@hhgtech/hhg-components 1.27.32 → 1.27.33

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 (276) hide show
  1. package/build/babyGrowth.js +8 -8
  2. package/build/cache.js +1 -1
  3. package/build/care.js +1 -1
  4. package/build/components.js +1 -1
  5. package/build/constants.js +1 -1
  6. package/build/core-aefa1247.js +1 -0
  7. package/build/{dataTransform-d109a2ff.js → dataTransform-5cc03a36.js} +1 -1
  8. package/build/ecom.js +1 -1
  9. package/build/esm/babyGrowth.js +2 -2
  10. package/build/esm/cache.js +1 -1
  11. package/build/esm/care.js +1 -1
  12. package/build/esm/components.js +1 -1
  13. package/build/esm/constants.js +1 -1
  14. package/build/esm/{core-890005a4.js → core-a3202a95.js} +1 -1
  15. package/build/esm/{dataTransform-f50a355c.js → dataTransform-e0fa829b.js} +1 -1
  16. package/build/esm/ecom.js +1 -1
  17. package/build/esm/{fixedBottomAdBlock-2017c788.js → fixedBottomAdBlock-8a6f7202.js} +1 -1
  18. package/build/esm/footer.js +1 -1
  19. package/build/esm/gAssets.js +1 -1
  20. package/build/esm/{getDynamicHealthTool-3dc6e153.js → getDynamicHealthTool-bd9b0426.js} +1 -1
  21. package/build/esm/{getSocialList-ccbf48db.js → getSocialList-ce9fa862.js} +1 -1
  22. package/build/esm/hooks.js +1 -1
  23. package/build/esm/i18n-values/my-MM.js +1 -1
  24. package/build/esm/i18n-values/zh-TW.js +1 -1
  25. package/build/esm/i18n.js +1 -1
  26. package/build/esm/i18nV2.js +1 -1
  27. package/build/esm/{index-78992174.js → index-0ca1bc0a.js} +1 -1
  28. package/build/esm/{index-48429f98.js → index-0fe39c19.js} +1 -1
  29. package/build/esm/{index-4a460261.js → index-10233736.js} +1 -1
  30. package/build/esm/{index-962b7a5b.js → index-16c50e5d.js} +1 -1
  31. package/build/esm/{index-eac9c06c.js → index-2d21fd23.js} +1 -1
  32. package/build/esm/{index-75a7ddcb.js → index-3a1ead00.js} +1 -1
  33. package/build/esm/{index-3650a52c.js → index-6221b00b.js} +1 -1
  34. package/build/esm/{index-9be09e75.js → index-6566aa80.js} +1 -1
  35. package/build/esm/{index-b1f1a90b.js → index-6738ea8d.js} +1 -1
  36. package/build/esm/{index-e3a62689.js → index-77902827.js} +1 -1
  37. package/build/esm/{index-7a7af552.js → index-7ecc719a.js} +1 -1
  38. package/build/esm/{index-4acb82eb.js → index-889037d3.js} +1 -1
  39. package/build/esm/{index-83e6b6d9.js → index-8acc4ab9.js} +1 -1
  40. package/build/esm/{index-141e9ea9.js → index-944f9cc1.js} +1 -1
  41. package/build/esm/index-a64df21d.js +1 -0
  42. package/build/esm/{index-0e921413.js → index-a71fd684.js} +1 -1
  43. package/build/esm/{index-453997c8.js → index-ae5920de.js} +1 -1
  44. package/build/esm/{index-9f6340aa.js → index-b088d5ab.js} +1 -1
  45. package/build/esm/{index-0ed1f8c1.js → index-b56095b8.js} +1 -1
  46. package/build/esm/{index-9b50fa62.js → index-bf849d69.js} +3 -3
  47. package/build/esm/{index-af7821db.js → index-db70ba7d.js} +1 -1
  48. package/build/esm/index-e58bc62c.js +1 -0
  49. package/build/esm/{index-567513ac.js → index-e85333e4.js} +1 -1
  50. package/build/esm/{index-1b375a3f.js → index-ef24366b.js} +1 -1
  51. package/build/esm/{index-8e8ef155.js → index-f5615fc6.js} +1 -1
  52. package/build/esm/index.js +1 -1
  53. package/build/esm/{index.styled-57ab6132.js → index.styled-35d1256d.js} +4 -4
  54. package/build/esm/{index.styled-ccda6a6a.js → index.styled-4e818009.js} +1 -1
  55. package/build/esm/index.styled-aac39d78.js +50 -0
  56. package/build/esm/{index.styled-d8afff19.js → index.styled-d0d52bd5.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/onboardingV2.js +2 -2
  63. package/build/esm/pwg.js +5 -5
  64. package/build/esm/{routing-255a493e.js → routing-8332d7bd.js} +1 -1
  65. package/build/esm/{screenSizeContext-fc50587c.js → screenSizeContext-62d9d281.js} +1 -1
  66. package/build/esm/together.js +1 -1
  67. package/build/esm/{types-6d888cb0.js → types-086f29d8.js} +1 -1
  68. package/build/esm/{types-0a817a6e.js → types-be3f16e4.js} +9 -9
  69. package/build/esm/types.js +1 -1
  70. package/build/esm/useHealthToolCache-b9040417.js +1 -0
  71. package/build/esm/{useRafState-9a39e2a9.js → useRafState-019a6d30.js} +1 -1
  72. package/build/esm/{useTranslations-f4ad49b0.js → useTranslations-2845154d.js} +1 -1
  73. package/build/esm/{utils-4d51e270.js → utils-d648625a.js} +1 -1
  74. package/build/esm/vaccination.js +5 -5
  75. package/build/{fixedBottomAdBlock-9db81534.js → fixedBottomAdBlock-50110473.js} +1 -1
  76. package/build/footer.js +1 -1
  77. package/build/gAssets.js +1 -1
  78. package/build/{getDynamicHealthTool-1f031ff7.js → getDynamicHealthTool-ac2a5f3b.js} +1 -1
  79. package/build/{getSocialList-7239e698.js → getSocialList-823ad2fa.js} +1 -1
  80. package/build/hooks.js +1 -1
  81. package/build/i18n-values/my-MM.js +1 -1
  82. package/build/i18n-values/zh-TW.js +1 -1
  83. package/build/i18n.js +1 -1
  84. package/build/i18nV2.js +1 -1
  85. package/build/{index-f454e922.js → index-0091c93e.js} +1 -1
  86. package/build/{index-7ef39ef9.js → index-086b49b2.js} +1 -1
  87. package/build/{index-d8157d51.js → index-0c2d10bf.js} +1 -1
  88. package/build/{index-19d53c73.js → index-177995f5.js} +3 -3
  89. package/build/{index-6ae6b151.js → index-2e6aa47d.js} +1 -1
  90. package/build/index-522c9dd3.js +1 -0
  91. package/build/{index-dab0a2d5.js → index-56b91b81.js} +6 -6
  92. package/build/index-5899d9bb.js +1 -0
  93. package/build/{index-58a5b6fe.js → index-686f0143.js} +1 -1
  94. package/build/{index-082b282c.js → index-7168ea2b.js} +2 -2
  95. package/build/index-95f53c66.js +1 -0
  96. package/build/{index-43577eef.js → index-9926e979.js} +1 -1
  97. package/build/{index-b1dd59b2.js → index-9c03e93e.js} +1 -1
  98. package/build/{index-4ea0c539.js → index-9d7ea83e.js} +1 -1
  99. package/build/{index-1c2cc382.js → index-a70d82ee.js} +1 -1
  100. package/build/{index-ec9c272e.js → index-ab28fa0d.js} +1 -1
  101. package/build/{index-cb770a41.js → index-bf0ac751.js} +1 -1
  102. package/build/{index-b1ce1f80.js → index-c93106c4.js} +14 -14
  103. package/build/{index-be5867b0.js → index-cf5662c4.js} +1 -1
  104. package/build/{index-72b80f3f.js → index-d345942f.js} +1 -1
  105. package/build/{index-0631a45b.js → index-e2f53c6a.js} +3 -3
  106. package/build/{index-0aee2419.js → index-e432133e.js} +1 -1
  107. package/build/{index-b84dc9fb.js → index-e4f20a90.js} +1 -1
  108. package/build/{index-0ab51265.js → index-f2c60e4e.js} +1 -1
  109. package/build/{index-6a375dc5.js → index-f7ab5768.js} +1 -1
  110. package/build/index.js +1 -1
  111. package/build/{index.styled-4abccf7c.js → index.styled-196eeb1b.js} +1 -1
  112. package/build/{index.styled-5fb6133c.js → index.styled-64d7893e.js} +1 -1
  113. package/build/{index.styled-699b2313.js → index.styled-8df44fea.js} +3 -3
  114. package/build/{index.styled-c8d0d688.js → index.styled-f9a4a8d0.js} +2 -2
  115. package/build/lead.js +1 -1
  116. package/build/mantine.js +1 -1
  117. package/build/misc.js +1 -1
  118. package/build/navigation.js +1 -1
  119. package/build/onboarding.js +1 -1
  120. package/build/onboardingV2.js +3 -3
  121. package/build/pwg.js +1 -1
  122. package/build/{routing-262cf2a5.js → routing-0d8aea8a.js} +1 -1
  123. package/build/{screenSizeContext-1dfc61c5.js → screenSizeContext-f7ffd59c.js} +2 -2
  124. package/build/together.js +1 -1
  125. package/build/{types-3e5f761a.js → types-197644c8.js} +1 -1
  126. package/build/{types-9b516835.js → types-daf9b5a9.js} +1 -1
  127. package/build/types.js +1 -1
  128. package/build/{useHealthToolCache-e095a8da.js → useHealthToolCache-3006bf8e.js} +1 -1
  129. package/build/{useRafState-73761af4.js → useRafState-685b91d5.js} +1 -1
  130. package/build/{useTranslations-83e2d53a.js → useTranslations-6f9becc4.js} +1 -1
  131. package/build/utils-a263bba8.js +1 -0
  132. package/build/vaccination.js +1 -1
  133. package/package.json +1 -1
  134. package/build/core-d3f73935.js +0 -1
  135. package/build/esm/index-11cc7821.js +0 -1
  136. package/build/esm/index-fc17f00e.js +0 -1
  137. package/build/esm/index.styled-5bf0b683.js +0 -50
  138. package/build/esm/useHealthToolCache-645df721.js +0 -1
  139. package/build/index-2115e2fc.js +0 -1
  140. package/build/index-2dd8fc69.js +0 -1
  141. package/build/index-723ae17c.js +0 -1
  142. package/build/utils-0b8086e1.js +0 -1
  143. /package/build/{BMI_BOYS.percentile.monthly-3e356ac0.js → BMI_BOYS.percentile.monthly-c61d8b5a.js} +0 -0
  144. /package/build/{BMI_BOYS.percentile.weekly-329a25f7.js → BMI_BOYS.percentile.weekly-9600038b.js} +0 -0
  145. /package/build/{BMI_BOYS.percentile.yearly-343adff2.js → BMI_BOYS.percentile.yearly-c95c26e2.js} +0 -0
  146. /package/build/{BMI_BOYS.zscore.monthly-4b1f687d.js → BMI_BOYS.zscore.monthly-9032d340.js} +0 -0
  147. /package/build/{BMI_BOYS.zscore.weekly-eb6922d0.js → BMI_BOYS.zscore.weekly-fdc1790e.js} +0 -0
  148. /package/build/{BMI_BOYS.zscore.yearly-d1e0760e.js → BMI_BOYS.zscore.yearly-c74fbea9.js} +0 -0
  149. /package/build/{BMI_GIRLS.percentile.monthly-c3c40331.js → BMI_GIRLS.percentile.monthly-8aa13777.js} +0 -0
  150. /package/build/{BMI_GIRLS.percentile.weekly-bccd2a6b.js → BMI_GIRLS.percentile.weekly-76a6eb4a.js} +0 -0
  151. /package/build/{BMI_GIRLS.percentile.yearly-4e85c87d.js → BMI_GIRLS.percentile.yearly-cb998729.js} +0 -0
  152. /package/build/{BMI_GIRLS.zscore.monthly-8f929983.js → BMI_GIRLS.zscore.monthly-e751c372.js} +0 -0
  153. /package/build/{BMI_GIRLS.zscore.weekly-10fb7f20.js → BMI_GIRLS.zscore.weekly-a78646de.js} +0 -0
  154. /package/build/{BMI_GIRLS.zscore.yearly-9562eef2.js → BMI_GIRLS.zscore.yearly-5f841993.js} +0 -0
  155. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-58ef6dc5.js → HEAD CIRCUM_BOYS.percentile.monthly-fc9cd034.js} +0 -0
  156. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-4aa6a407.js → HEAD CIRCUM_BOYS.percentile.weekly-554bd1f4.js} +0 -0
  157. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-1193c5b1.js → HEAD CIRCUM_BOYS.percentile.yearly-2fa31e96.js} +0 -0
  158. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-fdc1360d.js → HEAD CIRCUM_BOYS.zscore.monthly-f8f40bf9.js} +0 -0
  159. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-7880f670.js → HEAD CIRCUM_BOYS.zscore.weekly-bd274348.js} +0 -0
  160. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-708dfcbc.js → HEAD CIRCUM_BOYS.zscore.yearly-bc4c1456.js} +0 -0
  161. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-b22574bb.js → HEAD CIRCUM_GIRLS.percentile.monthly-17a18246.js} +0 -0
  162. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-cc913ec0.js → HEAD CIRCUM_GIRLS.percentile.weekly-3e8f9059.js} +0 -0
  163. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-81332155.js → HEAD CIRCUM_GIRLS.percentile.yearly-0ddd3cac.js} +0 -0
  164. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-e4e43570.js → HEAD CIRCUM_GIRLS.zscore.monthly-f17efe98.js} +0 -0
  165. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-98d35e4a.js → HEAD CIRCUM_GIRLS.zscore.weekly-ef6b4a65.js} +0 -0
  166. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-7f7b8aa1.js → HEAD CIRCUM_GIRLS.zscore.yearly-c061e773.js} +0 -0
  167. /package/build/{HEIGHT_BOYS.percentile.monthly-a3e40c68.js → HEIGHT_BOYS.percentile.monthly-7d306952.js} +0 -0
  168. /package/build/{HEIGHT_BOYS.percentile.weekly-299ff5f4.js → HEIGHT_BOYS.percentile.weekly-5f930021.js} +0 -0
  169. /package/build/{HEIGHT_BOYS.percentile.yearly-7fbf1f24.js → HEIGHT_BOYS.percentile.yearly-c28236f9.js} +0 -0
  170. /package/build/{HEIGHT_BOYS.zscore.monthly-6bd80093.js → HEIGHT_BOYS.zscore.monthly-24e21b17.js} +0 -0
  171. /package/build/{HEIGHT_BOYS.zscore.weekly-0f818fc7.js → HEIGHT_BOYS.zscore.weekly-ade2b8e1.js} +0 -0
  172. /package/build/{HEIGHT_BOYS.zscore.yearly-6b4c1c91.js → HEIGHT_BOYS.zscore.yearly-0fb0b3e6.js} +0 -0
  173. /package/build/{HEIGHT_GIRLS.percentile.monthly-113d550e.js → HEIGHT_GIRLS.percentile.monthly-a3a7f446.js} +0 -0
  174. /package/build/{HEIGHT_GIRLS.percentile.weekly-bc27d1d5.js → HEIGHT_GIRLS.percentile.weekly-9b7274cf.js} +0 -0
  175. /package/build/{HEIGHT_GIRLS.percentile.yearly-68fd5cb7.js → HEIGHT_GIRLS.percentile.yearly-c9129b20.js} +0 -0
  176. /package/build/{HEIGHT_GIRLS.zscore.monthly-181555d4.js → HEIGHT_GIRLS.zscore.monthly-3e3d2cc5.js} +0 -0
  177. /package/build/{HEIGHT_GIRLS.zscore.weekly-81270715.js → HEIGHT_GIRLS.zscore.weekly-f7cfba6c.js} +0 -0
  178. /package/build/{HEIGHT_GIRLS.zscore.yearly-8d214b12.js → HEIGHT_GIRLS.zscore.yearly-c52c820b.js} +0 -0
  179. /package/build/{Onboarding-99eb249d.js → Onboarding-79e5b9a7.js} +0 -0
  180. /package/build/{Visible-75210491.js → Visible-58ecc99e.js} +0 -0
  181. /package/build/{WEIGHT_BOYS.percentile.monthly-bf01ddad.js → WEIGHT_BOYS.percentile.monthly-9a002079.js} +0 -0
  182. /package/build/{WEIGHT_BOYS.percentile.weekly-4cbb8648.js → WEIGHT_BOYS.percentile.weekly-90e5e128.js} +0 -0
  183. /package/build/{WEIGHT_BOYS.percentile.yearly-6d2c2dc0.js → WEIGHT_BOYS.percentile.yearly-7ea31e83.js} +0 -0
  184. /package/build/{WEIGHT_BOYS.zscore.monthly-53c57889.js → WEIGHT_BOYS.zscore.monthly-646efdaf.js} +0 -0
  185. /package/build/{WEIGHT_BOYS.zscore.weekly-6a6ef2dd.js → WEIGHT_BOYS.zscore.weekly-a5ee61d2.js} +0 -0
  186. /package/build/{WEIGHT_BOYS.zscore.yearly-24e1bf91.js → WEIGHT_BOYS.zscore.yearly-867804a2.js} +0 -0
  187. /package/build/{WEIGHT_GIRLS.percentile.monthly-6a372bdb.js → WEIGHT_GIRLS.percentile.monthly-6da9be80.js} +0 -0
  188. /package/build/{WEIGHT_GIRLS.percentile.weekly-27d32185.js → WEIGHT_GIRLS.percentile.weekly-d7c29d8d.js} +0 -0
  189. /package/build/{WEIGHT_GIRLS.percentile.yearly-73eba09e.js → WEIGHT_GIRLS.percentile.yearly-5af53e4b.js} +0 -0
  190. /package/build/{WEIGHT_GIRLS.zscore.monthly-8bd46114.js → WEIGHT_GIRLS.zscore.monthly-1df2a8cf.js} +0 -0
  191. /package/build/{WEIGHT_GIRLS.zscore.weekly-a6e3a7f6.js → WEIGHT_GIRLS.zscore.weekly-2ad490f3.js} +0 -0
  192. /package/build/{WEIGHT_GIRLS.zscore.yearly-aa5ec6d9.js → WEIGHT_GIRLS.zscore.yearly-72293565.js} +0 -0
  193. /package/build/{constants-78ff8804.js → constants-22b494a9.js} +0 -0
  194. /package/build/{cookieHelper-b5e879be.js → cookieHelper-574167c9.js} +0 -0
  195. /package/build/{dataTransform-c988f4f0.js → dataTransform-1320ee4b.js} +0 -0
  196. /package/build/esm/{BMI_BOYS.percentile.monthly-d9a5c3d9.js → BMI_BOYS.percentile.monthly-c42b4c87.js} +0 -0
  197. /package/build/esm/{BMI_BOYS.percentile.weekly-fc7074cd.js → BMI_BOYS.percentile.weekly-115a027c.js} +0 -0
  198. /package/build/esm/{BMI_BOYS.percentile.yearly-a9661d17.js → BMI_BOYS.percentile.yearly-b0d643eb.js} +0 -0
  199. /package/build/esm/{BMI_BOYS.zscore.monthly-ac1ddd96.js → BMI_BOYS.zscore.monthly-ca24fd06.js} +0 -0
  200. /package/build/esm/{BMI_BOYS.zscore.weekly-894fdb0d.js → BMI_BOYS.zscore.weekly-bf2815ac.js} +0 -0
  201. /package/build/esm/{BMI_BOYS.zscore.yearly-3f43e96d.js → BMI_BOYS.zscore.yearly-0ddd0132.js} +0 -0
  202. /package/build/esm/{BMI_GIRLS.percentile.monthly-7ac54cfd.js → BMI_GIRLS.percentile.monthly-8c099838.js} +0 -0
  203. /package/build/esm/{BMI_GIRLS.percentile.weekly-c18b79c6.js → BMI_GIRLS.percentile.weekly-daed416f.js} +0 -0
  204. /package/build/esm/{BMI_GIRLS.percentile.yearly-58d7692c.js → BMI_GIRLS.percentile.yearly-8f95e5ed.js} +0 -0
  205. /package/build/esm/{BMI_GIRLS.zscore.monthly-172b57c2.js → BMI_GIRLS.zscore.monthly-0da7d5e3.js} +0 -0
  206. /package/build/esm/{BMI_GIRLS.zscore.weekly-9fcbb02a.js → BMI_GIRLS.zscore.weekly-5d24370a.js} +0 -0
  207. /package/build/esm/{BMI_GIRLS.zscore.yearly-4bbc7740.js → BMI_GIRLS.zscore.yearly-20880cdc.js} +0 -0
  208. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-2dd75d85.js → HEAD CIRCUM_BOYS.percentile.monthly-c1d1018b.js} +0 -0
  209. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-f2555b83.js → HEAD CIRCUM_BOYS.percentile.weekly-e992e46f.js} +0 -0
  210. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-b5d77ca8.js → HEAD CIRCUM_BOYS.percentile.yearly-305da24d.js} +0 -0
  211. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-349c0f24.js → HEAD CIRCUM_BOYS.zscore.monthly-9cb1267a.js} +0 -0
  212. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-c5eda548.js → HEAD CIRCUM_BOYS.zscore.weekly-f81b69e3.js} +0 -0
  213. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-4872051e.js → HEAD CIRCUM_BOYS.zscore.yearly-f0a07a2f.js} +0 -0
  214. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-175cd420.js → HEAD CIRCUM_GIRLS.percentile.monthly-8f62fd54.js} +0 -0
  215. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-ef0a460c.js → HEAD CIRCUM_GIRLS.percentile.weekly-6c2703b0.js} +0 -0
  216. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-97d09182.js → HEAD CIRCUM_GIRLS.percentile.yearly-4be3d115.js} +0 -0
  217. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-22037110.js → HEAD CIRCUM_GIRLS.zscore.monthly-a06bfdf5.js} +0 -0
  218. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-fd13aad6.js → HEAD CIRCUM_GIRLS.zscore.weekly-6223ca11.js} +0 -0
  219. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-57e9ddd4.js → HEAD CIRCUM_GIRLS.zscore.yearly-62d6d5aa.js} +0 -0
  220. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-9ecb94e5.js → HEIGHT_BOYS.percentile.monthly-e1990dfe.js} +0 -0
  221. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-ecfe0c7f.js → HEIGHT_BOYS.percentile.weekly-effb60a0.js} +0 -0
  222. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-db8d7445.js → HEIGHT_BOYS.percentile.yearly-06862e87.js} +0 -0
  223. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-365f7c69.js → HEIGHT_BOYS.zscore.monthly-a58741c6.js} +0 -0
  224. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-c7ba97e7.js → HEIGHT_BOYS.zscore.weekly-9147b51d.js} +0 -0
  225. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-bea95bc7.js → HEIGHT_BOYS.zscore.yearly-c69d4185.js} +0 -0
  226. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-304e5313.js → HEIGHT_GIRLS.percentile.monthly-d24ec496.js} +0 -0
  227. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-7f527450.js → HEIGHT_GIRLS.percentile.weekly-b2eb8dfc.js} +0 -0
  228. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-feabc12a.js → HEIGHT_GIRLS.percentile.yearly-f3cc5ba1.js} +0 -0
  229. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-048e9b3e.js → HEIGHT_GIRLS.zscore.monthly-83b7ff07.js} +0 -0
  230. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-3d306c57.js → HEIGHT_GIRLS.zscore.weekly-dfc18067.js} +0 -0
  231. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-2d19d773.js → HEIGHT_GIRLS.zscore.yearly-d453c1d9.js} +0 -0
  232. /package/build/esm/{Onboarding-01e65da4.js → Onboarding-5b53ad56.js} +0 -0
  233. /package/build/esm/{Visible-52b8a15d.js → Visible-19957415.js} +0 -0
  234. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-12b46347.js → WEIGHT_BOYS.percentile.monthly-f1a00ce0.js} +0 -0
  235. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-672a26da.js → WEIGHT_BOYS.percentile.weekly-b87524ec.js} +0 -0
  236. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-4811d3d0.js → WEIGHT_BOYS.percentile.yearly-62c54469.js} +0 -0
  237. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-c0aae4ee.js → WEIGHT_BOYS.zscore.monthly-10ddebca.js} +0 -0
  238. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-a319bbe4.js → WEIGHT_BOYS.zscore.weekly-9f8f7e00.js} +0 -0
  239. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-5b60b7ce.js → WEIGHT_BOYS.zscore.yearly-3ec2de4f.js} +0 -0
  240. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-d1907017.js → WEIGHT_GIRLS.percentile.monthly-69d6a56d.js} +0 -0
  241. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-a9bd18c6.js → WEIGHT_GIRLS.percentile.weekly-2994819c.js} +0 -0
  242. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-bfca4dc0.js → WEIGHT_GIRLS.percentile.yearly-bb66183a.js} +0 -0
  243. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-ab534504.js → WEIGHT_GIRLS.zscore.monthly-9b2a0898.js} +0 -0
  244. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-4f1cd9b4.js → WEIGHT_GIRLS.zscore.weekly-94096334.js} +0 -0
  245. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-f1849916.js → WEIGHT_GIRLS.zscore.yearly-12fcfc57.js} +0 -0
  246. /package/build/esm/{constants-ee7f773a.js → constants-c4564b0a.js} +0 -0
  247. /package/build/esm/{cookieHelper-584dbd8d.js → cookieHelper-f51a61f7.js} +0 -0
  248. /package/build/esm/{dataTransform-4ab244d7.js → dataTransform-3a94389c.js} +0 -0
  249. /package/build/esm/{index-1a06fbf0.js → index-4f5d9780.js} +0 -0
  250. /package/build/esm/{index-ef49cc03.js → index-acd2e81b.js} +0 -0
  251. /package/build/esm/{isProduction-ed27c0ed.js → isProduction-dd524cb4.js} +0 -0
  252. /package/build/esm/{localizeNumberFormat-85910ce5.js → localizeNumberFormat-2978012f.js} +0 -0
  253. /package/build/esm/{normalizeLink-28bbc4e6.js → normalizeLink-52be59ff.js} +0 -0
  254. /package/build/esm/{theme-4693e886.js → theme-6fcfd4c3.js} +0 -0
  255. /package/build/esm/{translationsContext-d8467494.js → translationsContext-5c973874.js} +0 -0
  256. /package/build/esm/{tslib.es6-566e140f.js → tslib.es6-dc24c862.js} +0 -0
  257. /package/build/esm/{types-88f7f8c1.js → types-5d9969c0.js} +0 -0
  258. /package/build/esm/{useIsInit-8e853e42.js → useIsInit-39acbfb4.js} +0 -0
  259. /package/build/esm/{useOutsideClick-57718e03.js → useOutsideClick-143b165c.js} +0 -0
  260. /package/build/esm/{useScrollbarSize-ab74da39.js → useScrollbarSize-b3c99865.js} +0 -0
  261. /package/build/esm/{useUniqueId-527dc21c.js → useUniqueId-6c3e7337.js} +0 -0
  262. /package/build/esm/{utils-807f25d6.js → utils-0112af9f.js} +0 -0
  263. /package/build/{index-f8592be9.js → index-8d31709c.js} +0 -0
  264. /package/build/{index-80f0f8c0.js → index-95f75677.js} +0 -0
  265. /package/build/{isProduction-b5284dac.js → isProduction-b193c2da.js} +0 -0
  266. /package/build/{localizeNumberFormat-addc1caf.js → localizeNumberFormat-dce626fe.js} +0 -0
  267. /package/build/{normalizeLink-3cd4439a.js → normalizeLink-45368b31.js} +0 -0
  268. /package/build/{theme-108d6e8a.js → theme-45c02360.js} +0 -0
  269. /package/build/{translationsContext-dc2f927d.js → translationsContext-5b994fc2.js} +0 -0
  270. /package/build/{tslib.es6-d3a5ce67.js → tslib.es6-614e1c6c.js} +0 -0
  271. /package/build/{types-49bc9a38.js → types-55af29f0.js} +0 -0
  272. /package/build/{useIsInit-b5fc47f5.js → useIsInit-07a53981.js} +0 -0
  273. /package/build/{useOutsideClick-8c93090c.js → useOutsideClick-f5265a97.js} +0 -0
  274. /package/build/{useScrollbarSize-dce45010.js → useScrollbarSize-70392f62.js} +0 -0
  275. /package/build/{useUniqueId-31dafff9.js → useUniqueId-45a55aba.js} +0 -0
  276. /package/build/{utils-f96a7b93.js → utils-8d3fbb64.js} +0 -0
@@ -1 +1 @@
1
- import{a as e,_ as o}from"./tslib.es6-566e140f.js";import t,{useContext as n,useState as r,useRef as a,useEffect as i,useMemo as s,useCallback as l}from"react";import{Input as d,Grid as m,Title as c}from"@mantine/core";import{useInterval as p,useCounter as u}from"@mantine/hooks";import{B as g}from"./index-4acb82eb.js";import{e as b,o as h,h as E,R as f,O as v,p as y,u as w,B as S}from"./index-8e8ef155.js";import{u as P,a as j,F as k,O as C,b as x}from"./index-9b50fa62.js";import{u as B}from"./useTranslations-f4ad49b0.js";import"lodash/debounce";import"./isProduction-ed27c0ed.js";import{L as z}from"./index-0e921413.js";import{O as T}from"./Onboarding-01e65da4.js";export{O as OnboardingStep}from"./Onboarding-01e65da4.js";import"dayjs";import"./screenSizeContext-fc50587c.js";import"styled-components";import{t as N}from"./theme-4693e886.js";import{M as F}from"./utils-807f25d6.js";import"./gAssets.js";import{S as I,a as L,b as q,c as A,d as V,e as D,f as _,g as R,h as U,i as W}from"./index.styled-57ab6132.js";import{yupResolver as Y}from"@mantine/form";import"./index-78992174.js";import"./index-eac9c06c.js";import"./index-3650a52c.js";import"./index.styled-d8afff19.js";import"./index-1a06fbf0.js";import{D as H}from"./index-7a7af552.js";import"./index-567513ac.js";import{A as $}from"./index-4a460261.js";import{V as G}from"./Visible-52b8a15d.js";import{M as Z,h as K}from"./utils-4d51e270.js";export{M as MAPPED_LOCALE}from"./utils-4d51e270.js";import*as J from"yup";import"@mantine/dates";import Q from"lodash/throttle";import{T as X}from"./index-141e9ea9.js";import{format as ee}from"date-fns";import"@mantine/carousel";import"./translationsContext-d8467494.js";import"string-format";import"date-fns/locale";import"./useUniqueId-527dc21c.js";import"react-keyed-flatten-children";import"./index-af7821db.js";const oe=({inputOrder:e=["phone"],withSimilac:o=!1,customTerms:n=""})=>{const{t:r}=B(),a=P(),i=t.createElement(d.Wrapper,Object.assign({className:o?"input-control":"phone-input",withAsterisk:!0},o?{label:t.createElement(b,{size:"s4",weight:"semiBold",as:"span"},r("onboarding.similac.input.phone"))}:{}),t.createElement(h,Object.assign({defaultCountry:Z[process.env.UNIFY_LOCALE]||"VN"},a.getInputProps("phone"))),t.createElement(d.Error,{size:"md"},a.errors.phone)),s=t.createElement(E,Object.assign({label:t.createElement(b,{size:"s4",weight:"semiBold",as:"span"},r("onboarding.formEmail.yourName")),withAsterisk:!0},a.getInputProps("name"))),l=t.createElement(E,Object.assign({label:t.createElement(b,{size:"s4",weight:"semiBold",as:"span"},r("onboarding.formEmail.yourEmail")),withAsterisk:!0},a.getInputProps("email"))),m=t.createElement(H,Object.assign({label:t.createElement(b,{size:"s4",weight:"semiBold",as:"span"},r("onboarding.formEmail.yourBirthday")),placeholder:"DD/MM/YYYY"},a.getInputProps("dob"))),c=t.createElement(f.Group,Object.assign({className:"radio-group",label:t.createElement(b,{size:"s4",weight:"semiBold",as:"span"},r("bmi.selectGender"))},a.getInputProps("gender")),t.createElement(f,{value:"0",label:r("onboarding.formEmail.genderMale")}),t.createElement(f,{value:"1",label:r("onboarding.formEmail.genderFemale")})),p=t.createElement("div",{className:"otp-input"},t.createElement(v,Object.assign({enterKeyHint:void 0,nonce:void 0},a.getInputProps("otp"))),t.createElement(d.Error,null,a.errors.otp)),u=t.createElement(E.Password,Object.assign({label:t.createElement(b,{size:"s4",weight:"semiBold",as:"span"},r("onboarding.updatePassword.password")),withAsterisk:!0,rightSection:t.createElement(G,null)},a.getInputProps("password"))),g=t.createElement(E.Wrapper,Object.assign({},a.getInputProps("term",{type:"checkbox"}),{error:null,mb:16}),t.createElement(y,{label:n?t.createElement(b,{size:"p4",as:"span",sx:{a:{color:"#2d87f3",fontWeight:"bold",letterSpacing:0}}},n):t.createElement(b,{size:"p4",as:"span"},"Tôi đã đọc và đồng ý với các điều khoản và chương trình của"," ",t.createElement("a",null,t.createElement(b,{size:"label1",as:"span",weight:"bold",color:"blue.6"},"Hello Bacsi"))," ","và"," ",t.createElement("a",null,t.createElement(b,{size:"label1",as:"span",weight:"bold",color:"blue.6"},"Abbott Similac"))," ","và được hướng dẫn cách ngưng chương trình"),onChange:e=>{a.setFieldValue("term",e.currentTarget.checked)}}),t.createElement(d.Error,{size:"md"},a.getInputProps("term",{type:"checkbox"}).error)),w=t.createElement($,Object.assign({className:"input-control",label:t.createElement(b,{size:"s4",weight:"semiBold",as:"span"},r("onboarding.similac.input.address"))},a.getInputProps("address"))),S=t.createElement(E.Password,Object.assign({label:t.createElement(b,{size:"s4",weight:"semiBold",as:"span"},r("onboarding.updatePassword.confirmPassword")),withAsterisk:!0,rightSection:t.createElement(G,null)},a.getInputProps("confirmPassword"))),j=e.map((e=>({phone:i,full_name:s,email:l,dob:m,gender:c,otp:p,password:u,confirm_password:S,term:g,address:w}[e]||null)));return t.createElement(I,null,j)},te=e=>J.object().shape({phone:J.string().required(e("onboarding.updatePhone.error")).default("")}),ne=e=>J.object().shape({phone:J.string().required(e("onboarding.updatePhone.error")).default(""),name:J.string().required(e("onboarding.errorMessage.requiredName")),email:J.string().required(e("onboarding.errorMessage.requiredEmail")).email(e("onboarding.errorMessage.invalidEmail")).default(""),address:J.mixed().required(e("onboarding.similac.address.error")),term:J.bool().oneOf([!0],e("onboarding.similac.term.error"))}),re=e=>J.object().shape({otp:J.string().required(e("onboarding.otpForm.error")).length(6,e("onboarding.otpForm.error")).default("")}),ae=e=>J.object().shape({email:J.string().required(e("onboarding.errorMessage.requiredEmail")).email(e("onboarding.errorMessage.invalidEmail")).default(""),name:J.string().required(e("onboarding.errorMessage.requiredName"))}),ie=e=>J.object().shape({password:J.string().required(e("onboarding.errorMessage.requiredPassword")).min(8,e("onboarding.errorMessage.minLength",{length:8})).matches(/.*[A-Z].*/,e("onboarding.errorMessage.passWithPattern")).default(""),confirmPassword:J.string().required(e("onboarding.errorMessage.requiredConfirmPassword")).oneOf([J.ref("password"),null],e("onboarding.errorMessage.passNotMatch")).default("")}),se=({onClose:o,onSubmit:n,canSkip:r=!0,customFormTexts:a})=>{const{t:i}=B(),s=j({initialValues:{phone:""},validate:Y(te(i))});return t.createElement(L,{heading:(null==a?void 0:a.heading)||i("onboarding.updatePhone.heading"),description:(null==a?void 0:a.description)||i("onboarding.updatePhone.description")},t.createElement(k,{form:s},t.createElement("form",{onSubmit:s.onSubmit((o=>e(void 0,void 0,void 0,(function*(){n(o.phone)}))),(e=>{console.log(e)}))},t.createElement(oe,{inputOrder:["phone"]}),t.createElement(g,{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"},i("onboarding.button.continue")),r&&t.createElement(g,{color:"ghost",isBlock:!0,size:"lg",onClick:o,type:"button"},i("onboarding.button.skip")))))},le=n=>{var{onClose:r,onSubmit:a,canSkip:i=!0,customFormTexts:s,customTerms:l,defaultValues:d}=n,m=o(n,["onClose","onSubmit","canSkip","customFormTexts","customTerms","defaultValues"]);const{t:c}=B(),{isMobile:p}=w(),u=j({initialValues:Object.assign({phone:"",term:!1},d),validate:Y(ne(c))});return t.createElement(L,Object.assign({heading:(null==s?void 0:s.heading)||c("onboarding.updatePhone.heading"),description:(null==s?void 0:s.description)||c("onboarding.updatePhone.description"),hiddenLogo:p},m),t.createElement(k,{form:u},t.createElement("form",{onSubmit:u.onSubmit((o=>e(void 0,void 0,void 0,(function*(){a(o)}))),(e=>{console.log(e)}))},t.createElement(oe,{inputOrder:["full_name","email","phone","address","term"],withSimilac:!0,customTerms:l}),t.createElement(S,{fullWidth:!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"},c("onboarding.button.continue")),i&&t.createElement(S,{variant:"ghost",fullWidth:!0,size:"lg",onClick:r,type:"button"},c("onboarding.button.skip")))))},de=e=>{var{withSimilac:n=!1}=e,r=o(e,["withSimilac"]);return n?t.createElement(le,Object.assign({},r)):t.createElement(se,Object.assign({},r))},me=({onSubmit:o,phone:l,email:d,onResendCode:m,otpError:c,onClose:b,loading:h,onBack:E,canSkip:f,outOfEdit:v})=>{const{siteType:y,isMarryBaby:w}=n(C),[S,P]=r(30),O=p((()=>P((e=>e-1))),1e3),[x,M]=u(0,{min:0,max:3}),z=a(!0),{t:T}=B();i((()=>(O.start(),O.stop)),[]),i((()=>{0===S&&(O.stop(),z.current=!1)}),[S]);const F=j({initialValues:{otp:""},validate:Y(re(T))});i((()=>{c&&F.setFieldError("otp",c)}),[c]);const I=s((()=>Q((()=>{z.current||(M.increment(),P(30),null==m||m(l||d),O.start(),z.current=!0)}),1e3,{trailing:!1})),[l,d,m,O]);return t.createElement(q,{heading:T("onboarding.otpForm.heading"),description:t.createElement(t.Fragment,null,t.createElement("span",{dangerouslySetInnerHTML:{__html:l?T("onboarding.otpForm.description",{phone:`<b style="color:${N.colors.gray800}">${l.slice(0,-3).replace(/./g,"x").concat(l.slice(-3))}</b>`}):T("onboarding.otpForm.descriptionEmail",{email:`<b style="color:${N.colors.gray800}">${K(d)}</b>`})}}),!v&&t.createElement("svg",{onClick:()=>{null==E||E()},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"otp-description-edit-icon"},t.createElement("path",{d:"M12.7812 1.33337C12.2987 1.33337 11.8162 1.51712 11.4479 1.88546L10.6667 2.66671L13.3333 5.33337L14.1146 4.55212C14.8506 3.81612 14.8506 2.62212 14.1146 1.88546C13.7463 1.51712 13.2638 1.33337 12.7812 1.33337ZM9.66667 3.66671L2 11.3334V14H4.66667L12.3333 6.33337L9.66667 3.66671Z",fill:"#ADB3BC"})))},t.createElement(k,{form:F},t.createElement("form",{onSubmit:F.onSubmit((t=>e(void 0,void 0,void 0,(function*(){M.increment(),o(t.otp)}))),(e=>{console.log(e)}))},t.createElement(oe,{inputOrder:["otp"]}),t.createElement("div",{className:"resend"},t.createElement(X,{size:"p4",color:N.colors.gray400},T("onboarding.otpForm.notReceiveOTP")),t.createElement(X,{as:"a",size:"p4",color:w?N.mbColors.pink:N.colors.primaryBase,onClick:I},T("onboarding.otpForm.resendCode",{seconds:S}))),t.createElement(g,{theme:y,color:"primary",isBlock:!0,size:"lg",type:"submit",isLoading:h,disabled:h,"data-event-category":"Sign Up","data-event-action":"Confirm Phone Number","data-event-label":"undefined"!=typeof window?window.location.href:"",className:"pointer-event-child-none"},T("onboarding.button.continue")),f&&x>=3&&t.createElement(g,{theme:y,color:"ghost",isBlock:!0,size:"lg",onClick:b,"data-event-category":"Sign Up","data-event-action":"Confirm Phone Number","data-event-label":"undefined"!=typeof window?window.location.href:"",className:"pointer-event-child-none",type:"button"},T("onboarding.button.skip")))))},ce=({onClose:e,onSubmit:o,canSkip:r,loading:a,errorMessage:s,initialData:l})=>{const{t:d,locale:m}=B(),{siteType:c,isMarryBaby:p}=n(C),u=j({validate:Y(ae(d))});return i((()=>{u.setValues(Object.assign(Object.assign({gender:"0"},l),(null==l?void 0:l.birthday)&&{birthday:new Date(l.birthday)}))}),[l]),i((()=>{s&&u.setFieldError("email",s)}),[s]),t.createElement(x,{heading:d("onboarding.formEmail.heading"),description:d("onboarding.formEmail.description",{site:p?"Marry Baby":z[m].SITE_NAME_FORMATTED})},t.createElement(k,{form:u},t.createElement("form",{className:"form",onSubmit:u.onSubmit((e=>{o(Object.assign(Object.assign({},e),{birthday:e.birthday&&ee(e.birthday,"yyyy-MM-dd")}))}),(e=>{console.log({fieldErrors:e})}))},t.createElement(oe,{inputOrder:["full_name","email","dob","gender"]}),t.createElement(g,{color:"primary",isBlock:!0,size:"lg",type:"submit",theme:c,isLoading:a,disabled:a},d("onboarding.button.continue")),r&&t.createElement(g,{theme:c,color:"ghost",isBlock:!0,size:"lg",onClick:e},d("onboarding.button.skip")))))},pe=({onClose:e,onSubmit:o,canSkip:n,errorMessage:r,loading:a})=>{const{t:i}=B(),s=j({initialValues:{password:"",confirmPassword:""},validate:Y(ie(i))});return t.createElement(x,{heading:i("onboarding.updatePassword.heading"),description:i("onboarding.updatePassword.description")},t.createElement(k,{form:s},t.createElement("form",{className:"form",onSubmit:s.onSubmit((e=>o((null==e?void 0:e.password)||"")),(e=>{console.log({fieldErrors:e})}))},t.createElement(oe,{inputOrder:["password","confirm_password"]}),t.createElement(g,{color:"primary",isBlock:!0,size:"lg",type:"submit",isLoading:a,disabled:a},i("onboarding.button.continue")),n&&t.createElement(g,{color:"ghost",isBlock:!0,size:"lg",onClick:e},i("onboarding.button.skip")),r&&t.createElement(d.Error,{className:"form-error"},r))))},ue=n=>{var{banner:a,canSkip:i,createPassError:s,createPassLoading:d,customFormTexts:p,emailLoading:h,flow:E=[T.Phone,T.OTP],initialData:f,onClose:v,onCreatePassByEmail:y,onOtpSubmit:S,onPersonalInfoSubmit:P,onPhoneSubmit:j,onResendCode:k,otpError:O,otpLoading:M,personalInfoError:z,resultScreenProps:I,siteType:L,step:q,withSimilac:Y=!1,similacFormProps:H}=n,$=o(n,["banner","canSkip","createPassError","createPassLoading","customFormTexts","emailLoading","flow","initialData","onClose","onCreatePassByEmail","onOtpSubmit","onPersonalInfoSubmit","onPhoneSubmit","onResendCode","otpError","otpLoading","personalInfoError","resultScreenProps","siteType","step","withSimilac","similacFormProps"]);const{t:G}=B(),[Z,K]=r(q||E[0]),[J,Q]=r(""),[X,ee]=r(""),[oe,te]=u(0,{min:0,max:2}),{isMobile:ne}=w(),re=l((()=>{const e=E.indexOf(Z)+1;e<=E.length-1&&K(E[e])}),[Z]),ae=l((()=>{const e=E.indexOf(Z)-1;e>=0&&K(E[e])}),[Z]),ie=o=>e(void 0,void 0,void 0,(function*(){try{!(yield S(o))&&re()}catch(e){console.error(e)}})),se=()=>{oe>=2||(te.increment(),ae())},ue="marryBaby"===L;return t.createElement(C.Provider,{value:{siteType:L,isMarryBaby:ue}},t.createElement(A,Object.assign({},$),E.length>0?t.createElement(V,null,t.createElement(m,{sx:{[F.mbDown]:{margin:0},".mantine-Grid-col":{[F.mbDown]:{padding:0}}}},t.createElement(m.Col,{span:"object"!=typeof a&&!Y||ne?12:6,order:Y?2:1,orderMd:Y?1:2,sx:{zIndex:Y?99:void 0}},t.createElement(D,{"data-similac":Y,"data-has-banner":"object"==typeof a},Z===T.Phone&&(Y?t.createElement(le,{onClose:v,canSkip:i,onSubmit:o=>e(void 0,void 0,void 0,(function*(){var e;try{const t=null==o?void 0:o.phone;t&&(Q(t),yield Promise.all([null===(e=null==H?void 0:H.onFormSubmit)||void 0===e?void 0:e.call(H,o),null==j?void 0:j(t)])),re()}catch(e){console.error(e)}})),customFormTexts:p.onboarding,defaultValues:null==H?void 0:H.defaultValues,customTerms:null==H?void 0:H.customTerms}):t.createElement(de,{onClose:v,canSkip:i,onSubmit:o=>e(void 0,void 0,void 0,(function*(){try{Q(o),yield null==j?void 0:j(o),re()}catch(e){console.error(e)}})),customFormTexts:p.onboarding})),Z===T.OTP&&t.createElement(me,{onClose:v,onSubmit:ie,phone:J,onResendCode:k,otpError:O,loading:M,canSkip:i,onBack:se,outOfEdit:oe>=2}),Z===T.OTPEmail&&t.createElement(me,{onClose:v,onSubmit:ie,onResendCode:k,otpError:O,loading:M,canSkip:i,onBack:se,outOfEdit:oe>=2,email:X}),Z===T.PersonalInfo&&t.createElement(ce,{initialData:null==f?void 0:f[T.PersonalInfo],onClose:v,canSkip:i,onSubmit:o=>e(void 0,void 0,void 0,(function*(){try{ee((null==o?void 0:o.email)||"");!(yield null==P?void 0:P(o))&&re()}catch(e){console.error(e)}})),errorMessage:z,loading:h}),Z===T.UpdatePassword&&t.createElement(pe,{onClose:v,canSkip:i,onSubmit:o=>e(void 0,void 0,void 0,(function*(){try{yield null==y?void 0:y(o),!s&&re()}catch(e){console.error(e)}})),errorMessage:s,loading:d}),Z===T.Result&&t.createElement(x,Object.assign({},I),t.createElement(g,{theme:L,size:"lg",onClick:v,className:"form-button"},G("onboarding.button.continue"))))),"object"==typeof a&&!Y&&t.createElement(m.Col,{span:"object"!=typeof a&&!Y||ne?12:6,order:Y?2:1,orderMd:Y?1:2},t.createElement(_,null,t.createElement(R,{"data-is-marry-baby":ue},t.createElement(U,null,(null==a?void 0:a.heading)&&t.createElement(c,{order:1,mb:24},null==a?void 0:a.heading),(null==a?void 0:a.description)&&t.createElement(b,{size:"p1",color:N.colors.gray800},G("onboarding.welcomeScreen.content"))),(null==a?void 0:a.imgSrc)&&t.createElement("div",null,t.createElement(W,{src:null==a?void 0:a.imgSrc,loading:"lazy"}))))),"object"==typeof a&&Y&&(null==a?void 0:a.imgSrc)&&t.createElement(m.Col,{span:"auto",order:Y?1:2,orderMd:Y?2:1},t.createElement(W,{src:null==a?void 0:a.imgSrc,loading:"lazy",className:"similac"})))):"Incorrect flow"))};export{de as OnboardingForm,ue as OnboardingModal,me as OtpForm};
1
+ import{a as e,_ as o}from"./tslib.es6-dc24c862.js";import t,{useContext as n,useState as r,useRef as a,useEffect as i,useMemo as s,useCallback as l}from"react";import{Input as d,Grid as m,Title as c}from"@mantine/core";import{useInterval as p,useCounter as u}from"@mantine/hooks";import{B as g}from"./index-889037d3.js";import{e as b,o as h,h as E,R as f,O as v,p as y,u as w,B as S}from"./index-f5615fc6.js";import{u as P,a as j,F as k,O as C,b as x}from"./index-bf849d69.js";import{u as B}from"./useTranslations-2845154d.js";import"lodash/debounce";import"./isProduction-dd524cb4.js";import{L as z}from"./index-a71fd684.js";import{O as T}from"./Onboarding-5b53ad56.js";export{O as OnboardingStep}from"./Onboarding-5b53ad56.js";import"dayjs";import"./screenSizeContext-62d9d281.js";import"styled-components";import{t as N}from"./theme-6fcfd4c3.js";import{M as F}from"./utils-0112af9f.js";import"./gAssets.js";import{S as I,a as L,b as q,c as A,d as V,e as D,f as _,g as R,h as U,i as W}from"./index.styled-35d1256d.js";import{yupResolver as Y}from"@mantine/form";import"./index-0ca1bc0a.js";import"./index-2d21fd23.js";import"./index-6221b00b.js";import"./index.styled-d0d52bd5.js";import"./index-4f5d9780.js";import{D as H}from"./index-7ecc719a.js";import"./index-e85333e4.js";import{A as $}from"./index-10233736.js";import{V as G}from"./Visible-19957415.js";import{M as Z,h as K}from"./utils-d648625a.js";export{M as MAPPED_LOCALE}from"./utils-d648625a.js";import*as J from"yup";import"@mantine/dates";import Q from"lodash/throttle";import{T as X}from"./index-944f9cc1.js";import{format as ee}from"date-fns";import"@mantine/carousel";import"./translationsContext-5c973874.js";import"string-format";import"date-fns/locale";import"./useUniqueId-6c3e7337.js";import"react-keyed-flatten-children";import"./index-db70ba7d.js";const oe=({inputOrder:e=["phone"],withSimilac:o=!1,customTerms:n=""})=>{const{t:r}=B(),a=P(),i=t.createElement(d.Wrapper,Object.assign({className:o?"input-control":"phone-input",withAsterisk:!0},o?{label:t.createElement(b,{size:"s4",weight:"semiBold",as:"span"},r("onboarding.similac.input.phone"))}:{}),t.createElement(h,Object.assign({defaultCountry:Z[process.env.UNIFY_LOCALE]||"VN"},a.getInputProps("phone"))),t.createElement(d.Error,{size:"md"},a.errors.phone)),s=t.createElement(E,Object.assign({label:t.createElement(b,{size:"s4",weight:"semiBold",as:"span"},r("onboarding.formEmail.yourName")),withAsterisk:!0},a.getInputProps("name"))),l=t.createElement(E,Object.assign({label:t.createElement(b,{size:"s4",weight:"semiBold",as:"span"},r("onboarding.formEmail.yourEmail")),withAsterisk:!0},a.getInputProps("email"))),m=t.createElement(H,Object.assign({label:t.createElement(b,{size:"s4",weight:"semiBold",as:"span"},r("onboarding.formEmail.yourBirthday")),placeholder:"DD/MM/YYYY"},a.getInputProps("dob"))),c=t.createElement(f.Group,Object.assign({className:"radio-group",label:t.createElement(b,{size:"s4",weight:"semiBold",as:"span"},r("bmi.selectGender"))},a.getInputProps("gender")),t.createElement(f,{value:"0",label:r("onboarding.formEmail.genderMale")}),t.createElement(f,{value:"1",label:r("onboarding.formEmail.genderFemale")})),p=t.createElement("div",{className:"otp-input"},t.createElement(v,Object.assign({enterKeyHint:void 0,nonce:void 0},a.getInputProps("otp"))),t.createElement(d.Error,null,a.errors.otp)),u=t.createElement(E.Password,Object.assign({label:t.createElement(b,{size:"s4",weight:"semiBold",as:"span"},r("onboarding.updatePassword.password")),withAsterisk:!0,rightSection:t.createElement(G,null)},a.getInputProps("password"))),g=t.createElement(E.Wrapper,Object.assign({},a.getInputProps("term",{type:"checkbox"}),{error:null,mb:16}),t.createElement(y,{label:n?t.createElement(b,{size:"p4",as:"span",sx:{a:{color:"#2d87f3",fontWeight:"bold",letterSpacing:0}}},n):t.createElement(b,{size:"p4",as:"span"},"Tôi đã đọc và đồng ý với các điều khoản và chương trình của"," ",t.createElement("a",null,t.createElement(b,{size:"label1",as:"span",weight:"bold",color:"blue.6"},"Hello Bacsi"))," ","và"," ",t.createElement("a",null,t.createElement(b,{size:"label1",as:"span",weight:"bold",color:"blue.6"},"Abbott Similac"))," ","và được hướng dẫn cách ngưng chương trình"),onChange:e=>{a.setFieldValue("term",e.currentTarget.checked)}}),t.createElement(d.Error,{size:"md"},a.getInputProps("term",{type:"checkbox"}).error)),w=t.createElement($,Object.assign({className:"input-control",label:t.createElement(b,{size:"s4",weight:"semiBold",as:"span"},r("onboarding.similac.input.address"))},a.getInputProps("address"))),S=t.createElement(E.Password,Object.assign({label:t.createElement(b,{size:"s4",weight:"semiBold",as:"span"},r("onboarding.updatePassword.confirmPassword")),withAsterisk:!0,rightSection:t.createElement(G,null)},a.getInputProps("confirmPassword"))),j=e.map((e=>({phone:i,full_name:s,email:l,dob:m,gender:c,otp:p,password:u,confirm_password:S,term:g,address:w}[e]||null)));return t.createElement(I,null,j)},te=e=>J.object().shape({phone:J.string().required(e("onboarding.updatePhone.error")).default("")}),ne=e=>J.object().shape({phone:J.string().required(e("onboarding.updatePhone.error")).default(""),name:J.string().required(e("onboarding.errorMessage.requiredName")),email:J.string().required(e("onboarding.errorMessage.requiredEmail")).email(e("onboarding.errorMessage.invalidEmail")).default(""),address:J.mixed().required(e("onboarding.similac.address.error")),term:J.bool().oneOf([!0],e("onboarding.similac.term.error"))}),re=e=>J.object().shape({otp:J.string().required(e("onboarding.otpForm.error")).length(6,e("onboarding.otpForm.error")).default("")}),ae=e=>J.object().shape({email:J.string().required(e("onboarding.errorMessage.requiredEmail")).email(e("onboarding.errorMessage.invalidEmail")).default(""),name:J.string().required(e("onboarding.errorMessage.requiredName"))}),ie=e=>J.object().shape({password:J.string().required(e("onboarding.errorMessage.requiredPassword")).min(8,e("onboarding.errorMessage.minLength",{length:8})).matches(/.*[A-Z].*/,e("onboarding.errorMessage.passWithPattern")).default(""),confirmPassword:J.string().required(e("onboarding.errorMessage.requiredConfirmPassword")).oneOf([J.ref("password"),null],e("onboarding.errorMessage.passNotMatch")).default("")}),se=({onClose:o,onSubmit:n,canSkip:r=!0,customFormTexts:a})=>{const{t:i}=B(),s=j({initialValues:{phone:""},validate:Y(te(i))});return t.createElement(L,{heading:(null==a?void 0:a.heading)||i("onboarding.updatePhone.heading"),description:(null==a?void 0:a.description)||i("onboarding.updatePhone.description")},t.createElement(k,{form:s},t.createElement("form",{onSubmit:s.onSubmit((o=>e(void 0,void 0,void 0,(function*(){n(o.phone)}))),(e=>{console.log(e)}))},t.createElement(oe,{inputOrder:["phone"]}),t.createElement(g,{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"},i("onboarding.button.continue")),r&&t.createElement(g,{color:"ghost",isBlock:!0,size:"lg",onClick:o,type:"button"},i("onboarding.button.skip")))))},le=n=>{var{onClose:r,onSubmit:a,canSkip:i=!0,customFormTexts:s,customTerms:l,defaultValues:d}=n,m=o(n,["onClose","onSubmit","canSkip","customFormTexts","customTerms","defaultValues"]);const{t:c}=B(),{isMobile:p}=w(),u=j({initialValues:Object.assign({phone:"",term:!1},d),validate:Y(ne(c))});return t.createElement(L,Object.assign({heading:(null==s?void 0:s.heading)||c("onboarding.updatePhone.heading"),description:(null==s?void 0:s.description)||c("onboarding.updatePhone.description"),hiddenLogo:p},m),t.createElement(k,{form:u},t.createElement("form",{onSubmit:u.onSubmit((o=>e(void 0,void 0,void 0,(function*(){a(o)}))),(e=>{console.log(e)}))},t.createElement(oe,{inputOrder:["full_name","email","phone","address","term"],withSimilac:!0,customTerms:l}),t.createElement(S,{fullWidth:!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"},c("onboarding.button.continue")),i&&t.createElement(S,{variant:"ghost",fullWidth:!0,size:"lg",onClick:r,type:"button"},c("onboarding.button.skip")))))},de=e=>{var{withSimilac:n=!1}=e,r=o(e,["withSimilac"]);return n?t.createElement(le,Object.assign({},r)):t.createElement(se,Object.assign({},r))},me=({onSubmit:o,phone:l,email:d,onResendCode:m,otpError:c,onClose:b,loading:h,onBack:E,canSkip:f,outOfEdit:v})=>{const{siteType:y,isMarryBaby:w}=n(C),[S,P]=r(30),O=p((()=>P((e=>e-1))),1e3),[x,M]=u(0,{min:0,max:3}),z=a(!0),{t:T}=B();i((()=>(O.start(),O.stop)),[]),i((()=>{0===S&&(O.stop(),z.current=!1)}),[S]);const F=j({initialValues:{otp:""},validate:Y(re(T))});i((()=>{c&&F.setFieldError("otp",c)}),[c]);const I=s((()=>Q((()=>{z.current||(M.increment(),P(30),null==m||m(l||d),O.start(),z.current=!0)}),1e3,{trailing:!1})),[l,d,m,O]);return t.createElement(q,{heading:T("onboarding.otpForm.heading"),description:t.createElement(t.Fragment,null,t.createElement("span",{dangerouslySetInnerHTML:{__html:l?T("onboarding.otpForm.description",{phone:`<b style="color:${N.colors.gray800}">${l.slice(0,-3).replace(/./g,"x").concat(l.slice(-3))}</b>`}):T("onboarding.otpForm.descriptionEmail",{email:`<b style="color:${N.colors.gray800}">${K(d)}</b>`})}}),!v&&t.createElement("svg",{onClick:()=>{null==E||E()},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"otp-description-edit-icon"},t.createElement("path",{d:"M12.7812 1.33337C12.2987 1.33337 11.8162 1.51712 11.4479 1.88546L10.6667 2.66671L13.3333 5.33337L14.1146 4.55212C14.8506 3.81612 14.8506 2.62212 14.1146 1.88546C13.7463 1.51712 13.2638 1.33337 12.7812 1.33337ZM9.66667 3.66671L2 11.3334V14H4.66667L12.3333 6.33337L9.66667 3.66671Z",fill:"#ADB3BC"})))},t.createElement(k,{form:F},t.createElement("form",{onSubmit:F.onSubmit((t=>e(void 0,void 0,void 0,(function*(){M.increment(),o(t.otp)}))),(e=>{console.log(e)}))},t.createElement(oe,{inputOrder:["otp"]}),t.createElement("div",{className:"resend"},t.createElement(X,{size:"p4",color:N.colors.gray400},T("onboarding.otpForm.notReceiveOTP")),t.createElement(X,{as:"a",size:"p4",color:w?N.mbColors.pink:N.colors.primaryBase,onClick:I},T("onboarding.otpForm.resendCode",{seconds:S}))),t.createElement(g,{theme:y,color:"primary",isBlock:!0,size:"lg",type:"submit",isLoading:h,disabled:h,"data-event-category":"Sign Up","data-event-action":"Confirm Phone Number","data-event-label":"undefined"!=typeof window?window.location.href:"",className:"pointer-event-child-none"},T("onboarding.button.continue")),f&&x>=3&&t.createElement(g,{theme:y,color:"ghost",isBlock:!0,size:"lg",onClick:b,"data-event-category":"Sign Up","data-event-action":"Confirm Phone Number","data-event-label":"undefined"!=typeof window?window.location.href:"",className:"pointer-event-child-none",type:"button"},T("onboarding.button.skip")))))},ce=({onClose:e,onSubmit:o,canSkip:r,loading:a,errorMessage:s,initialData:l})=>{const{t:d,locale:m}=B(),{siteType:c,isMarryBaby:p}=n(C),u=j({validate:Y(ae(d))});return i((()=>{u.setValues(Object.assign(Object.assign({gender:"0"},l),(null==l?void 0:l.birthday)&&{birthday:new Date(l.birthday)}))}),[l]),i((()=>{s&&u.setFieldError("email",s)}),[s]),t.createElement(x,{heading:d("onboarding.formEmail.heading"),description:d("onboarding.formEmail.description",{site:p?"Marry Baby":z[m].SITE_NAME_FORMATTED})},t.createElement(k,{form:u},t.createElement("form",{className:"form",onSubmit:u.onSubmit((e=>{o(Object.assign(Object.assign({},e),{birthday:e.birthday&&ee(e.birthday,"yyyy-MM-dd")}))}),(e=>{console.log({fieldErrors:e})}))},t.createElement(oe,{inputOrder:["full_name","email","dob","gender"]}),t.createElement(g,{color:"primary",isBlock:!0,size:"lg",type:"submit",theme:c,isLoading:a,disabled:a},d("onboarding.button.continue")),r&&t.createElement(g,{theme:c,color:"ghost",isBlock:!0,size:"lg",onClick:e},d("onboarding.button.skip")))))},pe=({onClose:e,onSubmit:o,canSkip:n,errorMessage:r,loading:a})=>{const{t:i}=B(),s=j({initialValues:{password:"",confirmPassword:""},validate:Y(ie(i))});return t.createElement(x,{heading:i("onboarding.updatePassword.heading"),description:i("onboarding.updatePassword.description")},t.createElement(k,{form:s},t.createElement("form",{className:"form",onSubmit:s.onSubmit((e=>o((null==e?void 0:e.password)||"")),(e=>{console.log({fieldErrors:e})}))},t.createElement(oe,{inputOrder:["password","confirm_password"]}),t.createElement(g,{color:"primary",isBlock:!0,size:"lg",type:"submit",isLoading:a,disabled:a},i("onboarding.button.continue")),n&&t.createElement(g,{color:"ghost",isBlock:!0,size:"lg",onClick:e},i("onboarding.button.skip")),r&&t.createElement(d.Error,{className:"form-error"},r))))},ue=n=>{var{banner:a,canSkip:i,createPassError:s,createPassLoading:d,customFormTexts:p,emailLoading:h,flow:E=[T.Phone,T.OTP],initialData:f,onClose:v,onCreatePassByEmail:y,onOtpSubmit:S,onPersonalInfoSubmit:P,onPhoneSubmit:j,onResendCode:k,otpError:O,otpLoading:M,personalInfoError:z,resultScreenProps:I,siteType:L,step:q,withSimilac:Y=!1,similacFormProps:H}=n,$=o(n,["banner","canSkip","createPassError","createPassLoading","customFormTexts","emailLoading","flow","initialData","onClose","onCreatePassByEmail","onOtpSubmit","onPersonalInfoSubmit","onPhoneSubmit","onResendCode","otpError","otpLoading","personalInfoError","resultScreenProps","siteType","step","withSimilac","similacFormProps"]);const{t:G}=B(),[Z,K]=r(q||E[0]),[J,Q]=r(""),[X,ee]=r(""),[oe,te]=u(0,{min:0,max:2}),{isMobile:ne}=w(),re=l((()=>{const e=E.indexOf(Z)+1;e<=E.length-1&&K(E[e])}),[Z]),ae=l((()=>{const e=E.indexOf(Z)-1;e>=0&&K(E[e])}),[Z]),ie=o=>e(void 0,void 0,void 0,(function*(){try{!(yield S(o))&&re()}catch(e){console.error(e)}})),se=()=>{oe>=2||(te.increment(),ae())},ue="marryBaby"===L;return t.createElement(C.Provider,{value:{siteType:L,isMarryBaby:ue}},t.createElement(A,Object.assign({},$),E.length>0?t.createElement(V,null,t.createElement(m,{sx:{[F.mbDown]:{margin:0},".mantine-Grid-col":{[F.mbDown]:{padding:0}}}},t.createElement(m.Col,{span:"object"!=typeof a&&!Y||ne?12:6,order:Y?2:1,orderMd:Y?1:2,sx:{zIndex:Y?99:void 0}},t.createElement(D,{"data-similac":Y,"data-has-banner":"object"==typeof a},Z===T.Phone&&(Y?t.createElement(le,{onClose:v,canSkip:i,onSubmit:o=>e(void 0,void 0,void 0,(function*(){var e;try{const t=null==o?void 0:o.phone;t&&(Q(t),yield Promise.all([null===(e=null==H?void 0:H.onFormSubmit)||void 0===e?void 0:e.call(H,o),null==j?void 0:j(t)])),re()}catch(e){console.error(e)}})),customFormTexts:p.onboarding,defaultValues:null==H?void 0:H.defaultValues,customTerms:null==H?void 0:H.customTerms}):t.createElement(de,{onClose:v,canSkip:i,onSubmit:o=>e(void 0,void 0,void 0,(function*(){try{Q(o),yield null==j?void 0:j(o),re()}catch(e){console.error(e)}})),customFormTexts:p.onboarding})),Z===T.OTP&&t.createElement(me,{onClose:v,onSubmit:ie,phone:J,onResendCode:k,otpError:O,loading:M,canSkip:i,onBack:se,outOfEdit:oe>=2}),Z===T.OTPEmail&&t.createElement(me,{onClose:v,onSubmit:ie,onResendCode:k,otpError:O,loading:M,canSkip:i,onBack:se,outOfEdit:oe>=2,email:X}),Z===T.PersonalInfo&&t.createElement(ce,{initialData:null==f?void 0:f[T.PersonalInfo],onClose:v,canSkip:i,onSubmit:o=>e(void 0,void 0,void 0,(function*(){try{ee((null==o?void 0:o.email)||"");!(yield null==P?void 0:P(o))&&re()}catch(e){console.error(e)}})),errorMessage:z,loading:h}),Z===T.UpdatePassword&&t.createElement(pe,{onClose:v,canSkip:i,onSubmit:o=>e(void 0,void 0,void 0,(function*(){try{yield null==y?void 0:y(o),!s&&re()}catch(e){console.error(e)}})),errorMessage:s,loading:d}),Z===T.Result&&t.createElement(x,Object.assign({},I),t.createElement(g,{theme:L,size:"lg",onClick:v,className:"form-button"},G("onboarding.button.continue"))))),"object"==typeof a&&!Y&&t.createElement(m.Col,{span:"object"!=typeof a&&!Y||ne?12:6,order:Y?2:1,orderMd:Y?1:2},t.createElement(_,null,t.createElement(R,{"data-is-marry-baby":ue},t.createElement(U,null,(null==a?void 0:a.heading)&&t.createElement(c,{order:1,mb:24},null==a?void 0:a.heading),(null==a?void 0:a.description)&&t.createElement(b,{size:"p1",color:N.colors.gray800},G("onboarding.welcomeScreen.content"))),(null==a?void 0:a.imgSrc)&&t.createElement("div",null,t.createElement(W,{src:null==a?void 0:a.imgSrc,loading:"lazy"}))))),"object"==typeof a&&Y&&(null==a?void 0:a.imgSrc)&&t.createElement(m.Col,{span:"auto",order:Y?1:2,orderMd:Y?2:1},t.createElement(W,{src:null==a?void 0:a.imgSrc,loading:"lazy",className:"similac"})))):"Incorrect flow"))};export{de as OnboardingForm,ue as OnboardingModal,me as OtpForm};
@@ -1,4 +1,4 @@
1
- import e,{createContext as t,forwardRef as n,useContext as r,useImperativeHandle as o,useState as a,useRef as i,useEffect as l,useMemo as s,Fragment as m}from"react";import{_ as d,a as c}from"./tslib.es6-566e140f.js";import{Box as p,Input as u,Grid as g,Title as b,Container as h,Stack as E,AspectRatio as f}from"@mantine/core";import{useInterval as L,useCounter as v}from"@mantine/hooks";import"./gAssets.js";import{D as C}from"./index-7a7af552.js";import{e as y,o as x,h as w,R as S,O as M,p as j,u as P,B as k}from"./index-8e8ef155.js";import{H as O}from"./index-78992174.js";import"dayjs";import"./screenSizeContext-fc50587c.js";import F from"styled-components";import{t as B}from"./theme-4693e886.js";import{L as z}from"./index-0e921413.js";import{M as N,a as I}from"./utils-807f25d6.js";import"./isProduction-ed27c0ed.js";import{L as T}from"./Onboarding-01e65da4.js";import{u as D}from"./useTranslations-f4ad49b0.js";import"./index-567513ac.js";import{A as Z}from"./index-4a460261.js";import"lodash/debounce";import{V as A}from"./Visible-52b8a15d.js";import{createFormContext as _,yupResolver as V}from"@mantine/form";import"./index-eac9c06c.js";import{L as q}from"./index-3650a52c.js";import"./index.styled-d8afff19.js";import"./index-1a06fbf0.js";import"@mantine/dates";import*as H from"yup";import{createPortal as $}from"react-dom";import{B as U}from"./index-4acb82eb.js";import{b as Y}from"./index-9b50fa62.js";import R from"lodash/throttle";import{T as W}from"./index-141e9ea9.js";import{format as G}from"date-fns";import"./translationsContext-d8467494.js";import"string-format";import K from"react-keyed-flatten-children";import"date-fns/locale";import"@mantine/carousel";import"./useUniqueId-527dc21c.js";import"./index-af7821db.js";import"./utils-4d51e270.js";const J=t({currentStep:0,setCurrentStep:()=>!1,setMaxStep:()=>!1,nextStep:()=>!1,prevStep:()=>!1,isMarryBaby:!1,siteType:"helloSites",sharedData:{},setSharedData:()=>!1}),[Q,X,ee]=_(),te=F(p)`
1
+ import e,{createContext as t,forwardRef as n,useContext as r,useImperativeHandle as o,useState as a,useRef as i,useEffect as l,useMemo as s,Fragment as m}from"react";import{_ as d,a as c}from"./tslib.es6-dc24c862.js";import{Box as p,Input as u,Grid as g,Title as b,Container as h,Stack as E,AspectRatio as f}from"@mantine/core";import{useInterval as L,useCounter as v}from"@mantine/hooks";import"./gAssets.js";import{D as C}from"./index-7ecc719a.js";import{e as y,o as x,h as w,R as S,O as M,p as j,u as P,B as k}from"./index-f5615fc6.js";import{H as O}from"./index-0ca1bc0a.js";import"dayjs";import"./screenSizeContext-62d9d281.js";import F from"styled-components";import{t as B}from"./theme-6fcfd4c3.js";import{L as z}from"./index-a71fd684.js";import{M as N,a as I}from"./utils-0112af9f.js";import"./isProduction-dd524cb4.js";import{L as T}from"./Onboarding-5b53ad56.js";import{u as D}from"./useTranslations-2845154d.js";import"./index-e85333e4.js";import{A as Z}from"./index-10233736.js";import"lodash/debounce";import{V as A}from"./Visible-19957415.js";import{createFormContext as _,yupResolver as V}from"@mantine/form";import"./index-2d21fd23.js";import{L as q}from"./index-6221b00b.js";import"./index.styled-d0d52bd5.js";import"./index-4f5d9780.js";import"@mantine/dates";import*as H from"yup";import{createPortal as $}from"react-dom";import{B as U}from"./index-889037d3.js";import{b as Y}from"./index-bf849d69.js";import R from"lodash/throttle";import{T as W}from"./index-944f9cc1.js";import{format as G}from"date-fns";import"./translationsContext-5c973874.js";import"string-format";import K from"react-keyed-flatten-children";import"date-fns/locale";import"@mantine/carousel";import"./useUniqueId-6c3e7337.js";import"./index-db70ba7d.js";import"./utils-d648625a.js";const J=t({currentStep:0,setCurrentStep:()=>!1,setMaxStep:()=>!1,nextStep:()=>!1,prevStep:()=>!1,isMarryBaby:!1,siteType:"helloSites",sharedData:{},setSharedData:()=>!1}),[Q,X,ee]=_(),te=F(p)`
2
2
  .phone-input {
3
3
  width: 100%;
4
4
  margin-bottom: 32px;
@@ -15,7 +15,7 @@ import e,{createContext as t,forwardRef as n,useContext as r,useImperativeHandle
15
15
  border-radius: 0 4px 4px 0;
16
16
  }
17
17
  }
18
- `,ne={[T.Vietnam]:"VN",[T.Cambodia]:"KH",[T.Indonesia]:"ID",[T.Malaysia]:"MY",[T.PhilippinesEnglish]:"PH",[T.PhilippinesTagalog]:"PH",[T.Taiwan]:"TW",[T.Thailand]:"TH",[T.Myanmar]:"MM"},re=(e="")=>{const t=e.indexOf("@"),n=e.substring(0,t),r=n.length>3?3:n.length;return e.replace(e.substring(r,t),e.slice(r,t).replace(/./g,"x"))},oe=t=>{var{inputOrder:n=["phone"],withSimilac:r=!1,customTerms:o="",formContext:a}=t,i=d(t,["inputOrder","withSimilac","customTerms","formContext"]);const{t:l}=D(),s=a||X(),m={phone:t=>{var{label:n,name:o="phone"}=t,a=d(t,["label","name"]);return e.createElement(u.Wrapper,{className:r?"input-control":"phone-input",withAsterisk:!0,label:n||r?e.createElement(y,{size:"s4",weight:"semiBold",as:"span"},n||l("onboarding.similac.input.phone")):void 0},e.createElement(x,Object.assign({defaultCountry:ne[process.env.UNIFY_LOCALE]||"VN"},s.getInputProps(o),a)),e.createElement(u.Error,{size:"md"},s.errors.phone))},full_name:t=>{var{label:n,name:r="name"}=t,o=d(t,["label","name"]);return e.createElement(w,Object.assign({label:e.createElement(y,{size:"s4",weight:"semiBold",as:"span"},n||l("onboarding.formEmail.yourName")),withAsterisk:!0},s.getInputProps(r),o))},email:t=>{var{label:n,name:r="email"}=t,o=d(t,["label","name"]);return e.createElement(w,Object.assign({label:e.createElement(y,{size:"s4",weight:"semiBold",as:"span"},n||l("onboarding.formEmail.yourEmail")),withAsterisk:!0},s.getInputProps(r),o))},dob:t=>{var{label:n,name:r="dob"}=t,o=d(t,["label","name"]);return e.createElement(C,Object.assign({label:e.createElement(y,{size:"s4",weight:"semiBold",as:"span"},n||l("onboarding.formEmail.yourBirthday")),placeholder:"DD/MM/YYYY"},s.getInputProps(r),o))},gender:({label:t,name:n="gender"})=>e.createElement(S.Group,Object.assign({className:"radio-group",label:e.createElement(y,{size:"s4",weight:"semiBold",as:"span"},t||l("bmi.selectGender"))},s.getInputProps(n)),e.createElement(S,{value:"0",label:l("onboarding.formEmail.genderMale")}),e.createElement(S,{value:"1",label:l("onboarding.formEmail.genderFemale")})),otp:({name:t="otp"})=>e.createElement("div",{className:"otp-input"},e.createElement(M,Object.assign({enterKeyHint:void 0,nonce:void 0},s.getInputProps(t))),e.createElement(u.Error,null,s.errors.otp)),password:({label:t,name:n="password"})=>e.createElement(w.Password,Object.assign({label:e.createElement(y,{size:"s4",weight:"semiBold",as:"span"},t||l("onboarding.updatePassword.password")),withAsterisk:!0,rightSection:e.createElement(A,null)},s.getInputProps(n))),confirm_password:({label:t,name:n="confirmPassword"})=>e.createElement(w.Password,Object.assign({label:e.createElement(y,{size:"s4",weight:"semiBold",as:"span"},t||l("onboarding.updatePassword.confirmPassword")),withAsterisk:!0,rightSection:e.createElement(A,null)},s.getInputProps(n))),term:({name:t="term",className:n=""})=>o?e.createElement("div",{style:{marginBottom:16},className:n},e.createElement(j,Object.assign({label:e.createElement(y,{size:"p4",as:"span",sx:{a:{color:"#2d87f3",fontWeight:"bold",letterSpacing:0}}},o)},s.getInputProps(t,{type:"checkbox"}),{error:null})),e.createElement(u.Error,{size:"md"},s.getInputProps("term",{type:"checkbox"}).error)):null,address:t=>{var{label:n,className:r="",name:o="address"}=t,a=d(t,["label","className","name"]);return e.createElement(Z,Object.assign({className:`${r} input-control`,label:e.createElement(y,{size:"s4",weight:"semiBold",as:"span"},n||l("onboarding.similac.input.address"))},s.getInputProps(o),a))}},c=n.map((e=>{var t;const n="string"==typeof e?{inputType:e}:e;return null===(t=m[n.inputType])||void 0===t?void 0:t.call(m,n)}));return e.createElement(te,Object.assign({},i),c)},ae=e=>H.object().shape({phone:H.string().required(e("onboarding.updatePhone.error")).default(""),name:H.string().required(e("onboarding.errorMessage.requiredName")),email:H.string().required(e("onboarding.errorMessage.requiredEmail")).email(e("onboarding.errorMessage.invalidEmail")).default(""),address:H.mixed().required(e("onboarding.similac.address.error")),term:H.bool().oneOf([!0],e("onboarding.similac.term.error"))});var ie=n(((t,n)=>{var{inputOrder:a,onSubmit:i,validateSchema:l,defaultValues:s,isActive:m,customTerms:u,customFormTexts:g}=t,b=d(t,["inputOrder","onSubmit","validateSchema","defaultValues","isActive","customTerms","customFormTexts"]);const{nextStep:h,setSharedData:E,sharedData:f}=r(J),{t:L}=D(),v=ee({initialValues:{term:!1,phone:(null==f?void 0:f.phone)||(null==s?void 0:s.phone)||"",email:(null==f?void 0:f.email)||(null==s?void 0:s.email)||"",name:(null==f?void 0:f.name)||(null==s?void 0:s.name)||""},validate:l||V(ae(L))}),C=e=>c(void 0,void 0,void 0,(function*(){try{yield null==i?void 0:i(e),E((t=>Object.assign(Object.assign({},t),{phone:e.phone,email:e.email,name:e.name}))),h()}catch(e){console.error(e)}})),x=e=>{console.log(e)},w=()=>{var e;return null===(e=v.onSubmit(C,x))||void 0===e?void 0:e()};return o(n,(()=>({submitForm:w}))),e.createElement(p,Object.assign({"data-active":m},b),e.createElement(p,{sx:e=>({display:"flex",flexDirection:"column",gap:"16px",[e.fn.largerThan("md")]:{gap:"24px"}})},e.createElement(p,{sx:{textAlign:"center"}},e.createElement(O,{tag:"h4",as:"h2"},null==g?void 0:g.heading),e.createElement(y,{size:"p3"},null==g?void 0:g.description)),e.createElement(Q,{form:v},e.createElement("form",{className:"friso-form",style:{width:"100%"},onSubmit:v.onSubmit(C,x)},e.createElement(p,{sx:{".friso-form":{display:"flex",flexWrap:"wrap",gap:"8px",".input-control":{width:"100%",marginBottom:0},".phone-input":{marginBottom:"0 !important",".PhoneInput":{marginBottom:"0 !important"}}}}},e.createElement(oe,{inputOrder:a,customTerms:u,className:"friso-form"}))))))}));const le=F.div`
18
+ `,ne={[T.Vietnam]:"VN",[T.Cambodia]:"KH",[T.Indonesia]:"ID",[T.Malaysia]:"MY",[T.PhilippinesEnglish]:"PH",[T.PhilippinesTagalog]:"PH",[T.Taiwan]:"TW",[T.Thailand]:"TH",[T.Myanmar]:"MM"},re=(e="")=>{const t=e.indexOf("@"),n=e.substring(0,t),r=n.length>3?3:n.length;return e.replace(e.substring(r,t),e.slice(r,t).replace(/./g,"x"))},oe=t=>{var{inputOrder:n=["phone"],withSimilac:r=!1,customTerms:o="",formContext:a}=t,i=d(t,["inputOrder","withSimilac","customTerms","formContext"]);const{t:l}=D(),s=a||X(),m={phone:t=>{var{label:n,name:o="phone"}=t,a=d(t,["label","name"]);return e.createElement(u.Wrapper,{className:r?"input-control":"phone-input",withAsterisk:!0,label:n||r?e.createElement(y,{size:"s4",weight:"semiBold",as:"span"},n||l("onboarding.similac.input.phone")):void 0},e.createElement(x,Object.assign({defaultCountry:ne[process.env.UNIFY_LOCALE]||"VN"},s.getInputProps(o),a)),e.createElement(u.Error,{size:"md"},s.errors.phone))},full_name:t=>{var{label:n,name:r="name"}=t,o=d(t,["label","name"]);return e.createElement(w,Object.assign({label:e.createElement(y,{size:"s4",weight:"semiBold",as:"span"},n||l("onboarding.formEmail.yourName")),withAsterisk:!0},s.getInputProps(r),o))},email:t=>{var{label:n,name:r="email"}=t,o=d(t,["label","name"]);return e.createElement(w,Object.assign({label:e.createElement(y,{size:"s4",weight:"semiBold",as:"span"},n||l("onboarding.formEmail.yourEmail")),withAsterisk:!0},s.getInputProps(r),o))},dob:t=>{var{label:n,name:r="dob"}=t,o=d(t,["label","name"]);return e.createElement(C,Object.assign({label:e.createElement(y,{size:"s4",weight:"semiBold",as:"span"},n||l("onboarding.formEmail.yourBirthday")),placeholder:"DD/MM/YYYY"},s.getInputProps(r),o))},gender:t=>{var{label:n,name:r="gender"}=t,o=d(t,["label","name"]);return e.createElement(S.Group,Object.assign({className:"radio-group",label:e.createElement(y,{size:"s4",weight:"semiBold",as:"span"},n||l("bmi.selectGender"))},s.getInputProps(r),o),e.createElement(S,{value:"0",label:l("onboarding.formEmail.genderMale")}),e.createElement(S,{value:"1",label:l("onboarding.formEmail.genderFemale")}))},otp:({name:t="otp"})=>e.createElement("div",{className:"otp-input"},e.createElement(M,Object.assign({enterKeyHint:void 0,nonce:void 0},s.getInputProps(t))),e.createElement(u.Error,null,s.errors.otp)),password:({label:t,name:n="password"})=>e.createElement(w.Password,Object.assign({label:e.createElement(y,{size:"s4",weight:"semiBold",as:"span"},t||l("onboarding.updatePassword.password")),withAsterisk:!0,rightSection:e.createElement(A,null)},s.getInputProps(n))),confirm_password:({label:t,name:n="confirmPassword"})=>e.createElement(w.Password,Object.assign({label:e.createElement(y,{size:"s4",weight:"semiBold",as:"span"},t||l("onboarding.updatePassword.confirmPassword")),withAsterisk:!0,rightSection:e.createElement(A,null)},s.getInputProps(n))),term:({name:t="term",className:n=""})=>o?e.createElement("div",{style:{marginBottom:16},className:n},e.createElement(j,Object.assign({label:e.createElement(y,{size:"p4",as:"span",sx:{a:{color:"#2d87f3",fontWeight:"bold",letterSpacing:0}}},o)},s.getInputProps(t,{type:"checkbox"}),{error:null})),e.createElement(u.Error,{size:"md"},s.getInputProps("term",{type:"checkbox"}).error)):null,address:t=>{var{label:n,className:r="",name:o="address"}=t,a=d(t,["label","className","name"]);return e.createElement(Z,Object.assign({className:`${r} input-control`,label:e.createElement(y,{size:"s4",weight:"semiBold",as:"span"},n||l("onboarding.similac.input.address"))},s.getInputProps(o),a))}},c=n.map((e=>{var t;const n="string"==typeof e?{inputType:e}:e;return null===(t=m[n.inputType])||void 0===t?void 0:t.call(m,n)}));return e.createElement(te,Object.assign({},i),c)},ae=e=>H.object().shape({phone:H.string().required(e("onboarding.updatePhone.error")).default(""),name:H.string().required(e("onboarding.errorMessage.requiredName")),email:H.string().required(e("onboarding.errorMessage.requiredEmail")).email(e("onboarding.errorMessage.invalidEmail")).default(""),address:H.mixed().required(e("onboarding.similac.address.error")),term:H.bool().oneOf([!0],e("onboarding.similac.term.error"))});var ie=n(((t,n)=>{var{inputOrder:a,onSubmit:i,validateSchema:l,defaultValues:s,isActive:m,customTerms:u,customFormTexts:g}=t,b=d(t,["inputOrder","onSubmit","validateSchema","defaultValues","isActive","customTerms","customFormTexts"]);const{nextStep:h,setSharedData:E,sharedData:f}=r(J),{t:L}=D(),v=ee({initialValues:{term:!1,phone:(null==f?void 0:f.phone)||(null==s?void 0:s.phone)||"",email:(null==f?void 0:f.email)||(null==s?void 0:s.email)||"",name:(null==f?void 0:f.name)||(null==s?void 0:s.name)||""},validate:l||V(ae(L))}),C=e=>c(void 0,void 0,void 0,(function*(){try{yield null==i?void 0:i(e),E((t=>Object.assign(Object.assign({},t),{phone:e.phone,email:e.email,name:e.name}))),h()}catch(e){console.error(e)}})),x=e=>{console.log(e)},w=()=>{var e;return null===(e=v.onSubmit(C,x))||void 0===e?void 0:e()};return o(n,(()=>({submitForm:w}))),e.createElement(p,Object.assign({"data-active":m},b),e.createElement(p,{sx:e=>({display:"flex",flexDirection:"column",gap:"16px",[e.fn.largerThan("md")]:{gap:"24px"}})},e.createElement(p,{sx:{textAlign:"center"}},e.createElement(O,{tag:"h4",as:"h2"},null==g?void 0:g.heading),e.createElement(y,{size:"p3"},null==g?void 0:g.description)),e.createElement(Q,{form:v},e.createElement("form",{className:"friso-form",style:{width:"100%"},onSubmit:v.onSubmit(C,x)},e.createElement(p,{sx:{".friso-form":{display:"flex",flexWrap:"wrap",gap:"8px",".input-control":{width:"100%",marginBottom:0},".phone-input":{marginBottom:"0 !important",".PhoneInput":{marginBottom:"0 !important"}}}}},e.createElement(oe,{inputOrder:a,customTerms:u,className:"friso-form"}))))))}));const le=F.div`
19
19
  position: fixed;
20
20
  inset: 0;
21
21
  z-index: 1000;
package/build/esm/pwg.js CHANGED
@@ -1,4 +1,4 @@
1
- import e,{useMemo as t,useState as r,useRef as l}from"react";import{M as a,a as o}from"./index-9be09e75.js";import{T as n}from"./index-141e9ea9.js";import{P as i}from"./index-962b7a5b.js";import{u as s}from"./useTranslations-f4ad49b0.js";import{t as c}from"./theme-4693e886.js";import{ResponsiveContainer as m,AreaChart as d,CartesianGrid as p,Tooltip as g,XAxis as y,YAxis as u,Area as b,ReferenceDot as f}from"recharts";import{C as h}from"./index-1a06fbf0.js";import{a as x}from"./useOutsideClick-57718e03.js";import E from"styled-components";import{_ as k}from"./tslib.es6-566e140f.js";import"./index.styled-d8afff19.js";import"./Onboarding-01e65da4.js";import"./index.styled-5bf0b683.js";import"./gAssets.js";import"./index-0e921413.js";import"date-fns/locale";import"./isProduction-ed27c0ed.js";import"./index-567513ac.js";import"@mantine/carousel";import"@mantine/core";import"@mantine/hooks";import"./translationsContext-d8467494.js";import"string-format";const w=t=>{const{x:r,y:l,payload:a,activeWeek:o}=t;return o===a.value?e.createElement("g",{transform:`translate(${r},${l})`},e.createElement("circle",{r:12,fill:"marryBaby"===t.siteType?c.mbColors.pink:c.colors.primaryBase}),e.createElement("text",{textAnchor:"middle",alignmentBaseline:"central",fill:c.colors.white,fontFamily:"Inter",fontWeight:"600",fontSize:"12px"},a.value)):e.createElement("g",{transform:`translate(${r},${l})`},e.createElement("text",{textAnchor:"middle",alignmentBaseline:"central",fill:c.colors.gray600,fontFamily:"Inter",fontWeight:"400",fontSize:"12px"},a.value))},v=E.div`
1
+ import e,{useMemo as t,useState as r,useRef as l}from"react";import{M as a,a as o}from"./index-6566aa80.js";import{T as n}from"./index-944f9cc1.js";import{P as i}from"./index-16c50e5d.js";import{u as c}from"./useTranslations-2845154d.js";import{t as s}from"./theme-6fcfd4c3.js";import{ResponsiveContainer as m,AreaChart as d,CartesianGrid as p,Tooltip as g,XAxis as y,YAxis as u,Area as b,ReferenceDot as h}from"recharts";import{C as x}from"./index-4f5d9780.js";import{a as f}from"./useOutsideClick-143b165c.js";import E from"styled-components";import{_ as k}from"./tslib.es6-dc24c862.js";import"./index.styled-d0d52bd5.js";import"./Onboarding-5b53ad56.js";import"./index.styled-aac39d78.js";import"./gAssets.js";import"./index-a71fd684.js";import"date-fns/locale";import"./isProduction-dd524cb4.js";import"./index-e85333e4.js";import"@mantine/carousel";import"@mantine/core";import"@mantine/hooks";import"./translationsContext-5c973874.js";import"string-format";const w=t=>{const{x:r,y:l,payload:a,activeWeek:o}=t;return o===a.value?e.createElement("g",{transform:`translate(${r},${l})`},e.createElement("circle",{r:12,fill:"marryBaby"===t.siteType?s.mbColors.pink:s.colors.primaryBase}),e.createElement("text",{textAnchor:"middle",alignmentBaseline:"central",fill:s.colors.white,fontFamily:"Inter",fontWeight:"600",fontSize:"12px"},a.value)):e.createElement("g",{transform:`translate(${r},${l})`},e.createElement("text",{textAnchor:"middle",alignmentBaseline:"central",fill:s.colors.gray600,fontFamily:"Inter",fontWeight:"400",fontSize:"12px"},a.value))},v=E.div`
2
2
  /* position: absolute; */
3
3
  display: flex;
4
4
  flex-direction: column;
@@ -18,7 +18,7 @@ import e,{useMemo as t,useState as r,useRef as l}from"react";import{M as a,a as
18
18
  display: flex;
19
19
  align-items: center;
20
20
  padding: 4px 8px;
21
- background: ${c.colors.yellow600};
21
+ background: ${s.colors.yellow600};
22
22
  border-radius: 3px;
23
23
  } */
24
24
  & > * {
@@ -55,14 +55,14 @@ import e,{useMemo as t,useState as r,useRef as l}from"react";import{M as a,a as
55
55
  align-items: center;
56
56
  gap: 4px;
57
57
  }
58
- `,T=[{name:"overweight",backgroundColor:c.colors.yellow50,color:c.colors.yellow900},{name:"underweight",backgroundColor:c.colors.yellow50,color:c.colors.yellow900},{name:"healthy",backgroundColor:c.colors.green50,color:c.colors.green900}],B=r=>{var l,a,o,i,s;const{payload:m,active:d}=r,p=null===(l=null==m?void 0:m[0])||void 0===l?void 0:l.payload;if(!p||!p.toolTipLabel||!d)return null;const{backgroundColor:g,color:y}=t((()=>T.find((e=>e.name===p.status))),[null==p?void 0:p.status]);return e.createElement(v,null,e.createElement("div",null,null===(a=p.toolTipLabel)||void 0===a?void 0:a[0]," ",null===(o=p.toolTipLabel)||void 0===o?void 0:o[1]),e.createElement("div",null,(null===(i=p.toolTipLabel)||void 0===i?void 0:i[2])&&e.createElement(n,{as:"span",size:"s3",color:c.colors.gray800,type:"semiBold"},null===(s=p.toolTipLabel)||void 0===s?void 0:s[2]),e.createElement("div",{className:"risk",style:{backgroundColor:g}},e.createElement(n,{size:"n1",color:y},p.translatedStatus))))},W=({weightByWeek:e,weightBefore:t,toolTipLabel:r,status:l,activeWeek:a,t:o})=>{const n=o(`bmi.result.${l}`);return e.map((e=>Object.assign({name:e.week,min:t+e.min,difference:e.max-e.min,max:t+e.max},e.week===a?{toolTipLabel:r,translatedStatus:n,status:l}:{})))},z=({weightBefore:o,weightByWeek:i,activeWeek:E,currentWeight:k,toolTipLabel:v=[],status:C,withLine:T=!1,siteType:z})=>{const{t:L}=s(),S="marryBaby"===z,O=t((()=>W({weightByWeek:i,weightBefore:o,toolTipLabel:v,status:C,activeWeek:E,t:L})),[i,o,v,C,E]),[F,I]=r(!1),M=l(null);return x(M,(()=>I(!1))),e.createElement(j,null,S?e.createElement(a,{type:"bodytext-3",color:c.mbColors.dark}," ",L("babyGrowth.weight")," ",L("pregnancyWeightGain.weightInput.desc")):e.createElement(n,{size:"n1",color:c.colors.gray500},L("babyGrowth.weight")," ",L("pregnancyWeightGain.weightInput.desc")),Array.isArray(O)&&O.length>0&&e.createElement(j,null,e.createElement(m,{height:388,className:"chart"},e.createElement(d,{data:O,margin:{top:16,right:0,left:0}},e.createElement(p,{stroke:c.colors.neutral100}),e.createElement(g,{trigger:"click",content:t=>e.createElement(B,Object.assign({active:!T&&F&&void 0!==E&&void 0!==k},t))}),e.createElement(y,{type:"number",scale:"linear",ticks:Array.from({length:40},((e,t)=>t+1)),dataKey:"name",tickLine:!1,tickMargin:12,tick:t=>e.createElement(w,Object.assign({},t,{activeWeek:E,siteType:z})),domain:["dataMin","dataMax"],interval:"preserveStartEnd",tickCount:1,allowDecimals:!1}),e.createElement(u,{domain:[e=>Math.max(e,o-10||e),e=>Math.max(e,o+20||e)],type:"number",scale:"auto",interval:"preserveStartEnd",tickLine:!1,tickMargin:7,width:45,tickCount:10,allowDecimals:!0,tickFormatter:e=>String(Math.round(100*(e+Number.EPSILON))/100),tick:{fontFamily:"Inter",fontWeight:400,fontSize:12,color:c.colors.gray600}}),e.createElement(b,{connectNulls:!0,type:"monotone",dataKey:"min",stackId:"1",stroke:"transparent",fill:"transparent"}),e.createElement(b,{connectNulls:!0,type:"monotone",dataKey:"difference",stackId:"1",stroke:"transparent",fill:S?c.mbColors.tonePink:c.colors.primary100}),void 0!==E&&void 0!==k&&e.createElement(f,{onClick:()=>I(!0),x:0===E?1:E,y:k,r:4,shape:e.createElement(h,{ref:M,r:4}),fill:S?c.mbColors.pink:c.colors.primaryBase,stroke:S?c.mbColors.pink:c.colors.primaryBase}))),e.createElement("div",{className:"custom-chart-label"},e.createElement("i",null),S?e.createElement(a,{type:"bodytext-3",color:c.mbColors.dark},L("pregnancy.week")):e.createElement(n,{size:"n1",color:c.colors.gray500},L("pregnancy.week")))))},L=t=>{var{color:r}=t,l=k(t,["color"]);return e.createElement("svg",Object.assign({width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l),e.createElement("circle",{cx:"4",cy:"4",r:"4",fill:r||c.colors.primaryBase}))},S=({idealWeight:t,siteType:r})=>{const{t:l}=s(),o="marryBaby"===r;return e.createElement(C,null,e.createElement("div",null,o?e.createElement(e.Fragment,null,e.createElement(L,{color:c.mbColors.lightPink}),e.createElement(a,{type:"bodytext-3",color:c.mbColors.dark},l("pregnancyTool.weightSuggested")," ",e.createElement(n,{size:"n1",color:c.colors.gray800,type:"bold",as:"span"},t))):e.createElement(e.Fragment,null,e.createElement(L,{color:c.colors.primary100}),e.createElement(n,{size:"n1",color:c.colors.gray600},e.createElement(n,{size:"n1",as:"span"},l("pregnancyTool.weightSuggested")," "),e.createElement(n,{size:"n1",color:c.colors.gray800,type:"bold",as:"span"},t)))),e.createElement("div",null,o?e.createElement(e.Fragment,null,e.createElement(L,{color:c.mbColors.pink}),e.createElement(a,{type:"bodytext-3",color:c.mbColors.dark},l("pwg.placeholder.weight"))):e.createElement(e.Fragment,null,e.createElement(L,null),e.createElement(n,{size:"n1",color:c.colors.gray600},l("pwg.placeholder.weight")))))},O=E.div`
58
+ `,T=[{name:"overweight",backgroundColor:s.colors.yellow50,color:s.colors.yellow900},{name:"underweight",backgroundColor:s.colors.yellow50,color:s.colors.yellow900},{name:"healthy",backgroundColor:s.colors.green50,color:s.colors.green900}],B=r=>{var l,a,o,i,c;const{payload:m,active:d}=r,p=null===(l=null==m?void 0:m[0])||void 0===l?void 0:l.payload;if(!p||!p.toolTipLabel||!d)return null;const{backgroundColor:g,color:y}=t((()=>T.find((e=>e.name===p.status))),[null==p?void 0:p.status]);return e.createElement(v,null,e.createElement("div",null,null===(a=p.toolTipLabel)||void 0===a?void 0:a[0]," ",null===(o=p.toolTipLabel)||void 0===o?void 0:o[1]),e.createElement("div",null,(null===(i=p.toolTipLabel)||void 0===i?void 0:i[2])&&e.createElement(n,{as:"span",size:"s3",color:s.colors.gray800,type:"semiBold"},null===(c=p.toolTipLabel)||void 0===c?void 0:c[2]),e.createElement("div",{className:"risk",style:{backgroundColor:g}},e.createElement(n,{size:"n1",color:y},p.translatedStatus))))},W=({weightByWeek:e,weightBefore:t,toolTipLabel:r,status:l,activeWeek:a,t:o})=>{const n=o(`bmi.result.${l}`);return e.map((e=>Object.assign({name:e.week,min:t+e.min,difference:e.max-e.min,max:t+e.max},e.week===a?{toolTipLabel:r,translatedStatus:n,status:l}:{})))},z=({weightBefore:o,weightByWeek:i,activeWeek:E,currentWeight:k,toolTipLabel:v=[],status:C,withLine:T=!1,siteType:z})=>{const{t:L}=c(),S="marryBaby"===z,O=t((()=>W({weightByWeek:i,weightBefore:o,toolTipLabel:v,status:C,activeWeek:E,t:L})),[i,o,v,C,E]),[F,I]=r(!1),M=l(null);return f(M,(()=>I(!1))),e.createElement(j,null,S?e.createElement(a,{type:"bodytext-3",color:s.mbColors.dark}," ",L("babyGrowth.weight")," ",L("pregnancyWeightGain.weightInput.desc")):e.createElement(n,{size:"n1",color:s.colors.gray500},L("babyGrowth.weight")," ",L("pregnancyWeightGain.weightInput.desc")),Array.isArray(O)&&O.length>0&&e.createElement(j,null,e.createElement(m,{height:388,className:"chart"},e.createElement(d,{data:O,margin:{top:16,right:0,left:0}},e.createElement(p,{stroke:s.colors.neutral100}),e.createElement(g,{trigger:"click",content:t=>e.createElement(B,Object.assign({active:!T&&F&&void 0!==E&&void 0!==k},t))}),e.createElement(y,{type:"number",scale:"linear",ticks:Array.from({length:40},((e,t)=>t+1)),dataKey:"name",tickLine:!1,tickMargin:12,tick:t=>e.createElement(w,Object.assign({},t,{activeWeek:E,siteType:z})),domain:["dataMin","dataMax"],interval:"preserveStartEnd",tickCount:1,allowDecimals:!1}),e.createElement(u,{domain:[e=>Math.max(e,o-10||e),e=>Math.max(e,o+20||e)],type:"number",scale:"auto",interval:"preserveStartEnd",tickLine:!1,tickMargin:7,width:45,tickCount:10,allowDecimals:!0,tickFormatter:e=>String(Math.round(100*(e+Number.EPSILON))/100),tick:{fontFamily:"Inter",fontWeight:400,fontSize:12,color:s.colors.gray600}}),e.createElement(b,{connectNulls:!0,type:"monotone",dataKey:"min",stackId:"1",stroke:"transparent",fill:"transparent"}),e.createElement(b,{connectNulls:!0,type:"monotone",dataKey:"difference",stackId:"1",stroke:"transparent",fill:S?s.mbColors.tonePink:s.colors.primary100}),void 0!==E&&void 0!==k&&e.createElement(h,{onClick:()=>I(!0),x:0===E?1:E,y:k,r:4,shape:e.createElement(x,{ref:M,r:4}),fill:S?s.mbColors.pink:s.colors.primaryBase,stroke:S?s.mbColors.pink:s.colors.primaryBase}))),e.createElement("div",{className:"custom-chart-label"},e.createElement("i",null),S?e.createElement(a,{type:"bodytext-3",color:s.mbColors.dark},L("pregnancy.week")):e.createElement(n,{size:"n1",color:s.colors.gray500},L("pregnancy.week")))))},L=t=>{var{color:r}=t,l=k(t,["color"]);return e.createElement("svg",Object.assign({width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l),e.createElement("circle",{cx:"4",cy:"4",r:"4",fill:r||s.colors.primaryBase}))},S=({idealWeight:t,siteType:r})=>{const{t:l}=c(),o="marryBaby"===r;return e.createElement(C,null,e.createElement("div",null,o?e.createElement(e.Fragment,null,e.createElement(L,{color:s.mbColors.lightPink}),e.createElement(a,{type:"bodytext-3",color:s.mbColors.dark},l("pregnancyTool.weightSuggested")," ",e.createElement(n,{size:"n1",color:s.colors.gray800,type:"bold",as:"span"},t))):e.createElement(e.Fragment,null,e.createElement(L,{color:s.colors.primary100}),e.createElement(n,{size:"n1",color:s.colors.gray600},e.createElement(n,{size:"n1",as:"span"},l("pregnancyTool.weightSuggested")," "),e.createElement(n,{size:"n1",color:s.colors.gray800,type:"bold",as:"span"},t)))),e.createElement("div",null,o?e.createElement(e.Fragment,null,e.createElement(L,{color:s.mbColors.pink}),e.createElement(a,{type:"bodytext-3",color:s.mbColors.dark},l("pwg.placeholder.weight"))):e.createElement(e.Fragment,null,e.createElement(L,null),e.createElement(n,{size:"n1",color:s.colors.gray600},l("pwg.placeholder.weight")))))},O=E.div`
59
59
  display: flex;
60
60
  flex-direction: column;
61
61
  align-items: center;
62
62
  padding: 24px 16px;
63
63
  width: 100%;
64
64
  gap: 24px;
65
- border: 1px solid ${c.colors.neutral100};
65
+ border: 1px solid ${s.colors.neutral100};
66
66
  border-radius: 8px;
67
67
  .chart-header {
68
68
  text-align: center;
@@ -70,4 +70,4 @@ import e,{useMemo as t,useState as r,useRef as l}from"react";import{M as a,a as
70
70
  > div {
71
71
  width: 100%;
72
72
  }
73
- `,F=({chartProps:t,pillCarouselProps:r,idealWeight:l,description:a,siteType:m})=>{const{t:d}=s(),p="marryBaby"===m;return e.createElement(O,null,e.createElement("div",{className:"chart-header"},p?e.createElement(o,{type:"h3",color:c.mbColors.dark},d("pregnancyTool.weightSuggested")):e.createElement(n,{size:"s1",type:"semiBold",color:c.colors.gray800},d("pregnancyTool.weightSuggested")),a&&a),e.createElement(i,Object.assign({},r)),e.createElement("div",null,e.createElement(S,{idealWeight:l,siteType:m}),e.createElement(z,Object.assign({},t,{siteType:m}))))};export{F as PregnancyWeightGainChart};
73
+ `,F=({chartProps:t,pillCarouselProps:r,idealWeight:l,description:a,siteType:m})=>{const{t:d}=c(),p="marryBaby"===m;return e.createElement(O,null,e.createElement("div",{className:"chart-header"},p?e.createElement(o,{type:"h3",color:s.mbColors.dark},d("pregnancyTool.weightSuggested")):e.createElement(n,{size:"s1",type:"semiBold",color:s.colors.gray800},d("pregnancyTool.weightSuggested")),a&&a),e.createElement(i,Object.assign({},r)),e.createElement("div",null,e.createElement(S,{idealWeight:l,siteType:m}),e.createElement(z,Object.assign({},t,{siteType:m}))))};export{F as PregnancyWeightGainChart};
@@ -1 +1 @@
1
- import{d as e}from"./index-0e921413.js";import{i as s}from"./isProduction-ed27c0ed.js";const t=(t,o)=>{if("undefined"!=typeof window)return window.location.origin;const r="development"===process.env.NEXT_PUBLIC_DEPLOY_ENV;return r?"http://localhost:3000":`https://${!r&&!s?o?"fe.":"discover.":o?"www.":""}${e[o?"vi-VN_MB":t]}`},o=(t,o)=>process.env.UNIFY_SSO_API||`https://${s?"id.":"staging-id."}${e[o?"vi-VN_MB":t]}`,r=()=>process.env.UNIFY_INTERNAL_TOGETHER_API||process.env.UNIFY_TOGETHER_API||`https://${s?"together.":"staging-together."}hellohealthgroup.com`,n=t=>process.env.UNIFY_DISCOVER_API||`https://${s?"wp.":"staging."}${e[t]}`,i=()=>process.env.UNIFY_INTERNAL_CARE_API||process.env.UNIFY_CARE_API||`https://${s?"health-care.":"service-health-care."}hellohealthgroup.com`;export{o as a,r as b,n as c,i as d,t as g};
1
+ import{d as e}from"./index-a71fd684.js";import{i as s}from"./isProduction-dd524cb4.js";const t=(t,o)=>{if("undefined"!=typeof window)return window.location.origin;const r="development"===process.env.NEXT_PUBLIC_DEPLOY_ENV;return r?"http://localhost:3000":`https://${!r&&!s?o?"fe.":"discover.":o?"www.":""}${e[o?"vi-VN_MB":t]}`},o=(t,o)=>process.env.UNIFY_SSO_API||`https://${s?"id.":"staging-id."}${e[o?"vi-VN_MB":t]}`,r=()=>process.env.UNIFY_INTERNAL_TOGETHER_API||process.env.UNIFY_TOGETHER_API||`https://${s?"together.":"staging-together."}hellohealthgroup.com`,n=t=>process.env.UNIFY_DISCOVER_API||`https://${s?"wp.":"staging."}${e[t]}`,i=()=>process.env.UNIFY_INTERNAL_CARE_API||process.env.UNIFY_CARE_API||`https://${s?"health-care.":"service-health-care."}hellohealthgroup.com`;export{o as a,r as b,n as c,i as d,t as g};
@@ -1,4 +1,4 @@
1
- import{keyframes as t}from"styled-components";import r,{createContext as i,useState as s,useEffect as a,useMemo as n}from"react";import e from"lodash/throttle";import{B as o}from"./utils-807f25d6.js";const d=t`
1
+ import{keyframes as t}from"styled-components";import r,{createContext as i,useState as s,useEffect as a,useMemo as n}from"react";import e from"lodash/throttle";import{B as o}from"./utils-0112af9f.js";const d=t`
2
2
  from {
3
3
  transform: translate3d(0, 100%, 0);
4
4
  visibility: visible;
@@ -1 +1 @@
1
- export{g as CardAuthor,C as CardLink,D as CardPost,E as CardPostPopoverMore,b as CardReactions,F as CardReply,G as CardReplyPopover,h as CreateNewPostContent,i as CreatePostDescription,j as CreatePostTitle,s as ImagePreviewPopup,I as InputCommentBar,e as LabelPin,d as LabelSortPin,f as LabelSorting,L as Loading,H as PopoverMenu,P as PopupDanger,l as PopupDoctor,k as PopupExpert,o as PopupFrame,m as PopupHospital,r as PostContent,w as PostImagePreview,v as PostSingleImageViewPopup,z as ProfileDetail,y as ProfileDetailModal,q as ShareBox,S as SharePopup,B as SkipQuestionOfExpertBtn,x as SocialLinkPreview,J as SourceList,p as SubmitReportForm,A as TabNameInProfileDetail,c as TagTopic,T as TogetherAuthConfigContext,a as TogetherAuthConfigContextProvider,t as TogetherTypes,n as TopicSelectList,V as VerifiedTag,u as useTogetherAuthRequiredAction}from"./types-6d888cb0.js";export{D as DefaultComponentGlobalContextData,G as GlobalData,T as TogetherComponentGlobalContext,a as TogetherComponentGlobalContextProvider,c as TogetherConstants,U as UserAvatar}from"./index.styled-ccda6a6a.js";export{d as TogetherDataTransforms}from"./dataTransform-f50a355c.js";import"./tslib.es6-566e140f.js";import"react";import"@mantine/core";import"./index-1b375a3f.js";import"styled-components";import"./utils-807f25d6.js";import"./index-48429f98.js";import"./gAssets.js";import"./index-0e921413.js";import"date-fns/locale";import"./Onboarding-01e65da4.js";import"./isProduction-ed27c0ed.js";import"./index-3650a52c.js";import"./index.styled-d8afff19.js";import"./index-141e9ea9.js";import"./index-4acb82eb.js";import"./index-78992174.js";import"./theme-4693e886.js";import"./index-eac9c06c.js";import"dayjs";import"./screenSizeContext-fc50587c.js";import"lodash/throttle";import"./useUniqueId-527dc21c.js";import"react-keyed-flatten-children";import"./index-e3a62689.js";import"./index-8e8ef155.js";import"@mantine/carousel";import"@mantine/hooks";import"./translationsContext-d8467494.js";import"string-format";import"./index-1a06fbf0.js";import"@mantine/dates";import"./index-567513ac.js";import"@hookform/resolvers/yup";import"react-hook-form";import"./index-75a7ddcb.js";import"./useTranslations-f4ad49b0.js";import"./index-9be09e75.js";import"date-fns";import"./index-453997c8.js";import"./types-88f7f8c1.js";import"react-day-picker/DayPickerInput";import"lodash/debounce";import"innertext";import"./index-0ed1f8c1.js";import"react-contenteditable";import"./cookieHelper-584dbd8d.js";import"react-dom";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-5bf0b683.js";import"uuid";import"./utils-4d51e270.js";import"dayjs/plugin/relativeTime";import"./index-b1f1a90b.js";import"./routing-255a493e.js";import"slugify";
1
+ export{g as CardAuthor,C as CardLink,D as CardPost,E as CardPostPopoverMore,b as CardReactions,F as CardReply,G as CardReplyPopover,h as CreateNewPostContent,i as CreatePostDescription,j as CreatePostTitle,s as ImagePreviewPopup,I as InputCommentBar,e as LabelPin,d as LabelSortPin,f as LabelSorting,L as Loading,H as PopoverMenu,P as PopupDanger,l as PopupDoctor,k as PopupExpert,o as PopupFrame,m as PopupHospital,r as PostContent,w as PostImagePreview,v as PostSingleImageViewPopup,z as ProfileDetail,y as ProfileDetailModal,q as ShareBox,S as SharePopup,B as SkipQuestionOfExpertBtn,x as SocialLinkPreview,J as SourceList,p as SubmitReportForm,A as TabNameInProfileDetail,c as TagTopic,T as TogetherAuthConfigContext,a as TogetherAuthConfigContextProvider,t as TogetherTypes,n as TopicSelectList,V as VerifiedTag,u as useTogetherAuthRequiredAction}from"./types-086f29d8.js";export{D as DefaultComponentGlobalContextData,G as GlobalData,T as TogetherComponentGlobalContext,a as TogetherComponentGlobalContextProvider,c as TogetherConstants,U as UserAvatar}from"./index.styled-4e818009.js";export{d as TogetherDataTransforms}from"./dataTransform-e0fa829b.js";import"./tslib.es6-dc24c862.js";import"react";import"@mantine/core";import"./index-ef24366b.js";import"styled-components";import"./utils-0112af9f.js";import"./index-0fe39c19.js";import"./gAssets.js";import"./index-a71fd684.js";import"date-fns/locale";import"./Onboarding-5b53ad56.js";import"./isProduction-dd524cb4.js";import"./index-6221b00b.js";import"./index.styled-d0d52bd5.js";import"./index-944f9cc1.js";import"./index-889037d3.js";import"./index-0ca1bc0a.js";import"./theme-6fcfd4c3.js";import"./index-2d21fd23.js";import"dayjs";import"./screenSizeContext-62d9d281.js";import"lodash/throttle";import"./useUniqueId-6c3e7337.js";import"react-keyed-flatten-children";import"./index-77902827.js";import"./index-f5615fc6.js";import"@mantine/carousel";import"@mantine/hooks";import"./translationsContext-5c973874.js";import"string-format";import"./index-4f5d9780.js";import"@mantine/dates";import"./index-e85333e4.js";import"@hookform/resolvers/yup";import"react-hook-form";import"./index-3a1ead00.js";import"./useTranslations-2845154d.js";import"./index-6566aa80.js";import"date-fns";import"./index-ae5920de.js";import"./types-5d9969c0.js";import"react-day-picker/DayPickerInput";import"lodash/debounce";import"innertext";import"./index-b56095b8.js";import"react-contenteditable";import"./cookieHelper-f51a61f7.js";import"react-dom";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-aac39d78.js";import"uuid";import"./utils-d648625a.js";import"dayjs/plugin/relativeTime";import"./index-6738ea8d.js";import"./routing-8332d7bd.js";import"slugify";
@@ -1,4 +1,4 @@
1
- import{a as e,_ as t}from"./tslib.es6-566e140f.js";import*as a from"react";import o,{createContext as n,useContext as i,useState as l,useRef as r,useEffect as s,useMemo as c,useCallback as d}from"react";import{useMantineTheme as m,createStyles as p,Flex as u,Checkbox as g,Portal as v,Anchor as h,Accordion as b,Popover as f}from"@mantine/core";import{a as y}from"./index-1b375a3f.js";import{u as w}from"./useTranslations-f4ad49b0.js";import x from"innertext";import{t as E}from"./theme-4693e886.js";import{H as C,Q as k,I as N,R as A,U as T,E as P,V as I,W as S,X as z}from"./index-78992174.js";import"@mantine/hooks";import{CommonGAssets as L}from"./gAssets.js";import"@mantine/dates";import{D as M,d as j}from"./index-0e921413.js";import"./Onboarding-01e65da4.js";import{e as B,B as F,A as O,k as V}from"./index-8e8ef155.js";import R from"dayjs";import"./screenSizeContext-fc50587c.js";import D,{keyframes as U,css as W}from"styled-components";import{M as H,t as Z,c as q,a as _}from"./utils-807f25d6.js";import"./isProduction-ed27c0ed.js";import"./index-567513ac.js";import{T as G,au as Q,av as X,aw as K,ax as $,ay as Y,az as J,aA as ee,U as te,aB as ae,aC as oe,aD as ne,aE as ie,aF as le,aG as re,aH as se,aI as ce,aJ as de,aK as me,aL as pe,aM as ue,aN as ge,aO as ve,aP as he}from"./index.styled-ccda6a6a.js";import{I as be,A as fe,B as ye,D as we}from"./index-0ed1f8c1.js";import{e as xe,c as Ee,P as Ce,g as ke,b as Ne,h as Ae,i as Te}from"./dataTransform-f50a355c.js";import{T as Pe}from"./index-141e9ea9.js";import{I as Ie}from"./index-e3a62689.js";import Se from"lodash/debounce";import ze from"react-contenteditable";import{B as Le}from"./index-4acb82eb.js";import{d as Me,g as je}from"./cookieHelper-584dbd8d.js";import*as Be from"react-dom";import{I as Fe}from"./index.styled-d8afff19.js";import"./index-eac9c06c.js";import"./index-3650a52c.js";import"./index-1a06fbf0.js";import{format as Oe}from"date-fns";import"react-day-picker/DayPickerInput";import"./index-75a7ddcb.js";import"lodash/throttle";import"./types-88f7f8c1.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-5bf0b683.js";import"uuid";import"./utils-4d51e270.js";import"string-format";import Ve from"dayjs/plugin/relativeTime";import{M as Re}from"./index-b1f1a90b.js";import{a as De}from"./useUniqueId-527dc21c.js";import"./translationsContext-d8467494.js";import{g as Ue}from"./routing-255a493e.js";const We=e=>a.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},e),a.createElement("path",{d:"M3.99403 3.32695C3.86141 3.32698 3.73181 3.36657 3.62181 3.44065C3.5118 3.51472 3.42638 3.61992 3.37648 3.7428C3.32658 3.86567 3.31445 4.00064 3.34165 4.13044C3.36885 4.26024 3.43415 4.37898 3.52919 4.47148L7.05784 8.00013L3.52919 11.5288C3.46521 11.5902 3.41413 11.6638 3.37894 11.7452C3.34375 11.8266 3.32516 11.9142 3.32425 12.0029C3.32335 12.0916 3.34015 12.1796 3.37368 12.2617C3.40721 12.3438 3.45678 12.4185 3.5195 12.4812C3.58222 12.5439 3.65682 12.5935 3.73894 12.627C3.82106 12.6605 3.90904 12.6773 3.99774 12.6764C4.08643 12.6755 4.17405 12.6569 4.25547 12.6217C4.33689 12.5865 4.41047 12.5355 4.4719 12.4715L8.00054 8.94283L11.5292 12.4715C11.5906 12.5355 11.6642 12.5865 11.7456 12.6217C11.827 12.6569 11.9147 12.6755 12.0034 12.6764C12.092 12.6773 12.18 12.6605 12.2621 12.627C12.3443 12.5935 12.4189 12.5439 12.4816 12.4812C12.5443 12.4185 12.5939 12.3439 12.6274 12.2617C12.6609 12.1796 12.6777 12.0916 12.6768 12.0029C12.6759 11.9142 12.6573 11.8266 12.6222 11.7452C12.587 11.6638 12.5359 11.5902 12.4719 11.5288L8.94325 8.00013L12.4719 4.47148C12.5682 4.37784 12.634 4.25728 12.6607 4.1256C12.6873 3.99392 12.6735 3.85726 12.6212 3.73354C12.5688 3.60982 12.4803 3.5048 12.3672 3.43224C12.2542 3.35969 12.1218 3.32299 11.9875 3.32695C11.8143 3.33211 11.6499 3.4045 11.5292 3.52877L8.00054 7.05742L4.4719 3.52877C4.40977 3.46491 4.33548 3.41415 4.2534 3.37948C4.17132 3.34482 4.08313 3.32696 3.99403 3.32695Z"})),He=n({}),Ze=({children:e,defaultParams:t})=>o.createElement(He.Provider,{value:{defaultParams:t}},e),qe=e=>{const{data:{userInfo:t,env:{togetherBasePath:a}}}=i(G),{defaultParams:o}=i(He)||{},n=null==t?void 0:t.id,l=t&&"number"==typeof t.communities_interacted&&0===t.communities_interacted;return{authActionWrapper:(t,i)=>{const r=Object.assign(Object.assign(Object.assign({},o),e),i);if(!n||l){n||Me(Q),(null==r?void 0:r._joinCommunityIds)&&(localStorage.setItem("to_join_community_ids",JSON.stringify(Array.from(new Set((JSON.parse(localStorage.getItem("to_join_community_ids")||"[]")||[]).concat(r._joinCommunityIds).filter(Boolean))))),null==r||delete r._joinCommunityIds),(null==r?void 0:r._joinTopicIds)&&(localStorage.setItem("to_join_topic_ids",JSON.stringify(Array.from(new Set((JSON.parse(localStorage.getItem("to_join_topic_ids")||"[]")||[]).concat(r._joinTopicIds).filter(Boolean))))),null==r||delete r._joinTopicIds);const e=(null==r?void 0:r._location)||window.location.href;return null==r||delete r._location,window.location.href=X(e,r,a),null}return t&&t()},params:Object.assign(Object.assign({},o),e)}},_e=D.div`
1
+ import{a as e,_ as t}from"./tslib.es6-dc24c862.js";import*as a from"react";import o,{createContext as n,useContext as i,useState as l,useRef as r,useEffect as s,useMemo as c,useCallback as d}from"react";import{useMantineTheme as m,createStyles as p,Flex as u,Checkbox as g,Portal as v,Anchor as h,Accordion as b,Popover as f}from"@mantine/core";import{a as y}from"./index-ef24366b.js";import{u as w}from"./useTranslations-2845154d.js";import x from"innertext";import{t as E}from"./theme-6fcfd4c3.js";import{H as C,Q as k,I as N,R as A,U as T,E as P,V as I,W as S,X as z}from"./index-0ca1bc0a.js";import"@mantine/hooks";import{CommonGAssets as L}from"./gAssets.js";import"@mantine/dates";import{D as M,d as j}from"./index-a71fd684.js";import"./Onboarding-5b53ad56.js";import{e as B,B as F,A as O,k as V}from"./index-f5615fc6.js";import R from"dayjs";import"./screenSizeContext-62d9d281.js";import D,{keyframes as U,css as W}from"styled-components";import{M as H,t as Z,c as q,a as _}from"./utils-0112af9f.js";import"./isProduction-dd524cb4.js";import"./index-e85333e4.js";import{T as G,au as Q,av as X,aw as K,ax as $,ay as Y,az as J,aA as ee,U as te,aB as ae,aC as oe,aD as ne,aE as ie,aF as le,aG as re,aH as se,aI as ce,aJ as de,aK as me,aL as pe,aM as ue,aN as ge,aO as ve,aP as he}from"./index.styled-4e818009.js";import{I as be,A as fe,B as ye,D as we}from"./index-b56095b8.js";import{e as xe,c as Ee,P as Ce,g as ke,b as Ne,h as Ae,i as Te}from"./dataTransform-e0fa829b.js";import{T as Pe}from"./index-944f9cc1.js";import{I as Ie}from"./index-77902827.js";import Se from"lodash/debounce";import ze from"react-contenteditable";import{B as Le}from"./index-889037d3.js";import{d as Me,g as je}from"./cookieHelper-f51a61f7.js";import*as Be from"react-dom";import{I as Fe}from"./index.styled-d0d52bd5.js";import"./index-2d21fd23.js";import"./index-6221b00b.js";import"./index-4f5d9780.js";import{format as Oe}from"date-fns";import"react-day-picker/DayPickerInput";import"./index-3a1ead00.js";import"lodash/throttle";import"./types-5d9969c0.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-aac39d78.js";import"uuid";import"./utils-d648625a.js";import"string-format";import Ve from"dayjs/plugin/relativeTime";import{M as Re}from"./index-6738ea8d.js";import{a as De}from"./useUniqueId-6c3e7337.js";import"./translationsContext-5c973874.js";import{g as Ue}from"./routing-8332d7bd.js";const We=e=>a.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},e),a.createElement("path",{d:"M3.99403 3.32695C3.86141 3.32698 3.73181 3.36657 3.62181 3.44065C3.5118 3.51472 3.42638 3.61992 3.37648 3.7428C3.32658 3.86567 3.31445 4.00064 3.34165 4.13044C3.36885 4.26024 3.43415 4.37898 3.52919 4.47148L7.05784 8.00013L3.52919 11.5288C3.46521 11.5902 3.41413 11.6638 3.37894 11.7452C3.34375 11.8266 3.32516 11.9142 3.32425 12.0029C3.32335 12.0916 3.34015 12.1796 3.37368 12.2617C3.40721 12.3438 3.45678 12.4185 3.5195 12.4812C3.58222 12.5439 3.65682 12.5935 3.73894 12.627C3.82106 12.6605 3.90904 12.6773 3.99774 12.6764C4.08643 12.6755 4.17405 12.6569 4.25547 12.6217C4.33689 12.5865 4.41047 12.5355 4.4719 12.4715L8.00054 8.94283L11.5292 12.4715C11.5906 12.5355 11.6642 12.5865 11.7456 12.6217C11.827 12.6569 11.9147 12.6755 12.0034 12.6764C12.092 12.6773 12.18 12.6605 12.2621 12.627C12.3443 12.5935 12.4189 12.5439 12.4816 12.4812C12.5443 12.4185 12.5939 12.3439 12.6274 12.2617C12.6609 12.1796 12.6777 12.0916 12.6768 12.0029C12.6759 11.9142 12.6573 11.8266 12.6222 11.7452C12.587 11.6638 12.5359 11.5902 12.4719 11.5288L8.94325 8.00013L12.4719 4.47148C12.5682 4.37784 12.634 4.25728 12.6607 4.1256C12.6873 3.99392 12.6735 3.85726 12.6212 3.73354C12.5688 3.60982 12.4803 3.5048 12.3672 3.43224C12.2542 3.35969 12.1218 3.32299 11.9875 3.32695C11.8143 3.33211 11.6499 3.4045 11.5292 3.52877L8.00054 7.05742L4.4719 3.52877C4.40977 3.46491 4.33548 3.41415 4.2534 3.37948C4.17132 3.34482 4.08313 3.32696 3.99403 3.32695Z"})),He=n({}),Ze=({children:e,defaultParams:t})=>o.createElement(He.Provider,{value:{defaultParams:t}},e),qe=e=>{const{data:{userInfo:t,env:{togetherBasePath:a}}}=i(G),{defaultParams:o}=i(He)||{},n=null==t?void 0:t.id,l=t&&"number"==typeof t.communities_interacted&&0===t.communities_interacted;return{authActionWrapper:(t,i)=>{const r=Object.assign(Object.assign(Object.assign({},o),e),i);if(!n||l){n||Me(Q),(null==r?void 0:r._joinCommunityIds)&&(localStorage.setItem("to_join_community_ids",JSON.stringify(Array.from(new Set((JSON.parse(localStorage.getItem("to_join_community_ids")||"[]")||[]).concat(r._joinCommunityIds).filter(Boolean))))),null==r||delete r._joinCommunityIds),(null==r?void 0:r._joinTopicIds)&&(localStorage.setItem("to_join_topic_ids",JSON.stringify(Array.from(new Set((JSON.parse(localStorage.getItem("to_join_topic_ids")||"[]")||[]).concat(r._joinTopicIds).filter(Boolean))))),null==r||delete r._joinTopicIds);const e=(null==r?void 0:r._location)||window.location.href;return null==r||delete r._location,window.location.href=X(e,r,a),null}return t&&t()},params:Object.assign(Object.assign({},o),e)}},_e=D.div`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
@@ -1,4 +1,4 @@
1
- import{a as e}from"./tslib.es6-566e140f.js";import t,{useState as i,useCallback as o,useMemo as a,useEffect as n,useRef as s,useReducer as r}from"react";import{I as l,L as c,a as d}from"./constants-ee7f773a.js";import{c as h,d as u}from"./index-0e921413.js";import{g as p,s as g,d as m}from"./cookieHelper-584dbd8d.js";import{u as C}from"./useTranslations-f4ad49b0.js";import f from"lodash/debounce";import{I as y}from"./index-e3a62689.js";import v,{createGlobalStyle as b}from"styled-components";import{T as w}from"./index-141e9ea9.js";import{t as E}from"./theme-4693e886.js";import L from"react-loading-skeleton";import{M as x}from"./utils-807f25d6.js";import S from"lodash/shuffle";import{a as k}from"./useOutsideClick-57718e03.js";import O from"string-format";const M=v.div``,j=v.div`
1
+ import{a as e}from"./tslib.es6-dc24c862.js";import t,{useState as i,useCallback as o,useMemo as a,useEffect as n,useRef as s,useReducer as r}from"react";import{I as c,L as l,a as d}from"./constants-c4564b0a.js";import{c as h,d as u}from"./index-a71fd684.js";import{g as p,s as g,d as m}from"./cookieHelper-f51a61f7.js";import{u as C}from"./useTranslations-2845154d.js";import f from"lodash/debounce";import{I as y}from"./index-77902827.js";import v,{createGlobalStyle as b}from"styled-components";import{T as w}from"./index-944f9cc1.js";import{t as E}from"./theme-6fcfd4c3.js";import L from"react-loading-skeleton";import{M as x}from"./utils-0112af9f.js";import S from"lodash/shuffle";import{a as k}from"./useOutsideClick-143b165c.js";import O from"string-format";const M=v.div``,j=v.div`
2
2
  --searchbar-z-index: 305;
3
3
  &[data-is-modal='true'] {
4
4
  position: fixed;
@@ -124,13 +124,13 @@ import{a as e}from"./tslib.es6-566e140f.js";import t,{useState as i,useCallback
124
124
  &:first-child {
125
125
  padding-top: 18px;
126
126
  }
127
- `,_=({cities:e,isLoading:i,onLocationClick:o,onCurrentLocationClick:a,geoLocationPermission:n="unset",isLocationLoading:s,selectedLocation:r,isOptionAllLocation:d})=>{const{t:h,locale:u}=C(),p="denied"===n,g=()=>t.createElement(K,{role:"button",tabIndex:0,onClick:e=>{p||(e.nativeEvent.stopImmediatePropagation(),s||a())},"data-is-denied":p},p?t.createElement(w,{color:"var(--gray600)",size:"md"},"x"):s?t.createElement(L,{height:20,width:20}):t.createElement(T,{color:E.colors.primaryBase}),t.createElement("div",null,p?t.createElement(w,{color:"var(--gray600)",size:"sm",style:{lineHeight:1.5}},h("booking.searchBar.grantLocation")):s?t.createElement(L,{height:20,style:{width:"calc(100% - 16px)"}}):t.createElement(w,{size:"md"},h("booking.searchBar.useCurrentLocation"))));return t.createElement($,{"data-testid":"location-search-results"},t.createElement(z,null,i?t.createElement(Z,{count:5}):!e||e.length<1?t.createElement(t.Fragment,null,g(),t.createElement(K,{"data-is-denied":"true"},t.createElement(w,{size:"sm",color:"#ccc"},h("booking.searchBar.noResults")))):t.createElement(t.Fragment,null,d&&t.createElement(K,{key:"all-location",role:"button",tabIndex:0,onClick:()=>{var e;o&&o({name:h("booking.searchBar.allLocations"),id:l,slug:null===(e=c[u])||void 0===e?void 0:e.ALL})}},t.createElement(D,{color:E.colors.neutral400}),t.createElement(w,{size:"md"},h("booking.searchBar.allLocations"))),g(),e.map((e=>t.createElement(K,{key:e.id,onClick:t=>{t.nativeEvent.stopImmediatePropagation(),o&&o(e)},role:"button",tabIndex:0,"aria-label":`Select ${e.name} as location`,isSelected:(null==r?void 0:r.id)===e.id},t.createElement(D,{color:E.colors.neutral400}),t.createElement(w,{size:"md"},e.name)))))))},G="TYPE_CHARACTER",U="REMOVE_CHARACTER",Q="REMOVE_ALL",Y="REMOVE_LAST_VISIBLE_NODE",q="PAUSE_FOR",W="CHANGE_DELETE_SPEED",J="CHANGE_DELAY",X="PASTE_STRING",ee=(e,t)=>Math.floor(Math.random()*(t-e+1))+e,te="TEXT_NODE";class ie{constructor(e){this.state={lastFrameTime:null,pauseUntil:null,eventQueue:[],eventLoop:null,eventLoopPaused:!1,reverseCalledEvents:[],calledEvents:[],visibleNodes:[],initialOptions:null},this.options={strings:null,delay:"natural",pauseFor:1500,deleteSpeed:"natural",loop:!1,autoStart:!1,stringSplitter:null,onCreateTextNode:null,onRemoveNode:null},this.start=()=>(this.state.eventLoopPaused=!1,this.runEventLoop(),this),this.pause=()=>(this.state.eventLoopPaused=!0,this),this.stop=()=>(this.state.eventLoop&&(window.cancelAnimationFrame(this.state.eventLoop),this.state.eventLoop=null),this),this.pauseFor=e=>(this.addEventToQueue(q,{ms:e}),this),this.typeOutAllStrings=()=>"string"==typeof this.options.strings?(this.typeString(this.options.strings).pauseFor(this.options.pauseFor),this):(this.options.strings.forEach((e=>{this.typeString(e).pauseFor(this.options.pauseFor).deleteAll(this.options.deleteSpeed)})),this),this.typeString=(e,t=null)=>{if(e){const{stringSplitter:i}=this.options||{},o="function"==typeof i?i(e):e.split("");this.typeCharacters(o,t)}return this},this.pasteString=(e,t=null)=>(e&&this.addEventToQueue(X,{character:e,node:t}),this),this.deleteAll=(e="natural")=>(this.addEventToQueue(Q,{speed:e}),this),this.changeDeleteSpeed=e=>{if(!e)throw new Error("Must provide new delete speed");return this.addEventToQueue(W,{speed:e}),this},this.changeDelay=e=>{if(!e)throw new Error("Must provide new delay");return this.addEventToQueue(J,{delay:e}),this},this.deleteChars=e=>{if(!e)throw new Error("Must provide amount of characters to delete");for(let t=0;t<e;t++)this.addEventToQueue(U);return this},this.typeCharacters=(e,t=null)=>{if(!e||!Array.isArray(e))throw new Error("Characters must be an array");return e.forEach((e=>{this.addEventToQueue(G,{character:e,node:t})})),this},this.removeCharacters=e=>{if(!e||!Array.isArray(e))throw new Error("Characters must be an array");return e.forEach((()=>{this.addEventToQueue(U)})),this},this.addEventToQueue=(e,t,i=!1)=>this.addEventToStateProperty(e,t,i,"eventQueue"),this.addReverseCalledEvent=(e,t,i=!1)=>{const{loop:o}=this.options;return o?this.addEventToStateProperty(e,t,i,"reverseCalledEvents"):this},this.addEventToStateProperty=(e,t,i=!1,o)=>{const a={eventName:e,eventArgs:t||{}};return this.state[o]=i?[a,...this.state[o]]:[...this.state[o],a],this},this.runEventLoop=()=>{this.state.lastFrameTime||(this.state.lastFrameTime=Date.now());const e=Date.now(),t=e-this.state.lastFrameTime;if(!this.state.eventQueue.length){if(!this.options.loop)return;this.state.eventQueue=[...this.state.calledEvents],this.state.calledEvents=[],this.options=Object.assign({},this.state.initialOptions)}if(this.state.eventLoop=window.requestAnimationFrame(this.runEventLoop),this.state.eventLoopPaused)return;if(this.state.pauseUntil){if(e<this.state.pauseUntil)return;this.state.pauseUntil=null}const i=[...this.state.eventQueue],o=i.shift();let a=0;if(a=o.eventName===Y||o.eventName===U?"natural"===this.options.deleteSpeed?ee(40,80):this.options.deleteSpeed:"natural"===this.options.delay?ee(120,160):this.options.delay,t<=a)return;const{eventName:n,eventArgs:s}=o;switch(n){case X:case G:{const{character:e}=s,t=document.createTextNode(e);let i=t;this.options.onCreateTextNode&&"function"==typeof this.options.onCreateTextNode&&(i=this.options.onCreateTextNode(e,t)),this.state.visibleNodes=[...this.state.visibleNodes,{type:te,character:e,node:i}];break}case U:i.unshift({eventName:Y,eventArgs:{removingCharacterNode:!0}});break;case q:{const{ms:e}=o.eventArgs;this.state.pauseUntil=Date.now()+parseInt(e);break}case Q:{const{visibleNodes:e}=this.state,{speed:t}=s,o=[];t&&o.push({eventName:W,eventArgs:{speed:t,temp:!0}});for(let t=0,i=e.length;t<i;t++)o.push({eventName:Y,eventArgs:{removingCharacterNode:!1}});t&&o.push({eventName:W,eventArgs:{speed:this.options.deleteSpeed,temp:!0}}),i.unshift(...o);break}case Y:if(this.state.visibleNodes.length){const{node:e,character:t}=this.state.visibleNodes.pop();this.options.onRemoveNode&&"function"==typeof this.options.onRemoveNode&&this.options.onRemoveNode({node:e,character:t}),e&&e.parentNode.removeChild(e)}break;case W:this.options.deleteSpeed=o.eventArgs.speed;break;case J:this.options.delay=o.eventArgs.delay}this.options.loop&&(o.eventName===Y||o.eventArgs&&o.eventArgs.temp||(this.state.calledEvents=[...this.state.calledEvents,o])),this.state.eventQueue=i,this.state.lastFrameTime=e},e&&(this.options=Object.assign(Object.assign({},this.options),e)),this.state.initialOptions=Object.assign({},this.options),this.init()}init(){this.addEventToQueue(Q,null,!0),!0===this.options.autoStart&&this.options.strings&&this.typeOutAllStrings().start()}}function oe({inputRef:e,wrapperRef:t,disabled:i}){const{t:o,locale:s}=C(),r=a((()=>{if(i)return[];const e=["booking.searchBar.placeholder.hospital","booking.searchBar.placeholder.doctor"];return"zh-TW"!==s&&e.push("booking.searchBar.placeholder.specialty","booking.searchBar.placeholder.service"),S(e).map((e=>o(e)))}),[o,s]);function l(e){const t=d();return t&&(t.placeholder=t.placeholder+e),null}function c(){const e=d();e&&(e.placeholder=e.placeholder.slice(0,-1))}function d(){return e&&e.current?e.current:t&&t.current&&t.current.querySelector("input")||null}n((()=>{if(i)return;const e=d();e&&(e.placeholder="",new ie({strings:r,autoStart:!0,loop:!0,delay:32,deleteSpeed:32,pauseFor:1500,onCreateTextNode:l,onRemoveNode:c}))}),[e,t])}const ae=v.div`
127
+ `,_=({cities:e,isLoading:i,onLocationClick:o,onCurrentLocationClick:a,geoLocationPermission:n="unset",isLocationLoading:s,selectedLocation:r,isOptionAllLocation:d})=>{const{t:h,locale:u}=C(),p="denied"===n,g=()=>t.createElement(K,{role:"button",tabIndex:0,onClick:e=>{p||(e.nativeEvent.stopImmediatePropagation(),s||a())},"data-is-denied":p},p?t.createElement(w,{color:"var(--gray600)",size:"md"},"x"):s?t.createElement(L,{height:20,width:20}):t.createElement(T,{color:E.colors.primaryBase}),t.createElement("div",null,p?t.createElement(w,{color:"var(--gray600)",size:"sm",style:{lineHeight:1.5}},h("booking.searchBar.grantLocation")):s?t.createElement(L,{height:20,style:{width:"calc(100% - 16px)"}}):t.createElement(w,{size:"md"},h("booking.searchBar.useCurrentLocation"))));return t.createElement($,{"data-testid":"location-search-results"},t.createElement(z,null,i?t.createElement(Z,{count:5}):!e||e.length<1?t.createElement(t.Fragment,null,g(),t.createElement(K,{"data-is-denied":"true"},t.createElement(w,{size:"sm",color:"#ccc"},h("booking.searchBar.noResults")))):t.createElement(t.Fragment,null,d&&t.createElement(K,{key:"all-location",role:"button",tabIndex:0,onClick:()=>{var e;o&&o({name:h("booking.searchBar.allLocations"),id:c,slug:null===(e=l[u])||void 0===e?void 0:e.ALL})}},t.createElement(D,{color:E.colors.neutral400}),t.createElement(w,{size:"md"},h("booking.searchBar.allLocations"))),g(),e.map((e=>t.createElement(K,{key:e.id,onClick:t=>{t.nativeEvent.stopImmediatePropagation(),o&&o(e)},role:"button",tabIndex:0,"aria-label":`Select ${e.name} as location`,isSelected:(null==r?void 0:r.id)===e.id},t.createElement(D,{color:E.colors.neutral400}),t.createElement(w,{size:"md"},e.name)))))))},G="TYPE_CHARACTER",U="REMOVE_CHARACTER",Q="REMOVE_ALL",Y="REMOVE_LAST_VISIBLE_NODE",q="PAUSE_FOR",W="CHANGE_DELETE_SPEED",J="CHANGE_DELAY",X="PASTE_STRING",ee=(e,t)=>Math.floor(Math.random()*(t-e+1))+e,te="TEXT_NODE";class ie{constructor(e){this.state={lastFrameTime:null,pauseUntil:null,eventQueue:[],eventLoop:null,eventLoopPaused:!1,reverseCalledEvents:[],calledEvents:[],visibleNodes:[],initialOptions:null},this.options={strings:null,delay:"natural",pauseFor:1500,deleteSpeed:"natural",loop:!1,autoStart:!1,stringSplitter:null,onCreateTextNode:null,onRemoveNode:null},this.start=()=>(this.state.eventLoopPaused=!1,this.runEventLoop(),this),this.pause=()=>(this.state.eventLoopPaused=!0,this),this.stop=()=>(this.state.eventLoop&&(window.cancelAnimationFrame(this.state.eventLoop),this.state.eventLoop=null),this),this.pauseFor=e=>(this.addEventToQueue(q,{ms:e}),this),this.typeOutAllStrings=()=>"string"==typeof this.options.strings?(this.typeString(this.options.strings).pauseFor(this.options.pauseFor),this):(this.options.strings.forEach((e=>{this.typeString(e).pauseFor(this.options.pauseFor).deleteAll(this.options.deleteSpeed)})),this),this.typeString=(e,t=null)=>{if(e){const{stringSplitter:i}=this.options||{},o="function"==typeof i?i(e):e.split("");this.typeCharacters(o,t)}return this},this.pasteString=(e,t=null)=>(e&&this.addEventToQueue(X,{character:e,node:t}),this),this.deleteAll=(e="natural")=>(this.addEventToQueue(Q,{speed:e}),this),this.changeDeleteSpeed=e=>{if(!e)throw new Error("Must provide new delete speed");return this.addEventToQueue(W,{speed:e}),this},this.changeDelay=e=>{if(!e)throw new Error("Must provide new delay");return this.addEventToQueue(J,{delay:e}),this},this.deleteChars=e=>{if(!e)throw new Error("Must provide amount of characters to delete");for(let t=0;t<e;t++)this.addEventToQueue(U);return this},this.typeCharacters=(e,t=null)=>{if(!e||!Array.isArray(e))throw new Error("Characters must be an array");return e.forEach((e=>{this.addEventToQueue(G,{character:e,node:t})})),this},this.removeCharacters=e=>{if(!e||!Array.isArray(e))throw new Error("Characters must be an array");return e.forEach((()=>{this.addEventToQueue(U)})),this},this.addEventToQueue=(e,t,i=!1)=>this.addEventToStateProperty(e,t,i,"eventQueue"),this.addReverseCalledEvent=(e,t,i=!1)=>{const{loop:o}=this.options;return o?this.addEventToStateProperty(e,t,i,"reverseCalledEvents"):this},this.addEventToStateProperty=(e,t,i=!1,o)=>{const a={eventName:e,eventArgs:t||{}};return this.state[o]=i?[a,...this.state[o]]:[...this.state[o],a],this},this.runEventLoop=()=>{this.state.lastFrameTime||(this.state.lastFrameTime=Date.now());const e=Date.now(),t=e-this.state.lastFrameTime;if(!this.state.eventQueue.length){if(!this.options.loop)return;this.state.eventQueue=[...this.state.calledEvents],this.state.calledEvents=[],this.options=Object.assign({},this.state.initialOptions)}if(this.state.eventLoop=window.requestAnimationFrame(this.runEventLoop),this.state.eventLoopPaused)return;if(this.state.pauseUntil){if(e<this.state.pauseUntil)return;this.state.pauseUntil=null}const i=[...this.state.eventQueue],o=i.shift();let a=0;if(a=o.eventName===Y||o.eventName===U?"natural"===this.options.deleteSpeed?ee(40,80):this.options.deleteSpeed:"natural"===this.options.delay?ee(120,160):this.options.delay,t<=a)return;const{eventName:n,eventArgs:s}=o;switch(n){case X:case G:{const{character:e}=s,t=document.createTextNode(e);let i=t;this.options.onCreateTextNode&&"function"==typeof this.options.onCreateTextNode&&(i=this.options.onCreateTextNode(e,t)),this.state.visibleNodes=[...this.state.visibleNodes,{type:te,character:e,node:i}];break}case U:i.unshift({eventName:Y,eventArgs:{removingCharacterNode:!0}});break;case q:{const{ms:e}=o.eventArgs;this.state.pauseUntil=Date.now()+parseInt(e);break}case Q:{const{visibleNodes:e}=this.state,{speed:t}=s,o=[];t&&o.push({eventName:W,eventArgs:{speed:t,temp:!0}});for(let t=0,i=e.length;t<i;t++)o.push({eventName:Y,eventArgs:{removingCharacterNode:!1}});t&&o.push({eventName:W,eventArgs:{speed:this.options.deleteSpeed,temp:!0}}),i.unshift(...o);break}case Y:if(this.state.visibleNodes.length){const{node:e,character:t}=this.state.visibleNodes.pop();this.options.onRemoveNode&&"function"==typeof this.options.onRemoveNode&&this.options.onRemoveNode({node:e,character:t}),e&&e.parentNode.removeChild(e)}break;case W:this.options.deleteSpeed=o.eventArgs.speed;break;case J:this.options.delay=o.eventArgs.delay}this.options.loop&&(o.eventName===Y||o.eventArgs&&o.eventArgs.temp||(this.state.calledEvents=[...this.state.calledEvents,o])),this.state.eventQueue=i,this.state.lastFrameTime=e},e&&(this.options=Object.assign(Object.assign({},this.options),e)),this.state.initialOptions=Object.assign({},this.options),this.init()}init(){this.addEventToQueue(Q,null,!0),!0===this.options.autoStart&&this.options.strings&&this.typeOutAllStrings().start()}}function oe({inputRef:e,wrapperRef:t,disabled:i}){const{t:o,locale:s}=C(),r=a((()=>{if(i)return[];const e=["booking.searchBar.placeholder.hospital","booking.searchBar.placeholder.doctor"];return"zh-TW"!==s&&e.push("booking.searchBar.placeholder.specialty","booking.searchBar.placeholder.service"),S(e).map((e=>o(e)))}),[o,s]);function c(e){const t=d();return t&&(t.placeholder=t.placeholder+e),null}function l(){const e=d();e&&(e.placeholder=e.placeholder.slice(0,-1))}function d(){return e&&e.current?e.current:t&&t.current&&t.current.querySelector("input")||null}n((()=>{if(i)return;const e=d();e&&(e.placeholder="",new ie({strings:r,autoStart:!0,loop:!0,delay:32,deleteSpeed:32,pauseFor:1500,onCreateTextNode:c,onRemoveNode:l}))}),[e,t])}const ae=v.div`
128
128
  user-select: none;
129
129
  input {
130
130
  pointer-events: none;
131
131
  background-color: white;
132
132
  }
133
- `;function ne({focused:e,value:i="",onClick:o,trackingAttributes:n,inputSearchPlaceholder:r}){const{t:l}=C(),c=s(null);oe({wrapperRef:c,disabled:!!r});const d=a((()=>n?{"data-event-category":n.dataEventCategory,"data-event-action":n.dataEventAction,"data-event-label":n.dataEventLabel}:{}),[n]);return t.createElement(ae,Object.assign({onClick:()=>o&&o(),ref:c},d),t.createElement(N,{inputClassName:"location"===e?"focused":void 0,name:"booking-search-placeholder",displayIcon:t.createElement(B,{color:E.colors.gray400}),placeholder:l("booking.searchBar.searchInput.placeholder"),value:i,size:"md"}))}const se=v.header`
133
+ `;function ne({focused:e,value:i="",onClick:o,trackingAttributes:n,inputSearchPlaceholder:r}){const{t:c}=C(),l=s(null);oe({wrapperRef:l,disabled:!!r});const d=a((()=>n?{"data-event-category":n.dataEventCategory,"data-event-action":n.dataEventAction,"data-event-label":n.dataEventLabel}:{}),[n]);return t.createElement(ae,Object.assign({onClick:()=>o&&o(),ref:l},d),t.createElement(N,{inputClassName:"location"===e?"focused":void 0,name:"booking-search-placeholder",displayIcon:t.createElement(B,{color:E.colors.gray400}),placeholder:c("booking.searchBar.searchInput.placeholder"),value:i,size:"md"}))}const se=v.header`
134
134
  display: flex;
135
135
  height: 64px;
136
136
  align-items: center;
@@ -147,18 +147,18 @@ import{a as e}from"./tslib.es6-566e140f.js";import t,{useState as i,useCallback
147
147
  justify-content: flex-end;
148
148
  cursor: pointer;
149
149
  text-decoration: underline;
150
- `,le=v.div`
150
+ `,ce=v.div`
151
151
  display: flex;
152
152
  align-items: center;
153
153
  margin-left: 16px;
154
154
  cursor: pointer;
155
- `,ce=v.div`
155
+ `,le=v.div`
156
156
  width: 100%;
157
157
  margin-left: 24px;
158
158
  `,de=v(w)`
159
159
  color: ${E.colors.secondaryDark};
160
160
  text-align: start;
161
- `,he=({className:e,onLeftClick:i,headingText:o,onRightClick:a,iconLeft:n,textRight:s})=>t.createElement(se,{className:e},t.createElement(le,{onClick:i},n||t.createElement(A,{color:E.colors.gray800})),t.createElement(ce,null,t.createElement(de,{size:"md",type:"bold"},o)),t.createElement(re,{onClick:a},s&&t.createElement("p",null,s))),ue={"en-PH":3,"tl-PH":2,"id-ID":3,"vi-VN":2,"zh-TW":0,"ms-MY":2},pe={isMobile:!1,isDebug:!1,navigateTo:null,geoLocationPermission:"unset",geoLocationCoordinates:null,focused:"none",searchLocationKeywords:"",searchKeywords:"",selectedLocation:null,defaultCity:null,initialCities:[],cities:[],searchResults:[],initialSearchResults:[],isLoadingCities:!1,isLoadingSearchResults:!1,isMobileModalOpened:!1,initialSelectedCity:null,autoCompleteDisabled:!1,inputSearchPlaceholder:"",locale:"vi-VN"};var ge;function me(e){const{selectedLocation:t,searchLocationKeywords:i}=e;return t&&i!==t.name?Object.assign(Object.assign({},e),{searchLocationKeywords:t.name}):e}function Ce(e,t){var i;switch(e.isDebug&&console.log("bookingSearchBar",{action:t,state:e}),t.type){case ge.NavigateTo:return Object.assign(Object.assign({},e),{navigateTo:t.payload,focused:"none",isMobileModalOpened:!1});case ge.ClickOutsideInputLocation:return e.isMobile||"location"!==e.focused?e:me(Object.assign(Object.assign({},e),{focused:"none"}));case ge.ClickOutsideInputSearch:return e.isMobile||"search"!==e.focused?e:Object.assign(Object.assign({},e),{focused:"none"});case ge.FocusInputLocation:{const t=Object.assign(Object.assign({},e),{focused:"location"});return(null===(i=e.selectedLocation)||void 0===i?void 0:i.id)===d&&(t.searchLocationKeywords=""),t}case ge.FocusInputSearch:const o=Object.assign(Object.assign({},e),{focused:"search"});return e.isMobile?me(o):o;case ge.ChangeInputLocation:return Object.assign(Object.assign({},e),{searchLocationKeywords:t.payload});case ge.ChangeInputSearch:{const i=t.payload;return Object.assign(Object.assign({},e),{searchKeywords:i,isLoadingSearchResults:i.trim().length>ue[e.locale]})}case ge.SelectCurrentLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name});case ge.ClearInputLocation:return Object.assign(Object.assign({},e),{focused:"location",cities:e.initialCities,searchLocationKeywords:""});case ge.ClearInputSearch:return Object.assign(Object.assign({},e),{focused:"search",searchKeywords:""});case ge.SelectLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name});case ge.SelectSearchResult:return Object.assign(Object.assign({},e),{searchKeywords:t.payload.name,isMobileModalOpened:!1,focused:"none",navigateTo:t.payload.url});case ge.FetchCitiesStart:return Object.assign(Object.assign({},e),{isLoadingCities:!0});case ge.FetchCitiesFinish:return Object.assign(Object.assign({},e),{isLoadingCities:!1});case ge.FetchSearchResultsStart:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!0});case ge.FetchSearchResultsFinish:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!1});case ge.FetchSearchResultsComplete:{const i=Object.assign(Object.assign({},e),{searchResults:t.payload});return 0===e.initialSearchResults.length&&(i.initialSearchResults=t.payload),i}case ge.FetchCitiesByGeoIpComplete:{let{cities:i}=t.payload;const{default:o}=t.payload;i=i.filter((e=>e.id!==o.id)),i.unshift(o),e.initialSelectedCity&&!i.find((t=>t.id===e.initialSelectedCity.id))&&i.unshift(e.initialSelectedCity);const a=Object.assign(Object.assign({},e),{defaultCity:o,initialCities:i,cities:i});return"denied"!==e.geoLocationPermission||e.initialSelectedCity||(a.selectedLocation=o,a.searchLocationKeywords=o.name),a}case ge.FetchCitiesByKeywordComplete:return Object.assign(Object.assign({},e),{cities:t.payload});case ge.DisplayInitialCities:return Object.assign(Object.assign({},e),{cities:e.initialCities});case ge.DisplayInitialSearchResults:return Object.assign(Object.assign({},e),{searchResults:e.initialSearchResults,isLoadingSearchResults:!1});case ge.GrantGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"granted",geoLocationCoordinates:t.payload});case ge.DenyGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"denied",geoLocationCoordinates:null});case ge.OpenMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!0});case ge.CloseMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!1});case ge.UpdateInitialSearchValue:return Object.assign(Object.assign({},e),{searchKeywords:t.payload});case ge.SetInputSearchPlaceholder:return Object.assign(Object.assign({},e),{inputSearchPlaceholder:t.payload});default:return e}}!function(e){e.NavigateTo="navigate to url",e.ClickOutsideInputLocation="click outside input location",e.ClickOutsideInputSearch="click outside input search",e.SelectCurrentLocation="select current location",e.FocusInputLocation="focus input location",e.FocusInputSearch="focus input search",e.ChangeInputLocation="change input location",e.ChangeInputSearch="change input search",e.ClearInputLocation="clear input location",e.ClearInputSearch="clear input search",e.SelectLocation="select location",e.FetchCitiesStart="fetch cities start",e.FetchCitiesFinish="fetch cities finish",e.FetchSearchResultsStart="fetch search results start",e.FetchSearchResultsComplete="fetch search results complete",e.FetchSearchResultsFinish="fetch search results finish",e.FetchCitiesByGeoIpComplete="fetch cities by geo IP finish",e.FetchCitiesByKeywordComplete="fetch cities by keyword finish",e.DisplayInitialCities="display initial cities",e.DisplayInitialSearchResults="display initial search results",e.GrantGeoLocationPermission="grant geolocation permission",e.DenyGeoLocationPermission="deny geolocation permission",e.OpenMobileModal="open mobile modal",e.CloseMobileModal="close mobile modal",e.UpdateInitialSearchValue="update initial search value",e.SelectSearchResult="select search result",e.SetInputSearchPlaceholder="set input search placeholder"}(ge||(ge={}));const fe=v.div`
161
+ `,he=({className:e,onLeftClick:i,headingText:o,onRightClick:a,iconLeft:n,textRight:s})=>t.createElement(se,{className:e},t.createElement(ce,{onClick:i},n||t.createElement(A,{color:E.colors.gray800})),t.createElement(le,null,t.createElement(de,{size:"md",type:"bold"},o)),t.createElement(re,{onClick:a},s&&t.createElement("p",null,s))),ue={"en-PH":3,"tl-PH":2,"id-ID":3,"vi-VN":2,"zh-TW":0,"ms-MY":2},pe={isMobile:!1,isDebug:!1,navigateTo:null,geoLocationPermission:"unset",geoLocationCoordinates:null,focused:"none",searchLocationKeywords:"",searchKeywords:"",selectedLocation:null,defaultCity:null,initialCities:[],cities:[],searchResults:[],initialSearchResults:[],isLoadingCities:!1,isLoadingSearchResults:!1,isMobileModalOpened:!1,initialSelectedCity:null,autoCompleteDisabled:!1,inputSearchPlaceholder:"",locale:"vi-VN"};var ge;function me(e){const{selectedLocation:t,searchLocationKeywords:i}=e;return t&&i!==t.name?Object.assign(Object.assign({},e),{searchLocationKeywords:t.name}):e}function Ce(e,t){var i;switch(e.isDebug&&console.log("bookingSearchBar",{action:t,state:e}),t.type){case ge.NavigateTo:return Object.assign(Object.assign({},e),{navigateTo:t.payload,focused:"none",isMobileModalOpened:!1});case ge.ClickOutsideInputLocation:return e.isMobile||"location"!==e.focused?e:me(Object.assign(Object.assign({},e),{focused:"none"}));case ge.ClickOutsideInputSearch:return e.isMobile||"search"!==e.focused?e:Object.assign(Object.assign({},e),{focused:"none"});case ge.FocusInputLocation:{const t=Object.assign(Object.assign({},e),{focused:"location"});return(null===(i=e.selectedLocation)||void 0===i?void 0:i.id)===d&&(t.searchLocationKeywords=""),t}case ge.FocusInputSearch:const o=Object.assign(Object.assign({},e),{focused:"search"});return e.isMobile?me(o):o;case ge.ChangeInputLocation:return Object.assign(Object.assign({},e),{searchLocationKeywords:t.payload});case ge.ChangeInputSearch:{const i=t.payload;return Object.assign(Object.assign({},e),{searchKeywords:i,isLoadingSearchResults:i.trim().length>ue[e.locale]})}case ge.SelectCurrentLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name});case ge.ClearInputLocation:return Object.assign(Object.assign({},e),{focused:"location",cities:e.initialCities,searchLocationKeywords:""});case ge.ClearInputSearch:return Object.assign(Object.assign({},e),{focused:"search",searchKeywords:""});case ge.SelectLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name});case ge.SelectSearchResult:return Object.assign(Object.assign({},e),{searchKeywords:t.payload.name,isMobileModalOpened:!1,focused:"none",navigateTo:t.payload.url});case ge.FetchCitiesStart:return Object.assign(Object.assign({},e),{isLoadingCities:!0});case ge.FetchCitiesFinish:return Object.assign(Object.assign({},e),{isLoadingCities:!1});case ge.FetchSearchResultsStart:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!0});case ge.FetchSearchResultsFinish:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!1});case ge.FetchSearchResultsComplete:{const i=Object.assign(Object.assign({},e),{searchResults:t.payload});return 0===e.initialSearchResults.length&&(i.initialSearchResults=t.payload),i}case ge.FetchCitiesByGeoIpComplete:{let{cities:i}=t.payload;const{default:o}=t.payload;i=i.filter((e=>e.id!==o.id)),i.unshift(o),e.initialSelectedCity&&!i.find((t=>t.id===e.initialSelectedCity.id))&&i.unshift(e.initialSelectedCity);const a=Object.assign(Object.assign({},e),{defaultCity:o,initialCities:i,cities:i});return"denied"!==e.geoLocationPermission||e.initialSelectedCity||(a.selectedLocation=o,a.searchLocationKeywords=o.name),a}case ge.FetchCitiesByKeywordComplete:return Object.assign(Object.assign({},e),{cities:t.payload});case ge.DisplayInitialCities:return Object.assign(Object.assign({},e),{cities:e.initialCities});case ge.DisplayInitialSearchResults:return Object.assign(Object.assign({},e),{searchResults:e.initialSearchResults,isLoadingSearchResults:!1});case ge.GrantGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"granted",geoLocationCoordinates:t.payload});case ge.DenyGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"denied",geoLocationCoordinates:null});case ge.OpenMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!0});case ge.CloseMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!1});case ge.UpdateInitialSearchValue:return Object.assign(Object.assign({},e),{searchKeywords:t.payload});case ge.SetInputSearchPlaceholder:return Object.assign(Object.assign({},e),{inputSearchPlaceholder:t.payload});default:return e}}!function(e){e.NavigateTo="navigate to url",e.ClickOutsideInputLocation="click outside input location",e.ClickOutsideInputSearch="click outside input search",e.SelectCurrentLocation="select current location",e.FocusInputLocation="focus input location",e.FocusInputSearch="focus input search",e.ChangeInputLocation="change input location",e.ChangeInputSearch="change input search",e.ClearInputLocation="clear input location",e.ClearInputSearch="clear input search",e.SelectLocation="select location",e.FetchCitiesStart="fetch cities start",e.FetchCitiesFinish="fetch cities finish",e.FetchSearchResultsStart="fetch search results start",e.FetchSearchResultsComplete="fetch search results complete",e.FetchSearchResultsFinish="fetch search results finish",e.FetchCitiesByGeoIpComplete="fetch cities by geo IP finish",e.FetchCitiesByKeywordComplete="fetch cities by keyword finish",e.DisplayInitialCities="display initial cities",e.DisplayInitialSearchResults="display initial search results",e.GrantGeoLocationPermission="grant geolocation permission",e.DenyGeoLocationPermission="deny geolocation permission",e.OpenMobileModal="open mobile modal",e.CloseMobileModal="close mobile modal",e.UpdateInitialSearchValue="update initial search value",e.SelectSearchResult="select search result",e.SetInputSearchPlaceholder="set input search placeholder"}(ge||(ge={}));const fe=v.div`
162
162
  display: flex;
163
163
  gap: 16px;
164
164
  ${x.mbDown} {
@@ -220,7 +220,7 @@ import{a as e}from"./tslib.es6-566e140f.js";import t,{useState as i,useCallback
220
220
  }
221
221
  `,xe=v(w)`
222
222
  font-weight: ${({theme:e})=>e.sizes.fwSemiBold};
223
- `,Se=({onClick:e})=>{const{t:i}=C(),o=i("booking.searchBar.searchButton");return t.createElement(Le,{onClick:e,title:o},t.createElement(Ee,null),t.createElement(xe,{size:"s3",color:"white"},o))};function ke({isMobile:e,state:i,dispatch:n,debouncedFetchCitiesByKeyword:r,debouncedFetchSearchResults:l,focusLocationInput:c,focusSearchInput:h,renderLocationResults:u,renderSearchResults:p,locationTrackingAttributes:g,trackingAttributes:m,onSearch:f,initalSearchValue:y}){const v=s(null),b=s(null),{focused:w,searchLocationKeywords:L,geoLocationPermission:x,selectedLocation:S,searchKeywords:O,inputSearchPlaceholder:M}=i,{t:j}=C();oe({wrapperRef:b,disabled:!!M}),k(v,(()=>{e||n({type:ge.ClickOutsideInputLocation})})),k(b,(()=>{e||n({type:ge.ClickOutsideInputSearch})}));const I=a((()=>"granted"===x&&(null==S?void 0:S.id)===d?E.colors.primaryBase:E.colors.gray400),[x,S]),R=o((function(e){n({type:ge.ChangeInputSearch,payload:e}),"function"!=typeof f&&(e.trim().length>ue[i.locale]||y?l(e.trim(),i):(l.cancel(),n({type:ge.DisplayInitialSearchResults})))}),[n,i]),P=o((function(e){n({type:ge.ChangeInputLocation,payload:e}),e.trim().length>ue[i.locale]?r(e.trim()):(r.cancel(),n({type:ge.DisplayInitialCities}))}),[r,n]);return t.createElement(fe,null,t.createElement(ve,{ref:v},t.createElement(N,{inputClassName:"location"===w?"focused":void 0,placeholder:j("booking.searchBar.locationPlaceholder"),autoComplete:"off",name:"search-location",displayIcon:t.createElement(F,{className:"location-pin-icon",color:I}),actionIcon:t.createElement(we,{color:E.colors.gray300,className:""!==L?"shown":""}),onActionClick:function(){n({type:ge.ClearInputLocation}),r.cancel(),c()},value:L,onChange:P,onFocus:()=>n({type:ge.FocusInputLocation}),size:"md",trackingAttributes:g}),!e&&u()),t.createElement(be,{ref:b},t.createElement(N,{placeholder:M||j("booking.searchBar.searchInput.placeholder"),autoComplete:"off",name:"search-results",actionIcon:t.createElement(we,{color:E.colors.gray300,className:""!==O?"shown":""}),onActionClick:function(){n({type:ge.ClearInputSearch}),l.cancel(),l("",i),h()},value:O,onChange:R,onFocus:()=>n({type:ge.FocusInputSearch}),inputClassName:"search"===w?"focused":void 0,size:"md",trackingAttributes:m,onKeyPress:e=>{i.autoCompleteDisabled&&"Enter"===e.key&&f&&f({cityId:i.selectedLocation.id,keyword:O})},enterKeyHint:i.autoCompleteDisabled?"search":void 0}),!e&&p()),i.autoCompleteDisabled&&!i.isMobile&&t.createElement(Se,{onClick:()=>{f({cityId:i.selectedLocation.id,keyword:O})}}))}const Oe=()=>t.createElement("svg",{width:"14",height:"18",viewBox:"0 0 14 18"},t.createElement("path",{d:"M7.00004 0.666992C5.29757 0.666992 3.64067 0.813476 2.52087 1.03158C1.73311 1.18457 1.16671 1.86816 1.16671 2.6722V4.83366C1.16671 5.29264 1.54106 5.66699 2.00004 5.66699H12C12.459 5.66699 12.8334 5.29264 12.8334 4.83366V2.69824C12.8334 1.89421 12.267 1.21061 11.4792 1.05762C10.3562 0.839518 8.69275 0.666992 7.00004 0.666992ZM6.16671 1.50033H7.83337V2.33366H8.66671V4.00033H7.83337V4.83366H6.16671V4.00033H5.33337V2.33366H6.16671V1.50033ZM1.42712 6.50033C1.3197 6.89421 1.24158 7.32389 1.19275 7.77637C1.14718 8.18001 1.05603 9.25423 1.06254 9.36491C0.603556 9.72624 0.333374 10.2861 0.333374 10.9014C0.333374 11.8356 0.977906 12.6364 1.84379 12.8285C2.74548 15.0192 4.55212 17.3337 7.00004 17.3337C9.44796 17.3337 11.2546 14.9964 12.1563 12.8024C13.0222 12.6136 13.6667 11.8356 13.6667 10.9014C13.6667 10.2861 13.3965 9.72624 12.9375 9.36491C12.9441 9.25423 12.8562 8.16048 12.8073 7.75033C12.7552 7.30436 12.6804 6.89095 12.573 6.50033H5.35942C6.52804 8.20606 9.27543 7.18717 11.0365 7.62012C11.5736 8.79199 11.1667 10.4326 11.1667 10.4326L11.8177 10.641C11.9121 10.6702 12 10.7549 12 10.9014C12 11.0576 11.8861 11.1943 11.6875 11.1878L11.0105 11.0837L10.7761 11.7347C9.96554 14.0492 8.4128 15.667 7.00004 15.667C5.58728 15.667 4.03455 14.0492 3.224 11.7347L2.96358 11.0837L2.26046 11.1878C2.11723 11.1878 2.00004 11.0576 2.00004 10.9014C2.00004 10.7549 2.08793 10.6702 2.18233 10.641L2.83337 10.4326C2.73246 10.5531 2.4102 8.7041 2.83337 8.03678C3.59184 7.5127 4.2266 7.87728 5.12504 6.50033H1.42712ZM5.17712 9.05241C4.57166 9.05241 4.08337 9.55371 4.08337 10.1722C4.08337 10.7907 4.57166 11.292 5.17712 11.292C5.78259 11.292 6.27087 10.7907 6.27087 10.1722C6.27087 9.55371 5.78259 9.05241 5.17712 9.05241ZM8.82296 9.05241C8.21749 9.05241 7.72921 9.55371 7.72921 10.1722C7.72921 10.7907 8.21749 11.292 8.82296 11.292C9.42843 11.292 9.91671 10.7907 9.91671 10.1722C9.91671 9.55371 9.42843 9.05241 8.82296 9.05241Z",fill:"#9AA2AC"})),Me=()=>t.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18"},t.createElement("path",{d:"M8.99996 0.666992C6.27535 0.666992 3.85348 1.97884 2.33329 4.00033H4.59892C5.80009 2.94564 7.36259 2.33366 8.99996 2.33366C10.6373 2.33366 12.1998 2.94564 13.401 4.00033H15.6666C14.1464 1.97884 11.7246 0.666992 8.99996 0.666992ZM1.78642 4.83366C1.07678 7.04069 0.666626 9.59928 0.666626 12.3337C0.666626 14.085 0.826131 15.7679 1.13538 17.3337H16.8645C17.1738 15.7679 17.3333 14.085 17.3333 12.3337C17.3333 9.59928 16.9231 7.04069 16.2135 4.83366H1.78642ZM8.99996 7.33366C11.3014 7.33366 13.1666 9.19889 13.1666 11.5003C13.1666 13.8018 11.3014 15.667 8.99996 15.667C6.69853 15.667 4.83329 13.8018 4.83329 11.5003C4.83329 9.19889 6.69853 7.33366 8.99996 7.33366ZM8.16663 9.00033V10.667H6.49996V12.3337H8.16663V14.0003H9.83329V12.3337H11.5V10.667H9.83329V9.00033H8.16663Z",fill:"#9AA2AC"})),je=()=>t.createElement("svg",{width:"16",height:"17",viewBox:"0 0 16 17"},t.createElement("path",{d:"M8 0.666992L0.5 5.63533V14.8337C0.5 15.7545 1.24583 16.5003 2.16667 16.5003H13.8333C14.7542 16.5003 15.5 15.7545 15.5 14.8337V5.63533L8 0.666992ZM11.3333 10.667H8.83333V13.167H7.16667V10.667H4.66667V9.00033H7.16667V6.50033H8.83333V9.00033H11.3333V10.667Z",fill:"#9AA2AC"})),Ie=()=>t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16"},t.createElement("path",{d:"M3.83333 0.5C2.94928 0.5 2.10143 0.851189 1.47631 1.47631C0.851189 2.10143 0.5 2.94928 0.5 3.83333C0.5 4.71739 0.851189 5.56523 1.47631 6.19036C2.10143 6.81548 2.94928 7.16667 3.83333 7.16667C4.71739 7.16667 5.56523 6.81548 6.19036 6.19036C6.81548 5.56523 7.16667 4.71739 7.16667 3.83333C7.16667 2.94928 6.81548 2.10143 6.19036 1.47631C5.56523 0.851189 4.71739 0.5 3.83333 0.5V0.5ZM10.5 0.5C9.57917 0.5 8.83333 1.24583 8.83333 2.16667V5.5C8.83333 6.42083 9.57917 7.16667 10.5 7.16667H13.8333C14.7542 7.16667 15.5 6.42083 15.5 5.5V2.16667C15.5 1.24583 14.7542 0.5 13.8333 0.5H10.5ZM3.83333 8.83333C2.94928 8.83333 2.10143 9.18452 1.47631 9.80964C0.851189 10.4348 0.5 11.2826 0.5 12.1667C0.5 13.0507 0.851189 13.8986 1.47631 14.5237C2.10143 15.1488 2.94928 15.5 3.83333 15.5C4.71739 15.5 5.56523 15.1488 6.19036 14.5237C6.81548 13.8986 7.16667 13.0507 7.16667 12.1667C7.16667 11.2826 6.81548 10.4348 6.19036 9.80964C5.56523 9.18452 4.71739 8.83333 3.83333 8.83333V8.83333ZM12.1667 8.83333C11.2826 8.83333 10.4348 9.18452 9.80964 9.80964C9.18452 10.4348 8.83333 11.2826 8.83333 12.1667C8.83333 13.0507 9.18452 13.8986 9.80964 14.5237C10.4348 15.1488 11.2826 15.5 12.1667 15.5C13.0507 15.5 13.8986 15.1488 14.5237 14.5237C15.1488 13.8986 15.5 13.0507 15.5 12.1667C15.5 11.2826 15.1488 10.4348 14.5237 9.80964C13.8986 9.18452 13.0507 8.83333 12.1667 8.83333V8.83333Z",fill:"#9AA2AC"})),Re=v.header`
223
+ `,Se=({onClick:e})=>{const{t:i}=C(),o=i("booking.searchBar.searchButton");return t.createElement(Le,{onClick:e,title:o},t.createElement(Ee,null),t.createElement(xe,{size:"s3",color:"white"},o))};function ke({isMobile:e,state:i,dispatch:n,debouncedFetchCitiesByKeyword:r,debouncedFetchSearchResults:c,focusLocationInput:l,focusSearchInput:h,renderLocationResults:u,renderSearchResults:p,locationTrackingAttributes:g,trackingAttributes:m,onSearch:f,initalSearchValue:y}){const v=s(null),b=s(null),{focused:w,searchLocationKeywords:L,geoLocationPermission:x,selectedLocation:S,searchKeywords:O,inputSearchPlaceholder:M}=i,{t:j}=C();oe({wrapperRef:b,disabled:!!M}),k(v,(()=>{e||n({type:ge.ClickOutsideInputLocation})})),k(b,(()=>{e||n({type:ge.ClickOutsideInputSearch})}));const I=a((()=>"granted"===x&&(null==S?void 0:S.id)===d?E.colors.primaryBase:E.colors.gray400),[x,S]),R=o((function(e){n({type:ge.ChangeInputSearch,payload:e}),"function"!=typeof f&&(e.trim().length>ue[i.locale]||y?c(e.trim(),i):(c.cancel(),n({type:ge.DisplayInitialSearchResults})))}),[n,i]),P=o((function(e){n({type:ge.ChangeInputLocation,payload:e}),e.trim().length>ue[i.locale]?r(e.trim()):(r.cancel(),n({type:ge.DisplayInitialCities}))}),[r,n]);return t.createElement(fe,null,t.createElement(ve,{ref:v},t.createElement(N,{inputClassName:"location"===w?"focused":void 0,placeholder:j("booking.searchBar.locationPlaceholder"),autoComplete:"off",name:"search-location",displayIcon:t.createElement(F,{className:"location-pin-icon",color:I}),actionIcon:t.createElement(we,{color:E.colors.gray300,className:""!==L?"shown":""}),onActionClick:function(){n({type:ge.ClearInputLocation}),r.cancel(),l()},value:L,onChange:P,onFocus:()=>n({type:ge.FocusInputLocation}),size:"md",trackingAttributes:g}),!e&&u()),t.createElement(be,{ref:b},t.createElement(N,{placeholder:M||j("booking.searchBar.searchInput.placeholder"),autoComplete:"off",name:"search-results",actionIcon:t.createElement(we,{color:E.colors.gray300,className:""!==O?"shown":""}),onActionClick:function(){n({type:ge.ClearInputSearch}),c.cancel(),c("",i),h()},value:O,onChange:R,onFocus:()=>n({type:ge.FocusInputSearch}),inputClassName:"search"===w?"focused":void 0,size:"md",trackingAttributes:m,onKeyPress:e=>{i.autoCompleteDisabled&&"Enter"===e.key&&f&&f({cityId:i.selectedLocation.id,keyword:O})},enterKeyHint:i.autoCompleteDisabled?"search":void 0}),!e&&p()),i.autoCompleteDisabled&&!i.isMobile&&t.createElement(Se,{onClick:()=>{f({cityId:i.selectedLocation.id,keyword:O})}}))}const Oe=()=>t.createElement("svg",{width:"14",height:"18",viewBox:"0 0 14 18"},t.createElement("path",{d:"M7.00004 0.666992C5.29757 0.666992 3.64067 0.813476 2.52087 1.03158C1.73311 1.18457 1.16671 1.86816 1.16671 2.6722V4.83366C1.16671 5.29264 1.54106 5.66699 2.00004 5.66699H12C12.459 5.66699 12.8334 5.29264 12.8334 4.83366V2.69824C12.8334 1.89421 12.267 1.21061 11.4792 1.05762C10.3562 0.839518 8.69275 0.666992 7.00004 0.666992ZM6.16671 1.50033H7.83337V2.33366H8.66671V4.00033H7.83337V4.83366H6.16671V4.00033H5.33337V2.33366H6.16671V1.50033ZM1.42712 6.50033C1.3197 6.89421 1.24158 7.32389 1.19275 7.77637C1.14718 8.18001 1.05603 9.25423 1.06254 9.36491C0.603556 9.72624 0.333374 10.2861 0.333374 10.9014C0.333374 11.8356 0.977906 12.6364 1.84379 12.8285C2.74548 15.0192 4.55212 17.3337 7.00004 17.3337C9.44796 17.3337 11.2546 14.9964 12.1563 12.8024C13.0222 12.6136 13.6667 11.8356 13.6667 10.9014C13.6667 10.2861 13.3965 9.72624 12.9375 9.36491C12.9441 9.25423 12.8562 8.16048 12.8073 7.75033C12.7552 7.30436 12.6804 6.89095 12.573 6.50033H5.35942C6.52804 8.20606 9.27543 7.18717 11.0365 7.62012C11.5736 8.79199 11.1667 10.4326 11.1667 10.4326L11.8177 10.641C11.9121 10.6702 12 10.7549 12 10.9014C12 11.0576 11.8861 11.1943 11.6875 11.1878L11.0105 11.0837L10.7761 11.7347C9.96554 14.0492 8.4128 15.667 7.00004 15.667C5.58728 15.667 4.03455 14.0492 3.224 11.7347L2.96358 11.0837L2.26046 11.1878C2.11723 11.1878 2.00004 11.0576 2.00004 10.9014C2.00004 10.7549 2.08793 10.6702 2.18233 10.641L2.83337 10.4326C2.73246 10.5531 2.4102 8.7041 2.83337 8.03678C3.59184 7.5127 4.2266 7.87728 5.12504 6.50033H1.42712ZM5.17712 9.05241C4.57166 9.05241 4.08337 9.55371 4.08337 10.1722C4.08337 10.7907 4.57166 11.292 5.17712 11.292C5.78259 11.292 6.27087 10.7907 6.27087 10.1722C6.27087 9.55371 5.78259 9.05241 5.17712 9.05241ZM8.82296 9.05241C8.21749 9.05241 7.72921 9.55371 7.72921 10.1722C7.72921 10.7907 8.21749 11.292 8.82296 11.292C9.42843 11.292 9.91671 10.7907 9.91671 10.1722C9.91671 9.55371 9.42843 9.05241 8.82296 9.05241Z",fill:"#9AA2AC"})),Me=()=>t.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18"},t.createElement("path",{d:"M8.99996 0.666992C6.27535 0.666992 3.85348 1.97884 2.33329 4.00033H4.59892C5.80009 2.94564 7.36259 2.33366 8.99996 2.33366C10.6373 2.33366 12.1998 2.94564 13.401 4.00033H15.6666C14.1464 1.97884 11.7246 0.666992 8.99996 0.666992ZM1.78642 4.83366C1.07678 7.04069 0.666626 9.59928 0.666626 12.3337C0.666626 14.085 0.826131 15.7679 1.13538 17.3337H16.8645C17.1738 15.7679 17.3333 14.085 17.3333 12.3337C17.3333 9.59928 16.9231 7.04069 16.2135 4.83366H1.78642ZM8.99996 7.33366C11.3014 7.33366 13.1666 9.19889 13.1666 11.5003C13.1666 13.8018 11.3014 15.667 8.99996 15.667C6.69853 15.667 4.83329 13.8018 4.83329 11.5003C4.83329 9.19889 6.69853 7.33366 8.99996 7.33366ZM8.16663 9.00033V10.667H6.49996V12.3337H8.16663V14.0003H9.83329V12.3337H11.5V10.667H9.83329V9.00033H8.16663Z",fill:"#9AA2AC"})),je=()=>t.createElement("svg",{width:"16",height:"17",viewBox:"0 0 16 17"},t.createElement("path",{d:"M8 0.666992L0.5 5.63533V14.8337C0.5 15.7545 1.24583 16.5003 2.16667 16.5003H13.8333C14.7542 16.5003 15.5 15.7545 15.5 14.8337V5.63533L8 0.666992ZM11.3333 10.667H8.83333V13.167H7.16667V10.667H4.66667V9.00033H7.16667V6.50033H8.83333V9.00033H11.3333V10.667Z",fill:"#9AA2AC"})),Ie=()=>t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16"},t.createElement("path",{d:"M3.83333 0.5C2.94928 0.5 2.10143 0.851189 1.47631 1.47631C0.851189 2.10143 0.5 2.94928 0.5 3.83333C0.5 4.71739 0.851189 5.56523 1.47631 6.19036C2.10143 6.81548 2.94928 7.16667 3.83333 7.16667C4.71739 7.16667 5.56523 6.81548 6.19036 6.19036C6.81548 5.56523 7.16667 4.71739 7.16667 3.83333C7.16667 2.94928 6.81548 2.10143 6.19036 1.47631C5.56523 0.851189 4.71739 0.5 3.83333 0.5V0.5ZM10.5 0.5C9.57917 0.5 8.83333 1.24583 8.83333 2.16667V5.5C8.83333 6.42083 9.57917 7.16667 10.5 7.16667H13.8333C14.7542 7.16667 15.5 6.42083 15.5 5.5V2.16667C15.5 1.24583 14.7542 0.5 13.8333 0.5H10.5ZM3.83333 8.83333C2.94928 8.83333 2.10143 9.18452 1.47631 9.80964C0.851189 10.4348 0.5 11.2826 0.5 12.1667C0.5 13.0507 0.851189 13.8986 1.47631 14.5237C2.10143 15.1488 2.94928 15.5 3.83333 15.5C4.71739 15.5 5.56523 15.1488 6.19036 14.5237C6.81548 13.8986 7.16667 13.0507 7.16667 12.1667C7.16667 11.2826 6.81548 10.4348 6.19036 9.80964C5.56523 9.18452 4.71739 8.83333 3.83333 8.83333V8.83333ZM12.1667 8.83333C11.2826 8.83333 10.4348 9.18452 9.80964 9.80964C9.18452 10.4348 8.83333 11.2826 8.83333 12.1667C8.83333 13.0507 9.18452 13.8986 9.80964 14.5237C10.4348 15.1488 11.2826 15.5 12.1667 15.5C13.0507 15.5 13.8986 15.1488 14.5237 14.5237C15.1488 13.8986 15.5 13.0507 15.5 12.1667C15.5 11.2826 15.1488 10.4348 14.5237 9.80964C13.8986 9.18452 13.0507 8.83333 12.1667 8.83333V8.83333Z",fill:"#9AA2AC"})),Re=v.header`
224
224
  display: flex;
225
225
  justify-content: space-between;
226
226
  padding: 12px 24px;
@@ -324,7 +324,7 @@ import{a as e}from"./tslib.es6-566e140f.js";import t,{useState as i,useCallback
324
324
  `,Ke=v.div`
325
325
  display: grid;
326
326
  place-items: center;
327
- `,Ze={doctors:({width:e,height:i})=>t.createElement("svg",{width:e||32,height:i||32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("g",{clipPath:"url(#clip0_14712_400114)"},t.createElement("rect",{width:"32",height:"32",rx:"16",fill:"#E4E8EC"}),t.createElement("path",{d:"M22.065 9.58305C22.1108 9.80952 22.1431 10.0396 22.1614 10.2722C22.3769 13.0522 22.5858 16.1276 22.5727 17.618C22.5306 20.5688 19.708 21.1325 19.4564 21.1769L19.4495 21.5357L19.5228 23.9014C20.8688 23.9341 22.203 24.1759 23.4772 24.6196C24.5264 24.9739 25.4827 25.5591 26.2757 26.332C27.0688 27.105 27.6783 28.0461 28.0594 29.0858L31.9886 39.2068C31.91 39.3048 30.6939 39.6356 29.4888 39.944C30.1695 42.3315 30.4582 44.8142 30.3432 47.2953C30.2991 48.2666 30.1816 49.264 29.7245 50.1211C29.4508 50.6342 29.0319 51.0912 28.5296 51.3753C28.5099 51.4347 28.4864 51.4928 28.4593 51.5495C28.4293 51.6146 28.3908 51.6756 28.3448 51.7307C28.3293 51.7772 28.3232 51.8406 28.3162 51.9135C28.3004 52.0779 28.2799 52.2909 28.1362 52.4685C28.001 52.6373 27.8519 52.7945 27.6905 52.9386C27.6905 52.9386 27.092 52.9667 26.4133 52.9845L26.458 58.4088H5.7492L6.30965 52.9523L5.66093 53.1637C5.07664 53.3528 4.45628 53.4028 3.84925 53.3099C3.24222 53.2169 2.66526 52.9835 2.1643 52.6283C1.61489 52.2388 1.17445 51.715 0.884966 51.1068C0.595484 50.4987 0.46662 49.8266 0.510669 49.1545L0.644528 47.1369L1.41503 38.3366L1.81323 38.4135L-0.914307 37.8437L-0.402886 36.5663C-0.407359 36.5645 -0.411803 36.5627 -0.416214 36.5608C-0.410804 36.56 -0.40538 36.5594 -0.399946 36.5589L2.05995 30.4146C3.00034 28.0825 4.7421 26.1624 6.97187 24.9999C8.56171 24.176 10.3028 23.6861 12.0882 23.5597L11.788 16.5865C11.1882 16.6507 10.0095 16.5266 9.96087 14.954C9.91229 13.3824 11.0457 13.3171 11.6507 13.3961L11.6445 13.2523C11.5785 12.8433 11.5088 12.439 11.4577 12.2132C11.3782 11.8628 11.2611 11.4953 11.1419 11.1207C10.8794 10.2967 10.6061 9.43855 10.697 8.65293C10.697 8.65293 10.6909 8.00438 11.4565 7.24044C11.3707 6.86644 11.3686 6.47786 11.4507 6.10258C11.5366 5.70965 11.7125 5.34199 11.9645 5.02848C12.2165 4.71497 12.5377 4.46414 12.9029 4.29569C13.2682 4.12725 13.6675 4.04577 14.0696 4.05766C14.2277 4.06393 14.3849 4.08493 14.5418 4.10589C14.7932 4.13945 15.0439 4.17294 15.2971 4.14581C15.7708 4.09409 16.177 3.83884 16.5862 3.58167C16.8357 3.42492 17.0863 3.26745 17.354 3.15494C17.9119 2.93744 18.5266 2.91281 19.1002 3.08497C19.6738 3.25713 20.1733 3.61619 20.5192 4.105C20.5943 4.21716 20.6621 4.33678 20.7298 4.45631C20.9035 4.76299 21.077 5.06915 21.373 5.24769C21.5927 5.38236 21.8482 5.42658 22.1057 5.47114C22.2633 5.49842 22.4216 5.52582 22.5728 5.57417C23.0267 5.71015 23.3999 6.0411 23.6319 6.45436C23.6327 6.40753 23.6317 6.36062 23.629 6.31374C23.6502 6.3657 23.6623 6.42092 23.6649 6.47698C23.6661 6.49165 23.667 6.50632 23.6677 6.521C23.8246 6.82609 23.9058 7.17114 23.8885 7.51347C23.8544 7.93447 23.7053 8.33801 23.4574 8.68001C23.2096 9.02201 22.8725 9.28933 22.483 9.45278C22.3469 9.50712 22.2071 9.55061 22.065 9.58305Z",fill:"white"})),t.createElement("defs",null,t.createElement("clipPath",{id:"clip0_14712_400114"},t.createElement("rect",{width:"32",height:"32",rx:"16",fill:"white"})))),services:({width:e,height:i})=>t.createElement("svg",{width:e||30,height:i||30,viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("circle",{cx:"15",cy:"15",r:"15",fill:"#F7F9FC"}),t.createElement("path",{d:"M14.9998 6.66663C12.2752 6.66663 9.85335 7.97848 8.33317 9.99996H10.5988C11.8 8.94527 13.3625 8.33329 14.9998 8.33329C16.6372 8.33329 18.1997 8.94527 19.4009 9.99996H21.6665C20.1463 7.97848 17.7244 6.66663 14.9998 6.66663ZM7.7863 10.8333C7.07666 13.0403 6.6665 15.5989 6.6665 18.3333C6.6665 20.0846 6.82601 21.7675 7.13525 23.3333H22.8644C23.1737 21.7675 23.3332 20.0846 23.3332 18.3333C23.3332 15.5989 22.923 13.0403 22.2134 10.8333H7.7863ZM14.9998 13.3333C17.3013 13.3333 19.1665 15.1985 19.1665 17.5C19.1665 19.8014 17.3013 21.6666 14.9998 21.6666C12.6984 21.6666 10.8332 19.8014 10.8332 17.5C10.8332 15.1985 12.6984 13.3333 14.9998 13.3333ZM14.1665 15V16.6666H12.4998V18.3333H14.1665V20H15.8332V18.3333H17.4998V16.6666H15.8332V15H14.1665Z",fill:"#BFC5CC"}))},_e=({type:e,item:i,imageUrl:o,className:n,onClickItem:s})=>{const r=a((()=>{const i=Ze[e]||H;return t.createElement(i,{width:32,height:"services"===e?32:24})}),[e]);return t.createElement(He,{onClick:()=>s&&s(i),onKeyDown:e=>{"Enter"!==e.key&&"Space"!==e.key||s&&s(i)},tabIndex:0,role:"button",className:n},t.createElement(ze,null,"hospitals"===e?t.createElement(De,{width:"12",height:"16",viewBox:"0 0 12 16"},t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 5.94873C0.75 3.04623 3.0975 0.69873 6 0.69873C8.9025 0.69873 11.25 3.04623 11.25 5.94873C11.25 9.07623 7.935 13.3887 6.5775 15.0312C6.2775 15.3912 5.73 15.3912 5.43 15.0312C4.065 13.3887 0.75 9.07623 0.75 5.94873ZM4.125 5.94873C4.125 6.98373 4.965 7.82373 6 7.82373C7.035 7.82373 7.875 6.98373 7.875 5.94873C7.875 4.91373 7.035 4.07373 6 4.07373C4.965 4.07373 4.125 4.91373 4.125 5.94873Z",fill:"#9AA2AC"})):t.createElement(Ve,{type:e},o?t.createElement("img",{src:o,width:32,height:"services"===e?32:24}):r)),t.createElement($e,{color:E.colors.gray800,size:"p3"},i.name))},Ge=({type:e,data:o,state:n,dispatch:s,itemsToShow:r,itemsToShowDesktop:l,isMobile:d,isLoading:h,keyword:u,isNavResultItem:p})=>{const[g,m]=i(!1),{t:f,locale:y}=C(),{selectedLocation:v,searchKeywords:b}=n,x=a((()=>c[y]),[y]),S="ms-MY"===y,k=a((()=>({doctors:{name:f("booking.searchPopup.doctors"),icon:t.createElement(Oe,null),slug:x.DOCTOR},services:{name:f("booking.searchPopup.services"),icon:t.createElement(Me,null),slug:x.SERVICE},hospitals:{name:f("booking.searchPopup.hospitals"),icon:t.createElement(je,null),slug:x.HOSPITAL},specialties:{name:f("booking.searchPopup.specialties"),icon:t.createElement(Ie,null),slug:x.SPECIALTIES}})),[e,x]),O=a((()=>k[e].slug),[k]),M=d?r:l;function j(t){let i="";switch(e){case"specialties":i=`/${v.slug}/${k.doctors.slug}/${t.slug}`;break;case"services":i=`/${v.slug}/${O}/${t.slug}`;break;case"doctors":case"hospitals":i=`/${O}/${t.slug}-${t.id}`}i&&s({type:ge.SelectSearchResult,payload:{name:t.name,url:i}})}function I(i){return t.createElement(_e,{key:i.id,item:i,type:e,imageUrl:i.logo||i.avatar||i.thumbnail,className:p?"":"not-nav",onClickItem:p&&j})}return t.createElement("section",null,t.createElement(Re,null,t.createElement(Ne,null,k[e].icon,t.createElement(Pe,null,k[e].name)),(u.trim().length<=ue[y]||S)&&t.createElement(Ae,{onClick:function(){let t="";switch(e){case"specialties":t=`/${O}`;break;case"services":case"doctors":case"hospitals":t=`/${v.slug}/${O}`}t&&s({type:ge.NavigateTo,payload:t})}},t.createElement(w,{size:"p3",color:E.colors.primaryBase},f("booking.searchPopup.seeAll")))),(h||o&&o.length>0)&&t.createElement(Fe,null,t.createElement(Te,null,h&&Array(2).fill(void 0).map(((i,o)=>t.createElement(He,{key:e+"loading"+o},t.createElement(ze,null,t.createElement(Ke,null,t.createElement(L,{height:14,width:"hospitals"===e?12:32,style:{maxWidth:"var(--graphicSize)",minHeight:"var(--graphicSize)"}}))),t.createElement(L,{width:120,height:24})))),!h&&o&&o.length>0&&o.slice(0,M).map(I)),t.createElement(Te,{isShown:g,isMore:!0},o.slice(M,-1).map(I)),"specialties"===e&&M<o.length&&!h&&t.createElement("button",{onClick:()=>m(!g)},t.createElement(Be,{size:"p3",color:E.colors.primaryBase},f(g?"booking.searchPopup.seeLessSpecialties":"booking.searchPopup.seeMoreSpecialties"))),"specialties"!==e&&(M<o.length||S)&&!h&&u.trim().length>ue[y]&&t.createElement("button",{onClick:function(){const{slug:t}=k[e],i=`/${v.slug}/${t}?q=${b}`;s({type:ge.NavigateTo,payload:i})}},t.createElement(Be,{size:"p3",color:E.colors.primaryBase},f(`booking.searchPopup.searchIn.${e}`,{name:u})))),!h&&0===(null==o?void 0:o.length)&&t.createElement(Fe,null,t.createElement(w,{size:"sm",color:E.colors.gray400},f("booking.searchBar.noResults"))))},Ue=v.section`
327
+ `,Ze={doctors:({width:e,height:i})=>t.createElement("svg",{width:e||32,height:i||32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("g",{clipPath:"url(#clip0_14712_400114)"},t.createElement("rect",{width:"32",height:"32",rx:"16",fill:"#E4E8EC"}),t.createElement("path",{d:"M22.065 9.58305C22.1108 9.80952 22.1431 10.0396 22.1614 10.2722C22.3769 13.0522 22.5858 16.1276 22.5727 17.618C22.5306 20.5688 19.708 21.1325 19.4564 21.1769L19.4495 21.5357L19.5228 23.9014C20.8688 23.9341 22.203 24.1759 23.4772 24.6196C24.5264 24.9739 25.4827 25.5591 26.2757 26.332C27.0688 27.105 27.6783 28.0461 28.0594 29.0858L31.9886 39.2068C31.91 39.3048 30.6939 39.6356 29.4888 39.944C30.1695 42.3315 30.4582 44.8142 30.3432 47.2953C30.2991 48.2666 30.1816 49.264 29.7245 50.1211C29.4508 50.6342 29.0319 51.0912 28.5296 51.3753C28.5099 51.4347 28.4864 51.4928 28.4593 51.5495C28.4293 51.6146 28.3908 51.6756 28.3448 51.7307C28.3293 51.7772 28.3232 51.8406 28.3162 51.9135C28.3004 52.0779 28.2799 52.2909 28.1362 52.4685C28.001 52.6373 27.8519 52.7945 27.6905 52.9386C27.6905 52.9386 27.092 52.9667 26.4133 52.9845L26.458 58.4088H5.7492L6.30965 52.9523L5.66093 53.1637C5.07664 53.3528 4.45628 53.4028 3.84925 53.3099C3.24222 53.2169 2.66526 52.9835 2.1643 52.6283C1.61489 52.2388 1.17445 51.715 0.884966 51.1068C0.595484 50.4987 0.46662 49.8266 0.510669 49.1545L0.644528 47.1369L1.41503 38.3366L1.81323 38.4135L-0.914307 37.8437L-0.402886 36.5663C-0.407359 36.5645 -0.411803 36.5627 -0.416214 36.5608C-0.410804 36.56 -0.40538 36.5594 -0.399946 36.5589L2.05995 30.4146C3.00034 28.0825 4.7421 26.1624 6.97187 24.9999C8.56171 24.176 10.3028 23.6861 12.0882 23.5597L11.788 16.5865C11.1882 16.6507 10.0095 16.5266 9.96087 14.954C9.91229 13.3824 11.0457 13.3171 11.6507 13.3961L11.6445 13.2523C11.5785 12.8433 11.5088 12.439 11.4577 12.2132C11.3782 11.8628 11.2611 11.4953 11.1419 11.1207C10.8794 10.2967 10.6061 9.43855 10.697 8.65293C10.697 8.65293 10.6909 8.00438 11.4565 7.24044C11.3707 6.86644 11.3686 6.47786 11.4507 6.10258C11.5366 5.70965 11.7125 5.34199 11.9645 5.02848C12.2165 4.71497 12.5377 4.46414 12.9029 4.29569C13.2682 4.12725 13.6675 4.04577 14.0696 4.05766C14.2277 4.06393 14.3849 4.08493 14.5418 4.10589C14.7932 4.13945 15.0439 4.17294 15.2971 4.14581C15.7708 4.09409 16.177 3.83884 16.5862 3.58167C16.8357 3.42492 17.0863 3.26745 17.354 3.15494C17.9119 2.93744 18.5266 2.91281 19.1002 3.08497C19.6738 3.25713 20.1733 3.61619 20.5192 4.105C20.5943 4.21716 20.6621 4.33678 20.7298 4.45631C20.9035 4.76299 21.077 5.06915 21.373 5.24769C21.5927 5.38236 21.8482 5.42658 22.1057 5.47114C22.2633 5.49842 22.4216 5.52582 22.5728 5.57417C23.0267 5.71015 23.3999 6.0411 23.6319 6.45436C23.6327 6.40753 23.6317 6.36062 23.629 6.31374C23.6502 6.3657 23.6623 6.42092 23.6649 6.47698C23.6661 6.49165 23.667 6.50632 23.6677 6.521C23.8246 6.82609 23.9058 7.17114 23.8885 7.51347C23.8544 7.93447 23.7053 8.33801 23.4574 8.68001C23.2096 9.02201 22.8725 9.28933 22.483 9.45278C22.3469 9.50712 22.2071 9.55061 22.065 9.58305Z",fill:"white"})),t.createElement("defs",null,t.createElement("clipPath",{id:"clip0_14712_400114"},t.createElement("rect",{width:"32",height:"32",rx:"16",fill:"white"})))),services:({width:e,height:i})=>t.createElement("svg",{width:e||30,height:i||30,viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("circle",{cx:"15",cy:"15",r:"15",fill:"#F7F9FC"}),t.createElement("path",{d:"M14.9998 6.66663C12.2752 6.66663 9.85335 7.97848 8.33317 9.99996H10.5988C11.8 8.94527 13.3625 8.33329 14.9998 8.33329C16.6372 8.33329 18.1997 8.94527 19.4009 9.99996H21.6665C20.1463 7.97848 17.7244 6.66663 14.9998 6.66663ZM7.7863 10.8333C7.07666 13.0403 6.6665 15.5989 6.6665 18.3333C6.6665 20.0846 6.82601 21.7675 7.13525 23.3333H22.8644C23.1737 21.7675 23.3332 20.0846 23.3332 18.3333C23.3332 15.5989 22.923 13.0403 22.2134 10.8333H7.7863ZM14.9998 13.3333C17.3013 13.3333 19.1665 15.1985 19.1665 17.5C19.1665 19.8014 17.3013 21.6666 14.9998 21.6666C12.6984 21.6666 10.8332 19.8014 10.8332 17.5C10.8332 15.1985 12.6984 13.3333 14.9998 13.3333ZM14.1665 15V16.6666H12.4998V18.3333H14.1665V20H15.8332V18.3333H17.4998V16.6666H15.8332V15H14.1665Z",fill:"#BFC5CC"}))},_e=({type:e,item:i,imageUrl:o,className:n,onClickItem:s})=>{const r=a((()=>{const i=Ze[e]||H;return t.createElement(i,{width:32,height:"services"===e?32:24})}),[e]);return t.createElement(He,{onClick:()=>s&&s(i),onKeyDown:e=>{"Enter"!==e.key&&"Space"!==e.key||s&&s(i)},tabIndex:0,role:"button",className:n},t.createElement(ze,null,"hospitals"===e?t.createElement(De,{width:"12",height:"16",viewBox:"0 0 12 16"},t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 5.94873C0.75 3.04623 3.0975 0.69873 6 0.69873C8.9025 0.69873 11.25 3.04623 11.25 5.94873C11.25 9.07623 7.935 13.3887 6.5775 15.0312C6.2775 15.3912 5.73 15.3912 5.43 15.0312C4.065 13.3887 0.75 9.07623 0.75 5.94873ZM4.125 5.94873C4.125 6.98373 4.965 7.82373 6 7.82373C7.035 7.82373 7.875 6.98373 7.875 5.94873C7.875 4.91373 7.035 4.07373 6 4.07373C4.965 4.07373 4.125 4.91373 4.125 5.94873Z",fill:"#9AA2AC"})):t.createElement(Ve,{type:e},o?t.createElement("img",{src:o,width:32,height:"services"===e?32:24}):r)),t.createElement($e,{color:E.colors.gray800,size:"p3"},i.name))},Ge=({type:e,data:o,state:n,dispatch:s,itemsToShow:r,itemsToShowDesktop:c,isMobile:d,isLoading:h,keyword:u,isNavResultItem:p})=>{const[g,m]=i(!1),{t:f,locale:y}=C(),{selectedLocation:v,searchKeywords:b}=n,x=a((()=>l[y]),[y]),S="ms-MY"===y,k=a((()=>({doctors:{name:f("booking.searchPopup.doctors"),icon:t.createElement(Oe,null),slug:x.DOCTOR},services:{name:f("booking.searchPopup.services"),icon:t.createElement(Me,null),slug:x.SERVICE},hospitals:{name:f("booking.searchPopup.hospitals"),icon:t.createElement(je,null),slug:x.HOSPITAL},specialties:{name:f("booking.searchPopup.specialties"),icon:t.createElement(Ie,null),slug:x.SPECIALTIES}})),[e,x]),O=a((()=>k[e].slug),[k]),M=d?r:c;function j(t){let i="";switch(e){case"specialties":i=`/${v.slug}/${k.doctors.slug}/${t.slug}`;break;case"services":i=`/${v.slug}/${O}/${t.slug}`;break;case"doctors":case"hospitals":i=`/${O}/${t.slug}-${t.id}`}i&&s({type:ge.SelectSearchResult,payload:{name:t.name,url:i}})}function I(i){return t.createElement(_e,{key:i.id,item:i,type:e,imageUrl:i.logo||i.avatar||i.thumbnail,className:p?"":"not-nav",onClickItem:p&&j})}return t.createElement("section",null,t.createElement(Re,null,t.createElement(Ne,null,k[e].icon,t.createElement(Pe,null,k[e].name)),(u.trim().length<=ue[y]||S)&&t.createElement(Ae,{onClick:function(){let t="";switch(e){case"specialties":t=`/${O}`;break;case"services":case"doctors":case"hospitals":t=`/${v.slug}/${O}`}t&&s({type:ge.NavigateTo,payload:t})}},t.createElement(w,{size:"p3",color:E.colors.primaryBase},f("booking.searchPopup.seeAll")))),(h||o&&o.length>0)&&t.createElement(Fe,null,t.createElement(Te,null,h&&Array(2).fill(void 0).map(((i,o)=>t.createElement(He,{key:e+"loading"+o},t.createElement(ze,null,t.createElement(Ke,null,t.createElement(L,{height:14,width:"hospitals"===e?12:32,style:{maxWidth:"var(--graphicSize)",minHeight:"var(--graphicSize)"}}))),t.createElement(L,{width:120,height:24})))),!h&&o&&o.length>0&&o.slice(0,M).map(I)),t.createElement(Te,{isShown:g,isMore:!0},o.slice(M,-1).map(I)),"specialties"===e&&M<o.length&&!h&&t.createElement("button",{onClick:()=>m(!g)},t.createElement(Be,{size:"p3",color:E.colors.primaryBase},f(g?"booking.searchPopup.seeLessSpecialties":"booking.searchPopup.seeMoreSpecialties"))),"specialties"!==e&&(M<o.length||S)&&!h&&u.trim().length>ue[y]&&t.createElement("button",{onClick:function(){const{slug:t}=k[e],i=`/${v.slug}/${t}?q=${b}`;s({type:ge.NavigateTo,payload:i})}},t.createElement(Be,{size:"p3",color:E.colors.primaryBase},f(`booking.searchPopup.searchIn.${e}`,{name:u})))),!h&&0===(null==o?void 0:o.length)&&t.createElement(Fe,null,t.createElement(w,{size:"sm",color:E.colors.gray400},f("booking.searchBar.noResults"))))},Ue=v.section`
328
328
  background-color: white;
329
329
  border-radius: 4px;
330
330
  position: absolute;
@@ -336,4 +336,4 @@ import{a as e}from"./tslib.es6-566e140f.js";import t,{useState as i,useCallback
336
336
  0px 16px 24px rgba(0, 0, 0, 0.04), 0px 4px 8px rgba(0, 0, 0, 0.04),
337
337
  0px 0px 1px rgba(0, 0, 0, 0.04);
338
338
  }
339
- `,Qe=({data:e,state:i,dispatch:o,isMobile:a,isLoading:n,keyword:s,hideResults:r,isNavResultItem:l})=>t.createElement(Ue,null,e&&e.map((e=>r&&r.includes(e.type)?t.createElement(t.Fragment,null):t.createElement(Ge,{type:e.type,state:i,dispatch:o,itemsToShow:2,itemsToShowDesktop:4,key:e.type,data:e.results,isMobile:a,isLoading:n,keyword:s,isNavResultItem:l})))),Ye="api/lists/cities?keyword={keyword}&country_id={countryId}&site={domain}&_nopaging={noPaging}",qe="api/v2/search/?site={domain}&type={searchType}&keyword={keyword}&city_id={city}&latitude={lat}&longitude={lng}",We="api/geobyip?site={domain}&latitude={lat}&longitude={lng}&_nopaging={noPaging}",Je=(e,t,i)=>O(e,Object.assign(Object.assign({},t),{domain:u[i||"en-PH"]}));const Xe=({isMobile:u,careApiDomain:y,geoLocationPermission:v,geoLocationCoordinates:b,initialSelectedCity:w,initialSearchValue:E="",careFrontDomain:L="/care",isDebug:x=!1,askForGeolocationPermission:S=!1,gaTrackingSearchBar:k,gaTrackingLocationSearch:O,autoCompleteDisabled:N=!1,inputSearchPlaceholder:A="",isOptionAllLocation:F=!1,hideResults:T=[],isNavResultItem:B=!0,routerPush:H,onGeoLocationPermissionChange:V,onSearch:$,onChangeLocation:z})=>{const{t:D,locale:K}=C(),Z=s(null),G=s(null),[U,Q]=i(void 0),[Y,q]=i(!1),{geoLocationPermission:W,geoLocationCoordinates:J,requestGeoLocation:X}=function(){const[e,t]=i((()=>{if("undefined"==typeof window)return"unset";if(p(h))return"granted";const e=!location.protocol.includes("https")&&"localhost"!==location.hostname;return!navigator.geolocation||e?"denied":"unset"})),[n,s]=i((()=>{if("undefined"==typeof window)return null;const e=p(h);if(e)try{return JSON.parse(e)}catch(e){console.log(e)}return null})),r=o((function(){navigator.geolocation&&navigator.geolocation.getCurrentPosition((e=>{const i={lat:""+Math.round(1e7*e.coords.latitude)/1e7,lng:""+Math.round(1e7*e.coords.longitude)/1e7};g(h,JSON.stringify(i),{minutes:15}),s(i),t("granted")}),(()=>{m(h),t("denied")}))}),[]);return a((()=>({geoLocationPermission:e,geoLocationCoordinates:n,requestGeoLocation:r})),[e,n])}(),[ee,te]=r(Ce,pe,(e=>Object.assign(Object.assign({},e),{isDebug:x,isMobile:u,geoLocationPermission:v||W||"unset",geoLocationCoordinates:b||J||null,searchKeywords:E,initialSelectedCity:w||null,selectedLocation:w||e.selectedLocation||null,searchLocationKeywords:(null==w?void 0:w.name)||e.searchLocationKeywords,autoCompleteDisabled:N,inputSearchPlaceholder:A,locale:K}))),{navigateTo:ie,focused:oe,isLoadingCities:ae,cities:se,searchKeywords:re,geoLocationPermission:le,selectedLocation:ce,initialSelectedCity:de,defaultCity:me,searchResults:fe,isLoadingSearchResults:ye,isMobileModalOpened:ve,inputSearchPlaceholder:be}=ee,{fetchCitiesByLocation:we,fetchCitiesByKeyword:Ee,fetchSearchResults:Le}=function({dispatch:e,careApiDomain:t,locale:i="vi-VN"}){const a=o((function(o,a={}){const n=`${t}${o}`;return e({type:ge.FetchCitiesStart}),fetch(Je(n,a,i),{method:"GET"}).then((e=>e.json())).then((e=>1===e._status&&e._data?null==e?void 0:e._data:(console.log("error loading cities",e),Promise.reject(e)))).finally((()=>e({type:ge.FetchCitiesFinish})))}),[i]);return{fetchCitiesByLocation:o((function({coordinates:t}){let o={};const n={};t&&(o={lat:t.lat,lng:t.lng}),"ms-MY"===i&&(n.noPaging=1);const s=[a(We,Object.assign(Object.assign({},o),n))];return"zh-TW"===i&&s.push(a(Ye,{noPaging:1})),Promise.all(s).then((([t,i])=>{const o=Object.assign({},t);if(i){const e=o.cities.map((e=>e.id));o.cities=o.cities.concat(i.cities.filter((t=>!e.includes(t.id))))}e({type:ge.FetchCitiesByGeoIpComplete,payload:o})})).catch((e=>console.error("error loading cities by location",e)))}),[i,t,e]),fetchCitiesByKeyword:o((function(t){return a(Ye,{keyword:t}).then((t=>{e({type:ge.FetchCitiesByKeywordComplete,payload:t.cities})})).catch((e=>console.error("error loading cities by keyword",e)))}),[i,t,e]),fetchSearchResults:o((function(o,a){const n=`${t}${qe}`;e({type:ge.FetchSearchResultsStart});const{defaultCity:s,selectedLocation:r,geoLocationCoordinates:c}=a;let h="";if(!r||!s)return void e({type:ge.FetchSearchResultsFinish});r.id===d?c||(h=s.id):h=r.id===l?"":r.id;const u=(null==c?void 0:c.lat)||"",p=(null==c?void 0:c.lng)||"";return fetch(Je(n,{domain:t,searchType:"global",keyword:o.trim().length>ue[i]?o.trim():"",city:h===d?"":h,lat:u,lng:p},i),{method:"GET",headers:{accept:"version=2.0.0.0"}}).then((e=>e.json())).then((e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e))).then((t=>e({type:ge.FetchSearchResultsComplete,payload:t}))).catch((e=>{console.log("error loading search results",{url:n,error:e})})).finally((()=>e({type:ge.FetchSearchResultsFinish})))}),[i,t,e])}}({dispatch:te,locale:K,careApiDomain:y}),xe=a((()=>{var e;return{id:d,name:D("booking.searchBar.currentLocation"),slug:null===(e=c[K])||void 0===e?void 0:e.CURRENT}}),[D,K]),Oe=a((()=>f(Ee,400)),[Ee]),Me=a((()=>f(Le,400)),[Le]);n((()=>{""!==E&&E!==ee.searchKeywords&&te({type:ge.UpdateInitialSearchValue,payload:E})}),[E]),n((()=>{S&&(null==ce?void 0:ce.id)===d&&"unset"===le&&X()}),[S,ce,le]),n((()=>{v||le===W||("granted"===W&&J?te({type:ge.GrantGeoLocationPermission,payload:J}):"denied"===W&&te({type:ge.DenyGeoLocationPermission}))}),[le,W,J,v]),n((()=>{ie&&(H?H(ie):window.location.href=`${L}${ie}`)}),[ie]);const je=o((function(){te({type:ge.SelectCurrentLocation,payload:xe})}),[D,te]);n((()=>{"denied"===le||de||je(),V&&V(le,ee.geoLocationCoordinates),u&&"granted"===le&&ce&&te({type:ge.FocusInputSearch}),we({coordinates:ee.geoLocationCoordinates})}),[le]),n((()=>{ce&&me&&Le(ee.searchKeywords,ee)}),[ce,me]),n((()=>{A!==be&&te({type:ge.SetInputSearchPlaceholder,payload:A})}),[A,be]),n((()=>{ve?document.body.classList.add("care-popup-open"):document.body.classList.remove("care-popup-open")}),[ve]);const Ie=o((function(e){"ms-MY"===K&&q(!0),te({type:ge.SelectLocation,payload:e}),"ms-MY"!==K&&Pe(),z&&z(e)}),[D,te]);function Re(){"ms-MY"===K&&q(!0),u&&"granted"!==ee.geoLocationPermission?X():(je(),"ms-MY"!==K&&Pe())}function Ne(){var e;Z.current&&(null===(e=Z.current.querySelector('input[name="search-location"]'))||void 0===e||e.focus())}function Pe(){var e;Z.current&&(null===(e=Z.current.querySelector('input[name="search-results"]'))||void 0===e||e.focus())}function Ae(){te({type:ge.CloseMobileModal})}function Fe(){return"location"!==oe?null:t.createElement(_,{isLoading:ae,cities:se,onLocationClick:Ie,onCurrentLocationClick:Re,isLocationLoading:ae,geoLocationPermission:le,selectedLocation:ce,isOptionAllLocation:F})}function Te(){return"search"!==oe?null:ee.autoCompleteDisabled?u?t.createElement(Se,{onClick:()=>{$({cityId:ee.selectedLocation.id,keyword:re}),Ae()}}):null:t.createElement(Qe,{data:fe,state:ee,dispatch:te,isMobile:!1,keyword:re,isLoading:ye,hideResults:T,isNavResultItem:B})}function Be(){return t.createElement(ke,{isMobile:u,state:ee,dispatch:te,debouncedFetchCitiesByKeyword:Oe,debouncedFetchSearchResults:Me,focusLocationInput:Ne,focusSearchInput:Pe,renderLocationResults:Fe,renderSearchResults:Te,trackingAttributes:k,locationTrackingAttributes:O,onSearch:$,initalSearchValue:E})}return n((()=>{if(window.visualViewport){const e=e=>{const t=e.target;Q(null==t?void 0:t.height)};return window.visualViewport.addEventListener("resize",e,{passive:!0}),()=>{window.visualViewport.removeEventListener("resize",e)}}}),[Q]),n((()=>{if(ce&&Y&&"ms-MY"===K){const e=`/${ce.slug}/hospital`;te({type:ge.NavigateTo,payload:e}),q(!1)}}),[Y,K,ce]),u?t.createElement(t.Fragment,null,t.createElement(P,null),t.createElement(R,{ref:G}),t.createElement(j,{id:"booking-search-bar",ref:Z,"data-is-modal":u&&ve,style:{"--mobile-care-searchbar-height":ve&&U?`${U}px`:"100%"}},ve?t.createElement(t.Fragment,null,t.createElement(I,null,t.createElement(he,{headingText:D("booking.searchBar.searchButton"),onLeftClick:Ae}),Be()),Fe(),Te()):t.createElement(ne,{onClick:function(){var t;return e(this,void 0,void 0,(function*(){G.current&&G.current.focus(),te({type:ge.OpenMobileModal}),yield Promise.resolve(),Z.current&&(null===(t=Z.current.querySelector('input[name="search-location"]'))||void 0===t||t.focus())}))},focused:oe,value:re,trackingAttributes:k,inputSearchPlaceholder:A}))):t.createElement(M,{id:"booking-search-bar",ref:Z},Be())};var et;!function(e){e[e.SPECIALTY=1]="SPECIALTY",e[e.DOCTOR=2]="DOCTOR",e[e.CLINIC=3]="CLINIC",e[e.SERVICE=4]="SERVICE"}(et||(et={}));var tt=Object.freeze({__proto__:null,get RedirectType(){return et}});export{Xe as B,tt as t};
339
+ `,Qe=({data:e,state:i,dispatch:o,isMobile:a,isLoading:n,keyword:s,hideResults:r,isNavResultItem:c})=>t.createElement(Ue,null,e&&e.map((e=>r&&r.includes(e.type)?t.createElement(t.Fragment,null):t.createElement(Ge,{type:e.type,state:i,dispatch:o,itemsToShow:2,itemsToShowDesktop:4,key:e.type,data:e.results,isMobile:a,isLoading:n,keyword:s,isNavResultItem:c})))),Ye="api/lists/cities?keyword={keyword}&country_id={countryId}&site={domain}&_nopaging={noPaging}",qe="api/v2/search/?site={domain}&type={searchType}&keyword={keyword}&city_id={city}&latitude={lat}&longitude={lng}",We="api/geobyip?site={domain}&latitude={lat}&longitude={lng}&_nopaging={noPaging}",Je=(e,t,i)=>O(e,Object.assign(Object.assign({},t),{domain:u[i||"en-PH"]}));const Xe=({isMobile:u,careApiDomain:y,geoLocationPermission:v,geoLocationCoordinates:b,initialSelectedCity:w,initialSearchValue:E="",careFrontDomain:L="/care",isDebug:x=!1,askForGeolocationPermission:S=!1,gaTrackingSearchBar:k,gaTrackingLocationSearch:O,autoCompleteDisabled:N=!1,inputSearchPlaceholder:A="",isOptionAllLocation:F=!1,hideResults:T=[],isNavResultItem:B=!0,routerPush:H,onGeoLocationPermissionChange:V,onSearch:$,onChangeLocation:z})=>{const{t:D,locale:K}=C(),Z=s(null),G=s(null),[U,Q]=i(void 0),[Y,q]=i(!1),{geoLocationPermission:W,geoLocationCoordinates:J,requestGeoLocation:X}=function(){const[e,t]=i((()=>{if("undefined"==typeof window)return"unset";if(p(h))return"granted";const e=!location.protocol.includes("https")&&"localhost"!==location.hostname;return!navigator.geolocation||e?"denied":"unset"})),[n,s]=i((()=>{if("undefined"==typeof window)return null;const e=p(h);if(e)try{return JSON.parse(e)}catch(e){console.log(e)}return null})),r=o((function(){navigator.geolocation&&navigator.geolocation.getCurrentPosition((e=>{const i={lat:""+Math.round(1e7*e.coords.latitude)/1e7,lng:""+Math.round(1e7*e.coords.longitude)/1e7};g(h,JSON.stringify(i),{minutes:15}),s(i),t("granted")}),(()=>{m(h),t("denied")}))}),[]);return a((()=>({geoLocationPermission:e,geoLocationCoordinates:n,requestGeoLocation:r})),[e,n])}(),[ee,te]=r(Ce,pe,(e=>Object.assign(Object.assign({},e),{isDebug:x,isMobile:u,geoLocationPermission:v||W||"unset",geoLocationCoordinates:b||J||null,searchKeywords:E,initialSelectedCity:w||null,selectedLocation:w||e.selectedLocation||null,searchLocationKeywords:(null==w?void 0:w.name)||e.searchLocationKeywords,autoCompleteDisabled:N,inputSearchPlaceholder:A,locale:K}))),{navigateTo:ie,focused:oe,isLoadingCities:ae,cities:se,searchKeywords:re,geoLocationPermission:ce,selectedLocation:le,initialSelectedCity:de,defaultCity:me,searchResults:fe,isLoadingSearchResults:ye,isMobileModalOpened:ve,inputSearchPlaceholder:be}=ee,{fetchCitiesByLocation:we,fetchCitiesByKeyword:Ee,fetchSearchResults:Le}=function({dispatch:e,careApiDomain:t,locale:i="vi-VN"}){const a=o((function(o,a={}){const n=`${t}${o}`;return e({type:ge.FetchCitiesStart}),fetch(Je(n,a,i),{method:"GET"}).then((e=>e.json())).then((e=>1===e._status&&e._data?null==e?void 0:e._data:(console.log("error loading cities",e),Promise.reject(e)))).finally((()=>e({type:ge.FetchCitiesFinish})))}),[i]);return{fetchCitiesByLocation:o((function({coordinates:t}){let o={};const n={};t&&(o={lat:t.lat,lng:t.lng}),"ms-MY"===i&&(n.noPaging=1);const s=[a(We,Object.assign(Object.assign({},o),n))];return"zh-TW"===i&&s.push(a(Ye,{noPaging:1})),Promise.all(s).then((([t,i])=>{const o=Object.assign({},t);if(i){const e=o.cities.map((e=>e.id));o.cities=o.cities.concat(i.cities.filter((t=>!e.includes(t.id))))}e({type:ge.FetchCitiesByGeoIpComplete,payload:o})})).catch((e=>console.error("error loading cities by location",e)))}),[i,t,e]),fetchCitiesByKeyword:o((function(t){return a(Ye,{keyword:t}).then((t=>{e({type:ge.FetchCitiesByKeywordComplete,payload:t.cities})})).catch((e=>console.error("error loading cities by keyword",e)))}),[i,t,e]),fetchSearchResults:o((function(o,a){const n=`${t}${qe}`;e({type:ge.FetchSearchResultsStart});const{defaultCity:s,selectedLocation:r,geoLocationCoordinates:l}=a;let h="";if(!r||!s)return void e({type:ge.FetchSearchResultsFinish});r.id===d?l||(h=s.id):h=r.id===c?"":r.id;const u=(null==l?void 0:l.lat)||"",p=(null==l?void 0:l.lng)||"";return fetch(Je(n,{domain:t,searchType:"global",keyword:o.trim().length>ue[i]?o.trim():"",city:h===d?"":h,lat:u,lng:p},i),{method:"GET",headers:{accept:"version=2.0.0.0"}}).then((e=>e.json())).then((e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e))).then((t=>e({type:ge.FetchSearchResultsComplete,payload:t}))).catch((e=>{console.log("error loading search results",{url:n,error:e})})).finally((()=>e({type:ge.FetchSearchResultsFinish})))}),[i,t,e])}}({dispatch:te,locale:K,careApiDomain:y}),xe=a((()=>{var e;return{id:d,name:D("booking.searchBar.currentLocation"),slug:null===(e=l[K])||void 0===e?void 0:e.CURRENT}}),[D,K]),Oe=a((()=>f(Ee,400)),[Ee]),Me=a((()=>f(Le,400)),[Le]);n((()=>{""!==E&&E!==ee.searchKeywords&&te({type:ge.UpdateInitialSearchValue,payload:E})}),[E]),n((()=>{S&&(null==le?void 0:le.id)===d&&"unset"===ce&&X()}),[S,le,ce]),n((()=>{v||ce===W||("granted"===W&&J?te({type:ge.GrantGeoLocationPermission,payload:J}):"denied"===W&&te({type:ge.DenyGeoLocationPermission}))}),[ce,W,J,v]),n((()=>{ie&&(H?H(ie):window.location.href=`${L}${ie}`)}),[ie]);const je=o((function(){te({type:ge.SelectCurrentLocation,payload:xe})}),[D,te]);n((()=>{"denied"===ce||de||je(),V&&V(ce,ee.geoLocationCoordinates),u&&"granted"===ce&&le&&te({type:ge.FocusInputSearch}),we({coordinates:ee.geoLocationCoordinates})}),[ce]),n((()=>{le&&me&&Le(ee.searchKeywords,ee)}),[le,me]),n((()=>{A!==be&&te({type:ge.SetInputSearchPlaceholder,payload:A})}),[A,be]),n((()=>{ve?document.body.classList.add("care-popup-open"):document.body.classList.remove("care-popup-open")}),[ve]);const Ie=o((function(e){"ms-MY"===K&&q(!0),te({type:ge.SelectLocation,payload:e}),"ms-MY"!==K&&Pe(),z&&z(e)}),[D,te]);function Re(){"ms-MY"===K&&q(!0),u&&"granted"!==ee.geoLocationPermission?X():(je(),"ms-MY"!==K&&Pe())}function Ne(){var e;Z.current&&(null===(e=Z.current.querySelector('input[name="search-location"]'))||void 0===e||e.focus())}function Pe(){var e;Z.current&&(null===(e=Z.current.querySelector('input[name="search-results"]'))||void 0===e||e.focus())}function Ae(){te({type:ge.CloseMobileModal})}function Fe(){return"location"!==oe?null:t.createElement(_,{isLoading:ae,cities:se,onLocationClick:Ie,onCurrentLocationClick:Re,isLocationLoading:ae,geoLocationPermission:ce,selectedLocation:le,isOptionAllLocation:F})}function Te(){return"search"!==oe?null:ee.autoCompleteDisabled?u?t.createElement(Se,{onClick:()=>{$({cityId:ee.selectedLocation.id,keyword:re}),Ae()}}):null:t.createElement(Qe,{data:fe,state:ee,dispatch:te,isMobile:!1,keyword:re,isLoading:ye,hideResults:T,isNavResultItem:B})}function Be(){return t.createElement(ke,{isMobile:u,state:ee,dispatch:te,debouncedFetchCitiesByKeyword:Oe,debouncedFetchSearchResults:Me,focusLocationInput:Ne,focusSearchInput:Pe,renderLocationResults:Fe,renderSearchResults:Te,trackingAttributes:k,locationTrackingAttributes:O,onSearch:$,initalSearchValue:E})}return n((()=>{if(window.visualViewport){const e=e=>{const t=e.target;Q(null==t?void 0:t.height)};return window.visualViewport.addEventListener("resize",e,{passive:!0}),()=>{window.visualViewport.removeEventListener("resize",e)}}}),[Q]),n((()=>{if(le&&Y&&"ms-MY"===K){const e=`/${le.slug}/hospital`;te({type:ge.NavigateTo,payload:e}),q(!1)}}),[Y,K,le]),u?t.createElement(t.Fragment,null,t.createElement(P,null),t.createElement(R,{ref:G}),t.createElement(j,{id:"booking-search-bar",ref:Z,"data-is-modal":u&&ve,style:{"--mobile-care-searchbar-height":ve&&U?`${U}px`:"100%"}},ve?t.createElement(t.Fragment,null,t.createElement(I,null,t.createElement(he,{headingText:D("booking.searchBar.searchButton"),onLeftClick:Ae}),Be()),Fe(),Te()):t.createElement(ne,{onClick:function(){var t;return e(this,void 0,void 0,(function*(){G.current&&G.current.focus(),te({type:ge.OpenMobileModal}),yield Promise.resolve(),Z.current&&(null===(t=Z.current.querySelector('input[name="search-location"]'))||void 0===t||t.focus())}))},focused:oe,value:re,trackingAttributes:k,inputSearchPlaceholder:A}))):t.createElement(M,{id:"booking-search-bar",ref:Z},Be())};var et;!function(e){e[e.SPECIALTY=1]="SPECIALTY",e[e.DOCTOR=2]="DOCTOR",e[e.CLINIC=3]="CLINIC",e[e.SERVICE=4]="SERVICE"}(et||(et={}));var tt=Object.freeze({__proto__:null,get RedirectType(){return et}});export{Xe as B,tt as t};
@@ -1 +1 @@
1
- export{a as BabyGrowthChartDuration,B as BabyGrowthChartType,b as BabyGrowthResultTab,G as Gender,L as LOCALE,O as OnboardingStep}from"./Onboarding-01e65da4.js";
1
+ export{a as BabyGrowthChartDuration,B as BabyGrowthChartType,b as BabyGrowthResultTab,G as Gender,L as LOCALE,O as OnboardingStep}from"./Onboarding-5b53ad56.js";
@@ -0,0 +1 @@
1
+ import{a as o}from"./tslib.es6-dc24c862.js";import{useState as t,useEffect as i,useCallback as l}from"react";import{a as n}from"./getDynamicHealthTool-bd9b0426.js";const r=r=>{const[a,e]=t([]);i((()=>{o(void 0,void 0,void 0,(function*(){const o=yield n(r);e(o)}))}),[n,r]);const s=l((o=>{var t;return(null===(t=a.find((t=>t.template===o)))||void 0===t?void 0:t.link)||""}),[a]);return{allTools:a,getHealthToolLink:s}};export{r as u};
@@ -1 +1 @@
1
- import{a as e}from"./tslib.es6-566e140f.js";import{useRef as t,useEffect as n,useState as r,useCallback as i}from"react";import{g as o}from"./cookieHelper-584dbd8d.js";import{u as a}from"./useUniqueId-527dc21c.js";function l(e){const t=(new TextEncoder).encode(e.trim().toLowerCase());return crypto.subtle.digest("SHA-256",t).then((e=>Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join("")))}const c=r=>{const i=t("");n((()=>(e(void 0,void 0,void 0,(function*(){var e,t,n,a,c;if(!i.current){let e=yield fetch("https://api.ipify.org").then((e=>e.text()));e||(e=yield fetch("https://icanhazip.com").then((e=>e.text()))),i.current=e}if(null===(t=null===(e=window.localStorage)||void 0===e?void 0:e.setItem)||void 0===t||t.call(e,"fbClientIp",JSON.stringify({client_ip_address:(null===(n=i.current)||void 0===n?void 0:n.replace("\n",""))||"",client_user_agent:navigator.userAgent||""})),null==r?void 0:r.id){const[e,t,n,i,s,u]=yield Promise.all([r.email?l(r.email):null,r.phone?l(r.phone):null,r.birthday?l(r.birthday.split("-").join("")):null,r.gender?"m":"f",r.city_name?l(r.city_name).then((e=>e.replace(/\s/g,""))):null,r.name?l(r.name):null]);o("_fbc"),o("_fbp");const d={user_id:r.id};u&&(d.fn=u),e&&(d.em=e),t&&(d.ph=t),n&&(d.db=n),s&&(d.ct=s),null===(c=null===(a=window.localStorage)||void 0===a?void 0:a.setItem)||void 0===c||c.call(a,"fbDataLayer_userInfo",JSON.stringify(d))}})),()=>{})),[r])},s=e=>{const n=t(),r=t(e);return a()||r.current===e||(n.current=r.current,r.current=e),n.current},u=e=>{const[o,a]=r(e),l=t(0),c=i((e=>{cancelAnimationFrame(l.current),l.current=requestAnimationFrame((()=>{a(e)}))}),[]);return n((()=>()=>cancelAnimationFrame(l.current))),[o,c]};export{s as a,u as b,c as u};
1
+ import{a as e}from"./tslib.es6-dc24c862.js";import{useRef as t,useEffect as n,useState as r,useCallback as i}from"react";import{g as o}from"./cookieHelper-f51a61f7.js";import{u as a}from"./useUniqueId-6c3e7337.js";function l(e){const t=(new TextEncoder).encode(e.trim().toLowerCase());return crypto.subtle.digest("SHA-256",t).then((e=>Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join("")))}const c=r=>{const i=t("");n((()=>(e(void 0,void 0,void 0,(function*(){var e,t,n,a,c;if(!i.current){let e=yield fetch("https://api.ipify.org").then((e=>e.text()));e||(e=yield fetch("https://icanhazip.com").then((e=>e.text()))),i.current=e}if(null===(t=null===(e=window.localStorage)||void 0===e?void 0:e.setItem)||void 0===t||t.call(e,"fbClientIp",JSON.stringify({client_ip_address:(null===(n=i.current)||void 0===n?void 0:n.replace("\n",""))||"",client_user_agent:navigator.userAgent||""})),null==r?void 0:r.id){const[e,t,n,i,s,u]=yield Promise.all([r.email?l(r.email):null,r.phone?l(r.phone):null,r.birthday?l(r.birthday.split("-").join("")):null,r.gender?"m":"f",r.city_name?l(r.city_name).then((e=>e.replace(/\s/g,""))):null,r.name?l(r.name):null]);o("_fbc"),o("_fbp");const d={user_id:r.id};u&&(d.fn=u),e&&(d.em=e),t&&(d.ph=t),n&&(d.db=n),s&&(d.ct=s),null===(c=null===(a=window.localStorage)||void 0===a?void 0:a.setItem)||void 0===c||c.call(a,"fbDataLayer_userInfo",JSON.stringify(d))}})),()=>{})),[r])},s=e=>{const n=t(),r=t(e);return a()||r.current===e||(n.current=r.current,r.current=e),n.current},u=e=>{const[o,a]=r(e),l=t(0),c=i((e=>{cancelAnimationFrame(l.current),l.current=requestAnimationFrame((()=>{a(e)}))}),[]);return n((()=>()=>cancelAnimationFrame(l.current))),[o,c]};export{s as a,u as b,c as u};