@hhgtech/hhg-components 1.29.88 → 1.29.89

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 (459) hide show
  1. package/build/{LastPeriod-235fc10e.js → LastPeriod-c8c46da3.js} +1 -1
  2. package/build/MobileBottomNavigationIcon-efacfc0c.js +193 -0
  3. package/build/{WhatsApp-e6406d8d.js → WhatsApp-8a1d6d0c.js} +1 -1
  4. package/build/adapters.js +18 -16
  5. package/build/atoms.js +47 -45
  6. package/build/babyGrowth.js +82 -80
  7. package/build/cache.js +2 -2
  8. package/build/care.js +28 -25
  9. package/build/careBookingSearchBar.js +1594 -0
  10. package/build/careBookingSearchBarV2.js +1665 -0
  11. package/build/components.js +125 -115
  12. package/build/{constants-2d046b25.js → constants-f5c5e2ae.js} +1 -1
  13. package/build/constants.js +3 -3
  14. package/build/constantsDomainLocales.js +1 -1
  15. package/build/constantsRiskScreener.js +2 -2
  16. package/build/constantsSite.js +2 -2
  17. package/build/{core-ab09e68b.js → core-58a245c5.js} +1 -1
  18. package/build/{dataTransform-945e5f4f.js → dataTransform-9ec385e3.js} +1 -1
  19. package/build/ecom.js +4 -4
  20. package/build/editor-40386fe7.js +986 -0
  21. package/build/embeddedHeathToolCards_babyGrowth.js +22 -20
  22. package/build/embeddedHeathToolCards_babyPoop.js +18 -16
  23. package/build/embeddedHeathToolCards_babyVaccine.js +21 -19
  24. package/build/embeddedHeathToolCards_bmi_bmi.js +25 -23
  25. package/build/embeddedHeathToolCards_bmrBmr.js +25 -23
  26. package/build/embeddedHeathToolCards_dueDate_dueDate.js +21 -19
  27. package/build/embeddedHeathToolCards_ovulation_ovulation.js +21 -19
  28. package/build/embeddedHeathToolCards_pwg_pwg.js +26 -24
  29. package/build/embeddedHeathToolCards_targetHeartRate.js +27 -25
  30. package/build/esm/{LastPeriod-fcd2b5ec.js → LastPeriod-46d6c03f.js} +1 -1
  31. package/build/esm/MobileBottomNavigationIcon-ae6490d7.js +185 -0
  32. package/build/esm/{WhatsApp-2f54ed26.js → WhatsApp-ed8ce0f2.js} +1 -1
  33. package/build/esm/adapters.js +18 -16
  34. package/build/esm/atoms.js +44 -42
  35. package/build/esm/babyGrowth.js +82 -80
  36. package/build/esm/cache.js +2 -2
  37. package/build/esm/care.js +26 -23
  38. package/build/esm/careBookingSearchBar.js +1582 -0
  39. package/build/esm/careBookingSearchBarV2.js +1655 -0
  40. package/build/esm/components.js +93 -83
  41. package/build/esm/{constants-b68073ea.js → constants-e9ebe043.js} +1 -1
  42. package/build/esm/constants.js +3 -3
  43. package/build/esm/constantsDomainLocales.js +1 -1
  44. package/build/esm/constantsRiskScreener.js +2 -2
  45. package/build/esm/constantsSite.js +2 -2
  46. package/build/esm/{core-bcdf3422.js → core-6d8629c2.js} +1 -1
  47. package/build/esm/{dataTransform-c3905a10.js → dataTransform-2023858d.js} +2 -2
  48. package/build/esm/ecom.js +4 -4
  49. package/build/esm/editor-82c3d476.js +959 -0
  50. package/build/esm/embeddedHeathToolCards_babyGrowth.js +22 -20
  51. package/build/esm/embeddedHeathToolCards_babyPoop.js +18 -16
  52. package/build/esm/embeddedHeathToolCards_babyVaccine.js +21 -19
  53. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +25 -23
  54. package/build/esm/embeddedHeathToolCards_bmrBmr.js +25 -23
  55. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +21 -19
  56. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +21 -19
  57. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +26 -24
  58. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +27 -25
  59. package/build/esm/{fixedBottomAdBlock-bb1a3c50.js → fixedBottomAdBlock-2af1606f.js} +26 -662
  60. package/build/esm/footer.js +20 -18
  61. package/build/esm/gAssets.js +2 -2
  62. package/build/esm/healthToolsCardWrapper.js +17 -15
  63. package/build/esm/healthToolsForm.js +33 -31
  64. package/build/esm/hooks.js +15 -15
  65. package/build/esm/i18n.js +2 -2
  66. package/build/esm/i18nV2.js +2 -2
  67. package/build/esm/{index-04146795.js → index-04ba5caa.js} +1 -1
  68. package/build/esm/{index-69c631bf.js → index-082a24ae.js} +12 -11
  69. package/build/esm/{index-478546e8.js → index-1313a7ac.js} +12 -11
  70. package/build/esm/{index-155daac5.js → index-13783871.js} +2 -2
  71. package/build/esm/{index-48fdf51c.js → index-16a4f1c7.js} +16 -15
  72. package/build/esm/{index-877a46df.js → index-19f27bd3.js} +2 -2
  73. package/build/esm/{index-8570e132.js → index-1a2bc551.js} +2 -2
  74. package/build/esm/{index-fcf9a2ce.js → index-275c8526.js} +14 -13
  75. package/build/esm/{index-0cf91429.js → index-277566f7.js} +1 -1
  76. package/build/esm/{index-67603e6c.js → index-2ac50d8f.js} +15 -14
  77. package/build/esm/{index-19a9a60d.js → index-2c4a2d31.js} +1 -1
  78. package/build/esm/{index-ef2b1e44.js → index-32a968a1.js} +6 -6
  79. package/build/esm/{index-cde1edae.js → index-346fd194.js} +21 -19
  80. package/build/esm/{index-b927d85a.js → index-38b87b21.js} +12 -11
  81. package/build/esm/{index-a7bfcfbd.js → index-46c22744.js} +6 -6
  82. package/build/esm/index-4cf37916.js +22 -0
  83. package/build/esm/{index-a715b700.js → index-4d27d02e.js} +15 -14
  84. package/build/esm/{index-9a0b3bcd.js → index-52d04cc5.js} +7 -7
  85. package/build/esm/index-538ca8aa.js +860 -0
  86. package/build/esm/{index-a2704991.js → index-57da0f13.js} +16 -88
  87. package/build/esm/{index-b4cab951.js → index-5e17f985.js} +16 -15
  88. package/build/esm/{index-83ab0594.js → index-605eed95.js} +35 -800
  89. package/build/esm/{index-5303fcd9.js → index-628c5e84.js} +2 -2
  90. package/build/esm/{index-321f0612.js → index-64b1cd5c.js} +1 -1
  91. package/build/esm/index-673fd5bd.js +1264 -0
  92. package/build/esm/{index-140ea208.js → index-70883b48.js} +17 -16
  93. package/build/esm/{index-e84f16f3.js → index-71c8b83f.js} +3 -142
  94. package/build/esm/{index-e5797070.js → index-72c269cf.js} +3 -3
  95. package/build/esm/index-7ad9db02.js +1030 -0
  96. package/build/esm/{index-17115a3b.js → index-7ca4ec53.js} +15 -14
  97. package/build/esm/{index-5a81cbdd.js → index-7decdf27.js} +1 -1
  98. package/build/esm/index-7e95ba03.js +144 -0
  99. package/build/esm/{index-11bc6557.js → index-84b3ef3d.js} +3 -3
  100. package/build/esm/{index-4e92aaf2.js → index-8b9c7b45.js} +3 -3
  101. package/build/esm/{index-63d30402.js → index-930b0a77.js} +16 -15
  102. package/build/esm/{index-2292c1f3.js → index-93c8863d.js} +2 -2
  103. package/build/esm/{index-29676661.js → index-949f771c.js} +6 -6
  104. package/build/esm/{index-7d97103f.js → index-99551970.js} +2 -2
  105. package/build/esm/{index-d3c3615e.js → index-9c268a93.js} +2 -2
  106. package/build/esm/{index-d10d5d1f.js → index-9d7d3a53.js} +4 -4
  107. package/build/esm/{index-69ca7b6a.js → index-9e220aaa.js} +2 -2
  108. package/build/esm/{index-58982ea1.js → index-a424a33d.js} +3 -3
  109. package/build/esm/{index-b23b0c82.js → index-a54b6536.js} +14 -13
  110. package/build/esm/{index-05075062.js → index-b09ced58.js} +1 -1
  111. package/build/esm/{index-1f944c2d.js → index-b5ed732f.js} +5 -5
  112. package/build/esm/{index-0e0f3ac6.js → index-b867d267.js} +1 -1
  113. package/build/esm/{index-2f06b1d8.js → index-c4b04b5f.js} +1 -1
  114. package/build/esm/{index-efdc151c.js → index-c5286b89.js} +12 -11
  115. package/build/esm/{index-2b20b8ce.js → index-cbb45a5d.js} +2 -2
  116. package/build/esm/{index-f42f0c66.js → index-d4dcfb68.js} +2 -2
  117. package/build/esm/{index-c0790cdc.js → index-dec46974.js} +20 -17
  118. package/build/esm/index-e19da15e.js +468 -0
  119. package/build/esm/{index-fbe76c43.js → index-e1d35fec.js} +7 -6
  120. package/build/esm/{index-58ed669e.js → index-e477c2a3.js} +23 -19
  121. package/build/esm/{index-7ab1ac4c.js → index-ed292946.js} +2 -2
  122. package/build/esm/index-f3f06437.js +281 -0
  123. package/build/esm/index.js +118 -98
  124. package/build/esm/index.styles-25454e9c.js +62 -0
  125. package/build/esm/interfaces/types/Subot.d.ts +3 -3
  126. package/build/esm/{labelSorting-db27bdad.js → labelSorting-27ecf45e.js} +4 -4
  127. package/build/esm/lead.js +22 -20
  128. package/build/esm/{logoIcon-6ed45e55.js → logoIcon-ef6d9e4c.js} +2 -2
  129. package/build/esm/mantine.js +24 -22
  130. package/build/esm/misc.js +18 -18
  131. package/build/esm/miscGetDynamicHealthTool.js +7 -7
  132. package/build/esm/miscGetSocialList.js +8 -8
  133. package/build/esm/miscScreenSizeContext.js +1 -1
  134. package/build/esm/mobileBottomNavigation.js +19 -0
  135. package/build/esm/mobileBottomNavigationIcon.js +10 -0
  136. package/build/esm/molecules.js +71 -64
  137. package/build/esm/moleculesArticleCard.js +85 -0
  138. package/build/esm/moleculesArticleCardV2.js +171 -0
  139. package/build/esm/navigation.js +40 -35
  140. package/build/esm/navigationLogoutPopup.js +116 -0
  141. package/build/esm/navigationProfileButton.js +43 -0
  142. package/build/esm/{normalizeLink-fcd22117.js → normalizeLink-d756e5e6.js} +1 -1
  143. package/build/esm/onboardingV2.js +27 -25
  144. package/build/esm/organisms.js +46 -41
  145. package/build/esm/post-86117110.js +267 -0
  146. package/build/esm/profileNavigation.js +441 -0
  147. package/build/esm/progressBar.js +250 -0
  148. package/build/esm/pwg.js +21 -19
  149. package/build/esm/{routing-ed745cc6.js → routing-b81b8f17.js} +1 -1
  150. package/build/esm/subot.js +29 -27
  151. package/build/esm/surveyOrPremiumBanner.js +30 -28
  152. package/build/esm/surveyQuestionCard.js +10 -10
  153. package/build/esm/{surveyThankyouCard-6fc9a327.js → surveyThankyouCard-1b30aa0b.js} +5 -5
  154. package/build/esm/together.js +53 -44
  155. package/build/esm/togetherApiUtils.js +4 -4
  156. package/build/esm/togetherAtoms.js +29 -26
  157. package/build/esm/togetherComponentGlobalContext.js +4 -4
  158. package/build/esm/togetherMolecules.js +56 -47
  159. package/build/esm/togetherMoleculesCardAuthor.js +41 -0
  160. package/build/esm/togetherMoleculesPostImagePreview.js +21 -0
  161. package/build/esm/togetherMoleculesProfileDetail.js +53 -0
  162. package/build/esm/togetherOrganisms.js +53 -44
  163. package/build/esm/togetherRichTextEditor.js +27 -0
  164. package/build/esm/togetherShareBox.js +305 -0
  165. package/build/esm/{treePopoverMenu-937ef815.js → treePopoverMenu-04ded0ef.js} +18 -17
  166. package/build/esm/types-3eb97d85.js +44 -0
  167. package/build/esm/types.js +2 -2
  168. package/build/esm/{useCategory-d239339f.js → useCategory-391ffab0.js} +5 -5
  169. package/build/esm/{useHealthToolCache-e6e0e96c.js → useHealthToolCache-931ab3ca.js} +1 -1
  170. package/build/esm/{useMantineLocale-2ece6eac.js → useMantineLocale-b29ca68b.js} +5 -5
  171. package/build/esm/{usePlacesAutocomplete-ecf31643.js → usePlacesAutocomplete-91226a4d.js} +1 -1
  172. package/build/esm/useTogetherAuthRequiredAction.js +4 -4
  173. package/build/esm/{useTranslations-160e66cc.js → useTranslations-b66d9f2b.js} +1 -1
  174. package/build/esm/utils-92e2bc22.js +206 -0
  175. package/build/esm/{utils-d78e02e6.js → utils-f4b925d7.js} +2 -2
  176. package/build/esm/{utils-3d9043fb.js → utils-f873578b.js} +4 -4
  177. package/build/esm/vaccination.js +20 -18
  178. package/build/{fixedBottomAdBlock-87988744.js → fixedBottomAdBlock-605a8692.js} +49 -691
  179. package/build/footer.js +20 -18
  180. package/build/gAssets.js +2 -2
  181. package/build/healthToolsCardWrapper.js +17 -15
  182. package/build/healthToolsForm.js +33 -31
  183. package/build/hooks.js +15 -15
  184. package/build/i18n.js +1 -1
  185. package/build/i18nV2.js +1 -1
  186. package/build/{index-6ce119f5.js → index-0afde39e.js} +2 -2
  187. package/build/{index-bac0bd08.js → index-0cb2de9d.js} +3 -3
  188. package/build/{index-84e8b355.js → index-188e2316.js} +15 -14
  189. package/build/index-1b06e81f.js +151 -0
  190. package/build/{index-fcf16e35.js → index-1cdccd4e.js} +2 -2
  191. package/build/index-27e50de1.js +478 -0
  192. package/build/{index-a688f865.js → index-32abfb15.js} +12 -11
  193. package/build/{index-a136cba7.js → index-36723718.js} +6 -6
  194. package/build/{index-9e92431c.js → index-36ba9947.js} +2 -2
  195. package/build/{index-5006f129.js → index-3c593ede.js} +6 -6
  196. package/build/{index-6c2d2f25.js → index-4bf6b5da.js} +24 -99
  197. package/build/{index-5ddda8f4.js → index-4fd69136.js} +16 -15
  198. package/build/{index-6313ec6f.js → index-526cee72.js} +6 -6
  199. package/build/{index-92e82d0d.js → index-549b9e8c.js} +1 -1
  200. package/build/{index-a6acde43.js → index-5b52b076.js} +38 -34
  201. package/build/{index-8b8263ed.js → index-5dbd317c.js} +34 -33
  202. package/build/index-5dcd87b7.js +289 -0
  203. package/build/{index-e4004288.js → index-648aac83.js} +2 -2
  204. package/build/{index-c294ccc2.js → index-6b7b4292.js} +3 -3
  205. package/build/{index-2de1a14d.js → index-6b95442c.js} +2 -2
  206. package/build/{index-9add51eb.js → index-6b9e8dda.js} +3 -3
  207. package/build/{index-b040447b.js → index-767f9ac6.js} +2 -2
  208. package/build/{index-1ebaa446.js → index-7ce45455.js} +16 -15
  209. package/build/{index-f05721a0.js → index-81ff6094.js} +7 -7
  210. package/build/{index-03834ac7.js → index-86ecfc48.js} +3 -3
  211. package/build/{index-66b34bd9.js → index-8a19ce1b.js} +96 -864
  212. package/build/{index-f3553904.js → index-8d9663db.js} +9 -8
  213. package/build/{index-227e17fd.js → index-9151d357.js} +2 -2
  214. package/build/index-922020ed.js +1045 -0
  215. package/build/{index-347a91f6.js → index-a76596ef.js} +1 -1
  216. package/build/{index-1489f027.js → index-a839c6ca.js} +3 -3
  217. package/build/{index-4dc41ef1.js → index-a8705384.js} +1 -1
  218. package/build/{index-b8620e16.js → index-aad249ab.js} +2 -2
  219. package/build/{index-92815934.js → index-af48fea3.js} +5 -5
  220. package/build/{index-ae03f378.js → index-b04c5212.js} +16 -15
  221. package/build/{index-7e8732ae.js → index-b4fd3100.js} +1 -1
  222. package/build/{index-f3f648e1.js → index-be0a9d63.js} +17 -16
  223. package/build/{index-d9559ac1.js → index-be262a50.js} +2 -2
  224. package/build/index-becfec7a.js +1307 -0
  225. package/build/index-bf3796aa.js +870 -0
  226. package/build/{index-196d4981.js → index-cc4ce0c4.js} +1 -1
  227. package/build/{index-9f995309.js → index-cd0db938.js} +34 -31
  228. package/build/{index-c016b1bb.js → index-d0610b0f.js} +14 -13
  229. package/build/{index-554ad68c.js → index-d393d57e.js} +1 -1
  230. package/build/{index-0772398f.js → index-d471ff2d.js} +1 -1
  231. package/build/{index-7024d536.js → index-d5d9ceb9.js} +15 -14
  232. package/build/{index-1245ea43.js → index-de26b5d1.js} +12 -11
  233. package/build/{index-7ca746d3.js → index-dec3abcf.js} +15 -14
  234. package/build/{index-a97a7a53.js → index-e018af91.js} +31 -29
  235. package/build/index-e8dc7fdb.js +29 -0
  236. package/build/{index-4a6c95fe.js → index-f30e56f1.js} +12 -11
  237. package/build/{index-519a6287.js → index-f6b32484.js} +12 -11
  238. package/build/{index-d39f2445.js → index-f91ed3be.js} +4 -4
  239. package/build/{index-e7b871b4.js → index-faa2908c.js} +3 -143
  240. package/build/{index-9cc21262.js → index-fbb369ff.js} +1 -1
  241. package/build/{index-f8a51099.js → index-fde11604.js} +2 -2
  242. package/build/index.js +182 -162
  243. package/build/index.styles-9031f6d6.js +65 -0
  244. package/build/interfaces/types/Subot.d.ts +3 -3
  245. package/build/{labelSorting-60b0f16a.js → labelSorting-11165c8e.js} +4 -4
  246. package/build/lead.js +22 -20
  247. package/build/{logoIcon-8e1ff0aa.js → logoIcon-f3283bfd.js} +2 -2
  248. package/build/mantine.js +20 -18
  249. package/build/misc.js +18 -18
  250. package/build/miscGetDynamicHealthTool.js +7 -7
  251. package/build/miscGetSocialList.js +8 -8
  252. package/build/miscScreenSizeContext.js +1 -1
  253. package/build/mobileBottomNavigation.js +27 -0
  254. package/build/mobileBottomNavigationIcon.js +18 -0
  255. package/build/molecules.js +76 -69
  256. package/build/moleculesArticleCard.js +93 -0
  257. package/build/moleculesArticleCardV2.js +180 -0
  258. package/build/navigation.js +40 -35
  259. package/build/navigationLogoutPopup.js +125 -0
  260. package/build/navigationProfileButton.js +51 -0
  261. package/build/onboardingV2.js +29 -27
  262. package/build/organisms.js +49 -44
  263. package/build/post-0fec66f4.js +303 -0
  264. package/build/profileNavigation.js +450 -0
  265. package/build/progressBar.js +260 -0
  266. package/build/pwg.js +21 -19
  267. package/build/{routing-d764168d.js → routing-7a9c8608.js} +1 -1
  268. package/build/subot.js +28 -26
  269. package/build/surveyOrPremiumBanner.js +30 -28
  270. package/build/surveyQuestionCard.js +10 -10
  271. package/build/{surveyThankyouCard-944ab001.js → surveyThankyouCard-db73c893.js} +5 -5
  272. package/build/together.js +77 -68
  273. package/build/togetherApiUtils.js +4 -4
  274. package/build/togetherAtoms.js +29 -26
  275. package/build/togetherComponentGlobalContext.js +4 -4
  276. package/build/togetherMolecules.js +79 -70
  277. package/build/togetherMoleculesCardAuthor.js +49 -0
  278. package/build/togetherMoleculesPostImagePreview.js +29 -0
  279. package/build/togetherMoleculesProfileDetail.js +70 -0
  280. package/build/togetherOrganisms.js +53 -44
  281. package/build/togetherRichTextEditor.js +36 -0
  282. package/build/togetherShareBox.js +314 -0
  283. package/build/{treePopoverMenu-0cbe3fd0.js → treePopoverMenu-61ebd05c.js} +18 -17
  284. package/build/types-57052089.js +52 -0
  285. package/build/types.js +2 -2
  286. package/build/{useCategory-32558796.js → useCategory-d9f73b82.js} +5 -5
  287. package/build/{useHealthToolCache-cbe4b1b4.js → useHealthToolCache-4b5bfb11.js} +1 -1
  288. package/build/{useMantineLocale-992ae094.js → useMantineLocale-cc272195.js} +5 -5
  289. package/build/{usePlacesAutocomplete-c19d396b.js → usePlacesAutocomplete-a0156f14.js} +1 -1
  290. package/build/useTogetherAuthRequiredAction.js +4 -4
  291. package/build/{useTranslations-5d28e8df.js → useTranslations-8a9fa84d.js} +1 -1
  292. package/build/{utils-1a876a51.js → utils-251b2841.js} +3 -3
  293. package/build/{utils-d3353e9c.js → utils-c29214c6.js} +2 -2
  294. package/build/utils-f47b2d2d.js +229 -0
  295. package/build/vaccination.js +24 -22
  296. package/package.json +1 -1
  297. package/build/esm/index-c7b92115.js +0 -5060
  298. package/build/esm/types-f387cdcf.js +0 -3433
  299. package/build/index-2ce324cf.js +0 -5123
  300. package/build/types-d798cef3.js +0 -3447
  301. /package/build/{BMI_BOYS.percentile.monthly-2fdec618.js → BMI_BOYS.percentile.monthly-5f29289b.js} +0 -0
  302. /package/build/{BMI_BOYS.percentile.weekly-4b1616c4.js → BMI_BOYS.percentile.weekly-53584232.js} +0 -0
  303. /package/build/{BMI_BOYS.percentile.yearly-f7761749.js → BMI_BOYS.percentile.yearly-84aaf8fb.js} +0 -0
  304. /package/build/{BMI_BOYS.zscore.monthly-6767b0d4.js → BMI_BOYS.zscore.monthly-76d7fd0e.js} +0 -0
  305. /package/build/{BMI_BOYS.zscore.weekly-5c57342b.js → BMI_BOYS.zscore.weekly-ed3d66f2.js} +0 -0
  306. /package/build/{BMI_BOYS.zscore.yearly-d970734e.js → BMI_BOYS.zscore.yearly-7e74f0e8.js} +0 -0
  307. /package/build/{BMI_GIRLS.percentile.monthly-ba4d972d.js → BMI_GIRLS.percentile.monthly-6973d8b0.js} +0 -0
  308. /package/build/{BMI_GIRLS.percentile.weekly-f73dacf3.js → BMI_GIRLS.percentile.weekly-a873a4e6.js} +0 -0
  309. /package/build/{BMI_GIRLS.percentile.yearly-a5b59a8c.js → BMI_GIRLS.percentile.yearly-e86761bb.js} +0 -0
  310. /package/build/{BMI_GIRLS.zscore.monthly-110d6823.js → BMI_GIRLS.zscore.monthly-9a12fa84.js} +0 -0
  311. /package/build/{BMI_GIRLS.zscore.weekly-cfe97ba9.js → BMI_GIRLS.zscore.weekly-5936ed5b.js} +0 -0
  312. /package/build/{BMI_GIRLS.zscore.yearly-ab4ae640.js → BMI_GIRLS.zscore.yearly-d40d8356.js} +0 -0
  313. /package/build/{ChevronDown-d37704eb.js → ChevronDown-a6775d48.js} +0 -0
  314. /package/build/{Close-1514c815.js → Close-9fa735bc.js} +0 -0
  315. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-6c797045.js → HEAD CIRCUM_BOYS.percentile.monthly-873a839f.js} +0 -0
  316. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-7ac501c0.js → HEAD CIRCUM_BOYS.percentile.weekly-bbe3965d.js} +0 -0
  317. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-2999cdb8.js → HEAD CIRCUM_BOYS.percentile.yearly-645dfc78.js} +0 -0
  318. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-7e3a78aa.js → HEAD CIRCUM_BOYS.zscore.monthly-9fe137bf.js} +0 -0
  319. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-2ea72789.js → HEAD CIRCUM_BOYS.zscore.weekly-2ccb15fb.js} +0 -0
  320. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-826ab425.js → HEAD CIRCUM_BOYS.zscore.yearly-48aed724.js} +0 -0
  321. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-0f1636c1.js → HEAD CIRCUM_GIRLS.percentile.monthly-d99d6d30.js} +0 -0
  322. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-b32da590.js → HEAD CIRCUM_GIRLS.percentile.weekly-8a49b504.js} +0 -0
  323. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-850c4e29.js → HEAD CIRCUM_GIRLS.percentile.yearly-d747b0cd.js} +0 -0
  324. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-f942b53a.js → HEAD CIRCUM_GIRLS.zscore.monthly-8ef18721.js} +0 -0
  325. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-26daad32.js → HEAD CIRCUM_GIRLS.zscore.weekly-853cca20.js} +0 -0
  326. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-0f331108.js → HEAD CIRCUM_GIRLS.zscore.yearly-4d5b2175.js} +0 -0
  327. /package/build/{HEIGHT_BOYS.percentile.monthly-6bfc3799.js → HEIGHT_BOYS.percentile.monthly-070590b8.js} +0 -0
  328. /package/build/{HEIGHT_BOYS.percentile.weekly-0ed4b053.js → HEIGHT_BOYS.percentile.weekly-56741428.js} +0 -0
  329. /package/build/{HEIGHT_BOYS.percentile.yearly-cc4c343d.js → HEIGHT_BOYS.percentile.yearly-9c81f767.js} +0 -0
  330. /package/build/{HEIGHT_BOYS.zscore.monthly-b2d384dc.js → HEIGHT_BOYS.zscore.monthly-729982c3.js} +0 -0
  331. /package/build/{HEIGHT_BOYS.zscore.weekly-b65aa792.js → HEIGHT_BOYS.zscore.weekly-ddb206fb.js} +0 -0
  332. /package/build/{HEIGHT_BOYS.zscore.yearly-0bae3840.js → HEIGHT_BOYS.zscore.yearly-5fc7ea6a.js} +0 -0
  333. /package/build/{HEIGHT_GIRLS.percentile.monthly-34960fd2.js → HEIGHT_GIRLS.percentile.monthly-8cbc8d18.js} +0 -0
  334. /package/build/{HEIGHT_GIRLS.percentile.weekly-949ca5b1.js → HEIGHT_GIRLS.percentile.weekly-7145e94f.js} +0 -0
  335. /package/build/{HEIGHT_GIRLS.percentile.yearly-4c40b714.js → HEIGHT_GIRLS.percentile.yearly-ab0e4f4e.js} +0 -0
  336. /package/build/{HEIGHT_GIRLS.zscore.monthly-a3856728.js → HEIGHT_GIRLS.zscore.monthly-b851b1d7.js} +0 -0
  337. /package/build/{HEIGHT_GIRLS.zscore.weekly-b39f321f.js → HEIGHT_GIRLS.zscore.weekly-98aef3cf.js} +0 -0
  338. /package/build/{HEIGHT_GIRLS.zscore.yearly-f50c6d58.js → HEIGHT_GIRLS.zscore.yearly-65d990f7.js} +0 -0
  339. /package/build/{Locale-e3b7ae56.js → Locale-07aceee9.js} +0 -0
  340. /package/build/{Visible-c6736a66.js → Visible-ddeaf4cc.js} +0 -0
  341. /package/build/{WEIGHT_BOYS.percentile.monthly-685aabfc.js → WEIGHT_BOYS.percentile.monthly-0ce96694.js} +0 -0
  342. /package/build/{WEIGHT_BOYS.percentile.weekly-3c1a6d2f.js → WEIGHT_BOYS.percentile.weekly-b5397f20.js} +0 -0
  343. /package/build/{WEIGHT_BOYS.percentile.yearly-2bd65c8f.js → WEIGHT_BOYS.percentile.yearly-80cccd42.js} +0 -0
  344. /package/build/{WEIGHT_BOYS.zscore.monthly-bba8cd92.js → WEIGHT_BOYS.zscore.monthly-12907f1f.js} +0 -0
  345. /package/build/{WEIGHT_BOYS.zscore.weekly-7bdc0673.js → WEIGHT_BOYS.zscore.weekly-a1af17eb.js} +0 -0
  346. /package/build/{WEIGHT_BOYS.zscore.yearly-32f635e0.js → WEIGHT_BOYS.zscore.yearly-2649ff58.js} +0 -0
  347. /package/build/{WEIGHT_GIRLS.percentile.monthly-ad305e84.js → WEIGHT_GIRLS.percentile.monthly-222d7201.js} +0 -0
  348. /package/build/{WEIGHT_GIRLS.percentile.weekly-92e552b6.js → WEIGHT_GIRLS.percentile.weekly-2997b740.js} +0 -0
  349. /package/build/{WEIGHT_GIRLS.percentile.yearly-df0dd71c.js → WEIGHT_GIRLS.percentile.yearly-3dc5928a.js} +0 -0
  350. /package/build/{WEIGHT_GIRLS.zscore.monthly-8820671b.js → WEIGHT_GIRLS.zscore.monthly-742b7617.js} +0 -0
  351. /package/build/{WEIGHT_GIRLS.zscore.weekly-31d29b05.js → WEIGHT_GIRLS.zscore.weekly-5ee1ca40.js} +0 -0
  352. /package/build/{WEIGHT_GIRLS.zscore.yearly-f731d1e2.js → WEIGHT_GIRLS.zscore.yearly-d6ca7d60.js} +0 -0
  353. /package/build/{animation-b224626d.js → animation-a1ed71d8.js} +0 -0
  354. /package/build/{cart-149e990d.js → cart-7bc1b943.js} +0 -0
  355. /package/build/{constants-f9eca9ad.js → constants-4cad9f4d.js} +0 -0
  356. /package/build/{constants-9c314450.js → constants-81b95117.js} +0 -0
  357. /package/build/{constants-42eed92d.js → constants-c3b9c9a9.js} +0 -0
  358. /package/build/{dataTransform-104761fc.js → dataTransform-867c472c.js} +0 -0
  359. /package/build/{doctor-d8f36158.js → doctor-dca6d1b2.js} +0 -0
  360. /package/build/esm/{BMI_BOYS.percentile.monthly-df1b3770.js → BMI_BOYS.percentile.monthly-2388d98f.js} +0 -0
  361. /package/build/esm/{BMI_BOYS.percentile.weekly-1d9595b1.js → BMI_BOYS.percentile.weekly-8ebe6955.js} +0 -0
  362. /package/build/esm/{BMI_BOYS.percentile.yearly-6bd2bb46.js → BMI_BOYS.percentile.yearly-3a97e95b.js} +0 -0
  363. /package/build/esm/{BMI_BOYS.zscore.monthly-658792d1.js → BMI_BOYS.zscore.monthly-f7572dcd.js} +0 -0
  364. /package/build/esm/{BMI_BOYS.zscore.weekly-d3c4d378.js → BMI_BOYS.zscore.weekly-d6281906.js} +0 -0
  365. /package/build/esm/{BMI_BOYS.zscore.yearly-8ad375e2.js → BMI_BOYS.zscore.yearly-fbebaaca.js} +0 -0
  366. /package/build/esm/{BMI_GIRLS.percentile.monthly-25f98c64.js → BMI_GIRLS.percentile.monthly-a75c8880.js} +0 -0
  367. /package/build/esm/{BMI_GIRLS.percentile.weekly-d60b034d.js → BMI_GIRLS.percentile.weekly-652bc9af.js} +0 -0
  368. /package/build/esm/{BMI_GIRLS.percentile.yearly-0560df43.js → BMI_GIRLS.percentile.yearly-8bcb5a6e.js} +0 -0
  369. /package/build/esm/{BMI_GIRLS.zscore.monthly-2104651f.js → BMI_GIRLS.zscore.monthly-ecbe2982.js} +0 -0
  370. /package/build/esm/{BMI_GIRLS.zscore.weekly-37757497.js → BMI_GIRLS.zscore.weekly-3abed735.js} +0 -0
  371. /package/build/esm/{BMI_GIRLS.zscore.yearly-56872c59.js → BMI_GIRLS.zscore.yearly-d88a34a0.js} +0 -0
  372. /package/build/esm/{ChevronDown-5633c5e8.js → ChevronDown-dfd91883.js} +0 -0
  373. /package/build/esm/{Close-f541a904.js → Close-b8fc27b1.js} +0 -0
  374. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-47e6539d.js → HEAD CIRCUM_BOYS.percentile.monthly-ff980a90.js} +0 -0
  375. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-594e065d.js → HEAD CIRCUM_BOYS.percentile.weekly-eb86eac9.js} +0 -0
  376. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-d24f1cc6.js → HEAD CIRCUM_BOYS.percentile.yearly-27ed6504.js} +0 -0
  377. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-94d82cb5.js → HEAD CIRCUM_BOYS.zscore.monthly-0d345597.js} +0 -0
  378. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-cb0109d0.js → HEAD CIRCUM_BOYS.zscore.weekly-c182ab46.js} +0 -0
  379. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-79a794c9.js → HEAD CIRCUM_BOYS.zscore.yearly-d45dbce1.js} +0 -0
  380. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-89615b43.js → HEAD CIRCUM_GIRLS.percentile.monthly-61919e45.js} +0 -0
  381. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-29d9184f.js → HEAD CIRCUM_GIRLS.percentile.weekly-51fa8f98.js} +0 -0
  382. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-140da49d.js → HEAD CIRCUM_GIRLS.percentile.yearly-c1fa6006.js} +0 -0
  383. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-fe41d0e8.js → HEAD CIRCUM_GIRLS.zscore.monthly-4dfc55d8.js} +0 -0
  384. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-c6193e75.js → HEAD CIRCUM_GIRLS.zscore.weekly-b21b5bf1.js} +0 -0
  385. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-7018fed4.js → HEAD CIRCUM_GIRLS.zscore.yearly-c42836fa.js} +0 -0
  386. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-fae5e6a0.js → HEIGHT_BOYS.percentile.monthly-24ff8afa.js} +0 -0
  387. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-ddc33aee.js → HEIGHT_BOYS.percentile.weekly-2be7b66e.js} +0 -0
  388. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-9e3064f0.js → HEIGHT_BOYS.percentile.yearly-ac02aa2d.js} +0 -0
  389. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-7c9e0bb8.js → HEIGHT_BOYS.zscore.monthly-b43667dc.js} +0 -0
  390. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-50b0a6a0.js → HEIGHT_BOYS.zscore.weekly-abcfcf3a.js} +0 -0
  391. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-afb6c4a2.js → HEIGHT_BOYS.zscore.yearly-71598c16.js} +0 -0
  392. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-5c7487f0.js → HEIGHT_GIRLS.percentile.monthly-7f9d679c.js} +0 -0
  393. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-33465e14.js → HEIGHT_GIRLS.percentile.weekly-6ce1d4e7.js} +0 -0
  394. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-ae62b279.js → HEIGHT_GIRLS.percentile.yearly-c398fd6b.js} +0 -0
  395. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-fd13c492.js → HEIGHT_GIRLS.zscore.monthly-8d33bc28.js} +0 -0
  396. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-f509ffbe.js → HEIGHT_GIRLS.zscore.weekly-eb44c302.js} +0 -0
  397. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-bf3a867b.js → HEIGHT_GIRLS.zscore.yearly-10b4d1fe.js} +0 -0
  398. /package/build/esm/{Locale-81beb37e.js → Locale-b86a7a92.js} +0 -0
  399. /package/build/esm/{Visible-3d8c22f1.js → Visible-69da852f.js} +0 -0
  400. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-4db4c32c.js → WEIGHT_BOYS.percentile.monthly-fd349fe7.js} +0 -0
  401. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-5321689a.js → WEIGHT_BOYS.percentile.weekly-d5e52d60.js} +0 -0
  402. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-0c2aee80.js → WEIGHT_BOYS.percentile.yearly-929119b3.js} +0 -0
  403. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-ddf307e5.js → WEIGHT_BOYS.zscore.monthly-3f0f08cd.js} +0 -0
  404. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-be1d57ac.js → WEIGHT_BOYS.zscore.weekly-b9fd3298.js} +0 -0
  405. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-6dab88ff.js → WEIGHT_BOYS.zscore.yearly-9945948d.js} +0 -0
  406. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-a666fe8a.js → WEIGHT_GIRLS.percentile.monthly-1e83ae51.js} +0 -0
  407. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-cd85042c.js → WEIGHT_GIRLS.percentile.weekly-c3531852.js} +0 -0
  408. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-f22705ec.js → WEIGHT_GIRLS.percentile.yearly-3c0040b0.js} +0 -0
  409. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-9f3f1083.js → WEIGHT_GIRLS.zscore.monthly-3baeda15.js} +0 -0
  410. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-7dcf0ba5.js → WEIGHT_GIRLS.zscore.weekly-2d8e6618.js} +0 -0
  411. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-c658040c.js → WEIGHT_GIRLS.zscore.yearly-826f5bdd.js} +0 -0
  412. /package/build/esm/{animation-db89f033.js → animation-7207941a.js} +0 -0
  413. /package/build/esm/{cart-47013af9.js → cart-4f482601.js} +0 -0
  414. /package/build/esm/{constants-f9614464.js → constants-0497b893.js} +0 -0
  415. /package/build/esm/{constants-247d5eb0.js → constants-af02be2a.js} +0 -0
  416. /package/build/esm/{constants-410be40f.js → constants-f7943ab2.js} +0 -0
  417. /package/build/esm/{dataTransform-f9e5b4ec.js → dataTransform-610e61bf.js} +0 -0
  418. /package/build/esm/{doctor-88e78d2c.js → doctor-63e09ada.js} +0 -0
  419. /package/build/esm/{index-907fffe6.js → index-20192854.js} +0 -0
  420. /package/build/esm/{index-c3d6b2ed.js → index-20199246.js} +0 -0
  421. /package/build/esm/{index-6dd5a329.js → index-5364f2db.js} +0 -0
  422. /package/build/esm/{index-0ca51fbb.js → index-56d0ac47.js} +0 -0
  423. /package/build/esm/{index-24f2f569.js → index-9f076f64.js} +0 -0
  424. /package/build/esm/{index-6f44d928.js → index-a2506e52.js} +0 -0
  425. /package/build/esm/{index-5f214b71.js → index-c130afdc.js} +0 -0
  426. /package/build/esm/{index-fcd9b927.js → index-c9467e39.js} +0 -0
  427. /package/build/esm/{localizeNumberFormat-be70a31e.js → localizeNumberFormat-3bf28240.js} +0 -0
  428. /package/build/esm/{number-7e3f376a.js → number-d26abebe.js} +0 -0
  429. /package/build/esm/{other-811b7d93.js → other-08d0b30e.js} +0 -0
  430. /package/build/esm/{paths-650d5eee.js → paths-ce59b252.js} +0 -0
  431. /package/build/esm/{translationsContext-0cbb21e6.js → translationsContext-8afb0ce3.js} +0 -0
  432. /package/build/esm/{tslib.es6-3970c414.js → tslib.es6-e0840efa.js} +0 -0
  433. /package/build/esm/{types-78bfaf40.js → types-41242882.js} +0 -0
  434. /package/build/esm/{useIsInit-3f7af1fd.js → useIsInit-f59c6bd2.js} +0 -0
  435. /package/build/esm/{useOutsideClick-2fae5fb5.js → useOutsideClick-12815e56.js} +0 -0
  436. /package/build/esm/{useScrollbarSize-2a7e6dd2.js → useScrollbarSize-431cf33c.js} +0 -0
  437. /package/build/esm/{useUniqueId-d714426d.js → useUniqueId-8f710187.js} +0 -0
  438. /package/build/esm/{utils-cee25689.js → utils-8a1f05c9.js} +0 -0
  439. /package/build/{index-27f25094.js → index-017f99b2.js} +0 -0
  440. /package/build/{index-1d528960.js → index-1a6a94cd.js} +0 -0
  441. /package/build/{index-41a348a2.js → index-668f591b.js} +0 -0
  442. /package/build/{index-32917720.js → index-70abc2ac.js} +0 -0
  443. /package/build/{index-20a5cee0.js → index-c6b0831a.js} +0 -0
  444. /package/build/{index-9f501aac.js → index-ce2d2850.js} +0 -0
  445. /package/build/{index-186f9324.js → index-e3e72aed.js} +0 -0
  446. /package/build/{index-e327613c.js → index-f70c0edf.js} +0 -0
  447. /package/build/{localizeNumberFormat-a5804ea2.js → localizeNumberFormat-30e7f015.js} +0 -0
  448. /package/build/{normalizeLink-2878a2ce.js → normalizeLink-c1b2b407.js} +0 -0
  449. /package/build/{number-35662113.js → number-20d56f69.js} +0 -0
  450. /package/build/{other-a7f01b3d.js → other-eedaf6ca.js} +0 -0
  451. /package/build/{paths-488dafd4.js → paths-4c182009.js} +0 -0
  452. /package/build/{translationsContext-951038ad.js → translationsContext-cd046df4.js} +0 -0
  453. /package/build/{tslib.es6-145af9ce.js → tslib.es6-f3c387c0.js} +0 -0
  454. /package/build/{types-aeea2cc2.js → types-2614ec58.js} +0 -0
  455. /package/build/{useIsInit-0c37752a.js → useIsInit-e56642e4.js} +0 -0
  456. /package/build/{useOutsideClick-aa477d22.js → useOutsideClick-f18dfe3f.js} +0 -0
  457. /package/build/{useScrollbarSize-01b12b72.js → useScrollbarSize-4aaa4dd1.js} +0 -0
  458. /package/build/{useUniqueId-17c2097b.js → useUniqueId-621ec272.js} +0 -0
  459. /package/build/{utils-a1cfbdac.js → utils-ae9740c0.js} +0 -0
@@ -0,0 +1,1655 @@
1
+ import React__default, { useMemo, useRef, useCallback, useState, useReducer, useEffect } from 'react';
2
+ import { Skeleton, Input, Divider, Tabs, Flex, Button } from '@mantine/core';
3
+ import { i as checkMarkIconUrl, P as PinIcon, h as getApiPath, u as useGeolocation } from './utils-92e2bc22.js';
4
+ import { a as useOutsideClick } from './useOutsideClick-12815e56.js';
5
+ import { u as useTranslations } from './useTranslations-b66d9f2b.js';
6
+ import debounce from 'lodash/debounce';
7
+ import { a as ID_OPTION_CURRENT_LOCATION, M as MAPPING_CLIENT_WITH_SLUG, L as LOCALIZED_SLUGS, I as ID_OPTION_ALL_LOCATION, S as SLUG_VACIN_ID, C as CLIENT_KEY } from './constants-f7943ab2.js';
8
+ import styled from '@emotion/styled';
9
+ import { theme } from './miscTheme.js';
10
+ import { M as MediaQueries } from './utils-8a1f05c9.js';
11
+ import { C as Container } from './index-c9467e39.js';
12
+ import { Search } from '@hhgtech/icons/core';
13
+ import { T as Text } from './index-99551970.js';
14
+ import { C as ChevronDown } from './ChevronDown-dfd91883.js';
15
+ import { P as PATHS } from './paths-ce59b252.js';
16
+ import './index-9e220aaa.js';
17
+ import 'date-fns/locale';
18
+ import './index-7decdf27.js';
19
+ import './Locale-b86a7a92.js';
20
+ import './constantsIsProduction.js';
21
+ import './constantsSite.js';
22
+ import './constantsDomainLocales.js';
23
+ import './constantsRiskScreener.js';
24
+ import './miscCookieHelper.js';
25
+ import 'react-loading-skeleton';
26
+ import 'string-format';
27
+ import './translationsContext-8afb0ce3.js';
28
+ import './tslib.es6-e0840efa.js';
29
+ import './other-08d0b30e.js';
30
+
31
+ const StyledSearchBarWrapper = styled.div ``;
32
+ const StyleWrapperContainer = styled.div `
33
+ background-color: ${theme.colors.neutral50};
34
+ padding-bottom: 1px;
35
+ ${MediaQueries.mbDown} {
36
+ padding: 0 16px 10px;
37
+ }
38
+ `;
39
+ const StyleSearchInputContainer = styled(Container) `
40
+ padding: 0 16px;
41
+
42
+ ${MediaQueries.mbDown} {
43
+ padding: 0;
44
+ }
45
+ `;
46
+ const StyleSearchContent = styled.div `
47
+ padding: 24px 56px;
48
+ border-radius: 16px;
49
+ background-color: ${theme.colors.white};
50
+ box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.04),
51
+ 0px 0px 2px 0px rgba(0, 0, 0, 0.06), 0px 4px 8px 0px rgba(0, 0, 0, 0.04);
52
+
53
+ ${MediaQueries.mbDown} {
54
+ padding: 16px 16px;
55
+ border-radius: 0px 0px 12px 12px;
56
+ }
57
+
58
+ .flex-search-input {
59
+ flex-direction: row;
60
+ ${MediaQueries.mbDown} {
61
+ flex-direction: column;
62
+ }
63
+ }
64
+ `;
65
+
66
+ const SEARCH_KEYWORD_MIN_LENGTH = {
67
+ 'en-PH': 3,
68
+ 'tl-PH': 2,
69
+ 'id-ID': 3,
70
+ 'vi-VN': 2,
71
+ 'zh-TW': 0,
72
+ 'ms-MY': 2,
73
+ };
74
+
75
+ const initialState = {
76
+ isMobile: false,
77
+ isDebug: false,
78
+ navigateTo: null,
79
+ geoLocationPermission: 'unset',
80
+ geoLocationCoordinates: null,
81
+ focused: 'none',
82
+ focusedSpecialty: 'none',
83
+ searchLocationKeywords: '',
84
+ searchSpecialtyKeywords: '',
85
+ searchKeywords: '',
86
+ selectedLocation: null,
87
+ selectedSpecialty: null,
88
+ defaultCity: null,
89
+ initialCities: [],
90
+ cities: [],
91
+ searchResults: {},
92
+ initialSearchResults: {},
93
+ isLoadingCities: false,
94
+ isLoadingSearchResults: false,
95
+ isMobileModalOpened: false,
96
+ initialSelectedCity: null,
97
+ autoCompleteDisabled: false,
98
+ inputSearchPlaceholder: '',
99
+ locale: 'vi-VN',
100
+ allSpecialties: [],
101
+ popularKeys: [],
102
+ };
103
+ var ActionTypes;
104
+ (function (ActionTypes) {
105
+ ActionTypes["NavigateTo"] = "navigate to url";
106
+ ActionTypes["ClickOutsideInputLocation"] = "click outside input location";
107
+ ActionTypes["ClickOutsideInputSearch"] = "click outside input search";
108
+ ActionTypes["ClickOutsideInputSearchSpecialty"] = "click outside input search specialty";
109
+ ActionTypes["ClickOutsideInputSpecialty"] = "click outside input specialty";
110
+ ActionTypes["SelectCurrentLocation"] = "select current location";
111
+ ActionTypes["FocusInputLocation"] = "focus input location";
112
+ ActionTypes["FocusInputSearch"] = "focus input search";
113
+ ActionTypes["FocusInputSearchSpecialty"] = "focus input search specialty";
114
+ ActionTypes["ChangeInputLocation"] = "change input location";
115
+ ActionTypes["ChangeInputSearch"] = "change input search";
116
+ ActionTypes["ClearInputLocation"] = "clear input location";
117
+ ActionTypes["ClearInputSearch"] = "clear input search";
118
+ ActionTypes["SelectLocation"] = "select location";
119
+ ActionTypes["SelectSpecialty"] = "select specialty";
120
+ ActionTypes["FetchCitiesStart"] = "fetch cities start";
121
+ ActionTypes["FetchCitiesFinish"] = "fetch cities finish";
122
+ ActionTypes["FetchSearchResultsStart"] = "fetch search results start";
123
+ ActionTypes["FetchSearchResultsComplete"] = "fetch search results complete";
124
+ ActionTypes["FetchSearchResultsFinish"] = "fetch search results finish";
125
+ ActionTypes["FetchCitiesByGeoIpComplete"] = "fetch cities by geo IP finish";
126
+ ActionTypes["FetchCitiesByKeywordComplete"] = "fetch cities by keyword finish";
127
+ ActionTypes["DisplayInitialCities"] = "display initial cities";
128
+ ActionTypes["DisplayInitialSearchResults"] = "display initial search results";
129
+ ActionTypes["UpdateInitialSearchResults"] = "update initial search results";
130
+ ActionTypes["GrantGeoLocationPermission"] = "grant geolocation permission";
131
+ ActionTypes["DenyGeoLocationPermission"] = "deny geolocation permission";
132
+ ActionTypes["OpenMobileModal"] = "open mobile modal";
133
+ ActionTypes["CloseMobileModal"] = "close mobile modal";
134
+ ActionTypes["UpdateInitialSearchValue"] = "update initial search value";
135
+ ActionTypes["SelectSearchResult"] = "select search result";
136
+ ActionTypes["SetInputSearchPlaceholder"] = "set input search placeholder";
137
+ ActionTypes["FocusInputSpecialty"] = "focus input specialty";
138
+ ActionTypes["FetchAllSpecialties"] = "fetch all specialty";
139
+ ActionTypes["FetchPopularKeys"] = "fetch popular key by type";
140
+ })(ActionTypes || (ActionTypes = {}));
141
+ function resetSearchLocationKeywords(state) {
142
+ const { selectedLocation, searchLocationKeywords } = state;
143
+ if (selectedLocation && searchLocationKeywords !== selectedLocation.name) {
144
+ return Object.assign(Object.assign({}, state), { searchLocationKeywords: selectedLocation.name });
145
+ }
146
+ return state;
147
+ }
148
+ function reducer(state, action) {
149
+ var _a, _b;
150
+ if (state.isDebug) {
151
+ console.log('bookingSearchBar', { action, state });
152
+ }
153
+ switch (action.type) {
154
+ case ActionTypes.NavigateTo:
155
+ return Object.assign(Object.assign({}, state), { navigateTo: action.payload, focused: 'none', isMobileModalOpened: false });
156
+ case ActionTypes.ClickOutsideInputLocation: {
157
+ if (state.focused !== 'location') {
158
+ return state;
159
+ }
160
+ return resetSearchLocationKeywords(Object.assign(Object.assign({}, state), { focused: 'none' }));
161
+ }
162
+ case ActionTypes.ClickOutsideInputSpecialty: {
163
+ if (state.focused !== 'specialty') {
164
+ return state;
165
+ }
166
+ return resetSearchLocationKeywords(Object.assign(Object.assign({}, state), { focused: 'none' }));
167
+ }
168
+ case ActionTypes.ClickOutsideInputSearch: {
169
+ if (state.focused !== 'search') {
170
+ return state;
171
+ }
172
+ return Object.assign(Object.assign({}, state), { focused: 'none' });
173
+ }
174
+ case ActionTypes.ClickOutsideInputSearchSpecialty: {
175
+ if (state.focusedSpecialty !== 'search') {
176
+ return state;
177
+ }
178
+ return Object.assign(Object.assign({}, state), { focusedSpecialty: 'none' });
179
+ }
180
+ case ActionTypes.FocusInputLocation: {
181
+ const nextState = Object.assign(Object.assign({}, state), { focused: 'location' });
182
+ if (((_a = state.selectedLocation) === null || _a === void 0 ? void 0 : _a.id) === ID_OPTION_CURRENT_LOCATION) {
183
+ nextState.searchLocationKeywords = '';
184
+ }
185
+ return nextState;
186
+ }
187
+ case ActionTypes.FocusInputSpecialty: {
188
+ const nextState = Object.assign(Object.assign({}, state), { focused: 'specialty' });
189
+ if (((_b = state.selectedLocation) === null || _b === void 0 ? void 0 : _b.id) === ID_OPTION_CURRENT_LOCATION) {
190
+ nextState.searchLocationKeywords = '';
191
+ }
192
+ return nextState;
193
+ }
194
+ case ActionTypes.FocusInputSearch:
195
+ const nextState = Object.assign(Object.assign({}, state), { focused: 'search' });
196
+ if (state.isMobile) {
197
+ return resetSearchLocationKeywords(nextState);
198
+ }
199
+ return nextState;
200
+ case ActionTypes.FocusInputSearchSpecialty: {
201
+ const nextState = Object.assign(Object.assign({}, state), { focusedSpecialty: 'search' });
202
+ return nextState;
203
+ }
204
+ case ActionTypes.ChangeInputLocation:
205
+ return Object.assign(Object.assign({}, state), { searchLocationKeywords: action.payload });
206
+ case ActionTypes.ChangeInputSearch: {
207
+ const keyword = action.payload;
208
+ return Object.assign(Object.assign({}, state), { searchKeywords: keyword, isLoadingSearchResults: keyword.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale] });
209
+ }
210
+ case ActionTypes.SelectCurrentLocation:
211
+ return Object.assign(Object.assign({}, state), { focused: 'none', selectedLocation: action.payload, searchLocationKeywords: action.payload.name });
212
+ case ActionTypes.ClearInputLocation:
213
+ return Object.assign(Object.assign({}, state), { focused: 'location', cities: state.initialCities, searchLocationKeywords: '' });
214
+ case ActionTypes.ClearInputSearch:
215
+ return Object.assign(Object.assign({}, state), { focused: 'search', searchKeywords: '' });
216
+ case ActionTypes.SelectLocation:
217
+ return Object.assign(Object.assign({}, state), { focused: 'none', selectedLocation: action.payload, searchLocationKeywords: action.payload.name });
218
+ case ActionTypes.SelectSpecialty:
219
+ return Object.assign(Object.assign({}, state), { focused: 'none', selectedSpecialty: action.payload });
220
+ case ActionTypes.SelectSearchResult:
221
+ return Object.assign(Object.assign({}, state), { searchKeywords: action.payload.name, isMobileModalOpened: false, focused: 'none', navigateTo: action.payload.url });
222
+ case ActionTypes.FetchCitiesStart:
223
+ return Object.assign(Object.assign({}, state), { isLoadingCities: true });
224
+ case ActionTypes.FetchCitiesFinish:
225
+ return Object.assign(Object.assign({}, state), { isLoadingCities: false });
226
+ case ActionTypes.FetchSearchResultsStart:
227
+ return Object.assign(Object.assign({}, state), { isLoadingSearchResults: true });
228
+ case ActionTypes.FetchSearchResultsFinish:
229
+ return Object.assign(Object.assign({}, state), { isLoadingSearchResults: false });
230
+ case ActionTypes.FetchSearchResultsComplete: {
231
+ const nextState = Object.assign(Object.assign({}, state), { searchResults: Object.assign(Object.assign({}, state.searchResults), { [action.payload.key]: action.payload.searches }) });
232
+ return nextState;
233
+ }
234
+ case ActionTypes.FetchCitiesByGeoIpComplete: {
235
+ let { cities } = action.payload;
236
+ const { default: defaultCity } = action.payload;
237
+ cities = cities.filter((c) => c.id !== defaultCity.id);
238
+ if (defaultCity) {
239
+ cities.unshift(defaultCity);
240
+ }
241
+ if (state.initialSelectedCity &&
242
+ !cities.find((c) => c.id === state.initialSelectedCity.id)) {
243
+ cities.unshift(state.initialSelectedCity);
244
+ }
245
+ const nextState = Object.assign(Object.assign({}, state), { defaultCity, initialCities: cities, cities });
246
+ if (state.geoLocationPermission === 'denied' &&
247
+ !state.initialSelectedCity) {
248
+ nextState.selectedLocation = defaultCity;
249
+ nextState.searchLocationKeywords = defaultCity.name;
250
+ }
251
+ return nextState;
252
+ }
253
+ case ActionTypes.FetchCitiesByKeywordComplete:
254
+ return Object.assign(Object.assign({}, state), { cities: action.payload });
255
+ case ActionTypes.DisplayInitialCities:
256
+ return Object.assign(Object.assign({}, state), { cities: state.initialCities });
257
+ case ActionTypes.DisplayInitialSearchResults:
258
+ return Object.assign(Object.assign({}, state), { searchResults: state.initialSearchResults, isLoadingSearchResults: false });
259
+ case ActionTypes.UpdateInitialSearchResults:
260
+ return Object.assign(Object.assign({}, state), { initialSearchResults: Object.assign(Object.assign({}, state.initialSearchResults), { [action.payload.key]: action.payload.searches }) });
261
+ case ActionTypes.GrantGeoLocationPermission:
262
+ return Object.assign(Object.assign({}, state), { geoLocationPermission: 'granted', geoLocationCoordinates: action.payload });
263
+ case ActionTypes.DenyGeoLocationPermission:
264
+ return Object.assign(Object.assign({}, state), { geoLocationPermission: 'denied', geoLocationCoordinates: null });
265
+ case ActionTypes.OpenMobileModal:
266
+ return Object.assign(Object.assign({}, state), { isMobileModalOpened: true });
267
+ case ActionTypes.CloseMobileModal:
268
+ return Object.assign(Object.assign({}, state), { isMobileModalOpened: false });
269
+ case ActionTypes.UpdateInitialSearchValue:
270
+ return Object.assign(Object.assign({}, state), { searchKeywords: action.payload });
271
+ case ActionTypes.SetInputSearchPlaceholder:
272
+ return Object.assign(Object.assign({}, state), { inputSearchPlaceholder: action.payload });
273
+ case ActionTypes.FetchAllSpecialties:
274
+ return Object.assign(Object.assign({}, state), { allSpecialties: action.payload });
275
+ case ActionTypes.FetchPopularKeys:
276
+ return Object.assign(Object.assign({}, state), { popularKeys: action.payload });
277
+ default:
278
+ return state;
279
+ }
280
+ }
281
+
282
+ const StyleSearchInputsWrapper = styled.div `
283
+ flex: 1;
284
+ position: relative;
285
+
286
+ ${MediaQueries.mbDown} {
287
+ width: 100%;
288
+ display: flex;
289
+ flex-direction: column;
290
+ gap: 12px;
291
+ }
292
+ `;
293
+ const StyleResultWrapper$2 = styled.div `
294
+ position: absolute;
295
+ top: calc(100% + 2px);
296
+ width: 100%;
297
+ border-radius: 4px;
298
+ background: ${theme.colors.white};
299
+ box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1);
300
+ z-index: 10;
301
+
302
+ ${MediaQueries.mbDown} {
303
+ width: calc(100% + 64px);
304
+ left: -32px;
305
+ }
306
+ `;
307
+
308
+ const StyledSearchResultWrapper = styled.div ``;
309
+ const StyleResultHeader = styled.div `
310
+ display: flex;
311
+ justify-content: space-between;
312
+ align-item: center;
313
+ padding: 9px 14px 9px 22px;
314
+ background: #f7f9fc;
315
+
316
+ .title {
317
+ color: ${theme.colors.gray800};
318
+ font-size: 14px;
319
+ font-weight: 600;
320
+ line-height: 22px;
321
+ }
322
+
323
+ .btn-see-all {
324
+ color: ${theme.colors.blue600};
325
+ font-size: 14px;
326
+ line-height: 22px;
327
+ cursor: pointer;
328
+ }
329
+ `;
330
+ const StyleResultBody = styled.div `
331
+ padding: 10px 16px;
332
+ max-height: 400px;
333
+ overflow: auto;
334
+ `;
335
+ const StyleResultItem = styled.div `
336
+ display: flex;
337
+ gap: 12px;
338
+ align-items: center;
339
+ cursor: pointer;
340
+
341
+ &:hover {
342
+ background-color: ${theme.colors.blue50};
343
+ }
344
+ .image-item {
345
+ flex: 0 0 48px;
346
+ width: 48px;
347
+ height: 48px;
348
+ border-radius: 50%;
349
+
350
+ img {
351
+ object-fit: contain;
352
+ width: 100%;
353
+ height: 100%;
354
+ border-radius: 50%;
355
+ }
356
+ }
357
+ .infor {
358
+ overflow: hidden;
359
+ padding: 12px 0;
360
+ flex: 1;
361
+ border-bottom: 1px solid ${theme.colors.neutral100};
362
+ .title {
363
+ color: ${theme.colors.gray800};
364
+ font-size: 16px;
365
+ font-weight: 600;
366
+ line-height: 24px;
367
+ }
368
+ .description {
369
+ overflow: hidden;
370
+ color: ${theme.colors.gray600};
371
+ text-overflow: ellipsis;
372
+ white-space: nowrap;
373
+ font-size: 12px;
374
+ line-height: 18px;
375
+ display: flex;
376
+ gap: 8px;
377
+ align-items: center;
378
+ margin-top: 5px;
379
+
380
+ svg {
381
+ flex: 0 0 16px;
382
+ }
383
+
384
+ .sub-description {
385
+ overflow: hidden;
386
+ white-space: nowrap;
387
+ text-overflow: ellipsis;
388
+ flex: 1;
389
+ }
390
+ }
391
+ }
392
+
393
+ &.last-item {
394
+ .infor {
395
+ border-bottom: none;
396
+ }
397
+ }
398
+ `;
399
+ styled.div `
400
+ padding: 0 16px 16px;
401
+
402
+ .search-detail-btn {
403
+ color: ${theme.colors.blue600};
404
+ font-size: 14px;
405
+ line-height: 22px;
406
+ cursor: pointer;
407
+ }
408
+ `;
409
+
410
+ const SearchResult = ({ state, type, results, location, isLoading, typeInformation, clientSlug = '', dispatch, }) => {
411
+ const { locale, t } = useTranslations();
412
+ const { selectedLocation } = state;
413
+ const typeSlug = useMemo(() => typeInformation[type].slug, [typeInformation, type]);
414
+ const handleOnClick = (item) => {
415
+ let url = '';
416
+ switch (type) {
417
+ case 'service':
418
+ url = `/${selectedLocation.slug}/${typeSlug}/${item.slug}`;
419
+ break;
420
+ case 'doctor':
421
+ case 'hospital':
422
+ url = `/${typeSlug}/${item.slug}-${item.id}`;
423
+ break;
424
+ }
425
+ if (url) {
426
+ dispatch({
427
+ type: ActionTypes.NavigateTo,
428
+ payload: url,
429
+ });
430
+ }
431
+ };
432
+ const handleSeeAll = () => {
433
+ let url = `/${selectedLocation.slug}/${typeSlug}`;
434
+ const slugClientUrl = MAPPING_CLIENT_WITH_SLUG[locale][clientSlug];
435
+ if (slugClientUrl) {
436
+ url += `/${slugClientUrl}`;
437
+ }
438
+ if ((type === 'doctor' || type === 'hospital') &&
439
+ state.selectedSpecialty.id > 0) {
440
+ url += `?specialtyId=${state.selectedSpecialty.id}`;
441
+ }
442
+ if (url) {
443
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
444
+ }
445
+ };
446
+ return (React__default.createElement(StyledSearchResultWrapper, null,
447
+ React__default.createElement(StyleResultHeader, null,
448
+ React__default.createElement("div", { className: "title" }, t('booking.searchResult.description', {
449
+ search_type: typeInformation[type].name,
450
+ search_location: location,
451
+ })),
452
+ results.length > 0 && (React__default.createElement("div", { className: "btn-see-all", onClick: handleSeeAll }, t('home.seeAll')))),
453
+ React__default.createElement(StyleResultBody, null,
454
+ isLoading &&
455
+ Array(3)
456
+ .fill(undefined)
457
+ .map((_, i) => (React__default.createElement(StyleResultItem, { key: type + 'loading' + i, className: i === 2 ? 'last-item' : '' },
458
+ React__default.createElement("div", { className: "image-item" },
459
+ React__default.createElement(Skeleton, { height: 48, circle: true, mb: "xl", animate: true })),
460
+ React__default.createElement("div", { className: "infor" },
461
+ React__default.createElement("div", { className: "title" },
462
+ React__default.createElement(Skeleton, { height: 8, mt: 10, radius: "xl", animate: true })),
463
+ React__default.createElement("div", { className: "description" },
464
+ React__default.createElement("div", { className: "sub-description" },
465
+ React__default.createElement(Skeleton, { height: 8, mt: 10, radius: "xl", width: "80%", animate: true }))))))),
466
+ !isLoading && results && results.length > 0 && (React__default.createElement(React__default.Fragment, null, results.map((item, index) => {
467
+ var _a, _b;
468
+ const isLastItem = (results.length > 4 && index === 3) ||
469
+ (results.length <= 4 && index === results.length - 1);
470
+ let subDescription = '';
471
+ if (type === 'hospital') {
472
+ subDescription = (item === null || item === void 0 ? void 0 : item.address) || '';
473
+ }
474
+ if (type === 'doctor') {
475
+ subDescription = ((_a = item === null || item === void 0 ? void 0 : item.specialties) === null || _a === void 0 ? void 0 : _a.join(', ')) || '';
476
+ }
477
+ if (type === 'service') {
478
+ subDescription = ((_b = item === null || item === void 0 ? void 0 : item.hospital_branch) === null || _b === void 0 ? void 0 : _b.name) || '';
479
+ }
480
+ if (index >= 4) {
481
+ return React__default.createElement(React__default.Fragment, null);
482
+ }
483
+ return (React__default.createElement(StyleResultItem, { key: item.id, className: isLastItem ? 'last-item' : '', onClick: () => handleOnClick(item) },
484
+ React__default.createElement("div", { className: "image-item" },
485
+ React__default.createElement("img", { src: item.logo || item.avatar, alt: item.name })),
486
+ React__default.createElement("div", { className: "infor" },
487
+ React__default.createElement("div", { className: "title" }, item.name),
488
+ React__default.createElement("div", { className: "description" },
489
+ typeInformation[type].icon,
490
+ React__default.createElement("div", { className: "sub-description" }, subDescription)))));
491
+ }))),
492
+ !isLoading && (results === null || results === void 0 ? void 0 : results.length) === 0 && (React__default.createElement(Text, { size: "sm", color: theme.colors.gray400 }, t('booking.searchBar.noResults'))))));
493
+ };
494
+
495
+ const StyleSearchSpecialtyWrapper = styled.div `
496
+ position: relative;
497
+
498
+ ${MediaQueries.mbDown} {
499
+ width: 100%;
500
+ display: flex;
501
+ flex-direction: column;
502
+ gap: 12px;
503
+ }
504
+ `;
505
+ const StyleResultWrapper$1 = styled.div `
506
+ position: absolute;
507
+ top: calc(100% + 2px);
508
+ width: calc(100% + 100px);
509
+ border-radius: 4px;
510
+ background: ${theme.colors.white};
511
+ box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1);
512
+ z-index: 10;
513
+ max-height: 300px;
514
+ overflow: auto;
515
+
516
+ ${MediaQueries.mbDown} {
517
+ width: calc(100% + 64px);
518
+ left: -32px;
519
+ }
520
+ `;
521
+ const StyledSpecialtyItem = styled.li `
522
+ position: relative;
523
+ cursor: pointer;
524
+ padding: 12px 18px;
525
+ display: flex;
526
+ align-items: center;
527
+ gap: 14px;
528
+ overflow: hidden;
529
+
530
+ .image-item {
531
+ display: flex;
532
+ align-items: center;
533
+ width: 40px;
534
+ height: 40px;
535
+
536
+ img {
537
+ width: 100%;
538
+ object-fit: cover;
539
+ }
540
+
541
+ svg {
542
+ width: 40px;
543
+ }
544
+ }
545
+
546
+ ${({ isSelected }) => isSelected &&
547
+ `
548
+ &::after {
549
+ content: ${checkMarkIconUrl};
550
+ top: 50%;
551
+ right: 18px;
552
+ position: absolute;
553
+ transform: translateY(-50%);
554
+ }
555
+ `}
556
+
557
+ & + li::before {
558
+ content: '';
559
+ position: absolute;
560
+ left: 18px;
561
+ right: 18px;
562
+ top: 0;
563
+ height: 1px;
564
+ background-color: ${theme.colors.neutral100};
565
+ }
566
+
567
+ &:not([data-is-denied='true']):hover {
568
+ background-color: ${theme.colors.neutral50};
569
+ }
570
+
571
+ &:last-child:hover {
572
+ border-bottom-right-radius: 6px;
573
+ border-bottom-left-radius: 6px;
574
+ }
575
+
576
+ &:first-child:hover {
577
+ border-top-right-radius: 6px;
578
+ border-top-left-radius: 6px;
579
+ }
580
+
581
+ &[data-is-denied='true'] {
582
+ cursor: not-allowed;
583
+ }
584
+ `;
585
+
586
+ const DoctorIcon = () => (React__default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
587
+ React__default.createElement("path", { d: "M8.983 14.333q-1.666 0-2.833-1.166Q4.983 12 4.983 10.333v-.366a3.48 3.48 0 0 1-2.258-1.2 3.57 3.57 0 0 1-.909-2.434V3.1a.58.58 0 0 1 .175-.425.58.58 0 0 1 .425-.175h1.4v-.167a.486.486 0 0 1 .5-.5q.217 0 .36.142a.5.5 0 0 1 .14.358v1.334a.485.485 0 0 1-.5.5.484.484 0 0 1-.5-.5V3.5h-1v2.833q0 1.1.784 1.884Q4.383 9 5.483 9t1.883-.783.784-1.884V3.5h-1v.167a.485.485 0 0 1-.5.5.484.484 0 0 1-.5-.5V2.333a.486.486 0 0 1 .5-.5q.217 0 .358.142a.5.5 0 0 1 .142.358V2.5h1.4a.58.58 0 0 1 .425.175.58.58 0 0 1 .175.425v3.233q0 1.4-.908 2.434a3.5 3.5 0 0 1-2.259 1.2v.366q0 1.25.875 2.126a2.9 2.9 0 0 0 2.125.874q1.25 0 2.125-.874a2.9 2.9 0 0 0 .875-2.126V9.25a1.74 1.74 0 0 1-.858-.609 1.6 1.6 0 0 1-.342-1.008q0-.716.5-1.216t1.2-.5q.716 0 1.217.5.5.5.5 1.216 0 .567-.342 1.008t-.875.609v1.083q0 1.667-1.167 2.834-1.166 1.166-2.833 1.166m3.5-6q.3 0 .509-.208a.67.67 0 0 0 .208-.492q0-.3-.208-.508a.7.7 0 0 0-.509-.208q-.3 0-.5.208a.7.7 0 0 0-.2.508q0 .284.2.492t.5.208", fill: "#595959" })));
588
+ const ServiceIcon = () => (React__default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
589
+ React__default.createElement("path", { d: "M6.868 9.265v.974q0 .405.284.69.284.283.69.283t.69-.284.284-.69v-.973h.973q.405 0 .69-.284a.94.94 0 0 0 .284-.689.94.94 0 0 0-.284-.69.94.94 0 0 0-.69-.284h-.973v-.974a.94.94 0 0 0-.284-.69.94.94 0 0 0-.69-.284.94.94 0 0 0-.689.284.94.94 0 0 0-.285.69v.974h-.973a.94.94 0 0 0-.69.283.94.94 0 0 0-.284.69q0 .405.284.69.285.284.69.284zm-3.46 4.868q-.581 0-.994-.413A1.36 1.36 0 0 1 2 12.725v-6.65a1.4 1.4 0 0 1 .563-1.127l4.434-3.333q.369-.282.844-.282.474 0 .846.282l4.434 3.333q.264.193.413.493.15.3.15.633v6.651q0 .58-.414.995a1.36 1.36 0 0 1-.994.413zm0-1.168h8.868q.105 0 .172-.068a.23.23 0 0 0 .068-.172v-6.65a.2.2 0 0 0-.027-.11.3.3 0 0 0-.07-.085L7.983 2.554a.2.2 0 0 0-.142-.052.2.2 0 0 0-.142.052L3.266 5.88a.3.3 0 0 0-.071.086.2.2 0 0 0-.027.108v6.651q0 .105.068.172a.23.23 0 0 0 .172.068", fill: "#595959" })));
590
+ const HospitalIcon = () => (React__default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
591
+ React__default.createElement("path", { d: "M8 8q.55 0 .941-.392.393-.391.392-.941 0-.55-.392-.942A1.28 1.28 0 0 0 8 5.333q-.55 0-.942.392a1.28 1.28 0 0 0-.391.942q0 .55.391.941Q7.45 8 8 8m0 4.9q2.032-1.866 3.017-3.392Q12 7.983 12 6.8q0-1.817-1.158-2.975Q9.682 2.667 8 2.667T5.158 3.825Q4 4.983 4 6.8q0 1.184.983 2.708Q5.966 11.034 8 12.9m0 1.517a.8.8 0 0 1-.5-.183q-2.433-2.151-3.633-3.992T2.667 6.8q0-2.5 1.608-3.983Q5.883 1.332 8 1.333q2.116 0 3.725 1.484T13.333 6.8q0 1.6-1.2 3.442-1.2 1.841-3.633 3.991a.8.8 0 0 1-.5.184", fill: "#8C8C8C" })));
592
+ const SpecialtyIcon = () => (React__default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16" },
593
+ React__default.createElement("path", { d: "M3.833.5a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667M10.5.5c-.92 0-1.667.746-1.667 1.667V5.5c0 .92.746 1.667 1.667 1.667h3.333c.921 0 1.667-.746 1.667-1.667V2.167C15.5 1.246 14.754.5 13.833.5zM3.833 8.833a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667m8.334 0a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667", fill: "#9AA2AC" })));
594
+
595
+ const SearchSpecialty = ({ state, isMobile, debouncedFetchSearchResults, selectedLocation, onSpecialtyClick, dispatch, }) => {
596
+ var _a;
597
+ const { t, locale } = useTranslations();
598
+ const inputSpecialtyWrapperRef = useRef(null);
599
+ const slugs = useMemo(() => LOCALIZED_SLUGS[locale], [locale]);
600
+ const styleSpecialties = useMemo(() => {
601
+ return {
602
+ wrapper: {
603
+ '&:after': {
604
+ content: '""',
605
+ width: '1px',
606
+ height: '20px',
607
+ backgroundColor: '#E4E8EC',
608
+ position: 'absolute',
609
+ right: 0,
610
+ top: '13px',
611
+ },
612
+ },
613
+ input: {
614
+ border: isMobile ? 'border: 1px solid #d9d9d9' : 'none',
615
+ height: isMobile ? '40px' : '46px !important',
616
+ paddingRight: '30px',
617
+ '&:focus': {
618
+ boxShadow: isMobile ? 'box-shadow: 0px 0px 0px 2px #91caff' : 'none',
619
+ },
620
+ },
621
+ rightSection: {
622
+ width: '30px',
623
+ svg: {
624
+ fontSize: '20px',
625
+ },
626
+ },
627
+ };
628
+ }, [isMobile]);
629
+ const handleSearchSpecialtyInputChange = useCallback(function handleSearchSpecialtyInputChange(value) {
630
+ // dispatch({ type: ActionTypes.ChangeInputLocation, payload: value })
631
+ // if (value.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale]) {
632
+ // debouncedFetchSearchResults(value.trim())
633
+ // } else {
634
+ // debouncedFetchSearchResults.cancel()
635
+ // dispatch({ type: ActionTypes.DisplayInitialCities })
636
+ // }
637
+ console.log(value);
638
+ }, [debouncedFetchSearchResults, dispatch]);
639
+ useOutsideClick(inputSpecialtyWrapperRef, () => {
640
+ dispatch({ type: ActionTypes.ClickOutsideInputSpecialty });
641
+ });
642
+ return (React__default.createElement(StyleSearchSpecialtyWrapper, { ref: inputSpecialtyWrapperRef },
643
+ React__default.createElement(Input.Wrapper, null,
644
+ React__default.createElement(Input, { size: isMobile ? 'md' : 'lg', placeholder: t('booking.searchPopup.specialties'), value: ((_a = state === null || state === void 0 ? void 0 : state.selectedSpecialty) === null || _a === void 0 ? void 0 : _a.name) || '', rightSection: React__default.createElement(ChevronDown, null), styles: styleSpecialties, onFocus: () => dispatch({ type: ActionTypes.FocusInputSpecialty }), onChange: (event) => {
645
+ handleSearchSpecialtyInputChange(event.target.value);
646
+ } })),
647
+ state.focused === 'specialty' && (React__default.createElement(StyleResultWrapper$1, null,
648
+ React__default.createElement(StyledSpecialtyItem, { key: "all-location", role: "button", tabIndex: 0, onClick: () => {
649
+ if (onSpecialtyClick) {
650
+ onSpecialtyClick({
651
+ name: t('booking.searchBar.allSpecialties'),
652
+ id: -1,
653
+ thumbnail: '',
654
+ total_doctor: 0,
655
+ slug: slugs.SPECIALTIES,
656
+ });
657
+ }
658
+ } },
659
+ React__default.createElement("div", { className: "image-item" },
660
+ React__default.createElement(SpecialtyIcon, null)),
661
+ React__default.createElement(Text, { size: "md" }, t('booking.searchBar.allSpecialties'))),
662
+ state.allSpecialties.map((specialty) => (React__default.createElement(StyledSpecialtyItem, { key: specialty.id, onClick: (evt) => {
663
+ evt.nativeEvent.stopImmediatePropagation();
664
+ if (onSpecialtyClick) {
665
+ onSpecialtyClick(Object.assign(Object.assign({}, specialty), { total_doctor: 0 }));
666
+ }
667
+ }, role: "button", tabIndex: 0, "aria-label": `Select ${specialty.name} as location`, isSelected: (selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.id) === specialty.id },
668
+ React__default.createElement("div", { className: "image-item" },
669
+ React__default.createElement("img", { src: specialty.thumbnail, alt: specialty.name })),
670
+ React__default.createElement(Text, { size: "md" }, specialty.name))))))));
671
+ };
672
+
673
+ const SearchInputs = ({ state, type, isMobile, isLoading, initalSearchValue, typeInformation, debouncedFetchSearchResults, trackingAttributes, hideSpecialtySelection = false, clientSlug = '', focusSearchInput, onSearch, onEnterSearch, dispatch, }) => {
674
+ var _a;
675
+ const { t } = useTranslations();
676
+ const inputSearchWrapperRef = useRef(null);
677
+ const gaAttributes = useMemo(() => {
678
+ if (trackingAttributes) {
679
+ return {
680
+ 'data-event-category': trackingAttributes.dataEventCategory,
681
+ 'data-event-action': trackingAttributes.dataEventAction,
682
+ 'data-event-label': trackingAttributes.dataEventLabel,
683
+ };
684
+ }
685
+ else {
686
+ return {};
687
+ }
688
+ }, [trackingAttributes]);
689
+ const placeholderSearch = useMemo(() => {
690
+ if (type === 'doctor') {
691
+ return t('booking.searchBar.placeholder.doctor');
692
+ }
693
+ if (type === 'service') {
694
+ return t('booking.searchBar.placeholder.service');
695
+ }
696
+ if (type === 'hospital') {
697
+ return t('booking.searchBar.placeholder.hospital');
698
+ }
699
+ if (type === 'specialty') {
700
+ return t('booking.searchBar.placeholder.specialty');
701
+ }
702
+ return '';
703
+ }, [type]);
704
+ const styleInputWrapper = useMemo(() => {
705
+ return {
706
+ root: {
707
+ flex: 1,
708
+ '&.hide-specialty-selection': {
709
+ '.mantine-Input-rightSection': {
710
+ display: 'none',
711
+ },
712
+ input: {
713
+ paddingLeft: '48px',
714
+ },
715
+ '.mantine-Input-icon': {
716
+ left: '0',
717
+ },
718
+ },
719
+ },
720
+ };
721
+ }, []);
722
+ const styleInput = useMemo(() => {
723
+ return {
724
+ icon: {
725
+ left: '165px',
726
+ },
727
+ input: {
728
+ color: '#262626',
729
+ '&[data-with-icon="true"]': {
730
+ paddingLeft: '205px',
731
+ paddingRight: '16px',
732
+ },
733
+ },
734
+ rightSection: {
735
+ left: 0,
736
+ width: '165px',
737
+ padding: '1px',
738
+ },
739
+ };
740
+ }, []);
741
+ const styleInputSpecialties = useMemo(() => {
742
+ return {
743
+ input: {
744
+ color: '#262626',
745
+ },
746
+ };
747
+ }, []);
748
+ useOutsideClick(inputSearchWrapperRef, () => {
749
+ dispatch({ type: ActionTypes.ClickOutsideInputSearch });
750
+ });
751
+ const handleSearchInputChange = useCallback(function handleSearchInputChange(value) {
752
+ dispatch({ type: ActionTypes.ChangeInputSearch, payload: value });
753
+ if (typeof onSearch === 'function') {
754
+ return;
755
+ }
756
+ if (value.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale] ||
757
+ initalSearchValue ||
758
+ value.trim().length === 0) {
759
+ debouncedFetchSearchResults(value.trim(), state, type, clientSlug);
760
+ }
761
+ else {
762
+ debouncedFetchSearchResults.cancel();
763
+ dispatch({ type: ActionTypes.DisplayInitialSearchResults });
764
+ }
765
+ }, [dispatch, state, type]);
766
+ const handleSpecialtyClick = useCallback(function handleSpecialtyClick(specialty) {
767
+ dispatch({ type: ActionTypes.SelectSpecialty, payload: specialty });
768
+ focusSearchInput();
769
+ }, [dispatch]);
770
+ const inputOnKeyDown = useCallback((e) => {
771
+ if (e.keyCode === 13) {
772
+ e.stopPropagation();
773
+ e.preventDefault();
774
+ onEnterSearch && onEnterSearch();
775
+ }
776
+ }, [onEnterSearch]);
777
+ return (React__default.createElement(StyleSearchInputsWrapper, { ref: inputSearchWrapperRef }, type === 'specialty' ? (React__default.createElement(Input.Wrapper, { styles: styleInputWrapper },
778
+ React__default.createElement(Input, { icon: React__default.createElement(Search, null), size: isMobile ? 'md' : 'lg', placeholder: placeholderSearch, styles: styleInputSpecialties, value: state.searchKeywords, onFocus: () => dispatch({ type: ActionTypes.FocusInputSearchSpecialty }), onChange: (event) => {
779
+ handleSearchInputChange(event.target.value);
780
+ }, onKeyDown: inputOnKeyDown }))) : (React__default.createElement(React__default.Fragment, null,
781
+ type === 'service' ? (React__default.createElement(Input.Wrapper, { styles: styleInputWrapper },
782
+ React__default.createElement(Input, { icon: React__default.createElement(Search, null), size: isMobile ? 'md' : 'lg', name: "search-results", placeholder: placeholderSearch, onFocus: () => dispatch({ type: ActionTypes.FocusInputSearch }), value: state.searchKeywords, onChange: (event) => {
783
+ handleSearchInputChange(event.target.value);
784
+ }, onKeyDown: inputOnKeyDown }))) : (React__default.createElement(React__default.Fragment, null, isMobile && !hideSpecialtySelection ? (React__default.createElement(React__default.Fragment, null,
785
+ React__default.createElement(SearchSpecialty, { state: state, isMobile: isMobile, dispatch: dispatch, debouncedFetchSearchResults: debouncedFetchSearchResults, onSpecialtyClick: handleSpecialtyClick }),
786
+ React__default.createElement(Input.Wrapper, { styles: styleInputWrapper },
787
+ React__default.createElement(Input, { icon: React__default.createElement(Search, null), size: "md", placeholder: placeholderSearch, value: state.searchKeywords, name: "search-results", onFocus: () => dispatch({ type: ActionTypes.FocusInputSearch }), onChange: (event) => {
788
+ handleSearchInputChange(event.target.value);
789
+ }, onKeyDown: inputOnKeyDown })))) : (React__default.createElement(Input.Wrapper, { styles: styleInputWrapper, className: hideSpecialtySelection ? 'hide-specialty-selection' : '' },
790
+ React__default.createElement(Input, Object.assign({ icon: React__default.createElement(Search, null), size: "lg", placeholder: placeholderSearch, styles: styleInput, name: "search-results", autoComplete: "off", value: state.searchKeywords, onChange: (event) => {
791
+ handleSearchInputChange(event.target.value);
792
+ }, onFocus: () => dispatch({ type: ActionTypes.FocusInputSearch }), onKeyDown: inputOnKeyDown }, gaAttributes, { rightSection: hideSpecialtySelection ? (React__default.createElement(React__default.Fragment, null)) : (React__default.createElement(SearchSpecialty, { state: state, isMobile: isMobile, dispatch: dispatch, debouncedFetchSearchResults: debouncedFetchSearchResults, onSpecialtyClick: handleSpecialtyClick })) })))))),
793
+ state.focused === 'search' && (React__default.createElement(StyleResultWrapper$2, null,
794
+ React__default.createElement(SearchResult, { type: type, state: state, results: ((_a = state.searchResults) === null || _a === void 0 ? void 0 : _a[type]) || [], location: state.selectedLocation.name, dispatch: dispatch, isLoading: isLoading, typeInformation: typeInformation, clientSlug: clientSlug })))))));
795
+ };
796
+
797
+ const StyleSearchLocationWrapper = styled.div `
798
+ position: relative;
799
+
800
+ ${MediaQueries.mbDown} {
801
+ width: 100%;
802
+ display: flex;
803
+ flex-direction: column;
804
+ gap: 12px;
805
+ }
806
+ `;
807
+ const StyleResultWrapper = styled.div `
808
+ position: absolute;
809
+ top: calc(100% + 2px);
810
+ width: 100%;
811
+ border-radius: 4px;
812
+ background: ${theme.colors.white};
813
+ box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1);
814
+ z-index: 10;
815
+
816
+ ${MediaQueries.mbDown} {
817
+ width: calc(100% + 64px);
818
+ left: -32px;
819
+ }
820
+ `;
821
+ const StyledLocationItem = styled.li `
822
+ position: relative;
823
+ cursor: pointer;
824
+ padding: 12px 18px;
825
+ display: flex;
826
+ align-items: center;
827
+ gap: 14px;
828
+ overflow: hidden;
829
+
830
+ ${({ isSelected }) => isSelected &&
831
+ `
832
+ &::after {
833
+ content: ${checkMarkIconUrl};
834
+ top: 50%;
835
+ right: 18px;
836
+ position: absolute;
837
+ transform: translateY(-50%);
838
+ }
839
+ `}
840
+
841
+ & + li::before {
842
+ content: '';
843
+ position: absolute;
844
+ left: 18px;
845
+ right: 18px;
846
+ top: 0;
847
+ height: 1px;
848
+ background-color: ${theme.colors.neutral100};
849
+ }
850
+
851
+ &:not([data-is-denied='true']):hover {
852
+ background-color: ${theme.colors.neutral50};
853
+ }
854
+
855
+ &:last-child:hover {
856
+ border-bottom-right-radius: 6px;
857
+ border-bottom-left-radius: 6px;
858
+ }
859
+
860
+ &:first-child:hover {
861
+ border-top-right-radius: 6px;
862
+ border-top-left-radius: 6px;
863
+ }
864
+
865
+ &[data-is-denied='true'] {
866
+ cursor: not-allowed;
867
+ }
868
+ `;
869
+ const StyledPinIcon = styled(PinIcon) `
870
+ width: 12px;
871
+ height: 18px;
872
+ flex: 0 0 12px;
873
+ `;
874
+
875
+ const SearchLocation = ({ state, isMobile, debouncedFetchCitiesByKeyword, selectedLocation, trackingAttributes, onLocationClick, dispatch, }) => {
876
+ const { t, locale } = useTranslations();
877
+ const inputLocationWrapperRef = useRef(null);
878
+ const gaAttributes = useMemo(() => {
879
+ if (trackingAttributes) {
880
+ return {
881
+ 'data-event-category': trackingAttributes.dataEventCategory,
882
+ 'data-event-action': trackingAttributes.dataEventAction,
883
+ 'data-event-label': trackingAttributes.dataEventLabel,
884
+ };
885
+ }
886
+ else {
887
+ return {};
888
+ }
889
+ }, [trackingAttributes]);
890
+ const handleSearchLocationInputChange = useCallback(function handleSearchLocationInputChange(value) {
891
+ dispatch({ type: ActionTypes.ChangeInputLocation, payload: value });
892
+ if (value.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale]) {
893
+ debouncedFetchCitiesByKeyword(value.trim());
894
+ }
895
+ else {
896
+ debouncedFetchCitiesByKeyword.cancel();
897
+ dispatch({ type: ActionTypes.DisplayInitialCities });
898
+ }
899
+ }, [debouncedFetchCitiesByKeyword, dispatch]);
900
+ useOutsideClick(inputLocationWrapperRef, () => {
901
+ dispatch({ type: ActionTypes.ClickOutsideInputLocation });
902
+ });
903
+ return (React__default.createElement(StyleSearchLocationWrapper, { ref: inputLocationWrapperRef },
904
+ React__default.createElement(Input.Wrapper, null,
905
+ React__default.createElement(Input, Object.assign({ size: isMobile ? 'md' : 'lg', placeholder: "Search location", value: state.searchLocationKeywords, onFocus: () => dispatch({ type: ActionTypes.FocusInputLocation }), onChange: (event) => {
906
+ handleSearchLocationInputChange(event.target.value);
907
+ } }, gaAttributes))),
908
+ state.focused === 'location' && (React__default.createElement(StyleResultWrapper, null,
909
+ React__default.createElement(StyledLocationItem, { key: "all-location", role: "button", tabIndex: 0, onClick: () => {
910
+ var _a;
911
+ if (onLocationClick) {
912
+ onLocationClick({
913
+ name: t('booking.searchBar.allLocations'),
914
+ id: ID_OPTION_ALL_LOCATION,
915
+ slug: (_a = LOCALIZED_SLUGS[locale]) === null || _a === void 0 ? void 0 : _a.ALL,
916
+ });
917
+ }
918
+ } },
919
+ React__default.createElement(StyledPinIcon, { color: theme.colors.neutral400 }),
920
+ React__default.createElement(Text, { size: "md" }, t('booking.searchBar.allLocations'))),
921
+ state.cities.map((city) => (React__default.createElement(StyledLocationItem, { key: city.id, onClick: (evt) => {
922
+ evt.nativeEvent.stopImmediatePropagation();
923
+ if (onLocationClick) {
924
+ onLocationClick(city);
925
+ }
926
+ }, role: "button", tabIndex: 0, "aria-label": `Select ${city.name} as location`, isSelected: (selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.id) === city.id },
927
+ React__default.createElement(StyledPinIcon, { color: theme.colors.neutral400 }),
928
+ React__default.createElement(Text, { size: "md" }, city.name))))))));
929
+ };
930
+
931
+ const StyleSpecialtiesWrapper = styled.div `
932
+ display: flex;
933
+ flex-wrap: wrap;
934
+ row-gap: 8px;
935
+ column-gap: 20px;
936
+ ${MediaQueries.mbDown} {
937
+ margin-top: 12px;
938
+ }
939
+ `;
940
+ const StyleSpecialtyItem = styled.div `
941
+ display: flex;
942
+ align-items: center;
943
+ border-radius: 8px;
944
+ border: 1px solid ${theme.colors.neutral100};
945
+ background: ${theme.colors.white};
946
+ padding: 8px 12px 8px 8px;
947
+ flex: 0 0 calc(33.3% - 13px);
948
+ gap: 12px;
949
+ cursor: pointer;
950
+
951
+ &:hover {
952
+ background: ${theme.colors.blue50};
953
+ }
954
+
955
+ ${MediaQueries.tdDown} {
956
+ flex: 0 0 calc(50% - 10px);
957
+ }
958
+
959
+ ${MediaQueries.mbDown} {
960
+ flex: 0 0 100%;
961
+ border: none;
962
+ }
963
+
964
+ .image-item {
965
+ display: flex;
966
+ align-items: center;
967
+ width: 40px;
968
+ height: 40px;
969
+
970
+ img {
971
+ width: 100%;
972
+ object-fit: cover;
973
+ }
974
+ }
975
+
976
+ .infor {
977
+ flex: 1;
978
+ .title {
979
+ color: ${theme.colors.gray800};
980
+ font-size: 14px;
981
+ font-style: normal;
982
+ font-weight: 400;
983
+ line-height: 22px;
984
+ }
985
+
986
+ .description {
987
+ color: ${theme.colors.gray600};
988
+ font-size: 12px;
989
+ font-weight: 400;
990
+ line-height: 18px;
991
+ }
992
+ }
993
+ `;
994
+ const StyleDivider = styled(Divider) `
995
+ margin: 24px 0 !important;
996
+ `;
997
+ const StyleShowMore = styled.div `
998
+ display: flex;
999
+ justify-content: center;
1000
+ margin-top: 24px;
1001
+ .show-more {
1002
+ border-radius: 4px;
1003
+ border: 1px solid ${theme.colors.neutral200};
1004
+ padding: 12px 16px;
1005
+ cursor: pointer;
1006
+ display: inline-block;
1007
+ color: ${theme.colors.gray800};
1008
+ font-size: 16px;
1009
+ font-weight: 600;
1010
+ line-height: 24px;
1011
+
1012
+ ${MediaQueries.mbDown} {
1013
+ width: 100%;
1014
+ text-align: center;
1015
+ }
1016
+ }
1017
+ `;
1018
+
1019
+ const SearchResultSpecialties = ({ state, isMobile, specialties, isLoading, dispatch, }) => {
1020
+ const { t, locale } = useTranslations();
1021
+ const { selectedLocation } = state;
1022
+ const slugs = useMemo(() => LOCALIZED_SLUGS[locale], [locale]);
1023
+ const handleOnClick = (specialtySlug) => {
1024
+ let url = '';
1025
+ if (specialtySlug === SLUG_VACIN_ID) {
1026
+ url = `/${selectedLocation.slug}/${slugs.HOSPITAL}/${CLIENT_KEY.GSK}/`;
1027
+ dispatch({ type: ActionTypes.ClickOutsideInputSearchSpecialty });
1028
+ }
1029
+ else {
1030
+ url = `/${selectedLocation.slug}/${slugs.DOCTOR}/${specialtySlug}`;
1031
+ }
1032
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1033
+ };
1034
+ const handleShowMore = () => {
1035
+ const url = `/${slugs.SPECIALTIES}`;
1036
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1037
+ };
1038
+ const showSeeMore = useMemo(() => {
1039
+ return (specialties.length >= 9 ||
1040
+ state.searchKeywords.trim().length <=
1041
+ SEARCH_KEYWORD_MIN_LENGTH[state.locale]);
1042
+ }, [state.searchKeywords, specialties]);
1043
+ return (React__default.createElement(React__default.Fragment, null,
1044
+ !isMobile && React__default.createElement(StyleDivider, { color: "#E4E8EC" }),
1045
+ React__default.createElement(StyleSpecialtiesWrapper, null,
1046
+ specialties.length > 0 && !isLoading && (React__default.createElement(React__default.Fragment, null, specialties.map((specialty, index) => {
1047
+ if (index >= 9) {
1048
+ return React__default.createElement(React__default.Fragment, null);
1049
+ }
1050
+ return (React__default.createElement(StyleSpecialtyItem, { key: specialty.id, onClick: () => handleOnClick(specialty.slug) },
1051
+ React__default.createElement("div", { className: "image-item" },
1052
+ React__default.createElement("img", { src: specialty.thumbnail, alt: specialty.name })),
1053
+ React__default.createElement("div", { className: "infor" },
1054
+ React__default.createElement("div", { className: "title" }, specialty.name))));
1055
+ }))),
1056
+ specialties.length === 0 && !isLoading && (React__default.createElement(Text, { size: "sm", color: theme.colors.gray400 }, t('booking.searchBar.noResults'))),
1057
+ isLoading &&
1058
+ Array(6)
1059
+ .fill(undefined)
1060
+ .map((_, i) => (React__default.createElement(StyleSpecialtyItem, { key: 'loading' + i },
1061
+ React__default.createElement("div", { className: "image-item" },
1062
+ React__default.createElement(Skeleton, { height: 40, animate: true })),
1063
+ React__default.createElement("div", { className: "infor" },
1064
+ React__default.createElement("div", { className: "title" },
1065
+ React__default.createElement(Skeleton, { height: 20, radius: "sm", animate: true }))))))),
1066
+ showSeeMore && (React__default.createElement(StyleShowMore, null,
1067
+ React__default.createElement("div", { className: "show-more", onClick: handleShowMore }, t('home.seeAll'))))));
1068
+ };
1069
+
1070
+ const StyleSearchTagWrapper = styled.div `
1071
+ display: flex;
1072
+ gap: 5px;
1073
+ margin-top: 16px;
1074
+ flex-wrap: wrap;
1075
+ `;
1076
+ const StyleTagItem = styled.div `
1077
+ color: ${theme.colors.gray600};
1078
+ font-size: 14px;
1079
+ font-weight: 600;
1080
+ line-height: 22px;
1081
+ padding: 4px 12px;
1082
+ background: ${theme.colors.white};
1083
+ border-radius: 32px;
1084
+ cursor: pointer;
1085
+ border: 1px solid ${theme.colors.white};
1086
+ margin-bottom: 5px;
1087
+ border-color: ${theme.colors.neutral100};
1088
+ background: #f7f9fc;
1089
+
1090
+ &.view-all {
1091
+ border-radius: 32px;
1092
+ border-color: ${theme.colors.blue50};
1093
+ background: ${theme.colors.blue50};
1094
+ color: ${theme.colors.blue600};
1095
+
1096
+ &:hover {
1097
+ border-color: ${theme.colors.blue50};
1098
+ background: ${theme.colors.blue50};
1099
+ color: ${theme.colors.blue600};
1100
+ }
1101
+ }
1102
+
1103
+ &:hover {
1104
+ border-color: ${theme.colors.neutral100};
1105
+ background: #f7f9fc;
1106
+ }
1107
+ `;
1108
+ const StyleTagLabel = styled.div `
1109
+ color: ${theme.colors.gray600};
1110
+ font-size: 14px;
1111
+ font-weight: 600;
1112
+ line-height: 22px;
1113
+ padding: 4px 0;
1114
+ background: ${theme.colors.white};
1115
+ border-radius: 32px;
1116
+ border: 1px solid ${theme.colors.white};
1117
+ margin-bottom: 5px;
1118
+ margin-right: 7px;
1119
+ `;
1120
+
1121
+ const SearchTag = ({ state, type, typeInformation, dispatch }) => {
1122
+ const { t } = useTranslations();
1123
+ const { selectedLocation } = state;
1124
+ const typeSlug = useMemo(() => typeInformation[type].slug, [typeInformation, type]);
1125
+ const handleViewAll = () => {
1126
+ const url = `/${selectedLocation.slug}/${typeSlug}`;
1127
+ if (url) {
1128
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1129
+ }
1130
+ };
1131
+ const handleClickKeyword = (keyword) => {
1132
+ if (keyword.url) {
1133
+ window.location.href = keyword.url;
1134
+ }
1135
+ };
1136
+ return (React__default.createElement(StyleSearchTagWrapper, null,
1137
+ React__default.createElement(StyleTagLabel, null, t('booking.searchBar.popularKey')),
1138
+ state.popularKeys.map((item) => {
1139
+ return (React__default.createElement(StyleTagItem, { key: item.id, onClick: () => handleClickKeyword(item) }, item.keyword));
1140
+ }),
1141
+ React__default.createElement(StyleTagItem, { className: "view-all", onClick: handleViewAll }, t('booking.searchBar.viewAll'))));
1142
+ };
1143
+
1144
+ const StyledTabWrapper = styled.div `
1145
+ background: rgba(255, 255, 255, 0.64);
1146
+ backdrop-filter: blur(12px);
1147
+ border-bottom: 1px solid ${theme.colors.neutral100};
1148
+ `;
1149
+ const StyleTabContainer = styled(Container) `
1150
+ padding: 0 16px;
1151
+ `;
1152
+
1153
+ const itemTabs = () => {
1154
+ const { t } = useTranslations();
1155
+ return [
1156
+ {
1157
+ value: 'hospital',
1158
+ label: t('booking.searchPopup.hospitals'),
1159
+ },
1160
+ {
1161
+ value: 'doctor',
1162
+ label: t('booking.searchPopup.doctors'),
1163
+ },
1164
+ {
1165
+ value: 'service',
1166
+ label: t('booking.searchPopup.services'),
1167
+ },
1168
+ {
1169
+ value: 'specialty',
1170
+ label: t('booking.searchPopup.specialties'),
1171
+ },
1172
+ ];
1173
+ };
1174
+ const TabSearch = ({ currentTab, hideTabBookingSearch = [], isMobile, setCurrentTab, }) => {
1175
+ const stylesTabs = useMemo(() => {
1176
+ return {
1177
+ root: {
1178
+ overflowY: isMobile ? 'hidden' : 'initial',
1179
+ overflowX: isMobile ? 'auto' : 'initial',
1180
+ },
1181
+ tabsList: {
1182
+ background: 'rgba(255, 255, 255, 0)',
1183
+ borderBottom: 'none',
1184
+ flexWrap: 'nowrap',
1185
+ '.mantine-Tabs-tab': {
1186
+ '&:last-child': {
1187
+ '&:after': {
1188
+ display: 'none',
1189
+ },
1190
+ },
1191
+ },
1192
+ },
1193
+ tab: {
1194
+ padding: isMobile ? '12px 16px 12px 16px' : '15px 40px 15px 40px',
1195
+ borderTop: '2px solid transparent',
1196
+ borderBottom: 'none',
1197
+ margin: 0,
1198
+ borderRadius: 0,
1199
+ position: 'relative',
1200
+ width: 'auto',
1201
+ '&[data-active="true"]': {
1202
+ borderColor: '#2d87f3',
1203
+ backgroundColor: '#ffffff',
1204
+ '&:after': {
1205
+ display: 'none',
1206
+ },
1207
+ '&:before': {
1208
+ content: '""',
1209
+ width: '100%',
1210
+ height: '1px',
1211
+ position: 'absolute',
1212
+ backgroundColor: '#ffffff',
1213
+ bottom: '-1px',
1214
+ },
1215
+ },
1216
+ '&:hover': {
1217
+ borderColor: '#2d87f3',
1218
+ backgroundColor: '#ffffff',
1219
+ '&:before': {
1220
+ content: '""',
1221
+ width: '100%',
1222
+ height: '1px',
1223
+ position: 'absolute',
1224
+ backgroundColor: '#ffffff',
1225
+ bottom: '-1px',
1226
+ },
1227
+ },
1228
+ '&:after': {
1229
+ content: '""',
1230
+ width: '1px',
1231
+ height: '24px',
1232
+ backgroundColor: '#E4E8EC',
1233
+ position: 'absolute',
1234
+ right: '-1px',
1235
+ },
1236
+ },
1237
+ tabLabel: {
1238
+ color: '#595959',
1239
+ fontSize: isMobile ? '14px' : '16px',
1240
+ fontWeight: 600,
1241
+ lineHeight: isMobile ? '22px' : '24px',
1242
+ },
1243
+ };
1244
+ }, [isMobile]);
1245
+ const tabConfig = itemTabs();
1246
+ const activeTabs = useMemo(() => {
1247
+ return (tabConfig.filter((item) => !hideTabBookingSearch.includes(item.value)) ||
1248
+ []);
1249
+ }, [hideTabBookingSearch, tabConfig]);
1250
+ return (React__default.createElement(StyledTabWrapper, { className: "booking-search-tab" },
1251
+ React__default.createElement(StyleTabContainer, null,
1252
+ React__default.createElement(Tabs, { value: currentTab, onTabChange: (tab) => {
1253
+ setCurrentTab(tab);
1254
+ }, styles: stylesTabs },
1255
+ React__default.createElement(Tabs.List, null, activeTabs.map((tab) => {
1256
+ return (React__default.createElement(Tabs.Tab, { value: tab.value, key: tab.value }, tab.label));
1257
+ }))))));
1258
+ };
1259
+
1260
+ var TypePopularKeySearch;
1261
+ (function (TypePopularKeySearch) {
1262
+ TypePopularKeySearch["doctor"] = "doctor";
1263
+ TypePopularKeySearch["service"] = "hospital_service";
1264
+ TypePopularKeySearch["hospital"] = "hospital_branch";
1265
+ })(TypePopularKeySearch || (TypePopularKeySearch = {}));
1266
+
1267
+ function useSearchBarApi({ dispatch, careApiDomain, locale = 'vi-VN', client = '', }) {
1268
+ const fetchCitiesApi = useCallback(function fetchCitiesApi(path, params = {}) {
1269
+ const url = `${careApiDomain}${path}`;
1270
+ dispatch({ type: ActionTypes.FetchCitiesStart });
1271
+ return fetch(getApiPath(url, params, locale), { method: 'GET' })
1272
+ .then((res) => res.json())
1273
+ .then((data) => {
1274
+ if (data._status !== 1 || !data._data) {
1275
+ console.log('error loading cities', data);
1276
+ return Promise.reject(data);
1277
+ }
1278
+ return data === null || data === void 0 ? void 0 : data._data;
1279
+ })
1280
+ .finally(() => dispatch({ type: ActionTypes.FetchCitiesFinish }));
1281
+ }, [locale]);
1282
+ const fetchCitiesByLocation = useCallback(function fetchCitiesByLocation({ coordinates }) {
1283
+ let params = {};
1284
+ const moreParams = {};
1285
+ if (coordinates) {
1286
+ params = {
1287
+ lat: coordinates.lat,
1288
+ lng: coordinates.lng,
1289
+ };
1290
+ }
1291
+ if (locale === 'ms-MY') {
1292
+ moreParams.noPaging = 1;
1293
+ }
1294
+ const requests = [
1295
+ fetchCitiesApi(PATHS.GET_CITY_BY_IP, Object.assign(Object.assign(Object.assign({}, params), moreParams), { client: CLIENT_KEY.MSD === client ? '' : client })),
1296
+ ];
1297
+ if (locale === 'zh-TW') {
1298
+ requests.push(fetchCitiesApi(PATHS.GET_CITIES_LIST, {
1299
+ noPaging: 1,
1300
+ client: CLIENT_KEY.MSD === client ? '' : client,
1301
+ }));
1302
+ }
1303
+ return Promise.all(requests)
1304
+ .then(([data1, data2]) => {
1305
+ const data = Object.assign({}, data1);
1306
+ if (data2) {
1307
+ const citiesIds = data.cities.map((c) => c.id);
1308
+ data.cities = data.cities.concat(data2.cities.filter((c) => !citiesIds.includes(c.id)));
1309
+ }
1310
+ dispatch({
1311
+ type: ActionTypes.FetchCitiesByGeoIpComplete,
1312
+ payload: data,
1313
+ });
1314
+ })
1315
+ .catch((err) => console.error('error loading cities by location', err));
1316
+ }, [locale, careApiDomain, dispatch]);
1317
+ const fetchCitiesByKeyword = useCallback(function fetchCitiesByKeyword(keyword) {
1318
+ return fetchCitiesApi(PATHS.GET_CITIES_LIST, {
1319
+ keyword,
1320
+ client,
1321
+ })
1322
+ .then((data) => {
1323
+ dispatch({
1324
+ type: ActionTypes.FetchCitiesByKeywordComplete,
1325
+ payload: data.cities,
1326
+ });
1327
+ })
1328
+ .catch((err) => console.error('error loading cities by keyword', err));
1329
+ }, [locale, careApiDomain, dispatch]);
1330
+ const fetchSearchResults = useCallback(function fetchSearchResults(searchKeywords, state, searchType, clientSlug, cacheResult) {
1331
+ const url = searchType === 'specialty'
1332
+ ? `${careApiDomain}${PATHS.GET_SEARCH_SPECIALTY}`
1333
+ : `${careApiDomain}${PATHS.GET_SEARCH_V2}`;
1334
+ dispatch({ type: ActionTypes.FetchSearchResultsStart });
1335
+ const { selectedLocation, geoLocationCoordinates, selectedSpecialty } = state;
1336
+ let cityId = '';
1337
+ if (!selectedLocation) {
1338
+ dispatch({ type: ActionTypes.FetchSearchResultsFinish });
1339
+ return;
1340
+ }
1341
+ if (selectedLocation.id === ID_OPTION_ALL_LOCATION) {
1342
+ cityId = '';
1343
+ }
1344
+ else {
1345
+ cityId = selectedLocation.id;
1346
+ }
1347
+ const lat = (geoLocationCoordinates === null || geoLocationCoordinates === void 0 ? void 0 : geoLocationCoordinates.lat) || '';
1348
+ const lng = (geoLocationCoordinates === null || geoLocationCoordinates === void 0 ? void 0 : geoLocationCoordinates.lng) || '';
1349
+ const specialty_id = (selectedSpecialty === null || selectedSpecialty === void 0 ? void 0 : selectedSpecialty.id) > 0 ? selectedSpecialty === null || selectedSpecialty === void 0 ? void 0 : selectedSpecialty.id : '';
1350
+ const keyword = searchKeywords.trim().length > SEARCH_KEYWORD_MIN_LENGTH[locale]
1351
+ ? searchKeywords.trim()
1352
+ : '';
1353
+ return fetch(getApiPath(url, {
1354
+ domain: careApiDomain,
1355
+ searchType: searchType || 'global',
1356
+ keyword: keyword,
1357
+ city: cityId === ID_OPTION_CURRENT_LOCATION ? '' : cityId,
1358
+ lat,
1359
+ lng,
1360
+ specialty_id,
1361
+ client_slug: CLIENT_KEY.MSD === clientSlug ? '' : clientSlug,
1362
+ msd: CLIENT_KEY.MSD === client ? 1 : '',
1363
+ }, locale), {
1364
+ method: 'GET',
1365
+ headers: {
1366
+ accept: 'version=2.0.0.0',
1367
+ },
1368
+ })
1369
+ .then((res) => res.json())
1370
+ .then((data) => {
1371
+ if (data._status !== 1 || !data._data) {
1372
+ return Promise.reject(data);
1373
+ }
1374
+ return data === null || data === void 0 ? void 0 : data._data;
1375
+ })
1376
+ .then((results) => {
1377
+ let searchesResult = [];
1378
+ if (searchType !== 'specialty') {
1379
+ searchesResult = results.searches;
1380
+ }
1381
+ if (searchType === 'specialty') {
1382
+ if (keyword) {
1383
+ searchesResult = results.specialties;
1384
+ }
1385
+ else {
1386
+ searchesResult = results.default;
1387
+ }
1388
+ }
1389
+ dispatch({
1390
+ type: ActionTypes.FetchSearchResultsComplete,
1391
+ payload: {
1392
+ key: searchType,
1393
+ searches: searchesResult || [],
1394
+ },
1395
+ });
1396
+ if (cacheResult) {
1397
+ dispatch({
1398
+ type: ActionTypes.UpdateInitialSearchResults,
1399
+ payload: {
1400
+ key: searchType,
1401
+ searches: searchesResult || [],
1402
+ },
1403
+ });
1404
+ }
1405
+ })
1406
+ .catch((error) => {
1407
+ console.log('error loading search results', { url, error });
1408
+ })
1409
+ .finally(() => dispatch({ type: ActionTypes.FetchSearchResultsFinish }));
1410
+ }, [locale, careApiDomain, dispatch]);
1411
+ const fetchAllSpecialties = useCallback(function fetchSearchSpecialties() {
1412
+ const url = `${careApiDomain}${PATHS.GET_SEARCH_SPECIALTY}`;
1413
+ return fetch(getApiPath(url, {
1414
+ domain: careApiDomain,
1415
+ searchType: '',
1416
+ msd: CLIENT_KEY.MSD === client ? 1 : '',
1417
+ }, locale), {
1418
+ method: 'GET',
1419
+ headers: {
1420
+ accept: 'version=2.0.0.0',
1421
+ },
1422
+ })
1423
+ .then((res) => res.json())
1424
+ .then((data) => {
1425
+ if (data._status !== 1 || !data._data) {
1426
+ return Promise.reject(data);
1427
+ }
1428
+ return data === null || data === void 0 ? void 0 : data._data;
1429
+ })
1430
+ .then((results) => {
1431
+ dispatch({
1432
+ type: ActionTypes.FetchAllSpecialties,
1433
+ payload: results.specialties || [],
1434
+ });
1435
+ })
1436
+ .catch((error) => {
1437
+ console.log('error loading search results', { url, error });
1438
+ });
1439
+ }, [locale, careApiDomain, dispatch]);
1440
+ const fetchPopularKeys = useCallback(function fetchPopularKeys(searchType) {
1441
+ const url = `${careApiDomain}${PATHS.GET_SEARCH_POPULAR_KEY}`;
1442
+ return fetch(getApiPath(url, {
1443
+ domain: careApiDomain,
1444
+ searchType: TypePopularKeySearch[searchType],
1445
+ sort_by: 'display_order',
1446
+ sort_order: 'asc',
1447
+ }, locale))
1448
+ .then((res) => res.json())
1449
+ .then((data) => {
1450
+ if (data._status !== 1 || !data._data) {
1451
+ return Promise.reject(data);
1452
+ }
1453
+ return data === null || data === void 0 ? void 0 : data._data;
1454
+ })
1455
+ .then((results) => {
1456
+ dispatch({
1457
+ type: ActionTypes.FetchPopularKeys,
1458
+ payload: results.popular_searches || [],
1459
+ });
1460
+ })
1461
+ .catch((error) => {
1462
+ console.log('error loading search results', { url, error });
1463
+ });
1464
+ }, [locale, careApiDomain, dispatch]);
1465
+ return {
1466
+ fetchCitiesByLocation,
1467
+ fetchCitiesByKeyword,
1468
+ fetchSearchResults,
1469
+ fetchAllSpecialties,
1470
+ fetchPopularKeys,
1471
+ };
1472
+ }
1473
+
1474
+ const BookingSearchBarV2 = ({ isMobile, careApiDomain, geoLocationPermission: geoLocationPermissionFromProps, geoLocationCoordinates: geoLocationCoordinatesFromProps, initialSelectedCity: initialSelectedCityFromProps, initialSearchValue = '', initTypeSearch = 'hospital', initSpecialty, careFrontDomain = '/care', isDebug = false,
1475
+ // askForGeolocationPermission = false,
1476
+ gaTrackingSearchBar, gaTrackingLocationSearch, autoCompleteDisabled = false, inputSearchPlaceholder = '', hideTabBookingSearch = [], hideSpecialtySelection = false, hidePopularSearchKeys = false, clientSlug = '',
1477
+ // isOptionAllLocation = false,
1478
+ // hideResults = [],
1479
+ // isNavResultItem = true,
1480
+ routerPush, onGeoLocationPermissionChange,
1481
+ // onSearch,
1482
+ onChangeLocation, }) => {
1483
+ const { locale, t } = useTranslations();
1484
+ const wrapperRef = useRef(null);
1485
+ const inputSearchSpecialtyWrapperRef = useRef(null);
1486
+ const [currentTab, setCurrentTab] = useState(initTypeSearch);
1487
+ const { geoLocationPermission: geoLocationPermissionFromHook, geoLocationCoordinates: geoLocationCoordinatesFromHook, } = useGeolocation();
1488
+ const [state, dispatch] = useReducer(reducer, initialState, (s) => (Object.assign(Object.assign({}, s), { isDebug,
1489
+ isMobile, geoLocationPermission: geoLocationPermissionFromProps ||
1490
+ geoLocationPermissionFromHook ||
1491
+ 'unset', geoLocationCoordinates: geoLocationCoordinatesFromProps ||
1492
+ geoLocationCoordinatesFromHook ||
1493
+ null, searchKeywords: initialSearchValue, initialSelectedCity: initialSelectedCityFromProps || null, selectedLocation: initialSelectedCityFromProps || s.selectedLocation || null, searchLocationKeywords: (initialSelectedCityFromProps === null || initialSelectedCityFromProps === void 0 ? void 0 : initialSelectedCityFromProps.name) || s.searchLocationKeywords, autoCompleteDisabled,
1494
+ inputSearchPlaceholder,
1495
+ locale })));
1496
+ const { navigateTo, focusedSpecialty,
1497
+ // isLoadingCities,
1498
+ // cities,
1499
+ searchKeywords, geoLocationPermission, selectedLocation, selectedSpecialty, initialSelectedCity,
1500
+ // defaultCity,
1501
+ searchResults, isLoadingSearchResults,
1502
+ // isMobileModalOpened,
1503
+ // inputSearchPlaceholder,
1504
+ // allSpecialties,
1505
+ } = state;
1506
+ const { fetchCitiesByLocation, fetchCitiesByKeyword, fetchSearchResults, fetchAllSpecialties, fetchPopularKeys, } = useSearchBarApi({
1507
+ dispatch,
1508
+ locale,
1509
+ careApiDomain,
1510
+ client: clientSlug,
1511
+ });
1512
+ const slugs = useMemo(() => LOCALIZED_SLUGS[locale], [locale]);
1513
+ const typeInformation = useMemo(() => {
1514
+ return {
1515
+ doctor: {
1516
+ name: t('booking.searchPopup.doctors'),
1517
+ icon: React__default.createElement(DoctorIcon, null),
1518
+ slug: slugs.DOCTOR,
1519
+ },
1520
+ service: {
1521
+ name: t('booking.searchPopup.services'),
1522
+ icon: React__default.createElement(ServiceIcon, null),
1523
+ slug: slugs.SERVICE,
1524
+ },
1525
+ hospital: {
1526
+ name: t('booking.searchPopup.hospitals'),
1527
+ icon: React__default.createElement(HospitalIcon, null),
1528
+ slug: slugs.HOSPITAL,
1529
+ },
1530
+ specialty: {
1531
+ name: t('booking.searchPopup.specialties'),
1532
+ icon: React__default.createElement(SpecialtyIcon, null),
1533
+ slug: slugs.SPECIALTIES,
1534
+ },
1535
+ };
1536
+ }, [currentTab]);
1537
+ const debouncedFetchCitiesByKeyword = useMemo(() => debounce(fetchCitiesByKeyword, 400), [fetchCitiesByKeyword]);
1538
+ const debouncedFetchSearchResults = useMemo(() => debounce(fetchSearchResults, 400), [fetchSearchResults]);
1539
+ const handleLocationClick = useCallback(function handleLocationClick(city) {
1540
+ dispatch({ type: ActionTypes.SelectLocation, payload: city });
1541
+ focusSearchInput();
1542
+ if (onChangeLocation) {
1543
+ onChangeLocation(city);
1544
+ }
1545
+ }, [t, dispatch]);
1546
+ function focusSearchInput() {
1547
+ var _a;
1548
+ if (wrapperRef.current) {
1549
+ (_a = wrapperRef.current
1550
+ .querySelector('input[name="search-results"]')) === null || _a === void 0 ? void 0 : _a.focus();
1551
+ }
1552
+ }
1553
+ function onClickSearchByKeyword() {
1554
+ let url = '';
1555
+ const { slug: typeSlug } = typeInformation[currentTab];
1556
+ let moreParams = '';
1557
+ const slugClientUrl = MAPPING_CLIENT_WITH_SLUG[locale][clientSlug];
1558
+ if ((currentTab === 'doctor' || currentTab === 'hospital') &&
1559
+ state.selectedSpecialty.id > 0) {
1560
+ moreParams = `&specialtyId=${state.selectedSpecialty.id}`;
1561
+ }
1562
+ if (currentTab === 'specialty') {
1563
+ url = `/${typeSlug}`;
1564
+ }
1565
+ else {
1566
+ url = `/${selectedLocation.slug}/${typeSlug}`;
1567
+ }
1568
+ if (slugClientUrl) {
1569
+ url += `/${slugClientUrl}`;
1570
+ }
1571
+ url += `?q=${searchKeywords}${moreParams}`;
1572
+ if (url) {
1573
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1574
+ }
1575
+ }
1576
+ useOutsideClick(inputSearchSpecialtyWrapperRef, () => {
1577
+ dispatch({ type: ActionTypes.ClickOutsideInputSearchSpecialty });
1578
+ });
1579
+ useEffect(() => {
1580
+ var _a;
1581
+ if (geoLocationPermission !== 'denied' && !initialSelectedCity) {
1582
+ dispatch({
1583
+ type: ActionTypes.SelectLocation,
1584
+ payload: {
1585
+ name: t('booking.searchBar.allLocations'),
1586
+ id: ID_OPTION_ALL_LOCATION,
1587
+ slug: (_a = LOCALIZED_SLUGS[locale]) === null || _a === void 0 ? void 0 : _a.ALL,
1588
+ },
1589
+ });
1590
+ }
1591
+ if (onGeoLocationPermissionChange) {
1592
+ onGeoLocationPermissionChange(geoLocationPermission, state.geoLocationCoordinates);
1593
+ }
1594
+ if (isMobile && geoLocationPermission === 'granted' && selectedLocation) {
1595
+ dispatch({ type: ActionTypes.FocusInputSearch });
1596
+ }
1597
+ fetchCitiesByLocation({ coordinates: state.geoLocationCoordinates });
1598
+ }, [geoLocationPermission]);
1599
+ useEffect(() => {
1600
+ const defaultSpecialty = initSpecialty
1601
+ ? initSpecialty
1602
+ : {
1603
+ name: t('booking.searchBar.allSpecialties'),
1604
+ id: -1,
1605
+ thumbnail: '',
1606
+ total_doctor: 0,
1607
+ slug: slugs.SPECIALTIES,
1608
+ };
1609
+ if (!state.selectedSpecialty) {
1610
+ dispatch({
1611
+ type: ActionTypes.SelectSpecialty,
1612
+ payload: defaultSpecialty,
1613
+ });
1614
+ }
1615
+ }, [initSpecialty, state.selectedSpecialty]);
1616
+ useEffect(() => {
1617
+ fetchAllSpecialties();
1618
+ }, []);
1619
+ useEffect(() => {
1620
+ fetchPopularKeys(currentTab);
1621
+ }, [currentTab]);
1622
+ useEffect(() => {
1623
+ if (navigateTo) {
1624
+ if (routerPush) {
1625
+ routerPush(navigateTo);
1626
+ }
1627
+ else {
1628
+ window.location.href = `${careFrontDomain}${navigateTo}`;
1629
+ }
1630
+ }
1631
+ }, [navigateTo]);
1632
+ useEffect(() => {
1633
+ fetchSearchResults(state.searchKeywords, state, currentTab, clientSlug, true);
1634
+ }, [selectedLocation, selectedSpecialty, currentTab]);
1635
+ return (React__default.createElement(StyledSearchBarWrapper, { ref: wrapperRef },
1636
+ React__default.createElement(TabSearch, { currentTab: currentTab, setCurrentTab: setCurrentTab, isMobile: isMobile, hideTabBookingSearch: hideTabBookingSearch }),
1637
+ React__default.createElement(StyleWrapperContainer, { className: "booking-search-container" },
1638
+ React__default.createElement(StyleSearchInputContainer, null,
1639
+ React__default.createElement(StyleSearchContent, { className: "booking-search-content" },
1640
+ React__default.createElement("div", { ref: inputSearchSpecialtyWrapperRef },
1641
+ React__default.createElement(Flex, { gap: "12px", justify: "space-between", align: "center", direction: isMobile ? 'column' : 'row', className: "flex-search-input" },
1642
+ currentTab !== 'specialty' && (React__default.createElement(SearchLocation, { state: state, isMobile: isMobile, dispatch: dispatch, debouncedFetchCitiesByKeyword: debouncedFetchCitiesByKeyword, selectedLocation: selectedLocation, onLocationClick: handleLocationClick, trackingAttributes: gaTrackingLocationSearch })),
1643
+ React__default.createElement(SearchInputs, { type: currentTab, isMobile: isMobile, state: state, dispatch: dispatch, debouncedFetchSearchResults: debouncedFetchSearchResults, initalSearchValue: initialSearchValue, focusSearchInput: focusSearchInput, onEnterSearch: onClickSearchByKeyword, typeInformation: typeInformation, trackingAttributes: gaTrackingSearchBar, isLoading: isLoadingSearchResults, hideSpecialtySelection: hideSpecialtySelection, clientSlug: clientSlug }),
1644
+ React__default.createElement(Button, { size: isMobile ? 'md' : 'lg', color: "#2D87F3", fullWidth: isMobile, variant: "filled", onClick: onClickSearchByKeyword, styles: {
1645
+ root: {
1646
+ height: isMobile ? '40px' : '48px',
1647
+ },
1648
+ } }, t('booking.searchBar.searchButton'))),
1649
+ !hidePopularSearchKeys &&
1650
+ currentTab !== 'specialty' &&
1651
+ state.popularKeys.length > 0 && (React__default.createElement(SearchTag, { type: currentTab, state: state, typeInformation: typeInformation, dispatch: dispatch })),
1652
+ currentTab === 'specialty' && focusedSpecialty === 'search' && (React__default.createElement(SearchResultSpecialties, { state: state, isMobile: isMobile, dispatch: dispatch, specialties: (searchResults === null || searchResults === void 0 ? void 0 : searchResults.specialty) || [], isLoading: isLoadingSearchResults }))))))));
1653
+ };
1654
+
1655
+ export { BookingSearchBarV2 };