@hhgtech/hhg-components 1.29.81 → 1.29.83

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 (422) hide show
  1. package/build/LastPeriod-79a8acbe.js +29 -0
  2. package/build/Locale-0b86b849.js +15 -0
  3. package/build/{WhatsApp-82018096.js → WhatsApp-19ca0437.js} +1 -1
  4. package/build/adapters.js +22 -17
  5. package/build/atoms.js +59 -51
  6. package/build/babyGrowth.js +169 -162
  7. package/build/cache.js +3 -3
  8. package/build/care.js +22 -17
  9. package/build/components.js +146 -117
  10. package/build/{constants-3a475a22.js → constants-79d3ff1b.js} +4 -4
  11. package/build/constants-e85d7085.js +18 -0
  12. package/build/constants.js +17 -13
  13. package/build/constantsDomainLocales.js +34 -0
  14. package/build/{isProduction-aa963bf9.js → constantsIsProduction.js} +2 -0
  15. package/build/constantsRiskScreener.js +21 -0
  16. package/build/constantsSite.js +134 -0
  17. package/build/{core-9e44ee99.js → core-9f7c0442.js} +4 -4
  18. package/build/dataTransform-1e0514ef.js +13 -0
  19. package/build/{dataTransform-6b4d7a4e.js → dataTransform-265f1b67.js} +1 -106
  20. package/build/ecom.js +10 -6
  21. package/build/embeddedHeathToolCards_babyGrowth.js +64 -0
  22. package/build/embeddedHeathToolCards_babyPoop.js +57 -0
  23. package/build/embeddedHeathToolCards_babyVaccine.js +64 -0
  24. package/build/embeddedHeathToolCards_bmi_bmi.js +70 -0
  25. package/build/embeddedHeathToolCards_bmrBmr.js +70 -0
  26. package/build/embeddedHeathToolCards_dueDate_dueDate.js +65 -0
  27. package/build/embeddedHeathToolCards_helpers.js +11 -0
  28. package/build/embeddedHeathToolCards_ovulation_ovulation.js +64 -0
  29. package/build/embeddedHeathToolCards_pwg_pwg.js +70 -0
  30. package/build/embeddedHeathToolCards_targetHeartRate.js +73 -0
  31. package/build/esm/LastPeriod-62287ef2.js +23 -0
  32. package/build/esm/Locale-c6a90240.js +15 -0
  33. package/build/esm/{WhatsApp-7d3732e2.js → WhatsApp-2e6d1d02.js} +1 -1
  34. package/build/esm/adapters.js +22 -17
  35. package/build/esm/atoms.js +53 -45
  36. package/build/esm/babyGrowth.js +87 -81
  37. package/build/esm/cache.js +3 -3
  38. package/build/esm/care.js +22 -17
  39. package/build/esm/components.js +106 -77
  40. package/build/esm/constants-a5d70cf5.js +16 -0
  41. package/build/esm/{constants-ebf80e5f.js → constants-e930bc7b.js} +2 -2
  42. package/build/esm/constants.js +7 -3
  43. package/build/esm/constantsDomainLocales.js +29 -0
  44. package/build/esm/{isProduction-5684a28c.js → constantsIsProduction.js} +1 -1
  45. package/build/esm/constantsRiskScreener.js +17 -0
  46. package/build/esm/constantsSite.js +129 -0
  47. package/build/esm/{core-c72e0ff5.js → core-36290fcb.js} +2 -2
  48. package/build/esm/dataTransform-14587328.js +11 -0
  49. package/build/esm/{dataTransform-3e8e25ba.js → dataTransform-8852461c.js} +2 -101
  50. package/build/esm/ecom.js +9 -5
  51. package/build/esm/embeddedHeathToolCards_babyGrowth.js +56 -0
  52. package/build/esm/embeddedHeathToolCards_babyPoop.js +49 -0
  53. package/build/esm/embeddedHeathToolCards_babyVaccine.js +56 -0
  54. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +62 -0
  55. package/build/esm/embeddedHeathToolCards_bmrBmr.js +62 -0
  56. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +57 -0
  57. package/build/esm/embeddedHeathToolCards_helpers.js +7 -0
  58. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +56 -0
  59. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +62 -0
  60. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +65 -0
  61. package/build/esm/{fixedBottomAdBlock-13ed4a34.js → fixedBottomAdBlock-26b94f6b.js} +35 -410
  62. package/build/esm/footer.js +23 -18
  63. package/build/esm/gAssets.js +4 -5
  64. package/build/esm/healthToolsCardWrapper.js +33 -0
  65. package/build/esm/healthToolsForm.js +39 -25
  66. package/build/esm/hooks.js +21 -17
  67. package/build/esm/i18n.js +2 -2
  68. package/build/esm/i18nV2.js +2 -2
  69. package/build/esm/{index-cdac57da.js → index-03050142.js} +1 -1
  70. package/build/esm/{index-21eac858.js → index-03d7200e.js} +12 -10
  71. package/build/esm/index-21524e86.js +249 -0
  72. package/build/esm/{index-16514f4d.js → index-288b564e.js} +3 -3
  73. package/build/esm/index-3060c2dc.js +174 -0
  74. package/build/esm/index-3288f45c.js +490 -0
  75. package/build/esm/{index-42ad7763.js → index-343e5b65.js} +2 -2
  76. package/build/esm/{index-76d20d3f.js → index-345e507e.js} +3 -3
  77. package/build/esm/{index-e3787b20.js → index-38ced379.js} +3 -15
  78. package/build/esm/{index-bef3c9bd.js → index-39aa0c9f.js} +9 -168
  79. package/build/esm/index-39f24b49.js +1351 -0
  80. package/build/esm/{index-f27edf45.js → index-3e2f70fe.js} +11 -11
  81. package/build/esm/{index-d218b94e.js → index-3e3904ec.js} +2 -2
  82. package/build/esm/{index-8952ceac.js → index-40b6555d.js} +4 -4
  83. package/build/esm/{index-703205e3.js → index-41a809d7.js} +3 -3
  84. package/build/esm/index-4d06fffe.js +25 -0
  85. package/build/esm/{index-e104ad21.js → index-506563f6.js} +8 -8
  86. package/build/esm/{index-c1af3a8e.js → index-5369d2e2.js} +15 -13
  87. package/build/esm/index-6125d991.js +370 -0
  88. package/build/esm/index-64dff9b0.js +233 -0
  89. package/build/esm/index-6dd92895.js +791 -0
  90. package/build/esm/{index-e26514ee.js → index-7720a710.js} +4 -4
  91. package/build/esm/{index-c200bff6.js → index-7a1552e9.js} +2 -2
  92. package/build/esm/index-7c678785.js +259 -0
  93. package/build/esm/{index-780a08de.js → index-88c06a7e.js} +2 -2
  94. package/build/esm/{index-cb4afb33.js → index-90d58b18.js} +7 -6
  95. package/build/esm/{index-598ab51b.js → index-96a5f239.js} +6 -5
  96. package/build/esm/index-9a8df805.js +147 -0
  97. package/build/esm/{index-9f1899f2.js → index-9aee96f2.js} +5 -4
  98. package/build/esm/index-a1658f07.js +60 -0
  99. package/build/esm/{constants-6bdb97a8.js → index-a1d2c38b.js} +6 -21
  100. package/build/esm/{index-7e756cb8.js → index-a51336b9.js} +11 -11
  101. package/build/esm/{index-29d04985.js → index-a57a5338.js} +2 -2
  102. package/build/esm/{index-996f7caf.js → index-a7f10a58.js} +4 -4
  103. package/build/esm/index-b123bf27.js +18 -0
  104. package/build/esm/{index-7cbe2a10.js → index-b1e1f9b4.js} +13 -12
  105. package/build/esm/{index-b1bb27aa.js → index-b2ea5cc7.js} +11 -45
  106. package/build/esm/{index-376bee14.js → index-b5019321.js} +7 -7
  107. package/build/esm/{index-78255d6c.js → index-b9c4dfcb.js} +2 -2
  108. package/build/esm/{index-d6201fa4.js → index-bb53d99f.js} +2 -2
  109. package/build/esm/{index-2b9213cf.js → index-bdc3bd61.js} +1 -1
  110. package/build/esm/{index-88ad2ca3.js → index-c41ef517.js} +23 -19
  111. package/build/esm/{index-2774583d.js → index-d462b2bd.js} +35 -31
  112. package/build/esm/{index-cf6beac8.js → index-d5bcc5cc.js} +1 -1
  113. package/build/esm/{index-38f50764.js → index-d9555b0b.js} +17 -260
  114. package/build/esm/{index-1ecbcf21.js → index-e0f8a206.js} +6 -5
  115. package/build/esm/{types-2580132c.js → index-e6b9c7d8.js} +563 -3517
  116. package/build/esm/index-e9d85fda.js +91 -0
  117. package/build/esm/{index-73301602.js → index-f0184ea4.js} +2 -2
  118. package/build/esm/{index-69248434.js → index-f1025cea.js} +3 -3
  119. package/build/esm/index-f3903d13.js +101 -0
  120. package/build/esm/{index-1da2ca0b.js → index-f93799fc.js} +2 -2
  121. package/build/esm/{index-87a2ea8c.js → index-fa83ce20.js} +2 -2
  122. package/build/esm/index-fb8f8203.js +140 -0
  123. package/build/esm/index.js +119 -82
  124. package/build/esm/interfaces/constants/domainLocales.d.ts +25 -0
  125. package/build/esm/interfaces/constants/index.d.ts +1 -25
  126. package/build/esm/labelSorting-e7fa8826.js +47 -0
  127. package/build/esm/lead.js +26 -21
  128. package/build/esm/{logoIcon-d93bc56e.js → logoIcon-b0ce60d0.js} +2 -2
  129. package/build/esm/mantine.js +28 -23
  130. package/build/esm/misc.js +27 -21
  131. package/build/esm/{cookieHelper-73ce3871.js → miscCookieHelper.js} +1 -1
  132. package/build/esm/{defaultClassWrapper-31caf23b.js → miscDefaultClassWrapper.js} +1 -1
  133. package/build/esm/{getDynamicHealthTool-7681e43a.js → miscGetDynamicHealthTool.js} +13 -5
  134. package/build/esm/{getSocialList-e8142513.js → miscGetSocialList.js} +16 -6
  135. package/build/esm/{dataTransform-6c032113.js → miscScreenSizeContext.js} +2 -12
  136. package/build/esm/{theme-f18c2351.js → miscTheme.js} +1 -1
  137. package/build/esm/molecules.js +84 -57
  138. package/build/esm/navigation.js +44 -37
  139. package/build/esm/onboardingV2.js +30 -25
  140. package/build/esm/organisms.js +48 -41
  141. package/build/esm/other-9b439f19.js +102 -0
  142. package/build/esm/pwg.js +25 -20
  143. package/build/esm/{routing-bebdc8b7.js → routing-f2e46f96.js} +3 -2
  144. package/build/esm/subot.js +35 -29
  145. package/build/esm/surveyOrPremiumBanner.js +34 -28
  146. package/build/esm/surveyQuestionCard.js +11 -10
  147. package/build/esm/{surveyThankyouCard-bf6080eb.js → surveyThankyouCard-9d482ef8.js} +6 -6
  148. package/build/esm/together/togetherComponentGlobalContext.d.ts +1 -2
  149. package/build/esm/together.js +58 -42
  150. package/build/esm/togetherApiPaths.js +165 -0
  151. package/build/esm/togetherApiUtils.js +10 -0
  152. package/build/esm/togetherAtoms.js +47 -0
  153. package/build/esm/togetherComponentGlobalContext.js +10 -0
  154. package/build/esm/togetherMolecules.js +60 -0
  155. package/build/esm/togetherOrganisms.js +64 -0
  156. package/build/esm/treePopoverMenu-890070aa.js +334 -0
  157. package/build/esm/types-7d3a4df2.js +5 -0
  158. package/build/esm/{types-be952df2.js → types-e21a244d.js} +14 -13
  159. package/build/esm/types.js +2 -1
  160. package/build/esm/{useCategory-8f109eb7.js → useCategory-45ce6ea8.js} +6 -5
  161. package/build/esm/{useHealthToolCache-d97dfa00.js → useHealthToolCache-fe7dc697.js} +2 -2
  162. package/build/esm/{useMantineLocale-4fb67342.js → useMantineLocale-faa72172.js} +5 -3
  163. package/build/esm/{usePlacesAutocomplete-fe2e4cbe.js → usePlacesAutocomplete-81624098.js} +1 -1
  164. package/build/esm/useTogetherAuthRequiredAction.js +58 -0
  165. package/build/esm/{useTranslations-fbf6a6ab.js → useTranslations-ba901edf.js} +1 -1
  166. package/build/{utils-524bda7c.js → esm/utils-40533779.js} +1 -114
  167. package/build/esm/{utils-d5a0b58f.js → utils-c730ad5d.js} +16 -163
  168. package/build/esm/{utils-cef111b6.js → utils-dbc80293.js} +2 -1
  169. package/build/esm/vaccination.js +23 -18
  170. package/build/{fixedBottomAdBlock-0d4379d1.js → fixedBottomAdBlock-026650fb.js} +155 -540
  171. package/build/footer.js +23 -18
  172. package/build/gAssets.js +4 -5
  173. package/build/healthToolsCardWrapper.js +41 -0
  174. package/build/healthToolsForm.js +45 -31
  175. package/build/hooks.js +21 -17
  176. package/build/i18n.js +1 -1
  177. package/build/i18nV2.js +1 -1
  178. package/build/{index-d34cd464.js → index-036fe55d.js} +4 -4
  179. package/build/index-03da3dbb.js +1364 -0
  180. package/build/{index-7da7b531.js → index-1950777d.js} +7 -7
  181. package/build/index-1fe1ec7e.js +180 -0
  182. package/build/{index-264eeddd.js → index-251187e5.js} +2 -2
  183. package/build/{index-dba2e361.js → index-2ce6cc83.js} +2 -2
  184. package/build/{index-aa818139.js → index-3129e975.js} +6 -6
  185. package/build/{index-c2900d8c.js → index-323d2766.js} +2 -2
  186. package/build/{index-6c27b627.js → index-325d93fc.js} +120 -116
  187. package/build/{index-7c1dc717.js → index-34b1babf.js} +19 -18
  188. package/build/{index-06fa8444.js → index-385f27fb.js} +4 -4
  189. package/build/index-3db01ab3.js +146 -0
  190. package/build/{index-bef2bc73.js → index-48ef94cb.js} +11 -11
  191. package/build/{index-ee964d3c.js → index-4b98362e.js} +6 -6
  192. package/build/index-4c18e4ba.js +97 -0
  193. package/build/{index-77a2b9ee.js → index-4ef9be86.js} +9 -9
  194. package/build/index-5fdde636.js +256 -0
  195. package/build/{index-a86ea1b6.js → index-617bff8c.js} +33 -197
  196. package/build/{index-fe7345fa.js → index-66e789cf.js} +4 -4
  197. package/build/index-6b23104e.js +108 -0
  198. package/build/{index-3dcb9bc6.js → index-6bcde89a.js} +6 -6
  199. package/build/{index-dd1392e3.js → index-6daafc7b.js} +12 -12
  200. package/build/{index-1efa7d84.js → index-6e7aede8.js} +5 -5
  201. package/build/index-6e85bdbb.js +239 -0
  202. package/build/{index-d5b4089d.js → index-70a7d73e.js} +12 -49
  203. package/build/{index-f6575703.js → index-72b989a7.js} +3 -3
  204. package/build/index-72e5dba6.js +153 -0
  205. package/build/{constants-dd16fb4d.js → index-769ecf0d.js} +8 -24
  206. package/build/index-7b98097c.js +25 -0
  207. package/build/{index-838b0f95.js → index-7e89d856.js} +18 -17
  208. package/build/{index-73cde644.js → index-7efbe5e3.js} +9 -9
  209. package/build/{index-a7de42d1.js → index-8cb3f562.js} +1 -1
  210. package/build/{index-c225ef22.js → index-92a816de.js} +25 -24
  211. package/build/{index-b773bc3d.js → index-99ddd1a4.js} +6 -5
  212. package/build/{index-6acb08c0.js → index-a0659d79.js} +14 -14
  213. package/build/{index-def9867a.js → index-a8c1c011.js} +11 -11
  214. package/build/index-aef8a50c.js +267 -0
  215. package/build/{index-247a9eb2.js → index-b76dcc89.js} +81 -77
  216. package/build/index-b99e7941.js +32 -0
  217. package/build/index-bd0008c0.js +805 -0
  218. package/build/{index-dcbd8bf3.js → index-bd37f7ea.js} +9 -9
  219. package/build/index-be727078.js +66 -0
  220. package/build/{index-f28c47ce.js → index-cb1c7190.js} +11 -11
  221. package/build/{index-f1f4fbb9.js → index-cb4ea8c9.js} +26 -24
  222. package/build/index-d71aec74.js +377 -0
  223. package/build/{index-df5cd44b.js → index-d91f52cc.js} +3 -15
  224. package/build/{index-f10efb61.js → index-db6d4daf.js} +33 -33
  225. package/build/{index-05f106c2.js → index-df9447b3.js} +41 -39
  226. package/build/index-e239d386.js +499 -0
  227. package/build/{index-4af08ec2.js → index-eddf350b.js} +2 -2
  228. package/build/{index-6bc3f8c3.js → index-eeb7220e.js} +8 -7
  229. package/build/{types-6c5643a2.js → index-f5956cd0.js} +749 -3709
  230. package/build/index-fbfa2310.js +320 -0
  231. package/build/{index-cb0544e5.js → index-fe74a1a3.js} +59 -59
  232. package/build/index.js +228 -191
  233. package/build/interfaces/constants/domainLocales.d.ts +25 -0
  234. package/build/interfaces/constants/index.d.ts +1 -25
  235. package/build/labelSorting-1905fd49.js +53 -0
  236. package/build/lead.js +43 -38
  237. package/build/{logoIcon-ee9a5501.js → logoIcon-d9adf505.js} +2 -2
  238. package/build/mantine.js +28 -23
  239. package/build/misc.js +39 -33
  240. package/build/{cookieHelper-17491ce8.js → miscCookieHelper.js} +2 -0
  241. package/build/{defaultClassWrapper-e87ca8ef.js → miscDefaultClassWrapper.js} +2 -0
  242. package/build/{getDynamicHealthTool-2a92e1a5.js → miscGetDynamicHealthTool.js} +14 -4
  243. package/build/{getSocialList-97e7bcc1.js → miscGetSocialList.js} +46 -34
  244. package/build/{dataTransform-c1701cbd.js → miscScreenSizeContext.js} +3 -12
  245. package/build/{theme-e4f7f487.js → miscTheme.js} +2 -0
  246. package/build/molecules.js +106 -79
  247. package/build/navigation.js +44 -37
  248. package/build/onboardingV2.js +40 -35
  249. package/build/organisms.js +48 -41
  250. package/build/other-0edcc417.js +104 -0
  251. package/build/pwg.js +60 -55
  252. package/build/{routing-f6d54205.js → routing-54391665.js} +10 -9
  253. package/build/subot.js +175 -169
  254. package/build/surveyOrPremiumBanner.js +34 -28
  255. package/build/surveyQuestionCard.js +11 -10
  256. package/build/{surveyThankyouCard-ead6b355.js → surveyThankyouCard-c7e94445.js} +25 -25
  257. package/build/together/togetherComponentGlobalContext.d.ts +1 -2
  258. package/build/together.js +106 -90
  259. package/build/togetherApiPaths.js +173 -0
  260. package/build/togetherApiUtils.js +40 -0
  261. package/build/togetherAtoms.js +61 -0
  262. package/build/togetherComponentGlobalContext.js +24 -0
  263. package/build/togetherMolecules.js +93 -0
  264. package/build/togetherOrganisms.js +78 -0
  265. package/build/treePopoverMenu-dbb4b61e.js +345 -0
  266. package/build/types-87a48532.js +7 -0
  267. package/build/{types-4ba4268f.js → types-ce7323a0.js} +88 -87
  268. package/build/types.js +6 -5
  269. package/build/{useCategory-e2c91f59.js → useCategory-04ea2a70.js} +18 -17
  270. package/build/{useHealthToolCache-2a53367b.js → useHealthToolCache-9d59f009.js} +4 -4
  271. package/build/{useMantineLocale-a4f0c61d.js → useMantineLocale-f9195d27.js} +26 -24
  272. package/build/{usePlacesAutocomplete-c76d0caf.js → usePlacesAutocomplete-8360abe0.js} +1 -1
  273. package/build/useTogetherAuthRequiredAction.js +68 -0
  274. package/build/{useTranslations-200168a3.js → useTranslations-80687df4.js} +1 -1
  275. package/build/{utils-af695515.js → utils-4849ab04.js} +11 -10
  276. package/build/{esm/utils-f8761b9d.js → utils-928b4701.js} +11 -101
  277. package/build/{utils-95d9832e.js → utils-e4d5701e.js} +26 -172
  278. package/build/vaccination.js +72 -67
  279. package/package.json +1 -1
  280. package/build/esm/index-6ac73f00.js +0 -1114
  281. package/build/index-058b3c0f.js +0 -1127
  282. package/build/index-3d0d22b3.js +0 -565
  283. /package/build/{BMI_BOYS.percentile.monthly-71fb1c9f.js → BMI_BOYS.percentile.monthly-5ba0659a.js} +0 -0
  284. /package/build/{BMI_BOYS.percentile.weekly-b2b344a7.js → BMI_BOYS.percentile.weekly-879f7a42.js} +0 -0
  285. /package/build/{BMI_BOYS.percentile.yearly-031ddade.js → BMI_BOYS.percentile.yearly-e4c37a27.js} +0 -0
  286. /package/build/{BMI_BOYS.zscore.monthly-bb1f9962.js → BMI_BOYS.zscore.monthly-fa3d3237.js} +0 -0
  287. /package/build/{BMI_BOYS.zscore.weekly-d6198d53.js → BMI_BOYS.zscore.weekly-71226efa.js} +0 -0
  288. /package/build/{BMI_BOYS.zscore.yearly-48255337.js → BMI_BOYS.zscore.yearly-92a2f05e.js} +0 -0
  289. /package/build/{BMI_GIRLS.percentile.monthly-e3e284ee.js → BMI_GIRLS.percentile.monthly-cd39f35d.js} +0 -0
  290. /package/build/{BMI_GIRLS.percentile.weekly-9f2d3977.js → BMI_GIRLS.percentile.weekly-5cb19fda.js} +0 -0
  291. /package/build/{BMI_GIRLS.percentile.yearly-c79f34ce.js → BMI_GIRLS.percentile.yearly-b80f3d32.js} +0 -0
  292. /package/build/{BMI_GIRLS.zscore.monthly-11092df0.js → BMI_GIRLS.zscore.monthly-89248182.js} +0 -0
  293. /package/build/{BMI_GIRLS.zscore.weekly-5c375d2b.js → BMI_GIRLS.zscore.weekly-609c3c1f.js} +0 -0
  294. /package/build/{BMI_GIRLS.zscore.yearly-adbba8e3.js → BMI_GIRLS.zscore.yearly-f4587218.js} +0 -0
  295. /package/build/{ChevronDown-f7e25d61.js → ChevronDown-dfb97861.js} +0 -0
  296. /package/build/{Close-36b0da99.js → Close-6296f986.js} +0 -0
  297. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-163b99ad.js → HEAD CIRCUM_BOYS.percentile.monthly-a7e17d51.js} +0 -0
  298. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-c9882014.js → HEAD CIRCUM_BOYS.percentile.weekly-688e7e30.js} +0 -0
  299. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-9d2bc91e.js → HEAD CIRCUM_BOYS.percentile.yearly-5e1b6296.js} +0 -0
  300. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-1d2a215c.js → HEAD CIRCUM_BOYS.zscore.monthly-e66bc7d4.js} +0 -0
  301. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-1f139c91.js → HEAD CIRCUM_BOYS.zscore.weekly-f1221399.js} +0 -0
  302. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-ba15501b.js → HEAD CIRCUM_BOYS.zscore.yearly-c3dea838.js} +0 -0
  303. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-a546201a.js → HEAD CIRCUM_GIRLS.percentile.monthly-df5b45d4.js} +0 -0
  304. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-66cd5a7e.js → HEAD CIRCUM_GIRLS.percentile.weekly-6c4e803a.js} +0 -0
  305. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-9db3c653.js → HEAD CIRCUM_GIRLS.percentile.yearly-05ac380c.js} +0 -0
  306. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-0405e2cb.js → HEAD CIRCUM_GIRLS.zscore.monthly-8418b138.js} +0 -0
  307. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-b2cc3ad2.js → HEAD CIRCUM_GIRLS.zscore.weekly-02c9e21d.js} +0 -0
  308. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-3115f993.js → HEAD CIRCUM_GIRLS.zscore.yearly-656652b6.js} +0 -0
  309. /package/build/{HEIGHT_BOYS.percentile.monthly-35138a98.js → HEIGHT_BOYS.percentile.monthly-9b3ca406.js} +0 -0
  310. /package/build/{HEIGHT_BOYS.percentile.weekly-0216c35b.js → HEIGHT_BOYS.percentile.weekly-add16dbe.js} +0 -0
  311. /package/build/{HEIGHT_BOYS.percentile.yearly-f698e45d.js → HEIGHT_BOYS.percentile.yearly-a338c8a8.js} +0 -0
  312. /package/build/{HEIGHT_BOYS.zscore.monthly-01195728.js → HEIGHT_BOYS.zscore.monthly-7caebf2d.js} +0 -0
  313. /package/build/{HEIGHT_BOYS.zscore.weekly-993e9cf2.js → HEIGHT_BOYS.zscore.weekly-5962317e.js} +0 -0
  314. /package/build/{HEIGHT_BOYS.zscore.yearly-fee3ed69.js → HEIGHT_BOYS.zscore.yearly-b1576fab.js} +0 -0
  315. /package/build/{HEIGHT_GIRLS.percentile.monthly-27b2474a.js → HEIGHT_GIRLS.percentile.monthly-937209f6.js} +0 -0
  316. /package/build/{HEIGHT_GIRLS.percentile.weekly-77bff236.js → HEIGHT_GIRLS.percentile.weekly-c571a906.js} +0 -0
  317. /package/build/{HEIGHT_GIRLS.percentile.yearly-6200a720.js → HEIGHT_GIRLS.percentile.yearly-e78281ec.js} +0 -0
  318. /package/build/{HEIGHT_GIRLS.zscore.monthly-94978e64.js → HEIGHT_GIRLS.zscore.monthly-e5212600.js} +0 -0
  319. /package/build/{HEIGHT_GIRLS.zscore.weekly-7951beb1.js → HEIGHT_GIRLS.zscore.weekly-3c269af1.js} +0 -0
  320. /package/build/{HEIGHT_GIRLS.zscore.yearly-c2eca714.js → HEIGHT_GIRLS.zscore.yearly-449bc93d.js} +0 -0
  321. /package/build/{Visible-eee51ba6.js → Visible-16859c31.js} +0 -0
  322. /package/build/{WEIGHT_BOYS.percentile.monthly-6a6f901b.js → WEIGHT_BOYS.percentile.monthly-85da0f0a.js} +0 -0
  323. /package/build/{WEIGHT_BOYS.percentile.weekly-737fb867.js → WEIGHT_BOYS.percentile.weekly-9229beac.js} +0 -0
  324. /package/build/{WEIGHT_BOYS.percentile.yearly-7772b5e5.js → WEIGHT_BOYS.percentile.yearly-e8a3c476.js} +0 -0
  325. /package/build/{WEIGHT_BOYS.zscore.monthly-8db2e7d6.js → WEIGHT_BOYS.zscore.monthly-20bef361.js} +0 -0
  326. /package/build/{WEIGHT_BOYS.zscore.weekly-ddd37c1a.js → WEIGHT_BOYS.zscore.weekly-0ec853d0.js} +0 -0
  327. /package/build/{WEIGHT_BOYS.zscore.yearly-332a8f7b.js → WEIGHT_BOYS.zscore.yearly-fccc526c.js} +0 -0
  328. /package/build/{WEIGHT_GIRLS.percentile.monthly-3edad688.js → WEIGHT_GIRLS.percentile.monthly-e7c89bed.js} +0 -0
  329. /package/build/{WEIGHT_GIRLS.percentile.weekly-f113a82a.js → WEIGHT_GIRLS.percentile.weekly-2510046f.js} +0 -0
  330. /package/build/{WEIGHT_GIRLS.percentile.yearly-95afbeaf.js → WEIGHT_GIRLS.percentile.yearly-5046e02b.js} +0 -0
  331. /package/build/{WEIGHT_GIRLS.zscore.monthly-d27c4bd4.js → WEIGHT_GIRLS.zscore.monthly-e6077126.js} +0 -0
  332. /package/build/{WEIGHT_GIRLS.zscore.weekly-2b113519.js → WEIGHT_GIRLS.zscore.weekly-1a145215.js} +0 -0
  333. /package/build/{WEIGHT_GIRLS.zscore.yearly-c82b04db.js → WEIGHT_GIRLS.zscore.yearly-31e42fc2.js} +0 -0
  334. /package/build/{animation-e1375a3b.js → animation-f64d3491.js} +0 -0
  335. /package/build/{cart-67147d06.js → cart-1cbf9c06.js} +0 -0
  336. /package/build/{constants-513a9a41.js → constants-1953275e.js} +0 -0
  337. /package/build/{constants-936f45e9.js → constants-2aeb65f2.js} +0 -0
  338. /package/build/{doctor-17b525f8.js → doctor-10ee1543.js} +0 -0
  339. /package/build/esm/{BMI_BOYS.percentile.monthly-7c9d4923.js → BMI_BOYS.percentile.monthly-44bf9bca.js} +0 -0
  340. /package/build/esm/{BMI_BOYS.percentile.weekly-c410294a.js → BMI_BOYS.percentile.weekly-14f8edd2.js} +0 -0
  341. /package/build/esm/{BMI_BOYS.percentile.yearly-695a4fe2.js → BMI_BOYS.percentile.yearly-609a4150.js} +0 -0
  342. /package/build/esm/{BMI_BOYS.zscore.monthly-9fb9f281.js → BMI_BOYS.zscore.monthly-5f7b2488.js} +0 -0
  343. /package/build/esm/{BMI_BOYS.zscore.weekly-d2109e4b.js → BMI_BOYS.zscore.weekly-79b9ae06.js} +0 -0
  344. /package/build/esm/{BMI_BOYS.zscore.yearly-bfa5361b.js → BMI_BOYS.zscore.yearly-08133388.js} +0 -0
  345. /package/build/esm/{BMI_GIRLS.percentile.monthly-f5f60596.js → BMI_GIRLS.percentile.monthly-20e00636.js} +0 -0
  346. /package/build/esm/{BMI_GIRLS.percentile.weekly-26e4e864.js → BMI_GIRLS.percentile.weekly-033dda0b.js} +0 -0
  347. /package/build/esm/{BMI_GIRLS.percentile.yearly-5a2b297d.js → BMI_GIRLS.percentile.yearly-d66fbb80.js} +0 -0
  348. /package/build/esm/{BMI_GIRLS.zscore.monthly-4e80bed5.js → BMI_GIRLS.zscore.monthly-fec8e639.js} +0 -0
  349. /package/build/esm/{BMI_GIRLS.zscore.weekly-03b79f0b.js → BMI_GIRLS.zscore.weekly-7cd36dc2.js} +0 -0
  350. /package/build/esm/{BMI_GIRLS.zscore.yearly-822ed949.js → BMI_GIRLS.zscore.yearly-9729495b.js} +0 -0
  351. /package/build/esm/{ChevronDown-74267eb8.js → ChevronDown-b58f1e76.js} +0 -0
  352. /package/build/esm/{Close-372aa467.js → Close-0390b2a2.js} +0 -0
  353. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-21b04c4c.js → HEAD CIRCUM_BOYS.percentile.monthly-6aa62326.js} +0 -0
  354. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-049a9d97.js → HEAD CIRCUM_BOYS.percentile.weekly-dccbec56.js} +0 -0
  355. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-a4bbbaba.js → HEAD CIRCUM_BOYS.percentile.yearly-153e0846.js} +0 -0
  356. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-7cb348c6.js → HEAD CIRCUM_BOYS.zscore.monthly-3fe46c5e.js} +0 -0
  357. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-678a1a52.js → HEAD CIRCUM_BOYS.zscore.weekly-81fa76e0.js} +0 -0
  358. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-db81b17e.js → HEAD CIRCUM_BOYS.zscore.yearly-a5955c3a.js} +0 -0
  359. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-cee33cd5.js → HEAD CIRCUM_GIRLS.percentile.monthly-16afd7d8.js} +0 -0
  360. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-2cec19c3.js → HEAD CIRCUM_GIRLS.percentile.weekly-b0258df8.js} +0 -0
  361. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-5949e664.js → HEAD CIRCUM_GIRLS.percentile.yearly-fbe848aa.js} +0 -0
  362. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-7c2bffab.js → HEAD CIRCUM_GIRLS.zscore.monthly-7cb222f7.js} +0 -0
  363. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-356dd00a.js → HEAD CIRCUM_GIRLS.zscore.weekly-786f37d5.js} +0 -0
  364. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-e7b62215.js → HEAD CIRCUM_GIRLS.zscore.yearly-546970dc.js} +0 -0
  365. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-359c4335.js → HEIGHT_BOYS.percentile.monthly-3fe8dd70.js} +0 -0
  366. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-a4d4acd3.js → HEIGHT_BOYS.percentile.weekly-8ff515f0.js} +0 -0
  367. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-ec9a7f9b.js → HEIGHT_BOYS.percentile.yearly-2ed73e3c.js} +0 -0
  368. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-12331258.js → HEIGHT_BOYS.zscore.monthly-f18a337e.js} +0 -0
  369. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-172054d3.js → HEIGHT_BOYS.zscore.weekly-d06e0e09.js} +0 -0
  370. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-bb47a3be.js → HEIGHT_BOYS.zscore.yearly-e500b2d1.js} +0 -0
  371. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-c93c0b34.js → HEIGHT_GIRLS.percentile.monthly-2eb2700e.js} +0 -0
  372. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-f1f83097.js → HEIGHT_GIRLS.percentile.weekly-2f205b6e.js} +0 -0
  373. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-ccee4e55.js → HEIGHT_GIRLS.percentile.yearly-0d54472f.js} +0 -0
  374. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-caf5410c.js → HEIGHT_GIRLS.zscore.monthly-d1846835.js} +0 -0
  375. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-b1e28b0e.js → HEIGHT_GIRLS.zscore.weekly-b9036bc9.js} +0 -0
  376. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-c3af35d3.js → HEIGHT_GIRLS.zscore.yearly-8dcf6e2d.js} +0 -0
  377. /package/build/esm/{Visible-3f9d7dca.js → Visible-76b05e8e.js} +0 -0
  378. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-8a4647df.js → WEIGHT_BOYS.percentile.monthly-85f7b978.js} +0 -0
  379. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-a2a6adf1.js → WEIGHT_BOYS.percentile.weekly-7c206abd.js} +0 -0
  380. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-073df8b7.js → WEIGHT_BOYS.percentile.yearly-52c0957d.js} +0 -0
  381. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-bb9e73d2.js → WEIGHT_BOYS.zscore.monthly-f48a971e.js} +0 -0
  382. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-ef32ce7a.js → WEIGHT_BOYS.zscore.weekly-6355c54f.js} +0 -0
  383. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-6cc77688.js → WEIGHT_BOYS.zscore.yearly-bdb0459b.js} +0 -0
  384. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-a4b518bc.js → WEIGHT_GIRLS.percentile.monthly-a3b768e9.js} +0 -0
  385. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-dcedaebb.js → WEIGHT_GIRLS.percentile.weekly-715f5009.js} +0 -0
  386. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-9e66577e.js → WEIGHT_GIRLS.percentile.yearly-c3a04a7d.js} +0 -0
  387. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-c07cb81f.js → WEIGHT_GIRLS.zscore.monthly-ea7be69d.js} +0 -0
  388. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-9c5c3e8e.js → WEIGHT_GIRLS.zscore.weekly-8b92b792.js} +0 -0
  389. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-e99ce511.js → WEIGHT_GIRLS.zscore.yearly-8a06cbf9.js} +0 -0
  390. /package/build/esm/{animation-0b2299dc.js → animation-b6d252e4.js} +0 -0
  391. /package/build/esm/{cart-f961dadc.js → cart-043dfe5c.js} +0 -0
  392. /package/build/esm/{constants-71d9f33b.js → constants-697503a2.js} +0 -0
  393. /package/build/esm/{constants-f77fc231.js → constants-b3779c5e.js} +0 -0
  394. /package/build/esm/{doctor-8a07ca44.js → doctor-9f166022.js} +0 -0
  395. /package/build/esm/{index-b65a8764.js → index-36764891.js} +0 -0
  396. /package/build/esm/{index-3078acec.js → index-44870130.js} +0 -0
  397. /package/build/esm/{index-782fed08.js → index-77dc8ed1.js} +0 -0
  398. /package/build/esm/{index-c3264b34.js → index-ee5dec8f.js} +0 -0
  399. /package/build/esm/{localizeNumberFormat-42ae8d89.js → localizeNumberFormat-4dd1fd7a.js} +0 -0
  400. /package/build/esm/{normalizeLink-d6f57223.js → normalizeLink-243e6342.js} +0 -0
  401. /package/build/esm/{number-13f075cf.js → number-129aedb0.js} +0 -0
  402. /package/build/esm/{paths-49a813e7.js → paths-67ad72a7.js} +0 -0
  403. /package/build/esm/{translationsContext-f3d1a7bd.js → translationsContext-68168ff3.js} +0 -0
  404. /package/build/esm/{tslib.es6-761239c7.js → tslib.es6-2d738692.js} +0 -0
  405. /package/build/esm/{useIsInit-ee864235.js → useIsInit-6be72906.js} +0 -0
  406. /package/build/esm/{useOutsideClick-7451aa57.js → useOutsideClick-fd3849ea.js} +0 -0
  407. /package/build/esm/{useScrollbarSize-84bb5b47.js → useScrollbarSize-77534d1d.js} +0 -0
  408. /package/build/esm/{useUniqueId-c23213b6.js → useUniqueId-e84c90ce.js} +0 -0
  409. /package/build/{index-bba97c2e.js → index-0168f1a0.js} +0 -0
  410. /package/build/{index-e0bf03ac.js → index-053ed018.js} +0 -0
  411. /package/build/{index-97ebd7e1.js → index-90e7e427.js} +0 -0
  412. /package/build/{index-ba3797bb.js → index-a73d7cb3.js} +0 -0
  413. /package/build/{localizeNumberFormat-90d4f9d5.js → localizeNumberFormat-8ab6a41e.js} +0 -0
  414. /package/build/{normalizeLink-451ae6d8.js → normalizeLink-07c90859.js} +0 -0
  415. /package/build/{number-c2338382.js → number-5605662c.js} +0 -0
  416. /package/build/{paths-e0bbfce7.js → paths-6b0114f1.js} +0 -0
  417. /package/build/{translationsContext-39528d2f.js → translationsContext-ade0df93.js} +0 -0
  418. /package/build/{tslib.es6-7e140b89.js → tslib.es6-d6fa4ee6.js} +0 -0
  419. /package/build/{useIsInit-38cec0c4.js → useIsInit-08580a12.js} +0 -0
  420. /package/build/{useOutsideClick-e579e1ac.js → useOutsideClick-960bf73b.js} +0 -0
  421. /package/build/{useScrollbarSize-5a8be010.js → useScrollbarSize-49049c18.js} +0 -0
  422. /package/build/{useUniqueId-8929fe5f.js → useUniqueId-3c52a5c5.js} +0 -0
@@ -0,0 +1,1351 @@
1
+ import { a as __awaiter, _ as __rest } from './tslib.es6-2d738692.js';
2
+ import React__default, { useContext, useState, useEffect, useMemo } from 'react';
3
+ import { B as Button } from './index-f93799fc.js';
4
+ import { H as Heading } from './index-f0184ea4.js';
5
+ import { u as useTranslations } from './useTranslations-ba901edf.js';
6
+ import innertext from 'innertext';
7
+ import { S as SharePopup, P as PopupDanger, x as deletePost, y as IconAlertCircle, e as SubmitReportForm, z as deleteComment, C as CardAuthor, L as Loading, l as ProfileDetailModal, m as ProfileDetail, A as decodeCommentBody, g as PostContent, j as PostImagePreview, B as likeUnlikeComment, I as InputCommentBar, k as SocialLinkPreview, D as likeUnlikePost, s as getDefaultFailNoti } from './index-e6b9c7d8.js';
8
+ import { C as CommonGAssets } from './index-b9c4dfcb.js';
9
+ import { R as REPORT_REASON_MAP, D as DEFAULT_IMG } from './constants-697503a2.js';
10
+ import { PATHS, DISCOVER_PATHS, CARE_PATHS } from './togetherApiPaths.js';
11
+ import { T as TogetherComponentGlobalContext, b as callApiWithAuth, d as getApiPath, c as callApi, q as getMarryBabyApiPath, o as getDiscoverApiPath, g as getCarePath, k as getCurrentBaseUrl$1, r as callApiWithOptionalAuth, l as domainLocales$1 } from './utils-c730ad5d.js';
12
+ import { useTogetherAuthRequiredAction, TogetherAuthConfigContextProvider } from './useTogetherAuthRequiredAction.js';
13
+ import { b as TreePopoverMenu, C as CardReactions, c as CardReactionType, a as LabelPin, T as TagTopic } from './treePopoverMenu-890070aa.js';
14
+ import styled from '@emotion/styled';
15
+ import { M as MediaQueries } from './utils-40533779.js';
16
+ import { theme } from './miscTheme.js';
17
+ import { e as formatArticle, h as formatCategory, c as formatComment } from './dataTransform-8852461c.js';
18
+ import { C as CardLink } from './index-3288f45c.js';
19
+ import { D as Divider } from './index-b123bf27.js';
20
+ import './index-39aa0c9f.js';
21
+ import { Plus } from '@hhgtech/icons/core';
22
+ import { ArrowRight, ArrowDown, Trash, Endorse } from '@hhgtech/icons/other';
23
+ import { Accordion } from '@mantine/core';
24
+ import { I as Input } from './index-288b564e.js';
25
+ import { T as Text } from './index-7a1552e9.js';
26
+ import { g as getCurrentBaseUrl } from './routing-f2e46f96.js';
27
+ import { domainLocales } from './constantsDomainLocales.js';
28
+
29
+ var img$8 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath fill='%233E3F58' d='M5 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2M19 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2M12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2'/%3e%3c/svg%3e";
30
+ var MBMoreSolid = img$8;
31
+
32
+ var img$7 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23595959'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 13.333 8 10.37l-4 2.963V3.852c0-.314.12-.616.335-.838.214-.222.505-.347.808-.347h5.714c.303 0 .594.125.808.347s.335.524.335.838z'/%3e%3c/svg%3e";
33
+ var IconBookmarkFill = img$7;
34
+
35
+ var img$6 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 13.333 8 10.37l-4 2.963V3.852c0-.314.12-.616.335-.838.214-.222.505-.347.808-.347h5.714c.303 0 .594.125.808.347s.335.524.335.838z'/%3e%3c/svg%3e";
36
+ var IconBookmark = img$6;
37
+
38
+ var img$5 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='3' height='13' fill='none'%3e%3ccircle cx='1.583' cy='6.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 6.417)'/%3e%3ccircle cx='1.583' cy='1.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 1.417)'/%3e%3ccircle cx='1.583' cy='11.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 11.417)'/%3e%3c/svg%3e";
39
+ var IconKebab = img$5;
40
+
41
+ var img$4 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 5.333a2 2 0 1 0 0-4 2 2 0 0 0 0 4M4 10a2 2 0 1 0 0-4 2 2 0 0 0 0 4M12 14.667a2 2 0 1 0 0-4 2 2 0 0 0 0 4M5.727 9.007l4.553 2.653M10.273 4.34 5.727 6.993'/%3e%3c/svg%3e";
42
+ var IconShareOnMedia = img$4;
43
+
44
+ var img$3 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M7.17 3.236H2.995a1.193 1.193 0 0 0-1.193 1.192v8.35a1.193 1.193 0 0 0 1.193 1.192h8.35a1.193 1.193 0 0 0 1.192-1.192V8.603'/%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M11.643 2.341a1.265 1.265 0 0 1 1.789 1.79L7.766 9.795l-2.385.596.596-2.385z'/%3e%3c/svg%3e";
45
+ var IconTabEdit = img$3;
46
+
47
+ var img$2 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M2 4h12'/%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M5.333 4V2.667a1.333 1.333 0 0 1 1.334-1.334h2.666a1.334 1.334 0 0 1 1.334 1.334V4m2 0v9.333a1.334 1.334 0 0 1-1.334 1.334H4.667a1.334 1.334 0 0 1-1.334-1.334V4zM6.667 7.333v4M9.333 7.333v4'/%3e%3c/svg%3e";
48
+ var IconTrashBin = img$2;
49
+
50
+ // import IconBellOff from '../../../assets/svg/icon-bell-off.svg'
51
+ // import IconBellOn from '../../../assets/svg/icon-bell-on.svg'
52
+ const CardPostPopoverMore = ({ authorEmail, onDeletePost, shareUrl, post, className = '', popoverClassName = '', onBookmark, onRemoveBookmark, onEditPost, }) => {
53
+ const { data: { locale, userInfo, togetherUserId, env: { isMarryBaby }, }, action: { pushNotifications }, } = useContext(TogetherComponentGlobalContext);
54
+ const { t } = useTranslations();
55
+ // const [localHasNoti, setLocalHasNoti] = useState(false)
56
+ const [loading, setLoading] = useState(false);
57
+ const [isOpenLeavePopup, setIsOpenLeavePopup] = useState(false);
58
+ const [isOpenSharePopup, setIsOpenSharePopup] = useState(false);
59
+ const { authActionWrapper } = useTogetherAuthRequiredAction();
60
+ const isAuthor = authorEmail && (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) && authorEmail === String(userInfo === null || userInfo === void 0 ? void 0 : userInfo.email);
61
+ return (React__default.createElement("div", { className: className, onClick: (e) => {
62
+ e.preventDefault();
63
+ e.stopPropagation();
64
+ } },
65
+ isOpenSharePopup && (React__default.createElement(SharePopup, { url: shareUrl, text: post === null || post === void 0 ? void 0 : post.title, onClose: () => setIsOpenSharePopup(false) })),
66
+ isOpenLeavePopup && (React__default.createElement(PopupDanger, { thumbnail: CommonGAssets.getAssetPath('trash-bin.svg'), isThumbnailIcon: true, title: t('popup.deletePost.title'), description: t('popup.deletePost.description'), acceptText: t('popup.deletePost.accept'), cancelText: t('popup.deletePost.cancel'), onAccept: () => __awaiter(void 0, void 0, void 0, function* () {
67
+ if (!(post === null || post === void 0 ? void 0 : post.id) || loading)
68
+ return;
69
+ setLoading(true);
70
+ try {
71
+ const res = yield deletePost({
72
+ id: post.id,
73
+ locale,
74
+ });
75
+ if ((res === null || res === void 0 ? void 0 : res.status) === 1)
76
+ onDeletePost === null || onDeletePost === void 0 ? void 0 : onDeletePost();
77
+ }
78
+ catch (_a) { }
79
+ setLoading(false);
80
+ }), onClose: () => setIsOpenLeavePopup(false) })),
81
+ React__default.createElement(TreePopoverMenu, { className: popoverClassName, toggleButtonContent: React__default.createElement("img", { src: isMarryBaby ? MBMoreSolid : IconKebab, loading: "lazy" }), position: "bottom", align: "end", buttonProps: {
82
+ isLoading: loading,
83
+ }, data: isAuthor
84
+ ? {
85
+ isShowheader: false,
86
+ type: 'list',
87
+ list: [
88
+ {
89
+ icon: IconShareOnMedia,
90
+ label: t('morePopover.share'),
91
+ onClick: () => setIsOpenSharePopup(true),
92
+ },
93
+ {
94
+ icon: IconTabEdit,
95
+ label: t('actionPopover.edit'),
96
+ onClick: onEditPost,
97
+ },
98
+ {
99
+ icon: IconTrashBin,
100
+ label: t('actionPopover.delete'),
101
+ onClick: () => {
102
+ authActionWrapper(() => setIsOpenLeavePopup(true));
103
+ },
104
+ },
105
+ ],
106
+ }
107
+ : {
108
+ isShowheader: false,
109
+ type: 'list',
110
+ list: [
111
+ {
112
+ icon: IconShareOnMedia,
113
+ label: t('morePopover.share'),
114
+ onClick: () => setIsOpenSharePopup(true),
115
+ },
116
+ {
117
+ icon: !!(post === null || post === void 0 ? void 0 : post.bookmarked) ? IconBookmarkFill : IconBookmark,
118
+ label: !!(post === null || post === void 0 ? void 0 : post.bookmarked)
119
+ ? t('morePopover.unsavePost')
120
+ : t('morePopover.savePost'),
121
+ onClick: () => {
122
+ authActionWrapper(() => __awaiter(void 0, void 0, void 0, function* () {
123
+ if (!(userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) || !(post === null || post === void 0 ? void 0 : post.id))
124
+ return;
125
+ if (post === null || post === void 0 ? void 0 : post.bookmarked) {
126
+ const res = yield callApiWithAuth(getApiPath(PATHS.BOOKMARK.DELETE, {
127
+ _locale: locale,
128
+ }), 'DELETE', {
129
+ data: {
130
+ post_id: String(post.id),
131
+ },
132
+ });
133
+ if ((res === null || res === void 0 ? void 0 : res.status) === 1) {
134
+ pushNotifications({
135
+ title: '',
136
+ message: 'Removed saved post',
137
+ type: 'success',
138
+ displayIcon: IconBookmark,
139
+ });
140
+ onRemoveBookmark && onRemoveBookmark();
141
+ }
142
+ else {
143
+ pushNotifications({
144
+ title: '',
145
+ message: 'Remove failed',
146
+ type: 'danger',
147
+ displayIcon: IconBookmark,
148
+ });
149
+ }
150
+ }
151
+ else {
152
+ const res = yield callApiWithAuth(getApiPath(PATHS.BOOKMARK.CREATE, {
153
+ _locale: locale,
154
+ }), 'POST', {
155
+ data: {
156
+ user_id: togetherUserId || userInfo.id,
157
+ post_id: post.id,
158
+ },
159
+ });
160
+ if ((res === null || res === void 0 ? void 0 : res.status) === 1) {
161
+ pushNotifications({
162
+ title: '',
163
+ message: 'Post saved',
164
+ type: 'success',
165
+ displayIcon: IconBookmarkFill,
166
+ });
167
+ onBookmark && onBookmark();
168
+ }
169
+ else {
170
+ pushNotifications({
171
+ title: '',
172
+ message: 'Post saved failed',
173
+ type: 'danger',
174
+ displayIcon: IconBookmark,
175
+ });
176
+ }
177
+ }
178
+ }));
179
+ },
180
+ },
181
+ // {
182
+ // icon: togetherBasePath + '/svg/icon-bell-on.svg',
183
+ // label: !localHasNoti
184
+ // ? t( 'morePopover.turnOnNotifications' })
185
+ // : t( 'morePopover.turnOffNotifications' }),
186
+ // onClick: () => {
187
+ // authActionWrapper(async () => {
188
+ // if (!post?.id || loading) return
189
+ // setLoading(true)
190
+ // try {
191
+ // const res = await followUnfollowPost({
192
+ // id: post?.id,
193
+ // locale,
194
+ // })
195
+ // if (res?.status === 1) {
196
+ // pushNotifications({
197
+ // message: !localHasNoti
198
+ // ? 'Notification on'
199
+ // : 'Notification off',
200
+ // type: !localHasNoti ? 'success' : 'danger',
201
+ // displayIcon: !localHasNoti ? IconBellOn : IconBellOff,
202
+ // })
203
+ // setLocalHasNoti((v) => !v)
204
+ // }
205
+ // } catch {}
206
+ // setLoading(false)
207
+ // })
208
+ // },
209
+ // },
210
+ {
211
+ icon: IconAlertCircle,
212
+ label: t('morePopover.report'),
213
+ subTree: {
214
+ title: t('morePopover.report.title'),
215
+ description: t('morePopover.report.description'),
216
+ isShowheader: true,
217
+ type: 'list',
218
+ list: Object.keys(REPORT_REASON_MAP)
219
+ .map((k) => ({
220
+ label: REPORT_REASON_MAP[k].label,
221
+ reason: REPORT_REASON_MAP[k].reportReasonText,
222
+ reasonValue: k,
223
+ }))
224
+ .map((item) => ({
225
+ label: t(item.label),
226
+ subTree: {
227
+ title: t('morePopover.reportSubmit.title'),
228
+ description: t('morePopover.reportSubmit.description'),
229
+ isShowheader: true,
230
+ type: 'jsx',
231
+ jsxRenderer: (setShow) => (React__default.createElement(SubmitReportForm, { reason: item.reasonValue, reasonText: t(item.reason), postId: post === null || post === void 0 ? void 0 : post.id, onClose: () => setShow && setShow(false) })),
232
+ },
233
+ })),
234
+ },
235
+ },
236
+ ],
237
+ } })));
238
+ };
239
+
240
+ const StyledCardPost$1 = styled.div `
241
+ position: relative;
242
+ margin-bottom: 24px;
243
+ background: white;
244
+ border-radius: ${theme.borderRadius};
245
+
246
+ a {
247
+ text-decoration: none;
248
+ }
249
+
250
+ ${MediaQueries.mbDown} {
251
+ margin-bottom: 8px;
252
+ }
253
+ &.flat-top {
254
+ border-top-left-radius: 0;
255
+ border-top-right-radius: 0;
256
+ }
257
+
258
+ .post-pin {
259
+ padding: 0.5rem 1rem;
260
+ border-radius: ${theme.borderRadius} 6px 0 0;
261
+ }
262
+ .post-author {
263
+ display: flex;
264
+ align-items: center;
265
+ justify-content: space-between;
266
+ &.comment {
267
+ padding-right: 2.6rem;
268
+ }
269
+ .author-avatar-wrapper {
270
+ width: 40px;
271
+ height: 40px;
272
+ font-size: 20px;
273
+ ${MediaQueries.mbDown} {
274
+ width: 32px;
275
+ height: 32px;
276
+ font-size: 16px;
277
+ }
278
+ }
279
+ }
280
+ .post-content-link-wrapper {
281
+ color: inherit;
282
+ cursor: pointer;
283
+ .post-content-title {
284
+ padding: 1rem 1rem 0;
285
+ word-break: break-word;
286
+ }
287
+ }
288
+ .social-preview-wrapper.has-image {
289
+ margin-bottom: 5px;
290
+ }
291
+ .social-preview-wrapper,
292
+ .image-preview-wrapper,
293
+ .link-preview-wrapper {
294
+ width: 100%;
295
+ &[data-is-reply='true'] {
296
+ padding-right: 1rem;
297
+ padding-left: 1rem;
298
+ }
299
+ }
300
+ .post-topics {
301
+ padding: 0 1rem;
302
+ }
303
+
304
+ .post-reaction {
305
+ background: none;
306
+ border-radius: 0 0 6px 6px;
307
+ &.hide-top-border {
308
+ ::before {
309
+ display: none;
310
+ }
311
+ }
312
+ }
313
+ .most-engaging-wrapper {
314
+ padding: 1rem;
315
+ cursor: pointer;
316
+ .author-avatar-wrapper {
317
+ width: 2rem;
318
+ height: 2rem;
319
+ font-size: 1rem;
320
+ }
321
+ .see-more-comments {
322
+ width: 100%;
323
+ padding: 12px 0 0;
324
+ text-align: unset;
325
+ }
326
+ }
327
+ &[data-most-engaging='true'] {
328
+ border: none;
329
+ ${MediaQueries.mbDown} {
330
+ margin: 1rem;
331
+ border: 1px solid #e4e8ec;
332
+ }
333
+ }
334
+ .top-divider {
335
+ border-color: #e4e8ec;
336
+ }
337
+ .popover {
338
+ .popover-menu__btn {
339
+ display: flex;
340
+ width: 1.5rem;
341
+ height: 1rem;
342
+ align-items: center;
343
+ justify-content: center;
344
+ padding: 0;
345
+ background: transparent;
346
+
347
+ &:hover {
348
+ background-color: transparent;
349
+ }
350
+ }
351
+ .popover-menu__content {
352
+ &.--position-bottom {
353
+ &.--align-end {
354
+ &::before {
355
+ right: 12.5px;
356
+ }
357
+ }
358
+ }
359
+ }
360
+ }
361
+
362
+ &[data-is-marrybaby='true'] {
363
+ border: 1px solid #f3f3f3;
364
+ border-radius: 1rem;
365
+ /* shadow */
366
+
367
+ box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.08);
368
+ .image-preview-wrapper,
369
+ .link-preview-wrapper {
370
+ padding-right: 1rem;
371
+ padding-left: 1rem;
372
+ }
373
+ .popover {
374
+ .popover-menu__btn {
375
+ width: 24px;
376
+ height: 24px;
377
+ ${MediaQueries.mbDown} {
378
+ width: 18px;
379
+ height: 18px;
380
+ }
381
+ }
382
+ .popover-menu__content {
383
+ &.--position-bottom {
384
+ &.--align-end {
385
+ &::before {
386
+ right: 1rem;
387
+ }
388
+ width: 350px;
389
+ ${MediaQueries.mbDown} {
390
+ max-width: calc(320px - 2rem);
391
+ }
392
+ }
393
+ }
394
+ }
395
+ }
396
+ .most-engaging-wrapper {
397
+ position: relative;
398
+ padding: 0;
399
+ &::before {
400
+ position: absolute;
401
+ z-index: 5;
402
+ top: 0;
403
+ left: 50%;
404
+ width: calc(100% - 2rem);
405
+ height: 1px;
406
+ background: #f3f3f3;
407
+ content: ' ';
408
+ transform: translateX(-50%);
409
+ }
410
+ }
411
+ ${MediaQueries.mbDown} {
412
+ margin-bottom: 12px;
413
+ }
414
+ }
415
+ `;
416
+
417
+ var img$1 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cg stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' clip-path='url(%23a)'%3e%3cpath d='M2 4.008h12m-8.667 0V2.675a1.333 1.333 0 0 1 1.334-1.333h2.666a1.333 1.333 0 0 1 1.334 1.333v1.333m2 0v9.334a1.333 1.333 0 0 1-1.334 1.333H4.667a1.333 1.333 0 0 1-1.334-1.333V4.008zm-6 3.334v4m2.666-4v4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='a'%3e%3cpath fill='white' d='M0 .008h16v16H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
418
+ var IconDelete = img$1;
419
+
420
+ const CardReplyPopover = ({ onDeleteComment, commentId, className = '', popoverClassName = '', }) => {
421
+ const { data: { env: { isMarryBaby }, locale, }, action: { pushNotifications }, } = useContext(TogetherComponentGlobalContext);
422
+ const { t } = useTranslations();
423
+ const [isOpenLeavePopup, setIsOpenLeavePopup] = useState(false);
424
+ const { authActionWrapper } = useTogetherAuthRequiredAction();
425
+ return (React__default.createElement("div", { className: className, onClick: (e) => {
426
+ e.preventDefault();
427
+ e.stopPropagation();
428
+ } },
429
+ isOpenLeavePopup && (React__default.createElement(PopupDanger, { thumbnail: IconDelete, isThumbnailIcon: true, title: t('popup.deleteComment.title'), description: t('popup.deleteComment.description'), acceptText: t('popup.deletePost.accept'), cancelText: t('popup.deletePost.cancel'), onAccept: () => __awaiter(void 0, void 0, void 0, function* () {
430
+ var _a;
431
+ if (!commentId)
432
+ return;
433
+ const res = yield deleteComment({ id: commentId, locale });
434
+ if ((res === null || res === void 0 ? void 0 : res.status) === 1) {
435
+ onDeleteComment && onDeleteComment();
436
+ pushNotifications({
437
+ title: '',
438
+ message: t('notification.success'),
439
+ type: 'success',
440
+ });
441
+ }
442
+ else {
443
+ pushNotifications({
444
+ title: '',
445
+ message: ((_a = res === null || res === void 0 ? void 0 : res.messages) === null || _a === void 0 ? void 0 : _a[0]) || t('notification.failure'),
446
+ type: 'danger',
447
+ });
448
+ }
449
+ }), onClose: () => setIsOpenLeavePopup(false) })),
450
+ React__default.createElement(TreePopoverMenu, { position: "bottom", align: "end", data: {
451
+ isShowheader: false,
452
+ type: 'list',
453
+ list: [
454
+ // {
455
+ // icon: _href('/svg/icon-share-on-media.svg'),
456
+ // label: f({ id: 'morePopover.share' }),
457
+ // subTree: {
458
+ // title: f({ id: 'morePopover.shareOn' }),
459
+ // isShowheader: true,
460
+ // type: 'jsx',
461
+ // jsxType: TreeJSXType.share,
462
+ // data: {
463
+ // shareUrl: shareUrl,
464
+ // shareTitle: shareTitle,
465
+ // },
466
+ // },
467
+ // },
468
+ // {
469
+ // icon: _href('/svg/icon-tab-edit-2.svg'),
470
+ // label: f({ id: 'actionPopover.edit' }),
471
+ // onClick: onEditPost,
472
+ // },
473
+ {
474
+ icon: IconTrashBin,
475
+ label: t('actionPopover.delete'),
476
+ onClick: () => {
477
+ authActionWrapper(() => {
478
+ setIsOpenLeavePopup(true);
479
+ });
480
+ },
481
+ },
482
+ ],
483
+ }, className: popoverClassName, toggleButtonContent: React__default.createElement("img", { src: isMarryBaby ? MBMoreSolid : IconKebab, loading: "lazy" }), buttonProps: {
484
+ // isLoading: loading,
485
+ } })));
486
+ };
487
+
488
+ const StyledContainer$1 = styled.div `
489
+ .add-link {
490
+ color: ${theme.colors.primaryBase};
491
+ }
492
+ `;
493
+ const StyledAlertTag = styled.div `
494
+ margin: 16px 0;
495
+ background: ${theme.colors.yellow50};
496
+ padding: 5px 10px;
497
+ border-radius: 2px;
498
+
499
+ .icon {
500
+ display: inline-block;
501
+ vertical-align: middle;
502
+ margin-right: 6px;
503
+ }
504
+ `;
505
+ const StyledSourceItemWrapper = styled.div `
506
+ display: flex;
507
+ align-items: center;
508
+ gap: 8px;
509
+ `;
510
+ const StyledListItems$1 = styled.div `
511
+ padding: 8px 16px;
512
+ `;
513
+ const StyledInputWrapper = styled.div `
514
+ margin-bottom: 12px;
515
+ width: 100%;
516
+ `;
517
+
518
+ const StyledContainer = styled.div ``;
519
+ const StyledHeader = styled.div `
520
+ margin-bottom: 16px;
521
+ `;
522
+ const StyledListItems = styled.div `
523
+ display: flex;
524
+ flex-wrap: wrap;
525
+ row-gap: 16px;
526
+ ${MediaQueries.tdUp} {
527
+ align-items: center;
528
+ column-gap: 24px;
529
+ }
530
+ `;
531
+ const StyledItem$1 = styled.a `
532
+ display: flex;
533
+ align-items: center;
534
+ gap: 16px;
535
+ ${MediaQueries.mbDown} {
536
+ width: 100%;
537
+ justify-content: space-between;
538
+ }
539
+ `;
540
+ const StyledItemInfo = styled.div `
541
+ display: flex;
542
+ align-items: center;
543
+ gap: 16px;
544
+ `;
545
+ const StyledThumb = styled.div `
546
+ border-radius: ${theme.borderRadius};
547
+ overflow: hidden;
548
+ width: 48px;
549
+ height: 48px;
550
+ img {
551
+ object-fit: cover;
552
+ width: 100%;
553
+ height: 100%;
554
+ }
555
+ `;
556
+
557
+ const RecommentCategories = ({ categories }) => {
558
+ const { t } = useTranslations();
559
+ const { data: { locale, env: { isMarryBaby }, }, } = useContext(TogetherComponentGlobalContext);
560
+ const url = getCurrentBaseUrl(locale, isMarryBaby);
561
+ return (React__default.createElement(StyledContainer, null,
562
+ React__default.createElement(StyledHeader, null,
563
+ React__default.createElement(Heading, { tag: "h6", as: "h5" }, t('cardReply.recommentCategories.heading'))),
564
+ React__default.createElement(StyledListItems, null, categories.map((i) => (React__default.createElement(StyledItem$1, { href: url + i.permalink, key: String(i.termId), target: "_blank" },
565
+ React__default.createElement(StyledItemInfo, null,
566
+ React__default.createElement(StyledThumb, null,
567
+ React__default.createElement("img", { src: i.featureImage ||
568
+ CommonGAssets.getAssetPath(isMarryBaby ? 'mb-logo.svg' : '/logo/logomark.png'), alt: i.displayName, loading: "lazy" })),
569
+ React__default.createElement(Text, { size: "s3", weight: "bold" }, i.displayName)),
570
+ React__default.createElement(ArrowRight, { size: 20, color: theme.colors.gray400 })))))));
571
+ };
572
+
573
+ const StyledItem = styled.a `
574
+ padding: 12px 0;
575
+ display: flex;
576
+ flex-direction: column;
577
+ gap: 8px;
578
+ border-top: 1px solid ${theme.colors.neutral100};
579
+ text-decoration: none;
580
+
581
+ &:first-child {
582
+ border-top: 0;
583
+ }
584
+ `;
585
+
586
+ const SourceItem = ({ postTitle, articleReviewed, modifiedTime, href, }) => {
587
+ const { t } = useTranslations();
588
+ const getDetail = (() => {
589
+ const { expert, editor, is_author } = articleReviewed;
590
+ if (expert) {
591
+ const result = {
592
+ name: expert.display_name,
593
+ role: 'expert',
594
+ avatar: expert.avatar,
595
+ };
596
+ if (is_author) {
597
+ return Object.assign({ title: t('articleAuthor.title.written-by') }, result);
598
+ }
599
+ else {
600
+ if (expert.role === 'expert') {
601
+ // Is Expert
602
+ return Object.assign({ title: t('articleAuthor.title.expert') }, result);
603
+ }
604
+ else {
605
+ // Is medical
606
+ return Object.assign({ title: t('articleAuthor.title.medical') }, result);
607
+ }
608
+ }
609
+ }
610
+ else if (editor) {
611
+ return {
612
+ title: t('articleAuthor.title.fact-check'),
613
+ name: editor.display_name,
614
+ avatar: editor.avatar,
615
+ };
616
+ }
617
+ })();
618
+ return (React__default.createElement(StyledItem, { href: href, title: postTitle, target: "_blank" },
619
+ React__default.createElement(Text, { size: "s3", as: "h5", weight: "bold" }, postTitle),
620
+ React__default.createElement("div", null,
621
+ React__default.createElement(CardAuthor, { avatar: getDetail === null || getDetail === void 0 ? void 0 : getDetail.avatar, avatarProps: {
622
+ size: 32,
623
+ }, name: getDetail === null || getDetail === void 0 ? void 0 : getDetail.name, role: getDetail === null || getDetail === void 0 ? void 0 : getDetail.role, hideBackground: true },
624
+ React__default.createElement(CardAuthor.SubTextRow, null,
625
+ React__default.createElement(CardAuthor.SubText, null, getDetail === null || getDetail === void 0 ? void 0 :
626
+ getDetail.title,
627
+ ' ',
628
+ React__default.createElement("span", { style: { color: theme.colors.gray800 } }, getDetail === null || getDetail === void 0 ? void 0 : getDetail.name)),
629
+ React__default.createElement(CardAuthor.SubDivider, null),
630
+ React__default.createElement(CardAuthor.SubText, null, modifiedTime))))));
631
+ };
632
+
633
+ var styles$1 = {"accordion":"CnNZq8D","header":"F4mmgSy","heading":"_8jLruY3","headingIcon":"FE8w-fe","panel":"Yd2a9Nj","chevron":"A7QrQ7A"};
634
+
635
+ const SourceList = (_a) => {
636
+ var { listUrl: listUrlInit, hideSourceList, categorySlug, editMode, collapseSource, onListChange, isMarryBaby } = _a, rest = __rest(_a, ["listUrl", "hideSourceList", "categorySlug", "editMode", "collapseSource", "onListChange", "isMarryBaby"]);
637
+ const { t } = useTranslations();
638
+ const [listUrl, setListUrl] = useState(listUrlInit || []);
639
+ const [data, setData] = useState([]);
640
+ const [categories, setCategories] = useState([]);
641
+ const [loading, setLoading] = useState(false);
642
+ useEffect(() => {
643
+ !hideSourceList &&
644
+ (() => __awaiter(void 0, void 0, void 0, function* () {
645
+ setLoading(true);
646
+ const listPaths = listUrl.map((i) => {
647
+ const url = new URL(i);
648
+ const pathArr = String(url.pathname)
649
+ .split('/')
650
+ .filter((i) => i != '');
651
+ const origin = url.origin;
652
+ const isMarrySite = origin.search('marrybaby.vn') !== -1;
653
+ return {
654
+ isMarrySite,
655
+ path: pathArr[pathArr.length - 1],
656
+ href: i,
657
+ };
658
+ });
659
+ const listApi = [
660
+ ...listPaths.map((i) => callApi(i.isMarrySite
661
+ ? getMarryBabyApiPath(DISCOVER_PATHS.GET_PREVIEW_ARTICLE, {
662
+ fullSlug: i.path,
663
+ }, true)
664
+ : getDiscoverApiPath(DISCOVER_PATHS.GET_PREVIEW_ARTICLE, {
665
+ fullSlug: i.path,
666
+ }, true), 'GET')),
667
+ ];
668
+ const res = yield Promise.all(listApi);
669
+ setData(res
670
+ .map((i, index) => {
671
+ var _a, _b;
672
+ return ((_a = i === null || i === void 0 ? void 0 : i.data) === null || _a === void 0 ? void 0 : _a.post) && Object.assign(Object.assign({}, formatArticle((_b = i === null || i === void 0 ? void 0 : i.data) === null || _b === void 0 ? void 0 : _b.post)), { href: listPaths[index].href });
673
+ })
674
+ .filter(Boolean));
675
+ setLoading(false);
676
+ }))();
677
+ }, []);
678
+ useEffect(() => {
679
+ !hideSourceList &&
680
+ (data === null || data === void 0 ? void 0 : data.length) === 0 &&
681
+ categorySlug &&
682
+ (() => __awaiter(void 0, void 0, void 0, function* () {
683
+ var _a;
684
+ const res = yield callApi(isMarryBaby
685
+ ? getMarryBabyApiPath(DISCOVER_PATHS.GET_CATEGORY_OR_ARTICLE_DETAIL, {
686
+ fullSlug: categorySlug,
687
+ }, true)
688
+ : getDiscoverApiPath(DISCOVER_PATHS.GET_CATEGORY_OR_ARTICLE_DETAIL, {
689
+ fullSlug: categorySlug,
690
+ }, true), 'GET');
691
+ (res === null || res === void 0 ? void 0 : res.data) && setCategories([formatCategory((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.category)]);
692
+ }))();
693
+ }, [data]);
694
+ const handleRemoveItem = (idx) => {
695
+ setListUrl((old) => {
696
+ const tmp = [...old];
697
+ tmp.splice(idx, 1);
698
+ return tmp;
699
+ });
700
+ setData((old) => {
701
+ const tmp = [...old];
702
+ tmp.splice(idx, 1);
703
+ return tmp;
704
+ });
705
+ };
706
+ useEffect(() => {
707
+ onListChange === null || onListChange === void 0 ? void 0 : onListChange(listUrl);
708
+ }, [listUrl]);
709
+ return (React__default.createElement("div", Object.assign({}, rest),
710
+ !editMode && (React__default.createElement(StyledAlertTag, null,
711
+ React__default.createElement("img", { className: "icon", src: CommonGAssets.getAssetPath('warning.svg'), alt: "warning", style: { marginBottom: '3px', width: '18px' }, loading: "lazy" }),
712
+ React__default.createElement(Text, { size: "s3", as: "span", dangerouslySetInnerHTML: {
713
+ __html: t('cardReply.disclaimer'),
714
+ } }))),
715
+ !hideSourceList ? (loading ? (React__default.createElement(Loading, null)) : data.length > 0 || editMode ? (React__default.createElement(StyledContainer$1, null,
716
+ React__default.createElement(Accordion, { defaultValue: !collapseSource && 'accordion', styles: {
717
+ control: {
718
+ borderRadius: 'inherit',
719
+ '&[aria-expanded="false"]': {
720
+ borderBottom: 0,
721
+ },
722
+ },
723
+ chevron: {
724
+ width: '32px',
725
+ height: '32px',
726
+ },
727
+ content: {
728
+ padding: 0,
729
+ borderBottom: 0,
730
+ borderTop: `1px solid ${theme.colors.neutral100}`,
731
+ },
732
+ item: {
733
+ marginBottom: '16px',
734
+ borderTopLeftRadius: '8px',
735
+ borderTopRightRadius: '8px',
736
+ border: `1px solid ${theme.colors.neutral100}`,
737
+ borderBottomLeftRadius: '8px',
738
+ borderBottomRightRadius: '8px',
739
+ '&[data-active]': {
740
+ borderBottomLeftRadius: 0,
741
+ borderBottomRightRadius: 0,
742
+ },
743
+ },
744
+ }, chevron: React__default.createElement("div", { className: styles$1.chevron },
745
+ React__default.createElement(ArrowDown, { color: theme.colors.gray600, size: 20 })) },
746
+ React__default.createElement(Accordion.Item, { value: "accordion" },
747
+ React__default.createElement(Accordion.Control, null,
748
+ React__default.createElement("div", { className: styles$1.header },
749
+ React__default.createElement(Heading, { as: "h4", tag: "h6" }, t('cardReply.source')))),
750
+ React__default.createElement(Accordion.Panel, null,
751
+ React__default.createElement(StyledListItems$1, null,
752
+ (data || []).map((i, idx) => (React__default.createElement(StyledSourceItemWrapper, { key: String(idx) },
753
+ typeof i === 'object' ? (React__default.createElement(SourceItem, Object.assign({}, i))) : (React__default.createElement(StyledInputWrapper, null,
754
+ React__default.createElement(Input, { style: { width: '100%' }, name: "source-list", value: i || '', size: "sm", onChange: (v) => {
755
+ setListUrl((old) => {
756
+ const tmp = [...old];
757
+ tmp[idx] = v;
758
+ return tmp;
759
+ });
760
+ setData((old) => {
761
+ const tmp = [...old];
762
+ tmp[idx] = v;
763
+ return tmp;
764
+ });
765
+ } }))),
766
+ editMode && (React__default.createElement(Button, { size: "md", color: "transparent", icon: React__default.createElement(Trash, null), onClick: () => handleRemoveItem(idx) }))))),
767
+ editMode && (React__default.createElement(Button, { className: "add-link", color: "transparent", size: "md", icon: React__default.createElement(Plus, { color: theme.colors.primaryBase, size: 18 }), onClick: () => {
768
+ setListUrl((old) => [...old, '']);
769
+ setData((old) => [...old, '']);
770
+ } }, "Add source")))))))) : (React__default.createElement(RecommentCategories, { categories: categories }))) : null));
771
+ };
772
+
773
+ const StyledCardPost = styled.div `
774
+ position: relative;
775
+ margin-bottom: 0;
776
+ background: white;
777
+ border-radius: ${theme.borderRadius};
778
+
779
+ .verify-tag {
780
+ margin-top: 12px;
781
+ }
782
+
783
+ .post-author {
784
+ &.with-popover {
785
+ padding-right: 2.6rem;
786
+ }
787
+ .author-avatar-wrapper {
788
+ width: 40px;
789
+ height: 40px;
790
+ font-size: 20px;
791
+ ${MediaQueries.mbDown} {
792
+ width: 32px;
793
+ height: 32px;
794
+ font-size: 16px;
795
+ }
796
+ }
797
+ }
798
+ .image-preview-wrapper,
799
+ .link-preview-wrapper {
800
+ width: 100%;
801
+ &[data-is-reply='true'] {
802
+ padding-right: 1rem;
803
+ padding-left: 1rem;
804
+ }
805
+ }
806
+ .post-reaction {
807
+ background: none;
808
+ border-radius: 0 0 6px 6px;
809
+ }
810
+ &[data-is-reply='true'] {
811
+ > .post-author .author-avatar-wrapper {
812
+ width: 20px;
813
+ height: 20px;
814
+ font-size: 10px;
815
+ }
816
+ }
817
+ &[data-is-reply='false'] {
818
+ border: 1px solid #e4e8ec;
819
+ }
820
+ .expert-wrapper {
821
+ width: 100%;
822
+ }
823
+ &[data-has-booking='true'] {
824
+ display: grid;
825
+ .post-author {
826
+ background-color: ${theme.colors.primary50};
827
+ }
828
+ .btn-wrapper {
829
+ padding: 0 16px;
830
+ .btn-booking {
831
+ width: 100%;
832
+ margin: 12px 0;
833
+ }
834
+ }
835
+ }
836
+
837
+ .comment-reply-wrapper {
838
+ padding: 0 1rem;
839
+ .more-cmt {
840
+ .chevron-right {
841
+ height: 1rem;
842
+ width: 1rem;
843
+ vertical-align: middle;
844
+ }
845
+ }
846
+ }
847
+ .top-divider {
848
+ border-color: #e4e8ec;
849
+ }
850
+ .popover {
851
+ position: absolute;
852
+ top: 1.5rem;
853
+ right: 1rem;
854
+ .popover-menu__btn {
855
+ display: flex;
856
+ width: 1rem;
857
+ height: 1rem;
858
+ align-items: center;
859
+ justify-content: center;
860
+ padding: 0;
861
+ background: transparent;
862
+
863
+ &:hover {
864
+ background-color: transparent;
865
+ }
866
+
867
+ .popover-menu__content {
868
+ &.--position-bottom {
869
+ &.--align-end {
870
+ &::before {
871
+ right: 12.5px;
872
+ }
873
+ }
874
+ }
875
+ }
876
+ }
877
+ }
878
+
879
+ &[data-is-marrybaby='true'] {
880
+ &[data-is-reply='false'] {
881
+ border: none;
882
+ }
883
+ .image-preview-wrapper,
884
+ .link-preview-wrapper {
885
+ padding-right: 1rem;
886
+ padding-left: 1rem;
887
+ }
888
+ .popover {
889
+ .popover-menu__btn {
890
+ width: 24px;
891
+ height: 24px;
892
+ }
893
+ }
894
+
895
+ margin-left: 56px;
896
+ ${MediaQueries.mbDown} {
897
+ margin-left: 40px;
898
+ }
899
+ > .post-author {
900
+ margin-left: -56px;
901
+ ${MediaQueries.mbDown} {
902
+ margin-left: -40px;
903
+ }
904
+ .author-info {
905
+ align-items: center;
906
+ display: flex;
907
+ align-items: center;
908
+ .author-info-top {
909
+ width: 100%;
910
+ }
911
+ .author-info-text-wrapper {
912
+ justify-content: space-between;
913
+ }
914
+ }
915
+ .author-avatar-wrapper {
916
+ width: 40px;
917
+ height: 40px;
918
+ font-size: 20px;
919
+ ${MediaQueries.mbDown} {
920
+ width: 24px;
921
+ height: 24px;
922
+ font-size: 12px;
923
+ }
924
+ }
925
+ }
926
+ &[data-is-reply] {
927
+ > .post-author {
928
+ .author-avatar-wrapper {
929
+ width: 40px;
930
+ height: 40px;
931
+ font-size: 20px;
932
+ ${MediaQueries.mbDown} {
933
+ width: 24px;
934
+ height: 24px;
935
+ font-size: 12px;
936
+ }
937
+ }
938
+ }
939
+ }
940
+
941
+ .comment-reply-wrapper {
942
+ padding-right: 0;
943
+ padding-left: 0;
944
+ }
945
+ .post-reaction {
946
+ &::after {
947
+ position: absolute;
948
+ bottom: 0;
949
+ left: 50%;
950
+ width: calc(100% - 2rem);
951
+ height: 1px;
952
+ background: #f3f3f3;
953
+ content: ' ';
954
+ transform: translateX(-50%);
955
+ }
956
+ }
957
+ .post-content-wrapper {
958
+ padding-top: 0;
959
+ padding-bottom: 0;
960
+ ${MediaQueries.mbDown} {
961
+ padding-left: 0.5rem;
962
+ }
963
+ }
964
+
965
+ ${MediaQueries.mbDown} {
966
+ margin-bottom: 12px;
967
+ }
968
+ }
969
+ `;
970
+ const StyledSourceList = styled(SourceList) `
971
+ margin-top: 12px;
972
+ padding: 0.5rem 1rem 1rem;
973
+ `;
974
+
975
+ var styles = {"button":"-dzIuHr"};
976
+
977
+ const VerifiedTag = ({ userId, avatar, name, role, title, className, }) => {
978
+ const { t } = useTranslations();
979
+ const [openPopup, setOpenPopup] = useState(false);
980
+ return (React__default.createElement(React__default.Fragment, null,
981
+ React__default.createElement(Button, { className: `${styles.button} ${className}`, color: "success", size: "xs", onClick: () => setOpenPopup(true), style: {
982
+ padding: '5px 8px',
983
+ marginBottom: '12px',
984
+ borderRadius: '4px',
985
+ } },
986
+ React__default.createElement("span", { className: "text" },
987
+ React__default.createElement(Endorse, { isSolid: true, size: 18, color: theme.colors.green800, className: "icon" }),
988
+ t('cardReply.verifyBy', {
989
+ name: `${name || ''}`,
990
+ }))),
991
+ React__default.createElement(ProfileDetailModal, { open: openPopup, onClose: () => setOpenPopup(false), profileModalProps: { zIndex: 1000 } },
992
+ React__default.createElement(ProfileDetail, { authorProps: {
993
+ userId,
994
+ avatar: avatar,
995
+ name,
996
+ role,
997
+ title,
998
+ }, hideQuestionTab: true }))));
999
+ };
1000
+
1001
+ var img = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%232D87F3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 12 4-4-4-4'/%3e%3c/svg%3e";
1002
+ var ChevronRightActive = img;
1003
+
1004
+ const COMMENT_LIMIT = 4;
1005
+ const CardReply = ({ className, style, comment: CommentProps, type = 'comment', level = 0, replyingId, onPostCommentSuccess, post, onDeleteComment, refetchComment, hasQuickBookingEnable, handleMakeAppointment, cardAuthorProps, maxChars = 600, disableShortenContent, }) => {
1006
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
1007
+ const { data: { locale, userInfo, env: { isMarryBaby }, }, } = useContext(TogetherComponentGlobalContext);
1008
+ const { t } = useTranslations();
1009
+ const [comment, setComment] = useState(CommentProps || null);
1010
+ const { id, countLikes, content, replies = [], images = [], author, liked, link, mentionedUser, mentions, } = comment;
1011
+ const { text, replyingTo } = decodeCommentBody(content);
1012
+ const { authActionWrapper } = useTogetherAuthRequiredAction({
1013
+ _joinCommunityIds: [(_a = post === null || post === void 0 ? void 0 : post.community) === null || _a === void 0 ? void 0 : _a.id],
1014
+ _joinTopicIds: (_b = post === null || post === void 0 ? void 0 : post.topics) === null || _b === void 0 ? void 0 : _b.map((t) => t.id),
1015
+ });
1016
+ const [maxRepliesShow, setMaxRepliesShow] = useState(COMMENT_LIMIT);
1017
+ const isCommented = (userInfo === null || userInfo === void 0 ? void 0 : userInfo.id)
1018
+ ? replies === null || replies === void 0 ? void 0 : replies.some((c) => c.author.id === userInfo.id)
1019
+ : false;
1020
+ const addNewReply = (comment) => {
1021
+ setComment((old) => {
1022
+ // somehow this set state run twice
1023
+ // => we need to check unique comment id before add to array
1024
+ if (!old.replies.find((c) => c.id === comment.id)) {
1025
+ old.replies.unshift(comment);
1026
+ const newComment = Object.assign(Object.assign({}, old), { replies: old.replies.slice(), countReplies: old.countReplies + 1 });
1027
+ refetchComment && refetchComment(newComment);
1028
+ return newComment;
1029
+ }
1030
+ return old;
1031
+ });
1032
+ };
1033
+ const [showInputComment, setShowInputComment] = useState(false);
1034
+ const sortedReplies = useMemo(() => {
1035
+ if (type !== 'comment' || !replies || replies.length == 0)
1036
+ return replies;
1037
+ return replies.sort((a, b) => {
1038
+ const timeA = new Date(a.createdAt).getTime();
1039
+ const timeB = new Date(b.createdAt).getTime();
1040
+ if (timeA > timeB)
1041
+ return -1;
1042
+ if (timeA < timeB)
1043
+ return 1;
1044
+ return 0;
1045
+ });
1046
+ }, [type, replies]);
1047
+ const mergeCountReplies = (replies === null || replies === void 0 ? void 0 : replies.length) || 0;
1048
+ const hasPopover = String(author === null || author === void 0 ? void 0 : author.email) &&
1049
+ (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) &&
1050
+ String(author === null || author === void 0 ? void 0 : author.email) === String(userInfo === null || userInfo === void 0 ? void 0 : userInfo.email);
1051
+ // const isAnonymousOfCurAuthor =
1052
+ // post?.isAnonymous && post?.author?.username === author?.username
1053
+ // const name = isAnonymousOfCurAuthor
1054
+ // ? t('cardPost.anonymous')
1055
+ // : author?.name || author?.username || ''
1056
+ // const avatar = isAnonymousOfCurAuthor ? DEFAULT_AVATAR_IMG : author?.avatar
1057
+ // const username = isAnonymousOfCurAuthor
1058
+ // ? t('cardPost.anonymous')
1059
+ // : author?.username || author?.name || ''
1060
+ const name = (author === null || author === void 0 ? void 0 : author.name) || (author === null || author === void 0 ? void 0 : author.username) || '';
1061
+ const username = (author === null || author === void 0 ? void 0 : author.username) || (author === null || author === void 0 ? void 0 : author.name) || '';
1062
+ const avatar = author === null || author === void 0 ? void 0 : author.avatar;
1063
+ const authorRole = (post === null || post === void 0 ? void 0 : post.isAnonymous) ? undefined : author === null || author === void 0 ? void 0 : author.role;
1064
+ const listMentions = [
1065
+ ...((post === null || post === void 0 ? void 0 : post.isAnonymous)
1066
+ ? [
1067
+ {
1068
+ id: ((_c = post === null || post === void 0 ? void 0 : post.author) === null || _c === void 0 ? void 0 : _c.id) || 0,
1069
+ name: t('cardPost.anonymous'),
1070
+ },
1071
+ ]
1072
+ : []),
1073
+ ...(mentions || []),
1074
+ ];
1075
+ const [hospitalInfo, setHospitalInfo] = useState(null);
1076
+ const [doctorInfo, setDoctorInfo] = useState(null);
1077
+ useEffect(() => {
1078
+ if (author === null || author === void 0 ? void 0 : author.hospitalId) {
1079
+ const fetchHospitalDetail = (hospitalId) => __awaiter(void 0, void 0, void 0, function* () {
1080
+ var _a;
1081
+ const response = yield callApi(getCarePath(CARE_PATHS.GET_HOSPITAL_INFO, {
1082
+ hospital_branch_id: hospitalId,
1083
+ website_url: domainLocales[locale],
1084
+ }), 'get');
1085
+ if ((_a = response === null || response === void 0 ? void 0 : response._data) === null || _a === void 0 ? void 0 : _a.branch) {
1086
+ setHospitalInfo(response === null || response === void 0 ? void 0 : response._data.branch);
1087
+ }
1088
+ });
1089
+ fetchHospitalDetail(author.hospitalId);
1090
+ }
1091
+ if (author === null || author === void 0 ? void 0 : author.doctorId) {
1092
+ const fetchDoctorDetail = (doctorId) => __awaiter(void 0, void 0, void 0, function* () {
1093
+ var _b;
1094
+ const response = yield callApi(getCarePath(CARE_PATHS.GET_DOCTOR_INFO, {
1095
+ doctorId: doctorId,
1096
+ website_url: domainLocales[locale],
1097
+ }), 'get');
1098
+ if ((_b = response === null || response === void 0 ? void 0 : response._data) === null || _b === void 0 ? void 0 : _b.doctor) {
1099
+ setDoctorInfo(response === null || response === void 0 ? void 0 : response._data.doctor);
1100
+ }
1101
+ });
1102
+ fetchDoctorDetail(author.doctorId);
1103
+ }
1104
+ }, [author.hospitalId, author.doctorId]);
1105
+ const isDoctorAvailable = (doctorInfo === null || doctorInfo === void 0 ? void 0 : doctorInfo.valid_outpatient) || (doctorInfo === null || doctorInfo === void 0 ? void 0 : doctorInfo.valid_telemedicine);
1106
+ const isHospitalAvailable = ((hospitalInfo === null || hospitalInfo === void 0 ? void 0 : hospitalInfo.total_available_service) ||
1107
+ (hospitalInfo === null || hospitalInfo === void 0 ? void 0 : hospitalInfo.total_available_doctor)) > 0;
1108
+ const hasQuickBooking = hasQuickBookingEnable && (isDoctorAvailable || isHospitalAvailable);
1109
+ const isChatbotAuthor = ((_d = comment === null || comment === void 0 ? void 0 : comment.author) === null || _d === void 0 ? void 0 : _d.type) === 'chatbot';
1110
+ return (React__default.createElement(TogetherAuthConfigContextProvider, { defaultParams: {
1111
+ _joinCommunityIds: [(_e = post === null || post === void 0 ? void 0 : post.community) === null || _e === void 0 ? void 0 : _e.id],
1112
+ _joinTopicIds: (_f = post === null || post === void 0 ? void 0 : post.topics) === null || _f === void 0 ? void 0 : _f.map((t) => t.id),
1113
+ } },
1114
+ React__default.createElement(StyledCardPost, { className: className, style: style, "data-is-reply": !!level, "data-is-marrybaby": isMarryBaby, "data-has-booking": hasQuickBooking },
1115
+ type === 'reply' && React__default.createElement(Divider, { className: "top-divider", type: "solid" }),
1116
+ React__default.createElement("div", { style: { padding: '16px 16px 0' } },
1117
+ React__default.createElement(CardAuthor, Object.assign({ avatar: avatar, name: name, username: username, timeText: post === null || post === void 0 ? void 0 : post.createdTime, community: post === null || post === void 0 ? void 0 : post.community,
1118
+ // miniIcon="./svg/icon-tag.svg"
1119
+ // authorLabelType={getAuthorLabelFromRoles(author?.role || [])}
1120
+ className: `post-author ${hasPopover ? 'with-popover' : ''}`, type: type, userId: author === null || author === void 0 ? void 0 : author.id, role: authorRole, expertId: author === null || author === void 0 ? void 0 : author.partnerId, title: author === null || author === void 0 ? void 0 : author.title, doctorId: author === null || author === void 0 ? void 0 : author.doctorId, hospitalId: author === null || author === void 0 ? void 0 : author.hospitalId, hasQuickBooking: hasQuickBooking, handleMakeAppointment: handleMakeAppointment, isAnonymous: (comment === null || comment === void 0 ? void 0 : comment.isAnonymous) ||
1121
+ (Boolean(post === null || post === void 0 ? void 0 : post.isAnonymous) &&
1122
+ ((_g = post === null || post === void 0 ? void 0 : post.author) === null || _g === void 0 ? void 0 : _g.username) === (author === null || author === void 0 ? void 0 : author.username)), hideBackground: isChatbotAuthor, userType: author === null || author === void 0 ? void 0 : author.type }, cardAuthorProps)),
1123
+ Boolean(comment === null || comment === void 0 ? void 0 : comment.isVerify) && !Boolean(comment === null || comment === void 0 ? void 0 : comment.isOppose) && (React__default.createElement(VerifiedTag, { title: (_h = comment === null || comment === void 0 ? void 0 : comment.userVerify) === null || _h === void 0 ? void 0 : _h.title, name: (_j = comment === null || comment === void 0 ? void 0 : comment.userVerify) === null || _j === void 0 ? void 0 : _j.name, userId: (_k = comment === null || comment === void 0 ? void 0 : comment.userVerify) === null || _k === void 0 ? void 0 : _k.id, role: (_l = comment === null || comment === void 0 ? void 0 : comment.userVerify) === null || _l === void 0 ? void 0 : _l.role, avatar: (_m = comment === null || comment === void 0 ? void 0 : comment.userVerify) === null || _m === void 0 ? void 0 : _m.avatar, className: "verify-tag" }))),
1124
+ React__default.createElement(PostContent, { className: "post-content-wrapper", replyingTo: replyingTo, mentionedUser: mentionedUser, description: text, mentions: listMentions, maxChars: maxChars, disableShortenContent: disableShortenContent }),
1125
+ React__default.createElement("span", null),
1126
+ React__default.createElement("span", null),
1127
+ images && images.length > 0 ? (React__default.createElement("div", { key: "image-preview", className: "image-preview-wrapper", "data-is-reply": true },
1128
+ React__default.createElement(PostImagePreview, { images: images, authorName: author === null || author === void 0 ? void 0 : author.username }))) : null,
1129
+ (!images || images.length === 0) && link ? (React__default.createElement("div", { key: "link-preview", className: "link-preview-wrapper", "data-is-reply": true },
1130
+ React__default.createElement(CardLink, { url: link }))) : null,
1131
+ type !== 'most-engaging' ? (React__default.createElement(React__default.Fragment, null,
1132
+ isChatbotAuthor && (React__default.createElement(StyledSourceList, { listUrl: comment === null || comment === void 0 ? void 0 : comment.source, categorySlug: comment === null || comment === void 0 ? void 0 : comment.categorySlug })),
1133
+ React__default.createElement(CardReactions, { type: CardReactionType.reply, loveCount: countLikes, replyCount: mergeCountReplies, className: "post-reaction", liked: liked, isReplied: isCommented, hideCommentIcon: type === 'reply' || isChatbotAuthor, hasShare: false, onCommentClick: () => authActionWrapper(() => setShowInputComment((v) => !v)), onCommentCountClick: () => authActionWrapper(() => {
1134
+ setShowInputComment(true);
1135
+ }), onLikeClick: () => authActionWrapper(() => __awaiter(void 0, void 0, void 0, function* () {
1136
+ if (id) {
1137
+ const res = yield likeUnlikeComment({
1138
+ commentId: id,
1139
+ setLike: !liked,
1140
+ locale,
1141
+ });
1142
+ if (res.status === 1) {
1143
+ setComment((old) => {
1144
+ return Object.assign(Object.assign({}, old), { liked: !liked, countLikes: old.countLikes + (!liked ? 1 : -1) });
1145
+ });
1146
+ }
1147
+ }
1148
+ })) }),
1149
+ showInputComment && (React__default.createElement(InputCommentBar, { replyingId: replyingId || comment.id, replyToName: name, isReply: true, onClose: () => setShowInputComment(false), onPostSuccess: (comment) => {
1150
+ if (type === 'reply') {
1151
+ onPostCommentSuccess && onPostCommentSuccess(comment);
1152
+ }
1153
+ else {
1154
+ addNewReply(comment);
1155
+ }
1156
+ }, post: post, replyingUser: author })),
1157
+ type === 'comment' && replies && replies.length > 0 ? (React__default.createElement("div", { className: "comment-reply-wrapper" }, (_o = sortedReplies === null || sortedReplies === void 0 ? void 0 : sortedReplies.slice(0, maxRepliesShow)) === null || _o === void 0 ? void 0 :
1158
+ _o.map((reply) => (React__default.createElement(CardReply, { key: reply.id, comment: reply, type: "reply", className: "comment-reply-item", level: level + 1, replyingId: id, onPostCommentSuccess: addNewReply, post: post, onDeleteComment: () => {
1159
+ setComment((old) => {
1160
+ return Object.assign(Object.assign({}, old), { replies: old.replies.filter((r) => r.id !== reply.id), countReplies: old.countReplies - 1 });
1161
+ });
1162
+ }, handleMakeAppointment: handleMakeAppointment, hasQuickBookingEnable: hasQuickBookingEnable }))),
1163
+ mergeCountReplies > maxRepliesShow && (React__default.createElement(React__default.Fragment, null,
1164
+ React__default.createElement(Divider, { className: "top-divider", type: "solid" }),
1165
+ React__default.createElement(Button, { className: "more-cmt", size: "lg", color: "ghost", onClick: () => setMaxRepliesShow((m) => m + COMMENT_LIMIT) },
1166
+ t('comment.seeMoreReplies', {
1167
+ count: mergeCountReplies - maxRepliesShow,
1168
+ }),
1169
+ React__default.createElement("img", { className: "chevron-right", src: ChevronRightActive, loading: "lazy" })))))) : null)) : null,
1170
+ hasPopover && (React__default.createElement(CardReplyPopover, { onDeleteComment: onDeleteComment, className: "popover", commentId: comment.id })))));
1171
+ };
1172
+
1173
+ const getMostEngagingComment = (postId, locale) => __awaiter(void 0, void 0, void 0, function* () {
1174
+ var _a, _b, _c;
1175
+ const commentsRes = yield callApiWithOptionalAuth(getApiPath(PATHS.COMMENT.LIST, {
1176
+ postId: postId,
1177
+ _locale: locale,
1178
+ sort: 'popularity',
1179
+ perPage: 1,
1180
+ withoutReply: 1,
1181
+ }), 'GET');
1182
+ return (_c = (_b = (_a = commentsRes === null || commentsRes === void 0 ? void 0 : commentsRes.data) === null || _a === void 0 ? void 0 : _a.comments) === null || _b === void 0 ? void 0 : _b.map(formatComment)) === null || _c === void 0 ? void 0 : _c[0];
1183
+ });
1184
+ const CardPost = ({ className, style, hideViewMoreComment, showMostEngaging, onCommentClick, onCommentCountClick, onMostEngagingCommentClick, onPostCommentSuccess: onPostCommentSuccessProp, disableCardLink, disableShortenContent, onDeletePost, onEditPost, post: postProp, mostEngagingComment: mostEngagingCommentProp, onDeleteComment: onDeleteCommentProp, showInputComment: propsShowInputComment, InlineCommentsComponent, hasQuickBookingEnable, handleMakeAppointment, cardAuthorProps, }) => {
1185
+ const [post, setPost] = useState(postProp);
1186
+ const [isOpenSharePopup, setIsOpenSharePopup] = useState(false);
1187
+ const [mostEngagingComment, setMostEngagingComment] = useState(mostEngagingCommentProp);
1188
+ const { community, topics, author, slug, isPin, liked, photos, mentions, title, description, previewUrl, likesCount, commentsCount, id, commented, } = post;
1189
+ const { data: { locale, env: { isMarryBaby, togetherBasePath }, }, action: { pushNotifications }, } = useContext(TogetherComponentGlobalContext);
1190
+ const { t } = useTranslations();
1191
+ const [showInputComment, setShowInputComment] = useState(propsShowInputComment);
1192
+ const postRelativeHref = `${togetherBasePath}/${(community === null || community === void 0 ? void 0 : community.slug) || '_'}/${slug || ''}`;
1193
+ const postHref = `${getCurrentBaseUrl$1(locale)}${postRelativeHref}`;
1194
+ const { authActionWrapper } = useTogetherAuthRequiredAction((community === null || community === void 0 ? void 0 : community.slug)
1195
+ ? {
1196
+ _joinCommunityIds: [community.id],
1197
+ _joinTopicIds: topics === null || topics === void 0 ? void 0 : topics.map((t) => t.id),
1198
+ // _location: postHref,
1199
+ }
1200
+ : undefined);
1201
+ const [isLikeLoading, setIsLikeLoading] = useState(false);
1202
+ useEffect(() => {
1203
+ setShowInputComment(propsShowInputComment);
1204
+ }, [propsShowInputComment]);
1205
+ const name = (author === null || author === void 0 ? void 0 : author.name) || (author === null || author === void 0 ? void 0 : author.username) || '';
1206
+ const username = (author === null || author === void 0 ? void 0 : author.username) || (author === null || author === void 0 ? void 0 : author.name) || '';
1207
+ const avatar = author === null || author === void 0 ? void 0 : author.avatar;
1208
+ const authorRole = (post === null || post === void 0 ? void 0 : post.isAnonymous) ? undefined : author === null || author === void 0 ? void 0 : author.role;
1209
+ const [hospitalInfo, setHospitalInfo] = useState(null);
1210
+ const [doctorInfo, setDoctorInfo] = useState(null);
1211
+ useEffect(() => {
1212
+ if (author === null || author === void 0 ? void 0 : author.hospitalId) {
1213
+ const fetchHospitalDetail = (hospitalId) => __awaiter(void 0, void 0, void 0, function* () {
1214
+ var _a;
1215
+ const response = yield callApi(getCarePath(CARE_PATHS.GET_HOSPITAL_INFO, {
1216
+ hospital_branch_id: hospitalId,
1217
+ website_url: domainLocales$1[locale],
1218
+ }), 'get');
1219
+ if ((_a = response === null || response === void 0 ? void 0 : response._data) === null || _a === void 0 ? void 0 : _a.branch) {
1220
+ setHospitalInfo(response === null || response === void 0 ? void 0 : response._data.branch);
1221
+ }
1222
+ });
1223
+ fetchHospitalDetail(author.hospitalId);
1224
+ }
1225
+ if (author === null || author === void 0 ? void 0 : author.doctorId) {
1226
+ const fetchDoctorDetail = (doctorId) => __awaiter(void 0, void 0, void 0, function* () {
1227
+ var _b;
1228
+ const response = yield callApi(getCarePath(CARE_PATHS.GET_DOCTOR_INFO, {
1229
+ doctorId: doctorId,
1230
+ website_url: domainLocales$1[locale],
1231
+ }), 'get');
1232
+ if ((_b = response === null || response === void 0 ? void 0 : response._data) === null || _b === void 0 ? void 0 : _b.doctor) {
1233
+ setDoctorInfo(response === null || response === void 0 ? void 0 : response._data.doctor);
1234
+ }
1235
+ });
1236
+ fetchDoctorDetail(author.doctorId);
1237
+ }
1238
+ }, [author.hospitalId, author.doctorId]);
1239
+ const isDoctorAvailable = (doctorInfo === null || doctorInfo === void 0 ? void 0 : doctorInfo.valid_outpatient) || (doctorInfo === null || doctorInfo === void 0 ? void 0 : doctorInfo.valid_telemedicine);
1240
+ const isHospitalAvailable = ((hospitalInfo === null || hospitalInfo === void 0 ? void 0 : hospitalInfo.total_available_service) ||
1241
+ (hospitalInfo === null || hospitalInfo === void 0 ? void 0 : hospitalInfo.total_available_doctor)) > 0;
1242
+ const hasQuickBooking = hasQuickBookingEnable && (isDoctorAvailable || isHospitalAvailable);
1243
+ useEffect(() => {
1244
+ (() => __awaiter(void 0, void 0, void 0, function* () {
1245
+ if (id &&
1246
+ commentsCount &&
1247
+ showMostEngaging &&
1248
+ !(mostEngagingCommentProp === null || mostEngagingCommentProp === void 0 ? void 0 : mostEngagingCommentProp.id)) {
1249
+ const comment = yield getMostEngagingComment(id, locale);
1250
+ setMostEngagingComment(comment);
1251
+ }
1252
+ }))();
1253
+ }, [id, locale, commentsCount, showMostEngaging, mostEngagingCommentProp === null || mostEngagingCommentProp === void 0 ? void 0 : mostEngagingCommentProp.id]);
1254
+ useEffect(() => {
1255
+ setMostEngagingComment(mostEngagingCommentProp);
1256
+ }, [mostEngagingCommentProp === null || mostEngagingCommentProp === void 0 ? void 0 : mostEngagingCommentProp.id]);
1257
+ const onPostCommentSuccess = (comment) => {
1258
+ if (commentsCount === 0 && !(mostEngagingComment === null || mostEngagingComment === void 0 ? void 0 : mostEngagingComment.id)) {
1259
+ setMostEngagingComment(comment);
1260
+ }
1261
+ setPost((p) => (Object.assign(Object.assign({}, p), { commentsCount: p.commentsCount + 1, commented: true })));
1262
+ onPostCommentSuccessProp && onPostCommentSuccessProp(comment);
1263
+ };
1264
+ const onDeleteComment = (comment) => __awaiter(void 0, void 0, void 0, function* () {
1265
+ if (commentsCount > 1 &&
1266
+ (mostEngagingComment === null || mostEngagingComment === void 0 ? void 0 : mostEngagingComment.id) &&
1267
+ (mostEngagingComment === null || mostEngagingComment === void 0 ? void 0 : mostEngagingComment.id) === (comment === null || comment === void 0 ? void 0 : comment.id)) {
1268
+ const newMostEngaging = yield getMostEngagingComment(id, locale);
1269
+ setMostEngagingComment(newMostEngaging);
1270
+ }
1271
+ setPost((p) => (Object.assign(Object.assign({}, p), { commentsCount: p.commentsCount - 1 })));
1272
+ onDeleteCommentProp && onDeleteCommentProp(comment);
1273
+ });
1274
+ return (React__default.createElement(TogetherAuthConfigContextProvider, { defaultParams: (community === null || community === void 0 ? void 0 : community.slug)
1275
+ ? {
1276
+ _joinCommunityIds: [community.id],
1277
+ _joinTopicIds: topics === null || topics === void 0 ? void 0 : topics.map((t) => t.id),
1278
+ // _location: postHref,
1279
+ }
1280
+ : undefined },
1281
+ isOpenSharePopup && (React__default.createElement(SharePopup, { url: postHref, avatar: DEFAULT_IMG, text: title, onClose: () => setIsOpenSharePopup(false) })),
1282
+ React__default.createElement(StyledCardPost$1, { className: className, style: style, "data-is-marrybaby": isMarryBaby },
1283
+ isPin ? React__default.createElement(LabelPin, { className: "post-pin" }) : null,
1284
+ React__default.createElement("div", { style: { position: 'relative', padding: '1rem 1rem 0' } },
1285
+ React__default.createElement(CardAuthor, Object.assign({ avatar: avatar, name: name, username: username, url: disableCardLink ? undefined : postRelativeHref, community: community,
1286
+ // miniIcon="./svg/icon-tag.svg"
1287
+ timeText: post === null || post === void 0 ? void 0 : post.createdTime, className: "post-author", role: authorRole, userId: author === null || author === void 0 ? void 0 : author.id, expertId: author === null || author === void 0 ? void 0 : author.partnerId, doctorId: author === null || author === void 0 ? void 0 : author.doctorId, hospitalId: author === null || author === void 0 ? void 0 : author.hospitalId, title: author === null || author === void 0 ? void 0 : author.title, hasQuickBooking: hasQuickBooking, handleMakeAppointment: handleMakeAppointment, "data-testid": "name", isAnonymous: !!(post === null || post === void 0 ? void 0 : post.isAnonymous), extendEle: React__default.createElement(CardPostPopoverMore, { authorEmail: String(author === null || author === void 0 ? void 0 : author.email), onDeletePost: onDeletePost, shareUrl: postHref, post: post, className: "popover", onEditPost: onEditPost }) }, cardAuthorProps))),
1288
+ React__default.createElement("a", { href: disableCardLink ? undefined : postRelativeHref, className: "post-content-link-wrapper" },
1289
+ title && (React__default.createElement(Heading, { className: "post-content-title", as: "h2", tag: "h5", fontWeight: "bold", "data-testid": "Title of the Post" }, innertext(title))),
1290
+ React__default.createElement(PostContent, { className: "post-content-wrapper", description: description, disableShortenContent: disableShortenContent, mentions: mentions, "data-testid": "Content of the Post" })),
1291
+ React__default.createElement("span", null),
1292
+ React__default.createElement("span", null),
1293
+ React__default.createElement("div", { key: "tag-topic" }, topics && topics.length > 0 ? (React__default.createElement(TagTopic, { topics: topics, className: "post-topics" })) : null),
1294
+ React__default.createElement("div", { key: "social-preview" }, (post === null || post === void 0 ? void 0 : post.introUrl) ? (React__default.createElement("div", { className: `social-preview-wrapper ${!!(photos === null || photos === void 0 ? void 0 : photos.length) ? 'has-image' : ''}` },
1295
+ React__default.createElement(SocialLinkPreview, { url: post.introUrl, image: post.bannerImage }))) : null),
1296
+ React__default.createElement("div", { key: "image-preview" }, !!(photos === null || photos === void 0 ? void 0 : photos.length) ? (React__default.createElement("div", { className: "image-preview-wrapper" },
1297
+ React__default.createElement(PostImagePreview, { images: photos, authorName: author === null || author === void 0 ? void 0 : author.name }))) : null),
1298
+ React__default.createElement("div", { key: "link-preview" }, !(post === null || post === void 0 ? void 0 : post.introUrl) && !(photos === null || photos === void 0 ? void 0 : photos.length) && (previewUrl === null || previewUrl === void 0 ? void 0 : previewUrl.url) ? (React__default.createElement("div", { className: "link-preview-wrapper" },
1299
+ React__default.createElement(CardLink, { title: previewUrl.title, url: previewUrl.url, image: previewUrl.image }))) : null),
1300
+ React__default.createElement(CardReactions, { isMarryBaby: isMarryBaby, type: CardReactionType.post, loveCount: likesCount, replyCount: commentsCount, className: `post-reaction ${(photos === null || photos === void 0 ? void 0 : photos.length) || (previewUrl === null || previewUrl === void 0 ? void 0 : previewUrl.url) ? 'hide-top-border' : ''}`, liked: isLikeLoading ? !liked : liked, isReplied: commented, onCommentClick: () => authActionWrapper(() => {
1301
+ onCommentClick ? onCommentClick() : setShowInputComment((v) => !v);
1302
+ }), onCommentCountClick: () => {
1303
+ authActionWrapper(() => {
1304
+ isMarryBaby
1305
+ ? setShowInputComment(true)
1306
+ : onCommentCountClick
1307
+ ? onCommentCountClick()
1308
+ : !disableCardLink && (window.location.href = postRelativeHref);
1309
+ });
1310
+ }, onShareClick: () => {
1311
+ setIsOpenSharePopup(true);
1312
+ }, onLikeClick: () => __awaiter(void 0, void 0, void 0, function* () {
1313
+ if (!id || isLikeLoading)
1314
+ return;
1315
+ setIsLikeLoading(true);
1316
+ try {
1317
+ const res = yield likeUnlikePost({
1318
+ id,
1319
+ locale,
1320
+ });
1321
+ if ((res === null || res === void 0 ? void 0 : res.status) !== 1) {
1322
+ pushNotifications(getDefaultFailNoti(t));
1323
+ }
1324
+ else {
1325
+ setPost((p) => (Object.assign(Object.assign({}, p), { likesCount: (p.likesCount || 0) + (!p.liked ? 1 : -1), liked: !p.liked })));
1326
+ }
1327
+ }
1328
+ catch (_a) {
1329
+ pushNotifications(getDefaultFailNoti(t));
1330
+ }
1331
+ setIsLikeLoading(false);
1332
+ }), showingMostEngaging: !!(showMostEngaging && (mostEngagingComment === null || mostEngagingComment === void 0 ? void 0 : mostEngagingComment.id)) }),
1333
+ showInputComment && (React__default.createElement(InputCommentBar, { isMainCmt: !propsShowInputComment, onClose: () => setShowInputComment(false), onPostSuccess: onPostCommentSuccess, post: post })),
1334
+ showMostEngaging && (mostEngagingComment === null || mostEngagingComment === void 0 ? void 0 : mostEngagingComment.id) ? (React__default.createElement("div", { className: "most-engaging-wrapper", onClick: (e) => {
1335
+ if (onMostEngagingCommentClick) {
1336
+ e.stopPropagation();
1337
+ onMostEngagingCommentClick();
1338
+ }
1339
+ else
1340
+ window.location.href = postRelativeHref;
1341
+ } },
1342
+ React__default.createElement(CardReply, { hasQuickBookingEnable: hasQuickBookingEnable, handleMakeAppointment: handleMakeAppointment, comment: mostEngagingComment, post: post, onDeleteComment: () => {
1343
+ onDeleteComment && onDeleteComment(mostEngagingComment);
1344
+ }, className: "most-engaging-comment", type: "most-engaging", key: mostEngagingComment.id, cardAuthorProps: cardAuthorProps }),
1345
+ commentsCount > 1 && !hideViewMoreComment && (React__default.createElement(Button, { className: "see-more-comments", color: "ghost", size: "md" }, t('comment.seeMoreComments', {
1346
+ count: commentsCount - 1,
1347
+ }))))) : null,
1348
+ InlineCommentsComponent)));
1349
+ };
1350
+
1351
+ export { CardPost as C, SourceList as S, VerifiedTag as V, CardPostPopoverMore as a, CardReply as b, CardReplyPopover as c };