@hhgtech/hhg-components 1.25.13 → 1.25.15

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 (293) hide show
  1. package/build/babyGrowth.js +2 -2
  2. package/build/cache.js +1 -1
  3. package/build/care.js +1 -1
  4. package/build/components/vaccination/index.d.ts +1 -1
  5. package/build/components/vaccination/vaccineCard/badge.d.ts +8 -0
  6. package/build/components/vaccination/vaccineCard/index.d.ts +22 -6
  7. package/build/components/vaccination/vaccineCard/modal.d.ts +3 -0
  8. package/build/components/vaccination/vaccineCard/status.d.ts +1 -1
  9. package/build/components/vaccination/vaccineCard/timeline.d.ts +3 -0
  10. package/build/components.js +1 -1
  11. package/build/constants.js +1 -1
  12. package/build/core-15d6dbb4.js +1 -0
  13. package/build/{dataTransform-e3ac854d.js → dataTransform-7fc7f4f8.js} +1 -1
  14. package/build/ecom.js +1 -1
  15. package/build/esm/babyGrowth.js +2 -2
  16. package/build/esm/cache.js +1 -1
  17. package/build/esm/care.js +1 -1
  18. package/build/esm/components.js +1 -1
  19. package/build/esm/constants.js +1 -1
  20. package/build/esm/core-1eab176f.js +1 -0
  21. package/build/esm/{dataTransform-16786588.js → dataTransform-64a13114.js} +1 -1
  22. package/build/esm/ecom.js +1 -1
  23. package/build/esm/footer.js +1 -1
  24. package/build/esm/gAssets.js +1 -1
  25. package/build/esm/getDynamicHealthTool-56a311b0.js +1 -0
  26. package/build/esm/{getSocialList-cb4c5aaa.js → getSocialList-71178ab1.js} +1 -1
  27. package/build/esm/hooks.js +1 -1
  28. package/build/esm/i18n.js +1 -1
  29. package/build/esm/{index-5035344d.js → index-0c003cc8.js} +1 -1
  30. package/build/esm/{index-f72a5db6.js → index-1a0b2606.js} +1 -1
  31. package/build/esm/index-1a6781ec.js +1 -0
  32. package/build/esm/{index-a378903a.js → index-3bd73d7d.js} +1 -1
  33. package/build/esm/index-413fdc77.js +1 -0
  34. package/build/esm/{index-4b3834b0.js → index-41820b9b.js} +1 -1
  35. package/build/esm/{index-1de8b14c.js → index-4af154ad.js} +1 -1
  36. package/build/esm/{index-615defe2.js → index-4f201bd7.js} +1 -1
  37. package/build/esm/{index-5bdb24f3.js → index-5c97d404.js} +1 -1
  38. package/build/esm/{index-de075a29.js → index-63efd893.js} +1 -1
  39. package/build/esm/{index-6569f80d.js → index-6cdb2b0b.js} +1 -1
  40. package/build/esm/{index-fb849e99.js → index-6f3880bd.js} +1 -1
  41. package/build/esm/index-73f56d42.js +1 -0
  42. package/build/esm/{index-e1a2e7b1.js → index-a3ee57ef.js} +1 -1
  43. package/build/esm/{index-1483611b.js → index-a5f1692a.js} +1 -1
  44. package/build/esm/{index-f0f59b4a.js → index-ac9888af.js} +1 -1
  45. package/build/esm/{index-d3cc6f8a.js → index-ade91020.js} +1 -1
  46. package/build/esm/{index-74bd30cc.js → index-d25e4ea9.js} +1 -1
  47. package/build/esm/index-d8bbe3c3.js +1 -0
  48. package/build/esm/{index-a25dbc33.js → index-df92f1fe.js} +1 -1
  49. package/build/esm/{index-1ade8351.js → index-e259b1f3.js} +1 -1
  50. package/build/esm/{index-a49e0bc1.js → index-f0daa1f1.js} +1 -1
  51. package/build/esm/index-fc3ca38e.js +1 -0
  52. package/build/esm/{index-076075d1.js → index-ff727949.js} +1 -1
  53. package/build/esm/index.js +1 -1
  54. package/build/esm/{index.styled-e704c9c2.js → index.styled-472c3814.js} +1 -1
  55. package/build/esm/{index.styled-928161bc.js → index.styled-5a0b52e8.js} +1 -1
  56. package/build/esm/{index.styled-e0eda731.js → index.styled-5dcc0941.js} +5 -5
  57. package/build/esm/{index.styled-8a3ed141.js → index.styled-78fde46a.js} +1 -1
  58. package/build/esm/{index.styled-1a0e35c1.js → index.styled-e6aaa693.js} +5 -5
  59. package/build/esm/{index.styled-0591673c.js → index.styled-ed037548.js} +1 -1
  60. package/build/esm/{index.styled-79d4b1a1.js → index.styled-ffad8868.js} +1 -1
  61. package/build/esm/{index.styles-e4b8b655.js → index.styles-768e9218.js} +2 -2
  62. package/build/esm/lead.js +1 -1
  63. package/build/esm/mantine.js +1 -1
  64. package/build/esm/misc.js +1 -1
  65. package/build/esm/navigation.js +1 -1
  66. package/build/esm/onboarding.js +1 -1
  67. package/build/esm/pwg.js +5 -5
  68. package/build/esm/{routing-de7d22cc.js → routing-2f9c1504.js} +1 -1
  69. package/build/esm/{screenSizeContext-39b53f94.js → screenSizeContext-af9362cd.js} +1 -1
  70. package/build/esm/together.js +1 -1
  71. package/build/esm/translationsContext-48c3884a.js +1 -0
  72. package/build/esm/translationsProvider-c0a74d2c.js +1 -0
  73. package/build/esm/{types-b2e85f6d.js → types-0c430fa1.js} +37 -37
  74. package/build/esm/{types-d9736596.js → types-adf4dd67.js} +17 -17
  75. package/build/esm/types.js +1 -1
  76. package/build/esm/useHealthToolCache-8c9f2f1a.js +1 -0
  77. package/build/esm/useRafState-1e78f920.js +1 -0
  78. package/build/esm/{useScreenSize-b94df01a.js → useScreenSize-c26c3d21.js} +1 -1
  79. package/build/esm/useTranslations-bd79fd17.js +1 -0
  80. package/build/esm/vaccination.js +35 -36
  81. package/build/footer.js +1 -1
  82. package/build/gAssets.js +1 -1
  83. package/build/{getDynamicHealthTool-2053d8df.js → getDynamicHealthTool-a49169db.js} +1 -1
  84. package/build/{getSocialList-03cb4a3e.js → getSocialList-4e4a3ef2.js} +1 -1
  85. package/build/hooks.js +1 -1
  86. package/build/i18n.js +1 -1
  87. package/build/{index-db3cb96a.js → index-002b40f9.js} +1 -1
  88. package/build/index-08fda072.js +1 -0
  89. package/build/{index-a7753ada.js → index-09692d7b.js} +1 -1
  90. package/build/index-16cf3b44.js +1 -0
  91. package/build/{index-d46d3f74.js → index-34e04f7b.js} +1 -1
  92. package/build/{index-29ecde16.js → index-3a453df3.js} +1 -1
  93. package/build/index-5c435c33.js +1 -0
  94. package/build/{index-4b9eb395.js → index-68f95b11.js} +1 -1
  95. package/build/{index-ca950658.js → index-78cb9fcb.js} +1 -1
  96. package/build/{index-7fdf24f5.js → index-8a813eea.js} +1 -1
  97. package/build/index-930f861f.js +1 -0
  98. package/build/{index-a4080a76.js → index-9beffe38.js} +1 -1
  99. package/build/{index-fb77943d.js → index-9d121cc5.js} +1 -1
  100. package/build/{index-34bc07b1.js → index-9ebe6d4b.js} +1 -1
  101. package/build/{index-a66f989d.js → index-a296a7fb.js} +1 -1
  102. package/build/{index-576b1b49.js → index-b1cacbe8.js} +1 -1
  103. package/build/index-babb9ffe.js +1 -0
  104. package/build/{index-b52d2827.js → index-c0b889fc.js} +1 -1
  105. package/build/{index-6d6b23a9.js → index-d1ddd89d.js} +1 -1
  106. package/build/index-d24b3875.js +1 -0
  107. package/build/{index-7cd1e3e5.js → index-ef43fe5c.js} +1 -1
  108. package/build/index-f2cc07a7.js +1 -0
  109. package/build/{index-c8205d33.js → index-f82b1cd8.js} +1 -1
  110. package/build/{index-474541c5.js → index-fdad797c.js} +1 -1
  111. package/build/index.js +1 -1
  112. package/build/{index.styled-1a35bf76.js → index.styled-3217e49c.js} +1 -1
  113. package/build/{index.styled-5e870fd9.js → index.styled-4623581b.js} +1 -1
  114. package/build/{index.styled-79c7a9cf.js → index.styled-4a34e78e.js} +1 -1
  115. package/build/{index.styled-98b6398e.js → index.styled-9a7057f6.js} +1 -1
  116. package/build/{index.styled-56c150e6.js → index.styled-a2fb0429.js} +4 -4
  117. package/build/{index.styled-bafd301f.js → index.styled-d0c80701.js} +5 -5
  118. package/build/{index.styled-870edf20.js → index.styled-f7e3c138.js} +1 -1
  119. package/build/{index.styles-34e70fee.js → index.styles-1fe11b9d.js} +4 -4
  120. package/build/interfaces/types/BabyGrowth.d.ts +1 -1
  121. package/build/lead.js +1 -1
  122. package/build/mantine.js +1 -1
  123. package/build/misc.js +1 -1
  124. package/build/navigation.js +1 -1
  125. package/build/onboarding.js +1 -1
  126. package/build/pwg.js +3 -3
  127. package/build/{routing-067a6ade.js → routing-4363eb70.js} +1 -1
  128. package/build/{screenSizeContext-e8b44907.js → screenSizeContext-6a014fcc.js} +3 -3
  129. package/build/together.js +1 -1
  130. package/build/translationsContext-68aba793.js +1 -0
  131. package/build/translationsProvider-1916d603.js +1 -0
  132. package/build/{types-581af155.js → types-a851cae8.js} +3 -3
  133. package/build/{types-1923fa69.js → types-fe35af36.js} +1 -1
  134. package/build/types.js +1 -1
  135. package/build/{useHealthToolCache-60b6bb5f.js → useHealthToolCache-4432de1e.js} +1 -1
  136. package/build/{useRafState-821efca4.js → useRafState-49db8e4b.js} +1 -1
  137. package/build/{useScreenSize-78826de5.js → useScreenSize-af1b39f4.js} +1 -1
  138. package/build/useTranslations-af68c257.js +1 -0
  139. package/build/vaccination.js +37 -38
  140. package/package.json +1 -1
  141. package/build/core-614e2f77.js +0 -1
  142. package/build/esm/core-e66477d9.js +0 -1
  143. package/build/esm/getDynamicHealthTool-85101b39.js +0 -1
  144. package/build/esm/index-07863aa4.js +0 -1
  145. package/build/esm/index-2b95d543.js +0 -1
  146. package/build/esm/index-52d9bc33.js +0 -1
  147. package/build/esm/index-66e178df.js +0 -1
  148. package/build/esm/index-dd8c9b9d.js +0 -1
  149. package/build/esm/translationsContext-3047aefe.js +0 -1
  150. package/build/esm/translationsProvider-f4d03925.js +0 -1
  151. package/build/esm/useHealthToolCache-98a806f6.js +0 -1
  152. package/build/esm/useRafState-9ec6ad3e.js +0 -1
  153. package/build/esm/useTranslations-05394aed.js +0 -1
  154. package/build/index-0d34e8a1.js +0 -1
  155. package/build/index-141d4714.js +0 -1
  156. package/build/index-512c3ad7.js +0 -1
  157. package/build/index-52f77ebf.js +0 -1
  158. package/build/index-e1695d28.js +0 -1
  159. package/build/index-f9663d42.js +0 -1
  160. package/build/index-faed6f8b.js +0 -1
  161. package/build/translationsContext-b8ff5f27.js +0 -1
  162. package/build/translationsProvider-7e36d683.js +0 -1
  163. package/build/useTranslations-d015548a.js +0 -1
  164. /package/build/{BMI_BOYS.percentile.monthly-c21ab4e7.js → BMI_BOYS.percentile.monthly-52bdb5b6.js} +0 -0
  165. /package/build/{BMI_BOYS.percentile.weekly-54e43011.js → BMI_BOYS.percentile.weekly-692f95ef.js} +0 -0
  166. /package/build/{BMI_BOYS.percentile.yearly-d301bc7d.js → BMI_BOYS.percentile.yearly-73e6975b.js} +0 -0
  167. /package/build/{BMI_BOYS.zscore.monthly-674a2873.js → BMI_BOYS.zscore.monthly-9bf688f2.js} +0 -0
  168. /package/build/{BMI_BOYS.zscore.weekly-56cadf20.js → BMI_BOYS.zscore.weekly-80f4d06d.js} +0 -0
  169. /package/build/{BMI_BOYS.zscore.yearly-8ba5d0b6.js → BMI_BOYS.zscore.yearly-ac44a51f.js} +0 -0
  170. /package/build/{BMI_GIRLS.percentile.monthly-fa093909.js → BMI_GIRLS.percentile.monthly-8841dc67.js} +0 -0
  171. /package/build/{BMI_GIRLS.percentile.weekly-1457a72d.js → BMI_GIRLS.percentile.weekly-01fc58a2.js} +0 -0
  172. /package/build/{BMI_GIRLS.percentile.yearly-10f0379c.js → BMI_GIRLS.percentile.yearly-08054791.js} +0 -0
  173. /package/build/{BMI_GIRLS.zscore.monthly-f26d3e1c.js → BMI_GIRLS.zscore.monthly-9795bef4.js} +0 -0
  174. /package/build/{BMI_GIRLS.zscore.weekly-3305efa7.js → BMI_GIRLS.zscore.weekly-a9feb4b3.js} +0 -0
  175. /package/build/{BMI_GIRLS.zscore.yearly-ac090337.js → BMI_GIRLS.zscore.yearly-8c7147bc.js} +0 -0
  176. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-c49a1936.js → HEAD CIRCUM_BOYS.percentile.monthly-212d141a.js} +0 -0
  177. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-ae07f03c.js → HEAD CIRCUM_BOYS.percentile.weekly-7c4ab599.js} +0 -0
  178. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-a2951f49.js → HEAD CIRCUM_BOYS.percentile.yearly-e4e0d5fa.js} +0 -0
  179. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-e8abd1cc.js → HEAD CIRCUM_BOYS.zscore.monthly-98378430.js} +0 -0
  180. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-aa341562.js → HEAD CIRCUM_BOYS.zscore.weekly-137773fc.js} +0 -0
  181. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-024b8166.js → HEAD CIRCUM_BOYS.zscore.yearly-09437073.js} +0 -0
  182. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-a8b1b844.js → HEAD CIRCUM_GIRLS.percentile.monthly-2259ef21.js} +0 -0
  183. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-ffbd79f7.js → HEAD CIRCUM_GIRLS.percentile.weekly-f5e0af33.js} +0 -0
  184. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-06ac8442.js → HEAD CIRCUM_GIRLS.percentile.yearly-82bfea57.js} +0 -0
  185. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-5b6bd0b7.js → HEAD CIRCUM_GIRLS.zscore.monthly-f25dd19b.js} +0 -0
  186. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-775b70e3.js → HEAD CIRCUM_GIRLS.zscore.weekly-155b7f6f.js} +0 -0
  187. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-df637a7a.js → HEAD CIRCUM_GIRLS.zscore.yearly-f6413a01.js} +0 -0
  188. /package/build/{HEIGHT_BOYS.percentile.monthly-9322f25f.js → HEIGHT_BOYS.percentile.monthly-0c5f0ddb.js} +0 -0
  189. /package/build/{HEIGHT_BOYS.percentile.weekly-68fe2920.js → HEIGHT_BOYS.percentile.weekly-6f74512b.js} +0 -0
  190. /package/build/{HEIGHT_BOYS.percentile.yearly-ac4ddd09.js → HEIGHT_BOYS.percentile.yearly-4248fe83.js} +0 -0
  191. /package/build/{HEIGHT_BOYS.zscore.monthly-09374a06.js → HEIGHT_BOYS.zscore.monthly-ab4a39f8.js} +0 -0
  192. /package/build/{HEIGHT_BOYS.zscore.weekly-437ce7f4.js → HEIGHT_BOYS.zscore.weekly-80248f03.js} +0 -0
  193. /package/build/{HEIGHT_BOYS.zscore.yearly-c3862bb3.js → HEIGHT_BOYS.zscore.yearly-a80fe16a.js} +0 -0
  194. /package/build/{HEIGHT_GIRLS.percentile.monthly-696207df.js → HEIGHT_GIRLS.percentile.monthly-7dada1f6.js} +0 -0
  195. /package/build/{HEIGHT_GIRLS.percentile.weekly-90812d8a.js → HEIGHT_GIRLS.percentile.weekly-3e7b2c2d.js} +0 -0
  196. /package/build/{HEIGHT_GIRLS.percentile.yearly-eb882825.js → HEIGHT_GIRLS.percentile.yearly-40faca9e.js} +0 -0
  197. /package/build/{HEIGHT_GIRLS.zscore.monthly-9ba3352d.js → HEIGHT_GIRLS.zscore.monthly-3f1a9ad1.js} +0 -0
  198. /package/build/{HEIGHT_GIRLS.zscore.weekly-acfbdf56.js → HEIGHT_GIRLS.zscore.weekly-4fa9e6d1.js} +0 -0
  199. /package/build/{HEIGHT_GIRLS.zscore.yearly-11415049.js → HEIGHT_GIRLS.zscore.yearly-d3958d45.js} +0 -0
  200. /package/build/{Onboarding-e054f4d9.js → Onboarding-2251ffb7.js} +0 -0
  201. /package/build/{Visible-8dea7639.js → Visible-da084739.js} +0 -0
  202. /package/build/{WEIGHT_BOYS.percentile.monthly-c12f8eda.js → WEIGHT_BOYS.percentile.monthly-f0e58091.js} +0 -0
  203. /package/build/{WEIGHT_BOYS.percentile.weekly-35e9aa18.js → WEIGHT_BOYS.percentile.weekly-5bd4183f.js} +0 -0
  204. /package/build/{WEIGHT_BOYS.percentile.yearly-fd319c97.js → WEIGHT_BOYS.percentile.yearly-a03b6138.js} +0 -0
  205. /package/build/{WEIGHT_BOYS.zscore.monthly-3902903f.js → WEIGHT_BOYS.zscore.monthly-1600bdb1.js} +0 -0
  206. /package/build/{WEIGHT_BOYS.zscore.weekly-01e6cb64.js → WEIGHT_BOYS.zscore.weekly-3d5ec5c1.js} +0 -0
  207. /package/build/{WEIGHT_BOYS.zscore.yearly-372bfef7.js → WEIGHT_BOYS.zscore.yearly-187e0b5d.js} +0 -0
  208. /package/build/{WEIGHT_GIRLS.percentile.monthly-7baef373.js → WEIGHT_GIRLS.percentile.monthly-c5a619ab.js} +0 -0
  209. /package/build/{WEIGHT_GIRLS.percentile.weekly-fc207ee2.js → WEIGHT_GIRLS.percentile.weekly-458a941f.js} +0 -0
  210. /package/build/{WEIGHT_GIRLS.percentile.yearly-51694de6.js → WEIGHT_GIRLS.percentile.yearly-166588d9.js} +0 -0
  211. /package/build/{WEIGHT_GIRLS.zscore.monthly-78775917.js → WEIGHT_GIRLS.zscore.monthly-92cc4516.js} +0 -0
  212. /package/build/{WEIGHT_GIRLS.zscore.weekly-590d86c1.js → WEIGHT_GIRLS.zscore.weekly-42606d99.js} +0 -0
  213. /package/build/{WEIGHT_GIRLS.zscore.yearly-0b1aee67.js → WEIGHT_GIRLS.zscore.yearly-0b407297.js} +0 -0
  214. /package/build/{constants-a995c0a8.js → constants-e482dcd0.js} +0 -0
  215. /package/build/{cookieHelper-4c0699e8.js → cookieHelper-9d3a8ce7.js} +0 -0
  216. /package/build/{dataTransform-97817fbb.js → dataTransform-0f42143e.js} +0 -0
  217. /package/build/esm/{BMI_BOYS.percentile.monthly-f1e1d3b5.js → BMI_BOYS.percentile.monthly-018fb748.js} +0 -0
  218. /package/build/esm/{BMI_BOYS.percentile.weekly-3b0ca0c5.js → BMI_BOYS.percentile.weekly-158ca4a0.js} +0 -0
  219. /package/build/esm/{BMI_BOYS.percentile.yearly-4a9421ee.js → BMI_BOYS.percentile.yearly-d7462b31.js} +0 -0
  220. /package/build/esm/{BMI_BOYS.zscore.monthly-ea554997.js → BMI_BOYS.zscore.monthly-dc42c5af.js} +0 -0
  221. /package/build/esm/{BMI_BOYS.zscore.weekly-bbbe3d7d.js → BMI_BOYS.zscore.weekly-5b7b6774.js} +0 -0
  222. /package/build/esm/{BMI_BOYS.zscore.yearly-5fda22f0.js → BMI_BOYS.zscore.yearly-14f113b9.js} +0 -0
  223. /package/build/esm/{BMI_GIRLS.percentile.monthly-e71b5661.js → BMI_GIRLS.percentile.monthly-9a01de27.js} +0 -0
  224. /package/build/esm/{BMI_GIRLS.percentile.weekly-1b502f34.js → BMI_GIRLS.percentile.weekly-67f8eb46.js} +0 -0
  225. /package/build/esm/{BMI_GIRLS.percentile.yearly-608681cb.js → BMI_GIRLS.percentile.yearly-5e932edb.js} +0 -0
  226. /package/build/esm/{BMI_GIRLS.zscore.monthly-20ff66a5.js → BMI_GIRLS.zscore.monthly-a3b3b9c5.js} +0 -0
  227. /package/build/esm/{BMI_GIRLS.zscore.weekly-c42ea738.js → BMI_GIRLS.zscore.weekly-0f38584b.js} +0 -0
  228. /package/build/esm/{BMI_GIRLS.zscore.yearly-0d883cee.js → BMI_GIRLS.zscore.yearly-6cb09bfa.js} +0 -0
  229. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-2799f8e9.js → HEAD CIRCUM_BOYS.percentile.monthly-0e1b5b5a.js} +0 -0
  230. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-cce83b89.js → HEAD CIRCUM_BOYS.percentile.weekly-5f7acff5.js} +0 -0
  231. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-503928c8.js → HEAD CIRCUM_BOYS.percentile.yearly-06e96bb5.js} +0 -0
  232. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-fa90a20a.js → HEAD CIRCUM_BOYS.zscore.monthly-4f81932e.js} +0 -0
  233. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-68188877.js → HEAD CIRCUM_BOYS.zscore.weekly-70753114.js} +0 -0
  234. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-f7da476a.js → HEAD CIRCUM_BOYS.zscore.yearly-03234cd2.js} +0 -0
  235. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-ca3623ae.js → HEAD CIRCUM_GIRLS.percentile.monthly-2aa26afd.js} +0 -0
  236. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-8376ae03.js → HEAD CIRCUM_GIRLS.percentile.weekly-9e318ea9.js} +0 -0
  237. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-d61a8a17.js → HEAD CIRCUM_GIRLS.percentile.yearly-ba26d8e8.js} +0 -0
  238. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-e2f7a1fd.js → HEAD CIRCUM_GIRLS.zscore.monthly-51721ae1.js} +0 -0
  239. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-da7bd965.js → HEAD CIRCUM_GIRLS.zscore.weekly-94a072d3.js} +0 -0
  240. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-73eb9b26.js → HEAD CIRCUM_GIRLS.zscore.yearly-6831fb4b.js} +0 -0
  241. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-fb9334d2.js → HEIGHT_BOYS.percentile.monthly-a847bca0.js} +0 -0
  242. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-5450fff6.js → HEIGHT_BOYS.percentile.weekly-bd4268a1.js} +0 -0
  243. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-153ed3db.js → HEIGHT_BOYS.percentile.yearly-df04a105.js} +0 -0
  244. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-725fd478.js → HEIGHT_BOYS.zscore.monthly-fd377f83.js} +0 -0
  245. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-37d9671d.js → HEIGHT_BOYS.zscore.weekly-87dec6b2.js} +0 -0
  246. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-a4cda789.js → HEIGHT_BOYS.zscore.yearly-79047c71.js} +0 -0
  247. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-239c6c76.js → HEIGHT_GIRLS.percentile.monthly-2a77ffbd.js} +0 -0
  248. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-5c5ffb26.js → HEIGHT_GIRLS.percentile.weekly-ddaad36a.js} +0 -0
  249. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-ec2f550d.js → HEIGHT_GIRLS.percentile.yearly-8c686049.js} +0 -0
  250. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-2cae4b7d.js → HEIGHT_GIRLS.zscore.monthly-8646cedd.js} +0 -0
  251. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-3f98a2a6.js → HEIGHT_GIRLS.zscore.weekly-c1812273.js} +0 -0
  252. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-0b17679f.js → HEIGHT_GIRLS.zscore.yearly-90381ad5.js} +0 -0
  253. /package/build/esm/{Onboarding-c98a38a5.js → Onboarding-21d12043.js} +0 -0
  254. /package/build/esm/{Visible-05e82139.js → Visible-86c2551f.js} +0 -0
  255. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-9ebb8ff3.js → WEIGHT_BOYS.percentile.monthly-339e841d.js} +0 -0
  256. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-ae700539.js → WEIGHT_BOYS.percentile.weekly-d30bb0b2.js} +0 -0
  257. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-8cb0bfd3.js → WEIGHT_BOYS.percentile.yearly-c8c4f6dd.js} +0 -0
  258. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-6b0c853c.js → WEIGHT_BOYS.zscore.monthly-947539a1.js} +0 -0
  259. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-c2b8459e.js → WEIGHT_BOYS.zscore.weekly-e21d87f7.js} +0 -0
  260. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-de34e8c0.js → WEIGHT_BOYS.zscore.yearly-e463988f.js} +0 -0
  261. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-8b411335.js → WEIGHT_GIRLS.percentile.monthly-237c435f.js} +0 -0
  262. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-b5fe1bd5.js → WEIGHT_GIRLS.percentile.weekly-34fe9803.js} +0 -0
  263. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-c83c506f.js → WEIGHT_GIRLS.percentile.yearly-5cf7caeb.js} +0 -0
  264. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-6865a3d4.js → WEIGHT_GIRLS.zscore.monthly-1af8a00b.js} +0 -0
  265. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-7bafea31.js → WEIGHT_GIRLS.zscore.weekly-abbdde8b.js} +0 -0
  266. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-fc986ffa.js → WEIGHT_GIRLS.zscore.yearly-ebadaef2.js} +0 -0
  267. /package/build/esm/{constants-0a7fc9d0.js → constants-52026b77.js} +0 -0
  268. /package/build/esm/{cookieHelper-cbbc5ece.js → cookieHelper-f34ae4b5.js} +0 -0
  269. /package/build/esm/{dataTransform-31bebacd.js → dataTransform-b335f7e4.js} +0 -0
  270. /package/build/esm/{index-7e0d894b.js → index-53cacbee.js} +0 -0
  271. /package/build/esm/{isProduction-aa4c6da9.js → isProduction-020306cd.js} +0 -0
  272. /package/build/esm/{localizeNumberFormat-fe23d3f4.js → localizeNumberFormat-f7f187e4.js} +0 -0
  273. /package/build/esm/{normalizeLink-080b6cfd.js → normalizeLink-41635236.js} +0 -0
  274. /package/build/esm/{theme-5782e8f2.js → theme-1b26637c.js} +0 -0
  275. /package/build/esm/{tslib.es6-6fca6fae.js → tslib.es6-9315bdbc.js} +0 -0
  276. /package/build/esm/{types-34bf4318.js → types-769cb1aa.js} +0 -0
  277. /package/build/esm/{useIsInit-a1b79772.js → useIsInit-9c00e3c3.js} +0 -0
  278. /package/build/esm/{useOutsideClick-43dca545.js → useOutsideClick-daeee503.js} +0 -0
  279. /package/build/esm/{useScrollbarSize-421af70b.js → useScrollbarSize-f79355e7.js} +0 -0
  280. /package/build/esm/{useUniqueId-abc4f1de.js → useUniqueId-1bfdbec1.js} +0 -0
  281. /package/build/esm/{utils-9858d408.js → utils-5a3d6877.js} +0 -0
  282. /package/build/{index-3333cad5.js → index-5a9e198f.js} +0 -0
  283. /package/build/{isProduction-288da54b.js → isProduction-c94394ce.js} +0 -0
  284. /package/build/{localizeNumberFormat-2cce9921.js → localizeNumberFormat-1193ff6a.js} +0 -0
  285. /package/build/{normalizeLink-b4bfb7d0.js → normalizeLink-4c87bcbb.js} +0 -0
  286. /package/build/{theme-105367d6.js → theme-f245ffa1.js} +0 -0
  287. /package/build/{tslib.es6-fbaa8bbc.js → tslib.es6-02acb991.js} +0 -0
  288. /package/build/{types-2d9cc644.js → types-21e3e4dd.js} +0 -0
  289. /package/build/{useIsInit-c03bb9ff.js → useIsInit-7e589ec9.js} +0 -0
  290. /package/build/{useOutsideClick-98293ab8.js → useOutsideClick-11155e2f.js} +0 -0
  291. /package/build/{useScrollbarSize-4b4c2af0.js → useScrollbarSize-6c13599f.js} +0 -0
  292. /package/build/{useUniqueId-f3ff5a82.js → useUniqueId-56ce12d2.js} +0 -0
  293. /package/build/{utils-c8d455a9.js → utils-b275a827.js} +0 -0
@@ -1,4 +1,4 @@
1
- import*as e from"react";import t,{useState as a,useEffect as r,forwardRef as n,Component as l,useRef as o,useCallback as i,useImperativeHandle as s}from"react";import{Image as c,createStyles as m,Textarea as h,Modal as d,Accordion as p,Indicator as g,Avatar as v,createEmotionCache as u,FileInput as f,NumberInput as z,PasswordInput as E,TextInput as b,Input as w,Checkbox as y,Slider as x,Radio as M,Flex as H}from"@mantine/core";import{CommonGAssets as j}from"./gAssets.js";import{DatePicker as k,DateRangePicker as C}from"@mantine/dates";import S,{css as O}from"styled-components";import $ from"dayjs";import"./screenSizeContext-39b53f94.js";import{t as P}from"./theme-5782e8f2.js";import{s as I}from"./index-74bd30cc.js";import{M as L}from"./utils-9858d408.js";import"./isProduction-aa4c6da9.js";import{L as A}from"./Onboarding-c98a38a5.js";import{_ as B,a as N}from"./tslib.es6-6fca6fae.js";import{useDebouncedValue as T}from"@mantine/hooks";import{Carousel as D}from"@mantine/carousel";const W=S(k)`
1
+ import*as e from"react";import t,{useState as a,useEffect as r,forwardRef as n,Component as l,useRef as o,useCallback as i,useImperativeHandle as s}from"react";import{Image as c,createStyles as m,Textarea as h,Modal as d,Accordion as p,Indicator as g,Avatar as v,createEmotionCache as u,FileInput as f,NumberInput as z,PasswordInput as E,TextInput as b,Input as w,Checkbox as y,Slider as x,Radio as M,Flex as H}from"@mantine/core";import{CommonGAssets as j}from"./gAssets.js";import{DatePicker as k,DateRangePicker as C}from"@mantine/dates";import S,{css as O}from"styled-components";import $ from"dayjs";import"./screenSizeContext-af9362cd.js";import{t as P}from"./theme-1b26637c.js";import{s as I}from"./index-d25e4ea9.js";import{M as L}from"./utils-5a3d6877.js";import"./isProduction-020306cd.js";import{L as A}from"./Onboarding-21d12043.js";import{_ as B,a as N}from"./tslib.es6-9315bdbc.js";import{useDebouncedValue as T}from"@mantine/hooks";import{Carousel as D}from"@mantine/carousel";const W=S(k)`
2
2
  position: relative;
3
3
  ${e=>e.fullWidth&&O`
4
4
  .mantine-DatePicker-dropdown {
@@ -112,4 +112,4 @@ import*as e from"react";import t,{useState as a,useEffect as r,forwardRef as n,C
112
112
  Copyright (c) 2018 Jed Watson.
113
113
  Licensed under the MIT License (MIT), see
114
114
  http://jedwatson.github.io/classnames
115
- */}var Me=xe((function(e){!function(){var t={}.hasOwnProperty;function a(){for(var e=[],r=0;r<arguments.length;r++){var n=arguments[r];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var o=a.apply(null,n);o&&e.push(o)}}else if("object"===l){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var i in n)t.call(n,i)&&n[i]&&e.push(i)}}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):window.classNames=a}()}));function He(e,t=6){const a=new Array(t).fill("");if(e){const t=e.toString().split("");a.map(((e,r)=>{t[r]&&(a[r]=t[r]||"")}))}return a}function je(e){return e.join("")}var ke="_2iQs0sk",Ce="Ia6IojY";const Se=n(((e,a)=>{const{maxLength:r=1,placeholder:n,className:l}=e,o=B(e,["maxLength","placeholder","className"]);return t.createElement("input",Object.assign({maxLength:r,className:Me(Ce,"otpInput",l),placeholder:n,type:"number"},o,{ref:a}))})),Oe=n(((e,n)=>{const{valueLength:l=6,type:c="number",value:m,defaultValue:h,onChange:d,onBlur:p}=e,g=o(new Array(l).fill(null)),[v,u]=a(h||m),[f,z]=a(-1),[E,b]=a((()=>He(v,l))),w=i((()=>{if(-1===f)return;const e=g.current[f];if(e){e.value="";const t=E;t[f]="",b(t),u((()=>je(t))),null==d||d(je(t))}}),[f,d,E]),y=i((()=>{if(0===f)return;const e=g.current[f];e&&e.blur();const t=g.current[f-1];t&&t.focus()}),[f]),x=i((()=>{if(f===l-1)return;const e=g.current[f];e&&e.blur();const t=g.current[f+1];t&&t.focus()}),[f,l]),M=i((e=>{const t=e.target,a=t.value.toString().slice(0,1),r=g.current.findIndex((e=>e===t));if(-1!==r){const e=E;e[r]=a,b(e),u((()=>je(e))),null==d||d(je(e))}x()}),[x,d,E]),j=i((e=>{const t=e.target,a=g.current.findIndex((e=>e===t));"number"===c?t.select():t.setSelectionRange(0,t.value.length,"backward"),-1!==a&&z(a)}),[]),k=i((e=>{const t=He(e.clipboardData.getData("text/plain"),l),a=je(t);b(t),u(a),null==d||d(a)}),[d,c,l]),C=i((e=>{8===e.keyCode||"Backspace"===e.key?(e.preventDefault(),w(),y()):46===e.keyCode||"Delete"===e.key?(e.preventDefault(),w()):37===e.keyCode||"ArrowLeft"===e.key?(e.preventDefault(),y()):39===e.keyCode||"ArrowRight"===e.key?(e.preventDefault(),x()):32!==e.keyCode&&" "!==e.key&&"Spacebar"!==e.key&&"Space"!==e.key||e.preventDefault()}),[w,x,y]);return s(n,(()=>g.current[0]),[]),r((()=>{b((()=>He(m,l))),u(m)}),[l,m]),t.createElement(H,{justify:"center",columnGap:8,className:Me(ke,"otpContainer")},E.map(((e,a)=>t.createElement(Se,{ref:e=>{g.current[a]=e},key:""+a,value:e,type:c,onChange:M,onFocus:j,onKeyDown:C,onPaste:k,onBlur:p}))))})),$e=t=>e.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 8 5",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M4 5L0.535898 0.5L7.4641 0.5L4 5Z"})),Pe=t=>e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",id:"flag-icons-kh",viewBox:"0 0 640 480",width:"1em",height:"1em"},t),e.createElement("path",{fill:"#032ea1",d:"M0 0h640v480H0z"}),e.createElement("path",{fill:"#e00025",d:"M0 120h640v240H0z"}),e.createElement("g",{fill:"#fff",stroke:"#000",transform:"matrix(1.2 0 0 1.2 85.6 -522)"},e.createElement("g",{strokeLinejoin:"bevel"},e.createElement("path",{d:"M139 623.5h113.8v43.8H139z"}),e.createElement("path",{d:"M247 647.6h3.5v16.5H247zm-108-8.1h113.8v5H139zm0-7h113.8v4.6H139z"}),e.createElement("path",{strokeWidth:.9,d:"M139 625.7h113.8v4.3H139z"}),e.createElement("path",{d:"M169 647.6h3.6v16.5H169zm49 0h3.6v16.5H218zm-78 0h3.5v16.5H140zm7 0h3.5v16.5H147zm7.5 0h3.5v16.5h-3.5zm7.5 0h3.5v16.5H162zm62.8 0h3.6v16.5h-3.6zm7.5 0h3.6v16.5h-3.6zm7.5 0h3.6v16.5h-3.6z"}),e.createElement("path",{strokeLinejoin:"miter",d:"M94.5 669.5a9.3 9.3 0 0 0 4.4-5.3H292a9.3 9.3 0 0 0 4.4 5.3z"})),e.createElement("path",{d:"M193 556.8s-.1-4.1 2.3-4.2c2.3 0 2.2 4.2 2.2 4.2zm-12.5 54.5v-5.5c0-2.8-2.8-3-2.8-5 0 0-.4-3 .4-4.4 1.1 4 3 3.3 3 1.6 0-1.4-1-2.8-3.3-6.3-.8-1.1-.3-4.6.7-5.9.4 3 .9 4.5 2.2 4.5.8 0 1.4-.5 1.4-2 0-2-1.3-3-2-4.8a5 5 0 0 1 1.1-5.3c.5 3 .4 4.2 1.7 4.2 2.7-.9 0-4.8-.6-5.8-.6-1.1 1-3.4 1-3.4.8 2.7 1 2.9 2 2.6 1.2-.3 1-2-.4-3.4-.9-1-.8-2.3.2-3.3 1 1.9 2.2 1.8 2.3.6l-.8-4.4H204l-.9 4.3c-.2 1.2 1.4 1.5 2.4-.5 1 1 1.1 2.4.2 3.3-1.4 1.4-1.6 3.1-.4 3.4 1 .3 1.2 0 2-2.6 0 0 1.5 1.5 1 3.4-.6 1-3.3 5-.6 5.8 1.3 0 1.2-1.2 1.7-4.2a5 5 0 0 1 1 5.3c-.6 1.8-2 2.8-2 4.8 0 1.5.7 2 1.5 2 1.3 0 1.8-1.4 2.2-4.5 1 1.3 1.5 4.8.7 6-2.3 3.4-3.4 4.8-3.4 6.2 0 1.7 2 2.4 3-1.6.9 1.4.5 4.4.5 4.4 0 2-2.7 2.2-2.8 5v5.5zm7.2-46-.4-3.1h15.9l-.4 3.1zm1-3.2-.2-2.5H202l-.3 2.5zm2.3-2.6-.3-2.6h9l-.1 2.6zm33 110c-2-.7-5-2.9-5-5v-24.3l2.6-3.4H169l2.5 3.4v24.3c0 2.1-2 4.3-4 5z"}),e.createElement("path",{strokeLinejoin:"bevel",d:"M178.2 647.6h3.6v16.5h-3.6zm30.4 0h3.6v16.5h-3.6z"}),e.createElement("path",{d:"M168 609.2v27.6h54v-27.6a4.2 4.2 0 0 0-2.6 2.8v11.8h-48.7V612s-.6-2-2.8-2.8z"}),e.createElement("path",{d:"M214.6 669.5c-1.8-.7-5.6-2.9-5.6-5v-27.2c.4-1.5 2.4-2.4 3.7-3.4H177c1.7 1 3.6 1.7 4.3 3.4v27.2c0 2.1-3 4.3-4.8 5z"}),e.createElement("path",{d:"M219.4 634.2v-19.6h-4.9v-1.9h-38.8v2h-5v19.5zM207 669.5c-1.8-.7-4.3-2.9-4.3-5v-23.2l1.4-2.1h-17.7l1.5 2v23.3c0 2.1-2.6 4.3-4.3 5z"}),e.createElement("path",{d:"M190.7 639.2h9v30.3h-9z"}),e.createElement("path",{strokeLinejoin:"bevel",d:"M204.4 632.5c0-2 5.8-2.1 8.8-3.8h-36c3 1.7 8.7 1.8 8.7 3.8l1.2 3.9 15 .6z"}),e.createElement("path",{d:"M211.4 611.3c0-4.9.2-6.7 1.7-6.7V620c-3.7 1.4-6.3 6-6.3 6h-23.2s-2.6-4.6-6.3-6v-15.5c1.8 0 1.8 2 1.8 6.7zm1.7-2c0-5.6 4.9-6.2 4.9-6.2v5c-1.9-.1-2.8 1.6-2.8 4 0 2.5 1.5 2.5 1.5 2.5v14.2h-3.6z"}),e.createElement("path",{d:"M177.3 609.3c0-5.6-4.9-6.2-4.9-6.2v5c1.9-.1 2.8 1.6 2.8 4 0 2.5-1.5 2.5-1.5 2.5v14.2h3.6z"}),e.createElement("g",{fill:"none",strokeWidth:.8},e.createElement("path",{d:"M186.8 570.6H204m-19.2 5.4h21m-23 6.5h24.9m-27 7.9h29.5m-30.2 9h30.4"}),e.createElement("path",{strokeWidth:1,d:"M170.8 629h48.6m-33.2 0h18v6.6h-18z"})),e.createElement("path",{d:"M184 614.2c3 3.6 2.6 9.7 2.6 13.3H204c0-3.6-.4-9.7 2.6-13.3zm9.7-41-2.4-1.3v-3.5c1 .3 2 .4 2.2 2 .3-2.3 1-2.1 1.9-3 1 .9 1.5.7 1.9 3 0-1.6 1.2-1.7 2.1-2v3.5l-2.3 1.2z"}),e.createElement("path",{d:"m193.5 578.9-4-2.8V573c1.5.3 3 .5 3.2 2.2.4-2.5 1.3-3.7 2.7-4.7 1.3 1 2.2 2.2 2.7 4.7.1-1.7 1.7-1.9 3-2.2v3.2l-3.9 2.7z"}),e.createElement("path",{d:"m193.2 587.8-4.5-4v-4.7c1.6.4 3.4.6 3.6 3.1.5-3.5 1.5-5.4 3-6.8 1.6 1.4 2.6 3.3 3.2 6.8.2-2.5 2-2.7 3.6-3.1v4.7l-4.6 4zm8.4 5.3-4 5.7h-4.7l-4.1-5.7zm-15.2 9.5c2 1.1 2.8 3.4 3 7.6H201c.2-4.2 1-6.5 3-7.6z"}),e.createElement("path",{strokeLinejoin:"bevel",d:"M204.2 593v-5.6a5.2 5.2 0 0 0-3.8 3.3c0-2-2.5-6.3-5.2-8.5-2.7 2.4-5.3 6.4-5.2 8.4-.5-1.5-1.8-2.7-3.8-3.2v5.7z"}),e.createElement("path",{strokeLinejoin:"bevel",d:"M205 602.6V597c-2.1.6-3.5 1.7-4.1 3.3 0-2-2.7-6.3-5.7-8.5-3 2.5-5.8 6.4-5.7 8.5-.5-1.5-2-2.7-4.1-3.3v5.7z"}),e.createElement("path",{strokeLinejoin:"bevel",d:"M207.4 614.3v-6.6a9.6 9.6 0 0 0-5.1 3.8c0-3.5-4-9-7.1-10.7-3.2 1.8-7.1 7.4-7.1 10.7a9.7 9.7 0 0 0-5.2-3.8v6.6z"}),e.createElement("path",{strokeLinejoin:"bevel",d:"M206 629v-6.8c-2.4.9-3 3.1-3.8 4.7.3-6.9-3.8-14.2-7-16.1-3.2 1.9-7.4 9.4-7 16-.8-1.4-1.5-3.7-3.8-4.6v6.7z"}),e.createElement("path",{d:"M204.4 639.2v-6.8c-2.5.6-2.6 1.5-3.4 3 .3-4.1-2.6-8.8-5.8-10.6-3.2 1.8-6 6.5-5.8 10.6-.8-1.5-.9-2.4-3.4-3v6.8z"}),e.createElement("g",{id:"a"},e.createElement("path",{d:"M99 664.2v-20.4c-.7-2.6-3-5-4.6-5.4v-18l3.7 2 4.3 18.9v23z"}),e.createElement("path",{d:"M99 664.3v-20.5c-.7-2.6-3-5-4.6-5.4v-19.2c2.5 0 3.7 3.2 3.7 3.2l4.3 18.9v22.9z"}),e.createElement("path",{d:"M96.3 669.5c1.7-.7 4.2-2.9 4.2-5v-25.6l-1.2-2H143l-1.7 2v25.6a6 6 0 0 0 3.4 5z"}),e.createElement("path",{d:"M135.8 669.5c-1.7-.7-4.2-2.9-4.2-5v-24.3l3.6-3.4h-29.6l3.6 3.4v24.3c0 2.1-2.5 4.3-4.2 5z"}),e.createElement("path",{d:"M131.7 669.5c-1.7-.7-4.3-2.9-4.3-5v-22l2.4-3.3H111l2.4 3.3v22c0 2.1-2.5 4.3-4.3 5z"}),e.createElement("path",{d:"M116 639.2h8.9v30.4h-9z"}),e.createElement("path",{strokeLinejoin:"bevel",d:"M103.7 647.6h3.6v16.5h-3.6zm30.8 0h3.5v16.5h-3.6zm-33.9-27.8h4.4v17h-4.4zm0-3.2h4.3v3.2h-4.3zm35.6 6.9h6.1v13h-6.1z"}),e.createElement("path",{d:"M104.9 636.6v-29c1.2 0 1.4 4.3 4.2 4.3 1.5 0 1.4-1.8.5-3.2-.7-1.3-1.6-3-.4-6.3.9 2.5 3.1 3.3 2.7 1.8-.7-2.7-2.8-3.2-1.2-7.3.5 3.4 2.7 3.3 2.2 1.3-.6-2.3-1.9-3.3-.3-6.5.9 3.7 2 3.5 2 1.2 0-3.4 0-7 4.2-8.3 0 0 .3-3 1.9-3 1.5 0 1.8 3 1.8 3 4.3 1.3 4.2 5 4.2 8.3 0 2.3 1.1 2.5 2-1.2 1.6 3.2.3 4.2-.3 6.5-.5 2 1.7 2.1 2.2-1.3 1.6 4.1-.5 4.6-1.2 7.3-.4 1.5 1.8.7 2.7-1.8 1.2 3.3.3 5-.4 6.3-.8 1.4-1 3.2.5 3.2 2.8 0 3-4.2 4.2-4.2v28.9zM98 614.7v22.1h2.5v-22.1c-.9-.5-1.7-.5-2.5 0z"}),e.createElement("path",{d:"M98.2 629c3.1 1.6 6.2 3.5 7 7.8h-7zm43.2-6.6v14.4h2v-14.4c-.6-.3-1.5-.4-2 0z"}),e.createElement("path",{d:"M143.4 629c-3.1 1.5-6.2 3.3-7 7.7h7zm-20.6-33.7 1.8-1.5v-2c-.6 0-1 .3-1.5 1a5 5 0 0 0-2.5-3 5 5 0 0 0-2.6 2.9c-.5-.7-.8-.8-1.5-1v2l1.8 1.6z"}),e.createElement("path",{d:"m123.8 600.2.8-1.9v-2.5c-.6 0-1 .3-1.5 1a5 5 0 0 0-2.5-3 5 5 0 0 0-2.6 2.9c-.5-.7-.8-.8-1.5-.9v2.5l.8 1.9z"}),e.createElement("path",{d:"m124 606.8 2.6-3.3v-3.2c-1 0-1.5.5-2.2 1.6-.7-2.3-2-2.7-3.8-3.8-1.9 1-3.2 1.5-3.8 3.7-.8-1.1-1.3-1.4-2.3-1.5v3.2l2.7 3.3z"}),e.createElement("path",{d:"M124.7 613.3s3.2-2.7 3.3-4.2v-3.5c-1.2.1-2.3.4-3.2 1.9-.8-2.9-2-3.7-4.2-5-2.3 1.3-3.5 2.1-4.2 5-1-1.5-2-1.8-3.3-2v3.6a15 15 0 0 0 3.3 4.2z"}),e.createElement("path",{d:"M126 625.3s4.4-4.7 4.5-6.6v-5.4c-1.6.2-3.2 1.3-4.4 3.6-1-4.5-2.6-7.6-5.5-9.8-3 2.2-4.6 5.3-5.6 9.8-1.2-2.3-2.7-3.4-4.3-3.6v5.4c.3 1.9 4.4 6.6 4.4 6.6z"}),e.createElement("path",{d:"M126 632.4s3.7-3.7 4.5-5.3v-5.4c-1.6.2-3.2 1.3-4.4 3.5a14 14 0 0 0-5.5-9.2c-3 2.2-4.6 4.7-5.6 9.2-1.2-2.2-2.7-3.3-4.3-3.5v5.4c1 1.6 4.4 5.3 4.4 5.3z"}),e.createElement("path",{d:"M127.5 636.6c-1-4.7-2-8.2-7.1-11.7-5.2 3.5-6.1 7-7.2 11.7z"}),e.createElement("path",{d:"M130.2 639.2v-6.8c-2.4 1-4.5 2.3-5.3 3.8-.8-3.8-2.5-5.4-4.6-7.7-2.1 2.3-3.5 4-4.4 7.7-.8-1.5-2.9-2.9-5.2-3.8v6.8z"})),e.createElement("use",{xlinkHref:"#a",width:"100%",height:"100%",transform:"matrix(-1 0 0 1 390.7 0)"}),e.createElement("path",{d:"M72.7 694.3H318v12.5H72.7zm-6.5 12.5h258.3v12.5H66.2zm19.4-31.3H305v8.1H85.6z"}),e.createElement("path",{d:"M79.2 683.6h232.4v10.6H79.2zm10.2-14.3h212v6.2h-212z"}),e.createElement("path",{d:"M112.4 669.3h16v50h-16z"}),e.createElement("path",{d:"M116 669.3h8.9v50h-9zm71 0h16v50h-16z"}),e.createElement("path",{d:"M190.7 669.3h9v50h-9zm71.5 0h16v50h-16z"}),e.createElement("path",{d:"M265.7 669.3h9v50h-9z"}),e.createElement("path",{fill:"none",d:"M99 664.2h193M115.8 713h9.2m-9.2-6.3h9.2m-9.2-6.2h9.2m-9.2-6.3h9.2m-9.2-6.2h9.2m-9.2-6.3h9.2m-9.2-6.2h9.2m65.8 37.5h8.6m-8.6-6.3h8.6m-8.6-6.2h8.6m-8.6-6.3h8.6m-8.6-6.2h8.6m-8.6-6.3h8.6m-8.6-6.2h8.6m66.2 37.5h9.2m-9.2-6.3h9.2m-9.2-6.2h9.2m-9.2-6.3h9.2m-9.2-6.2h9.2m-9.2-6.3h9.2m-9.2-6.2h9.2"}))),Ie=t=>e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",id:"flag-icons-in",viewBox:"0 0 640 480",width:"1em",height:"1em"},t),e.createElement("path",{fill:"#f93",d:"M0 0h640v160H0z"}),e.createElement("path",{fill:"#fff",d:"M0 160h640v160H0z"}),e.createElement("path",{fill:"#128807",d:"M0 320h640v160H0z"}),e.createElement("g",{transform:"matrix(3.2 0 0 3.2 320 240)"},e.createElement("circle",{r:20,fill:"#008"}),e.createElement("circle",{r:17.5,fill:"#fff"}),e.createElement("circle",{r:3.5,fill:"#008"}),e.createElement("g",{id:"d"},e.createElement("g",{id:"c"},e.createElement("g",{id:"b"},e.createElement("g",{id:"a",fill:"#008"},e.createElement("circle",{r:.9,transform:"rotate(7.5 -8.8 133.5)"}),e.createElement("path",{d:"M0 17.5.6 7 0 2l-.6 5L0 17.5z"})),e.createElement("use",{xlinkHref:"#a",width:"100%",height:"100%",transform:"rotate(15)"})),e.createElement("use",{xlinkHref:"#b",width:"100%",height:"100%",transform:"rotate(30)"})),e.createElement("use",{xlinkHref:"#c",width:"100%",height:"100%",transform:"rotate(60)"})),e.createElement("use",{xlinkHref:"#d",width:"100%",height:"100%",transform:"rotate(120)"}),e.createElement("use",{xlinkHref:"#d",width:"100%",height:"100%",transform:"rotate(-120)"}))),Le=t=>e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",id:"flag-icons-id",viewBox:"0 0 640 480",width:"1em",height:"1em"},t),e.createElement("g",{fillRule:"evenodd",strokeWidth:"1pt"},e.createElement("path",{fill:"#e70011",d:"M0 0h640v249H0z"}),e.createElement("path",{fill:"#fff",d:"M0 240h640v240H0z"}))),Ae=t=>e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",id:"flag-icons-my",viewBox:"0 0 640 480",width:"1em",height:"1em"},t),e.createElement("path",{fill:"#c00",d:"M0 0h640v480H0z"}),e.createElement("path",{fill:"#fff",d:"M.5 39.9h639v38.4H.5zM.5 118.6h639V157H.5zM.5 197.4h639v38.4H.5z"}),e.createElement("path",{fill:"#006",d:"M0 .5h320v280H0Z"}),e.createElement("path",{fill:"#fc0",d:"m207.5 73.8 6 40.7 23-34-12.4 39.2 35.5-20.8-28.1 30 41-3.2-38.3 14.8 38.3 14.8-41-3.2 28.1 30-35.5-20.8 12.3 39.3-23-34.1-6 40.7-5.9-40.7-23 34 12.4-39.2-35.5 20.8 28-30-41 3.2 38.4-14.8-38.3-14.8 41 3.2-28.1-30 35.5 20.8-12.4-39.3 23 34.1zm-33.3 1.7a71.1 71.1 0 1 0 0 130 80 80 0 1 1 0-130z"}),e.createElement("path",{fill:"#fff",d:"M.5 276.2h639v38.4H.5zM.5 354.4h639v38.4H.5zM0 441.6h639V480H0z"})),Be=t=>e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",id:"flag-icons-mm",viewBox:"0 0 640 480",width:"1em",height:"1em"},t),e.createElement("path",{fill:"#fecb00",d:"M0 0h640v480H0z"}),e.createElement("path",{fill:"#34b233",d:"M0 160h640v320H0z"}),e.createElement("path",{fill:"#ea2839",d:"M0 320h640v160H0z"}),e.createElement("g",{transform:"translate(320 256.9) scale(176.87999)"},e.createElement("path",{id:"a",fill:"#fff",d:"m0-1 .3 1h-.6z"}),e.createElement("use",{xlinkHref:"#a",width:"100%",height:"100%",transform:"rotate(-144)"}),e.createElement("use",{xlinkHref:"#a",width:"100%",height:"100%",transform:"rotate(-72)"}),e.createElement("use",{xlinkHref:"#a",width:"100%",height:"100%",transform:"rotate(72)"}),e.createElement("use",{xlinkHref:"#a",width:"100%",height:"100%",transform:"rotate(144)"}))),Ne=t=>e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",id:"flag-icons-ph",viewBox:"0 0 640 480",width:"1em",height:"1em"},t),e.createElement("path",{fill:"#0038a8",d:"M0 0h640v240H0z"}),e.createElement("path",{fill:"#ce1126",d:"M0 240h640v240H0z"}),e.createElement("path",{fill:"#fff",d:"M415.7 240 0 480V0"}),e.createElement("path",{fill:"#fcd116",d:"M26.7 42.4 41 55l16.6-9.2-7.4 17.5 14 13-19-1.6-8.1 17.2-4.3-18.5L14 71l16.3-10zm323.8 172.3.4 19 18 6.3-18 6.2-.4 19-11.5-15.1-18.2 5.5 10.8-15.6-10.8-15.6 18.2 5.5zM37.2 388.1l8 17.2 19-1.6-13.9 13 7.4 17.5-16.6-9.1-14.4 12.4 3.6-18.7L14 409l18.9-2.4zm114.2-249-6.2 6.2 3.1 47-3 .3-5.7-42.9-5.1 5 7.6 38.4a47.5 47.5 0 0 0-17.2 7.1l-21.7-32.4H96l26.4 34.3a48 48 0 0 0-2.4 2l-31.1-35.5h-8.8v8.8l35.4 31-2 2.5-34.3-26.3v7.1l32.5 21.7c-3.4 5.2-5.9 11-7.1 17.2L66.3 223l-5.1 5 42.9 5.7c-.2 1-.3 2.1-.3 3.1l-47-3-6.2 6.2 6.2 6.2 47-3.1.3 3.1-42.9 5.7 5 5 38.4-7.6a47.5 47.5 0 0 0 7.1 17.2l-32.5 21.7v7.2l34.3-26.3a48 48 0 0 0 2 2.4l-35.4 31v8.8H89l31-35.4 2.5 2L96 312.2h7.2l21.7-32.5c5.1 3.4 11 5.9 17.2 7.1l-7.6 38.4 5 5 5.7-42.9c1 .2 2 .3 3.1.3l-3 47 6.1 6.2 6.3-6.2-3.1-47 3-.3 5.7 43 5.1-5.1-7.6-38.4a47.5 47.5 0 0 0 17.2-7.1l21.7 32.5h7.2l-26.4-34.3a48 48 0 0 0 2.4-2l31.1 35.4h8.8v-8.8l-35.4-31 2-2.4 34.3 26.3v-7.2l-32.5-21.7c3.4-5.1 5.9-11 7.1-17.2l38.3 7.6 5.1-5-42.9-5.7c.2-1 .3-2 .3-3.1l47 3 6.2-6.1-6.2-6.2-47 3-.3-3 42.9-5.7-5-5-38.4 7.5a47.5 47.5 0 0 0-7.1-17.2l32.5-21.7v-7.1l-34.3 26.3a48 48 0 0 0-2-2.4l35.4-31v-8.9H214l-31 35.5a48 48 0 0 0-2.5-2l26.4-34.3h-7.2L178 200.2c-5.1-3.4-11-5.9-17.2-7.1l7.6-38.3-5-5-5.7 42.8-3.1-.3 3-47z"})),Te=t=>e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",id:"flag-icons-tw",viewBox:"0 0 640 480",width:"1em",height:"1em"},t),e.createElement("clipPath",{id:"a"},e.createElement("path",{d:"M0 0h640v480H0z"})),e.createElement("g",{clipPath:"url(#a)"},e.createElement("path",{fill:"red",d:"M0 0h720v480H0z"}),e.createElement("path",{fill:"#000095",d:"M0 0h360v240H0z"}),e.createElement("g",{fill:"#fff"},e.createElement("path",{d:"m154 126.9-2.5 9.6 9.4 2.6-1.8-7.1zm46.9 5.1-1.8 7.1 9.4-2.6-2.5-9.6zm-41.8-24-5.1 5.1 1.9 6.9z"}),e.createElement("path",{d:"m155.9 120-1.9 6.9 5.1 5.1z"}),e.createElement("path",{d:"m154 113.1-6.9 6.9 6.9 6.9 1.9-6.9zm14 27.8 5.1 5.1 6.9-1.9zm18.9 5.1 9.6 2.5 2.6-9.4-7.1 1.8z"}),e.createElement("path",{d:"m192 140.9 7.1-1.8 1.8-7.1zm-31.1-1.8 2.6 9.4 9.6-2.5-5.1-5.1zm19.1 5 6.9 1.9 5.1-5.1z"}),e.createElement("path",{d:"m173.1 146 6.9 6.9 6.9-6.9-6.9-1.9zm-12.2-45.1-9.4 2.6 2.5 9.6 5.1-5.1zm-1.8 31.1 1.8 7.1 7.1 1.8zm45-12 1.9-6.9-5.1-5.1z"}),e.createElement("path",{d:"m168 99.1-7.1 1.8-1.8 7.1zm32.9 8.9-1.8-7.1-7.1-1.8zm5.1 18.9 6.9-6.9-6.9-6.9-1.9 6.9z"}),e.createElement("path",{d:"m200.9 108-8.9-8.9-12-3.2-12 3.2-8.9 8.9-3.2 12 3.2 12 8.9 8.9 12 3.2 12-3.2 8.9-8.9 3.2-12z"}),e.createElement("path",{d:"m200.9 132 5.1-5.1-1.9-6.9zm5.1-18.9 2.5-9.6-9.4-2.6 1.8 7.1zm-6.9-12.2-2.6-9.4-9.6 2.5 5.1 5.1zm-26-6.9-9.6-2.5-2.6 9.4 7.1-1.8zm6.9 1.9-6.9-1.9-5.1 5.1z"}),e.createElement("path",{d:"m186.9 94-6.9-6.9-6.9 6.9 6.9 1.9z"}),e.createElement("path",{d:"m192 99.1-5.1-5.1-6.9 1.9zM173.1 146l-9.6 2.5 4.5 16.6 12-12.2zm-5.1 19.1 12 44.9 12-44.9-12-12.2zm-7.1-26-9.4-2.6-4.4 16.4 16.4-4.4z"}),e.createElement("path",{d:"m147.1 152.9-12 45.1 32.9-32.9-4.5-16.6zm-12-20.9L102 165.1l45.1-12.2 4.4-16.4z"}),e.createElement("path",{d:"m154 126.9-6.9-6.9-12 12 16.4 4.5zm0-13.8-2.5-9.6-16.4 4.5 12 12z"}),e.createElement("path",{d:"M135.1 108 90 120l45.1 12 12-12zm90 24-16.6 4.5 4.4 16.4 45.1 12.2z"}),e.createElement("path",{d:"m199.1 139.1-2.6 9.4 16.4 4.4-4.4-16.4zm-12.2 6.9-6.9 6.9 12 12.2 4.5-16.6zm19.1-19.1 2.5 9.6 16.6-4.5-12.2-12z"}),e.createElement("path",{d:"m192 165.1 33.1 32.9-12.2-45.1-16.4-4.4zm7.1-64.2 9.4 2.6 4.4-16.4-16.4 4.4z"}),e.createElement("path",{d:"M225.1 108 258 75.1l-45.1 12-4.4 16.4zm-12.2-20.9L225.1 42 192 75.1l4.5 16.4zm12.2 44.9 44.9-12-44.9-12-12.2 12z"}),e.createElement("path",{d:"m206 113.1 6.9 6.9 12.2-12-16.6-4.5zm-38-38L135.1 42l12 45.1 16.4 4.4z"}),e.createElement("path",{d:"m160.9 100.9 2.6-9.4-16.4-4.4 4.4 16.4z"}),e.createElement("path",{d:"m147.1 87.1-45.1-12 33.1 32.9 16.4-4.5zm39.8 6.9 9.6-2.5-4.5-16.4-12 12z"}),e.createElement("path",{d:"M192 75.1 180 30l-12 45.1 12 12z"}),e.createElement("path",{d:"m173.1 94 6.9-6.9-12-12-4.5 16.4z"})),e.createElement("circle",{cx:180,cy:120,r:51.1,fill:"#000095"}),e.createElement("circle",{cx:180,cy:120,r:45.1,fill:"#fff"}))),De=t=>e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",id:"flag-icons-th",viewBox:"0 0 640 480",width:"1em",height:"1em"},t),e.createElement("g",{fillRule:"evenodd"},e.createElement("path",{fill:"#f4f5f8",d:"M0 0h640v480H0z"}),e.createElement("path",{fill:"#2d2a4a",d:"M0 162.5h640v160H0z"}),e.createElement("path",{fill:"#a51931",d:"M0 0h640v82.5H0zm0 400h640v80H0z"}))),We=t=>e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",id:"flag-icons-vn",viewBox:"0 0 640 480",width:"1em",height:"1em"},t),e.createElement("defs",null,e.createElement("clipPath",{id:"a"},e.createElement("path",{fillOpacity:.7,d:"M-85.3 0h682.6v512H-85.3z"}))),e.createElement("g",{fillRule:"evenodd",clipPath:"url(#a)",transform:"translate(80) scale(.9375)"},e.createElement("path",{fill:"#da251d",d:"M-128 0h768v512h-768z"}),e.createElement("path",{fill:"#ff0",d:"M349.6 381 260 314.3l-89 67.3L204 272l-89-67.7 110.1-1 34.2-109.4L294 203l110.1.1-88.5 68.4 33.9 109.6z"}))),Ve=Object.values(I).reduce(((e,{phoneCountry:t})=>(e.includes(t)||e.push(t),e)),[]),Re={PH:Ne,KH:Pe,ID:Ie,IN:Le,MM:Be,MY:Ae,TH:De,TW:Te,VN:We};var Fe={phoneInput:"i-9Ibox",error:"YDWHh9b"};const Ge=n(((e,n)=>{const{isError:l,defaultCountry:o,countries:i=Ve,countryCallingCodeEditable:s=!1,defaultValue:c,value:m,onChange:h,className:d}=e,p=B(e,["isError","defaultCountry","countries","countryCallingCodeEditable","defaultValue","value","onChange","className"]),[g,v]=a(c||m),[u,f]=a(null);return r((()=>{v(m)}),[m]),r((()=>{N(void 0,void 0,void 0,(function*(){const e=yield import("react-phone-number-input");f(e)}))}),[]),u?t.createElement(u.default,Object.assign({ref:n,value:g,onChange:e=>{v(e),null==h||h(e)},countries:i,defaultCountry:o,countryCallingCodeEditable:s,className:Me(Fe.phoneInput,{isError:l,[Fe.error]:l},d),flagUrl:void 0,flagComponent:e=>{const{country:a,countryName:r,flagUrl:n}=e,l=B(e,["country","countryName","flagUrl"]),o=Re[a],i=a?`(+${u.getCountryCallingCode(a)})`:"";return o?t.createElement(t.Fragment,null,t.createElement(o,Object.assign({title:r},l)),t.createElement("span",{className:Me(Fe.callingCode,"PhoneInputCountryIconCallingCode")},i)):t.createElement(t.Fragment,null)},countrySelectProps:{arrowComponent:()=>t.createElement("div",{className:Me(Fe.arrowSelect,"PhoneInputArrowContainer")},t.createElement($e,null))}},p)):null}));var Ue=m(((e,t)=>({root:{color:t.color||("hb"===e.primaryColor?"hb.6":e.fn.primaryColor()),"&[data-event-category] > *":{pointerEvents:"none"}}})));export{U as A,$e as C,ee as D,be as G,Ie as I,Ae as M,ae as N,Oe as O,Ne as P,de as R,he as S,Te as T,We as V,Pe as a,Le as b,Be as c,De as d,oe as e,xe as f,ye as g,G as h,me as i,K as j,Ue as k,R as l,Ge as m,Z as n,X as o,pe as p,Ee as q,we as r,ve as s,q as t,Y as u,J as v,se as w,ce as x,te as y,F as z};
115
+ */}var Me=xe((function(e){!function(){var t={}.hasOwnProperty;function a(){for(var e=[],r=0;r<arguments.length;r++){var n=arguments[r];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var o=a.apply(null,n);o&&e.push(o)}}else if("object"===l){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var i in n)t.call(n,i)&&n[i]&&e.push(i)}}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):window.classNames=a}()}));function He(e,t=6){const a=new Array(t).fill("");if(e){const t=e.toString().split("");a.map(((e,r)=>{t[r]&&(a[r]=t[r]||"")}))}return a}function je(e){return e.join("")}var ke="_2iQs0sk",Ce="Ia6IojY";const Se=n(((e,a)=>{const{maxLength:r=1,placeholder:n,className:l}=e,o=B(e,["maxLength","placeholder","className"]);return t.createElement("input",Object.assign({maxLength:r,className:Me(Ce,"otpInput",l),placeholder:n,type:"number"},o,{ref:a}))})),Oe=n(((e,n)=>{const{valueLength:l=6,type:c="number",value:m,defaultValue:h,onChange:d,onBlur:p}=e,g=o(new Array(l).fill(null)),[v,u]=a(h||m),[f,z]=a(-1),[E,b]=a((()=>He(v,l))),w=i((()=>{if(-1===f)return;const e=g.current[f];if(e){e.value="";const t=E;t[f]="",b(t),u((()=>je(t))),null==d||d(je(t))}}),[f,d,E]),y=i((()=>{if(0===f)return;const e=g.current[f];e&&e.blur();const t=g.current[f-1];t&&t.focus()}),[f]),x=i((()=>{if(f===l-1)return;const e=g.current[f];e&&e.blur();const t=g.current[f+1];t&&t.focus()}),[f,l]),M=i((e=>{const t=e.target,a=t.value.toString().slice(0,1),r=g.current.findIndex((e=>e===t));if(-1!==r){const e=E;e[r]=a,b(e),u((()=>je(e))),null==d||d(je(e))}x()}),[x,d,E]),j=i((e=>{const t=e.target,a=g.current.findIndex((e=>e===t));"number"===c?t.select():t.setSelectionRange(0,t.value.length,"backward"),-1!==a&&z(a)}),[]),k=i((e=>{const t=He(e.clipboardData.getData("text/plain"),l),a=je(t);b(t),u(a),null==d||d(a)}),[d,c,l]),C=i((e=>{8===e.keyCode||"Backspace"===e.key?(e.preventDefault(),w(),y()):46===e.keyCode||"Delete"===e.key?(e.preventDefault(),w()):37===e.keyCode||"ArrowLeft"===e.key?(e.preventDefault(),y()):39===e.keyCode||"ArrowRight"===e.key?(e.preventDefault(),x()):32!==e.keyCode&&" "!==e.key&&"Spacebar"!==e.key&&"Space"!==e.key||e.preventDefault()}),[w,x,y]);return s(n,(()=>g.current[0]),[]),r((()=>{b((()=>He(m,l))),u(m)}),[l,m]),t.createElement(H,{justify:"center",columnGap:8,className:Me(ke,"otpContainer")},E.map(((e,a)=>t.createElement(Se,{ref:e=>{g.current[a]=e},key:""+a,value:e,type:c,onChange:M,onFocus:j,onKeyDown:C,onPaste:k,onBlur:p}))))})),$e=t=>e.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 8 5",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M4 5L0.535898 0.5L7.4641 0.5L4 5Z"})),Pe=t=>e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",id:"flag-icons-kh",viewBox:"0 0 640 480",width:"1em",height:"1em"},t),e.createElement("path",{fill:"#032ea1",d:"M0 0h640v480H0z"}),e.createElement("path",{fill:"#e00025",d:"M0 120h640v240H0z"}),e.createElement("g",{fill:"#fff",stroke:"#000",transform:"matrix(1.2 0 0 1.2 85.6 -522)"},e.createElement("g",{strokeLinejoin:"bevel"},e.createElement("path",{d:"M139 623.5h113.8v43.8H139z"}),e.createElement("path",{d:"M247 647.6h3.5v16.5H247zm-108-8.1h113.8v5H139zm0-7h113.8v4.6H139z"}),e.createElement("path",{strokeWidth:.9,d:"M139 625.7h113.8v4.3H139z"}),e.createElement("path",{d:"M169 647.6h3.6v16.5H169zm49 0h3.6v16.5H218zm-78 0h3.5v16.5H140zm7 0h3.5v16.5H147zm7.5 0h3.5v16.5h-3.5zm7.5 0h3.5v16.5H162zm62.8 0h3.6v16.5h-3.6zm7.5 0h3.6v16.5h-3.6zm7.5 0h3.6v16.5h-3.6z"}),e.createElement("path",{strokeLinejoin:"miter",d:"M94.5 669.5a9.3 9.3 0 0 0 4.4-5.3H292a9.3 9.3 0 0 0 4.4 5.3z"})),e.createElement("path",{d:"M193 556.8s-.1-4.1 2.3-4.2c2.3 0 2.2 4.2 2.2 4.2zm-12.5 54.5v-5.5c0-2.8-2.8-3-2.8-5 0 0-.4-3 .4-4.4 1.1 4 3 3.3 3 1.6 0-1.4-1-2.8-3.3-6.3-.8-1.1-.3-4.6.7-5.9.4 3 .9 4.5 2.2 4.5.8 0 1.4-.5 1.4-2 0-2-1.3-3-2-4.8a5 5 0 0 1 1.1-5.3c.5 3 .4 4.2 1.7 4.2 2.7-.9 0-4.8-.6-5.8-.6-1.1 1-3.4 1-3.4.8 2.7 1 2.9 2 2.6 1.2-.3 1-2-.4-3.4-.9-1-.8-2.3.2-3.3 1 1.9 2.2 1.8 2.3.6l-.8-4.4H204l-.9 4.3c-.2 1.2 1.4 1.5 2.4-.5 1 1 1.1 2.4.2 3.3-1.4 1.4-1.6 3.1-.4 3.4 1 .3 1.2 0 2-2.6 0 0 1.5 1.5 1 3.4-.6 1-3.3 5-.6 5.8 1.3 0 1.2-1.2 1.7-4.2a5 5 0 0 1 1 5.3c-.6 1.8-2 2.8-2 4.8 0 1.5.7 2 1.5 2 1.3 0 1.8-1.4 2.2-4.5 1 1.3 1.5 4.8.7 6-2.3 3.4-3.4 4.8-3.4 6.2 0 1.7 2 2.4 3-1.6.9 1.4.5 4.4.5 4.4 0 2-2.7 2.2-2.8 5v5.5zm7.2-46-.4-3.1h15.9l-.4 3.1zm1-3.2-.2-2.5H202l-.3 2.5zm2.3-2.6-.3-2.6h9l-.1 2.6zm33 110c-2-.7-5-2.9-5-5v-24.3l2.6-3.4H169l2.5 3.4v24.3c0 2.1-2 4.3-4 5z"}),e.createElement("path",{strokeLinejoin:"bevel",d:"M178.2 647.6h3.6v16.5h-3.6zm30.4 0h3.6v16.5h-3.6z"}),e.createElement("path",{d:"M168 609.2v27.6h54v-27.6a4.2 4.2 0 0 0-2.6 2.8v11.8h-48.7V612s-.6-2-2.8-2.8z"}),e.createElement("path",{d:"M214.6 669.5c-1.8-.7-5.6-2.9-5.6-5v-27.2c.4-1.5 2.4-2.4 3.7-3.4H177c1.7 1 3.6 1.7 4.3 3.4v27.2c0 2.1-3 4.3-4.8 5z"}),e.createElement("path",{d:"M219.4 634.2v-19.6h-4.9v-1.9h-38.8v2h-5v19.5zM207 669.5c-1.8-.7-4.3-2.9-4.3-5v-23.2l1.4-2.1h-17.7l1.5 2v23.3c0 2.1-2.6 4.3-4.3 5z"}),e.createElement("path",{d:"M190.7 639.2h9v30.3h-9z"}),e.createElement("path",{strokeLinejoin:"bevel",d:"M204.4 632.5c0-2 5.8-2.1 8.8-3.8h-36c3 1.7 8.7 1.8 8.7 3.8l1.2 3.9 15 .6z"}),e.createElement("path",{d:"M211.4 611.3c0-4.9.2-6.7 1.7-6.7V620c-3.7 1.4-6.3 6-6.3 6h-23.2s-2.6-4.6-6.3-6v-15.5c1.8 0 1.8 2 1.8 6.7zm1.7-2c0-5.6 4.9-6.2 4.9-6.2v5c-1.9-.1-2.8 1.6-2.8 4 0 2.5 1.5 2.5 1.5 2.5v14.2h-3.6z"}),e.createElement("path",{d:"M177.3 609.3c0-5.6-4.9-6.2-4.9-6.2v5c1.9-.1 2.8 1.6 2.8 4 0 2.5-1.5 2.5-1.5 2.5v14.2h3.6z"}),e.createElement("g",{fill:"none",strokeWidth:.8},e.createElement("path",{d:"M186.8 570.6H204m-19.2 5.4h21m-23 6.5h24.9m-27 7.9h29.5m-30.2 9h30.4"}),e.createElement("path",{strokeWidth:1,d:"M170.8 629h48.6m-33.2 0h18v6.6h-18z"})),e.createElement("path",{d:"M184 614.2c3 3.6 2.6 9.7 2.6 13.3H204c0-3.6-.4-9.7 2.6-13.3zm9.7-41-2.4-1.3v-3.5c1 .3 2 .4 2.2 2 .3-2.3 1-2.1 1.9-3 1 .9 1.5.7 1.9 3 0-1.6 1.2-1.7 2.1-2v3.5l-2.3 1.2z"}),e.createElement("path",{d:"m193.5 578.9-4-2.8V573c1.5.3 3 .5 3.2 2.2.4-2.5 1.3-3.7 2.7-4.7 1.3 1 2.2 2.2 2.7 4.7.1-1.7 1.7-1.9 3-2.2v3.2l-3.9 2.7z"}),e.createElement("path",{d:"m193.2 587.8-4.5-4v-4.7c1.6.4 3.4.6 3.6 3.1.5-3.5 1.5-5.4 3-6.8 1.6 1.4 2.6 3.3 3.2 6.8.2-2.5 2-2.7 3.6-3.1v4.7l-4.6 4zm8.4 5.3-4 5.7h-4.7l-4.1-5.7zm-15.2 9.5c2 1.1 2.8 3.4 3 7.6H201c.2-4.2 1-6.5 3-7.6z"}),e.createElement("path",{strokeLinejoin:"bevel",d:"M204.2 593v-5.6a5.2 5.2 0 0 0-3.8 3.3c0-2-2.5-6.3-5.2-8.5-2.7 2.4-5.3 6.4-5.2 8.4-.5-1.5-1.8-2.7-3.8-3.2v5.7z"}),e.createElement("path",{strokeLinejoin:"bevel",d:"M205 602.6V597c-2.1.6-3.5 1.7-4.1 3.3 0-2-2.7-6.3-5.7-8.5-3 2.5-5.8 6.4-5.7 8.5-.5-1.5-2-2.7-4.1-3.3v5.7z"}),e.createElement("path",{strokeLinejoin:"bevel",d:"M207.4 614.3v-6.6a9.6 9.6 0 0 0-5.1 3.8c0-3.5-4-9-7.1-10.7-3.2 1.8-7.1 7.4-7.1 10.7a9.7 9.7 0 0 0-5.2-3.8v6.6z"}),e.createElement("path",{strokeLinejoin:"bevel",d:"M206 629v-6.8c-2.4.9-3 3.1-3.8 4.7.3-6.9-3.8-14.2-7-16.1-3.2 1.9-7.4 9.4-7 16-.8-1.4-1.5-3.7-3.8-4.6v6.7z"}),e.createElement("path",{d:"M204.4 639.2v-6.8c-2.5.6-2.6 1.5-3.4 3 .3-4.1-2.6-8.8-5.8-10.6-3.2 1.8-6 6.5-5.8 10.6-.8-1.5-.9-2.4-3.4-3v6.8z"}),e.createElement("g",{id:"a"},e.createElement("path",{d:"M99 664.2v-20.4c-.7-2.6-3-5-4.6-5.4v-18l3.7 2 4.3 18.9v23z"}),e.createElement("path",{d:"M99 664.3v-20.5c-.7-2.6-3-5-4.6-5.4v-19.2c2.5 0 3.7 3.2 3.7 3.2l4.3 18.9v22.9z"}),e.createElement("path",{d:"M96.3 669.5c1.7-.7 4.2-2.9 4.2-5v-25.6l-1.2-2H143l-1.7 2v25.6a6 6 0 0 0 3.4 5z"}),e.createElement("path",{d:"M135.8 669.5c-1.7-.7-4.2-2.9-4.2-5v-24.3l3.6-3.4h-29.6l3.6 3.4v24.3c0 2.1-2.5 4.3-4.2 5z"}),e.createElement("path",{d:"M131.7 669.5c-1.7-.7-4.3-2.9-4.3-5v-22l2.4-3.3H111l2.4 3.3v22c0 2.1-2.5 4.3-4.3 5z"}),e.createElement("path",{d:"M116 639.2h8.9v30.4h-9z"}),e.createElement("path",{strokeLinejoin:"bevel",d:"M103.7 647.6h3.6v16.5h-3.6zm30.8 0h3.5v16.5h-3.6zm-33.9-27.8h4.4v17h-4.4zm0-3.2h4.3v3.2h-4.3zm35.6 6.9h6.1v13h-6.1z"}),e.createElement("path",{d:"M104.9 636.6v-29c1.2 0 1.4 4.3 4.2 4.3 1.5 0 1.4-1.8.5-3.2-.7-1.3-1.6-3-.4-6.3.9 2.5 3.1 3.3 2.7 1.8-.7-2.7-2.8-3.2-1.2-7.3.5 3.4 2.7 3.3 2.2 1.3-.6-2.3-1.9-3.3-.3-6.5.9 3.7 2 3.5 2 1.2 0-3.4 0-7 4.2-8.3 0 0 .3-3 1.9-3 1.5 0 1.8 3 1.8 3 4.3 1.3 4.2 5 4.2 8.3 0 2.3 1.1 2.5 2-1.2 1.6 3.2.3 4.2-.3 6.5-.5 2 1.7 2.1 2.2-1.3 1.6 4.1-.5 4.6-1.2 7.3-.4 1.5 1.8.7 2.7-1.8 1.2 3.3.3 5-.4 6.3-.8 1.4-1 3.2.5 3.2 2.8 0 3-4.2 4.2-4.2v28.9zM98 614.7v22.1h2.5v-22.1c-.9-.5-1.7-.5-2.5 0z"}),e.createElement("path",{d:"M98.2 629c3.1 1.6 6.2 3.5 7 7.8h-7zm43.2-6.6v14.4h2v-14.4c-.6-.3-1.5-.4-2 0z"}),e.createElement("path",{d:"M143.4 629c-3.1 1.5-6.2 3.3-7 7.7h7zm-20.6-33.7 1.8-1.5v-2c-.6 0-1 .3-1.5 1a5 5 0 0 0-2.5-3 5 5 0 0 0-2.6 2.9c-.5-.7-.8-.8-1.5-1v2l1.8 1.6z"}),e.createElement("path",{d:"m123.8 600.2.8-1.9v-2.5c-.6 0-1 .3-1.5 1a5 5 0 0 0-2.5-3 5 5 0 0 0-2.6 2.9c-.5-.7-.8-.8-1.5-.9v2.5l.8 1.9z"}),e.createElement("path",{d:"m124 606.8 2.6-3.3v-3.2c-1 0-1.5.5-2.2 1.6-.7-2.3-2-2.7-3.8-3.8-1.9 1-3.2 1.5-3.8 3.7-.8-1.1-1.3-1.4-2.3-1.5v3.2l2.7 3.3z"}),e.createElement("path",{d:"M124.7 613.3s3.2-2.7 3.3-4.2v-3.5c-1.2.1-2.3.4-3.2 1.9-.8-2.9-2-3.7-4.2-5-2.3 1.3-3.5 2.1-4.2 5-1-1.5-2-1.8-3.3-2v3.6a15 15 0 0 0 3.3 4.2z"}),e.createElement("path",{d:"M126 625.3s4.4-4.7 4.5-6.6v-5.4c-1.6.2-3.2 1.3-4.4 3.6-1-4.5-2.6-7.6-5.5-9.8-3 2.2-4.6 5.3-5.6 9.8-1.2-2.3-2.7-3.4-4.3-3.6v5.4c.3 1.9 4.4 6.6 4.4 6.6z"}),e.createElement("path",{d:"M126 632.4s3.7-3.7 4.5-5.3v-5.4c-1.6.2-3.2 1.3-4.4 3.5a14 14 0 0 0-5.5-9.2c-3 2.2-4.6 4.7-5.6 9.2-1.2-2.2-2.7-3.3-4.3-3.5v5.4c1 1.6 4.4 5.3 4.4 5.3z"}),e.createElement("path",{d:"M127.5 636.6c-1-4.7-2-8.2-7.1-11.7-5.2 3.5-6.1 7-7.2 11.7z"}),e.createElement("path",{d:"M130.2 639.2v-6.8c-2.4 1-4.5 2.3-5.3 3.8-.8-3.8-2.5-5.4-4.6-7.7-2.1 2.3-3.5 4-4.4 7.7-.8-1.5-2.9-2.9-5.2-3.8v6.8z"})),e.createElement("use",{xlinkHref:"#a",width:"100%",height:"100%",transform:"matrix(-1 0 0 1 390.7 0)"}),e.createElement("path",{d:"M72.7 694.3H318v12.5H72.7zm-6.5 12.5h258.3v12.5H66.2zm19.4-31.3H305v8.1H85.6z"}),e.createElement("path",{d:"M79.2 683.6h232.4v10.6H79.2zm10.2-14.3h212v6.2h-212z"}),e.createElement("path",{d:"M112.4 669.3h16v50h-16z"}),e.createElement("path",{d:"M116 669.3h8.9v50h-9zm71 0h16v50h-16z"}),e.createElement("path",{d:"M190.7 669.3h9v50h-9zm71.5 0h16v50h-16z"}),e.createElement("path",{d:"M265.7 669.3h9v50h-9z"}),e.createElement("path",{fill:"none",d:"M99 664.2h193M115.8 713h9.2m-9.2-6.3h9.2m-9.2-6.2h9.2m-9.2-6.3h9.2m-9.2-6.2h9.2m-9.2-6.3h9.2m-9.2-6.2h9.2m65.8 37.5h8.6m-8.6-6.3h8.6m-8.6-6.2h8.6m-8.6-6.3h8.6m-8.6-6.2h8.6m-8.6-6.3h8.6m-8.6-6.2h8.6m66.2 37.5h9.2m-9.2-6.3h9.2m-9.2-6.2h9.2m-9.2-6.3h9.2m-9.2-6.2h9.2m-9.2-6.3h9.2m-9.2-6.2h9.2"}))),Ie=t=>e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",id:"flag-icons-in",viewBox:"0 0 640 480",width:"1em",height:"1em"},t),e.createElement("path",{fill:"#f93",d:"M0 0h640v160H0z"}),e.createElement("path",{fill:"#fff",d:"M0 160h640v160H0z"}),e.createElement("path",{fill:"#128807",d:"M0 320h640v160H0z"}),e.createElement("g",{transform:"matrix(3.2 0 0 3.2 320 240)"},e.createElement("circle",{r:20,fill:"#008"}),e.createElement("circle",{r:17.5,fill:"#fff"}),e.createElement("circle",{r:3.5,fill:"#008"}),e.createElement("g",{id:"d"},e.createElement("g",{id:"c"},e.createElement("g",{id:"b"},e.createElement("g",{id:"a",fill:"#008"},e.createElement("circle",{r:.9,transform:"rotate(7.5 -8.8 133.5)"}),e.createElement("path",{d:"M0 17.5.6 7 0 2l-.6 5L0 17.5z"})),e.createElement("use",{xlinkHref:"#a",width:"100%",height:"100%",transform:"rotate(15)"})),e.createElement("use",{xlinkHref:"#b",width:"100%",height:"100%",transform:"rotate(30)"})),e.createElement("use",{xlinkHref:"#c",width:"100%",height:"100%",transform:"rotate(60)"})),e.createElement("use",{xlinkHref:"#d",width:"100%",height:"100%",transform:"rotate(120)"}),e.createElement("use",{xlinkHref:"#d",width:"100%",height:"100%",transform:"rotate(-120)"}))),Le=t=>e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",id:"flag-icons-id",viewBox:"0 0 640 480",width:"1em",height:"1em"},t),e.createElement("g",{fillRule:"evenodd",strokeWidth:"1pt"},e.createElement("path",{fill:"#e70011",d:"M0 0h640v249H0z"}),e.createElement("path",{fill:"#fff",d:"M0 240h640v240H0z"}))),Ae=t=>e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",id:"flag-icons-my",viewBox:"0 0 640 480",width:"1em",height:"1em"},t),e.createElement("path",{fill:"#c00",d:"M0 0h640v480H0z"}),e.createElement("path",{fill:"#fff",d:"M.5 39.9h639v38.4H.5zM.5 118.6h639V157H.5zM.5 197.4h639v38.4H.5z"}),e.createElement("path",{fill:"#006",d:"M0 .5h320v280H0Z"}),e.createElement("path",{fill:"#fc0",d:"m207.5 73.8 6 40.7 23-34-12.4 39.2 35.5-20.8-28.1 30 41-3.2-38.3 14.8 38.3 14.8-41-3.2 28.1 30-35.5-20.8 12.3 39.3-23-34.1-6 40.7-5.9-40.7-23 34 12.4-39.2-35.5 20.8 28-30-41 3.2 38.4-14.8-38.3-14.8 41 3.2-28.1-30 35.5 20.8-12.4-39.3 23 34.1zm-33.3 1.7a71.1 71.1 0 1 0 0 130 80 80 0 1 1 0-130z"}),e.createElement("path",{fill:"#fff",d:"M.5 276.2h639v38.4H.5zM.5 354.4h639v38.4H.5zM0 441.6h639V480H0z"})),Be=t=>e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",id:"flag-icons-mm",viewBox:"0 0 640 480",width:"1em",height:"1em"},t),e.createElement("path",{fill:"#fecb00",d:"M0 0h640v480H0z"}),e.createElement("path",{fill:"#34b233",d:"M0 160h640v320H0z"}),e.createElement("path",{fill:"#ea2839",d:"M0 320h640v160H0z"}),e.createElement("g",{transform:"translate(320 256.9) scale(176.87999)"},e.createElement("path",{id:"a",fill:"#fff",d:"m0-1 .3 1h-.6z"}),e.createElement("use",{xlinkHref:"#a",width:"100%",height:"100%",transform:"rotate(-144)"}),e.createElement("use",{xlinkHref:"#a",width:"100%",height:"100%",transform:"rotate(-72)"}),e.createElement("use",{xlinkHref:"#a",width:"100%",height:"100%",transform:"rotate(72)"}),e.createElement("use",{xlinkHref:"#a",width:"100%",height:"100%",transform:"rotate(144)"}))),Ne=t=>e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",id:"flag-icons-ph",viewBox:"0 0 640 480",width:"1em",height:"1em"},t),e.createElement("path",{fill:"#0038a8",d:"M0 0h640v240H0z"}),e.createElement("path",{fill:"#ce1126",d:"M0 240h640v240H0z"}),e.createElement("path",{fill:"#fff",d:"M415.7 240 0 480V0"}),e.createElement("path",{fill:"#fcd116",d:"M26.7 42.4 41 55l16.6-9.2-7.4 17.5 14 13-19-1.6-8.1 17.2-4.3-18.5L14 71l16.3-10zm323.8 172.3.4 19 18 6.3-18 6.2-.4 19-11.5-15.1-18.2 5.5 10.8-15.6-10.8-15.6 18.2 5.5zM37.2 388.1l8 17.2 19-1.6-13.9 13 7.4 17.5-16.6-9.1-14.4 12.4 3.6-18.7L14 409l18.9-2.4zm114.2-249-6.2 6.2 3.1 47-3 .3-5.7-42.9-5.1 5 7.6 38.4a47.5 47.5 0 0 0-17.2 7.1l-21.7-32.4H96l26.4 34.3a48 48 0 0 0-2.4 2l-31.1-35.5h-8.8v8.8l35.4 31-2 2.5-34.3-26.3v7.1l32.5 21.7c-3.4 5.2-5.9 11-7.1 17.2L66.3 223l-5.1 5 42.9 5.7c-.2 1-.3 2.1-.3 3.1l-47-3-6.2 6.2 6.2 6.2 47-3.1.3 3.1-42.9 5.7 5 5 38.4-7.6a47.5 47.5 0 0 0 7.1 17.2l-32.5 21.7v7.2l34.3-26.3a48 48 0 0 0 2 2.4l-35.4 31v8.8H89l31-35.4 2.5 2L96 312.2h7.2l21.7-32.5c5.1 3.4 11 5.9 17.2 7.1l-7.6 38.4 5 5 5.7-42.9c1 .2 2 .3 3.1.3l-3 47 6.1 6.2 6.3-6.2-3.1-47 3-.3 5.7 43 5.1-5.1-7.6-38.4a47.5 47.5 0 0 0 17.2-7.1l21.7 32.5h7.2l-26.4-34.3a48 48 0 0 0 2.4-2l31.1 35.4h8.8v-8.8l-35.4-31 2-2.4 34.3 26.3v-7.2l-32.5-21.7c3.4-5.1 5.9-11 7.1-17.2l38.3 7.6 5.1-5-42.9-5.7c.2-1 .3-2 .3-3.1l47 3 6.2-6.1-6.2-6.2-47 3-.3-3 42.9-5.7-5-5-38.4 7.5a47.5 47.5 0 0 0-7.1-17.2l32.5-21.7v-7.1l-34.3 26.3a48 48 0 0 0-2-2.4l35.4-31v-8.9H214l-31 35.5a48 48 0 0 0-2.5-2l26.4-34.3h-7.2L178 200.2c-5.1-3.4-11-5.9-17.2-7.1l7.6-38.3-5-5-5.7 42.8-3.1-.3 3-47z"})),Te=t=>e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",id:"flag-icons-tw",viewBox:"0 0 640 480",width:"1em",height:"1em"},t),e.createElement("clipPath",{id:"a"},e.createElement("path",{d:"M0 0h640v480H0z"})),e.createElement("g",{clipPath:"url(#a)"},e.createElement("path",{fill:"red",d:"M0 0h720v480H0z"}),e.createElement("path",{fill:"#000095",d:"M0 0h360v240H0z"}),e.createElement("g",{fill:"#fff"},e.createElement("path",{d:"m154 126.9-2.5 9.6 9.4 2.6-1.8-7.1zm46.9 5.1-1.8 7.1 9.4-2.6-2.5-9.6zm-41.8-24-5.1 5.1 1.9 6.9z"}),e.createElement("path",{d:"m155.9 120-1.9 6.9 5.1 5.1z"}),e.createElement("path",{d:"m154 113.1-6.9 6.9 6.9 6.9 1.9-6.9zm14 27.8 5.1 5.1 6.9-1.9zm18.9 5.1 9.6 2.5 2.6-9.4-7.1 1.8z"}),e.createElement("path",{d:"m192 140.9 7.1-1.8 1.8-7.1zm-31.1-1.8 2.6 9.4 9.6-2.5-5.1-5.1zm19.1 5 6.9 1.9 5.1-5.1z"}),e.createElement("path",{d:"m173.1 146 6.9 6.9 6.9-6.9-6.9-1.9zm-12.2-45.1-9.4 2.6 2.5 9.6 5.1-5.1zm-1.8 31.1 1.8 7.1 7.1 1.8zm45-12 1.9-6.9-5.1-5.1z"}),e.createElement("path",{d:"m168 99.1-7.1 1.8-1.8 7.1zm32.9 8.9-1.8-7.1-7.1-1.8zm5.1 18.9 6.9-6.9-6.9-6.9-1.9 6.9z"}),e.createElement("path",{d:"m200.9 108-8.9-8.9-12-3.2-12 3.2-8.9 8.9-3.2 12 3.2 12 8.9 8.9 12 3.2 12-3.2 8.9-8.9 3.2-12z"}),e.createElement("path",{d:"m200.9 132 5.1-5.1-1.9-6.9zm5.1-18.9 2.5-9.6-9.4-2.6 1.8 7.1zm-6.9-12.2-2.6-9.4-9.6 2.5 5.1 5.1zm-26-6.9-9.6-2.5-2.6 9.4 7.1-1.8zm6.9 1.9-6.9-1.9-5.1 5.1z"}),e.createElement("path",{d:"m186.9 94-6.9-6.9-6.9 6.9 6.9 1.9z"}),e.createElement("path",{d:"m192 99.1-5.1-5.1-6.9 1.9zM173.1 146l-9.6 2.5 4.5 16.6 12-12.2zm-5.1 19.1 12 44.9 12-44.9-12-12.2zm-7.1-26-9.4-2.6-4.4 16.4 16.4-4.4z"}),e.createElement("path",{d:"m147.1 152.9-12 45.1 32.9-32.9-4.5-16.6zm-12-20.9L102 165.1l45.1-12.2 4.4-16.4z"}),e.createElement("path",{d:"m154 126.9-6.9-6.9-12 12 16.4 4.5zm0-13.8-2.5-9.6-16.4 4.5 12 12z"}),e.createElement("path",{d:"M135.1 108 90 120l45.1 12 12-12zm90 24-16.6 4.5 4.4 16.4 45.1 12.2z"}),e.createElement("path",{d:"m199.1 139.1-2.6 9.4 16.4 4.4-4.4-16.4zm-12.2 6.9-6.9 6.9 12 12.2 4.5-16.6zm19.1-19.1 2.5 9.6 16.6-4.5-12.2-12z"}),e.createElement("path",{d:"m192 165.1 33.1 32.9-12.2-45.1-16.4-4.4zm7.1-64.2 9.4 2.6 4.4-16.4-16.4 4.4z"}),e.createElement("path",{d:"M225.1 108 258 75.1l-45.1 12-4.4 16.4zm-12.2-20.9L225.1 42 192 75.1l4.5 16.4zm12.2 44.9 44.9-12-44.9-12-12.2 12z"}),e.createElement("path",{d:"m206 113.1 6.9 6.9 12.2-12-16.6-4.5zm-38-38L135.1 42l12 45.1 16.4 4.4z"}),e.createElement("path",{d:"m160.9 100.9 2.6-9.4-16.4-4.4 4.4 16.4z"}),e.createElement("path",{d:"m147.1 87.1-45.1-12 33.1 32.9 16.4-4.5zm39.8 6.9 9.6-2.5-4.5-16.4-12 12z"}),e.createElement("path",{d:"M192 75.1 180 30l-12 45.1 12 12z"}),e.createElement("path",{d:"m173.1 94 6.9-6.9-12-12-4.5 16.4z"})),e.createElement("circle",{cx:180,cy:120,r:51.1,fill:"#000095"}),e.createElement("circle",{cx:180,cy:120,r:45.1,fill:"#fff"}))),De=t=>e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",id:"flag-icons-th",viewBox:"0 0 640 480",width:"1em",height:"1em"},t),e.createElement("g",{fillRule:"evenodd"},e.createElement("path",{fill:"#f4f5f8",d:"M0 0h640v480H0z"}),e.createElement("path",{fill:"#2d2a4a",d:"M0 162.5h640v160H0z"}),e.createElement("path",{fill:"#a51931",d:"M0 0h640v82.5H0zm0 400h640v80H0z"}))),We=t=>e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",id:"flag-icons-vn",viewBox:"0 0 640 480",width:"1em",height:"1em"},t),e.createElement("defs",null,e.createElement("clipPath",{id:"a"},e.createElement("path",{fillOpacity:.7,d:"M-85.3 0h682.6v512H-85.3z"}))),e.createElement("g",{fillRule:"evenodd",clipPath:"url(#a)",transform:"translate(80) scale(.9375)"},e.createElement("path",{fill:"#da251d",d:"M-128 0h768v512h-768z"}),e.createElement("path",{fill:"#ff0",d:"M349.6 381 260 314.3l-89 67.3L204 272l-89-67.7 110.1-1 34.2-109.4L294 203l110.1.1-88.5 68.4 33.9 109.6z"}))),Ve=Object.values(I).reduce(((e,{phoneCountry:t})=>(e.includes(t)||e.push(t),e)),[]),Re={PH:Ne,KH:Pe,ID:Ie,IN:Le,MM:Be,MY:Ae,TH:De,TW:Te,VN:We};var Fe={phoneInput:"i-9Ibox",error:"YDWHh9b"};const Ge=n(((e,n)=>{const{isError:l,defaultCountry:o,countries:i=Ve,countryCallingCodeEditable:s=!1,defaultValue:c,value:m,onChange:h,className:d}=e,p=B(e,["isError","defaultCountry","countries","countryCallingCodeEditable","defaultValue","value","onChange","className"]),[g,v]=a(c||m),[u,f]=a(null);return r((()=>{v(m)}),[m]),r((()=>{N(void 0,void 0,void 0,(function*(){const e=yield import("react-phone-number-input");f(e)}))}),[]),u?t.createElement(u.default,Object.assign({ref:n,value:g,onChange:e=>{v(e),null==h||h(e)},countries:i,defaultCountry:o,countryCallingCodeEditable:s,className:Me(Fe.phoneInput,{isError:l,[Fe.error]:l},d),flagUrl:void 0,flagComponent:e=>{const{country:a,countryName:r,flagUrl:n}=e,l=B(e,["country","countryName","flagUrl"]),o=Re[a],i=a?`(+${u.getCountryCallingCode(a)})`:"";return o?t.createElement(t.Fragment,null,t.createElement(o,Object.assign({title:r},l)),t.createElement("span",{className:Me(Fe.callingCode,"PhoneInputCountryIconCallingCode")},i)):t.createElement(t.Fragment,null)},countrySelectProps:{arrowComponent:()=>t.createElement("div",{className:Me(Fe.arrowSelect,"PhoneInputArrowContainer")},t.createElement($e,null))}},p)):null}));var Ue=m(((e,t)=>({root:{color:t.color||("hb"===e.primaryColor?"hb.6":e.fn.primaryColor()),"&[data-event-category] > *":{pointerEvents:"none"}}})));export{U as A,$e as C,ee as D,be as G,Ie as I,Ae as M,ae as N,Oe as O,Ne as P,de as R,he as S,Te as T,We as V,Pe as a,Le as b,Be as c,De as d,oe as e,xe as f,ye as g,G as h,me as i,K as j,Ue as k,R as l,X as m,pe as n,Ee as o,we as p,Ge as q,Z as r,ve as s,q as t,Y as u,J as v,se as w,ce as x,te as y,F as z};
package/build/esm/lead.js CHANGED
@@ -1 +1 @@
1
- import{_ as e,a as t}from"./tslib.es6-6fca6fae.js";import a,{createContext as l,useState as n,useEffect as o,useMemo as i,useRef as r,useContext as s}from"react";import d from"lodash/debounce";import{createPortal as c}from"react-dom";import{T as m}from"./translationsContext-3047aefe.js";import{g as u,s as p}from"./cookieHelper-cbbc5ece.js";import{b as h,a as g}from"./utils-9858d408.js";import{v1 as v}from"uuid";import{u as b}from"./useTranslations-05394aed.js";import"./index.styled-79d4b1a1.js";import{B as y}from"./index-d3cc6f8a.js";import{CommonGAssets as f}from"./gAssets.js";import"@mantine/core";import"./index.styled-e704c9c2.js";import"./index-1ade8351.js";import{t as k}from"./theme-5782e8f2.js";import"./index.styled-8a3ed141.js";import"string-format";import"./index-7e0d894b.js";import{e as _,R as E,x as w,l as C,m as N,N as S}from"./index.styles-e4b8b655.js";import T from"dayjs";import"./screenSizeContext-39b53f94.js";import"styled-components";import"./index-74bd30cc.js";import"./isProduction-aa4c6da9.js";import"./Onboarding-c98a38a5.js";import"./index-f72a5db6.js";import"@mantine/hooks";import"./index.styled-0591673c.js";import"date-fns";import"react-day-picker/DayPickerInput";import"./index.styled-928161bc.js";import"./index-a25dbc33.js";import"lodash/throttle";import"keen-slider/react";import"./types-34bf4318.js";import"react-hook-form";import"date-fns/locale/en-US";import"date-fns/locale/id";import"date-fns/locale/vi";import"date-fns/locale/zh-TW";import"./index.styled-1a0e35c1.js";import{S as x}from"./index-1483611b.js";import{M as O}from"./index.styled-e0eda731.js";import{createFormContext as j}from"@mantine/form";import"yup";import{T as P}from"./index-a49e0bc1.js";import{H as B}from"./index-6569f80d.js";import"@mantine/dates";import"@mantine/carousel";import"./index-de075a29.js";import"./index-076075d1.js";import"@hookform/resolvers/yup";import"./index-4b3834b0.js";import"./useUniqueId-abc4f1de.js";import"./index-52d9bc33.js";import"./index-07863aa4.js";import"slugify";import"./routing-de7d22cc.js";import"dayjs/plugin/relativeTime";import"./index-dd8c9b9d.js";import"./Visible-05e82139.js";const L={LINKS:1,TAGS:2};let $="https://dev.leadgen.hellobacsi.com/";const I={MOBILE:1,DESKTOP:2};let A="";$.includes("localhost")&&($="https://dev.leadgen.hellobacsi.com/"),location.hostname.includes("marrybaby.vn")&&(A="pink");let U="https://"+location.hostname+location.pathname+location.search;U=U.toLowerCase(),sessionStorage.getItem("insider_object")&&(window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")));const D={"vi-VN":{popupLang:"vi",countryCode:"vn",countryCodeNumber:84},"id-ID":{popupLang:"id",countryCode:"id",countryCodeNumber:62},"th-TH":{popupLang:"th",countryCode:"th",countryCodeNumber:66},"ms-MY":{popupLang:"ms",countryCode:"my",countryCodeNumber:60},"zh-TW":{popupLang:"zh",countryCode:"tw",countryCodeNumber:886},"km-KH":{popupLang:"km",countryCode:"kh",countryCodeNumber:855},"my-MM":{popupLang:"my",countryCode:"mm",countryCodeNumber:95},"hi-IN":{popupLang:"hi",countryCode:"in",countryCodeNumber:91}},M=D[document.documentElement.lang]||D["vi-VN"];const R={1:"Asia/Ho_Chi_Minh",10:"Asia/Ho_Chi_Minh",11:"Asia/Ho_Chi_Minh",12:"Asia/Ho_Chi_Minh",2:"Asia/Jakarta",3:"Asia/Bangkok",4:"Asia/Phnom_Penh",5:"Asia/Kuala_Lumpur",6:"Asia/Taipei",7:"Asia/Yangon",8:"Asia/Kolkata",9:"Asia/Manila"};var H={"validator.required":"This field is required.","validator.remote":"Please fix this field.","validator.email":"Please enter a valid email address.","validator.phone":"Please input correct phone number.","validator.url":"Please enter a valid URL.","validator.date":"Please enter a valid date.","validator.dateISO":"Please enter a valid date (ISO).","validator.number":"Please enter a valid number.","validator.digits":"Please enter only digits.","validator.creditcard":"Please enter a valid credit card number.","validator.equalTo":"Please enter the same value again.","validator.accept":"Please enter a value with a valid extension.","validator.maxlength":"jQuery.validator.format('Please enter no more than {0} characters.","validator.minlength":"jQuery.validator.format('Please enter at least {0} characters.","validator.rangelength":"jQuery.validator.format('Please enter a value between {0} and {1} characters long.","validator.range":"jQuery.validator.format('Please enter a value between {0} and {1}.","validator.max":"jQuery.validator.format('Please enter a value less than or equal to {0}.","validator.min":"jQuery.validator.format('Please enter a value greater than or equal to {0}.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"};const F={"en-PH":H,"vi-VN":{"validator.required":"Vui lòng điền mục này","validator.email":"Vui lòng điền email có thật.","validator.number":"Vui lòng điền số có thật","validator.digits":"Vui lòng chỉ điền số","validator.maxlength":"Vui lòng điền dưới {0} số","validator.minlength":"Vui lòng điền hơn {0} số","validator.remote":"Hãy sửa cho đúng.","validator.url":"Hãy nhập URL.","validator.date":"Hãy nhập ngày.","validator.dateISO":"Hãy nhập ngày (ISO).","validator.creditcard":"Hãy nhập số thẻ tín dụng.","validator.equalTo":"Hãy nhập thêm lần nữa.","validator.extension":"Phần mở rộng không đúng.","validator.rangelength":"Hãy nhập từ {0} đến {1} kí tự.","validator.range":"Hãy nhập từ {0} đến {1}.","validator.max":"Hãy nhập từ {0} trở xuống.","validator.min":"Hãy nhập từ {0} trở lên.","validator.phone":"Nhập đúng định dạng số điện thoại","validator.emailUsed":"Email này đã được sử dụng cho chiến dịch.","validator.phoneUsed":"Số điện thoại này đã được sử dụng cho chiến dịch.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"hi-IN":{"validator.required":"इस क्षेत्र की आवश्यकता है।","validator.email":"कृपया एक मान्य ईमेल पता दर्ज करें","validator.number":"कृपया एक वैध संख्या दर्ज करें","validator.digits":"कृपया केवल अंक दर्ज करें","validator.maxlength":"कृपया {0} अक्षर से अधिक दर्ज न करें","validator.minlength":"कृपया कम से कम {0} अक्षर दर्ज करें","validator.phone":"कृपया एक वैध संख्या दर्ज करें","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"id-ID":{"validator.required":"Kolom ini wajib diisi","validator.email":"Tolong daftarkan email yang valid","validator.number":"Tolong daftarkan nomor telepon yang valid","validator.digits":"Tolong masukkan angka saja","validator.maxlength":"Jangan memasukkan lebih dari {0} karakter","validator.minlength":"Tolong ketik sedikitnya {0} karakter","validator.phone":"Tolong daftarkan nomor telepon yang valid","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"ms-MY":{"validator.required":"Bahagian ini wajib diisi.","validator.email":"Sila masukkan alamat emel yang sah.","validator.number":"Sila masukkan no telefon yang sah.","validator.digits":"Sila masukkan nombor digit sahaja.","validator.maxlength":"Sila masukkan tidak lebih dari {0} aksara","validator.minlength":"Sila masukkan sekurang-kurangnya {0} aksara","validator.phone":"Sila masukkan no telefon yang sah.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"my-MM":{"validator.required":"ဒီနေရာမှာ ဖြည့်ဖို့ လိုအပ်ပါတယ်","validator.email":"မှန်ကန်သော အီးမေးလ်လိပ်စာထည့်သွင်းပါ","validator.number":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.digits":"နံပါတ်များသာဖြည့်ပါ","validator.maxlength":"ကျေးဇူးပြု၍ {0} ထပ်မပိုသော ဂဏန်းများသာဖြည့်ပါ","validator.minlength":"ကျေးဇူးပြု၍ အနည်းဆုံး {0} ဂဏန်းဖြည့်ပါ","validator.phone":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"km-KH":{"validator.required":"ព័ត៌មាន​ចាំបាច់​ដែល​ត្រូវ​បំពេញ","validator.email":"សូម​វាយ​អាសយដ្ឋាន​អ៊ីម៉ែល​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.number":"សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.digits":"វាយ​បញ្ចូល​បាន​តែ​លេខ​ប៉ុណ្ណោះ","validator.maxlength":"សូម​វាយ​បញ្ចូលកុំ​ឲ្យ​លើស {0} តួអក្សរ","validator.minlength":"សូម​វាយ​បញ្ចូល​តិច​បំផុត {0} តួអក្ស","validator.phone":"សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"zh-TW":{"validator.required":"此為必填欄位","validator.email":"請填入有效的 email 地址","validator.number":"請填入有效的電話號碼","validator.digits":"此欄位僅能輸入數字","validator.maxlength":"請輸入少於 {0} 位數","validator.minlength":"請輸入至少 {0} 位數","validator.phone":"請填入有效的電話號碼","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"th-TH":{"validator.required":"ต้องระบุข้อมูลในช่องนี้","validator.email":"กรุณาใส่อีเมล์ที่ถูกต้อง","validator.number":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.digits":"กรุณาส่เฉพาะตัวเลข","validator.maxlength":"กรุณาใส่ตัวเลขมากกว่า {0} หลัก","validator.minlength":"กรุณาใส่ตัวเลขอย่างน้อย {0} หลัก","validator.phone":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"tl-PH":H},W=e=>{const t=F[e];return t||F["en-PH"]},V=l({}),q=e=>{const[t,a]=n(16),[l,i]=n(9),[r,s]=n(!1);return o((()=>{if(s(!1),e){const t=new Image;t.addEventListener("load",(()=>{a(t.naturalWidth),i(t.naturalHeight),s(!0)})),t.addEventListener("error",(()=>{a(16),i(9),s(!0)})),t.src=e}else a(16),i(9),s(!0)}),[e]),{loaded:r,width:t,height:l}},Y=({onClose:e,containerClassName:t,svgClassName:l})=>a.createElement("button",{onClick:e,className:`le-newbuilder-close-button js-modal__close ${t||""}`},a.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:l},a.createElement("circle",{cx:"16",cy:"16",r:"16",fill:"white"}),a.createElement("path",{d:"M16 17.05L10.925 22.125C10.7917 22.2584 10.621 22.329 10.413 22.337C10.2044 22.3457 10.025 22.275 9.87502 22.125C9.72502 21.975 9.65002 21.8 9.65002 21.6C9.65002 21.4 9.72502 21.225 9.87502 21.075L14.95 16L9.87502 10.925C9.74169 10.7917 9.67102 10.6207 9.66302 10.412C9.65436 10.204 9.72502 10.025 9.87502 9.87502C10.025 9.72502 10.2 9.65002 10.4 9.65002C10.6 9.65002 10.775 9.72502 10.925 9.87502L16 14.95L21.075 9.87502C21.2084 9.74169 21.3794 9.67069 21.588 9.66202C21.796 9.65402 21.975 9.72502 22.125 9.87502C22.275 10.025 22.35 10.2 22.35 10.4C22.35 10.6 22.275 10.775 22.125 10.925L17.05 16L22.125 21.075C22.2584 21.2084 22.329 21.379 22.337 21.587C22.3457 21.7957 22.275 21.975 22.125 22.125C21.975 22.275 21.8 22.35 21.6 22.35C21.4 22.35 21.225 22.275 21.075 22.125L16 17.05Z",fill:"#595959"}))),J=({popupId:e,url:t,newTab:l,imageDestkop:n,imageMobile:o,onClose:i,onOtherSubmit:r})=>{const{width:s,height:d,loaded:c}=q(o),{width:m,height:u,loaded:p}=q(n);return c&&p?a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"center_tab"},a.createElement("div",{className:"le-center-tab-popup"},a.createElement("div",{style:{position:"relative"}},a.createElement("a",{className:"js-popup-other-submit",href:t,target:l?"blank":"_parent",onClick:r},a.createElement("img",{className:"le-only-mobile",src:o,style:{aspectRatio:`${s}/${d}`}}),a.createElement("img",{className:"le-only-desktop",src:n,style:{aspectRatio:`${m}/${u}`}})),a.createElement(Y,{onClose:i,containerClassName:"close-button-top-right"})))):null},z=({popupId:e,url:t,title:l,urlText:n,titleAlign:o,subtitle:i,subtitleAlign:r,newTab:s,imageDesktop:d,imageMobile:c,onClose:m,onOtherSubmit:u})=>{const{width:p,height:h,loaded:g}=q(c),{width:v,height:b,loaded:y}=q(d);return g&&y?a.createElement("div",{id:e,className:"lead-modal-wrapper lead-floating-wrapper","data-popup-url":location.pathname,"data-popup-type":"floating"},a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:"le-floating-desktop"},a.createElement("div",{className:"le-floating-desktop-wrap",style:{position:"relative",background:"#fff"}},d?a.createElement("div",null,a.createElement("img",{style:{maxWidth:120,borderTopLeftRadius:5,borderBottomLeftRadius:5,aspectRatio:`${v}/${b}`},src:d})):null,a.createElement("div",{style:{padding:20}},a.createElement("div",{className:`le-floating-desktop-title le-text-align-${o}`},l),a.createElement("div",{className:`le-floating-desktop-desc le-text-align-${r}`},i)),a.createElement("a",{target:s?"blank":"_parent",style:{marginLeft:35,textDecoration:"none"},href:t},a.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:u},n)),a.createElement(Y,{onClose:m,containerClassName:"close-button-top-right"})))),a.createElement("aside",{className:"le-only-mobile"},a.createElement("div",{className:"le-floating-mobile"},a.createElement("div",{className:"le-floating-mobile-wrap",style:{position:"relative",background:"#fff"}},a.createElement("aside",{style:{display:"flex",justifyContent:"space-between"}},a.createElement("div",null,a.createElement("div",{className:`le-floating-mobile-title le-text-align-${o}`},l),a.createElement("div",{className:`le-floating-mobile-desc le-text-align-${r}`},i)),c?a.createElement("div",null,a.createElement("img",{style:{marginLeft:15,marginTop:4,maxWidth:100,aspectRatio:`${p}/${h}`},src:c})):null),a.createElement("div",{style:{textAlign:"center",marginTop:10}},a.createElement("a",{target:s?"blank":"_parent",href:t,style:{textDecoration:"none"}},a.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:u},n))),a.createElement(Y,{onClose:m,containerClassName:"close-button-top-right"}))))):null},K=({title:e,titleAlign:t,subtitle:l,subtitleAlign:n,link:o,linkNewTab:i,linkText:r,image:s})=>{const{width:d,height:c,loaded:m}=q(s);return m?a.createElement("div",{className:"lead-modal__thank-you"},a.createElement("div",{style:{width:"100%"}},a.createElement("img",{src:s,style:{maxHeight:162,objectFit:"cover",aspectRatio:`${d}/${c}`}}),e&&a.createElement("h1",{className:`le-thankyou-title le-text-align-${t}`},e),l&&a.createElement("p",{className:`le-thankyou-subtitle le-text-align-${n}`},l),r&&a.createElement("div",null,a.createElement("a",{href:o,target:i?"_blank":"parrent",rel:"noreferrer"},a.createElement("button",{className:`lead-modal__btn ${A}`},r))))):null};const G=new class{constructor(){this.apiLeadUrl="https://dev.leadgen.hellobacsi.com/",this.apiSubotUrl="https://staging-service-subot.hellohealthgroup.com/"}},Q={call(t){var{url:a,data:l}=t,n=e(t,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${G.apiLeadUrl}${a}`,n).then((e=>e.json())).catch((e=>({})))}},X={call(t){var{url:a,data:l}=t,n=e(t,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${G.apiSubotUrl}${a}`,n).then((e=>e.json())).catch((e=>({})))}},Z=({bot_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),X.call({url:"frontend/api/subot-campaign/check",method:"post",data:{bot_id:e,email:t,phone:l}})},ee=({campaign_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),Q.call({url:"api/subot-campaign/check",method:"post",data:{campaign_id:e,email:t,phone:l}})},te=({phone:e})=>Q.call({url:"api/sms/otp",method:"post",data:{phone_number:e.replace("+","")}}),ae=({phone:e,otp:t})=>Q.call({url:"api/sms/verify",method:"post",data:{otp_code:t,phone_number:e.replace("+","")}}),le={email:{},phone:{}},ne=(e,a,l)=>t(void 0,void 0,void 0,(function*(){const n="email"in l?"email":"phone",o="email"in l?l.email:l.phone,i="email"in l?"validator.emailUsed":"validator.phoneUsed";if(le[n][o]){if(le[n][o].value)return i;if(!le[n][o].value&&le[n][o].expire>Date.now())return""}const r=yield((e,a,l)=>t(void 0,void 0,void 0,(function*(){const t="email"in l?"email":"phone",n="email"in l?l.email:l.phone,o="email"in l?"validator.emailUsed":"validator.phoneUsed",i=yield ee({campaign_id:[e],[t]:n});return"SubmitLeadWithBotId_ERR_001"===i._errorCode||"SubmitLeadWithBotId_ERR_002"===i._errorCode||a.length&&"CheckSuBotLeadTool_ERR_001"===(yield Z({bot_id:a,[t]:n}))._errorCode?o:void 0})))(e,a,l);return le[n][o]=r?{value:!0}:{value:!1,expire:Date.now()+6e4},r})),oe=({content:e,inlinePosition:t})=>{const a=i((()=>{if(!t)return null;const e=document.querySelectorAll(`[data-url="${location.pathname}"] .body-content`),a=Array.from(e).reduce(((e,t)=>[...e,...Array.from(t.children)]),[]);if(null==a?void 0:a.length){const e=a.filter((e=>"P"===e.nodeName)),l=a.filter((e=>"H2"===e.nodeName));let n=null;switch(t){case"1th":n=e[0];break;case"2th":n=e[1];break;case"3th":n=e[2];break;case"4th":n=e[3];break;case"5th":n=e[4];break;case"6th":n=e[5];break;case"7th":n=e[6];break;case"8th":n=e[7];break;case"9th":n=e[8];break;case"10th":n=e[9];break;case"11th":n=e[10];break;case"12th":n=e[11];break;case"lastP":n=e[e.length-1];break;case"1thH2":n=l[0];break;case"2thH2":n=l[1];break;case"3thH2":n=l[2];break;case"4thH2":n=l[3];break;case"5thH2":n=l[4];break;case"6thH2":n=l[5];break;case"7thH2":n=l[6];break;case"8thH2":n=l[7];break;case"9thH2":n=l[8];break;case"10thH2":n=l[9];break;case"lastH2":n=l[l.length-1]}if(n){if(n.parentElement.querySelector(".inline-lead-wrapper"))return n.parentElement.querySelector(".inline-lead-wrapper");{const e=document.createElement("div");return e.classList.add("inline-lead-wrapper"),n.nextElementSibling?n.parentElement.insertBefore(e,n.nextElementSibling):n.parentElement.appendChild(e),e}}}}),[t]);return t&&a?c(e,a):null},ie=({content:e})=>{const t=i((()=>{const e=Array.from(document.querySelectorAll(".hc2-sidebar-with-ads,.page-main-col .right-col.f-right,.hhg-lead-sidebar"));return e.forEach((e=>{if(e.querySelector(".sidebar-lead-modal-wrapper"))return;const t=document.createElement("div");t.classList.add("sidebar-lead-modal-wrapper"),e.prepend(t)})),e.map((e=>e.querySelector(".sidebar-lead-modal-wrapper")))}),[]);return a.createElement(a.Fragment,null,t.map((t=>c(e,h(t,"sidebar-lead-modal-wrapper")))))},[re,se,de]=j(),ce="undefined"==typeof window,me={VN:"vi",ID:"id",TH:"th",MY:"ms",TW:"zh-TW",KH:"km",MM:"my",IN:"hi",PH:"en"},ue=(e="",a="",l="",i=500)=>{const[r,s]=n([]),[d,c]=n(!1);return o((()=>{let n;return e?n=window.setTimeout((()=>t(void 0,void 0,void 0,(function*(){var n;if(e)try{c(!0);const o=yield((e="",a="",l="vi")=>t(void 0,void 0,void 0,(function*(){return new Promise(((t,n)=>{if(!e)return n("Need valid text input");if(ce)return n("Need valid window object");try{(new window.google.maps.places.AutocompleteService).getPlacePredictions(Object.assign(Object.assign({input:e},a?{componentRestrictions:{country:a}}:{}),{language:me[l]}),t)}catch(e){n(e)}}))})))(e,a,l);s(!(n=o)||n.length<1?[]:n.map((e=>({placeId:e.place_id,description:e.description}))))}catch(e){console.error(e)}finally{c(!1)}else s([])}))),i):r.length&&s([]),()=>{window.clearTimeout(n)}}),[e,i,a]),{isLoading:d,predictions:r}},pe=["places"],he=({name:e,placeholder:t,locale:l})=>{var s;const d=se(),[c,m]=n(""),[u,p]=n(""),{predictions:h}=ue(c||"15 Lê","","tl-PH"===l?"en":null===(s=null==l?void 0:l.split("-"))||void 0===s?void 0:s[0]),[g,v]=n(null),[b,y]=n(!1),f=r(Math.random().toString(36).substring(7)),k=i((()=>{const e=h.map((e=>({value:e.description,label:e.description}))),t=e.find((e=>e.value===u));return!u||t?e:[{value:u,label:u}].concat(e)}),[h,u]);return o((()=>{var e,t,a;(null===(a=null===(t=null===(e=null===window||void 0===window?void 0:window.google)||void 0===e?void 0:e.maps)||void 0===t?void 0:t.places)||void 0===a?void 0:a.AutocompleteService)?y(!0):import("@react-google-maps/api").then((e=>{v((()=>e.LoadScript)),setTimeout((()=>{y(!0)}),200)}))}),[]),b?a.createElement(a.Fragment,null,g&&a.createElement(g,{googleMapsApiKey:"AIzaSyB9QmhfEYcy2wj5X3Fl38aCD5UkET6n82M",libraries:pe,loadingElement:a.createElement(a.Fragment,null)}),a.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":e,"data-control":"text"}),a.createElement(x,Object.assign({className:"lead-modal__form-control",label:t,placeholder:t,withAsterisk:!0,name:e,data:k,searchValue:c,onSearchChange:e=>{m(e)},filter:()=>!0,clearable:!0,searchable:!0,onChange:e=>p(e||""),icon:a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{d:"M9.99999 9.79167C10.4028 9.79167 10.7467 9.64944 11.0317 9.365C11.3161 9.08 11.4583 8.73611 11.4583 8.33333C11.4583 7.93056 11.3161 7.58667 11.0317 7.30167C10.7467 7.01722 10.4028 6.875 9.99999 6.875C9.59721 6.875 9.25332 7.01722 8.96832 7.30167C8.68388 7.58667 8.54166 7.93056 8.54166 8.33333C8.54166 8.73611 8.68388 9.08 8.96832 9.365C9.25332 9.64944 9.59721 9.79167 9.99999 9.79167ZM9.99999 17.875C9.90277 17.875 9.80555 17.8611 9.70832 17.8333C9.6111 17.8056 9.52082 17.7569 9.43749 17.6875C7.46527 15.8958 5.98971 14.2361 5.01082 12.7083C4.03138 11.1806 3.54166 9.77778 3.54166 8.5C3.54166 6.48611 4.1911 4.87833 5.48999 3.67667C6.78832 2.47556 8.29166 1.875 9.99999 1.875C11.7083 1.875 13.2119 2.47556 14.5108 3.67667C15.8092 4.87833 16.4583 6.48611 16.4583 8.5C16.4583 9.77778 15.9689 11.1806 14.99 12.7083C14.0105 14.2361 12.5347 15.8958 10.5625 17.6875C10.4792 17.7569 10.3889 17.8056 10.2917 17.8333C10.1944 17.8611 10.0972 17.875 9.99999 17.875Z",fill:"#8C8C8C"})),autoComplete:"no-auto-complete-"+f.current,rightSection:a.createElement(a.Fragment,null)},d.getInputProps(e)))):a.createElement("div",{style:{height:73}})},ge=({children:e,align:t})=>a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(t||"")} ${A}`},e),ve=({children:e,align:t})=>a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(t||"")} ${A}`},e),be=({listBlockAdded:e,popupId:t,locale:l,onClose:n,onOtherSubmit:o})=>{const i=se();return a.createElement(a.Fragment,null,e.map(((e,r)=>{const{name:s="",data:d={}}=e||{},{placeholder:c,value:m,align:u,listQuestion:p,isSendMailChimp:h=!1,newtab:g,url:v}=d;switch(s){case"TitleBlock":return a.createElement(ve,{key:r,align:u},m);case"SubtitleBlock":return a.createElement(ge,{key:r,align:u},m);case"TextBlock":return a.createElement(_,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"text",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"text",name:m},i.getInputProps(m)));case"NumberBlock":return a.createElement(S,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"number",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"number",name:m},i.getInputProps(m)));case"EmailBlock":return a.createElement(_,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"email",name:m},i.getInputProps(m)));case"PhoneOtpBlock":case"PhoneBlock":{const e=t+"-"+m+"-"+r;return a.createElement(_.Wrapper,Object.assign({size:"md",withAsterisk:!0,key:r,label:c,className:"lead-modal__form-control",labelProps:{htmlFor:e}},i.getInputProps(m)),a.createElement(N,{name:m,spellCheck:!1,type:"tel",placeholder:c,onChange:e=>{i.setFieldValue(m,e)},id:e,defaultCountry:l&&O[l]||"VN","data-control":"tel"}))}case"LocationBlock":return a.createElement(he,{key:r,name:m,placeholder:c,locale:l});case"DateBlock":return a.createElement(C,Object.assign({withAsterisk:!0,key:r,type:"date",name:m,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"date"},i.getInputProps(m)));case"LinkButtonBlock":return a.createElement("div",{key:r},a.createElement("a",{target:g?"blank":"parrent",href:v,style:{textDecoration:"none"}},a.createElement(y,{type:"button",size:"md",className:`lead-modal__btn ${A}`,onClick:()=>{null==n||n(),null==o||o()}},m)));case"CheckboxBlock":return a.createElement(a.Fragment,null,h&&a.createElement("div",{style:{display:"none"},"data-name":m+"-mailchimp"}),a.createElement(w.Group,Object.assign({withAsterisk:!0,className:"lead-modal__form-control",key:r,label:c,size:"md"},i.getInputProps(m)),p.map(((e,t)=>a.createElement(w,{name:m,key:t,value:e.value,label:e.placeholder,"data-control":"checkbox"})))));case"RadioBlock":return a.createElement(a.Fragment,null,h&&a.createElement(_,{type:"hidden",name:m+"-mailchimp",value:h}),a.createElement(E.Group,Object.assign({withAsterisk:!0,className:"lead-modal__form-control",key:r,label:c,size:"md"},i.getInputProps(m)),p.map(((e,t)=>a.createElement(E,{name:m,key:t,value:e.value,label:e.placeholder,"data-control":"radio"})))));case"DropdownBlock":return a.createElement(a.Fragment,null,a.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":m,"data-control":"dropdown"}),a.createElement(x,Object.assign({key:r,className:"lead-modal__form-control",label:c,withAsterisk:!0,name:m,data:p.map((e=>({value:e.value,label:e.placeholder})))},i.getInputProps(m))))}return null})))},ye=({phone:e,onSuccess:l,autoSendWhenOpen:i})=>{const{t:s}=b(),[d,c]=n(""),[m,u]=n(!1),[p,h]=n(0),g=r(null),[v,f]=n(),[E,w]=n(""),C=r();o((()=>{t(void 0,void 0,void 0,(function*(){var t;if(!C.current){const e=yield import("react-phone-number-input");C.current=e.formatPhoneNumberIntl}w((null===(t=C.current)||void 0===t?void 0:t.call(C,e))||e)}))}),[e]);const N=()=>t(void 0,void 0,void 0,(function*(){var t;if(!e)return;const a=yield te({phone:e}),n=null===(t=null==a?void 0:a._messages)||void 0===t?void 0:t[0];"Send sms successfully"===n?(h(60),setTimeout((()=>{g.current&&(g.current.focus(),g.current.scrollIntoView({block:"center"}))}),100)):"This phone number was verified"===n?l():f(n||"something Wrong")}));return o((()=>{setTimeout((()=>{p>0&&h((e=>e-1))}),1e3)}),[p]),o((()=>{i&&!p&&N()}),[]),a.createElement(a.Fragment,null,a.createElement("form",{onSubmit:a=>{a.preventDefault(),t(void 0,void 0,void 0,(function*(){if(!e||!d)return;const t=yield ae({phone:e,otp:d}),a=null==t?void 0:t._messages[0];"Verify successfully"===a||"This phone number was verified"===a?l():f(a||"something Wrong")}))},className:"lead-phone-otp-form"},a.createElement(B,{tag:"h3",fontWeight:"bold",style:{marginBottom:4}},s("lead.otp.title")),a.createElement(P,{size:"p1",color:k.colors.gray600},s("lead.otp.desc",{phone:E})),a.createElement(_,{ref:g,name:"_"+name+"-otp",spellCheck:!1,type:"number",placeholder:"Enter OTP",className:"lead-modal__form-control",label:"Phone OTP","data-control":"otp",withAsterisk:!0,pattern:"[0-9]*",value:d,onChange:e=>{u(!0),c(e),f(m&&!e?"OTP is required":void 0)},error:m?v:void 0}),a.createElement(y,{size:"md",color:"primary",className:`lead-modal__btn ${A}`,disabled:!d},s("lead.otp.verify")),a.createElement(y,{type:"button",size:"md",color:"transparent",className:`lead-modal__btn lead-phone-otp-button ${A}`,onClick:()=>{N()},disabled:!!p},s("lead.otp.resend",{timer:p?` (${p}s)`:""}))))},fe=({popupId:e,extraFields:t,onClose:l,onOtherSubmit:s,imageMobile:d,imageDesktop:c,imageOverlayMobile:m,imageOverlayDesktop:u,imageBackground:p,currentLayout:h,title:g,onSubmit:v,showThankyou:k,campaignId:_,campaign_subot_id:E,locale:w})=>{var C,N,S;const T=JSON.parse(t.listBlockAdded),x=JSON.parse(t.actionBlocks),O=JSON.parse(t.textBlocks),j=x.submitBlock.data.url,P=x.submitBlock.data.text,B=x.submitBlock.data.text2,L=x.submitBlock.data.value,$=location.pathname,I=h.includes("Inline")||"Sidebar"===h,U="Slider"===h,[D,R]=n(!0),[H,F]=n(""),W=r(),V=()=>{H?F(""):null==l||l()};if(window.innerWidth<769&&["Fullscreen","Slider"].includes(h))return console.log("😎 Not show fullscreen, slider on mobile "),null;o((()=>{(h.includes("LightBox")||"Fullscreen"==h)&&document.body.classList.add("noscroll"),window.intlTelInputUtils||require("intl-tel-input/build/js/utils"),le.email={},le.phone={}}),[]);const J=r(!1),z=r(!1),{form:G,validateObj:Q}=(({listBlockAdded:e=[],validatingPhoneRef:t,validatingEmailRef:a,campaignId:l,campaign_subot_id:n=[]})=>{const{t:o}=b(),s=i((()=>{const i=["TextBlock","NumberBlock","EmailBlock","PhoneBlock","DateBlock","CheckboxBlock","RadioBlock","DropdownBlock","PhoneOtpBlock","LocationBlock"],r=(e,t)=>a=>{if(c.current.isTouched(e))return void 0===a||""===a||Array.isArray(a)&&0===a.length?o("validator.required"):null==t?void 0:t(a)};return e.filter((e=>i.includes(e.name))).reduce(((e,i)=>"NumberBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(isNaN(Number(e)))return o("validator.number")}))}):"EmailBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))return o("validator.email");a.current=!0,setTimeout((()=>{c.current.setFieldError(i.data.value,"Validating..."),ne(l,n,{email:e}).then((e=>{e?c.current.setFieldError(i.data.value,o(e)):c.current.clearFieldError(i.data.value),a.current=!1})).catch((e=>{console.error(e),c.current.setFieldError(i.data.value,e.message||"Something went wrong"),a.current=!1}))}),200)}))}):"PhoneBlock"===i.name||"PhoneOtpBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(window.intlTelInputUtils&&!window.intlTelInputUtils.isValidNumber(String(e),M.countryCode))return o("validator.phone");t.current=!0,setTimeout((()=>{c.current.setFieldError(i.data.value,"Validating..."),ne(l,n,{phone:e}).then((e=>{e?c.current.setFieldError(i.data.value,o(e)):c.current.clearFieldError(i.data.value),t.current=!1})).catch((e=>{console.error(e),c.current.setFieldError(i.data.value,e.message||"Something went wrong"),t.current=!1}))}),200)}))}):"DateBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(isNaN(Date.parse(e)))return o("validator.date")}))}):Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value)})),{})}),[e.map((e=>e.name)).join(",")]),d=de({validateInputOnChange:!0,clearInputErrorOnChange:!0,validate:s}),c=r(d);return c.current=d,{form:d,validateObj:s}})({listBlockAdded:T,validatingPhoneRef:J,validatingEmailRef:z,campaignId:_,campaign_subot_id:E}),{width:X,height:Z,loaded:ee}=q(p),{width:te,height:ae,loaded:se}=q(d),{width:ce,height:me,loaded:ue}=q(c),pe=se&&ue&&("Fullscreen"!=h||ee),he=a.createElement(a.Fragment,null,a.createElement("style",{dangerouslySetInnerHTML:{__html:`\n .le-newbuilder-overlay {\n background-repeat: no-repeat;\n background-size: cover;\n }\n ${m?`\n .le-newbuilder-overlay {\n background: url(${m}) ;\n }`:""}\n ${u?`\n @media screen and (min-width:768px) {\n .le-newbuilder-overlay {\n background: url(${u}) ;\n }\n }`:""}`}}),a.createElement("div",{id:e,"data-popup-url":$,"data-popup-type":"lightbox-inline",className:`lead-modal lead-modal-wrapper modal--animate-scale ${I?"le-buider-inline":""} ${U?"le-buider-slider":""}`},"Fullscreen"==h?a.createElement("img",{className:"le-only-desktop le-fullscreen-img",draggable:!1,src:p||"",style:{aspectRatio:`${X}/${Z}`}}):null,a.createElement("div",{className:`lead-modal__wrapper le-newbuilder-wrap-${h}`},a.createElement("div",{className:`lead-modal__content le-newbuilder-${h}`},k?a.createElement(K,{title:k.title,titleAlign:k.titleAlign,subtitle:k.subtitle,subtitleAlign:k.subtitleAlign,link:k.link,linkNewTab:k.linkNewTab,linkText:k.linkText,image:k.image}):a.createElement(a.Fragment,null,a.createElement("header",{className:"lead-modal__header"},H?a.createElement("img",{src:f.getAssetPath("lead-otp-thumb.png"),draggable:"false",alt:"",style:{width:"100%"}}):a.createElement(a.Fragment,null,["LightBoxA","InlineA","Sidebar","Slider"].includes(h)?d?a.createElement("img",{draggable:"false",className:"lead-modal__image lead-modal-image-cover",src:d,style:{aspectRatio:`${te}/${ae}`},alt:""}):null:a.createElement(a.Fragment,null,c?a.createElement("img",{draggable:"false",className:"le-only-desktop lead-modal__image lead-modal-image-cover",style:{height:"100%",objectFit:"cover",aspectRatio:`${ce}/${me}`},src:c,alt:""}):null,d?a.createElement("img",{draggable:"false",className:"le-only-mobile lead-modal__image lead-modal-image-cover",src:d,alt:"",style:{aspectRatio:`${te}/${ae}`}}):null))),H&&a.createElement(ye,{phone:H,autoSendWhenOpen:!0,onSuccess:()=>{null==v||v(W.current,G.values)}}),a.createElement("div",{"data-hidden":!!H,className:"lead-modal__body le-newbuilder-overlay"},a.createElement(re,{form:G},a.createElement("form",{ref:W,className:`lead-modal__form ${e}`,onSubmit:e=>{e.preventDefault(),G.setTouched(Object.keys(Q).reduce(((e,t)=>(e[t]=!0,e)),{})),z.current||J.current||setTimeout((()=>{G.onSubmit((e=>{var t,a,l;if(!Object.keys(G.errors).length){if(T.findIndex((e=>"PhoneOtpBlock"===e.name))>-1){const n=null===(a=null===(t=T.find((e=>"PhoneOtpBlock"===e.name)))||void 0===t?void 0:t.data)||void 0===a?void 0:a.value;if(null===(l=e[n])||void 0===l?void 0:l.startsWith("+84"))return void F(e[n])}null==v||v(W.current,e)}}))(e)}),100)}},a.createElement("div",{style:{marginBottom:20}},a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(null===(C=O.titleBlock.data)||void 0===C?void 0:C.align)} ${A}`},g),a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(null===(N=O.titleBlock.data)||void 0===N?void 0:N.align)} ${A}`},O.subtitleBlock.data.value)),a.createElement("div",{className:"lead-modal__form-control-wrapper"},a.createElement(be,{listBlockAdded:T,popupId:e,locale:w,onClose:V,onOtherSubmit:s})),(null===(S=null==x?void 0:x.submitBlock)||void 0===S?void 0:S.isHide)?null:a.createElement(a.Fragment,null,a.createElement("div",{className:`lead-modal__checkbox-wrapper ${A}`},a.createElement("div",{className:"lead-modal__checkbox"},a.createElement("input",{id:"lead-term-checkbox",className:`lead-modal__checkbox__input ${A}`,type:"checkbox","aria-label":"Checkbox label",checked:D,onChange:e=>R(e.currentTarget.checked)}),a.createElement("div",{className:"lead-modal__checkbox__control","aria-hidden":"true"})),a.createElement("label",{htmlFor:"checkbox",className:"lead-modal__checkbox__label"},P," ",a.createElement("span",{style:{fontWeight:"bold"}},a.createElement("a",{target:"blank",href:j||"https://hellobacsi.com/chinh-sach",rel:"noopener noreferrer",style:{textDecoration:"none"}},B)))),a.createElement(y,{size:"md",id:"lead-submit",type:"submit",className:`lead-modal__btn ${A}`,disabled:!D},L))))))),!h.includes("Inline")&&a.createElement(Y,{onClose:V,containerClassName:"close-button-top-right"}))));return pe?h.includes("LightBox")||"Fullscreen"==h||"Slider"==h?he:"Sidebar"==h?a.createElement(ie,{content:he}):h.includes("Inline")?a.createElement(oe,{content:he,inlinePosition:t.popupInlinePosition}):null:null},ke=({popupId:e,link:t,linkText:l,linkNewTab:n,onClose:o,imageMobile:i,imageDesktop:r,currentLayout:s,onOtherSubmit:d})=>{const c=location.pathname,{width:m,height:u,loaded:p}=q(i),{width:h,height:g,loaded:v}=q(r);return p&&v?a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":c,"data-popup-type":"skin_ab"},"SkinA"==s?a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:"le-skin-a-desktop"},a.createElement("div",{style:{position:"relative"}},a.createElement("img",{src:r,style:{aspectRatio:`${h}/${g}`}}),a.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"calc(100% - 15px)"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn js-popup-other-submit"},l)),a.createElement(Y,{onClose:o,containerClassName:"close-button-top-right"})))):"SkinB"==s?a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:""},a.createElement("div",{style:{position:"relative",zIndex:1e4}},a.createElement("img",{src:r,style:{width:"100%",aspectRatio:`${h}/${g}`}}),a.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"100%"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn-mobile js-popup-other-submit"},l)),a.createElement(Y,{containerClassName:"close-button-top-right",onClose:o})))):null,a.createElement("aside",{className:"le-only-mobile"},a.createElement("div",{className:"le-skin-mobile"},a.createElement("div",{style:{position:"relative"}},a.createElement("img",{src:i,style:{width:"100%",aspectRatio:`${m}/${u}`}}),a.createElement("a",{style:{position:"absolute",top:"82%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",maxWidth:"calc(100% - 15px)"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn-mobile js-popup-other-submit"},l)),a.createElement(Y,{containerClassName:"close-button-top-right",svgClassName:"le-mobile-btn",onClose:o}))))):null},_e=({popupId:e,url:t,newTab:l,image:n,onClose:o,onOtherSubmit:i})=>{const{width:r,height:s,loaded:d}=q(n);return d?a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"tab"},a.createElement("div",{className:"le-tab-popup"},a.createElement("div",{style:{position:"relative"}},a.createElement("a",{href:t,target:l?"blank":"_parent",onClick:i},a.createElement("img",{className:"js-popup-other-submit",src:n,style:{aspectRatio:`${r}/${s}`}})),a.createElement(Y,{onClose:o,containerClassName:"close-button-top-right"})))):null},Ee=[],we=[],Ce=[];const Ne=e=>{const t=[...e];for(let e=t.length-1;e>0;e--){const a=Math.floor(Math.random()*(e+1)),l=t[e];t[e]=t[a],t[a]=l}return t},Se=(e="UTC")=>{const t=new Date;return new Date(t.toLocaleString("en-US",{timeZone:e}))},Te=e=>{try{const[t,a]=e.split(" "),[l,n,o]=t.split("-").map(Number),[i,r,s]=a.split(":").map(Number);return new Date(l,n-1,o,i,r,s)}catch(e){return null}};const xe=e=>1===e.formatted_status?function(e){var t;if(1===e.forever)return!0;const a=e.started_at,l=e.ended_at,n=Te(a),o=Te(l);if(!n||!o)return!0;const i=(null===(t=e.site)||void 0===t?void 0:t.id)||1,r=R[i];return!(Se(r).getTime()>o.getTime()&&(Ce.push(e),1))}(e):0===e.formatted_status&&(Ee.push(e),(e=>{var t;const a=(null===(t=e.site)||void 0===t?void 0:t.id)||1,l=e.started_at,n=e.ended_at,o=Te(l),i=Te(n);if(!o||!i)return!1;const r=R[a],s=Se(r).getTime();return s<=i.getTime()&&s>=o.getTime()&&(we.push(e),!0)})(e));let Oe=null;function je({leadApi:e,leadSiteId:t,leadDomain:a,onShowPopup:l,DEBUG_URL:n}){const o=n||("https://"+location.hostname+location.pathname+location.search).toLowerCase();fetch(e+"api/campaign/"+t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:o,ga_client_id:u("_ga")||null})}).then((e=>e.json())).then((e=>{var t,n,i,r,s;if(Pe("List campagin: ",e),U="https://"+location.hostname+location.pathname+location.search,1==e._status){const d=(null===(n=null===(t=e._data)||void 0===t?void 0:t.campaigns)||void 0===n?void 0:n.filter(xe))||[];u("hhg-id")||(p("hhg-id",v(),{domain:"."+a,path:"/"}),Pe("😍 Set HHG ID cookie"));let c=[];c=/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)?d.filter((e=>e.device_types.some((e=>e.id==I.MOBILE)))):d.filter((e=>e.device_types.some((e=>e.id==I.DESKTOP)))),Pe("👓 campaignsDevice",c),Pe("--listCampaignScheduled",Ee),Pe("--listCampaignScheduledToActivated",we),Pe("--listCampaignActiveButExpired",Ce);let m=c.map(((e,t)=>e.targets.filter((e=>e.type==L.LINKS)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1);m=m.filter((e=>{const t=new URL(String(e.target).toLowerCase());if("exact_match"==e.option)return Boolean(o===t.href);if("start_with"==e.option){if(o.includes(String(e.target))){return!e.sub_target.filter((e=>"excluding"==e.option)).map((e=>e.value)).includes(o.split("?")[0])}return!1}}));const h=Array.from(document.getElementsByTagName("META")).filter((e=>"article:tag"==e.getAttribute("property"))).map((e=>e.content));let g=[],b=[];h&&h.length&&(g=c.map(((e,t)=>e.targets.filter((e=>e.type==L.TAGS)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1),b=g.filter((e=>h.includes(e.target))));const y=[...m,...b],f=document.cookie.split("; ").map((e=>e.split("=")[0])),k=f.filter((e=>e.includes("lead_submited")));Pe("--listCampaignCodeSubmited",k);const _=f.filter((e=>e.includes("lead_closed")));Pe("--listCampaignCodeClosed",_);const E=[...k,..._],w=y.filter((e=>!E.some((t=>t.includes(c[e.campaignIndex].code))))),C=Ne(w);if(Pe("--listCampaignValid : ",C),C&&C.length){const e=c[C[0].campaignIndex];Pe("CAMPAIGN_SHOW",e);const{rules:t}=e,a=Number(null===(i=t.find((e=>"time"==e.rule)))||void 0===i?void 0:i.value);Pe("timeoutRule",a);const n=Number(null===(r=t.find((e=>"scroll"==e.rule)))||void 0===r?void 0:r.value);Pe("scrollRule",n);const o=Number(null===(s=t.find((e=>"exclude_sponsored"==e.rule)))||void 0===s?void 0:s.value);Pe("excludeSponsored",o);const d=Boolean(document.querySelector(".hhg-disclaimer-text"));if(Pe("💎 LEAD current page isSponsored",d),d&&o)return;let m="TIME";if(Number.isInteger(a)&&(m="TIME",Pe("✨ SHOW AWESOME POPUP AFTER: ",a," seconds"),Oe&&clearTimeout(Oe),Oe=setTimeout((()=>{null==l||l(e,m)}),1e3*a)),Number.isInteger(n)){m="SCROLL",Pe("✨ SHOW AWESOME AFTER: SCROLL",n," %");const t=document.querySelector(`[data-url="${location.pathname}"]`)||document.querySelector("body"),a=t.getBoundingClientRect().top,o=t.offsetHeight;Pe("👓 Element check scroll: ",t);const i=function(){const t=window.pageYOffset||document.documentElement.scrollTop;let r=0;t>=a&&(r=Math.round((t-a)/(o-innerHeight)*100)),Pe("---Scroll",r,n),r>=n&&(window.removeEventListener("scroll",i),null==l||l(e,m))};window.addEventListener("scroll",i,{passive:!0})}}else Pe("🚧 No lead campaigns on current URL, tags")}})).catch((e=>{Pe("Lead error: ",e)}))}const Pe=(...e)=>{("production"!==process.env.NODE_ENV||process.env.NEXT_PUBLIC_DEPLOY_ENV&&"production"!==process.env.NEXT_PUBLIC_DEPLOY_ENV||"undefined"!=typeof localStorage&&"true"===localStorage.getItem("hhg_debug"))&&console.log(...e)};const Be=({campaign:e,action:t,onSubmit:l,onClose:n,showThankyou:i,locale:d})=>{var c,m;b();const{apiUrl:h,siteDomain:g}=s(V);o((()=>{const e=u("_ga")||null;fetch(`${h}api/campaign/${_}/impression`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t,url:location.href.toLowerCase(),title_article:document.title,cookie_id:u("hhg-id"),ga_client_id:e})})}),[]);const{extra_fields:y,image:f,image_desktop:k,code:_,image_background:E,image_overlay_mobile:w,image_overlay_desktop:C}=e,{currentLayout:N}=y,S=y.imageBlocks?JSON.parse(y.imageBlocks):{},T=JSON.parse(y.actionBlocks),x=JSON.parse(y.textBlocks);let O=(null===(m=null===(c=null==x?void 0:x.titleBlock)||void 0===c?void 0:c.data)||void 0===m?void 0:m.value)||"";const j={1:{},2:{},3:{}},P=r("lead-modal-"+v()),B=function(e="Xin chao {{category_2}} extra"){if(e.includes("{{category_")){const t="{{category_".length,a=e.search("{{category_");return+e.charAt(t+a)}return null}(O);if(B){Pe("⚡️ Has categoryLevel",B);const e=Array.from(document.getElementsByTagName("META")),t=e.find((e=>e.name===`content_category_${B}`)),a=e.find((e=>e.name===`content_category_en_${B}`));if(!t||!a)return Pe("⚡️ No META TAG for categoryLevel, not show popup",B),null;j[B]={value:t.content,value_en:a.content},O=O.replace(`{{category_${B}}}`,t.content),Pe("⚡️ Set categoryData ",B)}else Pe("⚡️ No categoryLevel",B);const L=()=>{var t,a,l,o;if(Pe("👌 Other submit click"),document.body.classList.remove("noscroll"),N.includes("Skin")){const e=document.querySelector("#masthead");e&&(e.style.top="0px !important;")}const i=Number(null!==(a=null===(t=e.rules.find((e=>"days_to_show_again"==e.rule)))||void 0===t?void 0:t.value)&&void 0!==a?a:7),r=Number(null!==(o=null===(l=e.rules.find((e=>"show_again_after_submit"==e.rule)))||void 0===l?void 0:l.value)&&void 0!==o?o:0);0===r&&(Pe("⛔ Popup never show again!"),p(`lead_submited_${_}`,`target_${y.popupVersion}`,{domain:"."+g,path:"/"})),1==r&&(Pe(`⌛ Popup will show again after ${i} days!`),p(`lead_submited_${_}`,`target_${y.popupVersion}`,{domain:"."+g,days:i,path:"/"}));const s=u("_ga")||null,d={url:location.href.toLowerCase(),title_article:document.title,meta:[],cookie_id:u("hhg-id"),ga_client_id:s};B&&(d.category=j[B].value_en),fetch(`${h}api/campaign/${_}/lead`,{method:"POST",body:JSON.stringify(d),headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then((e=>e.json())).then((e=>{"error"===e.status&&Pe(e)})).catch((e=>{Pe("Error:",e)})),null==n||n()};return"CenterTab"===N?a.createElement(J,{popupId:P.current,url:S.imageMobile.data.url,newTab:S.imageMobile.data.newtab,imageMobile:f,imageDestkop:k,onClose:n,onOtherSubmit:L}):"Tab"===N?a.createElement(_e,{popupId:P.current,url:S.imageMobile.data.url,newTab:S.imageMobile.data.newtab,image:f,onClose:n,onOtherSubmit:L}):"Floating"===N?a.createElement(z,{popupId:P.current,title:O,titleAlign:x.titleBlock.data.align,subtitle:x.subtitleBlock.data.value,subtitleAlign:x.subtitleBlock.data.align,url:T.linkButtonBlock.data.url,urlText:T.linkButtonBlock.data.value,newTab:T.linkButtonBlock.data.newtab,imageMobile:f,imageDesktop:k,onClose:n,onOtherSubmit:L}):N.includes("LightBox")||N.includes("Inline")||"Fullscreen"==N||"Sidebar"==N||"Slider"==N?a.createElement(fe,{popupId:P.current,extraFields:y,onClose:n,onOtherSubmit:L,imageMobile:f,imageDesktop:k,imageBackground:E,currentLayout:N,title:O,onSubmit:(e,t)=>l(e,t,B,j),key:N,imageOverlayDesktop:C,imageOverlayMobile:w,showThankyou:i,campaignId:e.id,campaign_subot_id:e.bot_id||[],locale:d}):N.includes("Skin")?a.createElement(ke,{popupId:P.current,link:T.linkButtonBlock.data.url,linkNewTab:!!T.linkButtonBlock.data.newtab,linkText:T.linkButtonBlock.data.value,onClose:n,onOtherSubmit:L,imageMobile:f,imageDesktop:k,currentLayout:N}):null},Le=({apiUrl:e,siteDomain:l,siteId:s,locale:h,apiSubotUrl:v,DEBUG_URL:b})=>{var y;const f=r(),k=r(Date.now()),{apiUrl:_}=i((()=>{let t=e;return t.includes("localhost")&&(t="https://dev.leadgen.hellobacsi.com/"),{apiUrl:t}}),[e,l,s]),[E,w]=n(null),[C,N]=n(""),[S,x]=n(null);o((()=>{G.apiLeadUrl=_,G.apiSubotUrl=v}),[_,v]);const O=(e,t)=>{w(e),N(t)},j=()=>{var e,t;if(!E)return;Pe(`👋👋👋 CLOSE POPUP ${E.code} 👋👋👋`);const a=Number(null===(e=E.rules.find((e=>"show_again_after_exit"==e.rule)))||void 0===e?void 0:e.value),n=Number(null===(t=E.rules.find((e=>"days_to_show_again"==e.rule)))||void 0===t?void 0:t.value);0==a&&p(`lead_closed_${E.code}`,`target_${E.extra_fields.popupVersion}`,n?{domain:"."+l,days:n,path:"/"}:{domain:"."+l,path:"/"}),document.body.classList.remove("noscroll"),fetch(`${_}api/campaign/${E.code}/popup_exit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"CLICK",url:location.href.toLowerCase(),title_article:document.title,cookie_id:u("hhg-id"),duration:Math.ceil((Date.now()-k.current)/1e3)})}),w(null),x(null)};o((()=>{if(window.next){const e=d((e=>{Pe("--🌻 routeChangeComplete",e,Date.now());const t=location.pathname;j(),document.querySelectorAll(`[data-popup-url="${t}"]`).length?Pe("🔥 This URL page has show popup!"):(Pe("--Process checkShowPopup"),je({leadApi:_,leadDomain:l,leadSiteId:s,onShowPopup:O,DEBUG_URL:b})),f.current&&window.removeEventListener("scroll",f.current)}),500);window.next.router.events.on("routeChangeComplete",e)}je({leadApi:_,leadDomain:l,leadSiteId:s,onShowPopup:O,DEBUG_URL:b})}),[]);return o((()=>{E&&(k.current=Date.now())}),[E]),a.createElement(V.Provider,{value:{apiUrl:_,siteDomain:l,siteId:s,locale:h}},a.createElement(m.Provider,{value:{locale:h,values:W(h)}},c(a.createElement(a.Fragment,null,"2.1"===(null===(y=null==E?void 0:E.extra_fields)||void 0===y?void 0:y.popupVersion)&&a.createElement(Be,{campaign:E,action:C,onSubmit:(e,a,n,o)=>t(void 0,void 0,void 0,(function*(){var t,i,r,s,d,c,m,h,g,v,b;if(!a)return;Pe("submitHandler",n,o);const y=Object.keys(a).map((e=>({name:e,value:String(a[e])}))),f=u("_ga")||null;window.intlTelInputUtils||(yield require("intl-tel-input/build/js/utils"));const k={url:location.href.toLowerCase(),title_article:document.title,meta:y.map((t=>{var a,l;const n=(null===(a=e.querySelector(`*[name="${t.name}"]`))||void 0===a?void 0:a.getAttribute("data-control"))||(null===(l=e.querySelector(`*[data-extra][data-name="${t.name}"]`))||void 0===l?void 0:l.getAttribute("data-control"))||"text",o="tel"===n?window.intlTelInputUtils.formatNumber(String(t.value),null==M?void 0:M.countryCodeNumber,2).replace(/\s+/g,""):"date"===n?T(t.value).format("YYYY-MM-DD"):t.value;return{key:t.name,value:o,control:n,is_sent_mailchimp:e.querySelector(`div[data-name="${t.name}-mailchimp"]`)?"true":"false"}})),cookie_id:u("hhg-id"),ga_client_id:f};n&&o[n].value_en&&(k.category=o[n].value_en);const w=Number((null===(i=null===(t=E.rules)||void 0===t?void 0:t.find((e=>"days_to_show_again"===e.rule)))||void 0===i?void 0:i.value)||7),C=Number((null===(s=null===(r=E.rules)||void 0===r?void 0:r.find((e=>"show_again_after_submit"===e.rule)))||void 0===s?void 0:s.value)||0);if(0==C&&(Pe("⛔ Popup never show again!"),p(`lead_submited_${E.code}`,`target_${E.extra_fields.targetType}`,{domain:"."+l,path:"/"})),1==C&&(Pe(`⌛ Popup will show again after ${w} days!`),p(`lead_submited_${E.code}`,`target_${E.extra_fields.targetType}`,{domain:"."+l,days:w,path:"/"})),fetch(`${_}api/campaign/${E.code}/lead`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)}),"notshow"==E.extra_fields.popupShowThankYou)return j(),void document.body.classList.remove("noscroll");let N=!0;const S=E.thank_you_image||`${_}admin/img/thanksyou.png`;let O,P,B=E.extra_fields.popupThankyouTitle||"Thank you.",L=E.extra_fields.popupThankyouDesc||"We appreciate your time!",$="",I="",A="";if("2.1"==E.extra_fields.popupVersion){const e=E.extra_fields,t=JSON.parse(e.listBlockThankyou),a=t.find((e=>"TitleBlock"==e.name)),l=t.find((e=>"SubtitleBlock"==e.name)),n=t.find((e=>"LinkButtonBlock"==e.name));B=(null===(d=null==a?void 0:a.data)||void 0===d?void 0:d.value)||"",$=(null===(c=null==a?void 0:a.data)||void 0===c?void 0:c.align)||"",L=(null===(m=null==l?void 0:l.data)||void 0===m?void 0:m.value)||"",I=(null===(h=null==l?void 0:l.data)||void 0===h?void 0:h.align)||"",O=(null===(g=null==n?void 0:n.data)||void 0===g?void 0:g.value)||"",P=(null===(v=null==n?void 0:n.data)||void 0===v?void 0:v.newtab)||!1,A=(null===(b=null==n?void 0:n.data)||void 0===b?void 0:b.url)||"";const o=E.extra_fields.currentLayout;["SkinA","SkinB","Floating","Tab","CenterTab"].includes(o)&&(N=!1)}x(N?{title:B,titleAlign:$,subtitle:L,subtitleAlign:I,link:A,linkNewTab:P,linkText:O,image:S}:null),sessionStorage.getItem("insider_object")?window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")):window.insider_object={user:{email:"",phone_number:"",gdpr_optin:!0,sms_optin:!0,email_optin:!0}},y.map((e=>{const t=e.name,a=e.value;"tel"==t?window.insider_object.user.phone_number=a:"email"==t&&(window.insider_object.user.email=a)})),sessionStorage.setItem("insider_object",JSON.stringify(window.insider_object))})),onClose:j,showThankyou:S,locale:h})),g())))};export{Le as LeadGen};
1
+ import{_ as e,a as t}from"./tslib.es6-9315bdbc.js";import a,{createContext as l,useState as n,useEffect as o,useMemo as i,useRef as r,useContext as s}from"react";import d from"lodash/debounce";import{createPortal as c}from"react-dom";import{T as m}from"./translationsContext-48c3884a.js";import{g as u,s as p}from"./cookieHelper-f34ae4b5.js";import{b as h,a as g}from"./utils-5a3d6877.js";import{v1 as v}from"uuid";import{u as b}from"./useTranslations-bd79fd17.js";import"./index.styled-ffad8868.js";import{B as y}from"./index-ade91020.js";import{CommonGAssets as f}from"./gAssets.js";import"@mantine/core";import"./index.styled-472c3814.js";import"./index-e259b1f3.js";import{t as k}from"./theme-1b26637c.js";import"./index.styled-78fde46a.js";import"string-format";import"./index-53cacbee.js";import{e as _,R as E,x as w,l as C,q as N,N as S}from"./index.styles-768e9218.js";import T from"dayjs";import"./screenSizeContext-af9362cd.js";import"styled-components";import"./index-d25e4ea9.js";import"./isProduction-020306cd.js";import"./Onboarding-21d12043.js";import"./index-1a0b2606.js";import"@mantine/hooks";import"./index.styled-ed037548.js";import"date-fns";import"react-day-picker/DayPickerInput";import"./index.styled-5a0b52e8.js";import"./index-df92f1fe.js";import"lodash/throttle";import"keen-slider/react";import"./types-769cb1aa.js";import"react-hook-form";import"date-fns/locale/en-US";import"date-fns/locale/id";import"date-fns/locale/vi";import"date-fns/locale/zh-TW";import"./index.styled-e6aaa693.js";import{S as x}from"./index-a5f1692a.js";import{M as O}from"./index.styled-5dcc0941.js";import{createFormContext as j}from"@mantine/form";import"yup";import{T as P}from"./index-f0daa1f1.js";import{H as B}from"./index-6cdb2b0b.js";import"@mantine/dates";import"@mantine/carousel";import"./index-63efd893.js";import"./index-ff727949.js";import"@hookform/resolvers/yup";import"./index-41820b9b.js";import"./useUniqueId-1bfdbec1.js";import"./index-d8bbe3c3.js";import"./index-1a6781ec.js";import"slugify";import"./routing-2f9c1504.js";import"dayjs/plugin/relativeTime";import"./index-fc3ca38e.js";import"./Visible-86c2551f.js";const L={LINKS:1,TAGS:2};let $="https://dev.leadgen.hellobacsi.com/";const I={MOBILE:1,DESKTOP:2};let A="";$.includes("localhost")&&($="https://dev.leadgen.hellobacsi.com/"),location.hostname.includes("marrybaby.vn")&&(A="pink");let U="https://"+location.hostname+location.pathname+location.search;U=U.toLowerCase(),sessionStorage.getItem("insider_object")&&(window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")));const D={"vi-VN":{popupLang:"vi",countryCode:"vn",countryCodeNumber:84},"id-ID":{popupLang:"id",countryCode:"id",countryCodeNumber:62},"th-TH":{popupLang:"th",countryCode:"th",countryCodeNumber:66},"ms-MY":{popupLang:"ms",countryCode:"my",countryCodeNumber:60},"zh-TW":{popupLang:"zh",countryCode:"tw",countryCodeNumber:886},"km-KH":{popupLang:"km",countryCode:"kh",countryCodeNumber:855},"my-MM":{popupLang:"my",countryCode:"mm",countryCodeNumber:95},"hi-IN":{popupLang:"hi",countryCode:"in",countryCodeNumber:91}},M=D[document.documentElement.lang]||D["vi-VN"];const R={1:"Asia/Ho_Chi_Minh",10:"Asia/Ho_Chi_Minh",11:"Asia/Ho_Chi_Minh",12:"Asia/Ho_Chi_Minh",2:"Asia/Jakarta",3:"Asia/Bangkok",4:"Asia/Phnom_Penh",5:"Asia/Kuala_Lumpur",6:"Asia/Taipei",7:"Asia/Yangon",8:"Asia/Kolkata",9:"Asia/Manila"};var H={"validator.required":"This field is required.","validator.remote":"Please fix this field.","validator.email":"Please enter a valid email address.","validator.phone":"Please input correct phone number.","validator.url":"Please enter a valid URL.","validator.date":"Please enter a valid date.","validator.dateISO":"Please enter a valid date (ISO).","validator.number":"Please enter a valid number.","validator.digits":"Please enter only digits.","validator.creditcard":"Please enter a valid credit card number.","validator.equalTo":"Please enter the same value again.","validator.accept":"Please enter a value with a valid extension.","validator.maxlength":"jQuery.validator.format('Please enter no more than {0} characters.","validator.minlength":"jQuery.validator.format('Please enter at least {0} characters.","validator.rangelength":"jQuery.validator.format('Please enter a value between {0} and {1} characters long.","validator.range":"jQuery.validator.format('Please enter a value between {0} and {1}.","validator.max":"jQuery.validator.format('Please enter a value less than or equal to {0}.","validator.min":"jQuery.validator.format('Please enter a value greater than or equal to {0}.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"};const F={"en-PH":H,"vi-VN":{"validator.required":"Vui lòng điền mục này","validator.email":"Vui lòng điền email có thật.","validator.number":"Vui lòng điền số có thật","validator.digits":"Vui lòng chỉ điền số","validator.maxlength":"Vui lòng điền dưới {0} số","validator.minlength":"Vui lòng điền hơn {0} số","validator.remote":"Hãy sửa cho đúng.","validator.url":"Hãy nhập URL.","validator.date":"Hãy nhập ngày.","validator.dateISO":"Hãy nhập ngày (ISO).","validator.creditcard":"Hãy nhập số thẻ tín dụng.","validator.equalTo":"Hãy nhập thêm lần nữa.","validator.extension":"Phần mở rộng không đúng.","validator.rangelength":"Hãy nhập từ {0} đến {1} kí tự.","validator.range":"Hãy nhập từ {0} đến {1}.","validator.max":"Hãy nhập từ {0} trở xuống.","validator.min":"Hãy nhập từ {0} trở lên.","validator.phone":"Nhập đúng định dạng số điện thoại","validator.emailUsed":"Email này đã được sử dụng cho chiến dịch.","validator.phoneUsed":"Số điện thoại này đã được sử dụng cho chiến dịch.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"hi-IN":{"validator.required":"इस क्षेत्र की आवश्यकता है।","validator.email":"कृपया एक मान्य ईमेल पता दर्ज करें","validator.number":"कृपया एक वैध संख्या दर्ज करें","validator.digits":"कृपया केवल अंक दर्ज करें","validator.maxlength":"कृपया {0} अक्षर से अधिक दर्ज न करें","validator.minlength":"कृपया कम से कम {0} अक्षर दर्ज करें","validator.phone":"कृपया एक वैध संख्या दर्ज करें","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"id-ID":{"validator.required":"Kolom ini wajib diisi","validator.email":"Tolong daftarkan email yang valid","validator.number":"Tolong daftarkan nomor telepon yang valid","validator.digits":"Tolong masukkan angka saja","validator.maxlength":"Jangan memasukkan lebih dari {0} karakter","validator.minlength":"Tolong ketik sedikitnya {0} karakter","validator.phone":"Tolong daftarkan nomor telepon yang valid","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"ms-MY":{"validator.required":"Bahagian ini wajib diisi.","validator.email":"Sila masukkan alamat emel yang sah.","validator.number":"Sila masukkan no telefon yang sah.","validator.digits":"Sila masukkan nombor digit sahaja.","validator.maxlength":"Sila masukkan tidak lebih dari {0} aksara","validator.minlength":"Sila masukkan sekurang-kurangnya {0} aksara","validator.phone":"Sila masukkan no telefon yang sah.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"my-MM":{"validator.required":"ဒီနေရာမှာ ဖြည့်ဖို့ လိုအပ်ပါတယ်","validator.email":"မှန်ကန်သော အီးမေးလ်လိပ်စာထည့်သွင်းပါ","validator.number":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.digits":"နံပါတ်များသာဖြည့်ပါ","validator.maxlength":"ကျေးဇူးပြု၍ {0} ထပ်မပိုသော ဂဏန်းများသာဖြည့်ပါ","validator.minlength":"ကျေးဇူးပြု၍ အနည်းဆုံး {0} ဂဏန်းဖြည့်ပါ","validator.phone":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"km-KH":{"validator.required":"ព័ត៌មាន​ចាំបាច់​ដែល​ត្រូវ​បំពេញ","validator.email":"សូម​វាយ​អាសយដ្ឋាន​អ៊ីម៉ែល​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.number":"សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.digits":"វាយ​បញ្ចូល​បាន​តែ​លេខ​ប៉ុណ្ណោះ","validator.maxlength":"សូម​វាយ​បញ្ចូលកុំ​ឲ្យ​លើស {0} តួអក្សរ","validator.minlength":"សូម​វាយ​បញ្ចូល​តិច​បំផុត {0} តួអក្ស","validator.phone":"សូម​វាយបញ្ចូល​លេខ​ឲ្យ​បាន​ត្រឹមត្រូវ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"zh-TW":{"validator.required":"此為必填欄位","validator.email":"請填入有效的 email 地址","validator.number":"請填入有效的電話號碼","validator.digits":"此欄位僅能輸入數字","validator.maxlength":"請輸入少於 {0} 位數","validator.minlength":"請輸入至少 {0} 位數","validator.phone":"請填入有效的電話號碼","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"th-TH":{"validator.required":"ต้องระบุข้อมูลในช่องนี้","validator.email":"กรุณาใส่อีเมล์ที่ถูกต้อง","validator.number":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.digits":"กรุณาส่เฉพาะตัวเลข","validator.maxlength":"กรุณาใส่ตัวเลขมากกว่า {0} หลัก","validator.minlength":"กรุณาใส่ตัวเลขอย่างน้อย {0} หลัก","validator.phone":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"tl-PH":H},W=e=>{const t=F[e];return t||F["en-PH"]},V=l({}),q=e=>{const[t,a]=n(16),[l,i]=n(9),[r,s]=n(!1);return o((()=>{if(s(!1),e){const t=new Image;t.addEventListener("load",(()=>{a(t.naturalWidth),i(t.naturalHeight),s(!0)})),t.addEventListener("error",(()=>{a(16),i(9),s(!0)})),t.src=e}else a(16),i(9),s(!0)}),[e]),{loaded:r,width:t,height:l}},Y=({onClose:e,containerClassName:t,svgClassName:l})=>a.createElement("button",{onClick:e,className:`le-newbuilder-close-button js-modal__close ${t||""}`},a.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:l},a.createElement("circle",{cx:"16",cy:"16",r:"16",fill:"white"}),a.createElement("path",{d:"M16 17.05L10.925 22.125C10.7917 22.2584 10.621 22.329 10.413 22.337C10.2044 22.3457 10.025 22.275 9.87502 22.125C9.72502 21.975 9.65002 21.8 9.65002 21.6C9.65002 21.4 9.72502 21.225 9.87502 21.075L14.95 16L9.87502 10.925C9.74169 10.7917 9.67102 10.6207 9.66302 10.412C9.65436 10.204 9.72502 10.025 9.87502 9.87502C10.025 9.72502 10.2 9.65002 10.4 9.65002C10.6 9.65002 10.775 9.72502 10.925 9.87502L16 14.95L21.075 9.87502C21.2084 9.74169 21.3794 9.67069 21.588 9.66202C21.796 9.65402 21.975 9.72502 22.125 9.87502C22.275 10.025 22.35 10.2 22.35 10.4C22.35 10.6 22.275 10.775 22.125 10.925L17.05 16L22.125 21.075C22.2584 21.2084 22.329 21.379 22.337 21.587C22.3457 21.7957 22.275 21.975 22.125 22.125C21.975 22.275 21.8 22.35 21.6 22.35C21.4 22.35 21.225 22.275 21.075 22.125L16 17.05Z",fill:"#595959"}))),J=({popupId:e,url:t,newTab:l,imageDestkop:n,imageMobile:o,onClose:i,onOtherSubmit:r})=>{const{width:s,height:d,loaded:c}=q(o),{width:m,height:u,loaded:p}=q(n);return c&&p?a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"center_tab"},a.createElement("div",{className:"le-center-tab-popup"},a.createElement("div",{style:{position:"relative"}},a.createElement("a",{className:"js-popup-other-submit",href:t,target:l?"blank":"_parent",onClick:r},a.createElement("img",{className:"le-only-mobile",src:o,style:{aspectRatio:`${s}/${d}`}}),a.createElement("img",{className:"le-only-desktop",src:n,style:{aspectRatio:`${m}/${u}`}})),a.createElement(Y,{onClose:i,containerClassName:"close-button-top-right"})))):null},z=({popupId:e,url:t,title:l,urlText:n,titleAlign:o,subtitle:i,subtitleAlign:r,newTab:s,imageDesktop:d,imageMobile:c,onClose:m,onOtherSubmit:u})=>{const{width:p,height:h,loaded:g}=q(c),{width:v,height:b,loaded:y}=q(d);return g&&y?a.createElement("div",{id:e,className:"lead-modal-wrapper lead-floating-wrapper","data-popup-url":location.pathname,"data-popup-type":"floating"},a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:"le-floating-desktop"},a.createElement("div",{className:"le-floating-desktop-wrap",style:{position:"relative",background:"#fff"}},d?a.createElement("div",null,a.createElement("img",{style:{maxWidth:120,borderTopLeftRadius:5,borderBottomLeftRadius:5,aspectRatio:`${v}/${b}`},src:d})):null,a.createElement("div",{style:{padding:20}},a.createElement("div",{className:`le-floating-desktop-title le-text-align-${o}`},l),a.createElement("div",{className:`le-floating-desktop-desc le-text-align-${r}`},i)),a.createElement("a",{target:s?"blank":"_parent",style:{marginLeft:35,textDecoration:"none"},href:t},a.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:u},n)),a.createElement(Y,{onClose:m,containerClassName:"close-button-top-right"})))),a.createElement("aside",{className:"le-only-mobile"},a.createElement("div",{className:"le-floating-mobile"},a.createElement("div",{className:"le-floating-mobile-wrap",style:{position:"relative",background:"#fff"}},a.createElement("aside",{style:{display:"flex",justifyContent:"space-between"}},a.createElement("div",null,a.createElement("div",{className:`le-floating-mobile-title le-text-align-${o}`},l),a.createElement("div",{className:`le-floating-mobile-desc le-text-align-${r}`},i)),c?a.createElement("div",null,a.createElement("img",{style:{marginLeft:15,marginTop:4,maxWidth:100,aspectRatio:`${p}/${h}`},src:c})):null),a.createElement("div",{style:{textAlign:"center",marginTop:10}},a.createElement("a",{target:s?"blank":"_parent",href:t,style:{textDecoration:"none"}},a.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:u},n))),a.createElement(Y,{onClose:m,containerClassName:"close-button-top-right"}))))):null},K=({title:e,titleAlign:t,subtitle:l,subtitleAlign:n,link:o,linkNewTab:i,linkText:r,image:s})=>{const{width:d,height:c,loaded:m}=q(s);return m?a.createElement("div",{className:"lead-modal__thank-you"},a.createElement("div",{style:{width:"100%"}},a.createElement("img",{src:s,style:{maxHeight:162,objectFit:"cover",aspectRatio:`${d}/${c}`}}),e&&a.createElement("h1",{className:`le-thankyou-title le-text-align-${t}`},e),l&&a.createElement("p",{className:`le-thankyou-subtitle le-text-align-${n}`},l),r&&a.createElement("div",null,a.createElement("a",{href:o,target:i?"_blank":"parrent",rel:"noreferrer"},a.createElement("button",{className:`lead-modal__btn ${A}`},r))))):null};const G=new class{constructor(){this.apiLeadUrl="https://dev.leadgen.hellobacsi.com/",this.apiSubotUrl="https://staging-service-subot.hellohealthgroup.com/"}},Q={call(t){var{url:a,data:l}=t,n=e(t,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${G.apiLeadUrl}${a}`,n).then((e=>e.json())).catch((e=>({})))}},X={call(t){var{url:a,data:l}=t,n=e(t,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${G.apiSubotUrl}${a}`,n).then((e=>e.json())).catch((e=>({})))}},Z=({bot_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),X.call({url:"frontend/api/subot-campaign/check",method:"post",data:{bot_id:e,email:t,phone:l}})},ee=({campaign_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),Q.call({url:"api/subot-campaign/check",method:"post",data:{campaign_id:e,email:t,phone:l}})},te=({phone:e})=>Q.call({url:"api/sms/otp",method:"post",data:{phone_number:e.replace("+","")}}),ae=({phone:e,otp:t})=>Q.call({url:"api/sms/verify",method:"post",data:{otp_code:t,phone_number:e.replace("+","")}}),le={email:{},phone:{}},ne=(e,a,l)=>t(void 0,void 0,void 0,(function*(){const n="email"in l?"email":"phone",o="email"in l?l.email:l.phone,i="email"in l?"validator.emailUsed":"validator.phoneUsed";if(le[n][o]){if(le[n][o].value)return i;if(!le[n][o].value&&le[n][o].expire>Date.now())return""}const r=yield((e,a,l)=>t(void 0,void 0,void 0,(function*(){const t="email"in l?"email":"phone",n="email"in l?l.email:l.phone,o="email"in l?"validator.emailUsed":"validator.phoneUsed",i=yield ee({campaign_id:[e],[t]:n});return"SubmitLeadWithBotId_ERR_001"===i._errorCode||"SubmitLeadWithBotId_ERR_002"===i._errorCode||a.length&&"CheckSuBotLeadTool_ERR_001"===(yield Z({bot_id:a,[t]:n}))._errorCode?o:void 0})))(e,a,l);return le[n][o]=r?{value:!0}:{value:!1,expire:Date.now()+6e4},r})),oe=({content:e,inlinePosition:t})=>{const a=i((()=>{if(!t)return null;const e=document.querySelectorAll(`[data-url="${location.pathname}"] .body-content`),a=Array.from(e).reduce(((e,t)=>[...e,...Array.from(t.children)]),[]);if(null==a?void 0:a.length){const e=a.filter((e=>"P"===e.nodeName)),l=a.filter((e=>"H2"===e.nodeName));let n=null;switch(t){case"1th":n=e[0];break;case"2th":n=e[1];break;case"3th":n=e[2];break;case"4th":n=e[3];break;case"5th":n=e[4];break;case"6th":n=e[5];break;case"7th":n=e[6];break;case"8th":n=e[7];break;case"9th":n=e[8];break;case"10th":n=e[9];break;case"11th":n=e[10];break;case"12th":n=e[11];break;case"lastP":n=e[e.length-1];break;case"1thH2":n=l[0];break;case"2thH2":n=l[1];break;case"3thH2":n=l[2];break;case"4thH2":n=l[3];break;case"5thH2":n=l[4];break;case"6thH2":n=l[5];break;case"7thH2":n=l[6];break;case"8thH2":n=l[7];break;case"9thH2":n=l[8];break;case"10thH2":n=l[9];break;case"lastH2":n=l[l.length-1]}if(n){if(n.parentElement.querySelector(".inline-lead-wrapper"))return n.parentElement.querySelector(".inline-lead-wrapper");{const e=document.createElement("div");return e.classList.add("inline-lead-wrapper"),n.nextElementSibling?n.parentElement.insertBefore(e,n.nextElementSibling):n.parentElement.appendChild(e),e}}}}),[t]);return t&&a?c(e,a):null},ie=({content:e})=>{const t=i((()=>{const e=Array.from(document.querySelectorAll(".hc2-sidebar-with-ads,.page-main-col .right-col.f-right,.hhg-lead-sidebar"));return e.forEach((e=>{if(e.querySelector(".sidebar-lead-modal-wrapper"))return;const t=document.createElement("div");t.classList.add("sidebar-lead-modal-wrapper"),e.prepend(t)})),e.map((e=>e.querySelector(".sidebar-lead-modal-wrapper")))}),[]);return a.createElement(a.Fragment,null,t.map((t=>c(e,h(t,"sidebar-lead-modal-wrapper")))))},[re,se,de]=j(),ce="undefined"==typeof window,me={VN:"vi",ID:"id",TH:"th",MY:"ms",TW:"zh-TW",KH:"km",MM:"my",IN:"hi",PH:"en"},ue=(e="",a="",l="",i=500)=>{const[r,s]=n([]),[d,c]=n(!1);return o((()=>{let n;return e?n=window.setTimeout((()=>t(void 0,void 0,void 0,(function*(){var n;if(e)try{c(!0);const o=yield((e="",a="",l="vi")=>t(void 0,void 0,void 0,(function*(){return new Promise(((t,n)=>{if(!e)return n("Need valid text input");if(ce)return n("Need valid window object");try{(new window.google.maps.places.AutocompleteService).getPlacePredictions(Object.assign(Object.assign({input:e},a?{componentRestrictions:{country:a}}:{}),{language:me[l]}),t)}catch(e){n(e)}}))})))(e,a,l);s(!(n=o)||n.length<1?[]:n.map((e=>({placeId:e.place_id,description:e.description}))))}catch(e){console.error(e)}finally{c(!1)}else s([])}))),i):r.length&&s([]),()=>{window.clearTimeout(n)}}),[e,i,a]),{isLoading:d,predictions:r}},pe=["places"],he=({name:e,placeholder:t,locale:l})=>{var s;const d=se(),[c,m]=n(""),[u,p]=n(""),{predictions:h}=ue(c||"15 Lê","","tl-PH"===l?"en":null===(s=null==l?void 0:l.split("-"))||void 0===s?void 0:s[0]),[g,v]=n(null),[b,y]=n(!1),f=r(Math.random().toString(36).substring(7)),k=i((()=>{const e=h.map((e=>({value:e.description,label:e.description}))),t=e.find((e=>e.value===u));return!u||t?e:[{value:u,label:u}].concat(e)}),[h,u]);return o((()=>{var e,t,a;(null===(a=null===(t=null===(e=null===window||void 0===window?void 0:window.google)||void 0===e?void 0:e.maps)||void 0===t?void 0:t.places)||void 0===a?void 0:a.AutocompleteService)?y(!0):import("@react-google-maps/api").then((e=>{v((()=>e.LoadScript)),setTimeout((()=>{y(!0)}),200)}))}),[]),b?a.createElement(a.Fragment,null,g&&a.createElement(g,{googleMapsApiKey:"AIzaSyB9QmhfEYcy2wj5X3Fl38aCD5UkET6n82M",libraries:pe,loadingElement:a.createElement(a.Fragment,null)}),a.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":e,"data-control":"text"}),a.createElement(x,Object.assign({className:"lead-modal__form-control",label:t,placeholder:t,withAsterisk:!0,name:e,data:k,searchValue:c,onSearchChange:e=>{m(e)},filter:()=>!0,clearable:!0,searchable:!0,onChange:e=>p(e||""),icon:a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{d:"M9.99999 9.79167C10.4028 9.79167 10.7467 9.64944 11.0317 9.365C11.3161 9.08 11.4583 8.73611 11.4583 8.33333C11.4583 7.93056 11.3161 7.58667 11.0317 7.30167C10.7467 7.01722 10.4028 6.875 9.99999 6.875C9.59721 6.875 9.25332 7.01722 8.96832 7.30167C8.68388 7.58667 8.54166 7.93056 8.54166 8.33333C8.54166 8.73611 8.68388 9.08 8.96832 9.365C9.25332 9.64944 9.59721 9.79167 9.99999 9.79167ZM9.99999 17.875C9.90277 17.875 9.80555 17.8611 9.70832 17.8333C9.6111 17.8056 9.52082 17.7569 9.43749 17.6875C7.46527 15.8958 5.98971 14.2361 5.01082 12.7083C4.03138 11.1806 3.54166 9.77778 3.54166 8.5C3.54166 6.48611 4.1911 4.87833 5.48999 3.67667C6.78832 2.47556 8.29166 1.875 9.99999 1.875C11.7083 1.875 13.2119 2.47556 14.5108 3.67667C15.8092 4.87833 16.4583 6.48611 16.4583 8.5C16.4583 9.77778 15.9689 11.1806 14.99 12.7083C14.0105 14.2361 12.5347 15.8958 10.5625 17.6875C10.4792 17.7569 10.3889 17.8056 10.2917 17.8333C10.1944 17.8611 10.0972 17.875 9.99999 17.875Z",fill:"#8C8C8C"})),autoComplete:"no-auto-complete-"+f.current,rightSection:a.createElement(a.Fragment,null)},d.getInputProps(e)))):a.createElement("div",{style:{height:73}})},ge=({children:e,align:t})=>a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(t||"")} ${A}`},e),ve=({children:e,align:t})=>a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(t||"")} ${A}`},e),be=({listBlockAdded:e,popupId:t,locale:l,onClose:n,onOtherSubmit:o})=>{const i=se();return a.createElement(a.Fragment,null,e.map(((e,r)=>{const{name:s="",data:d={}}=e||{},{placeholder:c,value:m,align:u,listQuestion:p,isSendMailChimp:h=!1,newtab:g,url:v}=d;switch(s){case"TitleBlock":return a.createElement(ve,{key:r,align:u},m);case"SubtitleBlock":return a.createElement(ge,{key:r,align:u},m);case"TextBlock":return a.createElement(_,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"text",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"text",name:m},i.getInputProps(m)));case"NumberBlock":return a.createElement(S,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"number",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"number",name:m},i.getInputProps(m)));case"EmailBlock":return a.createElement(_,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"email",name:m},i.getInputProps(m)));case"PhoneOtpBlock":case"PhoneBlock":{const e=t+"-"+m+"-"+r;return a.createElement(_.Wrapper,Object.assign({size:"md",withAsterisk:!0,key:r,label:c,className:"lead-modal__form-control",labelProps:{htmlFor:e}},i.getInputProps(m)),a.createElement(N,{name:m,spellCheck:!1,type:"tel",placeholder:c,onChange:e=>{i.setFieldValue(m,e)},id:e,defaultCountry:l&&O[l]||"VN","data-control":"tel"}))}case"LocationBlock":return a.createElement(he,{key:r,name:m,placeholder:c,locale:l});case"DateBlock":return a.createElement(C,Object.assign({withAsterisk:!0,key:r,type:"date",name:m,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"date"},i.getInputProps(m)));case"LinkButtonBlock":return a.createElement("div",{key:r},a.createElement("a",{target:g?"blank":"parrent",href:v,style:{textDecoration:"none"}},a.createElement(y,{type:"button",size:"md",className:`lead-modal__btn ${A}`,onClick:()=>{null==n||n(),null==o||o()}},m)));case"CheckboxBlock":return a.createElement(a.Fragment,null,h&&a.createElement("div",{style:{display:"none"},"data-name":m+"-mailchimp"}),a.createElement(w.Group,Object.assign({withAsterisk:!0,className:"lead-modal__form-control",key:r,label:c,size:"md"},i.getInputProps(m)),p.map(((e,t)=>a.createElement(w,{name:m,key:t,value:e.value,label:e.placeholder,"data-control":"checkbox"})))));case"RadioBlock":return a.createElement(a.Fragment,null,h&&a.createElement(_,{type:"hidden",name:m+"-mailchimp",value:h}),a.createElement(E.Group,Object.assign({withAsterisk:!0,className:"lead-modal__form-control",key:r,label:c,size:"md"},i.getInputProps(m)),p.map(((e,t)=>a.createElement(E,{name:m,key:t,value:e.value,label:e.placeholder,"data-control":"radio"})))));case"DropdownBlock":return a.createElement(a.Fragment,null,a.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":m,"data-control":"dropdown"}),a.createElement(x,Object.assign({key:r,className:"lead-modal__form-control",label:c,withAsterisk:!0,name:m,data:p.map((e=>({value:e.value,label:e.placeholder})))},i.getInputProps(m))))}return null})))},ye=({phone:e,onSuccess:l,autoSendWhenOpen:i})=>{const{t:s}=b(),[d,c]=n(""),[m,u]=n(!1),[p,h]=n(0),g=r(null),[v,f]=n(),[E,w]=n(""),C=r();o((()=>{t(void 0,void 0,void 0,(function*(){var t;if(!C.current){const e=yield import("react-phone-number-input");C.current=e.formatPhoneNumberIntl}w((null===(t=C.current)||void 0===t?void 0:t.call(C,e))||e)}))}),[e]);const N=()=>t(void 0,void 0,void 0,(function*(){var t;if(!e)return;const a=yield te({phone:e}),n=null===(t=null==a?void 0:a._messages)||void 0===t?void 0:t[0];"Send sms successfully"===n?(h(60),setTimeout((()=>{g.current&&(g.current.focus(),g.current.scrollIntoView({block:"center"}))}),100)):"This phone number was verified"===n?l():f(n||"something Wrong")}));return o((()=>{setTimeout((()=>{p>0&&h((e=>e-1))}),1e3)}),[p]),o((()=>{i&&!p&&N()}),[]),a.createElement(a.Fragment,null,a.createElement("form",{onSubmit:a=>{a.preventDefault(),t(void 0,void 0,void 0,(function*(){if(!e||!d)return;const t=yield ae({phone:e,otp:d}),a=null==t?void 0:t._messages[0];"Verify successfully"===a||"This phone number was verified"===a?l():f(a||"something Wrong")}))},className:"lead-phone-otp-form"},a.createElement(B,{tag:"h3",fontWeight:"bold",style:{marginBottom:4}},s("lead.otp.title")),a.createElement(P,{size:"p1",color:k.colors.gray600},s("lead.otp.desc",{phone:E})),a.createElement(_,{ref:g,name:"_"+name+"-otp",spellCheck:!1,type:"number",placeholder:"Enter OTP",className:"lead-modal__form-control",label:"Phone OTP","data-control":"otp",withAsterisk:!0,pattern:"[0-9]*",value:d,onChange:e=>{u(!0),c(e),f(m&&!e?"OTP is required":void 0)},error:m?v:void 0}),a.createElement(y,{size:"md",color:"primary",className:`lead-modal__btn ${A}`,disabled:!d},s("lead.otp.verify")),a.createElement(y,{type:"button",size:"md",color:"transparent",className:`lead-modal__btn lead-phone-otp-button ${A}`,onClick:()=>{N()},disabled:!!p},s("lead.otp.resend",{timer:p?` (${p}s)`:""}))))},fe=({popupId:e,extraFields:t,onClose:l,onOtherSubmit:s,imageMobile:d,imageDesktop:c,imageOverlayMobile:m,imageOverlayDesktop:u,imageBackground:p,currentLayout:h,title:g,onSubmit:v,showThankyou:k,campaignId:_,campaign_subot_id:E,locale:w})=>{var C,N,S;const T=JSON.parse(t.listBlockAdded),x=JSON.parse(t.actionBlocks),O=JSON.parse(t.textBlocks),j=x.submitBlock.data.url,P=x.submitBlock.data.text,B=x.submitBlock.data.text2,L=x.submitBlock.data.value,$=location.pathname,I=h.includes("Inline")||"Sidebar"===h,U="Slider"===h,[D,R]=n(!0),[H,F]=n(""),W=r(),V=()=>{H?F(""):null==l||l()};if(window.innerWidth<769&&["Fullscreen","Slider"].includes(h))return console.log("😎 Not show fullscreen, slider on mobile "),null;o((()=>{(h.includes("LightBox")||"Fullscreen"==h)&&document.body.classList.add("noscroll"),window.intlTelInputUtils||require("intl-tel-input/build/js/utils"),le.email={},le.phone={}}),[]);const J=r(!1),z=r(!1),{form:G,validateObj:Q}=(({listBlockAdded:e=[],validatingPhoneRef:t,validatingEmailRef:a,campaignId:l,campaign_subot_id:n=[]})=>{const{t:o}=b(),s=i((()=>{const i=["TextBlock","NumberBlock","EmailBlock","PhoneBlock","DateBlock","CheckboxBlock","RadioBlock","DropdownBlock","PhoneOtpBlock","LocationBlock"],r=(e,t)=>a=>{if(c.current.isTouched(e))return void 0===a||""===a||Array.isArray(a)&&0===a.length?o("validator.required"):null==t?void 0:t(a)};return e.filter((e=>i.includes(e.name))).reduce(((e,i)=>"NumberBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(isNaN(Number(e)))return o("validator.number")}))}):"EmailBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))return o("validator.email");a.current=!0,setTimeout((()=>{c.current.setFieldError(i.data.value,"Validating..."),ne(l,n,{email:e}).then((e=>{e?c.current.setFieldError(i.data.value,o(e)):c.current.clearFieldError(i.data.value),a.current=!1})).catch((e=>{console.error(e),c.current.setFieldError(i.data.value,e.message||"Something went wrong"),a.current=!1}))}),200)}))}):"PhoneBlock"===i.name||"PhoneOtpBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(window.intlTelInputUtils&&!window.intlTelInputUtils.isValidNumber(String(e),M.countryCode))return o("validator.phone");t.current=!0,setTimeout((()=>{c.current.setFieldError(i.data.value,"Validating..."),ne(l,n,{phone:e}).then((e=>{e?c.current.setFieldError(i.data.value,o(e)):c.current.clearFieldError(i.data.value),t.current=!1})).catch((e=>{console.error(e),c.current.setFieldError(i.data.value,e.message||"Something went wrong"),t.current=!1}))}),200)}))}):"DateBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(isNaN(Date.parse(e)))return o("validator.date")}))}):Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value)})),{})}),[e.map((e=>e.name)).join(",")]),d=de({validateInputOnChange:!0,clearInputErrorOnChange:!0,validate:s}),c=r(d);return c.current=d,{form:d,validateObj:s}})({listBlockAdded:T,validatingPhoneRef:J,validatingEmailRef:z,campaignId:_,campaign_subot_id:E}),{width:X,height:Z,loaded:ee}=q(p),{width:te,height:ae,loaded:se}=q(d),{width:ce,height:me,loaded:ue}=q(c),pe=se&&ue&&("Fullscreen"!=h||ee),he=a.createElement(a.Fragment,null,a.createElement("style",{dangerouslySetInnerHTML:{__html:`\n .le-newbuilder-overlay {\n background-repeat: no-repeat;\n background-size: cover;\n }\n ${m?`\n .le-newbuilder-overlay {\n background: url(${m}) ;\n }`:""}\n ${u?`\n @media screen and (min-width:768px) {\n .le-newbuilder-overlay {\n background: url(${u}) ;\n }\n }`:""}`}}),a.createElement("div",{id:e,"data-popup-url":$,"data-popup-type":"lightbox-inline",className:`lead-modal lead-modal-wrapper modal--animate-scale ${I?"le-buider-inline":""} ${U?"le-buider-slider":""}`},"Fullscreen"==h?a.createElement("img",{className:"le-only-desktop le-fullscreen-img",draggable:!1,src:p||"",style:{aspectRatio:`${X}/${Z}`}}):null,a.createElement("div",{className:`lead-modal__wrapper le-newbuilder-wrap-${h}`},a.createElement("div",{className:`lead-modal__content le-newbuilder-${h}`},k?a.createElement(K,{title:k.title,titleAlign:k.titleAlign,subtitle:k.subtitle,subtitleAlign:k.subtitleAlign,link:k.link,linkNewTab:k.linkNewTab,linkText:k.linkText,image:k.image}):a.createElement(a.Fragment,null,a.createElement("header",{className:"lead-modal__header"},H?a.createElement("img",{src:f.getAssetPath("lead-otp-thumb.png"),draggable:"false",alt:"",style:{width:"100%"}}):a.createElement(a.Fragment,null,["LightBoxA","InlineA","Sidebar","Slider"].includes(h)?d?a.createElement("img",{draggable:"false",className:"lead-modal__image lead-modal-image-cover",src:d,style:{aspectRatio:`${te}/${ae}`},alt:""}):null:a.createElement(a.Fragment,null,c?a.createElement("img",{draggable:"false",className:"le-only-desktop lead-modal__image lead-modal-image-cover",style:{height:"100%",objectFit:"cover",aspectRatio:`${ce}/${me}`},src:c,alt:""}):null,d?a.createElement("img",{draggable:"false",className:"le-only-mobile lead-modal__image lead-modal-image-cover",src:d,alt:"",style:{aspectRatio:`${te}/${ae}`}}):null))),H&&a.createElement(ye,{phone:H,autoSendWhenOpen:!0,onSuccess:()=>{null==v||v(W.current,G.values)}}),a.createElement("div",{"data-hidden":!!H,className:"lead-modal__body le-newbuilder-overlay"},a.createElement(re,{form:G},a.createElement("form",{ref:W,className:`lead-modal__form ${e}`,onSubmit:e=>{e.preventDefault(),G.setTouched(Object.keys(Q).reduce(((e,t)=>(e[t]=!0,e)),{})),z.current||J.current||setTimeout((()=>{G.onSubmit((e=>{var t,a,l;if(!Object.keys(G.errors).length){if(T.findIndex((e=>"PhoneOtpBlock"===e.name))>-1){const n=null===(a=null===(t=T.find((e=>"PhoneOtpBlock"===e.name)))||void 0===t?void 0:t.data)||void 0===a?void 0:a.value;if(null===(l=e[n])||void 0===l?void 0:l.startsWith("+84"))return void F(e[n])}null==v||v(W.current,e)}}))(e)}),100)}},a.createElement("div",{style:{marginBottom:20}},a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(null===(C=O.titleBlock.data)||void 0===C?void 0:C.align)} ${A}`},g),a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(null===(N=O.titleBlock.data)||void 0===N?void 0:N.align)} ${A}`},O.subtitleBlock.data.value)),a.createElement("div",{className:"lead-modal__form-control-wrapper"},a.createElement(be,{listBlockAdded:T,popupId:e,locale:w,onClose:V,onOtherSubmit:s})),(null===(S=null==x?void 0:x.submitBlock)||void 0===S?void 0:S.isHide)?null:a.createElement(a.Fragment,null,a.createElement("div",{className:`lead-modal__checkbox-wrapper ${A}`},a.createElement("div",{className:"lead-modal__checkbox"},a.createElement("input",{id:"lead-term-checkbox",className:`lead-modal__checkbox__input ${A}`,type:"checkbox","aria-label":"Checkbox label",checked:D,onChange:e=>R(e.currentTarget.checked)}),a.createElement("div",{className:"lead-modal__checkbox__control","aria-hidden":"true"})),a.createElement("label",{htmlFor:"checkbox",className:"lead-modal__checkbox__label"},P," ",a.createElement("span",{style:{fontWeight:"bold"}},a.createElement("a",{target:"blank",href:j||"https://hellobacsi.com/chinh-sach",rel:"noopener noreferrer",style:{textDecoration:"none"}},B)))),a.createElement(y,{size:"md",id:"lead-submit",type:"submit",className:`lead-modal__btn ${A}`,disabled:!D},L))))))),!h.includes("Inline")&&a.createElement(Y,{onClose:V,containerClassName:"close-button-top-right"}))));return pe?h.includes("LightBox")||"Fullscreen"==h||"Slider"==h?he:"Sidebar"==h?a.createElement(ie,{content:he}):h.includes("Inline")?a.createElement(oe,{content:he,inlinePosition:t.popupInlinePosition}):null:null},ke=({popupId:e,link:t,linkText:l,linkNewTab:n,onClose:o,imageMobile:i,imageDesktop:r,currentLayout:s,onOtherSubmit:d})=>{const c=location.pathname,{width:m,height:u,loaded:p}=q(i),{width:h,height:g,loaded:v}=q(r);return p&&v?a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":c,"data-popup-type":"skin_ab"},"SkinA"==s?a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:"le-skin-a-desktop"},a.createElement("div",{style:{position:"relative"}},a.createElement("img",{src:r,style:{aspectRatio:`${h}/${g}`}}),a.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"calc(100% - 15px)"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn js-popup-other-submit"},l)),a.createElement(Y,{onClose:o,containerClassName:"close-button-top-right"})))):"SkinB"==s?a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:""},a.createElement("div",{style:{position:"relative",zIndex:1e4}},a.createElement("img",{src:r,style:{width:"100%",aspectRatio:`${h}/${g}`}}),a.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"100%"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn-mobile js-popup-other-submit"},l)),a.createElement(Y,{containerClassName:"close-button-top-right",onClose:o})))):null,a.createElement("aside",{className:"le-only-mobile"},a.createElement("div",{className:"le-skin-mobile"},a.createElement("div",{style:{position:"relative"}},a.createElement("img",{src:i,style:{width:"100%",aspectRatio:`${m}/${u}`}}),a.createElement("a",{style:{position:"absolute",top:"82%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",maxWidth:"calc(100% - 15px)"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn-mobile js-popup-other-submit"},l)),a.createElement(Y,{containerClassName:"close-button-top-right",svgClassName:"le-mobile-btn",onClose:o}))))):null},_e=({popupId:e,url:t,newTab:l,image:n,onClose:o,onOtherSubmit:i})=>{const{width:r,height:s,loaded:d}=q(n);return d?a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"tab"},a.createElement("div",{className:"le-tab-popup"},a.createElement("div",{style:{position:"relative"}},a.createElement("a",{href:t,target:l?"blank":"_parent",onClick:i},a.createElement("img",{className:"js-popup-other-submit",src:n,style:{aspectRatio:`${r}/${s}`}})),a.createElement(Y,{onClose:o,containerClassName:"close-button-top-right"})))):null},Ee=[],we=[],Ce=[];const Ne=e=>{const t=[...e];for(let e=t.length-1;e>0;e--){const a=Math.floor(Math.random()*(e+1)),l=t[e];t[e]=t[a],t[a]=l}return t},Se=(e="UTC")=>{const t=new Date;return new Date(t.toLocaleString("en-US",{timeZone:e}))},Te=e=>{try{const[t,a]=e.split(" "),[l,n,o]=t.split("-").map(Number),[i,r,s]=a.split(":").map(Number);return new Date(l,n-1,o,i,r,s)}catch(e){return null}};const xe=e=>1===e.formatted_status?function(e){var t;if(1===e.forever)return!0;const a=e.started_at,l=e.ended_at,n=Te(a),o=Te(l);if(!n||!o)return!0;const i=(null===(t=e.site)||void 0===t?void 0:t.id)||1,r=R[i];return!(Se(r).getTime()>o.getTime()&&(Ce.push(e),1))}(e):0===e.formatted_status&&(Ee.push(e),(e=>{var t;const a=(null===(t=e.site)||void 0===t?void 0:t.id)||1,l=e.started_at,n=e.ended_at,o=Te(l),i=Te(n);if(!o||!i)return!1;const r=R[a],s=Se(r).getTime();return s<=i.getTime()&&s>=o.getTime()&&(we.push(e),!0)})(e));let Oe=null;function je({leadApi:e,leadSiteId:t,leadDomain:a,onShowPopup:l,DEBUG_URL:n}){const o=n||("https://"+location.hostname+location.pathname+location.search).toLowerCase();fetch(e+"api/campaign/"+t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:o,ga_client_id:u("_ga")||null})}).then((e=>e.json())).then((e=>{var t,n,i,r,s;if(Pe("List campagin: ",e),U="https://"+location.hostname+location.pathname+location.search,1==e._status){const d=(null===(n=null===(t=e._data)||void 0===t?void 0:t.campaigns)||void 0===n?void 0:n.filter(xe))||[];u("hhg-id")||(p("hhg-id",v(),{domain:"."+a,path:"/"}),Pe("😍 Set HHG ID cookie"));let c=[];c=/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)?d.filter((e=>e.device_types.some((e=>e.id==I.MOBILE)))):d.filter((e=>e.device_types.some((e=>e.id==I.DESKTOP)))),Pe("👓 campaignsDevice",c),Pe("--listCampaignScheduled",Ee),Pe("--listCampaignScheduledToActivated",we),Pe("--listCampaignActiveButExpired",Ce);let m=c.map(((e,t)=>e.targets.filter((e=>e.type==L.LINKS)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1);m=m.filter((e=>{const t=new URL(String(e.target).toLowerCase());if("exact_match"==e.option)return Boolean(o===t.href);if("start_with"==e.option){if(o.includes(String(e.target))){return!e.sub_target.filter((e=>"excluding"==e.option)).map((e=>e.value)).includes(o.split("?")[0])}return!1}}));const h=Array.from(document.getElementsByTagName("META")).filter((e=>"article:tag"==e.getAttribute("property"))).map((e=>e.content));let g=[],b=[];h&&h.length&&(g=c.map(((e,t)=>e.targets.filter((e=>e.type==L.TAGS)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1),b=g.filter((e=>h.includes(e.target))));const y=[...m,...b],f=document.cookie.split("; ").map((e=>e.split("=")[0])),k=f.filter((e=>e.includes("lead_submited")));Pe("--listCampaignCodeSubmited",k);const _=f.filter((e=>e.includes("lead_closed")));Pe("--listCampaignCodeClosed",_);const E=[...k,..._],w=y.filter((e=>!E.some((t=>t.includes(c[e.campaignIndex].code))))),C=Ne(w);if(Pe("--listCampaignValid : ",C),C&&C.length){const e=c[C[0].campaignIndex];Pe("CAMPAIGN_SHOW",e);const{rules:t}=e,a=Number(null===(i=t.find((e=>"time"==e.rule)))||void 0===i?void 0:i.value);Pe("timeoutRule",a);const n=Number(null===(r=t.find((e=>"scroll"==e.rule)))||void 0===r?void 0:r.value);Pe("scrollRule",n);const o=Number(null===(s=t.find((e=>"exclude_sponsored"==e.rule)))||void 0===s?void 0:s.value);Pe("excludeSponsored",o);const d=Boolean(document.querySelector(".hhg-disclaimer-text"));if(Pe("💎 LEAD current page isSponsored",d),d&&o)return;let m="TIME";if(Number.isInteger(a)&&(m="TIME",Pe("✨ SHOW AWESOME POPUP AFTER: ",a," seconds"),Oe&&clearTimeout(Oe),Oe=setTimeout((()=>{null==l||l(e,m)}),1e3*a)),Number.isInteger(n)){m="SCROLL",Pe("✨ SHOW AWESOME AFTER: SCROLL",n," %");const t=document.querySelector(`[data-url="${location.pathname}"]`)||document.querySelector("body"),a=t.getBoundingClientRect().top,o=t.offsetHeight;Pe("👓 Element check scroll: ",t);const i=function(){const t=window.pageYOffset||document.documentElement.scrollTop;let r=0;t>=a&&(r=Math.round((t-a)/(o-innerHeight)*100)),Pe("---Scroll",r,n),r>=n&&(window.removeEventListener("scroll",i),null==l||l(e,m))};window.addEventListener("scroll",i,{passive:!0})}}else Pe("🚧 No lead campaigns on current URL, tags")}})).catch((e=>{Pe("Lead error: ",e)}))}const Pe=(...e)=>{("production"!==process.env.NODE_ENV||process.env.NEXT_PUBLIC_DEPLOY_ENV&&"production"!==process.env.NEXT_PUBLIC_DEPLOY_ENV||"undefined"!=typeof localStorage&&"true"===localStorage.getItem("hhg_debug"))&&console.log(...e)};const Be=({campaign:e,action:t,onSubmit:l,onClose:n,showThankyou:i,locale:d})=>{var c,m;b();const{apiUrl:h,siteDomain:g}=s(V);o((()=>{const e=u("_ga")||null;fetch(`${h}api/campaign/${_}/impression`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t,url:location.href.toLowerCase(),title_article:document.title,cookie_id:u("hhg-id"),ga_client_id:e})})}),[]);const{extra_fields:y,image:f,image_desktop:k,code:_,image_background:E,image_overlay_mobile:w,image_overlay_desktop:C}=e,{currentLayout:N}=y,S=y.imageBlocks?JSON.parse(y.imageBlocks):{},T=JSON.parse(y.actionBlocks),x=JSON.parse(y.textBlocks);let O=(null===(m=null===(c=null==x?void 0:x.titleBlock)||void 0===c?void 0:c.data)||void 0===m?void 0:m.value)||"";const j={1:{},2:{},3:{}},P=r("lead-modal-"+v()),B=function(e="Xin chao {{category_2}} extra"){if(e.includes("{{category_")){const t="{{category_".length,a=e.search("{{category_");return+e.charAt(t+a)}return null}(O);if(B){Pe("⚡️ Has categoryLevel",B);const e=Array.from(document.getElementsByTagName("META")),t=e.find((e=>e.name===`content_category_${B}`)),a=e.find((e=>e.name===`content_category_en_${B}`));if(!t||!a)return Pe("⚡️ No META TAG for categoryLevel, not show popup",B),null;j[B]={value:t.content,value_en:a.content},O=O.replace(`{{category_${B}}}`,t.content),Pe("⚡️ Set categoryData ",B)}else Pe("⚡️ No categoryLevel",B);const L=()=>{var t,a,l,o;if(Pe("👌 Other submit click"),document.body.classList.remove("noscroll"),N.includes("Skin")){const e=document.querySelector("#masthead");e&&(e.style.top="0px !important;")}const i=Number(null!==(a=null===(t=e.rules.find((e=>"days_to_show_again"==e.rule)))||void 0===t?void 0:t.value)&&void 0!==a?a:7),r=Number(null!==(o=null===(l=e.rules.find((e=>"show_again_after_submit"==e.rule)))||void 0===l?void 0:l.value)&&void 0!==o?o:0);0===r&&(Pe("⛔ Popup never show again!"),p(`lead_submited_${_}`,`target_${y.popupVersion}`,{domain:"."+g,path:"/"})),1==r&&(Pe(`⌛ Popup will show again after ${i} days!`),p(`lead_submited_${_}`,`target_${y.popupVersion}`,{domain:"."+g,days:i,path:"/"}));const s=u("_ga")||null,d={url:location.href.toLowerCase(),title_article:document.title,meta:[],cookie_id:u("hhg-id"),ga_client_id:s};B&&(d.category=j[B].value_en),fetch(`${h}api/campaign/${_}/lead`,{method:"POST",body:JSON.stringify(d),headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then((e=>e.json())).then((e=>{"error"===e.status&&Pe(e)})).catch((e=>{Pe("Error:",e)})),null==n||n()};return"CenterTab"===N?a.createElement(J,{popupId:P.current,url:S.imageMobile.data.url,newTab:S.imageMobile.data.newtab,imageMobile:f,imageDestkop:k,onClose:n,onOtherSubmit:L}):"Tab"===N?a.createElement(_e,{popupId:P.current,url:S.imageMobile.data.url,newTab:S.imageMobile.data.newtab,image:f,onClose:n,onOtherSubmit:L}):"Floating"===N?a.createElement(z,{popupId:P.current,title:O,titleAlign:x.titleBlock.data.align,subtitle:x.subtitleBlock.data.value,subtitleAlign:x.subtitleBlock.data.align,url:T.linkButtonBlock.data.url,urlText:T.linkButtonBlock.data.value,newTab:T.linkButtonBlock.data.newtab,imageMobile:f,imageDesktop:k,onClose:n,onOtherSubmit:L}):N.includes("LightBox")||N.includes("Inline")||"Fullscreen"==N||"Sidebar"==N||"Slider"==N?a.createElement(fe,{popupId:P.current,extraFields:y,onClose:n,onOtherSubmit:L,imageMobile:f,imageDesktop:k,imageBackground:E,currentLayout:N,title:O,onSubmit:(e,t)=>l(e,t,B,j),key:N,imageOverlayDesktop:C,imageOverlayMobile:w,showThankyou:i,campaignId:e.id,campaign_subot_id:e.bot_id||[],locale:d}):N.includes("Skin")?a.createElement(ke,{popupId:P.current,link:T.linkButtonBlock.data.url,linkNewTab:!!T.linkButtonBlock.data.newtab,linkText:T.linkButtonBlock.data.value,onClose:n,onOtherSubmit:L,imageMobile:f,imageDesktop:k,currentLayout:N}):null},Le=({apiUrl:e,siteDomain:l,siteId:s,locale:h,apiSubotUrl:v,DEBUG_URL:b})=>{var y;const f=r(),k=r(Date.now()),{apiUrl:_}=i((()=>{let t=e;return t.includes("localhost")&&(t="https://dev.leadgen.hellobacsi.com/"),{apiUrl:t}}),[e,l,s]),[E,w]=n(null),[C,N]=n(""),[S,x]=n(null);o((()=>{G.apiLeadUrl=_,G.apiSubotUrl=v}),[_,v]);const O=(e,t)=>{w(e),N(t)},j=()=>{var e,t;if(!E)return;Pe(`👋👋👋 CLOSE POPUP ${E.code} 👋👋👋`);const a=Number(null===(e=E.rules.find((e=>"show_again_after_exit"==e.rule)))||void 0===e?void 0:e.value),n=Number(null===(t=E.rules.find((e=>"days_to_show_again"==e.rule)))||void 0===t?void 0:t.value);0==a&&p(`lead_closed_${E.code}`,`target_${E.extra_fields.popupVersion}`,n?{domain:"."+l,days:n,path:"/"}:{domain:"."+l,path:"/"}),document.body.classList.remove("noscroll"),fetch(`${_}api/campaign/${E.code}/popup_exit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"CLICK",url:location.href.toLowerCase(),title_article:document.title,cookie_id:u("hhg-id"),duration:Math.ceil((Date.now()-k.current)/1e3)})}),w(null),x(null)};o((()=>{if(window.next){const e=d((e=>{Pe("--🌻 routeChangeComplete",e,Date.now());const t=location.pathname;j(),document.querySelectorAll(`[data-popup-url="${t}"]`).length?Pe("🔥 This URL page has show popup!"):(Pe("--Process checkShowPopup"),je({leadApi:_,leadDomain:l,leadSiteId:s,onShowPopup:O,DEBUG_URL:b})),f.current&&window.removeEventListener("scroll",f.current)}),500);window.next.router.events.on("routeChangeComplete",e)}je({leadApi:_,leadDomain:l,leadSiteId:s,onShowPopup:O,DEBUG_URL:b})}),[]);return o((()=>{E&&(k.current=Date.now())}),[E]),a.createElement(V.Provider,{value:{apiUrl:_,siteDomain:l,siteId:s,locale:h}},a.createElement(m.Provider,{value:{locale:h,values:W(h)}},c(a.createElement(a.Fragment,null,"2.1"===(null===(y=null==E?void 0:E.extra_fields)||void 0===y?void 0:y.popupVersion)&&a.createElement(Be,{campaign:E,action:C,onSubmit:(e,a,n,o)=>t(void 0,void 0,void 0,(function*(){var t,i,r,s,d,c,m,h,g,v,b;if(!a)return;Pe("submitHandler",n,o);const y=Object.keys(a).map((e=>({name:e,value:String(a[e])}))),f=u("_ga")||null;window.intlTelInputUtils||(yield require("intl-tel-input/build/js/utils"));const k={url:location.href.toLowerCase(),title_article:document.title,meta:y.map((t=>{var a,l;const n=(null===(a=e.querySelector(`*[name="${t.name}"]`))||void 0===a?void 0:a.getAttribute("data-control"))||(null===(l=e.querySelector(`*[data-extra][data-name="${t.name}"]`))||void 0===l?void 0:l.getAttribute("data-control"))||"text",o="tel"===n?window.intlTelInputUtils.formatNumber(String(t.value),null==M?void 0:M.countryCodeNumber,2).replace(/\s+/g,""):"date"===n?T(t.value).format("YYYY-MM-DD"):t.value;return{key:t.name,value:o,control:n,is_sent_mailchimp:e.querySelector(`div[data-name="${t.name}-mailchimp"]`)?"true":"false"}})),cookie_id:u("hhg-id"),ga_client_id:f};n&&o[n].value_en&&(k.category=o[n].value_en);const w=Number((null===(i=null===(t=E.rules)||void 0===t?void 0:t.find((e=>"days_to_show_again"===e.rule)))||void 0===i?void 0:i.value)||7),C=Number((null===(s=null===(r=E.rules)||void 0===r?void 0:r.find((e=>"show_again_after_submit"===e.rule)))||void 0===s?void 0:s.value)||0);if(0==C&&(Pe("⛔ Popup never show again!"),p(`lead_submited_${E.code}`,`target_${E.extra_fields.targetType}`,{domain:"."+l,path:"/"})),1==C&&(Pe(`⌛ Popup will show again after ${w} days!`),p(`lead_submited_${E.code}`,`target_${E.extra_fields.targetType}`,{domain:"."+l,days:w,path:"/"})),fetch(`${_}api/campaign/${E.code}/lead`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)}),"notshow"==E.extra_fields.popupShowThankYou)return j(),void document.body.classList.remove("noscroll");let N=!0;const S=E.thank_you_image||`${_}admin/img/thanksyou.png`;let O,P,B=E.extra_fields.popupThankyouTitle||"Thank you.",L=E.extra_fields.popupThankyouDesc||"We appreciate your time!",$="",I="",A="";if("2.1"==E.extra_fields.popupVersion){const e=E.extra_fields,t=JSON.parse(e.listBlockThankyou),a=t.find((e=>"TitleBlock"==e.name)),l=t.find((e=>"SubtitleBlock"==e.name)),n=t.find((e=>"LinkButtonBlock"==e.name));B=(null===(d=null==a?void 0:a.data)||void 0===d?void 0:d.value)||"",$=(null===(c=null==a?void 0:a.data)||void 0===c?void 0:c.align)||"",L=(null===(m=null==l?void 0:l.data)||void 0===m?void 0:m.value)||"",I=(null===(h=null==l?void 0:l.data)||void 0===h?void 0:h.align)||"",O=(null===(g=null==n?void 0:n.data)||void 0===g?void 0:g.value)||"",P=(null===(v=null==n?void 0:n.data)||void 0===v?void 0:v.newtab)||!1,A=(null===(b=null==n?void 0:n.data)||void 0===b?void 0:b.url)||"";const o=E.extra_fields.currentLayout;["SkinA","SkinB","Floating","Tab","CenterTab"].includes(o)&&(N=!1)}x(N?{title:B,titleAlign:$,subtitle:L,subtitleAlign:I,link:A,linkNewTab:P,linkText:O,image:S}:null),sessionStorage.getItem("insider_object")?window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")):window.insider_object={user:{email:"",phone_number:"",gdpr_optin:!0,sms_optin:!0,email_optin:!0}},y.map((e=>{const t=e.name,a=e.value;"tel"==t?window.insider_object.user.phone_number=a:"email"==t&&(window.insider_object.user.email=a)})),sessionStorage.setItem("insider_object",JSON.stringify(window.insider_object))})),onClose:j,showThankyou:S,locale:h})),g())))};export{Le as LeadGen};
@@ -1 +1 @@
1
- export{S as Select}from"./index-1483611b.js";import{n as a,o as r,A as o,p as i,G as n,q as c,r as f,s as d}from"./index.styles-e4b8b655.js";export{t as Accordion,v as Avatar,w as Carousel,x as Checkbox,l as DatePicker,e as Input,p as MAPPED_LOCALE,z as OTHER_THEME_CONFIG,O as OTP,m as Phone,R as Radio,y as emotionCache,s as useMantineLocale}from"./index.styles-e4b8b655.js";export{T as Text}from"./index-dd8c9b9d.js";export{B as Button}from"./index-fb849e99.js";export{A as AspectRatio,S as Switch}from"./index-2b95d543.js";import{_ as b}from"./tslib.es6-6fca6fae.js";import g,{useMemo as u}from"react";import{Indicator as h,Badge as E,Spoiler as j,LoadingOverlay as D,MantineProvider as F,clsx as H,Title as P,Text as I,Button as N}from"@mantine/core";import"dayjs";import"./screenSizeContext-39b53f94.js";import"styled-components";import{t as L}from"./theme-5782e8f2.js";import{I as _}from"./index-74bd30cc.js";import{B as k}from"./utils-9858d408.js";import"./isProduction-aa4c6da9.js";import{L as G}from"./Onboarding-c98a38a5.js";import"./gAssets.js";export{M as Modal}from"./index-1de8b14c.js";import{T as K}from"./index-a49e0bc1.js";import{u as $}from"./useTranslations-05394aed.js";export{C as CentralCarousel}from"./index-f72a5db6.js";export{S as Slider}from"./index-07863aa4.js";export{A as Anchor}from"./index-66e178df.js";import"@mantine/dates";import"@mantine/hooks";import"@mantine/carousel";import"lodash/throttle";import"./translationsContext-3047aefe.js";import"string-format";import"./index-d3cc6f8a.js";const U=e=>{var{styles:t}=e,a=b(e,["styles"]);return g.createElement(h,Object.assign({inline:!0,position:"top-end",offset:4,styles:Object.assign({indicator:{backgroundColor:L.colors.red700},processing:{animationDirection:"alternate"}},t)},a))},W=e=>g.createElement(a,Object.assign({minRows:2,maxRows:4},e)),J=e=>{var{color:t=L.colors.primaryBase,styles:a}=e,s=b(e,["color","styles"]);return g.createElement(E,Object.assign({variant:"filled",color:t,styles:Object.assign({root:{borderRadius:"2px",background:t,textTransform:"unset"}},a)},s))},V=e=>{var{children:t,line:a,lineHeight:s,trackingAttributes:r,maxHeight:o,customExpandFn:i}=e,n=b(e,["children","line","lineHeight","trackingAttributes","maxHeight","customExpandFn"]);const{t:c}=$(),l=u((()=>o||(a&&s?a*s:(console.error("[HHG-Comp]:[Spoiler] Please provide maxHeight, or line with lineHeight"),0))),[]);t||console.error("[HHG-Comp]:[Spoiler] Please provide children");const f=u((()=>r?{"data-event-category":r.dataEventCategory,"data-event-action":r.dataEventAction,"data-event-label":r.dataEventLabel}:{}),[r]);return g.createElement(j,Object.assign({showLabel:g.createElement(K,Object.assign({size:"p3",color:L.colors.primaryBase},f,{onClick:i}),c("articlePage.readMore")),hideLabel:g.createElement(K,Object.assign({size:"p3",color:L.colors.primaryBase},f),c("articlePage.showLess"))},n,{maxHeight:l}),t)},q=e=>g.createElement(D,Object.assign({loaderProps:{color:L.colors.primaryBase}},e)),Y={Button:{defaultProps:{size:"md"}}},Z={Checkbox:{styles:{input:r}}},Q=e=>({InputWrapper:{styles:{label:{display:"inline-flex",gap:4,marginBottom:"0.25rem",fontWeight:600,fontSize:"14px",lineHeight:"22px",color:L.colors.gray600},description:{fontWeight:400,fontSize:"12px",lineHeight:"18px",color:L.colors.gray600,marginBottom:"0.25rem"},error:{marginTop:"0.25rem"}}},NumberInput:{defaultProps:{decimalSeparator:_[e].separator}},Input:{styles:(e,t)=>({input:Object.assign(Object.assign({border:`1px solid ${L.colors.gray200}`,transition:`all ${o} ease-in-out`},(()=>{switch(t.size){case"lg":return{height:48,fontSize:16,minHeight:"unset",lineHeight:"24px"};case"md":return{height:40,fontSize:14,lineHeight:"22px",minHeight:"unset"};case"sm":return{height:32,fontSize:14,lineHeight:"22px",minHeight:"unset"}}})()),{"&:hover":{border:`1px solid ${e.primaryColor}`},"&:focus":{boxShadow:`0px 0px 0px 2px ${e.colors[e.primaryColor][2]}`}}),invalid:{border:`1px solid ${L.colors.red600}`,color:"#000"}})}}),X={hb:["#e3f2ff","#bcdeff","#91caff","#65b5ff","#45a4ff","#2b94ff","#2d87f3","#2c74df","#2b62cd","#2743ad"],mb:["#FFE9F1","#F8CCDC","#F5B4CB","#F29CBA","#EE84AA","#EB6B99","#E85388","#D34C7C","#BE446F","#A93D63"],blue:["#e3f2ff","#bcdeff","#91caff","#65b5ff","#45a4ff","#2b94ff","#2d87f3","#2c74df","#2b62cd","#2743ad"],gray:["#fafafa","#f2f2f2","#d9d9d9","#bfbfbf","#8c8c8c","#737373","#595959","#404040","#262626"],neutral:["#f8f9fc","#e4e8ec","#fafafa","#d2d6dc","#bfc5cc","#adb3bc","#9aa2ac","#87909c","#757f8c","#626d7c"],green:["#e0f8ee","#b3eed5","#7ce2b9","#2ed69e","#00CB8A","#00C076","#00B16A","#009E5C","#008C50","#006C39"],pink:["#fff1f6","#fec7dc","#fec7dc","#fec2cf","#fe9dc2","#fd87b4","#fd72a7","#fc5d9a","#fc488d","#E92D74"],violet:["#F5EDFF","#E7D2F7","#D8B7F0","#CA9CE8","#BB82E1","#AD67D9","#9E4CD1","#9031CA","#8116C2","#63059D"],yellow:["#fff8e2","#ffecb6","#ffe187","#ffd658","#ffc326","#fe921d","#ffb521","#fea21e","#fe921d","#fc7419"],teal:["#e0f7fc","#b1ebf8","#7ddff3","#44d1ec","#00c7e6","#00bee0","#00aecd","#0099b2","#008599","#00626c"],indigol:["#CEDDF0","#ACC5E6","#95B3DA","#85A6CF","#6D91BE","#5F85B5","#4C77AC","#35639C","#284A75","#1B3250"],redViolet:["#F3EAEB","#E8D5D7","#DDC1C4","#D1ACB0","#C5979C","#BA8288","#AF6D74","#A35961","#97444D","#8C2F39"]},ee=(e,t="hb")=>({defaultRadius:"hb"===t?4:16,datesLocale:i[e],dateFormat:_[e].dateFormat,colors:Object.assign(Object.assign({},X),L.colors),primaryColor:t,primaryShade:6,fontFamily:e===G.Cambodia?"Battambang,":"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI',\n Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif",breakpoints:{xs:k.BREAK_POINT_SMALL_MOBILE,sm:k.BREAK_POINT_MOBILE,md:k.BREAK_POINT_TABLET,lg:k.BREAK_POINT_PC,xl:k.BREAK_POINT_LGPC},components:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Q(e)),Z),n),Y),c),f)}),te=e=>{var{children:t,locale:a,template:s="hb"}=e,r=b(e,["children","locale","template"]);return d(a),g.createElement(F,Object.assign({theme:ee(a,s)},r),t)};var ae={container:"MON6sfi",iconContainer:"pS-tJD7",icon:"s3tJ9-5",title:"fNsZr1b",description:"uuxV74v",button:"YohjTDU"};function se(e){const{icon:t,title:a,description:s,button:r,buttonProps:o,style:i,className:n}=e,c=o||{},{size:l="lg",variant:f="outline"}=c,d=b(c,["size","variant"]),m=t;return g.createElement("div",{className:H("result",ae.container,n),style:i},m&&g.createElement("div",{className:H("resultIconContainer",ae.iconContainer)},g.createElement(m,{className:H("resultIcon",ae.icon)})),g.createElement(P,{order:3,size:"h3",className:H("resultTitle",ae.title)},a),g.createElement(I,{className:H("resultDescription",ae.description)},s),r&&g.createElement(N,Object.assign({},d,{size:l,variant:f,className:H("resultButton",ae.button,d.className)}),r))}export{J as Badge,U as Indicator,q as LoadingOverlay,te as MantineProvider,se as Result,V as Spoiler,W as TextArea,ee as getMantineThemeOverride,X as themeColors};
1
+ export{S as Select}from"./index-a5f1692a.js";import{r as a,s as r}from"./index.styles-768e9218.js";export{t as Accordion,v as Avatar,w as Carousel,x as Checkbox,l as DatePicker,e as Input,n as MAPPED_LOCALE,z as OTHER_THEME_CONFIG,O as OTP,q as Phone,R as Radio,y as emotionCache,s as useMantineLocale}from"./index.styles-768e9218.js";export{T as Text}from"./index-fc3ca38e.js";export{B as Button}from"./index-6f3880bd.js";import{g as o}from"./index-73f56d42.js";export{A as AspectRatio,S as Switch,g as getMantineThemeOverride,t as themeColors}from"./index-73f56d42.js";import{_ as i}from"./tslib.es6-9315bdbc.js";import c,{useMemo as m}from"react";import{Indicator as d,Badge as p,Spoiler as u,LoadingOverlay as f,MantineProvider as j,clsx as b,Title as h,Text as E,Button as H}from"@mantine/core";import"dayjs";import"./screenSizeContext-af9362cd.js";import"styled-components";import{t as P}from"./theme-1b26637c.js";import"./index-d25e4ea9.js";import"./utils-5a3d6877.js";import"./isProduction-020306cd.js";import"./Onboarding-21d12043.js";import"./gAssets.js";export{M as Modal}from"./index-4af154ad.js";import{T as N}from"./index-f0daa1f1.js";import{u as k}from"./useTranslations-bd79fd17.js";export{C as CentralCarousel}from"./index-1a0b2606.js";export{S as Slider}from"./index-1a6781ec.js";export{A as Anchor}from"./index-413fdc77.js";import"@mantine/dates";import"@mantine/hooks";import"@mantine/carousel";import"lodash/throttle";import"./translationsContext-48c3884a.js";import"string-format";import"./index-ade91020.js";const L=e=>{var{styles:t}=e,a=i(e,["styles"]);return c.createElement(d,Object.assign({inline:!0,position:"top-end",offset:4,styles:Object.assign({indicator:{backgroundColor:P.colors.red700},processing:{animationDirection:"alternate"}},t)},a))},D=e=>c.createElement(a,Object.assign({minRows:2,maxRows:4},e)),I=e=>{var{color:t=P.colors.primaryBase,styles:a}=e,s=i(e,["color","styles"]);return c.createElement(p,Object.assign({variant:"filled",color:t,styles:Object.assign({root:{borderRadius:"2px",background:t,textTransform:"unset"}},a)},s))},_=e=>{var{children:t,line:a,lineHeight:s,trackingAttributes:r,maxHeight:o,customExpandFn:n}=e,l=i(e,["children","line","lineHeight","trackingAttributes","maxHeight","customExpandFn"]);const{t:d}=k(),p=m((()=>o||(a&&s?a*s:(console.error("[HHG-Comp]:[Spoiler] Please provide maxHeight, or line with lineHeight"),0))),[]);t||console.error("[HHG-Comp]:[Spoiler] Please provide children");const x=m((()=>r?{"data-event-category":r.dataEventCategory,"data-event-action":r.dataEventAction,"data-event-label":r.dataEventLabel}:{}),[r]);return c.createElement(u,Object.assign({showLabel:c.createElement(N,Object.assign({size:"p3",color:P.colors.primaryBase},x,{onClick:n}),d("articlePage.readMore")),hideLabel:c.createElement(N,Object.assign({size:"p3",color:P.colors.primaryBase},x),d("articlePage.showLess"))},l,{maxHeight:p}),t)},F=e=>c.createElement(f,Object.assign({loaderProps:{color:P.colors.primaryBase}},e)),G=e=>{var{children:t,locale:a,template:s="hb"}=e,n=i(e,["children","locale","template"]);return r(a),c.createElement(j,Object.assign({theme:o(a,s)},n),t)};var J={container:"MON6sfi",iconContainer:"pS-tJD7",icon:"s3tJ9-5",title:"fNsZr1b",description:"uuxV74v",button:"YohjTDU"};function U(e){const{icon:t,title:a,description:s,button:r,buttonProps:o,style:n,className:l}=e,m=o||{},{size:d="lg",variant:p="outline"}=m,x=i(m,["size","variant"]),u=t;return c.createElement("div",{className:b("result",J.container,l),style:n},u&&c.createElement("div",{className:b("resultIconContainer",J.iconContainer)},c.createElement(u,{className:b("resultIcon",J.icon)})),c.createElement(h,{order:3,size:"h3",className:b("resultTitle",J.title)},a),c.createElement(E,{className:b("resultDescription",J.description)},s),r&&c.createElement(H,Object.assign({},x,{size:d,variant:p,className:b("resultButton",J.button,x.className)}),r))}export{I as Badge,L as Indicator,F as LoadingOverlay,G as MantineProvider,U as Result,_ as Spoiler,D as TextArea};
package/build/esm/misc.js CHANGED
@@ -1 +1 @@
1
- export{a as ageGenerate,c as convertLocalizedStringToNumber,l as localizeNumberFormat}from"./localizeNumberFormat-fe23d3f4.js";export{S as ScreenSizeContext,j as ScreenSizeContextProvider,h as fadeIn,i as getWindowSizeGroups,a as slideInDown,b as slideInLeft,c as slideInRight,s as slideInUp,e as slideOutDown,f as slideOutLeft,g as slideOutRight,d as slideOutUp}from"./screenSizeContext-39b53f94.js";export{d as deleteCookie,g as getCookie,s as setCookie}from"./cookieHelper-cbbc5ece.js";import"react";import"styled-components";export{M as MBTheme,t as theme}from"./theme-5782e8f2.js";export{a as abbreviateNumber,f as formatPill}from"./dataTransform-31bebacd.js";export{d as getCareApiDomain,g as getCurrentBaseUrl,a as getCurrentSsoUrl,c as getDiscoverApiDomain,b as getTogetherApiDomain}from"./routing-de7d22cc.js";export{B as Breakpoints,M as MediaQueries,f as formatUrlWithPageParam,g as getBoundariesFromMediaQueryKey,a as getPopupWrapperDom,b as getWrapperDomWithSelector,m as makeParams,c as safeEncodeURI,s as startCase,t as toggleNoScroll}from"./utils-9858d408.js";export{f as formatHealthTool,g as getDynamicHealthTool,a as getDynamicHealthToolWithCache}from"./getDynamicHealthTool-85101b39.js";export{g as getSocialList}from"./getSocialList-cb4c5aaa.js";import"dayjs";import"lodash/throttle";import"./index-74bd30cc.js";import"./Onboarding-c98a38a5.js";import"./isProduction-aa4c6da9.js";import"./tslib.es6-6fca6fae.js";import"./core-e66477d9.js";import"./normalizeLink-080b6cfd.js";import"./gAssets.js";
1
+ export{a as ageGenerate,c as convertLocalizedStringToNumber,l as localizeNumberFormat}from"./localizeNumberFormat-f7f187e4.js";export{S as ScreenSizeContext,j as ScreenSizeContextProvider,h as fadeIn,i as getWindowSizeGroups,a as slideInDown,b as slideInLeft,c as slideInRight,s as slideInUp,e as slideOutDown,f as slideOutLeft,g as slideOutRight,d as slideOutUp}from"./screenSizeContext-af9362cd.js";export{d as deleteCookie,g as getCookie,s as setCookie}from"./cookieHelper-f34ae4b5.js";import"react";import"styled-components";export{M as MBTheme,t as theme}from"./theme-1b26637c.js";export{a as abbreviateNumber,f as formatPill}from"./dataTransform-b335f7e4.js";export{d as getCareApiDomain,g as getCurrentBaseUrl,a as getCurrentSsoUrl,c as getDiscoverApiDomain,b as getTogetherApiDomain}from"./routing-2f9c1504.js";export{B as Breakpoints,M as MediaQueries,f as formatUrlWithPageParam,g as getBoundariesFromMediaQueryKey,a as getPopupWrapperDom,b as getWrapperDomWithSelector,m as makeParams,c as safeEncodeURI,s as startCase,t as toggleNoScroll}from"./utils-5a3d6877.js";export{f as formatHealthTool,g as getDynamicHealthTool,a as getDynamicHealthToolWithCache}from"./getDynamicHealthTool-56a311b0.js";export{g as getSocialList}from"./getSocialList-71178ab1.js";import"dayjs";import"lodash/throttle";import"./index-d25e4ea9.js";import"./Onboarding-21d12043.js";import"./isProduction-020306cd.js";import"./tslib.es6-9315bdbc.js";import"./core-1eab176f.js";import"./normalizeLink-41635236.js";import"./gAssets.js";
@@ -1 +1 @@
1
- import"./tslib.es6-6fca6fae.js";import"react";import"./core-e66477d9.js";export{N as NavigationV2,g as getNavMenuContent,a as getNavMenuContentWithCache}from"./index-5bdb24f3.js";import"./index-74bd30cc.js";import"./normalizeLink-080b6cfd.js";import"./routing-de7d22cc.js";import"./dataTransform-16786588.js";import"./index.styled-928161bc.js";import"./isProduction-aa4c6da9.js";import"./gAssets.js";import"./Onboarding-c98a38a5.js";import"./useUniqueId-abc4f1de.js";import"./index-a49e0bc1.js";import"./index-de075a29.js";import"./index-1ade8351.js";import"./utils-9858d408.js";import"styled-components";import"./useTranslations-05394aed.js";import"./translationsContext-3047aefe.js";import"string-format";import"lodash/throttle";import"./index.styled-79d4b1a1.js";import"./theme-5782e8f2.js";import"./index.styled-e704c9c2.js";import"dayjs";import"./screenSizeContext-39b53f94.js";import"@mantine/core";import"./index-d3cc6f8a.js";import"./cookieHelper-cbbc5ece.js";import"./index.styled-8a3ed141.js";import"./index-7e0d894b.js";import"./index.styles-e4b8b655.js";import"@mantine/dates";import"@mantine/hooks";import"@mantine/carousel";import"./index-f72a5db6.js";import"./constants-0a7fc9d0.js";import"./useIsInit-a1b79772.js";import"./index-6569f80d.js";import"lodash/debounce";import"slugify";import"dayjs/plugin/relativeTime";
1
+ import"./tslib.es6-9315bdbc.js";import"react";import"./core-1eab176f.js";export{N as NavigationV2,g as getNavMenuContent,a as getNavMenuContentWithCache}from"./index-5c97d404.js";import"./index-d25e4ea9.js";import"./normalizeLink-41635236.js";import"./routing-2f9c1504.js";import"./dataTransform-64a13114.js";import"./index.styled-5a0b52e8.js";import"./isProduction-020306cd.js";import"./gAssets.js";import"./Onboarding-21d12043.js";import"./useUniqueId-1bfdbec1.js";import"./index-f0daa1f1.js";import"./index-63efd893.js";import"./index-e259b1f3.js";import"./utils-5a3d6877.js";import"styled-components";import"./useTranslations-bd79fd17.js";import"./translationsContext-48c3884a.js";import"string-format";import"lodash/throttle";import"./index.styled-ffad8868.js";import"./theme-1b26637c.js";import"./index.styled-472c3814.js";import"dayjs";import"./screenSizeContext-af9362cd.js";import"@mantine/core";import"./index-ade91020.js";import"./cookieHelper-f34ae4b5.js";import"./index.styled-78fde46a.js";import"./index-53cacbee.js";import"./index.styles-768e9218.js";import"@mantine/dates";import"@mantine/hooks";import"@mantine/carousel";import"./index-1a0b2606.js";import"./constants-52026b77.js";import"./useIsInit-9c00e3c3.js";import"./index-6cdb2b0b.js";import"lodash/debounce";import"slugify";import"dayjs/plugin/relativeTime";
@@ -1 +1 @@
1
- import{a as e,_ as o}from"./tslib.es6-6fca6fae.js";import t,{useContext as n,useState as r,useRef as i,useEffect as a,useMemo as s,useCallback as l}from"react";import{Input as d,Title as m}from"@mantine/core";import{useInterval as c,useCounter as p}from"@mantine/hooks";import"./index.styled-79d4b1a1.js";import{B as b}from"./index-d3cc6f8a.js";import"./gAssets.js";import"./index.styled-e704c9c2.js";import"./index-1ade8351.js";import"./utils-9858d408.js";import{t as u}from"./theme-5782e8f2.js";import"./index.styled-8a3ed141.js";import{u as f}from"./useTranslations-05394aed.js";import"./index-7e0d894b.js";import"./index.styles-e4b8b655.js";import{T as E}from"./index-dd8c9b9d.js";import"dayjs";import"./screenSizeContext-39b53f94.js";import"styled-components";import{L as y}from"./index-74bd30cc.js";import"./isProduction-aa4c6da9.js";import{O as h}from"./Onboarding-c98a38a5.js";export{O as OnboardingStep}from"./Onboarding-c98a38a5.js";import"./index-f72a5db6.js";import{O as v,u as S,o as j,S as C,h as k,F as P,D as x,a as w,b as B,c as L,d as T,e as F,f as z,g as D,i as I,j as N,k as R,l as _}from"./index.styled-e0eda731.js";export{M as MAPPED_LOCALE,g as OnboardingForm}from"./index.styled-e0eda731.js";import"lodash/debounce";import{yupResolver as A}from"@mantine/form";import V from"lodash/throttle";import{T as $}from"./index-a49e0bc1.js";import{format as H}from"date-fns";import"./translationsContext-3047aefe.js";import"string-format";import"@mantine/dates";import"@mantine/carousel";import"./Visible-05e82139.js";import"yup";const U=({onSubmit:o,phone:l,email:d,onResendCode:m,otpError:g,onClose:E,loading:y,onBack:h,canSkip:O,outOfEdit:w})=>{const{siteType:B,isMarryBaby:L}=n(v),[T,M]=r(30),F=c((()=>M((e=>e-1))),1e3),[z,D]=p(0,{min:0,max:3}),I=i(!0),{t:N}=f();a((()=>(F.start(),F.stop)),[]),a((()=>{0===T&&(F.stop(),I.current=!1)}),[T]);const R=S({initialValues:{otp:""},validate:A(j(N))});a((()=>{g&&R.setFieldError("otp",g)}),[g]);const _=s((()=>V((()=>{I.current||(D.increment(),M(30),null==m||m(l||d),F.start(),I.current=!0)}),1e3,{trailing:!1})),[l,d,m,F]);return t.createElement(C,{heading:N("onboarding.otpForm.heading"),description:t.createElement(t.Fragment,null,t.createElement("span",{dangerouslySetInnerHTML:{__html:l?N("onboarding.otpForm.description",{phone:`<b style="color:${u.colors.gray800}">${l.slice(0,-3).replace(/./g,"x").concat(l.slice(-3))}</b>`}):N("onboarding.otpForm.descriptionEmail",{email:`<b style="color:${u.colors.gray800}">${k(d)}</b>`})}}),!w&&t.createElement("svg",{onClick:()=>{null==h||h()},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"otp-description-edit-icon"},t.createElement("path",{d:"M12.7812 1.33337C12.2987 1.33337 11.8162 1.51712 11.4479 1.88546L10.6667 2.66671L13.3333 5.33337L14.1146 4.55212C14.8506 3.81612 14.8506 2.62212 14.1146 1.88546C13.7463 1.51712 13.2638 1.33337 12.7812 1.33337ZM9.66667 3.66671L2 11.3334V14H4.66667L12.3333 6.33337L9.66667 3.66671Z",fill:"#ADB3BC"})))},t.createElement(P,{form:R},t.createElement("form",{onSubmit:R.onSubmit((t=>e(void 0,void 0,void 0,(function*(){D.increment(),o(t.otp)}))),(e=>{console.log(e)}))},t.createElement(x,{inputOrder:["otp"]}),t.createElement("div",{className:"resend"},t.createElement($,{size:"p4",color:u.colors.gray400},N("onboarding.otpForm.notReceiveOTP")),t.createElement($,{as:"a",size:"p4",color:L?u.mbColors.pink:u.colors.primaryBase,onClick:_},N("onboarding.otpForm.resendCode",{seconds:T}))),t.createElement(b,{theme:B,color:"primary",isBlock:!0,size:"lg",type:"submit",isLoading:y,disabled:y,"data-event-category":"Sign Up","data-event-action":"Confirm Phone Number","data-event-label":"undefined"!=typeof window?window.location.href:"",className:"pointer-event-child-none"},N("onboarding.button.continue")),O&&z>=3&&t.createElement(b,{theme:B,color:"ghost",isBlock:!0,size:"lg",onClick:E,type:"button"},N("onboarding.button.skip")))))},Z=({onClose:e,onSubmit:o,canSkip:r,loading:i,errorMessage:s,initialData:l})=>{const{t:d,locale:m}=f(),{siteType:c,isMarryBaby:p}=n(v),u=S({validate:A(w(d))});return a((()=>{u.setValues(Object.assign(Object.assign({gender:"0"},l),(null==l?void 0:l.birthday)&&{birthday:new Date(l.birthday)}))}),[l]),a((()=>{s&&u.setFieldError("email",s)}),[s]),t.createElement(B,{heading:d("onboarding.formEmail.heading"),description:d("onboarding.formEmail.description",{site:p?"Marry Baby":y[m].SITE_NAME_FORMATTED})},t.createElement(P,{form:u},t.createElement("form",{className:"form",onSubmit:u.onSubmit((e=>{o(Object.assign(Object.assign({},e),{birthday:e.birthday&&H(e.birthday,"yyyy-MM-dd")}))}),(e=>{console.log({fieldErrors:e})}))},t.createElement(x,{inputOrder:["full_name","email","dob","gender"]}),t.createElement(b,{color:"primary",isBlock:!0,size:"lg",type:"submit",theme:c,isLoading:i,disabled:i},d("onboarding.button.continue")),r&&t.createElement(b,{theme:c,color:"ghost",isBlock:!0,size:"lg",onClick:e},d("onboarding.button.skip")))))},q=({onClose:e,onSubmit:o,canSkip:n,errorMessage:r,loading:i})=>{const{t:a}=f(),s=S({initialValues:{password:"",confirmPassword:""},validate:A(L(a))});return t.createElement(B,{heading:a("onboarding.updatePassword.heading"),description:a("onboarding.updatePassword.description")},t.createElement(P,{form:s},t.createElement("form",{className:"form",onSubmit:s.onSubmit((e=>o((null==e?void 0:e.password)||"")),(e=>{console.log({fieldErrors:e})}))},t.createElement(x,{inputOrder:["password","confirm_password"]}),t.createElement(b,{color:"primary",isBlock:!0,size:"lg",type:"submit",isLoading:i,disabled:i},a("onboarding.button.continue")),n&&t.createElement(b,{color:"ghost",isBlock:!0,size:"lg",onClick:e},a("onboarding.button.skip")),r&&t.createElement(d.Error,{className:"form-error"},r))))},G=n=>{var{banner:i,canSkip:a,createPassError:s,createPassLoading:d,customFormTexts:c,emailLoading:g,flow:y=[h.Phone,h.OTP],initialData:S,onClose:j,onCreatePassByEmail:C,onOtpSubmit:k,onPersonalInfoSubmit:O,onPhoneSubmit:P,onResendCode:x,otpError:w,otpLoading:L,personalInfoError:M,resultScreenProps:A,siteType:V,step:$}=n,H=o(n,["banner","canSkip","createPassError","createPassLoading","customFormTexts","emailLoading","flow","initialData","onClose","onCreatePassByEmail","onOtpSubmit","onPersonalInfoSubmit","onPhoneSubmit","onResendCode","otpError","otpLoading","personalInfoError","resultScreenProps","siteType","step"]);const{t:G}=f(),[J,K]=r($||y[0]),[Q,W]=r(""),[X,Y]=r(""),[ee,oe]=p(0,{min:0,max:2}),te=l((()=>{const e=y.indexOf(J)+1;e<=y.length-1&&K(y[e])}),[J]),ne=l((()=>{const e=y.indexOf(J)-1;e>=0&&K(y[e])}),[J]),re=o=>e(void 0,void 0,void 0,(function*(){try{!(yield k(o))&&te()}catch(e){console.error(e)}})),ie=()=>{ee>=2||(oe.increment(),ne())},ae="marryBaby"===V;return t.createElement(v.Provider,{value:{siteType:V,isMarryBaby:ae}},t.createElement(T,Object.assign({},H),y.length>0?t.createElement(F,null,t.createElement(z,{"data-has-banner":"object"==typeof i},J===h.Phone&&t.createElement(D,{onClose:j,canSkip:a,onSubmit:o=>e(void 0,void 0,void 0,(function*(){try{W(o),yield null==P?void 0:P(o),te()}catch(e){console.error(e)}})),customFormTexts:c.onboarding}),J===h.OTP&&t.createElement(U,{onClose:j,onSubmit:re,phone:Q,onResendCode:x,otpError:w,loading:L,canSkip:a,onBack:ie,outOfEdit:ee>=2}),J===h.OTPEmail&&t.createElement(U,{onClose:j,onSubmit:re,onResendCode:x,otpError:w,loading:L,canSkip:a,onBack:ie,outOfEdit:ee>=2,email:X}),J===h.PersonalInfo&&t.createElement(Z,{initialData:null==S?void 0:S[h.PersonalInfo],onClose:j,canSkip:a,onSubmit:o=>e(void 0,void 0,void 0,(function*(){try{Y((null==o?void 0:o.email)||"");!(yield null==O?void 0:O(o))&&te()}catch(e){console.error(e)}})),errorMessage:M,loading:g}),J===h.UpdatePassword&&t.createElement(q,{onClose:j,canSkip:a,onSubmit:o=>e(void 0,void 0,void 0,(function*(){try{yield null==C?void 0:C(o),!s&&te()}catch(e){console.error(e)}})),errorMessage:s,loading:d}),J===h.Result&&t.createElement(B,Object.assign({},A),t.createElement(b,{theme:V,size:"lg",onClick:j,className:"form-button"},G("onboarding.button.continue")))),"object"==typeof i&&t.createElement(I,null,t.createElement(N,{"data-is-marry-baby":ae},t.createElement(R,null,(null==i?void 0:i.heading)&&t.createElement(m,{order:1,mb:24},null==i?void 0:i.heading),(null==i?void 0:i.description)&&t.createElement(E,{size:"p1",color:u.colors.gray800},G("onboarding.welcomeScreen.content"))),(null==i?void 0:i.imgSrc)&&t.createElement("div",null,t.createElement(_,{src:null==i?void 0:i.imgSrc,loading:"lazy"}))))):"Incorrect flow"))};export{G as OnboardingModal,U as OtpForm};
1
+ import{a as e,_ as o}from"./tslib.es6-9315bdbc.js";import t,{useContext as n,useState as r,useRef as i,useEffect as a,useMemo as s,useCallback as l}from"react";import{Input as d,Title as m}from"@mantine/core";import{useInterval as c,useCounter as p}from"@mantine/hooks";import"./index.styled-ffad8868.js";import{B as b}from"./index-ade91020.js";import"./gAssets.js";import"./index.styled-472c3814.js";import"./index-e259b1f3.js";import"./utils-5a3d6877.js";import{t as u}from"./theme-1b26637c.js";import"./index.styled-78fde46a.js";import{u as f}from"./useTranslations-bd79fd17.js";import"./index-53cacbee.js";import"./index.styles-768e9218.js";import{T as E}from"./index-fc3ca38e.js";import"dayjs";import"./screenSizeContext-af9362cd.js";import"styled-components";import{L as y}from"./index-d25e4ea9.js";import"./isProduction-020306cd.js";import{O as h}from"./Onboarding-21d12043.js";export{O as OnboardingStep}from"./Onboarding-21d12043.js";import"./index-1a0b2606.js";import{O as v,u as S,o as j,S as C,h as k,F as P,D as x,a as w,b as B,c as L,d as T,e as F,f as z,g as D,i as I,j as N,k as R,l as _}from"./index.styled-5dcc0941.js";export{M as MAPPED_LOCALE,g as OnboardingForm}from"./index.styled-5dcc0941.js";import"lodash/debounce";import{yupResolver as A}from"@mantine/form";import V from"lodash/throttle";import{T as $}from"./index-f0daa1f1.js";import{format as H}from"date-fns";import"./translationsContext-48c3884a.js";import"string-format";import"@mantine/dates";import"@mantine/carousel";import"./Visible-86c2551f.js";import"yup";const U=({onSubmit:o,phone:l,email:d,onResendCode:m,otpError:g,onClose:E,loading:y,onBack:h,canSkip:O,outOfEdit:w})=>{const{siteType:B,isMarryBaby:L}=n(v),[T,M]=r(30),F=c((()=>M((e=>e-1))),1e3),[z,D]=p(0,{min:0,max:3}),I=i(!0),{t:N}=f();a((()=>(F.start(),F.stop)),[]),a((()=>{0===T&&(F.stop(),I.current=!1)}),[T]);const R=S({initialValues:{otp:""},validate:A(j(N))});a((()=>{g&&R.setFieldError("otp",g)}),[g]);const _=s((()=>V((()=>{I.current||(D.increment(),M(30),null==m||m(l||d),F.start(),I.current=!0)}),1e3,{trailing:!1})),[l,d,m,F]);return t.createElement(C,{heading:N("onboarding.otpForm.heading"),description:t.createElement(t.Fragment,null,t.createElement("span",{dangerouslySetInnerHTML:{__html:l?N("onboarding.otpForm.description",{phone:`<b style="color:${u.colors.gray800}">${l.slice(0,-3).replace(/./g,"x").concat(l.slice(-3))}</b>`}):N("onboarding.otpForm.descriptionEmail",{email:`<b style="color:${u.colors.gray800}">${k(d)}</b>`})}}),!w&&t.createElement("svg",{onClick:()=>{null==h||h()},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"otp-description-edit-icon"},t.createElement("path",{d:"M12.7812 1.33337C12.2987 1.33337 11.8162 1.51712 11.4479 1.88546L10.6667 2.66671L13.3333 5.33337L14.1146 4.55212C14.8506 3.81612 14.8506 2.62212 14.1146 1.88546C13.7463 1.51712 13.2638 1.33337 12.7812 1.33337ZM9.66667 3.66671L2 11.3334V14H4.66667L12.3333 6.33337L9.66667 3.66671Z",fill:"#ADB3BC"})))},t.createElement(P,{form:R},t.createElement("form",{onSubmit:R.onSubmit((t=>e(void 0,void 0,void 0,(function*(){D.increment(),o(t.otp)}))),(e=>{console.log(e)}))},t.createElement(x,{inputOrder:["otp"]}),t.createElement("div",{className:"resend"},t.createElement($,{size:"p4",color:u.colors.gray400},N("onboarding.otpForm.notReceiveOTP")),t.createElement($,{as:"a",size:"p4",color:L?u.mbColors.pink:u.colors.primaryBase,onClick:_},N("onboarding.otpForm.resendCode",{seconds:T}))),t.createElement(b,{theme:B,color:"primary",isBlock:!0,size:"lg",type:"submit",isLoading:y,disabled:y,"data-event-category":"Sign Up","data-event-action":"Confirm Phone Number","data-event-label":"undefined"!=typeof window?window.location.href:"",className:"pointer-event-child-none"},N("onboarding.button.continue")),O&&z>=3&&t.createElement(b,{theme:B,color:"ghost",isBlock:!0,size:"lg",onClick:E,type:"button"},N("onboarding.button.skip")))))},Z=({onClose:e,onSubmit:o,canSkip:r,loading:i,errorMessage:s,initialData:l})=>{const{t:d,locale:m}=f(),{siteType:c,isMarryBaby:p}=n(v),u=S({validate:A(w(d))});return a((()=>{u.setValues(Object.assign(Object.assign({gender:"0"},l),(null==l?void 0:l.birthday)&&{birthday:new Date(l.birthday)}))}),[l]),a((()=>{s&&u.setFieldError("email",s)}),[s]),t.createElement(B,{heading:d("onboarding.formEmail.heading"),description:d("onboarding.formEmail.description",{site:p?"Marry Baby":y[m].SITE_NAME_FORMATTED})},t.createElement(P,{form:u},t.createElement("form",{className:"form",onSubmit:u.onSubmit((e=>{o(Object.assign(Object.assign({},e),{birthday:e.birthday&&H(e.birthday,"yyyy-MM-dd")}))}),(e=>{console.log({fieldErrors:e})}))},t.createElement(x,{inputOrder:["full_name","email","dob","gender"]}),t.createElement(b,{color:"primary",isBlock:!0,size:"lg",type:"submit",theme:c,isLoading:i,disabled:i},d("onboarding.button.continue")),r&&t.createElement(b,{theme:c,color:"ghost",isBlock:!0,size:"lg",onClick:e},d("onboarding.button.skip")))))},q=({onClose:e,onSubmit:o,canSkip:n,errorMessage:r,loading:i})=>{const{t:a}=f(),s=S({initialValues:{password:"",confirmPassword:""},validate:A(L(a))});return t.createElement(B,{heading:a("onboarding.updatePassword.heading"),description:a("onboarding.updatePassword.description")},t.createElement(P,{form:s},t.createElement("form",{className:"form",onSubmit:s.onSubmit((e=>o((null==e?void 0:e.password)||"")),(e=>{console.log({fieldErrors:e})}))},t.createElement(x,{inputOrder:["password","confirm_password"]}),t.createElement(b,{color:"primary",isBlock:!0,size:"lg",type:"submit",isLoading:i,disabled:i},a("onboarding.button.continue")),n&&t.createElement(b,{color:"ghost",isBlock:!0,size:"lg",onClick:e},a("onboarding.button.skip")),r&&t.createElement(d.Error,{className:"form-error"},r))))},G=n=>{var{banner:i,canSkip:a,createPassError:s,createPassLoading:d,customFormTexts:c,emailLoading:g,flow:y=[h.Phone,h.OTP],initialData:S,onClose:j,onCreatePassByEmail:C,onOtpSubmit:k,onPersonalInfoSubmit:O,onPhoneSubmit:P,onResendCode:x,otpError:w,otpLoading:L,personalInfoError:M,resultScreenProps:A,siteType:V,step:$}=n,H=o(n,["banner","canSkip","createPassError","createPassLoading","customFormTexts","emailLoading","flow","initialData","onClose","onCreatePassByEmail","onOtpSubmit","onPersonalInfoSubmit","onPhoneSubmit","onResendCode","otpError","otpLoading","personalInfoError","resultScreenProps","siteType","step"]);const{t:G}=f(),[J,K]=r($||y[0]),[Q,W]=r(""),[X,Y]=r(""),[ee,oe]=p(0,{min:0,max:2}),te=l((()=>{const e=y.indexOf(J)+1;e<=y.length-1&&K(y[e])}),[J]),ne=l((()=>{const e=y.indexOf(J)-1;e>=0&&K(y[e])}),[J]),re=o=>e(void 0,void 0,void 0,(function*(){try{!(yield k(o))&&te()}catch(e){console.error(e)}})),ie=()=>{ee>=2||(oe.increment(),ne())},ae="marryBaby"===V;return t.createElement(v.Provider,{value:{siteType:V,isMarryBaby:ae}},t.createElement(T,Object.assign({},H),y.length>0?t.createElement(F,null,t.createElement(z,{"data-has-banner":"object"==typeof i},J===h.Phone&&t.createElement(D,{onClose:j,canSkip:a,onSubmit:o=>e(void 0,void 0,void 0,(function*(){try{W(o),yield null==P?void 0:P(o),te()}catch(e){console.error(e)}})),customFormTexts:c.onboarding}),J===h.OTP&&t.createElement(U,{onClose:j,onSubmit:re,phone:Q,onResendCode:x,otpError:w,loading:L,canSkip:a,onBack:ie,outOfEdit:ee>=2}),J===h.OTPEmail&&t.createElement(U,{onClose:j,onSubmit:re,onResendCode:x,otpError:w,loading:L,canSkip:a,onBack:ie,outOfEdit:ee>=2,email:X}),J===h.PersonalInfo&&t.createElement(Z,{initialData:null==S?void 0:S[h.PersonalInfo],onClose:j,canSkip:a,onSubmit:o=>e(void 0,void 0,void 0,(function*(){try{Y((null==o?void 0:o.email)||"");!(yield null==O?void 0:O(o))&&te()}catch(e){console.error(e)}})),errorMessage:M,loading:g}),J===h.UpdatePassword&&t.createElement(q,{onClose:j,canSkip:a,onSubmit:o=>e(void 0,void 0,void 0,(function*(){try{yield null==C?void 0:C(o),!s&&te()}catch(e){console.error(e)}})),errorMessage:s,loading:d}),J===h.Result&&t.createElement(B,Object.assign({},A),t.createElement(b,{theme:V,size:"lg",onClick:j,className:"form-button"},G("onboarding.button.continue")))),"object"==typeof i&&t.createElement(I,null,t.createElement(N,{"data-is-marry-baby":ae},t.createElement(R,null,(null==i?void 0:i.heading)&&t.createElement(m,{order:1,mb:24},null==i?void 0:i.heading),(null==i?void 0:i.description)&&t.createElement(E,{size:"p1",color:u.colors.gray800},G("onboarding.welcomeScreen.content"))),(null==i?void 0:i.imgSrc)&&t.createElement("div",null,t.createElement(_,{src:null==i?void 0:i.imgSrc,loading:"lazy"}))))):"Incorrect flow"))};export{G as OnboardingModal,U as OtpForm};