@hhgtech/hhg-components 1.29.88 → 1.29.90

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 (463) hide show
  1. package/build/{LastPeriod-235fc10e.js → LastPeriod-5e6d2274.js} +1 -1
  2. package/build/MobileBottomNavigationIcon-3103ca02.js +193 -0
  3. package/build/{WhatsApp-e6406d8d.js → WhatsApp-21d7b616.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/molecules/popup/index.d.ts +2 -1
  12. package/build/components.js +125 -115
  13. package/build/{constants-2d046b25.js → constants-8abd9991.js} +1 -1
  14. package/build/constants.js +3 -3
  15. package/build/constantsDomainLocales.js +1 -1
  16. package/build/constantsRiskScreener.js +2 -2
  17. package/build/constantsSite.js +2 -2
  18. package/build/{core-ab09e68b.js → core-e12ff855.js} +1 -1
  19. package/build/{dataTransform-945e5f4f.js → dataTransform-27a22c74.js} +1 -1
  20. package/build/ecom.js +4 -4
  21. package/build/editor-e761dc49.js +986 -0
  22. package/build/embeddedHeathToolCards_babyGrowth.js +22 -20
  23. package/build/embeddedHeathToolCards_babyPoop.js +18 -16
  24. package/build/embeddedHeathToolCards_babyVaccine.js +21 -19
  25. package/build/embeddedHeathToolCards_bmi_bmi.js +25 -23
  26. package/build/embeddedHeathToolCards_bmrBmr.js +25 -23
  27. package/build/embeddedHeathToolCards_dueDate_dueDate.js +21 -19
  28. package/build/embeddedHeathToolCards_ovulation_ovulation.js +21 -19
  29. package/build/embeddedHeathToolCards_pwg_pwg.js +26 -24
  30. package/build/embeddedHeathToolCards_targetHeartRate.js +27 -25
  31. package/build/esm/{LastPeriod-fcd2b5ec.js → LastPeriod-cd2e1a56.js} +1 -1
  32. package/build/esm/MobileBottomNavigationIcon-cfcb7894.js +185 -0
  33. package/build/esm/{WhatsApp-2f54ed26.js → WhatsApp-6e473416.js} +1 -1
  34. package/build/esm/adapters.js +18 -16
  35. package/build/esm/atoms.js +44 -42
  36. package/build/esm/babyGrowth.js +82 -80
  37. package/build/esm/cache.js +2 -2
  38. package/build/esm/care.js +26 -23
  39. package/build/esm/careBookingSearchBar.js +1582 -0
  40. package/build/esm/careBookingSearchBarV2.js +1655 -0
  41. package/build/esm/components/molecules/popup/index.d.ts +2 -1
  42. package/build/esm/components.js +93 -83
  43. package/build/esm/{constants-b68073ea.js → constants-6409f351.js} +1 -1
  44. package/build/esm/constants.js +3 -3
  45. package/build/esm/constantsDomainLocales.js +1 -1
  46. package/build/esm/constantsRiskScreener.js +2 -2
  47. package/build/esm/constantsSite.js +2 -2
  48. package/build/esm/{core-bcdf3422.js → core-f2306660.js} +1 -1
  49. package/build/esm/{dataTransform-c3905a10.js → dataTransform-7074431d.js} +2 -2
  50. package/build/esm/ecom.js +4 -4
  51. package/build/esm/editor-f1c53093.js +959 -0
  52. package/build/esm/embeddedHeathToolCards_babyGrowth.js +22 -20
  53. package/build/esm/embeddedHeathToolCards_babyPoop.js +18 -16
  54. package/build/esm/embeddedHeathToolCards_babyVaccine.js +21 -19
  55. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +25 -23
  56. package/build/esm/embeddedHeathToolCards_bmrBmr.js +25 -23
  57. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +21 -19
  58. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +21 -19
  59. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +26 -24
  60. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +27 -25
  61. package/build/esm/{fixedBottomAdBlock-bb1a3c50.js → fixedBottomAdBlock-3d6bb6ed.js} +26 -662
  62. package/build/esm/footer.js +20 -18
  63. package/build/esm/gAssets.js +2 -2
  64. package/build/esm/healthToolsCardWrapper.js +17 -15
  65. package/build/esm/healthToolsForm.js +33 -31
  66. package/build/esm/hooks.js +15 -15
  67. package/build/esm/i18n.js +2 -2
  68. package/build/esm/i18nV2.js +2 -2
  69. package/build/esm/{index-2b20b8ce.js → index-00949e45.js} +2 -2
  70. package/build/esm/{index-7ab1ac4c.js → index-011e1a41.js} +2 -2
  71. package/build/esm/{index-e84f16f3.js → index-050b8644.js} +3 -142
  72. package/build/esm/{index-a7bfcfbd.js → index-0ad45a17.js} +6 -6
  73. package/build/esm/{index-48fdf51c.js → index-1065c7d0.js} +16 -15
  74. package/build/esm/{index-b927d85a.js → index-1778704d.js} +12 -11
  75. package/build/esm/{index-c0790cdc.js → index-1ba53d6c.js} +20 -17
  76. package/build/esm/{index-a2704991.js → index-21c80677.js} +16 -88
  77. package/build/esm/{index-8570e132.js → index-296a1099.js} +2 -2
  78. package/build/esm/index-2f30d1dd.js +860 -0
  79. package/build/esm/index-3367898a.js +1264 -0
  80. package/build/esm/{index-11bc6557.js → index-391aad5b.js} +3 -3
  81. package/build/esm/{index-63d30402.js → index-405b11d3.js} +16 -15
  82. package/build/esm/{index-d3c3615e.js → index-42286f3e.js} +2 -2
  83. package/build/esm/{index-1f944c2d.js → index-44ced5ce.js} +5 -5
  84. package/build/esm/{index-140ea208.js → index-4d512cd9.js} +17 -16
  85. package/build/esm/{index-2f06b1d8.js → index-51179764.js} +1 -1
  86. package/build/esm/{index-fcf9a2ce.js → index-52f07e54.js} +14 -13
  87. package/build/esm/{index-b4cab951.js → index-54d714a2.js} +16 -15
  88. package/build/esm/index-5bd382e3.js +281 -0
  89. package/build/esm/{index-7d97103f.js → index-5d2f2783.js} +2 -2
  90. package/build/esm/{index-d10d5d1f.js → index-5f04e701.js} +4 -4
  91. package/build/esm/{index-04146795.js → index-670afcce.js} +5 -3
  92. package/build/esm/{index-17115a3b.js → index-6ce0d042.js} +15 -14
  93. package/build/esm/{index-e5797070.js → index-6ebc4e40.js} +3 -3
  94. package/build/esm/{index-fbe76c43.js → index-714d2892.js} +7 -6
  95. package/build/esm/{index-efdc151c.js → index-75811f98.js} +12 -11
  96. package/build/esm/{index-321f0612.js → index-78cb9c0e.js} +1 -1
  97. package/build/esm/{index-19a9a60d.js → index-7a3ac1f6.js} +1 -1
  98. package/build/esm/{index-29676661.js → index-8002ffd2.js} +6 -6
  99. package/build/esm/index-82b481bf.js +468 -0
  100. package/build/esm/{index-83ab0594.js → index-83dba9e4.js} +35 -800
  101. package/build/esm/{index-f42f0c66.js → index-918a026b.js} +2 -2
  102. package/build/esm/{index-67603e6c.js → index-9197f143.js} +15 -14
  103. package/build/esm/{index-69c631bf.js → index-9c7493b6.js} +12 -11
  104. package/build/esm/{index-2292c1f3.js → index-a0d47b03.js} +2 -2
  105. package/build/esm/{index-0cf91429.js → index-a134d156.js} +1 -1
  106. package/build/esm/index-a8b7284e.js +144 -0
  107. package/build/esm/{index-05075062.js → index-b013dd09.js} +1 -1
  108. package/build/esm/{index-9a0b3bcd.js → index-b266ccec.js} +7 -7
  109. package/build/esm/{index-4e92aaf2.js → index-b4efb261.js} +3 -3
  110. package/build/esm/{index-ef2b1e44.js → index-b87e6e0b.js} +6 -6
  111. package/build/esm/{index-0e0f3ac6.js → index-ba8e6508.js} +1 -1
  112. package/build/esm/{index-5303fcd9.js → index-bda0913e.js} +2 -2
  113. package/build/esm/{index-58ed669e.js → index-c2e1fb70.js} +23 -19
  114. package/build/esm/{index-b23b0c82.js → index-c8368a30.js} +14 -13
  115. package/build/esm/{index-877a46df.js → index-cb4b219f.js} +2 -2
  116. package/build/esm/index-d034201a.js +22 -0
  117. package/build/esm/{index-69ca7b6a.js → index-d5543323.js} +2 -2
  118. package/build/esm/index-d66bd239.js +1030 -0
  119. package/build/esm/{index-155daac5.js → index-da92eee1.js} +2 -2
  120. package/build/esm/{index-a715b700.js → index-e63aadb3.js} +15 -14
  121. package/build/esm/{index-5a81cbdd.js → index-e7128232.js} +1 -1
  122. package/build/esm/{index-58982ea1.js → index-ec003775.js} +3 -3
  123. package/build/esm/{index-cde1edae.js → index-f0dc90df.js} +21 -19
  124. package/build/esm/{index-478546e8.js → index-f8cc91fb.js} +12 -11
  125. package/build/esm/index.js +118 -98
  126. package/build/esm/index.styles-793c0b30.js +62 -0
  127. package/build/esm/interfaces/types/Subot.d.ts +3 -3
  128. package/build/esm/{labelSorting-db27bdad.js → labelSorting-feaa24fb.js} +4 -4
  129. package/build/esm/lead.js +22 -20
  130. package/build/esm/{logoIcon-6ed45e55.js → logoIcon-fbc8e7a1.js} +2 -2
  131. package/build/esm/mantine.js +24 -22
  132. package/build/esm/misc.js +18 -18
  133. package/build/esm/miscGetDynamicHealthTool.js +7 -7
  134. package/build/esm/miscGetSocialList.js +8 -8
  135. package/build/esm/miscScreenSizeContext.js +1 -1
  136. package/build/esm/mobileBottomNavigation.js +19 -0
  137. package/build/esm/mobileBottomNavigationIcon.js +10 -0
  138. package/build/esm/molecules.js +71 -64
  139. package/build/esm/moleculesArticleCard.js +85 -0
  140. package/build/esm/moleculesArticleCardV2.js +171 -0
  141. package/build/esm/navigation.js +40 -35
  142. package/build/esm/navigationLogoutPopup.js +116 -0
  143. package/build/esm/navigationProfileButton.js +43 -0
  144. package/build/esm/{normalizeLink-fcd22117.js → normalizeLink-136a636d.js} +1 -1
  145. package/build/esm/onboardingV2.js +27 -25
  146. package/build/esm/organisms.js +46 -41
  147. package/build/esm/post-203760fe.js +267 -0
  148. package/build/esm/profileNavigation.js +441 -0
  149. package/build/esm/progressBar.js +250 -0
  150. package/build/esm/pwg.js +21 -19
  151. package/build/esm/{routing-ed745cc6.js → routing-e57320c2.js} +1 -1
  152. package/build/esm/subot.js +29 -27
  153. package/build/esm/surveyOrPremiumBanner.js +30 -28
  154. package/build/esm/surveyQuestionCard.js +10 -10
  155. package/build/esm/{surveyThankyouCard-6fc9a327.js → surveyThankyouCard-5a060837.js} +5 -5
  156. package/build/esm/together/components/molecules/popupFrame/index.d.ts +2 -1
  157. package/build/esm/together.js +53 -44
  158. package/build/esm/togetherApiUtils.js +4 -4
  159. package/build/esm/togetherAtoms.js +29 -26
  160. package/build/esm/togetherComponentGlobalContext.js +4 -4
  161. package/build/esm/togetherMolecules.js +56 -47
  162. package/build/esm/togetherMoleculesCardAuthor.js +41 -0
  163. package/build/esm/togetherMoleculesPostImagePreview.js +21 -0
  164. package/build/esm/togetherMoleculesProfileDetail.js +53 -0
  165. package/build/esm/togetherOrganisms.js +53 -44
  166. package/build/esm/togetherRichTextEditor.js +27 -0
  167. package/build/esm/togetherShareBox.js +305 -0
  168. package/build/esm/{treePopoverMenu-937ef815.js → treePopoverMenu-7845b5c1.js} +18 -17
  169. package/build/esm/types-5f680f53.js +44 -0
  170. package/build/esm/types.js +2 -2
  171. package/build/esm/{useCategory-d239339f.js → useCategory-c847c3ee.js} +5 -5
  172. package/build/esm/{useHealthToolCache-e6e0e96c.js → useHealthToolCache-41375a2b.js} +1 -1
  173. package/build/esm/{useMantineLocale-2ece6eac.js → useMantineLocale-bef42461.js} +5 -5
  174. package/build/esm/{usePlacesAutocomplete-ecf31643.js → usePlacesAutocomplete-44a9e05c.js} +1 -1
  175. package/build/esm/useTogetherAuthRequiredAction.js +4 -4
  176. package/build/esm/{useTranslations-160e66cc.js → useTranslations-9767b0ea.js} +1 -1
  177. package/build/esm/utils-7871047f.js +206 -0
  178. package/build/esm/{utils-3d9043fb.js → utils-8a1ccf09.js} +4 -4
  179. package/build/esm/{utils-d78e02e6.js → utils-c1678a05.js} +2 -2
  180. package/build/esm/vaccination.js +20 -18
  181. package/build/{fixedBottomAdBlock-87988744.js → fixedBottomAdBlock-bfdbc0df.js} +49 -691
  182. package/build/footer.js +20 -18
  183. package/build/gAssets.js +2 -2
  184. package/build/healthToolsCardWrapper.js +17 -15
  185. package/build/healthToolsForm.js +33 -31
  186. package/build/hooks.js +15 -15
  187. package/build/i18n.js +1 -1
  188. package/build/i18nV2.js +1 -1
  189. package/build/{index-c016b1bb.js → index-133544cd.js} +14 -13
  190. package/build/index-137b351f.js +1045 -0
  191. package/build/{index-92815934.js → index-190832cb.js} +5 -5
  192. package/build/{index-0772398f.js → index-1b1ac8fe.js} +1 -1
  193. package/build/{index-a6acde43.js → index-2089929b.js} +38 -34
  194. package/build/{index-f8a51099.js → index-2c23680e.js} +2 -2
  195. package/build/index-2d391b09.js +151 -0
  196. package/build/{index-b040447b.js → index-2f31063d.js} +2 -2
  197. package/build/{index-d9559ac1.js → index-31045247.js} +2 -2
  198. package/build/{index-e4004288.js → index-330e16a8.js} +2 -2
  199. package/build/{index-b8620e16.js → index-3c6a1bfc.js} +2 -2
  200. package/build/{index-e7b871b4.js → index-3f49c41e.js} +3 -143
  201. package/build/index-4b1b3672.js +478 -0
  202. package/build/{index-4a6c95fe.js → index-5209298d.js} +12 -11
  203. package/build/index-5cc887da.js +870 -0
  204. package/build/{index-a97a7a53.js → index-5e1337b4.js} +31 -29
  205. package/build/{index-2de1a14d.js → index-6266a5df.js} +2 -2
  206. package/build/{index-f3553904.js → index-62f912e0.js} +9 -8
  207. package/build/{index-84e8b355.js → index-63f2aaa5.js} +15 -14
  208. package/build/{index-9f995309.js → index-65eb73e7.js} +34 -31
  209. package/build/{index-6c2d2f25.js → index-67fa5818.js} +24 -99
  210. package/build/index-69cd0b40.js +1307 -0
  211. package/build/{index-d39f2445.js → index-6cda2bed.js} +4 -4
  212. package/build/{index-9add51eb.js → index-74869e06.js} +3 -3
  213. package/build/{index-227e17fd.js → index-7b74a414.js} +2 -2
  214. package/build/{index-6ce119f5.js → index-7b8badf9.js} +2 -2
  215. package/build/{index-bac0bd08.js → index-7dfa541c.js} +3 -3
  216. package/build/{index-519a6287.js → index-81dcaeb1.js} +12 -11
  217. package/build/{index-5ddda8f4.js → index-82577dcf.js} +16 -15
  218. package/build/{index-f05721a0.js → index-870325c1.js} +7 -7
  219. package/build/{index-a136cba7.js → index-87d6e499.js} +6 -6
  220. package/build/{index-554ad68c.js → index-8ce24abd.js} +1 -1
  221. package/build/{index-03834ac7.js → index-8e2a718b.js} +3 -3
  222. package/build/{index-347a91f6.js → index-930f87f9.js} +1 -1
  223. package/build/{index-ae03f378.js → index-96e9edfa.js} +16 -15
  224. package/build/{index-196d4981.js → index-9ca1658b.js} +1 -1
  225. package/build/{index-8b8263ed.js → index-a0dd7ee6.js} +34 -33
  226. package/build/{index-c294ccc2.js → index-a94d3a6e.js} +3 -3
  227. package/build/{index-a688f865.js → index-ae4a2ce9.js} +12 -11
  228. package/build/{index-1489f027.js → index-b1181a62.js} +3 -3
  229. package/build/{index-1245ea43.js → index-b74f6d6c.js} +12 -11
  230. package/build/{index-7ca746d3.js → index-bee8ec72.js} +15 -14
  231. package/build/index-c0960783.js +289 -0
  232. package/build/{index-6313ec6f.js → index-c7bc83de.js} +6 -6
  233. package/build/{index-4dc41ef1.js → index-d414e4f7.js} +5 -3
  234. package/build/{index-1ebaa446.js → index-e23391ca.js} +16 -15
  235. package/build/{index-fcf16e35.js → index-e48cde73.js} +2 -2
  236. package/build/{index-9cc21262.js → index-f00131bf.js} +1 -1
  237. package/build/{index-7e8732ae.js → index-f0c0316f.js} +1 -1
  238. package/build/index-f373b62b.js +29 -0
  239. package/build/{index-66b34bd9.js → index-f477fee8.js} +96 -864
  240. package/build/{index-5006f129.js → index-f4bd7dd9.js} +6 -6
  241. package/build/{index-f3f648e1.js → index-f4c71c79.js} +17 -16
  242. package/build/{index-7024d536.js → index-f7918c25.js} +15 -14
  243. package/build/{index-9e92431c.js → index-f9aee5dd.js} +2 -2
  244. package/build/{index-92e82d0d.js → index-fa8957ac.js} +1 -1
  245. package/build/index.js +182 -162
  246. package/build/index.styles-07f26519.js +65 -0
  247. package/build/interfaces/types/Subot.d.ts +3 -3
  248. package/build/{labelSorting-60b0f16a.js → labelSorting-2d65cd86.js} +4 -4
  249. package/build/lead.js +22 -20
  250. package/build/{logoIcon-8e1ff0aa.js → logoIcon-026665b4.js} +2 -2
  251. package/build/mantine.js +20 -18
  252. package/build/misc.js +18 -18
  253. package/build/miscGetDynamicHealthTool.js +7 -7
  254. package/build/miscGetSocialList.js +8 -8
  255. package/build/miscScreenSizeContext.js +1 -1
  256. package/build/mobileBottomNavigation.js +27 -0
  257. package/build/mobileBottomNavigationIcon.js +18 -0
  258. package/build/molecules.js +76 -69
  259. package/build/moleculesArticleCard.js +93 -0
  260. package/build/moleculesArticleCardV2.js +180 -0
  261. package/build/navigation.js +40 -35
  262. package/build/navigationLogoutPopup.js +125 -0
  263. package/build/navigationProfileButton.js +51 -0
  264. package/build/onboardingV2.js +29 -27
  265. package/build/organisms.js +49 -44
  266. package/build/post-0759bdca.js +303 -0
  267. package/build/profileNavigation.js +450 -0
  268. package/build/progressBar.js +260 -0
  269. package/build/pwg.js +21 -19
  270. package/build/{routing-d764168d.js → routing-7ba14d2a.js} +1 -1
  271. package/build/subot.js +28 -26
  272. package/build/surveyOrPremiumBanner.js +30 -28
  273. package/build/surveyQuestionCard.js +10 -10
  274. package/build/{surveyThankyouCard-944ab001.js → surveyThankyouCard-6a2454d1.js} +5 -5
  275. package/build/together/components/molecules/popupFrame/index.d.ts +2 -1
  276. package/build/together.js +77 -68
  277. package/build/togetherApiUtils.js +4 -4
  278. package/build/togetherAtoms.js +29 -26
  279. package/build/togetherComponentGlobalContext.js +4 -4
  280. package/build/togetherMolecules.js +79 -70
  281. package/build/togetherMoleculesCardAuthor.js +49 -0
  282. package/build/togetherMoleculesPostImagePreview.js +29 -0
  283. package/build/togetherMoleculesProfileDetail.js +70 -0
  284. package/build/togetherOrganisms.js +53 -44
  285. package/build/togetherRichTextEditor.js +36 -0
  286. package/build/togetherShareBox.js +314 -0
  287. package/build/{treePopoverMenu-0cbe3fd0.js → treePopoverMenu-86c7db6d.js} +18 -17
  288. package/build/types-20cc07c9.js +52 -0
  289. package/build/types.js +2 -2
  290. package/build/{useCategory-32558796.js → useCategory-0f8c9201.js} +5 -5
  291. package/build/{useHealthToolCache-cbe4b1b4.js → useHealthToolCache-c0468424.js} +1 -1
  292. package/build/{useMantineLocale-992ae094.js → useMantineLocale-b8eca90b.js} +5 -5
  293. package/build/{usePlacesAutocomplete-c19d396b.js → usePlacesAutocomplete-1d139be6.js} +1 -1
  294. package/build/useTogetherAuthRequiredAction.js +4 -4
  295. package/build/{useTranslations-5d28e8df.js → useTranslations-4fb7a5ac.js} +1 -1
  296. package/build/{utils-d3353e9c.js → utils-14192273.js} +2 -2
  297. package/build/{utils-1a876a51.js → utils-1b9bc7e0.js} +3 -3
  298. package/build/utils-a4f75f1f.js +229 -0
  299. package/build/vaccination.js +24 -22
  300. package/package.json +1 -1
  301. package/build/esm/index-c7b92115.js +0 -5060
  302. package/build/esm/types-f387cdcf.js +0 -3433
  303. package/build/index-2ce324cf.js +0 -5123
  304. package/build/types-d798cef3.js +0 -3447
  305. /package/build/{BMI_BOYS.percentile.monthly-2fdec618.js → BMI_BOYS.percentile.monthly-b372ea44.js} +0 -0
  306. /package/build/{BMI_BOYS.percentile.weekly-4b1616c4.js → BMI_BOYS.percentile.weekly-74d9aa42.js} +0 -0
  307. /package/build/{BMI_BOYS.percentile.yearly-f7761749.js → BMI_BOYS.percentile.yearly-8983c077.js} +0 -0
  308. /package/build/{BMI_BOYS.zscore.monthly-6767b0d4.js → BMI_BOYS.zscore.monthly-87a6a1a1.js} +0 -0
  309. /package/build/{BMI_BOYS.zscore.weekly-5c57342b.js → BMI_BOYS.zscore.weekly-943afdf9.js} +0 -0
  310. /package/build/{BMI_BOYS.zscore.yearly-d970734e.js → BMI_BOYS.zscore.yearly-b60dee5d.js} +0 -0
  311. /package/build/{BMI_GIRLS.percentile.monthly-ba4d972d.js → BMI_GIRLS.percentile.monthly-a92a2367.js} +0 -0
  312. /package/build/{BMI_GIRLS.percentile.weekly-f73dacf3.js → BMI_GIRLS.percentile.weekly-81e2a447.js} +0 -0
  313. /package/build/{BMI_GIRLS.percentile.yearly-a5b59a8c.js → BMI_GIRLS.percentile.yearly-aec7fe9d.js} +0 -0
  314. /package/build/{BMI_GIRLS.zscore.monthly-110d6823.js → BMI_GIRLS.zscore.monthly-a6183959.js} +0 -0
  315. /package/build/{BMI_GIRLS.zscore.weekly-cfe97ba9.js → BMI_GIRLS.zscore.weekly-0bc8803a.js} +0 -0
  316. /package/build/{BMI_GIRLS.zscore.yearly-ab4ae640.js → BMI_GIRLS.zscore.yearly-a3098165.js} +0 -0
  317. /package/build/{ChevronDown-d37704eb.js → ChevronDown-c29d0fb5.js} +0 -0
  318. /package/build/{Close-1514c815.js → Close-b7d67405.js} +0 -0
  319. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-6c797045.js → HEAD CIRCUM_BOYS.percentile.monthly-d4fabdf2.js} +0 -0
  320. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-7ac501c0.js → HEAD CIRCUM_BOYS.percentile.weekly-32cbc60f.js} +0 -0
  321. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-2999cdb8.js → HEAD CIRCUM_BOYS.percentile.yearly-a37b8f8a.js} +0 -0
  322. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-7e3a78aa.js → HEAD CIRCUM_BOYS.zscore.monthly-c3f7634f.js} +0 -0
  323. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-2ea72789.js → HEAD CIRCUM_BOYS.zscore.weekly-71ccd3df.js} +0 -0
  324. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-826ab425.js → HEAD CIRCUM_BOYS.zscore.yearly-a49605c2.js} +0 -0
  325. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-0f1636c1.js → HEAD CIRCUM_GIRLS.percentile.monthly-68c5f17b.js} +0 -0
  326. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-b32da590.js → HEAD CIRCUM_GIRLS.percentile.weekly-09ab91dc.js} +0 -0
  327. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-850c4e29.js → HEAD CIRCUM_GIRLS.percentile.yearly-f33be7ba.js} +0 -0
  328. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-f942b53a.js → HEAD CIRCUM_GIRLS.zscore.monthly-283c0ef7.js} +0 -0
  329. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-26daad32.js → HEAD CIRCUM_GIRLS.zscore.weekly-1feda657.js} +0 -0
  330. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-0f331108.js → HEAD CIRCUM_GIRLS.zscore.yearly-bcba4238.js} +0 -0
  331. /package/build/{HEIGHT_BOYS.percentile.monthly-6bfc3799.js → HEIGHT_BOYS.percentile.monthly-977b0b64.js} +0 -0
  332. /package/build/{HEIGHT_BOYS.percentile.weekly-0ed4b053.js → HEIGHT_BOYS.percentile.weekly-ff1b517f.js} +0 -0
  333. /package/build/{HEIGHT_BOYS.percentile.yearly-cc4c343d.js → HEIGHT_BOYS.percentile.yearly-e0ed022d.js} +0 -0
  334. /package/build/{HEIGHT_BOYS.zscore.monthly-b2d384dc.js → HEIGHT_BOYS.zscore.monthly-397f6aa4.js} +0 -0
  335. /package/build/{HEIGHT_BOYS.zscore.weekly-b65aa792.js → HEIGHT_BOYS.zscore.weekly-dccfdd52.js} +0 -0
  336. /package/build/{HEIGHT_BOYS.zscore.yearly-0bae3840.js → HEIGHT_BOYS.zscore.yearly-76500a0f.js} +0 -0
  337. /package/build/{HEIGHT_GIRLS.percentile.monthly-34960fd2.js → HEIGHT_GIRLS.percentile.monthly-3a7aef92.js} +0 -0
  338. /package/build/{HEIGHT_GIRLS.percentile.weekly-949ca5b1.js → HEIGHT_GIRLS.percentile.weekly-99e3c1c3.js} +0 -0
  339. /package/build/{HEIGHT_GIRLS.percentile.yearly-4c40b714.js → HEIGHT_GIRLS.percentile.yearly-9f01d7d1.js} +0 -0
  340. /package/build/{HEIGHT_GIRLS.zscore.monthly-a3856728.js → HEIGHT_GIRLS.zscore.monthly-973ae30d.js} +0 -0
  341. /package/build/{HEIGHT_GIRLS.zscore.weekly-b39f321f.js → HEIGHT_GIRLS.zscore.weekly-18ae768b.js} +0 -0
  342. /package/build/{HEIGHT_GIRLS.zscore.yearly-f50c6d58.js → HEIGHT_GIRLS.zscore.yearly-dc42b61a.js} +0 -0
  343. /package/build/{Locale-e3b7ae56.js → Locale-e697d040.js} +0 -0
  344. /package/build/{Visible-c6736a66.js → Visible-8c2b5ab1.js} +0 -0
  345. /package/build/{WEIGHT_BOYS.percentile.monthly-685aabfc.js → WEIGHT_BOYS.percentile.monthly-3f17ac1f.js} +0 -0
  346. /package/build/{WEIGHT_BOYS.percentile.weekly-3c1a6d2f.js → WEIGHT_BOYS.percentile.weekly-8f2ebf77.js} +0 -0
  347. /package/build/{WEIGHT_BOYS.percentile.yearly-2bd65c8f.js → WEIGHT_BOYS.percentile.yearly-a9eff519.js} +0 -0
  348. /package/build/{WEIGHT_BOYS.zscore.monthly-bba8cd92.js → WEIGHT_BOYS.zscore.monthly-a108db0c.js} +0 -0
  349. /package/build/{WEIGHT_BOYS.zscore.weekly-7bdc0673.js → WEIGHT_BOYS.zscore.weekly-e21f46c5.js} +0 -0
  350. /package/build/{WEIGHT_BOYS.zscore.yearly-32f635e0.js → WEIGHT_BOYS.zscore.yearly-1309493f.js} +0 -0
  351. /package/build/{WEIGHT_GIRLS.percentile.monthly-ad305e84.js → WEIGHT_GIRLS.percentile.monthly-e6ad9d1e.js} +0 -0
  352. /package/build/{WEIGHT_GIRLS.percentile.weekly-92e552b6.js → WEIGHT_GIRLS.percentile.weekly-15e2f043.js} +0 -0
  353. /package/build/{WEIGHT_GIRLS.percentile.yearly-df0dd71c.js → WEIGHT_GIRLS.percentile.yearly-788c6b1a.js} +0 -0
  354. /package/build/{WEIGHT_GIRLS.zscore.monthly-8820671b.js → WEIGHT_GIRLS.zscore.monthly-ad9bc118.js} +0 -0
  355. /package/build/{WEIGHT_GIRLS.zscore.weekly-31d29b05.js → WEIGHT_GIRLS.zscore.weekly-027d92d0.js} +0 -0
  356. /package/build/{WEIGHT_GIRLS.zscore.yearly-f731d1e2.js → WEIGHT_GIRLS.zscore.yearly-2f942e3c.js} +0 -0
  357. /package/build/{animation-b224626d.js → animation-e179e2c5.js} +0 -0
  358. /package/build/{cart-149e990d.js → cart-bf783c3f.js} +0 -0
  359. /package/build/{constants-9c314450.js → constants-0f0f1c47.js} +0 -0
  360. /package/build/{constants-f9eca9ad.js → constants-7d64d5de.js} +0 -0
  361. /package/build/{constants-42eed92d.js → constants-f4bb9873.js} +0 -0
  362. /package/build/{dataTransform-104761fc.js → dataTransform-e07ba759.js} +0 -0
  363. /package/build/{doctor-d8f36158.js → doctor-40ef3864.js} +0 -0
  364. /package/build/esm/{BMI_BOYS.percentile.monthly-df1b3770.js → BMI_BOYS.percentile.monthly-bc6b17e9.js} +0 -0
  365. /package/build/esm/{BMI_BOYS.percentile.weekly-1d9595b1.js → BMI_BOYS.percentile.weekly-8daca1b6.js} +0 -0
  366. /package/build/esm/{BMI_BOYS.percentile.yearly-6bd2bb46.js → BMI_BOYS.percentile.yearly-391e1be2.js} +0 -0
  367. /package/build/esm/{BMI_BOYS.zscore.monthly-658792d1.js → BMI_BOYS.zscore.monthly-aec29c0d.js} +0 -0
  368. /package/build/esm/{BMI_BOYS.zscore.weekly-d3c4d378.js → BMI_BOYS.zscore.weekly-1ab0449c.js} +0 -0
  369. /package/build/esm/{BMI_BOYS.zscore.yearly-8ad375e2.js → BMI_BOYS.zscore.yearly-01a796dd.js} +0 -0
  370. /package/build/esm/{BMI_GIRLS.percentile.monthly-25f98c64.js → BMI_GIRLS.percentile.monthly-259b596a.js} +0 -0
  371. /package/build/esm/{BMI_GIRLS.percentile.weekly-d60b034d.js → BMI_GIRLS.percentile.weekly-c383c66f.js} +0 -0
  372. /package/build/esm/{BMI_GIRLS.percentile.yearly-0560df43.js → BMI_GIRLS.percentile.yearly-d62c0a28.js} +0 -0
  373. /package/build/esm/{BMI_GIRLS.zscore.monthly-2104651f.js → BMI_GIRLS.zscore.monthly-7625134f.js} +0 -0
  374. /package/build/esm/{BMI_GIRLS.zscore.weekly-37757497.js → BMI_GIRLS.zscore.weekly-0e939010.js} +0 -0
  375. /package/build/esm/{BMI_GIRLS.zscore.yearly-56872c59.js → BMI_GIRLS.zscore.yearly-a63cf9c5.js} +0 -0
  376. /package/build/esm/{ChevronDown-5633c5e8.js → ChevronDown-47009d66.js} +0 -0
  377. /package/build/esm/{Close-f541a904.js → Close-7ace7512.js} +0 -0
  378. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-47e6539d.js → HEAD CIRCUM_BOYS.percentile.monthly-3a2beeac.js} +0 -0
  379. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-594e065d.js → HEAD CIRCUM_BOYS.percentile.weekly-74d61bf1.js} +0 -0
  380. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-d24f1cc6.js → HEAD CIRCUM_BOYS.percentile.yearly-f13c493e.js} +0 -0
  381. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-94d82cb5.js → HEAD CIRCUM_BOYS.zscore.monthly-205ba143.js} +0 -0
  382. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-cb0109d0.js → HEAD CIRCUM_BOYS.zscore.weekly-1e22609d.js} +0 -0
  383. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-79a794c9.js → HEAD CIRCUM_BOYS.zscore.yearly-07a6cd70.js} +0 -0
  384. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-89615b43.js → HEAD CIRCUM_GIRLS.percentile.monthly-6843b424.js} +0 -0
  385. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-29d9184f.js → HEAD CIRCUM_GIRLS.percentile.weekly-0602fcca.js} +0 -0
  386. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-140da49d.js → HEAD CIRCUM_GIRLS.percentile.yearly-c47a7e80.js} +0 -0
  387. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-fe41d0e8.js → HEAD CIRCUM_GIRLS.zscore.monthly-35359b2d.js} +0 -0
  388. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-c6193e75.js → HEAD CIRCUM_GIRLS.zscore.weekly-e60d4541.js} +0 -0
  389. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-7018fed4.js → HEAD CIRCUM_GIRLS.zscore.yearly-776abe04.js} +0 -0
  390. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-fae5e6a0.js → HEIGHT_BOYS.percentile.monthly-72427471.js} +0 -0
  391. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-ddc33aee.js → HEIGHT_BOYS.percentile.weekly-9002aef8.js} +0 -0
  392. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-9e3064f0.js → HEIGHT_BOYS.percentile.yearly-57e7b44e.js} +0 -0
  393. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-7c9e0bb8.js → HEIGHT_BOYS.zscore.monthly-e38229ab.js} +0 -0
  394. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-50b0a6a0.js → HEIGHT_BOYS.zscore.weekly-0de1c25b.js} +0 -0
  395. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-afb6c4a2.js → HEIGHT_BOYS.zscore.yearly-79fd59a0.js} +0 -0
  396. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-5c7487f0.js → HEIGHT_GIRLS.percentile.monthly-4b85547a.js} +0 -0
  397. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-33465e14.js → HEIGHT_GIRLS.percentile.weekly-c56f6c67.js} +0 -0
  398. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-ae62b279.js → HEIGHT_GIRLS.percentile.yearly-0ab407d8.js} +0 -0
  399. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-fd13c492.js → HEIGHT_GIRLS.zscore.monthly-bc1b72b1.js} +0 -0
  400. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-f509ffbe.js → HEIGHT_GIRLS.zscore.weekly-ad1be5c9.js} +0 -0
  401. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-bf3a867b.js → HEIGHT_GIRLS.zscore.yearly-f66a912e.js} +0 -0
  402. /package/build/esm/{Locale-81beb37e.js → Locale-ecfc005f.js} +0 -0
  403. /package/build/esm/{Visible-3d8c22f1.js → Visible-6cf48849.js} +0 -0
  404. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-4db4c32c.js → WEIGHT_BOYS.percentile.monthly-c6ff1c19.js} +0 -0
  405. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-5321689a.js → WEIGHT_BOYS.percentile.weekly-4da177a7.js} +0 -0
  406. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-0c2aee80.js → WEIGHT_BOYS.percentile.yearly-9dd4d8d7.js} +0 -0
  407. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-ddf307e5.js → WEIGHT_BOYS.zscore.monthly-824c2f6d.js} +0 -0
  408. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-be1d57ac.js → WEIGHT_BOYS.zscore.weekly-d20f3e4a.js} +0 -0
  409. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-6dab88ff.js → WEIGHT_BOYS.zscore.yearly-727beeda.js} +0 -0
  410. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-a666fe8a.js → WEIGHT_GIRLS.percentile.monthly-a2813cfb.js} +0 -0
  411. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-cd85042c.js → WEIGHT_GIRLS.percentile.weekly-5f11b917.js} +0 -0
  412. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-f22705ec.js → WEIGHT_GIRLS.percentile.yearly-50e69a87.js} +0 -0
  413. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-9f3f1083.js → WEIGHT_GIRLS.zscore.monthly-401c7b03.js} +0 -0
  414. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-7dcf0ba5.js → WEIGHT_GIRLS.zscore.weekly-c8c05886.js} +0 -0
  415. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-c658040c.js → WEIGHT_GIRLS.zscore.yearly-95f19286.js} +0 -0
  416. /package/build/esm/{animation-db89f033.js → animation-e6680d35.js} +0 -0
  417. /package/build/esm/{cart-47013af9.js → cart-bf2cc2ab.js} +0 -0
  418. /package/build/esm/{constants-f9614464.js → constants-7628355c.js} +0 -0
  419. /package/build/esm/{constants-247d5eb0.js → constants-785ee28c.js} +0 -0
  420. /package/build/esm/{constants-410be40f.js → constants-ce2232f9.js} +0 -0
  421. /package/build/esm/{dataTransform-f9e5b4ec.js → dataTransform-65f0e010.js} +0 -0
  422. /package/build/esm/{doctor-88e78d2c.js → doctor-e9dc9ff4.js} +0 -0
  423. /package/build/esm/{index-fcd9b927.js → index-0b230567.js} +0 -0
  424. /package/build/esm/{index-5f214b71.js → index-46c00291.js} +0 -0
  425. /package/build/esm/{index-6dd5a329.js → index-92017dfa.js} +0 -0
  426. /package/build/esm/{index-907fffe6.js → index-c1527254.js} +0 -0
  427. /package/build/esm/{index-24f2f569.js → index-d4eef69b.js} +0 -0
  428. /package/build/esm/{index-c3d6b2ed.js → index-d531588f.js} +0 -0
  429. /package/build/esm/{index-0ca51fbb.js → index-efcf28a7.js} +0 -0
  430. /package/build/esm/{index-6f44d928.js → index-fedbbf85.js} +0 -0
  431. /package/build/esm/{localizeNumberFormat-be70a31e.js → localizeNumberFormat-636f4afc.js} +0 -0
  432. /package/build/esm/{number-7e3f376a.js → number-4add588d.js} +0 -0
  433. /package/build/esm/{other-811b7d93.js → other-f8b0155f.js} +0 -0
  434. /package/build/esm/{paths-650d5eee.js → paths-8c6b2942.js} +0 -0
  435. /package/build/esm/{translationsContext-0cbb21e6.js → translationsContext-982b80f4.js} +0 -0
  436. /package/build/esm/{tslib.es6-3970c414.js → tslib.es6-fd8cab49.js} +0 -0
  437. /package/build/esm/{types-78bfaf40.js → types-795b39db.js} +0 -0
  438. /package/build/esm/{useIsInit-3f7af1fd.js → useIsInit-b060587e.js} +0 -0
  439. /package/build/esm/{useOutsideClick-2fae5fb5.js → useOutsideClick-9dd24b21.js} +0 -0
  440. /package/build/esm/{useScrollbarSize-2a7e6dd2.js → useScrollbarSize-63b3d369.js} +0 -0
  441. /package/build/esm/{useUniqueId-d714426d.js → useUniqueId-d61a7b61.js} +0 -0
  442. /package/build/esm/{utils-cee25689.js → utils-1dbd61fa.js} +0 -0
  443. /package/build/{index-1d528960.js → index-0e1519d2.js} +0 -0
  444. /package/build/{index-9f501aac.js → index-3a582f5d.js} +0 -0
  445. /package/build/{index-20a5cee0.js → index-7a8c6b41.js} +0 -0
  446. /package/build/{index-41a348a2.js → index-86f9afd6.js} +0 -0
  447. /package/build/{index-e327613c.js → index-96be5ce0.js} +0 -0
  448. /package/build/{index-32917720.js → index-b8a5acbb.js} +0 -0
  449. /package/build/{index-186f9324.js → index-db2b38f4.js} +0 -0
  450. /package/build/{index-27f25094.js → index-f8017859.js} +0 -0
  451. /package/build/{localizeNumberFormat-a5804ea2.js → localizeNumberFormat-9697460d.js} +0 -0
  452. /package/build/{normalizeLink-2878a2ce.js → normalizeLink-3ec047d7.js} +0 -0
  453. /package/build/{number-35662113.js → number-3ffc7553.js} +0 -0
  454. /package/build/{other-a7f01b3d.js → other-5c1524b3.js} +0 -0
  455. /package/build/{paths-488dafd4.js → paths-f15bee7b.js} +0 -0
  456. /package/build/{translationsContext-951038ad.js → translationsContext-9b528bb0.js} +0 -0
  457. /package/build/{tslib.es6-145af9ce.js → tslib.es6-5d65f18f.js} +0 -0
  458. /package/build/{types-aeea2cc2.js → types-4b87fdbb.js} +0 -0
  459. /package/build/{useIsInit-0c37752a.js → useIsInit-d6139b45.js} +0 -0
  460. /package/build/{useOutsideClick-aa477d22.js → useOutsideClick-b5ae0665.js} +0 -0
  461. /package/build/{useScrollbarSize-01b12b72.js → useScrollbarSize-ad6c0522.js} +0 -0
  462. /package/build/{useUniqueId-17c2097b.js → useUniqueId-5fc9f536.js} +0 -0
  463. /package/build/{utils-a1cfbdac.js → utils-97ffdcb1.js} +0 -0
@@ -0,0 +1,1665 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var core = require('@mantine/core');
7
+ var utils$1 = require('./utils-a4f75f1f.js');
8
+ var useOutsideClick = require('./useOutsideClick-b5ae0665.js');
9
+ var useTranslations = require('./useTranslations-4fb7a5ac.js');
10
+ var debounce = require('lodash/debounce');
11
+ var constants = require('./constants-f4bb9873.js');
12
+ var styled = require('@emotion/styled');
13
+ var miscTheme = require('./miscTheme.js');
14
+ var utils = require('./utils-97ffdcb1.js');
15
+ var index = require('./index-7a8c6b41.js');
16
+ var core$1 = require('@hhgtech/icons/core');
17
+ var index$1 = require('./index-6266a5df.js');
18
+ var ChevronDown = require('./ChevronDown-c29d0fb5.js');
19
+ var paths = require('./paths-f15bee7b.js');
20
+ require('./index-330e16a8.js');
21
+ require('date-fns/locale');
22
+ require('./index-1b1ac8fe.js');
23
+ require('./Locale-e697d040.js');
24
+ require('./constantsIsProduction.js');
25
+ require('./constantsSite.js');
26
+ require('./constantsDomainLocales.js');
27
+ require('./constantsRiskScreener.js');
28
+ require('./miscCookieHelper.js');
29
+ require('react-loading-skeleton');
30
+ require('string-format');
31
+ require('./translationsContext-9b528bb0.js');
32
+ require('./tslib.es6-5d65f18f.js');
33
+ require('./other-5c1524b3.js');
34
+
35
+ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
36
+
37
+ var React__default = /*#__PURE__*/_interopDefault(React);
38
+ var debounce__default = /*#__PURE__*/_interopDefault(debounce);
39
+ var styled__default = /*#__PURE__*/_interopDefault(styled);
40
+
41
+ const StyledSearchBarWrapper = styled__default["default"].div ``;
42
+ const StyleWrapperContainer = styled__default["default"].div `
43
+ background-color: ${miscTheme.theme.colors.neutral50};
44
+ padding-bottom: 1px;
45
+ ${utils.MediaQueries.mbDown} {
46
+ padding: 0 16px 10px;
47
+ }
48
+ `;
49
+ const StyleSearchInputContainer = styled__default["default"](index.Container) `
50
+ padding: 0 16px;
51
+
52
+ ${utils.MediaQueries.mbDown} {
53
+ padding: 0;
54
+ }
55
+ `;
56
+ const StyleSearchContent = styled__default["default"].div `
57
+ padding: 24px 56px;
58
+ border-radius: 16px;
59
+ background-color: ${miscTheme.theme.colors.white};
60
+ box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.04),
61
+ 0px 0px 2px 0px rgba(0, 0, 0, 0.06), 0px 4px 8px 0px rgba(0, 0, 0, 0.04);
62
+
63
+ ${utils.MediaQueries.mbDown} {
64
+ padding: 16px 16px;
65
+ border-radius: 0px 0px 12px 12px;
66
+ }
67
+
68
+ .flex-search-input {
69
+ flex-direction: row;
70
+ ${utils.MediaQueries.mbDown} {
71
+ flex-direction: column;
72
+ }
73
+ }
74
+ `;
75
+
76
+ const SEARCH_KEYWORD_MIN_LENGTH = {
77
+ 'en-PH': 3,
78
+ 'tl-PH': 2,
79
+ 'id-ID': 3,
80
+ 'vi-VN': 2,
81
+ 'zh-TW': 0,
82
+ 'ms-MY': 2,
83
+ };
84
+
85
+ const initialState = {
86
+ isMobile: false,
87
+ isDebug: false,
88
+ navigateTo: null,
89
+ geoLocationPermission: 'unset',
90
+ geoLocationCoordinates: null,
91
+ focused: 'none',
92
+ focusedSpecialty: 'none',
93
+ searchLocationKeywords: '',
94
+ searchSpecialtyKeywords: '',
95
+ searchKeywords: '',
96
+ selectedLocation: null,
97
+ selectedSpecialty: null,
98
+ defaultCity: null,
99
+ initialCities: [],
100
+ cities: [],
101
+ searchResults: {},
102
+ initialSearchResults: {},
103
+ isLoadingCities: false,
104
+ isLoadingSearchResults: false,
105
+ isMobileModalOpened: false,
106
+ initialSelectedCity: null,
107
+ autoCompleteDisabled: false,
108
+ inputSearchPlaceholder: '',
109
+ locale: 'vi-VN',
110
+ allSpecialties: [],
111
+ popularKeys: [],
112
+ };
113
+ var ActionTypes;
114
+ (function (ActionTypes) {
115
+ ActionTypes["NavigateTo"] = "navigate to url";
116
+ ActionTypes["ClickOutsideInputLocation"] = "click outside input location";
117
+ ActionTypes["ClickOutsideInputSearch"] = "click outside input search";
118
+ ActionTypes["ClickOutsideInputSearchSpecialty"] = "click outside input search specialty";
119
+ ActionTypes["ClickOutsideInputSpecialty"] = "click outside input specialty";
120
+ ActionTypes["SelectCurrentLocation"] = "select current location";
121
+ ActionTypes["FocusInputLocation"] = "focus input location";
122
+ ActionTypes["FocusInputSearch"] = "focus input search";
123
+ ActionTypes["FocusInputSearchSpecialty"] = "focus input search specialty";
124
+ ActionTypes["ChangeInputLocation"] = "change input location";
125
+ ActionTypes["ChangeInputSearch"] = "change input search";
126
+ ActionTypes["ClearInputLocation"] = "clear input location";
127
+ ActionTypes["ClearInputSearch"] = "clear input search";
128
+ ActionTypes["SelectLocation"] = "select location";
129
+ ActionTypes["SelectSpecialty"] = "select specialty";
130
+ ActionTypes["FetchCitiesStart"] = "fetch cities start";
131
+ ActionTypes["FetchCitiesFinish"] = "fetch cities finish";
132
+ ActionTypes["FetchSearchResultsStart"] = "fetch search results start";
133
+ ActionTypes["FetchSearchResultsComplete"] = "fetch search results complete";
134
+ ActionTypes["FetchSearchResultsFinish"] = "fetch search results finish";
135
+ ActionTypes["FetchCitiesByGeoIpComplete"] = "fetch cities by geo IP finish";
136
+ ActionTypes["FetchCitiesByKeywordComplete"] = "fetch cities by keyword finish";
137
+ ActionTypes["DisplayInitialCities"] = "display initial cities";
138
+ ActionTypes["DisplayInitialSearchResults"] = "display initial search results";
139
+ ActionTypes["UpdateInitialSearchResults"] = "update initial search results";
140
+ ActionTypes["GrantGeoLocationPermission"] = "grant geolocation permission";
141
+ ActionTypes["DenyGeoLocationPermission"] = "deny geolocation permission";
142
+ ActionTypes["OpenMobileModal"] = "open mobile modal";
143
+ ActionTypes["CloseMobileModal"] = "close mobile modal";
144
+ ActionTypes["UpdateInitialSearchValue"] = "update initial search value";
145
+ ActionTypes["SelectSearchResult"] = "select search result";
146
+ ActionTypes["SetInputSearchPlaceholder"] = "set input search placeholder";
147
+ ActionTypes["FocusInputSpecialty"] = "focus input specialty";
148
+ ActionTypes["FetchAllSpecialties"] = "fetch all specialty";
149
+ ActionTypes["FetchPopularKeys"] = "fetch popular key by type";
150
+ })(ActionTypes || (ActionTypes = {}));
151
+ function resetSearchLocationKeywords(state) {
152
+ const { selectedLocation, searchLocationKeywords } = state;
153
+ if (selectedLocation && searchLocationKeywords !== selectedLocation.name) {
154
+ return Object.assign(Object.assign({}, state), { searchLocationKeywords: selectedLocation.name });
155
+ }
156
+ return state;
157
+ }
158
+ function reducer(state, action) {
159
+ var _a, _b;
160
+ if (state.isDebug) {
161
+ console.log('bookingSearchBar', { action, state });
162
+ }
163
+ switch (action.type) {
164
+ case ActionTypes.NavigateTo:
165
+ return Object.assign(Object.assign({}, state), { navigateTo: action.payload, focused: 'none', isMobileModalOpened: false });
166
+ case ActionTypes.ClickOutsideInputLocation: {
167
+ if (state.focused !== 'location') {
168
+ return state;
169
+ }
170
+ return resetSearchLocationKeywords(Object.assign(Object.assign({}, state), { focused: 'none' }));
171
+ }
172
+ case ActionTypes.ClickOutsideInputSpecialty: {
173
+ if (state.focused !== 'specialty') {
174
+ return state;
175
+ }
176
+ return resetSearchLocationKeywords(Object.assign(Object.assign({}, state), { focused: 'none' }));
177
+ }
178
+ case ActionTypes.ClickOutsideInputSearch: {
179
+ if (state.focused !== 'search') {
180
+ return state;
181
+ }
182
+ return Object.assign(Object.assign({}, state), { focused: 'none' });
183
+ }
184
+ case ActionTypes.ClickOutsideInputSearchSpecialty: {
185
+ if (state.focusedSpecialty !== 'search') {
186
+ return state;
187
+ }
188
+ return Object.assign(Object.assign({}, state), { focusedSpecialty: 'none' });
189
+ }
190
+ case ActionTypes.FocusInputLocation: {
191
+ const nextState = Object.assign(Object.assign({}, state), { focused: 'location' });
192
+ if (((_a = state.selectedLocation) === null || _a === void 0 ? void 0 : _a.id) === constants.ID_OPTION_CURRENT_LOCATION) {
193
+ nextState.searchLocationKeywords = '';
194
+ }
195
+ return nextState;
196
+ }
197
+ case ActionTypes.FocusInputSpecialty: {
198
+ const nextState = Object.assign(Object.assign({}, state), { focused: 'specialty' });
199
+ if (((_b = state.selectedLocation) === null || _b === void 0 ? void 0 : _b.id) === constants.ID_OPTION_CURRENT_LOCATION) {
200
+ nextState.searchLocationKeywords = '';
201
+ }
202
+ return nextState;
203
+ }
204
+ case ActionTypes.FocusInputSearch:
205
+ const nextState = Object.assign(Object.assign({}, state), { focused: 'search' });
206
+ if (state.isMobile) {
207
+ return resetSearchLocationKeywords(nextState);
208
+ }
209
+ return nextState;
210
+ case ActionTypes.FocusInputSearchSpecialty: {
211
+ const nextState = Object.assign(Object.assign({}, state), { focusedSpecialty: 'search' });
212
+ return nextState;
213
+ }
214
+ case ActionTypes.ChangeInputLocation:
215
+ return Object.assign(Object.assign({}, state), { searchLocationKeywords: action.payload });
216
+ case ActionTypes.ChangeInputSearch: {
217
+ const keyword = action.payload;
218
+ return Object.assign(Object.assign({}, state), { searchKeywords: keyword, isLoadingSearchResults: keyword.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale] });
219
+ }
220
+ case ActionTypes.SelectCurrentLocation:
221
+ return Object.assign(Object.assign({}, state), { focused: 'none', selectedLocation: action.payload, searchLocationKeywords: action.payload.name });
222
+ case ActionTypes.ClearInputLocation:
223
+ return Object.assign(Object.assign({}, state), { focused: 'location', cities: state.initialCities, searchLocationKeywords: '' });
224
+ case ActionTypes.ClearInputSearch:
225
+ return Object.assign(Object.assign({}, state), { focused: 'search', searchKeywords: '' });
226
+ case ActionTypes.SelectLocation:
227
+ return Object.assign(Object.assign({}, state), { focused: 'none', selectedLocation: action.payload, searchLocationKeywords: action.payload.name });
228
+ case ActionTypes.SelectSpecialty:
229
+ return Object.assign(Object.assign({}, state), { focused: 'none', selectedSpecialty: action.payload });
230
+ case ActionTypes.SelectSearchResult:
231
+ return Object.assign(Object.assign({}, state), { searchKeywords: action.payload.name, isMobileModalOpened: false, focused: 'none', navigateTo: action.payload.url });
232
+ case ActionTypes.FetchCitiesStart:
233
+ return Object.assign(Object.assign({}, state), { isLoadingCities: true });
234
+ case ActionTypes.FetchCitiesFinish:
235
+ return Object.assign(Object.assign({}, state), { isLoadingCities: false });
236
+ case ActionTypes.FetchSearchResultsStart:
237
+ return Object.assign(Object.assign({}, state), { isLoadingSearchResults: true });
238
+ case ActionTypes.FetchSearchResultsFinish:
239
+ return Object.assign(Object.assign({}, state), { isLoadingSearchResults: false });
240
+ case ActionTypes.FetchSearchResultsComplete: {
241
+ const nextState = Object.assign(Object.assign({}, state), { searchResults: Object.assign(Object.assign({}, state.searchResults), { [action.payload.key]: action.payload.searches }) });
242
+ return nextState;
243
+ }
244
+ case ActionTypes.FetchCitiesByGeoIpComplete: {
245
+ let { cities } = action.payload;
246
+ const { default: defaultCity } = action.payload;
247
+ cities = cities.filter((c) => c.id !== defaultCity.id);
248
+ if (defaultCity) {
249
+ cities.unshift(defaultCity);
250
+ }
251
+ if (state.initialSelectedCity &&
252
+ !cities.find((c) => c.id === state.initialSelectedCity.id)) {
253
+ cities.unshift(state.initialSelectedCity);
254
+ }
255
+ const nextState = Object.assign(Object.assign({}, state), { defaultCity, initialCities: cities, cities });
256
+ if (state.geoLocationPermission === 'denied' &&
257
+ !state.initialSelectedCity) {
258
+ nextState.selectedLocation = defaultCity;
259
+ nextState.searchLocationKeywords = defaultCity.name;
260
+ }
261
+ return nextState;
262
+ }
263
+ case ActionTypes.FetchCitiesByKeywordComplete:
264
+ return Object.assign(Object.assign({}, state), { cities: action.payload });
265
+ case ActionTypes.DisplayInitialCities:
266
+ return Object.assign(Object.assign({}, state), { cities: state.initialCities });
267
+ case ActionTypes.DisplayInitialSearchResults:
268
+ return Object.assign(Object.assign({}, state), { searchResults: state.initialSearchResults, isLoadingSearchResults: false });
269
+ case ActionTypes.UpdateInitialSearchResults:
270
+ return Object.assign(Object.assign({}, state), { initialSearchResults: Object.assign(Object.assign({}, state.initialSearchResults), { [action.payload.key]: action.payload.searches }) });
271
+ case ActionTypes.GrantGeoLocationPermission:
272
+ return Object.assign(Object.assign({}, state), { geoLocationPermission: 'granted', geoLocationCoordinates: action.payload });
273
+ case ActionTypes.DenyGeoLocationPermission:
274
+ return Object.assign(Object.assign({}, state), { geoLocationPermission: 'denied', geoLocationCoordinates: null });
275
+ case ActionTypes.OpenMobileModal:
276
+ return Object.assign(Object.assign({}, state), { isMobileModalOpened: true });
277
+ case ActionTypes.CloseMobileModal:
278
+ return Object.assign(Object.assign({}, state), { isMobileModalOpened: false });
279
+ case ActionTypes.UpdateInitialSearchValue:
280
+ return Object.assign(Object.assign({}, state), { searchKeywords: action.payload });
281
+ case ActionTypes.SetInputSearchPlaceholder:
282
+ return Object.assign(Object.assign({}, state), { inputSearchPlaceholder: action.payload });
283
+ case ActionTypes.FetchAllSpecialties:
284
+ return Object.assign(Object.assign({}, state), { allSpecialties: action.payload });
285
+ case ActionTypes.FetchPopularKeys:
286
+ return Object.assign(Object.assign({}, state), { popularKeys: action.payload });
287
+ default:
288
+ return state;
289
+ }
290
+ }
291
+
292
+ const StyleSearchInputsWrapper = styled__default["default"].div `
293
+ flex: 1;
294
+ position: relative;
295
+
296
+ ${utils.MediaQueries.mbDown} {
297
+ width: 100%;
298
+ display: flex;
299
+ flex-direction: column;
300
+ gap: 12px;
301
+ }
302
+ `;
303
+ const StyleResultWrapper$2 = styled__default["default"].div `
304
+ position: absolute;
305
+ top: calc(100% + 2px);
306
+ width: 100%;
307
+ border-radius: 4px;
308
+ background: ${miscTheme.theme.colors.white};
309
+ box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1);
310
+ z-index: 10;
311
+
312
+ ${utils.MediaQueries.mbDown} {
313
+ width: calc(100% + 64px);
314
+ left: -32px;
315
+ }
316
+ `;
317
+
318
+ const StyledSearchResultWrapper = styled__default["default"].div ``;
319
+ const StyleResultHeader = styled__default["default"].div `
320
+ display: flex;
321
+ justify-content: space-between;
322
+ align-item: center;
323
+ padding: 9px 14px 9px 22px;
324
+ background: #f7f9fc;
325
+
326
+ .title {
327
+ color: ${miscTheme.theme.colors.gray800};
328
+ font-size: 14px;
329
+ font-weight: 600;
330
+ line-height: 22px;
331
+ }
332
+
333
+ .btn-see-all {
334
+ color: ${miscTheme.theme.colors.blue600};
335
+ font-size: 14px;
336
+ line-height: 22px;
337
+ cursor: pointer;
338
+ }
339
+ `;
340
+ const StyleResultBody = styled__default["default"].div `
341
+ padding: 10px 16px;
342
+ max-height: 400px;
343
+ overflow: auto;
344
+ `;
345
+ const StyleResultItem = styled__default["default"].div `
346
+ display: flex;
347
+ gap: 12px;
348
+ align-items: center;
349
+ cursor: pointer;
350
+
351
+ &:hover {
352
+ background-color: ${miscTheme.theme.colors.blue50};
353
+ }
354
+ .image-item {
355
+ flex: 0 0 48px;
356
+ width: 48px;
357
+ height: 48px;
358
+ border-radius: 50%;
359
+
360
+ img {
361
+ object-fit: contain;
362
+ width: 100%;
363
+ height: 100%;
364
+ border-radius: 50%;
365
+ }
366
+ }
367
+ .infor {
368
+ overflow: hidden;
369
+ padding: 12px 0;
370
+ flex: 1;
371
+ border-bottom: 1px solid ${miscTheme.theme.colors.neutral100};
372
+ .title {
373
+ color: ${miscTheme.theme.colors.gray800};
374
+ font-size: 16px;
375
+ font-weight: 600;
376
+ line-height: 24px;
377
+ }
378
+ .description {
379
+ overflow: hidden;
380
+ color: ${miscTheme.theme.colors.gray600};
381
+ text-overflow: ellipsis;
382
+ white-space: nowrap;
383
+ font-size: 12px;
384
+ line-height: 18px;
385
+ display: flex;
386
+ gap: 8px;
387
+ align-items: center;
388
+ margin-top: 5px;
389
+
390
+ svg {
391
+ flex: 0 0 16px;
392
+ }
393
+
394
+ .sub-description {
395
+ overflow: hidden;
396
+ white-space: nowrap;
397
+ text-overflow: ellipsis;
398
+ flex: 1;
399
+ }
400
+ }
401
+ }
402
+
403
+ &.last-item {
404
+ .infor {
405
+ border-bottom: none;
406
+ }
407
+ }
408
+ `;
409
+ styled__default["default"].div `
410
+ padding: 0 16px 16px;
411
+
412
+ .search-detail-btn {
413
+ color: ${miscTheme.theme.colors.blue600};
414
+ font-size: 14px;
415
+ line-height: 22px;
416
+ cursor: pointer;
417
+ }
418
+ `;
419
+
420
+ const SearchResult = ({ state, type, results, location, isLoading, typeInformation, clientSlug = '', dispatch, }) => {
421
+ const { locale, t } = useTranslations.useTranslations();
422
+ const { selectedLocation } = state;
423
+ const typeSlug = React.useMemo(() => typeInformation[type].slug, [typeInformation, type]);
424
+ const handleOnClick = (item) => {
425
+ let url = '';
426
+ switch (type) {
427
+ case 'service':
428
+ url = `/${selectedLocation.slug}/${typeSlug}/${item.slug}`;
429
+ break;
430
+ case 'doctor':
431
+ case 'hospital':
432
+ url = `/${typeSlug}/${item.slug}-${item.id}`;
433
+ break;
434
+ }
435
+ if (url) {
436
+ dispatch({
437
+ type: ActionTypes.NavigateTo,
438
+ payload: url,
439
+ });
440
+ }
441
+ };
442
+ const handleSeeAll = () => {
443
+ let url = `/${selectedLocation.slug}/${typeSlug}`;
444
+ const slugClientUrl = constants.MAPPING_CLIENT_WITH_SLUG[locale][clientSlug];
445
+ if (slugClientUrl) {
446
+ url += `/${slugClientUrl}`;
447
+ }
448
+ if ((type === 'doctor' || type === 'hospital') &&
449
+ state.selectedSpecialty.id > 0) {
450
+ url += `?specialtyId=${state.selectedSpecialty.id}`;
451
+ }
452
+ if (url) {
453
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
454
+ }
455
+ };
456
+ return (React__default["default"].createElement(StyledSearchResultWrapper, null,
457
+ React__default["default"].createElement(StyleResultHeader, null,
458
+ React__default["default"].createElement("div", { className: "title" }, t('booking.searchResult.description', {
459
+ search_type: typeInformation[type].name,
460
+ search_location: location,
461
+ })),
462
+ results.length > 0 && (React__default["default"].createElement("div", { className: "btn-see-all", onClick: handleSeeAll }, t('home.seeAll')))),
463
+ React__default["default"].createElement(StyleResultBody, null,
464
+ isLoading &&
465
+ Array(3)
466
+ .fill(undefined)
467
+ .map((_, i) => (React__default["default"].createElement(StyleResultItem, { key: type + 'loading' + i, className: i === 2 ? 'last-item' : '' },
468
+ React__default["default"].createElement("div", { className: "image-item" },
469
+ React__default["default"].createElement(core.Skeleton, { height: 48, circle: true, mb: "xl", animate: true })),
470
+ React__default["default"].createElement("div", { className: "infor" },
471
+ React__default["default"].createElement("div", { className: "title" },
472
+ React__default["default"].createElement(core.Skeleton, { height: 8, mt: 10, radius: "xl", animate: true })),
473
+ React__default["default"].createElement("div", { className: "description" },
474
+ React__default["default"].createElement("div", { className: "sub-description" },
475
+ React__default["default"].createElement(core.Skeleton, { height: 8, mt: 10, radius: "xl", width: "80%", animate: true }))))))),
476
+ !isLoading && results && results.length > 0 && (React__default["default"].createElement(React__default["default"].Fragment, null, results.map((item, index) => {
477
+ var _a, _b;
478
+ const isLastItem = (results.length > 4 && index === 3) ||
479
+ (results.length <= 4 && index === results.length - 1);
480
+ let subDescription = '';
481
+ if (type === 'hospital') {
482
+ subDescription = (item === null || item === void 0 ? void 0 : item.address) || '';
483
+ }
484
+ if (type === 'doctor') {
485
+ subDescription = ((_a = item === null || item === void 0 ? void 0 : item.specialties) === null || _a === void 0 ? void 0 : _a.join(', ')) || '';
486
+ }
487
+ if (type === 'service') {
488
+ subDescription = ((_b = item === null || item === void 0 ? void 0 : item.hospital_branch) === null || _b === void 0 ? void 0 : _b.name) || '';
489
+ }
490
+ if (index >= 4) {
491
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
492
+ }
493
+ return (React__default["default"].createElement(StyleResultItem, { key: item.id, className: isLastItem ? 'last-item' : '', onClick: () => handleOnClick(item) },
494
+ React__default["default"].createElement("div", { className: "image-item" },
495
+ React__default["default"].createElement("img", { src: item.logo || item.avatar, alt: item.name })),
496
+ React__default["default"].createElement("div", { className: "infor" },
497
+ React__default["default"].createElement("div", { className: "title" }, item.name),
498
+ React__default["default"].createElement("div", { className: "description" },
499
+ typeInformation[type].icon,
500
+ React__default["default"].createElement("div", { className: "sub-description" }, subDescription)))));
501
+ }))),
502
+ !isLoading && (results === null || results === void 0 ? void 0 : results.length) === 0 && (React__default["default"].createElement(index$1.Text, { size: "sm", color: miscTheme.theme.colors.gray400 }, t('booking.searchBar.noResults'))))));
503
+ };
504
+
505
+ const StyleSearchSpecialtyWrapper = styled__default["default"].div `
506
+ position: relative;
507
+
508
+ ${utils.MediaQueries.mbDown} {
509
+ width: 100%;
510
+ display: flex;
511
+ flex-direction: column;
512
+ gap: 12px;
513
+ }
514
+ `;
515
+ const StyleResultWrapper$1 = styled__default["default"].div `
516
+ position: absolute;
517
+ top: calc(100% + 2px);
518
+ width: calc(100% + 100px);
519
+ border-radius: 4px;
520
+ background: ${miscTheme.theme.colors.white};
521
+ box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1);
522
+ z-index: 10;
523
+ max-height: 300px;
524
+ overflow: auto;
525
+
526
+ ${utils.MediaQueries.mbDown} {
527
+ width: calc(100% + 64px);
528
+ left: -32px;
529
+ }
530
+ `;
531
+ const StyledSpecialtyItem = styled__default["default"].li `
532
+ position: relative;
533
+ cursor: pointer;
534
+ padding: 12px 18px;
535
+ display: flex;
536
+ align-items: center;
537
+ gap: 14px;
538
+ overflow: hidden;
539
+
540
+ .image-item {
541
+ display: flex;
542
+ align-items: center;
543
+ width: 40px;
544
+ height: 40px;
545
+
546
+ img {
547
+ width: 100%;
548
+ object-fit: cover;
549
+ }
550
+
551
+ svg {
552
+ width: 40px;
553
+ }
554
+ }
555
+
556
+ ${({ isSelected }) => isSelected &&
557
+ `
558
+ &::after {
559
+ content: ${utils$1.checkMarkIconUrl};
560
+ top: 50%;
561
+ right: 18px;
562
+ position: absolute;
563
+ transform: translateY(-50%);
564
+ }
565
+ `}
566
+
567
+ & + li::before {
568
+ content: '';
569
+ position: absolute;
570
+ left: 18px;
571
+ right: 18px;
572
+ top: 0;
573
+ height: 1px;
574
+ background-color: ${miscTheme.theme.colors.neutral100};
575
+ }
576
+
577
+ &:not([data-is-denied='true']):hover {
578
+ background-color: ${miscTheme.theme.colors.neutral50};
579
+ }
580
+
581
+ &:last-child:hover {
582
+ border-bottom-right-radius: 6px;
583
+ border-bottom-left-radius: 6px;
584
+ }
585
+
586
+ &:first-child:hover {
587
+ border-top-right-radius: 6px;
588
+ border-top-left-radius: 6px;
589
+ }
590
+
591
+ &[data-is-denied='true'] {
592
+ cursor: not-allowed;
593
+ }
594
+ `;
595
+
596
+ const DoctorIcon = () => (React__default["default"].createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
597
+ React__default["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" })));
598
+ const ServiceIcon = () => (React__default["default"].createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
599
+ React__default["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" })));
600
+ const HospitalIcon = () => (React__default["default"].createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
601
+ React__default["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" })));
602
+ const SpecialtyIcon = () => (React__default["default"].createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16" },
603
+ React__default["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" })));
604
+
605
+ const SearchSpecialty = ({ state, isMobile, debouncedFetchSearchResults, selectedLocation, onSpecialtyClick, dispatch, }) => {
606
+ var _a;
607
+ const { t, locale } = useTranslations.useTranslations();
608
+ const inputSpecialtyWrapperRef = React.useRef(null);
609
+ const slugs = React.useMemo(() => constants.LOCALIZED_SLUGS[locale], [locale]);
610
+ const styleSpecialties = React.useMemo(() => {
611
+ return {
612
+ wrapper: {
613
+ '&:after': {
614
+ content: '""',
615
+ width: '1px',
616
+ height: '20px',
617
+ backgroundColor: '#E4E8EC',
618
+ position: 'absolute',
619
+ right: 0,
620
+ top: '13px',
621
+ },
622
+ },
623
+ input: {
624
+ border: isMobile ? 'border: 1px solid #d9d9d9' : 'none',
625
+ height: isMobile ? '40px' : '46px !important',
626
+ paddingRight: '30px',
627
+ '&:focus': {
628
+ boxShadow: isMobile ? 'box-shadow: 0px 0px 0px 2px #91caff' : 'none',
629
+ },
630
+ },
631
+ rightSection: {
632
+ width: '30px',
633
+ svg: {
634
+ fontSize: '20px',
635
+ },
636
+ },
637
+ };
638
+ }, [isMobile]);
639
+ const handleSearchSpecialtyInputChange = React.useCallback(function handleSearchSpecialtyInputChange(value) {
640
+ // dispatch({ type: ActionTypes.ChangeInputLocation, payload: value })
641
+ // if (value.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale]) {
642
+ // debouncedFetchSearchResults(value.trim())
643
+ // } else {
644
+ // debouncedFetchSearchResults.cancel()
645
+ // dispatch({ type: ActionTypes.DisplayInitialCities })
646
+ // }
647
+ console.log(value);
648
+ }, [debouncedFetchSearchResults, dispatch]);
649
+ useOutsideClick.useOutsideClick(inputSpecialtyWrapperRef, () => {
650
+ dispatch({ type: ActionTypes.ClickOutsideInputSpecialty });
651
+ });
652
+ return (React__default["default"].createElement(StyleSearchSpecialtyWrapper, { ref: inputSpecialtyWrapperRef },
653
+ React__default["default"].createElement(core.Input.Wrapper, null,
654
+ React__default["default"].createElement(core.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["default"].createElement(ChevronDown.ChevronDown, null), styles: styleSpecialties, onFocus: () => dispatch({ type: ActionTypes.FocusInputSpecialty }), onChange: (event) => {
655
+ handleSearchSpecialtyInputChange(event.target.value);
656
+ } })),
657
+ state.focused === 'specialty' && (React__default["default"].createElement(StyleResultWrapper$1, null,
658
+ React__default["default"].createElement(StyledSpecialtyItem, { key: "all-location", role: "button", tabIndex: 0, onClick: () => {
659
+ if (onSpecialtyClick) {
660
+ onSpecialtyClick({
661
+ name: t('booking.searchBar.allSpecialties'),
662
+ id: -1,
663
+ thumbnail: '',
664
+ total_doctor: 0,
665
+ slug: slugs.SPECIALTIES,
666
+ });
667
+ }
668
+ } },
669
+ React__default["default"].createElement("div", { className: "image-item" },
670
+ React__default["default"].createElement(SpecialtyIcon, null)),
671
+ React__default["default"].createElement(index$1.Text, { size: "md" }, t('booking.searchBar.allSpecialties'))),
672
+ state.allSpecialties.map((specialty) => (React__default["default"].createElement(StyledSpecialtyItem, { key: specialty.id, onClick: (evt) => {
673
+ evt.nativeEvent.stopImmediatePropagation();
674
+ if (onSpecialtyClick) {
675
+ onSpecialtyClick(Object.assign(Object.assign({}, specialty), { total_doctor: 0 }));
676
+ }
677
+ }, role: "button", tabIndex: 0, "aria-label": `Select ${specialty.name} as location`, isSelected: (selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.id) === specialty.id },
678
+ React__default["default"].createElement("div", { className: "image-item" },
679
+ React__default["default"].createElement("img", { src: specialty.thumbnail, alt: specialty.name })),
680
+ React__default["default"].createElement(index$1.Text, { size: "md" }, specialty.name))))))));
681
+ };
682
+
683
+ const SearchInputs = ({ state, type, isMobile, isLoading, initalSearchValue, typeInformation, debouncedFetchSearchResults, trackingAttributes, hideSpecialtySelection = false, clientSlug = '', focusSearchInput, onSearch, onEnterSearch, dispatch, }) => {
684
+ var _a;
685
+ const { t } = useTranslations.useTranslations();
686
+ const inputSearchWrapperRef = React.useRef(null);
687
+ const gaAttributes = React.useMemo(() => {
688
+ if (trackingAttributes) {
689
+ return {
690
+ 'data-event-category': trackingAttributes.dataEventCategory,
691
+ 'data-event-action': trackingAttributes.dataEventAction,
692
+ 'data-event-label': trackingAttributes.dataEventLabel,
693
+ };
694
+ }
695
+ else {
696
+ return {};
697
+ }
698
+ }, [trackingAttributes]);
699
+ const placeholderSearch = React.useMemo(() => {
700
+ if (type === 'doctor') {
701
+ return t('booking.searchBar.placeholder.doctor');
702
+ }
703
+ if (type === 'service') {
704
+ return t('booking.searchBar.placeholder.service');
705
+ }
706
+ if (type === 'hospital') {
707
+ return t('booking.searchBar.placeholder.hospital');
708
+ }
709
+ if (type === 'specialty') {
710
+ return t('booking.searchBar.placeholder.specialty');
711
+ }
712
+ return '';
713
+ }, [type]);
714
+ const styleInputWrapper = React.useMemo(() => {
715
+ return {
716
+ root: {
717
+ flex: 1,
718
+ '&.hide-specialty-selection': {
719
+ '.mantine-Input-rightSection': {
720
+ display: 'none',
721
+ },
722
+ input: {
723
+ paddingLeft: '48px',
724
+ },
725
+ '.mantine-Input-icon': {
726
+ left: '0',
727
+ },
728
+ },
729
+ },
730
+ };
731
+ }, []);
732
+ const styleInput = React.useMemo(() => {
733
+ return {
734
+ icon: {
735
+ left: '165px',
736
+ },
737
+ input: {
738
+ color: '#262626',
739
+ '&[data-with-icon="true"]': {
740
+ paddingLeft: '205px',
741
+ paddingRight: '16px',
742
+ },
743
+ },
744
+ rightSection: {
745
+ left: 0,
746
+ width: '165px',
747
+ padding: '1px',
748
+ },
749
+ };
750
+ }, []);
751
+ const styleInputSpecialties = React.useMemo(() => {
752
+ return {
753
+ input: {
754
+ color: '#262626',
755
+ },
756
+ };
757
+ }, []);
758
+ useOutsideClick.useOutsideClick(inputSearchWrapperRef, () => {
759
+ dispatch({ type: ActionTypes.ClickOutsideInputSearch });
760
+ });
761
+ const handleSearchInputChange = React.useCallback(function handleSearchInputChange(value) {
762
+ dispatch({ type: ActionTypes.ChangeInputSearch, payload: value });
763
+ if (typeof onSearch === 'function') {
764
+ return;
765
+ }
766
+ if (value.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale] ||
767
+ initalSearchValue ||
768
+ value.trim().length === 0) {
769
+ debouncedFetchSearchResults(value.trim(), state, type, clientSlug);
770
+ }
771
+ else {
772
+ debouncedFetchSearchResults.cancel();
773
+ dispatch({ type: ActionTypes.DisplayInitialSearchResults });
774
+ }
775
+ }, [dispatch, state, type]);
776
+ const handleSpecialtyClick = React.useCallback(function handleSpecialtyClick(specialty) {
777
+ dispatch({ type: ActionTypes.SelectSpecialty, payload: specialty });
778
+ focusSearchInput();
779
+ }, [dispatch]);
780
+ const inputOnKeyDown = React.useCallback((e) => {
781
+ if (e.keyCode === 13) {
782
+ e.stopPropagation();
783
+ e.preventDefault();
784
+ onEnterSearch && onEnterSearch();
785
+ }
786
+ }, [onEnterSearch]);
787
+ return (React__default["default"].createElement(StyleSearchInputsWrapper, { ref: inputSearchWrapperRef }, type === 'specialty' ? (React__default["default"].createElement(core.Input.Wrapper, { styles: styleInputWrapper },
788
+ React__default["default"].createElement(core.Input, { icon: React__default["default"].createElement(core$1.Search, null), size: isMobile ? 'md' : 'lg', placeholder: placeholderSearch, styles: styleInputSpecialties, value: state.searchKeywords, onFocus: () => dispatch({ type: ActionTypes.FocusInputSearchSpecialty }), onChange: (event) => {
789
+ handleSearchInputChange(event.target.value);
790
+ }, onKeyDown: inputOnKeyDown }))) : (React__default["default"].createElement(React__default["default"].Fragment, null,
791
+ type === 'service' ? (React__default["default"].createElement(core.Input.Wrapper, { styles: styleInputWrapper },
792
+ React__default["default"].createElement(core.Input, { icon: React__default["default"].createElement(core$1.Search, null), size: isMobile ? 'md' : 'lg', name: "search-results", placeholder: placeholderSearch, onFocus: () => dispatch({ type: ActionTypes.FocusInputSearch }), value: state.searchKeywords, onChange: (event) => {
793
+ handleSearchInputChange(event.target.value);
794
+ }, onKeyDown: inputOnKeyDown }))) : (React__default["default"].createElement(React__default["default"].Fragment, null, isMobile && !hideSpecialtySelection ? (React__default["default"].createElement(React__default["default"].Fragment, null,
795
+ React__default["default"].createElement(SearchSpecialty, { state: state, isMobile: isMobile, dispatch: dispatch, debouncedFetchSearchResults: debouncedFetchSearchResults, onSpecialtyClick: handleSpecialtyClick }),
796
+ React__default["default"].createElement(core.Input.Wrapper, { styles: styleInputWrapper },
797
+ React__default["default"].createElement(core.Input, { icon: React__default["default"].createElement(core$1.Search, null), size: "md", placeholder: placeholderSearch, value: state.searchKeywords, name: "search-results", onFocus: () => dispatch({ type: ActionTypes.FocusInputSearch }), onChange: (event) => {
798
+ handleSearchInputChange(event.target.value);
799
+ }, onKeyDown: inputOnKeyDown })))) : (React__default["default"].createElement(core.Input.Wrapper, { styles: styleInputWrapper, className: hideSpecialtySelection ? 'hide-specialty-selection' : '' },
800
+ React__default["default"].createElement(core.Input, Object.assign({ icon: React__default["default"].createElement(core$1.Search, null), size: "lg", placeholder: placeholderSearch, styles: styleInput, name: "search-results", autoComplete: "off", value: state.searchKeywords, onChange: (event) => {
801
+ handleSearchInputChange(event.target.value);
802
+ }, onFocus: () => dispatch({ type: ActionTypes.FocusInputSearch }), onKeyDown: inputOnKeyDown }, gaAttributes, { rightSection: hideSpecialtySelection ? (React__default["default"].createElement(React__default["default"].Fragment, null)) : (React__default["default"].createElement(SearchSpecialty, { state: state, isMobile: isMobile, dispatch: dispatch, debouncedFetchSearchResults: debouncedFetchSearchResults, onSpecialtyClick: handleSpecialtyClick })) })))))),
803
+ state.focused === 'search' && (React__default["default"].createElement(StyleResultWrapper$2, null,
804
+ React__default["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 })))))));
805
+ };
806
+
807
+ const StyleSearchLocationWrapper = styled__default["default"].div `
808
+ position: relative;
809
+
810
+ ${utils.MediaQueries.mbDown} {
811
+ width: 100%;
812
+ display: flex;
813
+ flex-direction: column;
814
+ gap: 12px;
815
+ }
816
+ `;
817
+ const StyleResultWrapper = styled__default["default"].div `
818
+ position: absolute;
819
+ top: calc(100% + 2px);
820
+ width: 100%;
821
+ border-radius: 4px;
822
+ background: ${miscTheme.theme.colors.white};
823
+ box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1);
824
+ z-index: 10;
825
+
826
+ ${utils.MediaQueries.mbDown} {
827
+ width: calc(100% + 64px);
828
+ left: -32px;
829
+ }
830
+ `;
831
+ const StyledLocationItem = styled__default["default"].li `
832
+ position: relative;
833
+ cursor: pointer;
834
+ padding: 12px 18px;
835
+ display: flex;
836
+ align-items: center;
837
+ gap: 14px;
838
+ overflow: hidden;
839
+
840
+ ${({ isSelected }) => isSelected &&
841
+ `
842
+ &::after {
843
+ content: ${utils$1.checkMarkIconUrl};
844
+ top: 50%;
845
+ right: 18px;
846
+ position: absolute;
847
+ transform: translateY(-50%);
848
+ }
849
+ `}
850
+
851
+ & + li::before {
852
+ content: '';
853
+ position: absolute;
854
+ left: 18px;
855
+ right: 18px;
856
+ top: 0;
857
+ height: 1px;
858
+ background-color: ${miscTheme.theme.colors.neutral100};
859
+ }
860
+
861
+ &:not([data-is-denied='true']):hover {
862
+ background-color: ${miscTheme.theme.colors.neutral50};
863
+ }
864
+
865
+ &:last-child:hover {
866
+ border-bottom-right-radius: 6px;
867
+ border-bottom-left-radius: 6px;
868
+ }
869
+
870
+ &:first-child:hover {
871
+ border-top-right-radius: 6px;
872
+ border-top-left-radius: 6px;
873
+ }
874
+
875
+ &[data-is-denied='true'] {
876
+ cursor: not-allowed;
877
+ }
878
+ `;
879
+ const StyledPinIcon = styled__default["default"](utils$1.PinIcon) `
880
+ width: 12px;
881
+ height: 18px;
882
+ flex: 0 0 12px;
883
+ `;
884
+
885
+ const SearchLocation = ({ state, isMobile, debouncedFetchCitiesByKeyword, selectedLocation, trackingAttributes, onLocationClick, dispatch, }) => {
886
+ const { t, locale } = useTranslations.useTranslations();
887
+ const inputLocationWrapperRef = React.useRef(null);
888
+ const gaAttributes = React.useMemo(() => {
889
+ if (trackingAttributes) {
890
+ return {
891
+ 'data-event-category': trackingAttributes.dataEventCategory,
892
+ 'data-event-action': trackingAttributes.dataEventAction,
893
+ 'data-event-label': trackingAttributes.dataEventLabel,
894
+ };
895
+ }
896
+ else {
897
+ return {};
898
+ }
899
+ }, [trackingAttributes]);
900
+ const handleSearchLocationInputChange = React.useCallback(function handleSearchLocationInputChange(value) {
901
+ dispatch({ type: ActionTypes.ChangeInputLocation, payload: value });
902
+ if (value.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale]) {
903
+ debouncedFetchCitiesByKeyword(value.trim());
904
+ }
905
+ else {
906
+ debouncedFetchCitiesByKeyword.cancel();
907
+ dispatch({ type: ActionTypes.DisplayInitialCities });
908
+ }
909
+ }, [debouncedFetchCitiesByKeyword, dispatch]);
910
+ useOutsideClick.useOutsideClick(inputLocationWrapperRef, () => {
911
+ dispatch({ type: ActionTypes.ClickOutsideInputLocation });
912
+ });
913
+ return (React__default["default"].createElement(StyleSearchLocationWrapper, { ref: inputLocationWrapperRef },
914
+ React__default["default"].createElement(core.Input.Wrapper, null,
915
+ React__default["default"].createElement(core.Input, Object.assign({ size: isMobile ? 'md' : 'lg', placeholder: "Search location", value: state.searchLocationKeywords, onFocus: () => dispatch({ type: ActionTypes.FocusInputLocation }), onChange: (event) => {
916
+ handleSearchLocationInputChange(event.target.value);
917
+ } }, gaAttributes))),
918
+ state.focused === 'location' && (React__default["default"].createElement(StyleResultWrapper, null,
919
+ React__default["default"].createElement(StyledLocationItem, { key: "all-location", role: "button", tabIndex: 0, onClick: () => {
920
+ var _a;
921
+ if (onLocationClick) {
922
+ onLocationClick({
923
+ name: t('booking.searchBar.allLocations'),
924
+ id: constants.ID_OPTION_ALL_LOCATION,
925
+ slug: (_a = constants.LOCALIZED_SLUGS[locale]) === null || _a === void 0 ? void 0 : _a.ALL,
926
+ });
927
+ }
928
+ } },
929
+ React__default["default"].createElement(StyledPinIcon, { color: miscTheme.theme.colors.neutral400 }),
930
+ React__default["default"].createElement(index$1.Text, { size: "md" }, t('booking.searchBar.allLocations'))),
931
+ state.cities.map((city) => (React__default["default"].createElement(StyledLocationItem, { key: city.id, onClick: (evt) => {
932
+ evt.nativeEvent.stopImmediatePropagation();
933
+ if (onLocationClick) {
934
+ onLocationClick(city);
935
+ }
936
+ }, role: "button", tabIndex: 0, "aria-label": `Select ${city.name} as location`, isSelected: (selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.id) === city.id },
937
+ React__default["default"].createElement(StyledPinIcon, { color: miscTheme.theme.colors.neutral400 }),
938
+ React__default["default"].createElement(index$1.Text, { size: "md" }, city.name))))))));
939
+ };
940
+
941
+ const StyleSpecialtiesWrapper = styled__default["default"].div `
942
+ display: flex;
943
+ flex-wrap: wrap;
944
+ row-gap: 8px;
945
+ column-gap: 20px;
946
+ ${utils.MediaQueries.mbDown} {
947
+ margin-top: 12px;
948
+ }
949
+ `;
950
+ const StyleSpecialtyItem = styled__default["default"].div `
951
+ display: flex;
952
+ align-items: center;
953
+ border-radius: 8px;
954
+ border: 1px solid ${miscTheme.theme.colors.neutral100};
955
+ background: ${miscTheme.theme.colors.white};
956
+ padding: 8px 12px 8px 8px;
957
+ flex: 0 0 calc(33.3% - 13px);
958
+ gap: 12px;
959
+ cursor: pointer;
960
+
961
+ &:hover {
962
+ background: ${miscTheme.theme.colors.blue50};
963
+ }
964
+
965
+ ${utils.MediaQueries.tdDown} {
966
+ flex: 0 0 calc(50% - 10px);
967
+ }
968
+
969
+ ${utils.MediaQueries.mbDown} {
970
+ flex: 0 0 100%;
971
+ border: none;
972
+ }
973
+
974
+ .image-item {
975
+ display: flex;
976
+ align-items: center;
977
+ width: 40px;
978
+ height: 40px;
979
+
980
+ img {
981
+ width: 100%;
982
+ object-fit: cover;
983
+ }
984
+ }
985
+
986
+ .infor {
987
+ flex: 1;
988
+ .title {
989
+ color: ${miscTheme.theme.colors.gray800};
990
+ font-size: 14px;
991
+ font-style: normal;
992
+ font-weight: 400;
993
+ line-height: 22px;
994
+ }
995
+
996
+ .description {
997
+ color: ${miscTheme.theme.colors.gray600};
998
+ font-size: 12px;
999
+ font-weight: 400;
1000
+ line-height: 18px;
1001
+ }
1002
+ }
1003
+ `;
1004
+ const StyleDivider = styled__default["default"](core.Divider) `
1005
+ margin: 24px 0 !important;
1006
+ `;
1007
+ const StyleShowMore = styled__default["default"].div `
1008
+ display: flex;
1009
+ justify-content: center;
1010
+ margin-top: 24px;
1011
+ .show-more {
1012
+ border-radius: 4px;
1013
+ border: 1px solid ${miscTheme.theme.colors.neutral200};
1014
+ padding: 12px 16px;
1015
+ cursor: pointer;
1016
+ display: inline-block;
1017
+ color: ${miscTheme.theme.colors.gray800};
1018
+ font-size: 16px;
1019
+ font-weight: 600;
1020
+ line-height: 24px;
1021
+
1022
+ ${utils.MediaQueries.mbDown} {
1023
+ width: 100%;
1024
+ text-align: center;
1025
+ }
1026
+ }
1027
+ `;
1028
+
1029
+ const SearchResultSpecialties = ({ state, isMobile, specialties, isLoading, dispatch, }) => {
1030
+ const { t, locale } = useTranslations.useTranslations();
1031
+ const { selectedLocation } = state;
1032
+ const slugs = React.useMemo(() => constants.LOCALIZED_SLUGS[locale], [locale]);
1033
+ const handleOnClick = (specialtySlug) => {
1034
+ let url = '';
1035
+ if (specialtySlug === constants.SLUG_VACIN_ID) {
1036
+ url = `/${selectedLocation.slug}/${slugs.HOSPITAL}/${constants.CLIENT_KEY.GSK}/`;
1037
+ dispatch({ type: ActionTypes.ClickOutsideInputSearchSpecialty });
1038
+ }
1039
+ else {
1040
+ url = `/${selectedLocation.slug}/${slugs.DOCTOR}/${specialtySlug}`;
1041
+ }
1042
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1043
+ };
1044
+ const handleShowMore = () => {
1045
+ const url = `/${slugs.SPECIALTIES}`;
1046
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1047
+ };
1048
+ const showSeeMore = React.useMemo(() => {
1049
+ return (specialties.length >= 9 ||
1050
+ state.searchKeywords.trim().length <=
1051
+ SEARCH_KEYWORD_MIN_LENGTH[state.locale]);
1052
+ }, [state.searchKeywords, specialties]);
1053
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
1054
+ !isMobile && React__default["default"].createElement(StyleDivider, { color: "#E4E8EC" }),
1055
+ React__default["default"].createElement(StyleSpecialtiesWrapper, null,
1056
+ specialties.length > 0 && !isLoading && (React__default["default"].createElement(React__default["default"].Fragment, null, specialties.map((specialty, index) => {
1057
+ if (index >= 9) {
1058
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
1059
+ }
1060
+ return (React__default["default"].createElement(StyleSpecialtyItem, { key: specialty.id, onClick: () => handleOnClick(specialty.slug) },
1061
+ React__default["default"].createElement("div", { className: "image-item" },
1062
+ React__default["default"].createElement("img", { src: specialty.thumbnail, alt: specialty.name })),
1063
+ React__default["default"].createElement("div", { className: "infor" },
1064
+ React__default["default"].createElement("div", { className: "title" }, specialty.name))));
1065
+ }))),
1066
+ specialties.length === 0 && !isLoading && (React__default["default"].createElement(index$1.Text, { size: "sm", color: miscTheme.theme.colors.gray400 }, t('booking.searchBar.noResults'))),
1067
+ isLoading &&
1068
+ Array(6)
1069
+ .fill(undefined)
1070
+ .map((_, i) => (React__default["default"].createElement(StyleSpecialtyItem, { key: 'loading' + i },
1071
+ React__default["default"].createElement("div", { className: "image-item" },
1072
+ React__default["default"].createElement(core.Skeleton, { height: 40, animate: true })),
1073
+ React__default["default"].createElement("div", { className: "infor" },
1074
+ React__default["default"].createElement("div", { className: "title" },
1075
+ React__default["default"].createElement(core.Skeleton, { height: 20, radius: "sm", animate: true }))))))),
1076
+ showSeeMore && (React__default["default"].createElement(StyleShowMore, null,
1077
+ React__default["default"].createElement("div", { className: "show-more", onClick: handleShowMore }, t('home.seeAll'))))));
1078
+ };
1079
+
1080
+ const StyleSearchTagWrapper = styled__default["default"].div `
1081
+ display: flex;
1082
+ gap: 5px;
1083
+ margin-top: 16px;
1084
+ flex-wrap: wrap;
1085
+ `;
1086
+ const StyleTagItem = styled__default["default"].div `
1087
+ color: ${miscTheme.theme.colors.gray600};
1088
+ font-size: 14px;
1089
+ font-weight: 600;
1090
+ line-height: 22px;
1091
+ padding: 4px 12px;
1092
+ background: ${miscTheme.theme.colors.white};
1093
+ border-radius: 32px;
1094
+ cursor: pointer;
1095
+ border: 1px solid ${miscTheme.theme.colors.white};
1096
+ margin-bottom: 5px;
1097
+ border-color: ${miscTheme.theme.colors.neutral100};
1098
+ background: #f7f9fc;
1099
+
1100
+ &.view-all {
1101
+ border-radius: 32px;
1102
+ border-color: ${miscTheme.theme.colors.blue50};
1103
+ background: ${miscTheme.theme.colors.blue50};
1104
+ color: ${miscTheme.theme.colors.blue600};
1105
+
1106
+ &:hover {
1107
+ border-color: ${miscTheme.theme.colors.blue50};
1108
+ background: ${miscTheme.theme.colors.blue50};
1109
+ color: ${miscTheme.theme.colors.blue600};
1110
+ }
1111
+ }
1112
+
1113
+ &:hover {
1114
+ border-color: ${miscTheme.theme.colors.neutral100};
1115
+ background: #f7f9fc;
1116
+ }
1117
+ `;
1118
+ const StyleTagLabel = styled__default["default"].div `
1119
+ color: ${miscTheme.theme.colors.gray600};
1120
+ font-size: 14px;
1121
+ font-weight: 600;
1122
+ line-height: 22px;
1123
+ padding: 4px 0;
1124
+ background: ${miscTheme.theme.colors.white};
1125
+ border-radius: 32px;
1126
+ border: 1px solid ${miscTheme.theme.colors.white};
1127
+ margin-bottom: 5px;
1128
+ margin-right: 7px;
1129
+ `;
1130
+
1131
+ const SearchTag = ({ state, type, typeInformation, dispatch }) => {
1132
+ const { t } = useTranslations.useTranslations();
1133
+ const { selectedLocation } = state;
1134
+ const typeSlug = React.useMemo(() => typeInformation[type].slug, [typeInformation, type]);
1135
+ const handleViewAll = () => {
1136
+ const url = `/${selectedLocation.slug}/${typeSlug}`;
1137
+ if (url) {
1138
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1139
+ }
1140
+ };
1141
+ const handleClickKeyword = (keyword) => {
1142
+ if (keyword.url) {
1143
+ window.location.href = keyword.url;
1144
+ }
1145
+ };
1146
+ return (React__default["default"].createElement(StyleSearchTagWrapper, null,
1147
+ React__default["default"].createElement(StyleTagLabel, null, t('booking.searchBar.popularKey')),
1148
+ state.popularKeys.map((item) => {
1149
+ return (React__default["default"].createElement(StyleTagItem, { key: item.id, onClick: () => handleClickKeyword(item) }, item.keyword));
1150
+ }),
1151
+ React__default["default"].createElement(StyleTagItem, { className: "view-all", onClick: handleViewAll }, t('booking.searchBar.viewAll'))));
1152
+ };
1153
+
1154
+ const StyledTabWrapper = styled__default["default"].div `
1155
+ background: rgba(255, 255, 255, 0.64);
1156
+ backdrop-filter: blur(12px);
1157
+ border-bottom: 1px solid ${miscTheme.theme.colors.neutral100};
1158
+ `;
1159
+ const StyleTabContainer = styled__default["default"](index.Container) `
1160
+ padding: 0 16px;
1161
+ `;
1162
+
1163
+ const itemTabs = () => {
1164
+ const { t } = useTranslations.useTranslations();
1165
+ return [
1166
+ {
1167
+ value: 'hospital',
1168
+ label: t('booking.searchPopup.hospitals'),
1169
+ },
1170
+ {
1171
+ value: 'doctor',
1172
+ label: t('booking.searchPopup.doctors'),
1173
+ },
1174
+ {
1175
+ value: 'service',
1176
+ label: t('booking.searchPopup.services'),
1177
+ },
1178
+ {
1179
+ value: 'specialty',
1180
+ label: t('booking.searchPopup.specialties'),
1181
+ },
1182
+ ];
1183
+ };
1184
+ const TabSearch = ({ currentTab, hideTabBookingSearch = [], isMobile, setCurrentTab, }) => {
1185
+ const stylesTabs = React.useMemo(() => {
1186
+ return {
1187
+ root: {
1188
+ overflowY: isMobile ? 'hidden' : 'initial',
1189
+ overflowX: isMobile ? 'auto' : 'initial',
1190
+ },
1191
+ tabsList: {
1192
+ background: 'rgba(255, 255, 255, 0)',
1193
+ borderBottom: 'none',
1194
+ flexWrap: 'nowrap',
1195
+ '.mantine-Tabs-tab': {
1196
+ '&:last-child': {
1197
+ '&:after': {
1198
+ display: 'none',
1199
+ },
1200
+ },
1201
+ },
1202
+ },
1203
+ tab: {
1204
+ padding: isMobile ? '12px 16px 12px 16px' : '15px 40px 15px 40px',
1205
+ borderTop: '2px solid transparent',
1206
+ borderBottom: 'none',
1207
+ margin: 0,
1208
+ borderRadius: 0,
1209
+ position: 'relative',
1210
+ width: 'auto',
1211
+ '&[data-active="true"]': {
1212
+ borderColor: '#2d87f3',
1213
+ backgroundColor: '#ffffff',
1214
+ '&:after': {
1215
+ display: 'none',
1216
+ },
1217
+ '&:before': {
1218
+ content: '""',
1219
+ width: '100%',
1220
+ height: '1px',
1221
+ position: 'absolute',
1222
+ backgroundColor: '#ffffff',
1223
+ bottom: '-1px',
1224
+ },
1225
+ },
1226
+ '&:hover': {
1227
+ borderColor: '#2d87f3',
1228
+ backgroundColor: '#ffffff',
1229
+ '&:before': {
1230
+ content: '""',
1231
+ width: '100%',
1232
+ height: '1px',
1233
+ position: 'absolute',
1234
+ backgroundColor: '#ffffff',
1235
+ bottom: '-1px',
1236
+ },
1237
+ },
1238
+ '&:after': {
1239
+ content: '""',
1240
+ width: '1px',
1241
+ height: '24px',
1242
+ backgroundColor: '#E4E8EC',
1243
+ position: 'absolute',
1244
+ right: '-1px',
1245
+ },
1246
+ },
1247
+ tabLabel: {
1248
+ color: '#595959',
1249
+ fontSize: isMobile ? '14px' : '16px',
1250
+ fontWeight: 600,
1251
+ lineHeight: isMobile ? '22px' : '24px',
1252
+ },
1253
+ };
1254
+ }, [isMobile]);
1255
+ const tabConfig = itemTabs();
1256
+ const activeTabs = React.useMemo(() => {
1257
+ return (tabConfig.filter((item) => !hideTabBookingSearch.includes(item.value)) ||
1258
+ []);
1259
+ }, [hideTabBookingSearch, tabConfig]);
1260
+ return (React__default["default"].createElement(StyledTabWrapper, { className: "booking-search-tab" },
1261
+ React__default["default"].createElement(StyleTabContainer, null,
1262
+ React__default["default"].createElement(core.Tabs, { value: currentTab, onTabChange: (tab) => {
1263
+ setCurrentTab(tab);
1264
+ }, styles: stylesTabs },
1265
+ React__default["default"].createElement(core.Tabs.List, null, activeTabs.map((tab) => {
1266
+ return (React__default["default"].createElement(core.Tabs.Tab, { value: tab.value, key: tab.value }, tab.label));
1267
+ }))))));
1268
+ };
1269
+
1270
+ var TypePopularKeySearch;
1271
+ (function (TypePopularKeySearch) {
1272
+ TypePopularKeySearch["doctor"] = "doctor";
1273
+ TypePopularKeySearch["service"] = "hospital_service";
1274
+ TypePopularKeySearch["hospital"] = "hospital_branch";
1275
+ })(TypePopularKeySearch || (TypePopularKeySearch = {}));
1276
+
1277
+ function useSearchBarApi({ dispatch, careApiDomain, locale = 'vi-VN', client = '', }) {
1278
+ const fetchCitiesApi = React.useCallback(function fetchCitiesApi(path, params = {}) {
1279
+ const url = `${careApiDomain}${path}`;
1280
+ dispatch({ type: ActionTypes.FetchCitiesStart });
1281
+ return fetch(utils$1.getApiPath(url, params, locale), { method: 'GET' })
1282
+ .then((res) => res.json())
1283
+ .then((data) => {
1284
+ if (data._status !== 1 || !data._data) {
1285
+ console.log('error loading cities', data);
1286
+ return Promise.reject(data);
1287
+ }
1288
+ return data === null || data === void 0 ? void 0 : data._data;
1289
+ })
1290
+ .finally(() => dispatch({ type: ActionTypes.FetchCitiesFinish }));
1291
+ }, [locale]);
1292
+ const fetchCitiesByLocation = React.useCallback(function fetchCitiesByLocation({ coordinates }) {
1293
+ let params = {};
1294
+ const moreParams = {};
1295
+ if (coordinates) {
1296
+ params = {
1297
+ lat: coordinates.lat,
1298
+ lng: coordinates.lng,
1299
+ };
1300
+ }
1301
+ if (locale === 'ms-MY') {
1302
+ moreParams.noPaging = 1;
1303
+ }
1304
+ const requests = [
1305
+ fetchCitiesApi(paths.PATHS.GET_CITY_BY_IP, Object.assign(Object.assign(Object.assign({}, params), moreParams), { client: constants.CLIENT_KEY.MSD === client ? '' : client })),
1306
+ ];
1307
+ if (locale === 'zh-TW') {
1308
+ requests.push(fetchCitiesApi(paths.PATHS.GET_CITIES_LIST, {
1309
+ noPaging: 1,
1310
+ client: constants.CLIENT_KEY.MSD === client ? '' : client,
1311
+ }));
1312
+ }
1313
+ return Promise.all(requests)
1314
+ .then(([data1, data2]) => {
1315
+ const data = Object.assign({}, data1);
1316
+ if (data2) {
1317
+ const citiesIds = data.cities.map((c) => c.id);
1318
+ data.cities = data.cities.concat(data2.cities.filter((c) => !citiesIds.includes(c.id)));
1319
+ }
1320
+ dispatch({
1321
+ type: ActionTypes.FetchCitiesByGeoIpComplete,
1322
+ payload: data,
1323
+ });
1324
+ })
1325
+ .catch((err) => console.error('error loading cities by location', err));
1326
+ }, [locale, careApiDomain, dispatch]);
1327
+ const fetchCitiesByKeyword = React.useCallback(function fetchCitiesByKeyword(keyword) {
1328
+ return fetchCitiesApi(paths.PATHS.GET_CITIES_LIST, {
1329
+ keyword,
1330
+ client,
1331
+ })
1332
+ .then((data) => {
1333
+ dispatch({
1334
+ type: ActionTypes.FetchCitiesByKeywordComplete,
1335
+ payload: data.cities,
1336
+ });
1337
+ })
1338
+ .catch((err) => console.error('error loading cities by keyword', err));
1339
+ }, [locale, careApiDomain, dispatch]);
1340
+ const fetchSearchResults = React.useCallback(function fetchSearchResults(searchKeywords, state, searchType, clientSlug, cacheResult) {
1341
+ const url = searchType === 'specialty'
1342
+ ? `${careApiDomain}${paths.PATHS.GET_SEARCH_SPECIALTY}`
1343
+ : `${careApiDomain}${paths.PATHS.GET_SEARCH_V2}`;
1344
+ dispatch({ type: ActionTypes.FetchSearchResultsStart });
1345
+ const { selectedLocation, geoLocationCoordinates, selectedSpecialty } = state;
1346
+ let cityId = '';
1347
+ if (!selectedLocation) {
1348
+ dispatch({ type: ActionTypes.FetchSearchResultsFinish });
1349
+ return;
1350
+ }
1351
+ if (selectedLocation.id === constants.ID_OPTION_ALL_LOCATION) {
1352
+ cityId = '';
1353
+ }
1354
+ else {
1355
+ cityId = selectedLocation.id;
1356
+ }
1357
+ const lat = (geoLocationCoordinates === null || geoLocationCoordinates === void 0 ? void 0 : geoLocationCoordinates.lat) || '';
1358
+ const lng = (geoLocationCoordinates === null || geoLocationCoordinates === void 0 ? void 0 : geoLocationCoordinates.lng) || '';
1359
+ const specialty_id = (selectedSpecialty === null || selectedSpecialty === void 0 ? void 0 : selectedSpecialty.id) > 0 ? selectedSpecialty === null || selectedSpecialty === void 0 ? void 0 : selectedSpecialty.id : '';
1360
+ const keyword = searchKeywords.trim().length > SEARCH_KEYWORD_MIN_LENGTH[locale]
1361
+ ? searchKeywords.trim()
1362
+ : '';
1363
+ return fetch(utils$1.getApiPath(url, {
1364
+ domain: careApiDomain,
1365
+ searchType: searchType || 'global',
1366
+ keyword: keyword,
1367
+ city: cityId === constants.ID_OPTION_CURRENT_LOCATION ? '' : cityId,
1368
+ lat,
1369
+ lng,
1370
+ specialty_id,
1371
+ client_slug: constants.CLIENT_KEY.MSD === clientSlug ? '' : clientSlug,
1372
+ msd: constants.CLIENT_KEY.MSD === client ? 1 : '',
1373
+ }, locale), {
1374
+ method: 'GET',
1375
+ headers: {
1376
+ accept: 'version=2.0.0.0',
1377
+ },
1378
+ })
1379
+ .then((res) => res.json())
1380
+ .then((data) => {
1381
+ if (data._status !== 1 || !data._data) {
1382
+ return Promise.reject(data);
1383
+ }
1384
+ return data === null || data === void 0 ? void 0 : data._data;
1385
+ })
1386
+ .then((results) => {
1387
+ let searchesResult = [];
1388
+ if (searchType !== 'specialty') {
1389
+ searchesResult = results.searches;
1390
+ }
1391
+ if (searchType === 'specialty') {
1392
+ if (keyword) {
1393
+ searchesResult = results.specialties;
1394
+ }
1395
+ else {
1396
+ searchesResult = results.default;
1397
+ }
1398
+ }
1399
+ dispatch({
1400
+ type: ActionTypes.FetchSearchResultsComplete,
1401
+ payload: {
1402
+ key: searchType,
1403
+ searches: searchesResult || [],
1404
+ },
1405
+ });
1406
+ if (cacheResult) {
1407
+ dispatch({
1408
+ type: ActionTypes.UpdateInitialSearchResults,
1409
+ payload: {
1410
+ key: searchType,
1411
+ searches: searchesResult || [],
1412
+ },
1413
+ });
1414
+ }
1415
+ })
1416
+ .catch((error) => {
1417
+ console.log('error loading search results', { url, error });
1418
+ })
1419
+ .finally(() => dispatch({ type: ActionTypes.FetchSearchResultsFinish }));
1420
+ }, [locale, careApiDomain, dispatch]);
1421
+ const fetchAllSpecialties = React.useCallback(function fetchSearchSpecialties() {
1422
+ const url = `${careApiDomain}${paths.PATHS.GET_SEARCH_SPECIALTY}`;
1423
+ return fetch(utils$1.getApiPath(url, {
1424
+ domain: careApiDomain,
1425
+ searchType: '',
1426
+ msd: constants.CLIENT_KEY.MSD === client ? 1 : '',
1427
+ }, locale), {
1428
+ method: 'GET',
1429
+ headers: {
1430
+ accept: 'version=2.0.0.0',
1431
+ },
1432
+ })
1433
+ .then((res) => res.json())
1434
+ .then((data) => {
1435
+ if (data._status !== 1 || !data._data) {
1436
+ return Promise.reject(data);
1437
+ }
1438
+ return data === null || data === void 0 ? void 0 : data._data;
1439
+ })
1440
+ .then((results) => {
1441
+ dispatch({
1442
+ type: ActionTypes.FetchAllSpecialties,
1443
+ payload: results.specialties || [],
1444
+ });
1445
+ })
1446
+ .catch((error) => {
1447
+ console.log('error loading search results', { url, error });
1448
+ });
1449
+ }, [locale, careApiDomain, dispatch]);
1450
+ const fetchPopularKeys = React.useCallback(function fetchPopularKeys(searchType) {
1451
+ const url = `${careApiDomain}${paths.PATHS.GET_SEARCH_POPULAR_KEY}`;
1452
+ return fetch(utils$1.getApiPath(url, {
1453
+ domain: careApiDomain,
1454
+ searchType: TypePopularKeySearch[searchType],
1455
+ sort_by: 'display_order',
1456
+ sort_order: 'asc',
1457
+ }, locale))
1458
+ .then((res) => res.json())
1459
+ .then((data) => {
1460
+ if (data._status !== 1 || !data._data) {
1461
+ return Promise.reject(data);
1462
+ }
1463
+ return data === null || data === void 0 ? void 0 : data._data;
1464
+ })
1465
+ .then((results) => {
1466
+ dispatch({
1467
+ type: ActionTypes.FetchPopularKeys,
1468
+ payload: results.popular_searches || [],
1469
+ });
1470
+ })
1471
+ .catch((error) => {
1472
+ console.log('error loading search results', { url, error });
1473
+ });
1474
+ }, [locale, careApiDomain, dispatch]);
1475
+ return {
1476
+ fetchCitiesByLocation,
1477
+ fetchCitiesByKeyword,
1478
+ fetchSearchResults,
1479
+ fetchAllSpecialties,
1480
+ fetchPopularKeys,
1481
+ };
1482
+ }
1483
+
1484
+ const BookingSearchBarV2 = ({ isMobile, careApiDomain, geoLocationPermission: geoLocationPermissionFromProps, geoLocationCoordinates: geoLocationCoordinatesFromProps, initialSelectedCity: initialSelectedCityFromProps, initialSearchValue = '', initTypeSearch = 'hospital', initSpecialty, careFrontDomain = '/care', isDebug = false,
1485
+ // askForGeolocationPermission = false,
1486
+ gaTrackingSearchBar, gaTrackingLocationSearch, autoCompleteDisabled = false, inputSearchPlaceholder = '', hideTabBookingSearch = [], hideSpecialtySelection = false, hidePopularSearchKeys = false, clientSlug = '',
1487
+ // isOptionAllLocation = false,
1488
+ // hideResults = [],
1489
+ // isNavResultItem = true,
1490
+ routerPush, onGeoLocationPermissionChange,
1491
+ // onSearch,
1492
+ onChangeLocation, }) => {
1493
+ const { locale, t } = useTranslations.useTranslations();
1494
+ const wrapperRef = React.useRef(null);
1495
+ const inputSearchSpecialtyWrapperRef = React.useRef(null);
1496
+ const [currentTab, setCurrentTab] = React.useState(initTypeSearch);
1497
+ const { geoLocationPermission: geoLocationPermissionFromHook, geoLocationCoordinates: geoLocationCoordinatesFromHook, } = utils$1.useGeolocation();
1498
+ const [state, dispatch] = React.useReducer(reducer, initialState, (s) => (Object.assign(Object.assign({}, s), { isDebug,
1499
+ isMobile, geoLocationPermission: geoLocationPermissionFromProps ||
1500
+ geoLocationPermissionFromHook ||
1501
+ 'unset', geoLocationCoordinates: geoLocationCoordinatesFromProps ||
1502
+ geoLocationCoordinatesFromHook ||
1503
+ null, searchKeywords: initialSearchValue, initialSelectedCity: initialSelectedCityFromProps || null, selectedLocation: initialSelectedCityFromProps || s.selectedLocation || null, searchLocationKeywords: (initialSelectedCityFromProps === null || initialSelectedCityFromProps === void 0 ? void 0 : initialSelectedCityFromProps.name) || s.searchLocationKeywords, autoCompleteDisabled,
1504
+ inputSearchPlaceholder,
1505
+ locale })));
1506
+ const { navigateTo, focusedSpecialty,
1507
+ // isLoadingCities,
1508
+ // cities,
1509
+ searchKeywords, geoLocationPermission, selectedLocation, selectedSpecialty, initialSelectedCity,
1510
+ // defaultCity,
1511
+ searchResults, isLoadingSearchResults,
1512
+ // isMobileModalOpened,
1513
+ // inputSearchPlaceholder,
1514
+ // allSpecialties,
1515
+ } = state;
1516
+ const { fetchCitiesByLocation, fetchCitiesByKeyword, fetchSearchResults, fetchAllSpecialties, fetchPopularKeys, } = useSearchBarApi({
1517
+ dispatch,
1518
+ locale,
1519
+ careApiDomain,
1520
+ client: clientSlug,
1521
+ });
1522
+ const slugs = React.useMemo(() => constants.LOCALIZED_SLUGS[locale], [locale]);
1523
+ const typeInformation = React.useMemo(() => {
1524
+ return {
1525
+ doctor: {
1526
+ name: t('booking.searchPopup.doctors'),
1527
+ icon: React__default["default"].createElement(DoctorIcon, null),
1528
+ slug: slugs.DOCTOR,
1529
+ },
1530
+ service: {
1531
+ name: t('booking.searchPopup.services'),
1532
+ icon: React__default["default"].createElement(ServiceIcon, null),
1533
+ slug: slugs.SERVICE,
1534
+ },
1535
+ hospital: {
1536
+ name: t('booking.searchPopup.hospitals'),
1537
+ icon: React__default["default"].createElement(HospitalIcon, null),
1538
+ slug: slugs.HOSPITAL,
1539
+ },
1540
+ specialty: {
1541
+ name: t('booking.searchPopup.specialties'),
1542
+ icon: React__default["default"].createElement(SpecialtyIcon, null),
1543
+ slug: slugs.SPECIALTIES,
1544
+ },
1545
+ };
1546
+ }, [currentTab]);
1547
+ const debouncedFetchCitiesByKeyword = React.useMemo(() => debounce__default["default"](fetchCitiesByKeyword, 400), [fetchCitiesByKeyword]);
1548
+ const debouncedFetchSearchResults = React.useMemo(() => debounce__default["default"](fetchSearchResults, 400), [fetchSearchResults]);
1549
+ const handleLocationClick = React.useCallback(function handleLocationClick(city) {
1550
+ dispatch({ type: ActionTypes.SelectLocation, payload: city });
1551
+ focusSearchInput();
1552
+ if (onChangeLocation) {
1553
+ onChangeLocation(city);
1554
+ }
1555
+ }, [t, dispatch]);
1556
+ function focusSearchInput() {
1557
+ var _a;
1558
+ if (wrapperRef.current) {
1559
+ (_a = wrapperRef.current
1560
+ .querySelector('input[name="search-results"]')) === null || _a === void 0 ? void 0 : _a.focus();
1561
+ }
1562
+ }
1563
+ function onClickSearchByKeyword() {
1564
+ let url = '';
1565
+ const { slug: typeSlug } = typeInformation[currentTab];
1566
+ let moreParams = '';
1567
+ const slugClientUrl = constants.MAPPING_CLIENT_WITH_SLUG[locale][clientSlug];
1568
+ if ((currentTab === 'doctor' || currentTab === 'hospital') &&
1569
+ state.selectedSpecialty.id > 0) {
1570
+ moreParams = `&specialtyId=${state.selectedSpecialty.id}`;
1571
+ }
1572
+ if (currentTab === 'specialty') {
1573
+ url = `/${typeSlug}`;
1574
+ }
1575
+ else {
1576
+ url = `/${selectedLocation.slug}/${typeSlug}`;
1577
+ }
1578
+ if (slugClientUrl) {
1579
+ url += `/${slugClientUrl}`;
1580
+ }
1581
+ url += `?q=${searchKeywords}${moreParams}`;
1582
+ if (url) {
1583
+ dispatch({ type: ActionTypes.NavigateTo, payload: url });
1584
+ }
1585
+ }
1586
+ useOutsideClick.useOutsideClick(inputSearchSpecialtyWrapperRef, () => {
1587
+ dispatch({ type: ActionTypes.ClickOutsideInputSearchSpecialty });
1588
+ });
1589
+ React.useEffect(() => {
1590
+ var _a;
1591
+ if (geoLocationPermission !== 'denied' && !initialSelectedCity) {
1592
+ dispatch({
1593
+ type: ActionTypes.SelectLocation,
1594
+ payload: {
1595
+ name: t('booking.searchBar.allLocations'),
1596
+ id: constants.ID_OPTION_ALL_LOCATION,
1597
+ slug: (_a = constants.LOCALIZED_SLUGS[locale]) === null || _a === void 0 ? void 0 : _a.ALL,
1598
+ },
1599
+ });
1600
+ }
1601
+ if (onGeoLocationPermissionChange) {
1602
+ onGeoLocationPermissionChange(geoLocationPermission, state.geoLocationCoordinates);
1603
+ }
1604
+ if (isMobile && geoLocationPermission === 'granted' && selectedLocation) {
1605
+ dispatch({ type: ActionTypes.FocusInputSearch });
1606
+ }
1607
+ fetchCitiesByLocation({ coordinates: state.geoLocationCoordinates });
1608
+ }, [geoLocationPermission]);
1609
+ React.useEffect(() => {
1610
+ const defaultSpecialty = initSpecialty
1611
+ ? initSpecialty
1612
+ : {
1613
+ name: t('booking.searchBar.allSpecialties'),
1614
+ id: -1,
1615
+ thumbnail: '',
1616
+ total_doctor: 0,
1617
+ slug: slugs.SPECIALTIES,
1618
+ };
1619
+ if (!state.selectedSpecialty) {
1620
+ dispatch({
1621
+ type: ActionTypes.SelectSpecialty,
1622
+ payload: defaultSpecialty,
1623
+ });
1624
+ }
1625
+ }, [initSpecialty, state.selectedSpecialty]);
1626
+ React.useEffect(() => {
1627
+ fetchAllSpecialties();
1628
+ }, []);
1629
+ React.useEffect(() => {
1630
+ fetchPopularKeys(currentTab);
1631
+ }, [currentTab]);
1632
+ React.useEffect(() => {
1633
+ if (navigateTo) {
1634
+ if (routerPush) {
1635
+ routerPush(navigateTo);
1636
+ }
1637
+ else {
1638
+ window.location.href = `${careFrontDomain}${navigateTo}`;
1639
+ }
1640
+ }
1641
+ }, [navigateTo]);
1642
+ React.useEffect(() => {
1643
+ fetchSearchResults(state.searchKeywords, state, currentTab, clientSlug, true);
1644
+ }, [selectedLocation, selectedSpecialty, currentTab]);
1645
+ return (React__default["default"].createElement(StyledSearchBarWrapper, { ref: wrapperRef },
1646
+ React__default["default"].createElement(TabSearch, { currentTab: currentTab, setCurrentTab: setCurrentTab, isMobile: isMobile, hideTabBookingSearch: hideTabBookingSearch }),
1647
+ React__default["default"].createElement(StyleWrapperContainer, { className: "booking-search-container" },
1648
+ React__default["default"].createElement(StyleSearchInputContainer, null,
1649
+ React__default["default"].createElement(StyleSearchContent, { className: "booking-search-content" },
1650
+ React__default["default"].createElement("div", { ref: inputSearchSpecialtyWrapperRef },
1651
+ React__default["default"].createElement(core.Flex, { gap: "12px", justify: "space-between", align: "center", direction: isMobile ? 'column' : 'row', className: "flex-search-input" },
1652
+ currentTab !== 'specialty' && (React__default["default"].createElement(SearchLocation, { state: state, isMobile: isMobile, dispatch: dispatch, debouncedFetchCitiesByKeyword: debouncedFetchCitiesByKeyword, selectedLocation: selectedLocation, onLocationClick: handleLocationClick, trackingAttributes: gaTrackingLocationSearch })),
1653
+ React__default["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 }),
1654
+ React__default["default"].createElement(core.Button, { size: isMobile ? 'md' : 'lg', color: "#2D87F3", fullWidth: isMobile, variant: "filled", onClick: onClickSearchByKeyword, styles: {
1655
+ root: {
1656
+ height: isMobile ? '40px' : '48px',
1657
+ },
1658
+ } }, t('booking.searchBar.searchButton'))),
1659
+ !hidePopularSearchKeys &&
1660
+ currentTab !== 'specialty' &&
1661
+ state.popularKeys.length > 0 && (React__default["default"].createElement(SearchTag, { type: currentTab, state: state, typeInformation: typeInformation, dispatch: dispatch })),
1662
+ currentTab === 'specialty' && focusedSpecialty === 'search' && (React__default["default"].createElement(SearchResultSpecialties, { state: state, isMobile: isMobile, dispatch: dispatch, specialties: (searchResults === null || searchResults === void 0 ? void 0 : searchResults.specialty) || [], isLoading: isLoadingSearchResults }))))))));
1663
+ };
1664
+
1665
+ exports.BookingSearchBarV2 = BookingSearchBarV2;