@hhgtech/hhg-components 1.25.26 → 1.25.28

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 (275) 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/atoms/pill/index.d.ts +2 -3
  5. package/build/components.js +1 -1
  6. package/build/constants.js +1 -1
  7. package/build/{core-32806ebf.js → core-67535e7c.js} +1 -1
  8. package/build/{dataTransform-b6729b28.js → dataTransform-3fbb44ef.js} +1 -1
  9. package/build/ecom.js +1 -1
  10. package/build/esm/babyGrowth.js +2 -2
  11. package/build/esm/cache.js +1 -1
  12. package/build/esm/care.js +1 -1
  13. package/build/esm/components.js +1 -1
  14. package/build/esm/constants.js +1 -1
  15. package/build/esm/{core-75aa50f3.js → core-59eb3c84.js} +1 -1
  16. package/build/esm/{dataTransform-4f8ed05f.js → dataTransform-fe9a84ab.js} +1 -1
  17. package/build/esm/ecom.js +1 -1
  18. package/build/esm/footer.js +1 -1
  19. package/build/esm/gAssets.js +1 -1
  20. package/build/esm/{getDynamicHealthTool-e0865e00.js → getDynamicHealthTool-570e9ff3.js} +1 -1
  21. package/build/esm/{getSocialList-844ea065.js → getSocialList-5c823e1c.js} +1 -1
  22. package/build/esm/hooks.js +1 -1
  23. package/build/esm/i18n.js +1 -1
  24. package/build/esm/{index-0502f200.js → index-005e3957.js} +1 -1
  25. package/build/esm/{index-ade6919a.js → index-0584f4e0.js} +1 -1
  26. package/build/esm/{index-2f8b98a5.js → index-115ec021.js} +1 -1
  27. package/build/esm/{index-b449b11b.js → index-12640201.js} +1 -1
  28. package/build/esm/{index-62a0171b.js → index-36633c47.js} +1 -1
  29. package/build/esm/{index-c75b134d.js → index-3f1ff8fe.js} +1 -1
  30. package/build/esm/{index-2c5717b3.js → index-413d6b9b.js} +1 -1
  31. package/build/esm/index-557f111d.js +1 -0
  32. package/build/esm/{index-ed0947c0.js → index-5c473995.js} +1 -1
  33. package/build/esm/{index-f6ca06bb.js → index-62fb15a0.js} +1 -1
  34. package/build/esm/{index-f23d94b8.js → index-72a9b027.js} +1 -1
  35. package/build/esm/{index-3b91e315.js → index-72df41e4.js} +1 -1
  36. package/build/esm/{index-ad80a00f.js → index-77cc38c1.js} +6 -6
  37. package/build/esm/{index-1fbfb6c0.js → index-783fb4ec.js} +1 -1
  38. package/build/esm/{index-5810a91b.js → index-9211bd11.js} +1 -1
  39. package/build/esm/{index-e821b83d.js → index-9322ea14.js} +1 -1
  40. package/build/esm/{index-244b1669.js → index-9e6f1c4c.js} +1 -1
  41. package/build/esm/index-b1920332.js +1 -0
  42. package/build/esm/{index-5ccec059.js → index-b64ea845.js} +1 -1
  43. package/build/esm/{index-8cb33bb5.js → index-b7205a41.js} +1 -1
  44. package/build/esm/{index-b8d1644a.js → index-cd4deb55.js} +1 -1
  45. package/build/esm/{index-6c7a01f8.js → index-d51966d5.js} +1 -1
  46. package/build/esm/index-e2441395.js +1 -0
  47. package/build/esm/{index-722f08f8.js → index-ef0e9c6c.js} +1 -1
  48. package/build/esm/{index-46a00fd5.js → index-eff4918d.js} +1 -1
  49. package/build/esm/index.js +1 -1
  50. package/build/esm/{index.styled-dc6441de.js → index.styled-38fe8b82.js} +6 -6
  51. package/build/esm/{index.styled-f1df3408.js → index.styled-3f5fa13b.js} +1 -1
  52. package/build/esm/{index.styled-01789e81.js → index.styled-5acc1e41.js} +4 -4
  53. package/build/esm/{index.styled-5509c30c.js → index.styled-9910b1de.js} +1 -1
  54. package/build/esm/{index.styled-4d4c8449.js → index.styled-a06a6b82.js} +1 -1
  55. package/build/esm/{index.styled-228e900e.js → index.styled-ad00d8a6.js} +1 -1
  56. package/build/esm/{index.styled-7c1d555e.js → index.styled-be91ad13.js} +1 -1
  57. package/build/esm/lead.js +1 -1
  58. package/build/esm/mantine.js +1 -1
  59. package/build/esm/misc.js +1 -1
  60. package/build/esm/navigation.js +1 -1
  61. package/build/esm/onboarding.js +1 -1
  62. package/build/esm/pwg.js +2 -2
  63. package/build/esm/{routing-b298b666.js → routing-b0972916.js} +1 -1
  64. package/build/esm/{screenSizeContext-a9ee0d97.js → screenSizeContext-9bf65cae.js} +1 -1
  65. package/build/esm/together.js +1 -1
  66. package/build/esm/translationsProvider-8d4b7dca.js +1 -0
  67. package/build/esm/{types-25223204.js → types-19a65307.js} +1 -1
  68. package/build/esm/{types-c04c8649.js → types-854febb8.js} +1 -1
  69. package/build/esm/types.js +1 -1
  70. package/build/esm/useHealthToolCache-142eb8af.js +1 -0
  71. package/build/esm/{useRafState-c68c532f.js → useRafState-886ebe30.js} +1 -1
  72. package/build/esm/{useScreenSize-0eef1b55.js → useScreenSize-54978be3.js} +1 -1
  73. package/build/esm/{useTranslations-142d35dc.js → useTranslations-0fee2509.js} +1 -1
  74. package/build/esm/vaccination.js +1 -1
  75. package/build/footer.js +1 -1
  76. package/build/gAssets.js +1 -1
  77. package/build/{getDynamicHealthTool-872ef6fe.js → getDynamicHealthTool-60aee093.js} +1 -1
  78. package/build/{getSocialList-c4b4e2b4.js → getSocialList-d4211a80.js} +1 -1
  79. package/build/hooks.js +1 -1
  80. package/build/i18n.js +1 -1
  81. package/build/{index-792c447e.js → index-071acb59.js} +1 -1
  82. package/build/{index-0defe9a9.js → index-0b22570f.js} +1 -1
  83. package/build/{index-f111add8.js → index-28f49b53.js} +1 -1
  84. package/build/{index-23e6e5f7.js → index-3831ca3f.js} +1 -1
  85. package/build/{index-3d33135e.js → index-3a962d42.js} +1 -1
  86. package/build/{index-58822964.js → index-5b04e2b1.js} +1 -1
  87. package/build/{index-86e60cbe.js → index-68f20dc4.js} +1 -1
  88. package/build/{index-b0e07aab.js → index-6fb990ae.js} +1 -1
  89. package/build/{index-e6ce550b.js → index-7250366d.js} +1 -1
  90. package/build/{index-4dcd2689.js → index-759bd927.js} +1 -1
  91. package/build/{index-46923ba1.js → index-784e7363.js} +1 -1
  92. package/build/{index-e5ee2897.js → index-840c38f1.js} +1 -1
  93. package/build/index-850a588b.js +1 -0
  94. package/build/{index-942033f9.js → index-87774ce7.js} +1 -1
  95. package/build/{index-ff40d27e.js → index-8982aceb.js} +1 -1
  96. package/build/index-949343ad.js +1 -0
  97. package/build/index-a9e1caf7.js +1 -0
  98. package/build/{index-9308acdf.js → index-b2ee5323.js} +1 -1
  99. package/build/{index-636427e5.js → index-bec206ae.js} +1 -1
  100. package/build/{index-3811590f.js → index-cc50d5bc.js} +1 -1
  101. package/build/{index-2dcdddd1.js → index-cfa26873.js} +4 -4
  102. package/build/{index-0cdd36b0.js → index-d096b7c2.js} +1 -1
  103. package/build/{index-afcdd96e.js → index-e7c3276c.js} +1 -1
  104. package/build/{index-b92159af.js → index-ec09c108.js} +1 -1
  105. package/build/{index-2c0b39dc.js → index-fd7f535c.js} +1 -1
  106. package/build/index.js +1 -1
  107. package/build/{index.styled-573d4516.js → index.styled-08ef5cd9.js} +1 -1
  108. package/build/{index.styled-41696285.js → index.styled-366d8130.js} +9 -9
  109. package/build/{index.styled-735fc0c3.js → index.styled-6fe2f992.js} +3 -3
  110. package/build/{index.styled-58a01917.js → index.styled-7f448824.js} +1 -1
  111. package/build/{index.styled-e2a83417.js → index.styled-b5a14013.js} +1 -1
  112. package/build/{index.styled-8526a186.js → index.styled-e686e54d.js} +4 -4
  113. package/build/{index.styled-57c34909.js → index.styled-ff14fb9e.js} +1 -1
  114. package/build/lead.js +1 -1
  115. package/build/mantine.js +1 -1
  116. package/build/misc.js +1 -1
  117. package/build/navigation.js +1 -1
  118. package/build/onboarding.js +1 -1
  119. package/build/pwg.js +1 -1
  120. package/build/{routing-8c084456.js → routing-6f0d3ddd.js} +1 -1
  121. package/build/screenSizeContext-d465ad93.js +81 -0
  122. package/build/together.js +1 -1
  123. package/build/translationsProvider-cbf31461.js +1 -0
  124. package/build/{types-1f83ea11.js → types-76d11526.js} +1 -1
  125. package/build/{types-87ec07be.js → types-f0d28ed8.js} +1 -1
  126. package/build/types.js +1 -1
  127. package/build/{useHealthToolCache-e5815d75.js → useHealthToolCache-26365d4f.js} +1 -1
  128. package/build/{useRafState-f68a7c8a.js → useRafState-f74e2c4b.js} +1 -1
  129. package/build/{useScreenSize-3bff02f5.js → useScreenSize-1afd5543.js} +1 -1
  130. package/build/useTranslations-2b93987a.js +1 -0
  131. package/build/vaccination.js +4 -4
  132. package/package.json +1 -1
  133. package/build/esm/index-04617758.js +0 -1
  134. package/build/esm/index-97cfd9ea.js +0 -1
  135. package/build/esm/index-e56d4d22.js +0 -1
  136. package/build/esm/translationsProvider-ba78fb54.js +0 -1
  137. package/build/esm/useHealthToolCache-8f9e50eb.js +0 -1
  138. package/build/index-0236bc7b.js +0 -1
  139. package/build/index-631ec57b.js +0 -1
  140. package/build/index-f86a2844.js +0 -1
  141. package/build/screenSizeContext-e22f882d.js +0 -81
  142. package/build/translationsProvider-caf38efd.js +0 -1
  143. package/build/useTranslations-2e1f4604.js +0 -1
  144. /package/build/{BMI_BOYS.percentile.monthly-2ee4e32a.js → BMI_BOYS.percentile.monthly-12fc65a8.js} +0 -0
  145. /package/build/{BMI_BOYS.percentile.weekly-99efb281.js → BMI_BOYS.percentile.weekly-a48073b0.js} +0 -0
  146. /package/build/{BMI_BOYS.percentile.yearly-2b49b951.js → BMI_BOYS.percentile.yearly-59c0f342.js} +0 -0
  147. /package/build/{BMI_BOYS.zscore.monthly-691926d9.js → BMI_BOYS.zscore.monthly-9860a75f.js} +0 -0
  148. /package/build/{BMI_BOYS.zscore.weekly-c06ffa70.js → BMI_BOYS.zscore.weekly-e89f5ce5.js} +0 -0
  149. /package/build/{BMI_BOYS.zscore.yearly-4f51badf.js → BMI_BOYS.zscore.yearly-e797203b.js} +0 -0
  150. /package/build/{BMI_GIRLS.percentile.monthly-ff7113f0.js → BMI_GIRLS.percentile.monthly-301ea945.js} +0 -0
  151. /package/build/{BMI_GIRLS.percentile.weekly-6470f11a.js → BMI_GIRLS.percentile.weekly-d9390a1f.js} +0 -0
  152. /package/build/{BMI_GIRLS.percentile.yearly-16657d55.js → BMI_GIRLS.percentile.yearly-da29358d.js} +0 -0
  153. /package/build/{BMI_GIRLS.zscore.monthly-a3c800b2.js → BMI_GIRLS.zscore.monthly-0b2733cc.js} +0 -0
  154. /package/build/{BMI_GIRLS.zscore.weekly-64e0c83f.js → BMI_GIRLS.zscore.weekly-7d363887.js} +0 -0
  155. /package/build/{BMI_GIRLS.zscore.yearly-e9d2bbfd.js → BMI_GIRLS.zscore.yearly-1b899ece.js} +0 -0
  156. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-e88bf3a7.js → HEAD CIRCUM_BOYS.percentile.monthly-8b0455ea.js} +0 -0
  157. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-c085a45c.js → HEAD CIRCUM_BOYS.percentile.weekly-9aff7a2e.js} +0 -0
  158. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-3e78ddf4.js → HEAD CIRCUM_BOYS.percentile.yearly-a709143f.js} +0 -0
  159. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-ba7da389.js → HEAD CIRCUM_BOYS.zscore.monthly-d7716544.js} +0 -0
  160. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-2176a8e2.js → HEAD CIRCUM_BOYS.zscore.weekly-04c3fc12.js} +0 -0
  161. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-f0e36cc5.js → HEAD CIRCUM_BOYS.zscore.yearly-f812dc04.js} +0 -0
  162. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-2f403be2.js → HEAD CIRCUM_GIRLS.percentile.monthly-c98f64fe.js} +0 -0
  163. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-4d87fbc9.js → HEAD CIRCUM_GIRLS.percentile.weekly-8b512a2d.js} +0 -0
  164. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-bcfdf9f9.js → HEAD CIRCUM_GIRLS.percentile.yearly-27a0f8df.js} +0 -0
  165. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-dbe41238.js → HEAD CIRCUM_GIRLS.zscore.monthly-94b4fc78.js} +0 -0
  166. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-4e2f4602.js → HEAD CIRCUM_GIRLS.zscore.weekly-14ea650c.js} +0 -0
  167. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-2fb8f59e.js → HEAD CIRCUM_GIRLS.zscore.yearly-a76e950f.js} +0 -0
  168. /package/build/{HEIGHT_BOYS.percentile.monthly-4e73b502.js → HEIGHT_BOYS.percentile.monthly-0dc4f236.js} +0 -0
  169. /package/build/{HEIGHT_BOYS.percentile.weekly-f9840cf9.js → HEIGHT_BOYS.percentile.weekly-e8d9853b.js} +0 -0
  170. /package/build/{HEIGHT_BOYS.percentile.yearly-e5ea4154.js → HEIGHT_BOYS.percentile.yearly-739fd702.js} +0 -0
  171. /package/build/{HEIGHT_BOYS.zscore.monthly-49eb7d62.js → HEIGHT_BOYS.zscore.monthly-5c8345c7.js} +0 -0
  172. /package/build/{HEIGHT_BOYS.zscore.weekly-be248945.js → HEIGHT_BOYS.zscore.weekly-899679f3.js} +0 -0
  173. /package/build/{HEIGHT_BOYS.zscore.yearly-bc3f1b33.js → HEIGHT_BOYS.zscore.yearly-e1c2ceef.js} +0 -0
  174. /package/build/{HEIGHT_GIRLS.percentile.monthly-65cec5d9.js → HEIGHT_GIRLS.percentile.monthly-c19ba3db.js} +0 -0
  175. /package/build/{HEIGHT_GIRLS.percentile.weekly-7420bc0f.js → HEIGHT_GIRLS.percentile.weekly-94a492b5.js} +0 -0
  176. /package/build/{HEIGHT_GIRLS.percentile.yearly-865276f7.js → HEIGHT_GIRLS.percentile.yearly-c16affa5.js} +0 -0
  177. /package/build/{HEIGHT_GIRLS.zscore.monthly-fde115f3.js → HEIGHT_GIRLS.zscore.monthly-159d4073.js} +0 -0
  178. /package/build/{HEIGHT_GIRLS.zscore.weekly-273b9227.js → HEIGHT_GIRLS.zscore.weekly-48be2755.js} +0 -0
  179. /package/build/{HEIGHT_GIRLS.zscore.yearly-ad106138.js → HEIGHT_GIRLS.zscore.yearly-1026d9f4.js} +0 -0
  180. /package/build/{Onboarding-290281f9.js → Onboarding-e26a6654.js} +0 -0
  181. /package/build/{Visible-9f2fe9aa.js → Visible-3038d82c.js} +0 -0
  182. /package/build/{WEIGHT_BOYS.percentile.monthly-84901d2a.js → WEIGHT_BOYS.percentile.monthly-9c425854.js} +0 -0
  183. /package/build/{WEIGHT_BOYS.percentile.weekly-5c6be28a.js → WEIGHT_BOYS.percentile.weekly-2d787afa.js} +0 -0
  184. /package/build/{WEIGHT_BOYS.percentile.yearly-bd932c49.js → WEIGHT_BOYS.percentile.yearly-648c1f2a.js} +0 -0
  185. /package/build/{WEIGHT_BOYS.zscore.monthly-94ab78e6.js → WEIGHT_BOYS.zscore.monthly-2a287ccf.js} +0 -0
  186. /package/build/{WEIGHT_BOYS.zscore.weekly-059ff14e.js → WEIGHT_BOYS.zscore.weekly-99743cbc.js} +0 -0
  187. /package/build/{WEIGHT_BOYS.zscore.yearly-71ce63bb.js → WEIGHT_BOYS.zscore.yearly-40c0a50f.js} +0 -0
  188. /package/build/{WEIGHT_GIRLS.percentile.monthly-c0adecf2.js → WEIGHT_GIRLS.percentile.monthly-f6eae65e.js} +0 -0
  189. /package/build/{WEIGHT_GIRLS.percentile.weekly-34719297.js → WEIGHT_GIRLS.percentile.weekly-094e49af.js} +0 -0
  190. /package/build/{WEIGHT_GIRLS.percentile.yearly-fa1beebc.js → WEIGHT_GIRLS.percentile.yearly-a054699b.js} +0 -0
  191. /package/build/{WEIGHT_GIRLS.zscore.monthly-80f11598.js → WEIGHT_GIRLS.zscore.monthly-7fe96056.js} +0 -0
  192. /package/build/{WEIGHT_GIRLS.zscore.weekly-da131a93.js → WEIGHT_GIRLS.zscore.weekly-caedf8cf.js} +0 -0
  193. /package/build/{WEIGHT_GIRLS.zscore.yearly-6021e6de.js → WEIGHT_GIRLS.zscore.yearly-7491585d.js} +0 -0
  194. /package/build/{constants-bf2452fe.js → constants-69cbcdf0.js} +0 -0
  195. /package/build/{cookieHelper-9f1db7dc.js → cookieHelper-070b7f8d.js} +0 -0
  196. /package/build/{dataTransform-ba8a353f.js → dataTransform-594f58aa.js} +0 -0
  197. /package/build/esm/{BMI_BOYS.percentile.monthly-f3c5174e.js → BMI_BOYS.percentile.monthly-f759035d.js} +0 -0
  198. /package/build/esm/{BMI_BOYS.percentile.weekly-56bc1d8e.js → BMI_BOYS.percentile.weekly-11aab657.js} +0 -0
  199. /package/build/esm/{BMI_BOYS.percentile.yearly-5361e6a7.js → BMI_BOYS.percentile.yearly-96c6bd2b.js} +0 -0
  200. /package/build/esm/{BMI_BOYS.zscore.monthly-3f25ba52.js → BMI_BOYS.zscore.monthly-88c93f2e.js} +0 -0
  201. /package/build/esm/{BMI_BOYS.zscore.weekly-68c87269.js → BMI_BOYS.zscore.weekly-dc6aa925.js} +0 -0
  202. /package/build/esm/{BMI_BOYS.zscore.yearly-98bf3cf5.js → BMI_BOYS.zscore.yearly-6fa41c85.js} +0 -0
  203. /package/build/esm/{BMI_GIRLS.percentile.monthly-74fe665c.js → BMI_GIRLS.percentile.monthly-1972622c.js} +0 -0
  204. /package/build/esm/{BMI_GIRLS.percentile.weekly-fa2ad125.js → BMI_GIRLS.percentile.weekly-6e0c4bf2.js} +0 -0
  205. /package/build/esm/{BMI_GIRLS.percentile.yearly-b94b63c3.js → BMI_GIRLS.percentile.yearly-de13b769.js} +0 -0
  206. /package/build/esm/{BMI_GIRLS.zscore.monthly-caa77050.js → BMI_GIRLS.zscore.monthly-2481cd5a.js} +0 -0
  207. /package/build/esm/{BMI_GIRLS.zscore.weekly-456ba650.js → BMI_GIRLS.zscore.weekly-41049747.js} +0 -0
  208. /package/build/esm/{BMI_GIRLS.zscore.yearly-ccf9c755.js → BMI_GIRLS.zscore.yearly-436a84c8.js} +0 -0
  209. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-52445388.js → HEAD CIRCUM_BOYS.percentile.monthly-9310d177.js} +0 -0
  210. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-a6007e9d.js → HEAD CIRCUM_BOYS.percentile.weekly-44cc1714.js} +0 -0
  211. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-2f0ae9d1.js → HEAD CIRCUM_BOYS.percentile.yearly-d1e8416b.js} +0 -0
  212. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-3f40b0dd.js → HEAD CIRCUM_BOYS.zscore.monthly-ac30c1f2.js} +0 -0
  213. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-2a179454.js → HEAD CIRCUM_BOYS.zscore.weekly-bcc503af.js} +0 -0
  214. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-cb442da2.js → HEAD CIRCUM_BOYS.zscore.yearly-f3d45098.js} +0 -0
  215. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-c091a946.js → HEAD CIRCUM_GIRLS.percentile.monthly-5e639155.js} +0 -0
  216. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-66dcb60b.js → HEAD CIRCUM_GIRLS.percentile.weekly-e835fd3b.js} +0 -0
  217. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-659cbd4b.js → HEAD CIRCUM_GIRLS.percentile.yearly-f7beb453.js} +0 -0
  218. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-4f81cfff.js → HEAD CIRCUM_GIRLS.zscore.monthly-137fd5ed.js} +0 -0
  219. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-9882c0ea.js → HEAD CIRCUM_GIRLS.zscore.weekly-ab244333.js} +0 -0
  220. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-2da37a0e.js → HEAD CIRCUM_GIRLS.zscore.yearly-049333c9.js} +0 -0
  221. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-15b29538.js → HEIGHT_BOYS.percentile.monthly-69314b8e.js} +0 -0
  222. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-45ebfea7.js → HEIGHT_BOYS.percentile.weekly-79b4c76e.js} +0 -0
  223. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-afb37298.js → HEIGHT_BOYS.percentile.yearly-14b7995f.js} +0 -0
  224. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-ff768fb3.js → HEIGHT_BOYS.zscore.monthly-3179ac93.js} +0 -0
  225. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-bb4ab5b3.js → HEIGHT_BOYS.zscore.weekly-020732a0.js} +0 -0
  226. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-6ca0c5f7.js → HEIGHT_BOYS.zscore.yearly-faf213d7.js} +0 -0
  227. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-9b83836a.js → HEIGHT_GIRLS.percentile.monthly-369ff2a2.js} +0 -0
  228. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-15c5e6eb.js → HEIGHT_GIRLS.percentile.weekly-4dd88252.js} +0 -0
  229. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-74071ad3.js → HEIGHT_GIRLS.percentile.yearly-62928c60.js} +0 -0
  230. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-2173148d.js → HEIGHT_GIRLS.zscore.monthly-169be51e.js} +0 -0
  231. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-a7d40638.js → HEIGHT_GIRLS.zscore.weekly-009e2f23.js} +0 -0
  232. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-5c588ab3.js → HEIGHT_GIRLS.zscore.yearly-949b0ff9.js} +0 -0
  233. /package/build/esm/{Onboarding-c63cc86d.js → Onboarding-cc38c258.js} +0 -0
  234. /package/build/esm/{Visible-e14cf77f.js → Visible-8fc9d6c4.js} +0 -0
  235. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-f0636721.js → WEIGHT_BOYS.percentile.monthly-5e0e46e0.js} +0 -0
  236. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-d3cff5c4.js → WEIGHT_BOYS.percentile.weekly-1606e599.js} +0 -0
  237. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-5bcabacf.js → WEIGHT_BOYS.percentile.yearly-0cf127e0.js} +0 -0
  238. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-8a86534a.js → WEIGHT_BOYS.zscore.monthly-cf52879a.js} +0 -0
  239. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-179cf2c8.js → WEIGHT_BOYS.zscore.weekly-81cb1dcb.js} +0 -0
  240. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-0958ce4a.js → WEIGHT_BOYS.zscore.yearly-7ee5e661.js} +0 -0
  241. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-504a3b3d.js → WEIGHT_GIRLS.percentile.monthly-6f6d4fe1.js} +0 -0
  242. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-954bc240.js → WEIGHT_GIRLS.percentile.weekly-8cbe4f83.js} +0 -0
  243. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-a1b9ee0f.js → WEIGHT_GIRLS.percentile.yearly-36b13245.js} +0 -0
  244. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-0328f1c3.js → WEIGHT_GIRLS.zscore.monthly-c2431345.js} +0 -0
  245. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-52d84ab6.js → WEIGHT_GIRLS.zscore.weekly-f6b75ee4.js} +0 -0
  246. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-32998a0e.js → WEIGHT_GIRLS.zscore.yearly-810b5d2b.js} +0 -0
  247. /package/build/esm/{constants-f96bf356.js → constants-ce021f3d.js} +0 -0
  248. /package/build/esm/{cookieHelper-833f0129.js → cookieHelper-3b17012e.js} +0 -0
  249. /package/build/esm/{dataTransform-bbccaef4.js → dataTransform-068b1887.js} +0 -0
  250. /package/build/esm/{index-c23cae7f.js → index-3d0f42b6.js} +0 -0
  251. /package/build/esm/{isProduction-f16dd143.js → isProduction-52b782c4.js} +0 -0
  252. /package/build/esm/{localizeNumberFormat-a5af830c.js → localizeNumberFormat-c7fbaac7.js} +0 -0
  253. /package/build/esm/{normalizeLink-7b6cf263.js → normalizeLink-5703bfe6.js} +0 -0
  254. /package/build/esm/{theme-3d8106e4.js → theme-09666faa.js} +0 -0
  255. /package/build/esm/{translationsContext-98450578.js → translationsContext-fca059c7.js} +0 -0
  256. /package/build/esm/{tslib.es6-7feb5f1c.js → tslib.es6-02d11ec7.js} +0 -0
  257. /package/build/esm/{types-09106e37.js → types-b8a4ed34.js} +0 -0
  258. /package/build/esm/{useIsInit-be586072.js → useIsInit-7fe0636a.js} +0 -0
  259. /package/build/esm/{useOutsideClick-6f954f85.js → useOutsideClick-bf464e7c.js} +0 -0
  260. /package/build/esm/{useScrollbarSize-10ab7fe4.js → useScrollbarSize-dbda3edd.js} +0 -0
  261. /package/build/esm/{useUniqueId-1bf68487.js → useUniqueId-265a038e.js} +0 -0
  262. /package/build/esm/{utils-53b2e945.js → utils-f60d906f.js} +0 -0
  263. /package/build/{index-35888ed0.js → index-c5df2610.js} +0 -0
  264. /package/build/{isProduction-760d8f49.js → isProduction-f9d2f2fd.js} +0 -0
  265. /package/build/{localizeNumberFormat-9f3d575a.js → localizeNumberFormat-9a2a1dca.js} +0 -0
  266. /package/build/{normalizeLink-c2238f0d.js → normalizeLink-088758b3.js} +0 -0
  267. /package/build/{theme-1fe2de02.js → theme-9ef2b98f.js} +0 -0
  268. /package/build/{translationsContext-d956ef25.js → translationsContext-ad64012f.js} +0 -0
  269. /package/build/{tslib.es6-93d9e16a.js → tslib.es6-0df9a7e4.js} +0 -0
  270. /package/build/{types-45e6a090.js → types-f06c3fbe.js} +0 -0
  271. /package/build/{useIsInit-2248639b.js → useIsInit-9e5cc53e.js} +0 -0
  272. /package/build/{useOutsideClick-b3447d7a.js → useOutsideClick-f9b134de.js} +0 -0
  273. /package/build/{useScrollbarSize-35ba63b3.js → useScrollbarSize-dca0d138.js} +0 -0
  274. /package/build/{useUniqueId-8a32dc81.js → useUniqueId-e3593e0f.js} +0 -0
  275. /package/build/{utils-63966a9b.js → utils-8defba7c.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{_ as e}from"./tslib.es6-7feb5f1c.js";import t,{useMemo as o}from"react";import{L as n}from"./Onboarding-c63cc86d.js";import{CommonGAssets as i}from"./gAssets.js";import{t as r}from"./theme-3d8106e4.js";import{T as a}from"./index-5810a91b.js";import c from"styled-components";import{C as s}from"./index-5ccec059.js";const l=c.div`
1
+ import{_ as e}from"./tslib.es6-02d11ec7.js";import t,{useMemo as o}from"react";import{L as n}from"./Onboarding-cc38c258.js";import{CommonGAssets as i}from"./gAssets.js";import{t as a}from"./theme-09666faa.js";import{T as r}from"./index-9211bd11.js";import s from"styled-components";import{C as l}from"./index-b64ea845.js";const c=s.div`
2
2
  display: inline-flex;
3
3
  overflow: hidden;
4
4
  width: ${e=>e.size}px;
@@ -8,13 +8,13 @@ import{_ as e}from"./tslib.es6-7feb5f1c.js";import t,{useMemo as o}from"react";i
8
8
  justify-content: center;
9
9
 
10
10
  border: 1px solid #e4e8ec;
11
- background-color: ${e=>e.backgroundColor||r.colors.white};
11
+ background-color: ${e=>e.backgroundColor||a.colors.white};
12
12
  border-radius: ${e=>e.borderRadius||"50%"};
13
13
  & > * {
14
14
  width: ${e=>e.iconSize}px;
15
15
  height: ${e=>e.iconSize}px;
16
16
  }
17
- `,d=c.div`
17
+ `,d=s.div`
18
18
  display: inline-block;
19
19
  height: 108px;
20
20
  background-color: ${e=>e.theme.colors.white};
@@ -36,14 +36,14 @@ import{_ as e}from"./tslib.es6-7feb5f1c.js";import t,{useMemo as o}from"react";i
36
36
  & > * {
37
37
  pointer-events: none;
38
38
  }
39
- `,p=[n.Myanmar,n.Taiwan],m=c((n=>{var{icon:c,name:s,className:m,locale:g="en-PH",dataEventCategory:b,dataEventAction:x,dataEventLabel:h,onSelect:v}=n,f=e(n,["icon","name","className","locale","dataEventCategory","dataEventAction","dataEventLabel","onSelect"]);const u=o((()=>null==m?void 0:m.includes("selected-week-pill")),[m]);return t.createElement(d,Object.assign({onClick:v,className:m?"week-pill".concat(" non-pointer-event-child ",m):"week-pill non-pointer-event-child","data-event-category":b,"data-event-action":x,"data-event-label":h},f),t.createElement(l,{size:64,iconSize:40,backgroundColor:r.colors.white},t.createElement("img",{src:c||i.getAssetPath("week_default.png"),alt:""})),u?t.createElement(a,Object.assign({type:"semiBold",size:"n1",color:r.colors.gray800},p.includes(g)&&{style:{fontSize:"10px"}}),s):t.createElement(a,Object.assign({size:"n1",color:r.colors.gray600},p.includes(g)&&{style:{fontSize:"10px"}}),s))}))`
39
+ `,p=[n.Myanmar,n.Taiwan],m=s((n=>{var{icon:s,name:l,className:m,locale:g="en-PH",dataEventCategory:b,dataEventAction:x,dataEventLabel:h,onSelect:v}=n,u=e(n,["icon","name","className","locale","dataEventCategory","dataEventAction","dataEventLabel","onSelect"]);const f=o((()=>null==m?void 0:m.includes("selected-week-pill")),[m]);return t.createElement(d,Object.assign({onClick:v,className:m?"week-pill".concat(" non-pointer-event-child ",m):"week-pill non-pointer-event-child","data-event-category":b,"data-event-action":x,"data-event-label":h},u),t.createElement(c,{size:64,iconSize:40,backgroundColor:a.colors.white},t.createElement("img",{src:s||i.getAssetPath("week_default.png"),alt:""})),f?t.createElement(r,Object.assign({type:"semiBold",size:"n1",color:a.colors.gray800},p.includes(g)&&{style:{fontSize:"10px"}}),l):t.createElement(r,Object.assign({size:"n1",color:a.colors.gray600},p.includes(g)&&{style:{fontSize:"10px"}}),l))}))`
40
40
  box-shadow: 0px 0px 24px rgba(0, 0, 0, 0.08);
41
- `,g=c(s.Slide)`
41
+ `,g=s(l.Slide)`
42
42
  cursor: pointer;
43
43
  > div * {
44
44
  pointer-events: none;
45
45
  }
46
- `,b=c(s)`
46
+ `,b=s(l)`
47
47
  .centerred-pill-wrapper {
48
48
  padding: 16px 0;
49
49
  }
@@ -1,4 +1,4 @@
1
- import e from"react";import{M as t}from"./utils-53b2e945.js";import o from"styled-components";var i="DjBFAbd";const a=({children:t,className:o,style:a,htmlFor:s,size:r})=>e.createElement("label",{"data-size":r,className:`${i} ${o||""}`,style:a,htmlFor:s},t),s=o.div`
1
+ import e from"react";import{M as t}from"./utils-f60d906f.js";import o from"styled-components";var i="DjBFAbd";const a=({children:t,className:o,style:a,htmlFor:s,size:r})=>e.createElement("label",{"data-size":r,className:`${i} ${o||""}`,style:a,htmlFor:s},t),s=o.div`
2
2
  position: relative;
3
3
  width: 100%;
4
4
 
@@ -1,4 +1,4 @@
1
- import{_ as e,a as t}from"./tslib.es6-7feb5f1c.js";import r,{createContext as n,useContext as o}from"react";import{createFormContext as i,yupResolver as a}from"@mantine/form";import"./index.styled-228e900e.js";import{B as s}from"./index-3b91e315.js";import"./gAssets.js";import{Container as l,Title as p,Input as d}from"@mantine/core";import"./index.styled-f1df3408.js";import{c as m}from"./index-0502f200.js";import{M as c}from"./utils-53b2e945.js";import{t as g}from"./theme-3d8106e4.js";import"./index.styled-7c1d555e.js";import{u}from"./useTranslations-142d35dc.js";import"./index-c23cae7f.js";import{q as b,e as h,l as f,R as x,O as w}from"./index-46a00fd5.js";import"dayjs";import"./screenSizeContext-a9ee0d97.js";import E from"styled-components";import{L as y}from"./index-1fbfb6c0.js";import"./isProduction-f16dd143.js";import{L as P}from"./Onboarding-c63cc86d.js";import"./index-5ccec059.js";import"@mantine/hooks";import"lodash/debounce";import{T as j}from"./index-04617758.js";import{V as v}from"./Visible-e14cf77f.js";import*as M from"yup";import"./translationsContext-98450578.js";import"string-format";const I=n({}),[O,T,N]=i(),k=E.div`
1
+ import{_ as e,a as t}from"./tslib.es6-02d11ec7.js";import r,{createContext as n,useContext as o}from"react";import{createFormContext as a,yupResolver as i}from"@mantine/form";import"./index.styled-ad00d8a6.js";import{B as s}from"./index-72df41e4.js";import"./gAssets.js";import{Container as l,Title as p,Input as m}from"@mantine/core";import"./index.styled-3f5fa13b.js";import{c as d}from"./index-005e3957.js";import{M as c}from"./utils-f60d906f.js";import{t as g}from"./theme-09666faa.js";import"./index.styled-be91ad13.js";import{u}from"./useTranslations-0fee2509.js";import"./index-3d0f42b6.js";import{q as b,e as h,l as f,R as x,O as w}from"./index-eff4918d.js";import"dayjs";import"./screenSizeContext-9bf65cae.js";import E from"styled-components";import{L as y}from"./index-783fb4ec.js";import"./isProduction-52b782c4.js";import{L as P}from"./Onboarding-cc38c258.js";import"./index-b64ea845.js";import"@mantine/hooks";import"lodash/debounce";import{T as j}from"./index-b1920332.js";import{V as v}from"./Visible-8fc9d6c4.js";import*as M from"yup";import"./translationsContext-fca059c7.js";import"string-format";const I=n({}),[O,T,N]=a(),k=E.div`
2
2
  margin-top: 70px;
3
3
  display: flex;
4
4
  flex-direction: column;
@@ -47,7 +47,7 @@ import{_ as e,a as t}from"./tslib.es6-7feb5f1c.js";import r,{createContext as n,
47
47
  }
48
48
  `,C=E.img`
49
49
  margin-bottom: 38px;
50
- `,q=t=>{var n,{heading:i,description:a,children:s,className:l,imgSrc:d}=t,c=e(t,["heading","description","children","className","imgSrc"]);const{isMarryBaby:u,siteType:b}=o(I);return r.createElement(z,Object.assign({},c,{className:`hhg-comp-onboarding-container ${l}`,size:"sm"}),r.createElement(m,{type:u?b:(null===(n=y[process.env.UNIFY_LOCALE])||void 0===n?void 0:n.LOGO_TYPE)||"hellobacsi"}),r.createElement(k,null,d&&r.createElement(C,{src:d,loading:"lazy"}),r.createElement("div",{className:"header"},r.createElement(p,{order:3},i),r.createElement(j,{size:"p3",mt:8,color:g.colors.gray600},a)),s))},B=E.div`
50
+ `,q=t=>{var n,{heading:a,description:i,children:s,className:l,imgSrc:m}=t,c=e(t,["heading","description","children","className","imgSrc"]);const{isMarryBaby:u,siteType:b}=o(I);return r.createElement(z,Object.assign({},c,{className:`hhg-comp-onboarding-container ${l}`,size:"sm"}),r.createElement(d,{type:u?b:(null===(n=y[process.env.UNIFY_LOCALE])||void 0===n?void 0:n.LOGO_TYPE)||"hellobacsi"}),r.createElement(k,null,m&&r.createElement(C,{src:m,loading:"lazy"}),r.createElement("div",{className:"header"},r.createElement(p,{order:3},a),r.createElement(j,{size:"p3",mt:8,color:g.colors.gray600},i)),s))},B=E.div`
51
51
  .phone-input {
52
52
  width: 100%;
53
53
  margin-bottom: 32px;
@@ -64,7 +64,7 @@ import{_ as e,a as t}from"./tslib.es6-7feb5f1c.js";import r,{createContext as n,
64
64
  border-radius: 0 4px 4px 0;
65
65
  }
66
66
  }
67
- `,S={[P.Vietnam]:"VN",[P.Cambodia]:"KH",[P.Indonesia]:"ID",[P.Malaysia]:"MY",[P.PhilippinesEnglish]:"PH",[P.PhilippinesTagalog]:"PH",[P.Taiwan]:"TW",[P.Thailand]:"TH",[P.Myanmar]:"MM"},$=({inputOrder:e=["phone"]})=>{const{t:t}=u(),n=T(),o=r.createElement("div",{className:"phone-input"},r.createElement(b,Object.assign({defaultCountry:S[process.env.UNIFY_LOCALE]||"VN"},n.getInputProps("phone"))),r.createElement(d.Error,null,n.errors.phone)),i=r.createElement(h,Object.assign({label:r.createElement(j,{size:"s4",weight:"semiBold"},t("onboarding.formEmail.yourName")),withAsterisk:!0},n.getInputProps("name"))),a=r.createElement(h,Object.assign({label:r.createElement(j,{size:"s4",weight:"semiBold",span:!0},t("onboarding.formEmail.yourEmail")),withAsterisk:!0},n.getInputProps("email"))),s=r.createElement(f,Object.assign({label:r.createElement(j,{size:"s4",weight:"semiBold",span:!0},t("onboarding.formEmail.yourBirthday")),placeholder:"DD/MM/YYYY"},n.getInputProps("dob"))),l=r.createElement(x.Group,Object.assign({className:"radio-group",label:r.createElement(j,{size:"s4",weight:"semiBold",span:!0},t("bmi.selectGender"))},n.getInputProps("gender")),r.createElement(x,{value:"0",label:t("onboarding.formEmail.genderMale")}),r.createElement(x,{value:"1",label:t("onboarding.formEmail.genderFemale")})),p=r.createElement("div",{className:"otp-input"},r.createElement(w,Object.assign({enterKeyHint:void 0,nonce:void 0},n.getInputProps("otp"))),r.createElement(d.Error,null,n.errors.otp)),m=r.createElement(h.Password,Object.assign({label:r.createElement(j,{size:"s4",weight:"semiBold",span:!0},t("onboarding.updatePassword.password")),withAsterisk:!0,rightSection:r.createElement(v,null)},n.getInputProps("password"))),c=r.createElement(h.Password,Object.assign({label:r.createElement(j,{size:"s4",weight:"semiBold",span:!0},t("onboarding.updatePassword.confirmPassword")),withAsterisk:!0,rightSection:r.createElement(v,null)},n.getInputProps("confirmPassword"))),g=e.map((e=>{switch(e){case"phone":return o;case"full_name":return i;case"email":return a;case"dob":return s;case"gender":return l;case"otp":return p;case"password":return m;case"confirm_password":return c;default:return null}}));return r.createElement(B,null,g)},D=e=>M.object().shape({phone:M.string().required(e("onboarding.updatePhone.error")).default("")}),H=e=>M.object().shape({otp:M.string().required(e("onboarding.otpForm.error")).length(6,e("onboarding.otpForm.error")).default("")}),V=e=>M.object().shape({email:M.string().required(e("onboarding.errorMessage.requiredEmail")).email(e("onboarding.errorMessage.invalidEmail")).default(""),name:M.string().required(e("onboarding.errorMessage.requiredName"))}),Y=e=>M.object().shape({password:M.string().required(e("onboarding.errorMessage.requiredPassword")).min(8,e("onboarding.errorMessage.minLength",{length:8})).matches(/.*[A-Z].*/,e("onboarding.errorMessage.passWithPattern")).default(""),confirmPassword:M.string().required(e("onboarding.errorMessage.requiredConfirmPassword")).oneOf([M.ref("password"),null],e("onboarding.errorMessage.passNotMatch")).default("")}),A=E(q)`
67
+ `,S={[P.Vietnam]:"VN",[P.Cambodia]:"KH",[P.Indonesia]:"ID",[P.Malaysia]:"MY",[P.PhilippinesEnglish]:"PH",[P.PhilippinesTagalog]:"PH",[P.Taiwan]:"TW",[P.Thailand]:"TH",[P.Myanmar]:"MM"},$=({inputOrder:e=["phone"]})=>{const{t:t}=u(),n=T(),o=r.createElement("div",{className:"phone-input"},r.createElement(b,Object.assign({defaultCountry:S[process.env.UNIFY_LOCALE]||"VN"},n.getInputProps("phone"))),r.createElement(m.Error,null,n.errors.phone)),a=r.createElement(h,Object.assign({label:r.createElement(j,{size:"s4",weight:"semiBold"},t("onboarding.formEmail.yourName")),withAsterisk:!0},n.getInputProps("name"))),i=r.createElement(h,Object.assign({label:r.createElement(j,{size:"s4",weight:"semiBold",span:!0},t("onboarding.formEmail.yourEmail")),withAsterisk:!0},n.getInputProps("email"))),s=r.createElement(f,Object.assign({label:r.createElement(j,{size:"s4",weight:"semiBold",span:!0},t("onboarding.formEmail.yourBirthday")),placeholder:"DD/MM/YYYY"},n.getInputProps("dob"))),l=r.createElement(x.Group,Object.assign({className:"radio-group",label:r.createElement(j,{size:"s4",weight:"semiBold",span:!0},t("bmi.selectGender"))},n.getInputProps("gender")),r.createElement(x,{value:"0",label:t("onboarding.formEmail.genderMale")}),r.createElement(x,{value:"1",label:t("onboarding.formEmail.genderFemale")})),p=r.createElement("div",{className:"otp-input"},r.createElement(w,Object.assign({enterKeyHint:void 0,nonce:void 0},n.getInputProps("otp"))),r.createElement(m.Error,null,n.errors.otp)),d=r.createElement(h.Password,Object.assign({label:r.createElement(j,{size:"s4",weight:"semiBold",span:!0},t("onboarding.updatePassword.password")),withAsterisk:!0,rightSection:r.createElement(v,null)},n.getInputProps("password"))),c=r.createElement(h.Password,Object.assign({label:r.createElement(j,{size:"s4",weight:"semiBold",span:!0},t("onboarding.updatePassword.confirmPassword")),withAsterisk:!0,rightSection:r.createElement(v,null)},n.getInputProps("confirmPassword"))),g=e.map((e=>{switch(e){case"phone":return o;case"full_name":return a;case"email":return i;case"dob":return s;case"gender":return l;case"otp":return p;case"password":return d;case"confirm_password":return c;default:return null}}));return r.createElement(B,null,g)},D=e=>M.object().shape({phone:M.string().required(e("onboarding.updatePhone.error")).default("")}),H=e=>M.object().shape({otp:M.string().required(e("onboarding.otpForm.error")).length(6,e("onboarding.otpForm.error")).default("")}),V=e=>M.object().shape({email:M.string().required(e("onboarding.errorMessage.requiredEmail")).email(e("onboarding.errorMessage.invalidEmail")).default(""),name:M.string().required(e("onboarding.errorMessage.requiredName"))}),Y=e=>M.object().shape({password:M.string().required(e("onboarding.errorMessage.requiredPassword")).min(8,e("onboarding.errorMessage.minLength",{length:8})).matches(/.*[A-Z].*/,e("onboarding.errorMessage.passWithPattern")).default(""),confirmPassword:M.string().required(e("onboarding.errorMessage.requiredConfirmPassword")).oneOf([M.ref("password"),null],e("onboarding.errorMessage.passNotMatch")).default("")}),A=E(q)`
68
68
  .phone-input {
69
69
  width: 100%;
70
70
  margin-bottom: 32px;
@@ -81,7 +81,7 @@ import{_ as e,a as t}from"./tslib.es6-7feb5f1c.js";import r,{createContext as n,
81
81
  border-radius: 0 4px 4px 0;
82
82
  }
83
83
  }
84
- `,L={[P.Vietnam]:"VN",[P.Cambodia]:"KH",[P.Indonesia]:"ID",[P.Malaysia]:"MY",[P.PhilippinesEnglish]:"PH",[P.PhilippinesTagalog]:"PH",[P.Taiwan]:"TW",[P.Thailand]:"TH",[P.Myanmar]:"MM"},F=({onClose:e,onSubmit:n,canSkip:o=!0,customFormTexts:i})=>{const{t:l}=u(),p=N({initialValues:{phone:""},validate:a(D(l))});return r.createElement(A,{heading:(null==i?void 0:i.heading)||l("onboarding.updatePhone.heading"),description:(null==i?void 0:i.description)||l("onboarding.updatePhone.description")},r.createElement(O,{form:p},r.createElement("form",{onSubmit:p.onSubmit((e=>t(void 0,void 0,void 0,(function*(){n(e.phone)}))),(e=>{console.log(e)}))},r.createElement($,{inputOrder:["phone"]}),r.createElement(s,{color:"primary",isBlock:!0,size:"lg",type:"submit","data-event-category":"Sign Up","data-event-action":"Update Phone Number","data-event-label":"undefined"!=typeof window?window.location.href:"",className:"pointer-event-child-none"},l("onboarding.button.continue")),o&&r.createElement(s,{color:"ghost",isBlock:!0,size:"lg",onClick:e,type:"button"},l("onboarding.button.skip")))))};P.Vietnam,P.Cambodia,P.Indonesia,P.Malaysia,P.PhilippinesEnglish,P.PhilippinesTagalog,P.Taiwan,P.Thailand,P.Myanmar;const U=(e="")=>{const t=e.indexOf("@"),r=e.substring(0,t),n=r.length>3?3:r.length;return e.replace(e.substring(n,t),e.slice(n,t).replace(/./g,"x"))},_=E(q)`
84
+ `,L={[P.Vietnam]:"VN",[P.Cambodia]:"KH",[P.Indonesia]:"ID",[P.Malaysia]:"MY",[P.PhilippinesEnglish]:"PH",[P.PhilippinesTagalog]:"PH",[P.Taiwan]:"TW",[P.Thailand]:"TH",[P.Myanmar]:"MM"},F=({onClose:e,onSubmit:n,canSkip:o=!0,customFormTexts:a})=>{const{t:l}=u(),p=N({initialValues:{phone:""},validate:i(D(l))});return r.createElement(A,{heading:(null==a?void 0:a.heading)||l("onboarding.updatePhone.heading"),description:(null==a?void 0:a.description)||l("onboarding.updatePhone.description")},r.createElement(O,{form:p},r.createElement("form",{onSubmit:p.onSubmit((e=>t(void 0,void 0,void 0,(function*(){n(e.phone)}))),(e=>{console.log(e)}))},r.createElement($,{inputOrder:["phone"]}),r.createElement(s,{color:"primary",isBlock:!0,size:"lg",type:"submit","data-event-category":"Sign Up","data-event-action":"Update Phone Number","data-event-label":"undefined"!=typeof window?window.location.href:"",className:"pointer-event-child-none"},l("onboarding.button.continue")),o&&r.createElement(s,{color:"ghost",isBlock:!0,size:"lg",onClick:e,type:"button"},l("onboarding.button.skip")))))};P.Vietnam,P.Cambodia,P.Indonesia,P.Malaysia,P.PhilippinesEnglish,P.PhilippinesTagalog,P.Taiwan,P.Thailand,P.Myanmar;const U=(e="")=>{const t=e.indexOf("@"),r=e.substring(0,t),n=r.length>3?3:r.length;return e.replace(e.substring(n,t),e.slice(n,t).replace(/./g,"x"))},_=E(q)`
85
85
  .otp-input {
86
86
  margin-bottom: 36px;
87
87
  ${c.mbDown} {
@@ -1,4 +1,4 @@
1
- import e,{memo as t,useRef as i,useState as a,useEffect as n,useImperativeHandle as o,Fragment as r,useMemo as s}from"react";import l,{keyframes as d,css as c}from"styled-components";import{M as p}from"./utils-53b2e945.js";import{L as h}from"./index-b449b11b.js";import{T as m}from"./index-5810a91b.js";import{useMantineTheme as u,createStyles as g}from"@mantine/core";import{B as f}from"./index-3b91e315.js";import{B as x,T as b,C as y,P as v}from"./index.styled-228e900e.js";import{H as w}from"./index-b8d1644a.js";import{I as k}from"./index-2f8b98a5.js";import{_ as E}from"./tslib.es6-7feb5f1c.js";import C from"dayjs";import"./screenSizeContext-a9ee0d97.js";import{t as $}from"./theme-3d8106e4.js";import"./index-1fbfb6c0.js";import"./isProduction-f16dd143.js";import{G as S}from"./Onboarding-c63cc86d.js";import"./gAssets.js";import{f as D,g as _}from"./index-46a00fd5.js";import{yupResolver as T}from"@hookform/resolvers/yup";import{useForm as z,Controller as I}from"react-hook-form";import{I as N}from"./index-ade6919a.js";import{B as A,D as P}from"./index-ad80a00f.js";import{u as B}from"./useTranslations-142d35dc.js";import{ar as j,b as O}from"./index.styled-4d4c8449.js";import{L}from"./index.styled-f1df3408.js";import{C as M}from"./index-0502f200.js";import{format as F,addDays as U}from"date-fns";import{M as R}from"./index-f6ca06bb.js";import"./index-c23cae7f.js";import"./index-5ccec059.js";import{S as q}from"./index-c75b134d.js";import{D as H}from"./types-09106e37.js";import V from"react-day-picker/DayPickerInput";const G=({type:t,size:i="small",label:a,name:n,checked:o,value:r,className:s,isDisabled:l=!1,onChange:d,dataEventCategory:c,dataEventAction:p,dataEventLabel:h})=>{const m=!!p&&!!c&&!!h?{"data-event-category":c,"data-event-action":p,"data-event-label":h}:{};return e.createElement(x,{"data-disabled":l,className:s,"data-type":t,"data-size":i},e.createElement("label",Object.assign({style:{display:"flex",alignItems:"center"}},m),e.createElement("input",Object.assign({type:"radio",checked:o,name:n,value:r,onChange:()=>d(r)},m)),a))},W=t((()=>e.createElement("div",{className:"shoppable"},e.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("rect",{width:"24",height:"24",rx:"12",fill:"#1B3250"}),e.createElement("path",{d:"M16.6667 8.00033H15.3333C15.3333 6.16033 13.84 4.66699 12 4.66699C10.16 4.66699 8.66667 6.16033 8.66667 8.00033H7.33333C6.6 8.00033 6 8.60033 6 9.33366V17.3337C6 18.067 6.6 18.667 7.33333 18.667H16.6667C17.4 18.667 18 18.067 18 17.3337V9.33366C18 8.60033 17.4 8.00033 16.6667 8.00033ZM12 6.00033C13.1067 6.00033 14 6.89366 14 8.00033H10C10 6.89366 10.8933 6.00033 12 6.00033ZM12 12.667C10.4467 12.667 9.14 11.607 8.77333 10.167C8.66 9.74699 8.98667 9.33366 9.42 9.33366C9.73333 9.33366 9.98667 9.56033 10.0733 9.86699C10.3067 10.7137 11.08 11.3337 12 11.3337C12.92 11.3337 13.6933 10.7137 13.9267 9.86699C14.0133 9.56033 14.2667 9.33366 14.58 9.33366C15.0133 9.33366 15.3333 9.74699 15.2267 10.167C14.86 11.607 13.5533 12.667 12 12.667Z",fill:"white"}))))),Y=t((({dataEventCategoryForBookmark:t,dataEventActionForBookmark:i,dataEventLabelForBookmark:a})=>e.createElement("svg",{"data-event-category":t,"data-event-action":i,"data-event-label":a,width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M13 15L7 11.1111L1 15V2.55556C1 2.143 1.18061 1.74733 1.5021 1.45561C1.82359 1.16389 2.25963 1 2.71429 1H11.2857C11.7404 1 12.1764 1.16389 12.4979 1.45561C12.8194 1.74733 13 2.143 13 2.55556V15Z",fill:"#2ED69E",stroke:"#2ED69E",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})))),Z=t((({dataEventCategoryForBookmark:t,dataEventActionForBookmark:i,dataEventLabelForBookmark:a})=>e.createElement("svg",{"data-event-category":t,"data-event-action":i,"data-event-label":a,width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M12.75 2.25H5.25C4.425 2.25 3.75 2.925 3.75 3.75V15.75L9 13.5L14.25 15.75V3.75C14.25 2.925 13.575 2.25 12.75 2.25Z",fill:"#D2D6DC"})))),X=l.div`
1
+ import e,{memo as t,useRef as i,useState as a,useEffect as n,useImperativeHandle as o,Fragment as r,useMemo as s}from"react";import l,{keyframes as d,css as c}from"styled-components";import{M as p}from"./utils-f60d906f.js";import{L as h}from"./index-12640201.js";import{T as m}from"./index-9211bd11.js";import{useMantineTheme as u,createStyles as g}from"@mantine/core";import{B as f}from"./index-72df41e4.js";import{B as x,T as b,C as y,P as v}from"./index.styled-ad00d8a6.js";import{H as w}from"./index-cd4deb55.js";import{I as k}from"./index-115ec021.js";import{_ as E}from"./tslib.es6-02d11ec7.js";import C from"dayjs";import"./screenSizeContext-9bf65cae.js";import{t as $}from"./theme-09666faa.js";import"./index-783fb4ec.js";import"./isProduction-52b782c4.js";import{G as S}from"./Onboarding-cc38c258.js";import"./gAssets.js";import{f as D,g as _}from"./index-eff4918d.js";import{yupResolver as T}from"@hookform/resolvers/yup";import{useForm as z,Controller as I}from"react-hook-form";import{I as N}from"./index-0584f4e0.js";import{B as A,D as P}from"./index-77cc38c1.js";import{u as B}from"./useTranslations-0fee2509.js";import{ar as j,b as O}from"./index.styled-a06a6b82.js";import{L}from"./index.styled-3f5fa13b.js";import{C as M}from"./index-005e3957.js";import{format as F,addDays as U}from"date-fns";import{M as R}from"./index-62fb15a0.js";import"./index-3d0f42b6.js";import"./index-b64ea845.js";import{S as q}from"./index-3f1ff8fe.js";import{D as H}from"./types-b8a4ed34.js";import V from"react-day-picker/DayPickerInput";const G=({type:t,size:i="small",label:a,name:n,checked:o,value:r,className:s,isDisabled:l=!1,onChange:d,dataEventCategory:c,dataEventAction:p,dataEventLabel:h})=>{const m=!!p&&!!c&&!!h?{"data-event-category":c,"data-event-action":p,"data-event-label":h}:{};return e.createElement(x,{"data-disabled":l,className:s,"data-type":t,"data-size":i},e.createElement("label",Object.assign({style:{display:"flex",alignItems:"center"}},m),e.createElement("input",Object.assign({type:"radio",checked:o,name:n,value:r,onChange:()=>d(r)},m)),a))},W=t((()=>e.createElement("div",{className:"shoppable"},e.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("rect",{width:"24",height:"24",rx:"12",fill:"#1B3250"}),e.createElement("path",{d:"M16.6667 8.00033H15.3333C15.3333 6.16033 13.84 4.66699 12 4.66699C10.16 4.66699 8.66667 6.16033 8.66667 8.00033H7.33333C6.6 8.00033 6 8.60033 6 9.33366V17.3337C6 18.067 6.6 18.667 7.33333 18.667H16.6667C17.4 18.667 18 18.067 18 17.3337V9.33366C18 8.60033 17.4 8.00033 16.6667 8.00033ZM12 6.00033C13.1067 6.00033 14 6.89366 14 8.00033H10C10 6.89366 10.8933 6.00033 12 6.00033ZM12 12.667C10.4467 12.667 9.14 11.607 8.77333 10.167C8.66 9.74699 8.98667 9.33366 9.42 9.33366C9.73333 9.33366 9.98667 9.56033 10.0733 9.86699C10.3067 10.7137 11.08 11.3337 12 11.3337C12.92 11.3337 13.6933 10.7137 13.9267 9.86699C14.0133 9.56033 14.2667 9.33366 14.58 9.33366C15.0133 9.33366 15.3333 9.74699 15.2267 10.167C14.86 11.607 13.5533 12.667 12 12.667Z",fill:"white"}))))),Y=t((({dataEventCategoryForBookmark:t,dataEventActionForBookmark:i,dataEventLabelForBookmark:a})=>e.createElement("svg",{"data-event-category":t,"data-event-action":i,"data-event-label":a,width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M13 15L7 11.1111L1 15V2.55556C1 2.143 1.18061 1.74733 1.5021 1.45561C1.82359 1.16389 2.25963 1 2.71429 1H11.2857C11.7404 1 12.1764 1.16389 12.4979 1.45561C12.8194 1.74733 13 2.143 13 2.55556V15Z",fill:"#2ED69E",stroke:"#2ED69E",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})))),Z=t((({dataEventCategoryForBookmark:t,dataEventActionForBookmark:i,dataEventLabelForBookmark:a})=>e.createElement("svg",{"data-event-category":t,"data-event-action":i,"data-event-label":a,width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M12.75 2.25H5.25C4.425 2.25 3.75 2.925 3.75 3.75V15.75L9 13.5L14.25 15.75V3.75C14.25 2.925 13.575 2.25 12.75 2.25Z",fill:"#D2D6DC"})))),X=l.div`
2
2
  --dropdown-padding: 12px 18px 12px 16px;
3
3
  position: relative;
4
4
  box-sizing: border-box;
@@ -1,4 +1,4 @@
1
- import{M as e}from"./utils-53b2e945.js";import t from"styled-components";import{t as i}from"./theme-3d8106e4.js";import{C as o}from"./index.styled-228e900e.js";import a,{useMemo as r,createContext as n,useState as l,useEffect as s,memo as p,useContext as d}from"react";import{u as c}from"./useTranslations-142d35dc.js";import{CommonGAssets as m}from"./gAssets.js";import{a as g,_ as h}from"./tslib.es6-7feb5f1c.js";import{C as u,a as b,T as x,d as f}from"./index-1fbfb6c0.js";import{g as y}from"./cookieHelper-833f0129.js";import v from"slugify";import _ from"string-format";import{i as w}from"./isProduction-f16dd143.js";import{g as E,a as T,b as O,c as A}from"./routing-b298b666.js";import I from"dayjs";import L from"dayjs/plugin/relativeTime";const $=t.div`
1
+ import{M as e}from"./utils-f60d906f.js";import t from"styled-components";import{t as i}from"./theme-09666faa.js";import{C as o}from"./index.styled-ad00d8a6.js";import a,{useMemo as r,createContext as n,useState as l,useEffect as s,memo as p,useContext as d}from"react";import{u as c}from"./useTranslations-0fee2509.js";import{CommonGAssets as m}from"./gAssets.js";import{a as g,_ as h}from"./tslib.es6-02d11ec7.js";import{C as u,a as b,T as x,d as f}from"./index-783fb4ec.js";import{g as y}from"./cookieHelper-3b17012e.js";import v from"slugify";import _ from"string-format";import{i as w}from"./isProduction-52b782c4.js";import{g as E,a as T,b as O,c as A}from"./routing-b0972916.js";import I from"dayjs";import L from"dayjs/plugin/relativeTime";const $=t.div`
2
2
  position: fixed;
3
3
  left: 50%;
4
4
 
@@ -1,4 +1,4 @@
1
- import e,{css as o}from"styled-components";import{t}from"./theme-3d8106e4.js";import{M as r}from"./utils-53b2e945.js";import{_ as i}from"./tslib.es6-7feb5f1c.js";import a,{useState as s,forwardRef as l}from"react";import{L as n}from"./index.styled-f1df3408.js";import{C as c}from"./index-0502f200.js";import{T as d}from"./index-5810a91b.js";import"dayjs";import{s as p,e as h,b as C,f as g,c as m,g as v,a as x,d as u,h as w}from"./screenSizeContext-a9ee0d97.js";import"./index-1fbfb6c0.js";import"./isProduction-f16dd143.js";import"./Onboarding-c63cc86d.js";import"./gAssets.js";import{createStyles as f}from"@mantine/core";const b=e.div`
1
+ import e,{css as o}from"styled-components";import{t}from"./theme-09666faa.js";import{M as r}from"./utils-f60d906f.js";import{_ as i}from"./tslib.es6-02d11ec7.js";import a,{useState as s,forwardRef as l}from"react";import{L as n}from"./index.styled-3f5fa13b.js";import{C as c}from"./index-005e3957.js";import{T as d}from"./index-9211bd11.js";import"dayjs";import{s as p,e as h,b as C,f as g,c as m,g as v,a as x,d as u,h as w}from"./screenSizeContext-9bf65cae.js";import"./index-783fb4ec.js";import"./isProduction-52b782c4.js";import"./Onboarding-cc38c258.js";import"./gAssets.js";import{createStyles as f}from"@mantine/core";const b=e.div`
2
2
  background-color: var(--background-color, transparent);
3
3
  color: white;
4
4
  cursor: pointer;
@@ -1,4 +1,4 @@
1
- import{_ as t}from"./tslib.es6-7feb5f1c.js";import e from"react";import i from"styled-components";const p=i((i=>{var{type:p}=i,n=t(i,["type"]);return e.createElement(p,n)}))`
1
+ import{_ as t}from"./tslib.es6-02d11ec7.js";import e from"react";import i from"styled-components";const p=i((i=>{var{type:p}=i,n=t(i,["type"]);return e.createElement(p,n)}))`
2
2
  color: var(--text-color, ${t=>t.theme.mbColors.dark});
3
3
  font-family: Krub;
4
4
  font-weight: 600;
package/build/esm/lead.js CHANGED
@@ -1 +1 @@
1
- import{_ as e,a as t}from"./tslib.es6-7feb5f1c.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-98450578.js";import{g as u,s as p}from"./cookieHelper-833f0129.js";import{b as h,a as g}from"./utils-53b2e945.js";import{v1 as v}from"uuid";import{u as b}from"./useTranslations-142d35dc.js";import"./index.styled-228e900e.js";import{B as y}from"./index-3b91e315.js";import{CommonGAssets as f}from"./gAssets.js";import"@mantine/core";import"./index.styled-f1df3408.js";import"./index-0502f200.js";import{t as k}from"./theme-3d8106e4.js";import"./index.styled-7c1d555e.js";import"string-format";import"./index-c23cae7f.js";import{e as _,R as E,x as w,l as C,q as N,N as S}from"./index-46a00fd5.js";import T from"dayjs";import"./screenSizeContext-a9ee0d97.js";import"styled-components";import"./index-1fbfb6c0.js";import"./isProduction-f16dd143.js";import"./Onboarding-c63cc86d.js";import"./index-5ccec059.js";import"@mantine/hooks";import"./index.styled-5509c30c.js";import"date-fns";import"react-day-picker/DayPickerInput";import"./index.styled-4d4c8449.js";import"./index-ad80a00f.js";import"lodash/throttle";import"keen-slider/react";import"./types-09106e37.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-dc6441de.js";import{S as x}from"./index-722f08f8.js";import{M as O}from"./index.styled-01789e81.js";import{createFormContext as j}from"@mantine/form";import"yup";import{T as P}from"./index-5810a91b.js";import{H as B}from"./index-b8d1644a.js";import"@mantine/dates";import"@mantine/carousel";import"./index-b449b11b.js";import"./index-2f8b98a5.js";import"@hookform/resolvers/yup";import"./index-ade6919a.js";import"./useUniqueId-1bf68487.js";import"./index-f6ca06bb.js";import"./index-c75b134d.js";import"slugify";import"./routing-b298b666.js";import"dayjs/plugin/relativeTime";import"./index-04617758.js";import"./Visible-e14cf77f.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-02d11ec7.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-fca059c7.js";import{g as u,s as p}from"./cookieHelper-3b17012e.js";import{b as h,a as g}from"./utils-f60d906f.js";import{v1 as v}from"uuid";import{u as b}from"./useTranslations-0fee2509.js";import"./index.styled-ad00d8a6.js";import{B as f}from"./index-72df41e4.js";import{CommonGAssets as y}from"./gAssets.js";import"@mantine/core";import"./index.styled-3f5fa13b.js";import"./index-005e3957.js";import{t as k}from"./theme-09666faa.js";import"./index.styled-be91ad13.js";import"string-format";import"./index-3d0f42b6.js";import{e as _,R as E,x as w,l as C,q as N,N as S}from"./index-eff4918d.js";import T from"dayjs";import"./screenSizeContext-9bf65cae.js";import"styled-components";import"./index-783fb4ec.js";import"./isProduction-52b782c4.js";import"./Onboarding-cc38c258.js";import"./index-b64ea845.js";import"@mantine/hooks";import"./index.styled-9910b1de.js";import"date-fns";import"react-day-picker/DayPickerInput";import"./index.styled-a06a6b82.js";import"./index-77cc38c1.js";import"lodash/throttle";import"keen-slider/react";import"./types-b8a4ed34.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-38fe8b82.js";import{S as x}from"./index-ef0e9c6c.js";import{M as O}from"./index.styled-5acc1e41.js";import{createFormContext as j}from"@mantine/form";import"yup";import{T as P}from"./index-9211bd11.js";import{H as B}from"./index-cd4deb55.js";import"@mantine/dates";import"@mantine/carousel";import"./index-12640201.js";import"./index-115ec021.js";import"@hookform/resolvers/yup";import"./index-0584f4e0.js";import"./useUniqueId-265a038e.js";import"./index-62fb15a0.js";import"./index-3f1ff8fe.js";import"slugify";import"./routing-b0972916.js";import"dayjs/plugin/relativeTime";import"./index-b1920332.js";import"./Visible-8fc9d6c4.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:f}=q(d);return g&&f?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,f]=n(!1),y=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)?f(!0):import("@react-google-maps/api").then((e=>{v((()=>e.LoadScript)),setTimeout((()=>{f(!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-"+y.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(f,{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})))},fe=({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,y]=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():y(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():y(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),y(m&&!e?"OTP is required":void 0)},error:m?v:void 0}),a.createElement(f,{size:"md",color:"primary",className:`lead-modal__btn ${A}`,disabled:!d},s("lead.otp.verify")),a.createElement(f,{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)`:""}))))},ye=({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:y.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(fe,{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(f,{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 f=[...m,...b],y=document.cookie.split("; ").map((e=>e.split("=")[0])),k=y.filter((e=>e.includes("lead_submited")));Pe("--listCampaignCodeSubmited",k);const _=y.filter((e=>e.includes("lead_closed")));Pe("--listCampaignCodeClosed",_);const E=[...k,..._],w=f.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:f,image:y,image_desktop:k,code:_,image_background:E,image_overlay_mobile:w,image_overlay_desktop:C}=e,{currentLayout:N}=f,S=f.imageBlocks?JSON.parse(f.imageBlocks):{},T=JSON.parse(f.actionBlocks),x=JSON.parse(f.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_${f.popupVersion}`,{domain:"."+g,path:"/"})),1==r&&(Pe(`⌛ Popup will show again after ${i} days!`),p(`lead_submited_${_}`,`target_${f.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:y,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:y,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:y,imageDesktop:k,onClose:n,onOtherSubmit:L}):N.includes("LightBox")||N.includes("Inline")||"Fullscreen"==N||"Sidebar"==N||"Slider"==N?a.createElement(ye,{popupId:P.current,extraFields:f,onClose:n,onOtherSubmit:L,imageMobile:y,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:y,imageDesktop:k,currentLayout:N}):null},Le=({apiUrl:e,siteDomain:l,siteId:s,locale:h,apiSubotUrl:v,DEBUG_URL:b})=>{var f;const y=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})),y.current&&window.removeEventListener("scroll",y.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===(f=null==E?void 0:E.extra_fields)||void 0===f?void 0:f.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 f=Object.keys(a).map((e=>({name:e,value:String(a[e])}))),y=u("_ga")||null;window.intlTelInputUtils||(yield require("intl-tel-input/build/js/utils"));const k={url:location.href.toLowerCase(),title_article:document.title,meta:f.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:y};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}},f.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-722f08f8.js";import{r as a,s as r}from"./index-46a00fd5.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,B as Tabs,y as emotionCache,s as useMantineLocale}from"./index-46a00fd5.js";export{T as Text}from"./index-04617758.js";export{B as Button}from"./index-97cfd9ea.js";import{g as o}from"./index-ed0947c0.js";export{A as AspectRatio,S as Switch,g as getMantineThemeOverride,t as themeColors}from"./index-ed0947c0.js";import{_ as i}from"./tslib.es6-7feb5f1c.js";import c,{useMemo as m}from"react";import{Indicator as d,Badge as p,Spoiler as b,LoadingOverlay as u,MantineProvider as f,clsx as j,Title as h,Text as E,Button as H}from"@mantine/core";import"dayjs";import"./screenSizeContext-a9ee0d97.js";import"styled-components";import{t as P}from"./theme-3d8106e4.js";import"./index-1fbfb6c0.js";import"./utils-53b2e945.js";import"./isProduction-f16dd143.js";import"./Onboarding-c63cc86d.js";import"./gAssets.js";export{M as Modal}from"./index-2c5717b3.js";import{T as N}from"./index-5810a91b.js";import{u as k}from"./useTranslations-142d35dc.js";export{C as CentralCarousel}from"./index-5ccec059.js";export{S as Slider}from"./index-c75b134d.js";export{A as Anchor}from"./index-6c7a01f8.js";import"@mantine/dates";import"@mantine/hooks";import"@mantine/carousel";import"lodash/throttle";import"./translationsContext-98450578.js";import"string-format";import"./index-3b91e315.js";const L=e=>{var{styles:t}=e,s=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)},s))},D=e=>c.createElement(a,Object.assign({minRows:2,maxRows:4},e)),I=e=>{var{color:t=P.colors.primaryBase,styles:s}=e,a=i(e,["color","styles"]);return c.createElement(p,Object.assign({variant:"filled",color:t,styles:Object.assign({root:{borderRadius:"2px",background:t,textTransform:"unset"}},s)},a))},_=e=>{var{children:t,line:s,lineHeight:a,trackingAttributes:r,maxHeight:o,customExpandFn:n}=e,l=i(e,["children","line","lineHeight","trackingAttributes","maxHeight","customExpandFn"]);const{t:d}=k(),p=m((()=>o||(s&&a?s*a:(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(b,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(u,Object.assign({loaderProps:{color:P.colors.primaryBase}},e)),G=e=>{var{children:t,locale:s,template:a="hb"}=e,n=i(e,["children","locale","template"]);return r(s),c.createElement(f,Object.assign({theme:o(s,a)},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:s,description:a,button:r,buttonProps:o,style:n,className:l}=e,m=o||{},{size:d="lg",variant:p="outline"}=m,x=i(m,["size","variant"]),b=t;return c.createElement("div",{className:j("result",J.container,l),style:n},b&&c.createElement("div",{className:j("resultIconContainer",J.iconContainer)},c.createElement(b,{className:j("resultIcon",J.icon)})),c.createElement(h,{order:3,size:"h3",className:j("resultTitle",J.title)},s),c.createElement(E,{className:j("resultDescription",J.description)},a),r&&c.createElement(H,Object.assign({},x,{size:d,variant:p,className:j("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};
1
+ export{S as Select}from"./index-ef0e9c6c.js";import{r as a,s as r}from"./index-eff4918d.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,B as Tabs,y as emotionCache,s as useMantineLocale}from"./index-eff4918d.js";export{T as Text}from"./index-b1920332.js";export{B as Button}from"./index-e2441395.js";import{g as o}from"./index-5c473995.js";export{A as AspectRatio,S as Switch,g as getMantineThemeOverride,t as themeColors}from"./index-5c473995.js";import{_ as i}from"./tslib.es6-02d11ec7.js";import c,{useMemo as m}from"react";import{Indicator as d,Badge as p,Spoiler as f,LoadingOverlay as b,MantineProvider as u,clsx as j,Title as h,Text as E,Button as H}from"@mantine/core";import"dayjs";import"./screenSizeContext-9bf65cae.js";import"styled-components";import{t as P}from"./theme-09666faa.js";import"./index-783fb4ec.js";import"./utils-f60d906f.js";import"./isProduction-52b782c4.js";import"./Onboarding-cc38c258.js";import"./gAssets.js";export{M as Modal}from"./index-413d6b9b.js";import{T as N}from"./index-9211bd11.js";import{u as k}from"./useTranslations-0fee2509.js";export{C as CentralCarousel}from"./index-b64ea845.js";export{S as Slider}from"./index-3f1ff8fe.js";export{A as Anchor}from"./index-d51966d5.js";import"@mantine/dates";import"@mantine/hooks";import"@mantine/carousel";import"lodash/throttle";import"./translationsContext-fca059c7.js";import"string-format";import"./index-72df41e4.js";const L=e=>{var{styles:t}=e,s=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)},s))},D=e=>c.createElement(a,Object.assign({minRows:2,maxRows:4},e)),I=e=>{var{color:t=P.colors.primaryBase,styles:s}=e,a=i(e,["color","styles"]);return c.createElement(p,Object.assign({variant:"filled",color:t,styles:Object.assign({root:{borderRadius:"2px",background:t,textTransform:"unset"}},s)},a))},_=e=>{var{children:t,line:s,lineHeight:a,trackingAttributes:r,maxHeight:o,customExpandFn:n}=e,l=i(e,["children","line","lineHeight","trackingAttributes","maxHeight","customExpandFn"]);const{t:d}=k(),p=m((()=>o||(s&&a?s*a:(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(f,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(b,Object.assign({loaderProps:{color:P.colors.primaryBase}},e)),G=e=>{var{children:t,locale:s,template:a="hb"}=e,n=i(e,["children","locale","template"]);return r(s),c.createElement(u,Object.assign({theme:o(s,a)},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:s,description:a,button:r,buttonProps:o,style:n,className:l}=e,m=o||{},{size:d="lg",variant:p="outline"}=m,f=i(m,["size","variant"]),x=t;return c.createElement("div",{className:j("result",J.container,l),style:n},x&&c.createElement("div",{className:j("resultIconContainer",J.iconContainer)},c.createElement(x,{className:j("resultIcon",J.icon)})),c.createElement(h,{order:3,size:"h3",className:j("resultTitle",J.title)},s),c.createElement(E,{className:j("resultDescription",J.description)},a),r&&c.createElement(H,Object.assign({},f,{size:d,variant:p,className:j("resultButton",J.button,f.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-a5af830c.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-a9ee0d97.js";export{d as deleteCookie,g as getCookie,s as setCookie}from"./cookieHelper-833f0129.js";import"react";import"styled-components";export{M as MBTheme,t as theme}from"./theme-3d8106e4.js";export{a as abbreviateNumber,f as formatPill}from"./dataTransform-bbccaef4.js";export{d as getCareApiDomain,g as getCurrentBaseUrl,a as getCurrentSsoUrl,c as getDiscoverApiDomain,b as getTogetherApiDomain}from"./routing-b298b666.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-53b2e945.js";export{f as formatHealthTool,g as getDynamicHealthTool,a as getDynamicHealthToolWithCache}from"./getDynamicHealthTool-e0865e00.js";export{g as getSocialList}from"./getSocialList-844ea065.js";import"dayjs";import"lodash/throttle";import"./index-1fbfb6c0.js";import"./Onboarding-c63cc86d.js";import"./isProduction-f16dd143.js";import"./tslib.es6-7feb5f1c.js";import"./core-75aa50f3.js";import"./normalizeLink-7b6cf263.js";import"./gAssets.js";
1
+ export{a as ageGenerate,c as convertLocalizedStringToNumber,l as localizeNumberFormat}from"./localizeNumberFormat-c7fbaac7.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-9bf65cae.js";export{d as deleteCookie,g as getCookie,s as setCookie}from"./cookieHelper-3b17012e.js";import"react";import"styled-components";export{M as MBTheme,t as theme}from"./theme-09666faa.js";export{a as abbreviateNumber,f as formatPill}from"./dataTransform-068b1887.js";export{d as getCareApiDomain,g as getCurrentBaseUrl,a as getCurrentSsoUrl,c as getDiscoverApiDomain,b as getTogetherApiDomain}from"./routing-b0972916.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-f60d906f.js";export{f as formatHealthTool,g as getDynamicHealthTool,a as getDynamicHealthToolWithCache}from"./getDynamicHealthTool-570e9ff3.js";export{g as getSocialList}from"./getSocialList-5c823e1c.js";import"dayjs";import"lodash/throttle";import"./index-783fb4ec.js";import"./Onboarding-cc38c258.js";import"./isProduction-52b782c4.js";import"./tslib.es6-02d11ec7.js";import"./core-59eb3c84.js";import"./normalizeLink-5703bfe6.js";import"./gAssets.js";
@@ -1 +1 @@
1
- import"./tslib.es6-7feb5f1c.js";import"react";import"./core-75aa50f3.js";export{N as NavigationV2,g as getNavMenuContent,a as getNavMenuContentWithCache}from"./index-8cb33bb5.js";import"./index-1fbfb6c0.js";import"./normalizeLink-7b6cf263.js";import"./routing-b298b666.js";import"./dataTransform-4f8ed05f.js";import"./index.styled-4d4c8449.js";import"./isProduction-f16dd143.js";import"./gAssets.js";import"./Onboarding-c63cc86d.js";import"./useUniqueId-1bf68487.js";import"./index-5810a91b.js";import"./index-b449b11b.js";import"./index-0502f200.js";import"./utils-53b2e945.js";import"styled-components";import"./useTranslations-142d35dc.js";import"./translationsContext-98450578.js";import"string-format";import"lodash/throttle";import"./index.styled-228e900e.js";import"./theme-3d8106e4.js";import"./index.styled-f1df3408.js";import"dayjs";import"./screenSizeContext-a9ee0d97.js";import"@mantine/core";import"./index-3b91e315.js";import"./cookieHelper-833f0129.js";import"./index.styled-7c1d555e.js";import"./index-c23cae7f.js";import"./index-46a00fd5.js";import"@mantine/dates";import"@mantine/hooks";import"@mantine/carousel";import"./index-5ccec059.js";import"./constants-f96bf356.js";import"./useIsInit-be586072.js";import"./index-b8d1644a.js";import"lodash/debounce";import"slugify";import"dayjs/plugin/relativeTime";
1
+ import"./tslib.es6-02d11ec7.js";import"react";import"./core-59eb3c84.js";export{N as NavigationV2,g as getNavMenuContent,a as getNavMenuContentWithCache}from"./index-b7205a41.js";import"./index-783fb4ec.js";import"./normalizeLink-5703bfe6.js";import"./routing-b0972916.js";import"./dataTransform-fe9a84ab.js";import"./index.styled-a06a6b82.js";import"./isProduction-52b782c4.js";import"./gAssets.js";import"./Onboarding-cc38c258.js";import"./useUniqueId-265a038e.js";import"./index-9211bd11.js";import"./index-12640201.js";import"./index-005e3957.js";import"./utils-f60d906f.js";import"styled-components";import"./useTranslations-0fee2509.js";import"./translationsContext-fca059c7.js";import"string-format";import"lodash/throttle";import"./index.styled-ad00d8a6.js";import"./theme-09666faa.js";import"./index.styled-3f5fa13b.js";import"dayjs";import"./screenSizeContext-9bf65cae.js";import"@mantine/core";import"./index-72df41e4.js";import"./cookieHelper-3b17012e.js";import"./index.styled-be91ad13.js";import"./index-3d0f42b6.js";import"./index-eff4918d.js";import"@mantine/dates";import"@mantine/hooks";import"@mantine/carousel";import"./index-b64ea845.js";import"./constants-ce021f3d.js";import"./useIsInit-7fe0636a.js";import"./index-cd4deb55.js";import"lodash/debounce";import"slugify";import"dayjs/plugin/relativeTime";