@hhgtech/hhg-components 1.29.81 → 1.29.82

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 (353) hide show
  1. package/build/{WhatsApp-82018096.js → WhatsApp-46f4f408.js} +1 -1
  2. package/build/adapters.js +16 -16
  3. package/build/atoms.js +53 -51
  4. package/build/babyGrowth.js +79 -79
  5. package/build/cache.js +3 -3
  6. package/build/care.js +17 -17
  7. package/build/components.js +108 -106
  8. package/build/{constants-3a475a22.js → constants-223c01fc.js} +2 -2
  9. package/build/{constants-dd16fb4d.js → constants-f182fc32.js} +5 -5
  10. package/build/constants.js +3 -3
  11. package/build/{core-9e44ee99.js → core-9d69a722.js} +2 -2
  12. package/build/{dataTransform-c1701cbd.js → dataTransform-ded2692d.js} +1 -1
  13. package/build/{dataTransform-6b4d7a4e.js → dataTransform-e39297c1.js} +3 -3
  14. package/build/ecom.js +5 -5
  15. package/build/esm/{WhatsApp-7d3732e2.js → WhatsApp-c599b715.js} +1 -1
  16. package/build/esm/adapters.js +16 -16
  17. package/build/esm/atoms.js +47 -45
  18. package/build/esm/babyGrowth.js +80 -80
  19. package/build/esm/cache.js +3 -3
  20. package/build/esm/care.js +17 -17
  21. package/build/esm/components.js +79 -77
  22. package/build/esm/{constants-ebf80e5f.js → constants-bb470362.js} +2 -2
  23. package/build/esm/{constants-6bdb97a8.js → constants-fa475b0f.js} +5 -5
  24. package/build/esm/constants.js +3 -3
  25. package/build/esm/{core-c72e0ff5.js → core-80bfe8b7.js} +2 -2
  26. package/build/esm/{dataTransform-6c032113.js → dataTransform-55f67eed.js} +1 -1
  27. package/build/esm/{dataTransform-3e8e25ba.js → dataTransform-623716c3.js} +4 -4
  28. package/build/esm/ecom.js +5 -5
  29. package/build/esm/{fixedBottomAdBlock-13ed4a34.js → fixedBottomAdBlock-60a5d48f.js} +27 -27
  30. package/build/esm/footer.js +18 -18
  31. package/build/esm/gAssets.js +4 -4
  32. package/build/esm/{getDynamicHealthTool-7681e43a.js → getDynamicHealthTool-82855adc.js} +4 -4
  33. package/build/esm/{getSocialList-e8142513.js → getSocialList-7d2cf48d.js} +5 -5
  34. package/build/esm/healthToolsForm.js +24 -24
  35. package/build/esm/hooks.js +17 -17
  36. package/build/esm/i18n.js +2 -2
  37. package/build/esm/i18nV2.js +2 -2
  38. package/build/esm/{index-7cbe2a10.js → index-01405723.js} +12 -12
  39. package/build/esm/{index-8952ceac.js → index-01b5d2e9.js} +4 -4
  40. package/build/esm/{index-88ad2ca3.js → index-02d3f05b.js} +19 -19
  41. package/build/esm/{index-73301602.js → index-046778af.js} +2 -2
  42. package/build/esm/{index-69248434.js → index-049e0270.js} +3 -3
  43. package/build/esm/{index-29d04985.js → index-07f3f47e.js} +2 -2
  44. package/build/esm/index-0b745f46.js +1349 -0
  45. package/build/esm/{index-780a08de.js → index-0ca9b175.js} +2 -2
  46. package/build/esm/{index-2774583d.js → index-0cd3523c.js} +31 -31
  47. package/build/esm/{index-42ad7763.js → index-0ee66974.js} +2 -2
  48. package/build/esm/index-10ab6596.js +489 -0
  49. package/build/esm/{index-cb4afb33.js → index-13d8dd4b.js} +6 -6
  50. package/build/esm/{index-87a2ea8c.js → index-1c9b481b.js} +2 -2
  51. package/build/esm/{index-2b9213cf.js → index-1d3c6ce7.js} +1 -1
  52. package/build/esm/{index-cf6beac8.js → index-21256394.js} +1 -1
  53. package/build/esm/{index-7e756cb8.js → index-219e3a35.js} +11 -11
  54. package/build/esm/{index-cdac57da.js → index-29908d2c.js} +1 -1
  55. package/build/esm/{index-1ecbcf21.js → index-2dc7803d.js} +5 -5
  56. package/build/esm/{index-c200bff6.js → index-5723381f.js} +2 -2
  57. package/build/esm/{index-bef3c9bd.js → index-6210f454.js} +2 -2
  58. package/build/esm/{index-76d20d3f.js → index-7a1ea734.js} +3 -3
  59. package/build/esm/{index-598ab51b.js → index-7c384ae6.js} +5 -5
  60. package/build/esm/{index-f27edf45.js → index-8eb04f36.js} +11 -11
  61. package/build/esm/{index-e104ad21.js → index-8fcf671c.js} +8 -8
  62. package/build/esm/{index-78255d6c.js → index-9471fca1.js} +2 -2
  63. package/build/esm/{index-21eac858.js → index-9b3a8b6d.js} +10 -10
  64. package/build/esm/{index-1da2ca0b.js → index-9b9c1499.js} +2 -2
  65. package/build/esm/{index-703205e3.js → index-9f99909b.js} +3 -3
  66. package/build/esm/{index-6ac73f00.js → index-ac2a8f95.js} +16 -16
  67. package/build/esm/{index-d6201fa4.js → index-acf8b60e.js} +2 -2
  68. package/build/esm/{index-c1af3a8e.js → index-bcedec73.js} +13 -13
  69. package/build/esm/{index-9f1899f2.js → index-c013ba1b.js} +4 -4
  70. package/build/esm/{index-e26514ee.js → index-c2584051.js} +4 -4
  71. package/build/esm/{types-2580132c.js → index-c430773c.js} +559 -3517
  72. package/build/esm/index-cdc50618.js +25 -0
  73. package/build/esm/{index-d218b94e.js → index-cfedca38.js} +2 -2
  74. package/build/esm/{index-38f50764.js → index-d6a5f5cf.js} +16 -16
  75. package/build/esm/{index-376bee14.js → index-e0b0d6a2.js} +7 -7
  76. package/build/esm/{index-996f7caf.js → index-ea63e0d2.js} +4 -4
  77. package/build/esm/{index-b1bb27aa.js → index-f22f6e6e.js} +10 -45
  78. package/build/esm/index-f4b938f2.js +18 -0
  79. package/build/esm/{index-16514f4d.js → index-f660abb7.js} +3 -3
  80. package/build/esm/index-fa67d66e.js +789 -0
  81. package/build/esm/index.js +91 -82
  82. package/build/esm/labelSorting-7351409a.js +47 -0
  83. package/build/esm/lead.js +21 -21
  84. package/build/esm/{logoIcon-d93bc56e.js → logoIcon-3a581efb.js} +2 -2
  85. package/build/esm/mantine.js +22 -22
  86. package/build/esm/misc.js +21 -21
  87. package/build/esm/molecules.js +56 -56
  88. package/build/esm/navigation.js +36 -36
  89. package/build/esm/onboardingV2.js +25 -25
  90. package/build/esm/organisms.js +40 -40
  91. package/build/esm/pwg.js +19 -19
  92. package/build/esm/{routing-bebdc8b7.js → routing-9e330438.js} +2 -2
  93. package/build/esm/subot.js +29 -29
  94. package/build/esm/surveyOrPremiumBanner.js +28 -28
  95. package/build/esm/surveyQuestionCard.js +10 -10
  96. package/build/esm/{surveyThankyouCard-bf6080eb.js → surveyThankyouCard-ec204631.js} +6 -6
  97. package/build/esm/together.js +51 -42
  98. package/build/esm/togetherAtoms.js +41 -0
  99. package/build/esm/togetherComponentGlobalContext.js +12 -0
  100. package/build/esm/togetherMolecules.js +53 -0
  101. package/build/esm/togetherOrganisms.js +57 -0
  102. package/build/esm/treePopoverMenu-cb214db6.js +332 -0
  103. package/build/esm/types-721e7a66.js +5 -0
  104. package/build/esm/{types-be952df2.js → types-ffcf5fb4.js} +13 -13
  105. package/build/esm/types.js +1 -1
  106. package/build/esm/{useCategory-8f109eb7.js → useCategory-553bee0b.js} +5 -5
  107. package/build/esm/{useHealthToolCache-d97dfa00.js → useHealthToolCache-6ce1724e.js} +2 -2
  108. package/build/esm/{useMantineLocale-4fb67342.js → useMantineLocale-453f8013.js} +3 -3
  109. package/build/esm/{usePlacesAutocomplete-fe2e4cbe.js → usePlacesAutocomplete-8925d4fb.js} +1 -1
  110. package/build/esm/useTogetherAuthRequiredAction.js +60 -0
  111. package/build/esm/{useTranslations-fbf6a6ab.js → useTranslations-b970f667.js} +1 -1
  112. package/build/esm/{utils-d5a0b58f.js → utils-3b29eb79.js} +6 -6
  113. package/build/esm/{utils-cef111b6.js → utils-6d45bdd1.js} +1 -1
  114. package/build/esm/vaccination.js +18 -18
  115. package/build/{fixedBottomAdBlock-0d4379d1.js → fixedBottomAdBlock-0129a006.js} +27 -27
  116. package/build/footer.js +18 -18
  117. package/build/gAssets.js +4 -4
  118. package/build/{getDynamicHealthTool-2a92e1a5.js → getDynamicHealthTool-f08b5fab.js} +4 -4
  119. package/build/{getSocialList-97e7bcc1.js → getSocialList-8cc32f7c.js} +5 -5
  120. package/build/healthToolsForm.js +24 -24
  121. package/build/hooks.js +17 -17
  122. package/build/i18n.js +1 -1
  123. package/build/i18nV2.js +1 -1
  124. package/build/{index-3d0d22b3.js → index-00a78d81.js} +16 -16
  125. package/build/index-077bf48f.js +803 -0
  126. package/build/{index-6bc3f8c3.js → index-0b727664.js} +5 -5
  127. package/build/{index-dcbd8bf3.js → index-10760994.js} +3 -3
  128. package/build/{index-247a9eb2.js → index-130e0f35.js} +33 -33
  129. package/build/{index-d5b4089d.js → index-16ed0d98.js} +12 -50
  130. package/build/{index-f1f4fbb9.js → index-1e1d8eb1.js} +13 -13
  131. package/build/{index-d34cd464.js → index-1fdf2f01.js} +2 -2
  132. package/build/{index-b773bc3d.js → index-206afefb.js} +4 -4
  133. package/build/{types-6c5643a2.js → index-2afbeb3d.js} +749 -3713
  134. package/build/{index-fe7345fa.js → index-2fd9063e.js} +2 -2
  135. package/build/{index-f10efb61.js → index-33432b02.js} +4 -4
  136. package/build/{index-a7de42d1.js → index-3eb666e6.js} +1 -1
  137. package/build/{index-264eeddd.js → index-405faafa.js} +2 -2
  138. package/build/{index-bef2bc73.js → index-4357a324.js} +11 -11
  139. package/build/index-466a2c32.js +1362 -0
  140. package/build/{index-73cde644.js → index-4b7d4b5b.js} +4 -4
  141. package/build/{index-77a2b9ee.js → index-4bc690c9.js} +1 -1
  142. package/build/index-4cdcdbbe.js +498 -0
  143. package/build/{index-06fa8444.js → index-53e14542.js} +2 -2
  144. package/build/{index-4af08ec2.js → index-54aeefca.js} +2 -2
  145. package/build/{index-058b3c0f.js → index-60f6d762.js} +16 -16
  146. package/build/{index-1efa7d84.js → index-64d8db08.js} +2 -2
  147. package/build/{index-cb0544e5.js → index-6aeb5ff5.js} +7 -7
  148. package/build/{index-3dcb9bc6.js → index-71843eb4.js} +4 -4
  149. package/build/{index-ee964d3c.js → index-765ed75d.js} +4 -4
  150. package/build/{index-dd1392e3.js → index-7953fb8e.js} +3 -3
  151. package/build/{index-7c1dc717.js → index-7ecc69af.js} +12 -12
  152. package/build/index-9e8877c0.js +25 -0
  153. package/build/{index-7da7b531.js → index-a2664204.js} +3 -3
  154. package/build/{index-f28c47ce.js → index-a6a9855f.js} +1 -1
  155. package/build/{index-aa818139.js → index-a8680a58.js} +2 -2
  156. package/build/{index-def9867a.js → index-a9bbb5aa.js} +11 -11
  157. package/build/{index-c225ef22.js → index-a9bdf889.js} +5 -5
  158. package/build/{index-838b0f95.js → index-b66ae554.js} +6 -6
  159. package/build/{index-dba2e361.js → index-ca616373.js} +2 -2
  160. package/build/{index-6c27b627.js → index-d9919cd2.js} +32 -32
  161. package/build/index-dd074159.js +32 -0
  162. package/build/{index-05f106c2.js → index-dff7ee1b.js} +10 -10
  163. package/build/{index-a86ea1b6.js → index-e3bbd009.js} +2 -2
  164. package/build/{index-6acb08c0.js → index-ec34e358.js} +8 -8
  165. package/build/{index-c2900d8c.js → index-f222ee45.js} +2 -2
  166. package/build/{index-f6575703.js → index-fd3e1d16.js} +2 -2
  167. package/build/index.js +176 -167
  168. package/build/labelSorting-f86081b7.js +53 -0
  169. package/build/lead.js +21 -21
  170. package/build/{logoIcon-ee9a5501.js → logoIcon-21a16853.js} +2 -2
  171. package/build/mantine.js +18 -18
  172. package/build/misc.js +21 -21
  173. package/build/molecules.js +56 -56
  174. package/build/navigation.js +36 -36
  175. package/build/onboardingV2.js +24 -24
  176. package/build/organisms.js +40 -40
  177. package/build/pwg.js +19 -19
  178. package/build/{routing-f6d54205.js → routing-d6c9099a.js} +2 -2
  179. package/build/subot.js +100 -100
  180. package/build/surveyOrPremiumBanner.js +28 -28
  181. package/build/surveyQuestionCard.js +10 -10
  182. package/build/{surveyThankyouCard-ead6b355.js → surveyThankyouCard-5b23b8f6.js} +6 -6
  183. package/build/together.js +99 -90
  184. package/build/togetherAtoms.js +55 -0
  185. package/build/togetherComponentGlobalContext.js +26 -0
  186. package/build/togetherMolecules.js +86 -0
  187. package/build/togetherOrganisms.js +71 -0
  188. package/build/treePopoverMenu-c0cb395f.js +343 -0
  189. package/build/{types-4ba4268f.js → types-8d9c5f21.js} +13 -13
  190. package/build/types-b25ffde0.js +7 -0
  191. package/build/types.js +1 -1
  192. package/build/{useCategory-e2c91f59.js → useCategory-b695fd3a.js} +5 -5
  193. package/build/{useHealthToolCache-2a53367b.js → useHealthToolCache-048807ea.js} +2 -2
  194. package/build/{useMantineLocale-a4f0c61d.js → useMantineLocale-0d63dfea.js} +3 -3
  195. package/build/{usePlacesAutocomplete-c76d0caf.js → usePlacesAutocomplete-9520e525.js} +1 -1
  196. package/build/useTogetherAuthRequiredAction.js +70 -0
  197. package/build/{useTranslations-200168a3.js → useTranslations-685f989b.js} +1 -1
  198. package/build/{utils-95d9832e.js → utils-169c6a7d.js} +6 -6
  199. package/build/{utils-af695515.js → utils-1a00c0f8.js} +1 -1
  200. package/build/vaccination.js +18 -18
  201. package/package.json +1 -1
  202. /package/build/{BMI_BOYS.percentile.monthly-71fb1c9f.js → BMI_BOYS.percentile.monthly-1aa95e30.js} +0 -0
  203. /package/build/{BMI_BOYS.percentile.weekly-b2b344a7.js → BMI_BOYS.percentile.weekly-61d78e1c.js} +0 -0
  204. /package/build/{BMI_BOYS.percentile.yearly-031ddade.js → BMI_BOYS.percentile.yearly-f80e040e.js} +0 -0
  205. /package/build/{BMI_BOYS.zscore.monthly-bb1f9962.js → BMI_BOYS.zscore.monthly-a6c7c8ff.js} +0 -0
  206. /package/build/{BMI_BOYS.zscore.weekly-d6198d53.js → BMI_BOYS.zscore.weekly-742f7028.js} +0 -0
  207. /package/build/{BMI_BOYS.zscore.yearly-48255337.js → BMI_BOYS.zscore.yearly-c19cccd5.js} +0 -0
  208. /package/build/{BMI_GIRLS.percentile.monthly-e3e284ee.js → BMI_GIRLS.percentile.monthly-089d3981.js} +0 -0
  209. /package/build/{BMI_GIRLS.percentile.weekly-9f2d3977.js → BMI_GIRLS.percentile.weekly-0cc52cda.js} +0 -0
  210. /package/build/{BMI_GIRLS.percentile.yearly-c79f34ce.js → BMI_GIRLS.percentile.yearly-10bc603f.js} +0 -0
  211. /package/build/{BMI_GIRLS.zscore.monthly-11092df0.js → BMI_GIRLS.zscore.monthly-c3fe57f3.js} +0 -0
  212. /package/build/{BMI_GIRLS.zscore.weekly-5c375d2b.js → BMI_GIRLS.zscore.weekly-b83a54db.js} +0 -0
  213. /package/build/{BMI_GIRLS.zscore.yearly-adbba8e3.js → BMI_GIRLS.zscore.yearly-5f13cda2.js} +0 -0
  214. /package/build/{ChevronDown-f7e25d61.js → ChevronDown-2fd86d66.js} +0 -0
  215. /package/build/{Close-36b0da99.js → Close-711196b0.js} +0 -0
  216. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-163b99ad.js → HEAD CIRCUM_BOYS.percentile.monthly-03b8d7fb.js} +0 -0
  217. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-c9882014.js → HEAD CIRCUM_BOYS.percentile.weekly-9ebd3eb6.js} +0 -0
  218. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-9d2bc91e.js → HEAD CIRCUM_BOYS.percentile.yearly-8e97b738.js} +0 -0
  219. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-1d2a215c.js → HEAD CIRCUM_BOYS.zscore.monthly-e7892261.js} +0 -0
  220. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-1f139c91.js → HEAD CIRCUM_BOYS.zscore.weekly-47c5af84.js} +0 -0
  221. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-ba15501b.js → HEAD CIRCUM_BOYS.zscore.yearly-9a1bc325.js} +0 -0
  222. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-a546201a.js → HEAD CIRCUM_GIRLS.percentile.monthly-d84491d7.js} +0 -0
  223. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-66cd5a7e.js → HEAD CIRCUM_GIRLS.percentile.weekly-a6f38c3e.js} +0 -0
  224. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-9db3c653.js → HEAD CIRCUM_GIRLS.percentile.yearly-5771d277.js} +0 -0
  225. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-0405e2cb.js → HEAD CIRCUM_GIRLS.zscore.monthly-e3633bcc.js} +0 -0
  226. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-b2cc3ad2.js → HEAD CIRCUM_GIRLS.zscore.weekly-23b0ab1a.js} +0 -0
  227. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-3115f993.js → HEAD CIRCUM_GIRLS.zscore.yearly-20f29cf1.js} +0 -0
  228. /package/build/{HEIGHT_BOYS.percentile.monthly-35138a98.js → HEIGHT_BOYS.percentile.monthly-57cc12ee.js} +0 -0
  229. /package/build/{HEIGHT_BOYS.percentile.weekly-0216c35b.js → HEIGHT_BOYS.percentile.weekly-c788506a.js} +0 -0
  230. /package/build/{HEIGHT_BOYS.percentile.yearly-f698e45d.js → HEIGHT_BOYS.percentile.yearly-ac56c1f2.js} +0 -0
  231. /package/build/{HEIGHT_BOYS.zscore.monthly-01195728.js → HEIGHT_BOYS.zscore.monthly-1bb78253.js} +0 -0
  232. /package/build/{HEIGHT_BOYS.zscore.weekly-993e9cf2.js → HEIGHT_BOYS.zscore.weekly-22737c43.js} +0 -0
  233. /package/build/{HEIGHT_BOYS.zscore.yearly-fee3ed69.js → HEIGHT_BOYS.zscore.yearly-90f6cd0a.js} +0 -0
  234. /package/build/{HEIGHT_GIRLS.percentile.monthly-27b2474a.js → HEIGHT_GIRLS.percentile.monthly-019f80d2.js} +0 -0
  235. /package/build/{HEIGHT_GIRLS.percentile.weekly-77bff236.js → HEIGHT_GIRLS.percentile.weekly-ceed9817.js} +0 -0
  236. /package/build/{HEIGHT_GIRLS.percentile.yearly-6200a720.js → HEIGHT_GIRLS.percentile.yearly-3e5192ac.js} +0 -0
  237. /package/build/{HEIGHT_GIRLS.zscore.monthly-94978e64.js → HEIGHT_GIRLS.zscore.monthly-f8fca0b6.js} +0 -0
  238. /package/build/{HEIGHT_GIRLS.zscore.weekly-7951beb1.js → HEIGHT_GIRLS.zscore.weekly-827b17e8.js} +0 -0
  239. /package/build/{HEIGHT_GIRLS.zscore.yearly-c2eca714.js → HEIGHT_GIRLS.zscore.yearly-3cdb483d.js} +0 -0
  240. /package/build/{Visible-eee51ba6.js → Visible-515a4eec.js} +0 -0
  241. /package/build/{WEIGHT_BOYS.percentile.monthly-6a6f901b.js → WEIGHT_BOYS.percentile.monthly-2ecbd498.js} +0 -0
  242. /package/build/{WEIGHT_BOYS.percentile.weekly-737fb867.js → WEIGHT_BOYS.percentile.weekly-75c9c25c.js} +0 -0
  243. /package/build/{WEIGHT_BOYS.percentile.yearly-7772b5e5.js → WEIGHT_BOYS.percentile.yearly-03e7cea6.js} +0 -0
  244. /package/build/{WEIGHT_BOYS.zscore.monthly-8db2e7d6.js → WEIGHT_BOYS.zscore.monthly-2ff9fb56.js} +0 -0
  245. /package/build/{WEIGHT_BOYS.zscore.weekly-ddd37c1a.js → WEIGHT_BOYS.zscore.weekly-e9f7fe2d.js} +0 -0
  246. /package/build/{WEIGHT_BOYS.zscore.yearly-332a8f7b.js → WEIGHT_BOYS.zscore.yearly-4a96f34f.js} +0 -0
  247. /package/build/{WEIGHT_GIRLS.percentile.monthly-3edad688.js → WEIGHT_GIRLS.percentile.monthly-5bf09e30.js} +0 -0
  248. /package/build/{WEIGHT_GIRLS.percentile.weekly-f113a82a.js → WEIGHT_GIRLS.percentile.weekly-f737ae23.js} +0 -0
  249. /package/build/{WEIGHT_GIRLS.percentile.yearly-95afbeaf.js → WEIGHT_GIRLS.percentile.yearly-56ebc8eb.js} +0 -0
  250. /package/build/{WEIGHT_GIRLS.zscore.monthly-d27c4bd4.js → WEIGHT_GIRLS.zscore.monthly-4697d3b5.js} +0 -0
  251. /package/build/{WEIGHT_GIRLS.zscore.weekly-2b113519.js → WEIGHT_GIRLS.zscore.weekly-3633820e.js} +0 -0
  252. /package/build/{WEIGHT_GIRLS.zscore.yearly-c82b04db.js → WEIGHT_GIRLS.zscore.yearly-a9a04790.js} +0 -0
  253. /package/build/{animation-e1375a3b.js → animation-85d012ee.js} +0 -0
  254. /package/build/{cart-67147d06.js → cart-8877bd63.js} +0 -0
  255. /package/build/{constants-936f45e9.js → constants-8743b014.js} +0 -0
  256. /package/build/{constants-513a9a41.js → constants-a78fa8b3.js} +0 -0
  257. /package/build/{cookieHelper-17491ce8.js → cookieHelper-86ae022e.js} +0 -0
  258. /package/build/{defaultClassWrapper-e87ca8ef.js → defaultClassWrapper-b7719693.js} +0 -0
  259. /package/build/{doctor-17b525f8.js → doctor-2c14fed1.js} +0 -0
  260. /package/build/esm/{BMI_BOYS.percentile.monthly-7c9d4923.js → BMI_BOYS.percentile.monthly-42ff2c64.js} +0 -0
  261. /package/build/esm/{BMI_BOYS.percentile.weekly-c410294a.js → BMI_BOYS.percentile.weekly-b4a6c521.js} +0 -0
  262. /package/build/esm/{BMI_BOYS.percentile.yearly-695a4fe2.js → BMI_BOYS.percentile.yearly-d3bc1a77.js} +0 -0
  263. /package/build/esm/{BMI_BOYS.zscore.monthly-9fb9f281.js → BMI_BOYS.zscore.monthly-c4506dfa.js} +0 -0
  264. /package/build/esm/{BMI_BOYS.zscore.weekly-d2109e4b.js → BMI_BOYS.zscore.weekly-ddf3b3f9.js} +0 -0
  265. /package/build/esm/{BMI_BOYS.zscore.yearly-bfa5361b.js → BMI_BOYS.zscore.yearly-e0e3139e.js} +0 -0
  266. /package/build/esm/{BMI_GIRLS.percentile.monthly-f5f60596.js → BMI_GIRLS.percentile.monthly-96686bcc.js} +0 -0
  267. /package/build/esm/{BMI_GIRLS.percentile.weekly-26e4e864.js → BMI_GIRLS.percentile.weekly-c3106a65.js} +0 -0
  268. /package/build/esm/{BMI_GIRLS.percentile.yearly-5a2b297d.js → BMI_GIRLS.percentile.yearly-b38c1f1f.js} +0 -0
  269. /package/build/esm/{BMI_GIRLS.zscore.monthly-4e80bed5.js → BMI_GIRLS.zscore.monthly-f8a7836f.js} +0 -0
  270. /package/build/esm/{BMI_GIRLS.zscore.weekly-03b79f0b.js → BMI_GIRLS.zscore.weekly-4c1fc771.js} +0 -0
  271. /package/build/esm/{BMI_GIRLS.zscore.yearly-822ed949.js → BMI_GIRLS.zscore.yearly-dce5e66a.js} +0 -0
  272. /package/build/esm/{ChevronDown-74267eb8.js → ChevronDown-31ea3e19.js} +0 -0
  273. /package/build/esm/{Close-372aa467.js → Close-40d598bc.js} +0 -0
  274. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-21b04c4c.js → HEAD CIRCUM_BOYS.percentile.monthly-34e3fa1c.js} +0 -0
  275. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-049a9d97.js → HEAD CIRCUM_BOYS.percentile.weekly-d3f3568f.js} +0 -0
  276. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-a4bbbaba.js → HEAD CIRCUM_BOYS.percentile.yearly-dfae3ad2.js} +0 -0
  277. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-7cb348c6.js → HEAD CIRCUM_BOYS.zscore.monthly-95840c2f.js} +0 -0
  278. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-678a1a52.js → HEAD CIRCUM_BOYS.zscore.weekly-8b198c1c.js} +0 -0
  279. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-db81b17e.js → HEAD CIRCUM_BOYS.zscore.yearly-b7d639ad.js} +0 -0
  280. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-cee33cd5.js → HEAD CIRCUM_GIRLS.percentile.monthly-47caa070.js} +0 -0
  281. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-2cec19c3.js → HEAD CIRCUM_GIRLS.percentile.weekly-bae46665.js} +0 -0
  282. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-5949e664.js → HEAD CIRCUM_GIRLS.percentile.yearly-81989cdd.js} +0 -0
  283. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-7c2bffab.js → HEAD CIRCUM_GIRLS.zscore.monthly-f2f7d985.js} +0 -0
  284. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-356dd00a.js → HEAD CIRCUM_GIRLS.zscore.weekly-e287ddb7.js} +0 -0
  285. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-e7b62215.js → HEAD CIRCUM_GIRLS.zscore.yearly-8790b62a.js} +0 -0
  286. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-359c4335.js → HEIGHT_BOYS.percentile.monthly-5d2b6466.js} +0 -0
  287. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-a4d4acd3.js → HEIGHT_BOYS.percentile.weekly-a38ad13e.js} +0 -0
  288. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-ec9a7f9b.js → HEIGHT_BOYS.percentile.yearly-e4841712.js} +0 -0
  289. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-12331258.js → HEIGHT_BOYS.zscore.monthly-d8e722f8.js} +0 -0
  290. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-172054d3.js → HEIGHT_BOYS.zscore.weekly-a92ea3ca.js} +0 -0
  291. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-bb47a3be.js → HEIGHT_BOYS.zscore.yearly-3af1adce.js} +0 -0
  292. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-c93c0b34.js → HEIGHT_GIRLS.percentile.monthly-c5203801.js} +0 -0
  293. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-f1f83097.js → HEIGHT_GIRLS.percentile.weekly-4c25d07f.js} +0 -0
  294. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-ccee4e55.js → HEIGHT_GIRLS.percentile.yearly-f91e2e27.js} +0 -0
  295. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-caf5410c.js → HEIGHT_GIRLS.zscore.monthly-b2a60aca.js} +0 -0
  296. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-b1e28b0e.js → HEIGHT_GIRLS.zscore.weekly-0a98c520.js} +0 -0
  297. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-c3af35d3.js → HEIGHT_GIRLS.zscore.yearly-8070d58f.js} +0 -0
  298. /package/build/esm/{Visible-3f9d7dca.js → Visible-e3e4fb6f.js} +0 -0
  299. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-8a4647df.js → WEIGHT_BOYS.percentile.monthly-b262b97d.js} +0 -0
  300. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-a2a6adf1.js → WEIGHT_BOYS.percentile.weekly-7e817f9f.js} +0 -0
  301. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-073df8b7.js → WEIGHT_BOYS.percentile.yearly-b7f1786a.js} +0 -0
  302. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-bb9e73d2.js → WEIGHT_BOYS.zscore.monthly-014af835.js} +0 -0
  303. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-ef32ce7a.js → WEIGHT_BOYS.zscore.weekly-4577f724.js} +0 -0
  304. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-6cc77688.js → WEIGHT_BOYS.zscore.yearly-08fd3f13.js} +0 -0
  305. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-a4b518bc.js → WEIGHT_GIRLS.percentile.monthly-a6e1aa0d.js} +0 -0
  306. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-dcedaebb.js → WEIGHT_GIRLS.percentile.weekly-4c0b6f94.js} +0 -0
  307. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-9e66577e.js → WEIGHT_GIRLS.percentile.yearly-bf689a3a.js} +0 -0
  308. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-c07cb81f.js → WEIGHT_GIRLS.zscore.monthly-f82fc3c8.js} +0 -0
  309. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-9c5c3e8e.js → WEIGHT_GIRLS.zscore.weekly-854ce987.js} +0 -0
  310. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-e99ce511.js → WEIGHT_GIRLS.zscore.yearly-2a3b869a.js} +0 -0
  311. /package/build/esm/{animation-0b2299dc.js → animation-85d9a0ed.js} +0 -0
  312. /package/build/esm/{cart-f961dadc.js → cart-1ac23ce7.js} +0 -0
  313. /package/build/esm/{constants-71d9f33b.js → constants-a5827634.js} +0 -0
  314. /package/build/esm/{constants-f77fc231.js → constants-f6b2e49d.js} +0 -0
  315. /package/build/esm/{cookieHelper-73ce3871.js → cookieHelper-6c3b4790.js} +0 -0
  316. /package/build/esm/{defaultClassWrapper-31caf23b.js → defaultClassWrapper-00903c00.js} +0 -0
  317. /package/build/esm/{doctor-8a07ca44.js → doctor-e0c2476d.js} +0 -0
  318. /package/build/esm/{index-e3787b20.js → index-189d7601.js} +0 -0
  319. /package/build/esm/{index-c3264b34.js → index-21bca818.js} +0 -0
  320. /package/build/esm/{index-782fed08.js → index-266a32ff.js} +0 -0
  321. /package/build/esm/{index-b65a8764.js → index-8684181f.js} +0 -0
  322. /package/build/esm/{index-3078acec.js → index-ad1c7c38.js} +0 -0
  323. /package/build/esm/{isProduction-5684a28c.js → isProduction-1937d355.js} +0 -0
  324. /package/build/esm/{localizeNumberFormat-42ae8d89.js → localizeNumberFormat-1f000110.js} +0 -0
  325. /package/build/esm/{normalizeLink-d6f57223.js → normalizeLink-7a93ebb9.js} +0 -0
  326. /package/build/esm/{number-13f075cf.js → number-1d1ba14a.js} +0 -0
  327. /package/build/esm/{paths-49a813e7.js → paths-b83be1a0.js} +0 -0
  328. /package/build/esm/{theme-f18c2351.js → theme-7dadf4a1.js} +0 -0
  329. /package/build/esm/{translationsContext-f3d1a7bd.js → translationsContext-42a1fa63.js} +0 -0
  330. /package/build/esm/{tslib.es6-761239c7.js → tslib.es6-06ba3978.js} +0 -0
  331. /package/build/esm/{useIsInit-ee864235.js → useIsInit-f4dec279.js} +0 -0
  332. /package/build/esm/{useOutsideClick-7451aa57.js → useOutsideClick-210c1134.js} +0 -0
  333. /package/build/esm/{useScrollbarSize-84bb5b47.js → useScrollbarSize-909ae7ec.js} +0 -0
  334. /package/build/esm/{useUniqueId-c23213b6.js → useUniqueId-5885911d.js} +0 -0
  335. /package/build/esm/{utils-f8761b9d.js → utils-d7bbdb52.js} +0 -0
  336. /package/build/{index-df5cd44b.js → index-1f3fc2e3.js} +0 -0
  337. /package/build/{index-bba97c2e.js → index-2de1eb4a.js} +0 -0
  338. /package/build/{index-ba3797bb.js → index-6fdcd09d.js} +0 -0
  339. /package/build/{index-e0bf03ac.js → index-82c85f9d.js} +0 -0
  340. /package/build/{index-97ebd7e1.js → index-bc9e8eae.js} +0 -0
  341. /package/build/{isProduction-aa963bf9.js → isProduction-20cd663d.js} +0 -0
  342. /package/build/{localizeNumberFormat-90d4f9d5.js → localizeNumberFormat-7ff6bd3a.js} +0 -0
  343. /package/build/{normalizeLink-451ae6d8.js → normalizeLink-d307f624.js} +0 -0
  344. /package/build/{number-c2338382.js → number-dddf656c.js} +0 -0
  345. /package/build/{paths-e0bbfce7.js → paths-7da79c64.js} +0 -0
  346. /package/build/{theme-e4f7f487.js → theme-be20929b.js} +0 -0
  347. /package/build/{translationsContext-39528d2f.js → translationsContext-00fdb62e.js} +0 -0
  348. /package/build/{tslib.es6-7e140b89.js → tslib.es6-bd3f8718.js} +0 -0
  349. /package/build/{useIsInit-38cec0c4.js → useIsInit-e06b96f5.js} +0 -0
  350. /package/build/{useOutsideClick-e579e1ac.js → useOutsideClick-d95a32b6.js} +0 -0
  351. /package/build/{useScrollbarSize-5a8be010.js → useScrollbarSize-1499b1c3.js} +0 -0
  352. /package/build/{useUniqueId-8929fe5f.js → useUniqueId-1af8848e.js} +0 -0
  353. /package/build/{utils-524bda7c.js → utils-15a9772e.js} +0 -0
@@ -0,0 +1,1362 @@
1
+ 'use strict';
2
+
3
+ var tslib_es6 = require('./tslib.es6-bd3f8718.js');
4
+ var React = require('react');
5
+ var index$5 = require('./index-f222ee45.js');
6
+ var index$2 = require('./index-54aeefca.js');
7
+ var useTranslations = require('./useTranslations-685f989b.js');
8
+ var innertext = require('innertext');
9
+ var index = require('./index-2afbeb3d.js');
10
+ var index$1 = require('./index-64d8db08.js');
11
+ var constants = require('./constants-a78fa8b3.js');
12
+ var togetherComponentGlobalContext = require('./utils-169c6a7d.js');
13
+ var useTogetherAuthRequiredAction = require('./useTogetherAuthRequiredAction.js');
14
+ var treePopoverMenu = require('./treePopoverMenu-c0cb395f.js');
15
+ var styled = require('@emotion/styled');
16
+ var utils = require('./utils-15a9772e.js');
17
+ var theme = require('./theme-be20929b.js');
18
+ var dataTransform = require('./dataTransform-e39297c1.js');
19
+ var index$7 = require('./index-4cdcdbbe.js');
20
+ var index$6 = require('./index-9e8877c0.js');
21
+ var index$8 = require('./index-e3bbd009.js');
22
+ var core$1 = require('@hhgtech/icons/core');
23
+ var other = require('@hhgtech/icons/other');
24
+ var core = require('@mantine/core');
25
+ var index$4 = require('./index-7953fb8e.js');
26
+ var index$3 = require('./index-1fdf2f01.js');
27
+ var routing = require('./routing-d6c9099a.js');
28
+
29
+ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
30
+
31
+ var React__default = /*#__PURE__*/_interopDefault(React);
32
+ var innertext__default = /*#__PURE__*/_interopDefault(innertext);
33
+ var styled__default = /*#__PURE__*/_interopDefault(styled);
34
+
35
+ 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";
36
+ var MBMoreSolid = img$8;
37
+
38
+ 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";
39
+ var IconBookmarkFill = img$7;
40
+
41
+ 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";
42
+ var IconBookmark = img$6;
43
+
44
+ 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";
45
+ var IconKebab = img$5;
46
+
47
+ 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";
48
+ var IconShareOnMedia = img$4;
49
+
50
+ 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";
51
+ var IconTabEdit = img$3;
52
+
53
+ 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";
54
+ var IconTrashBin = img$2;
55
+
56
+ // import IconBellOff from '../../../assets/svg/icon-bell-off.svg'
57
+ // import IconBellOn from '../../../assets/svg/icon-bell-on.svg'
58
+ const CardPostPopoverMore = ({ authorEmail, onDeletePost, shareUrl, post, className = '', popoverClassName = '', onBookmark, onRemoveBookmark, onEditPost, }) => {
59
+ const { data: { locale, userInfo, togetherUserId, env: { isMarryBaby }, }, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
60
+ const { t } = useTranslations.useTranslations();
61
+ // const [localHasNoti, setLocalHasNoti] = useState(false)
62
+ const [loading, setLoading] = React.useState(false);
63
+ const [isOpenLeavePopup, setIsOpenLeavePopup] = React.useState(false);
64
+ const [isOpenSharePopup, setIsOpenSharePopup] = React.useState(false);
65
+ const { authActionWrapper } = useTogetherAuthRequiredAction.useTogetherAuthRequiredAction();
66
+ const isAuthor = authorEmail && (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) && authorEmail === String(userInfo === null || userInfo === void 0 ? void 0 : userInfo.email);
67
+ return (React__default["default"].createElement("div", { className: className, onClick: (e) => {
68
+ e.preventDefault();
69
+ e.stopPropagation();
70
+ } },
71
+ isOpenSharePopup && (React__default["default"].createElement(index.SharePopup, { url: shareUrl, text: post === null || post === void 0 ? void 0 : post.title, onClose: () => setIsOpenSharePopup(false) })),
72
+ isOpenLeavePopup && (React__default["default"].createElement(index.PopupDanger, { thumbnail: index$1.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: () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
73
+ if (!(post === null || post === void 0 ? void 0 : post.id) || loading)
74
+ return;
75
+ setLoading(true);
76
+ try {
77
+ const res = yield index.deletePost({
78
+ id: post.id,
79
+ locale,
80
+ });
81
+ if ((res === null || res === void 0 ? void 0 : res.status) === 1)
82
+ onDeletePost === null || onDeletePost === void 0 ? void 0 : onDeletePost();
83
+ }
84
+ catch (_a) { }
85
+ setLoading(false);
86
+ }), onClose: () => setIsOpenLeavePopup(false) })),
87
+ React__default["default"].createElement(treePopoverMenu.TreePopoverMenu, { className: popoverClassName, toggleButtonContent: React__default["default"].createElement("img", { src: isMarryBaby ? MBMoreSolid : IconKebab, loading: "lazy" }), position: "bottom", align: "end", buttonProps: {
88
+ isLoading: loading,
89
+ }, data: isAuthor
90
+ ? {
91
+ isShowheader: false,
92
+ type: 'list',
93
+ list: [
94
+ {
95
+ icon: IconShareOnMedia,
96
+ label: t('morePopover.share'),
97
+ onClick: () => setIsOpenSharePopup(true),
98
+ },
99
+ {
100
+ icon: IconTabEdit,
101
+ label: t('actionPopover.edit'),
102
+ onClick: onEditPost,
103
+ },
104
+ {
105
+ icon: IconTrashBin,
106
+ label: t('actionPopover.delete'),
107
+ onClick: () => {
108
+ authActionWrapper(() => setIsOpenLeavePopup(true));
109
+ },
110
+ },
111
+ ],
112
+ }
113
+ : {
114
+ isShowheader: false,
115
+ type: 'list',
116
+ list: [
117
+ {
118
+ icon: IconShareOnMedia,
119
+ label: t('morePopover.share'),
120
+ onClick: () => setIsOpenSharePopup(true),
121
+ },
122
+ {
123
+ icon: !!(post === null || post === void 0 ? void 0 : post.bookmarked) ? IconBookmarkFill : IconBookmark,
124
+ label: !!(post === null || post === void 0 ? void 0 : post.bookmarked)
125
+ ? t('morePopover.unsavePost')
126
+ : t('morePopover.savePost'),
127
+ onClick: () => {
128
+ authActionWrapper(() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
129
+ if (!(userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) || !(post === null || post === void 0 ? void 0 : post.id))
130
+ return;
131
+ if (post === null || post === void 0 ? void 0 : post.bookmarked) {
132
+ const res = yield togetherComponentGlobalContext.callApiWithAuth(togetherComponentGlobalContext.getApiPath(togetherComponentGlobalContext.PATHS.BOOKMARK.DELETE, {
133
+ _locale: locale,
134
+ }), 'DELETE', {
135
+ data: {
136
+ post_id: String(post.id),
137
+ },
138
+ });
139
+ if ((res === null || res === void 0 ? void 0 : res.status) === 1) {
140
+ pushNotifications({
141
+ title: '',
142
+ message: 'Removed saved post',
143
+ type: 'success',
144
+ displayIcon: IconBookmark,
145
+ });
146
+ onRemoveBookmark && onRemoveBookmark();
147
+ }
148
+ else {
149
+ pushNotifications({
150
+ title: '',
151
+ message: 'Remove failed',
152
+ type: 'danger',
153
+ displayIcon: IconBookmark,
154
+ });
155
+ }
156
+ }
157
+ else {
158
+ const res = yield togetherComponentGlobalContext.callApiWithAuth(togetherComponentGlobalContext.getApiPath(togetherComponentGlobalContext.PATHS.BOOKMARK.CREATE, {
159
+ _locale: locale,
160
+ }), 'POST', {
161
+ data: {
162
+ user_id: togetherUserId || userInfo.id,
163
+ post_id: post.id,
164
+ },
165
+ });
166
+ if ((res === null || res === void 0 ? void 0 : res.status) === 1) {
167
+ pushNotifications({
168
+ title: '',
169
+ message: 'Post saved',
170
+ type: 'success',
171
+ displayIcon: IconBookmarkFill,
172
+ });
173
+ onBookmark && onBookmark();
174
+ }
175
+ else {
176
+ pushNotifications({
177
+ title: '',
178
+ message: 'Post saved failed',
179
+ type: 'danger',
180
+ displayIcon: IconBookmark,
181
+ });
182
+ }
183
+ }
184
+ }));
185
+ },
186
+ },
187
+ // {
188
+ // icon: togetherBasePath + '/svg/icon-bell-on.svg',
189
+ // label: !localHasNoti
190
+ // ? t( 'morePopover.turnOnNotifications' })
191
+ // : t( 'morePopover.turnOffNotifications' }),
192
+ // onClick: () => {
193
+ // authActionWrapper(async () => {
194
+ // if (!post?.id || loading) return
195
+ // setLoading(true)
196
+ // try {
197
+ // const res = await followUnfollowPost({
198
+ // id: post?.id,
199
+ // locale,
200
+ // })
201
+ // if (res?.status === 1) {
202
+ // pushNotifications({
203
+ // message: !localHasNoti
204
+ // ? 'Notification on'
205
+ // : 'Notification off',
206
+ // type: !localHasNoti ? 'success' : 'danger',
207
+ // displayIcon: !localHasNoti ? IconBellOn : IconBellOff,
208
+ // })
209
+ // setLocalHasNoti((v) => !v)
210
+ // }
211
+ // } catch {}
212
+ // setLoading(false)
213
+ // })
214
+ // },
215
+ // },
216
+ {
217
+ icon: index.IconAlertCircle,
218
+ label: t('morePopover.report'),
219
+ subTree: {
220
+ title: t('morePopover.report.title'),
221
+ description: t('morePopover.report.description'),
222
+ isShowheader: true,
223
+ type: 'list',
224
+ list: Object.keys(constants.REPORT_REASON_MAP)
225
+ .map((k) => ({
226
+ label: constants.REPORT_REASON_MAP[k].label,
227
+ reason: constants.REPORT_REASON_MAP[k].reportReasonText,
228
+ reasonValue: k,
229
+ }))
230
+ .map((item) => ({
231
+ label: t(item.label),
232
+ subTree: {
233
+ title: t('morePopover.reportSubmit.title'),
234
+ description: t('morePopover.reportSubmit.description'),
235
+ isShowheader: true,
236
+ type: 'jsx',
237
+ jsxRenderer: (setShow) => (React__default["default"].createElement(index.SubmitReportForm, { reason: item.reasonValue, reasonText: t(item.reason), postId: post === null || post === void 0 ? void 0 : post.id, onClose: () => setShow && setShow(false) })),
238
+ },
239
+ })),
240
+ },
241
+ },
242
+ ],
243
+ } })));
244
+ };
245
+
246
+ const StyledCardPost$1 = styled__default["default"].div `
247
+ position: relative;
248
+ margin-bottom: 24px;
249
+ background: white;
250
+ border-radius: ${theme.theme.borderRadius};
251
+
252
+ a {
253
+ text-decoration: none;
254
+ }
255
+
256
+ ${utils.MediaQueries.mbDown} {
257
+ margin-bottom: 8px;
258
+ }
259
+ &.flat-top {
260
+ border-top-left-radius: 0;
261
+ border-top-right-radius: 0;
262
+ }
263
+
264
+ .post-pin {
265
+ padding: 0.5rem 1rem;
266
+ border-radius: ${theme.theme.borderRadius} 6px 0 0;
267
+ }
268
+ .post-author {
269
+ display: flex;
270
+ align-items: center;
271
+ justify-content: space-between;
272
+ &.comment {
273
+ padding-right: 2.6rem;
274
+ }
275
+ .author-avatar-wrapper {
276
+ width: 40px;
277
+ height: 40px;
278
+ font-size: 20px;
279
+ ${utils.MediaQueries.mbDown} {
280
+ width: 32px;
281
+ height: 32px;
282
+ font-size: 16px;
283
+ }
284
+ }
285
+ }
286
+ .post-content-link-wrapper {
287
+ color: inherit;
288
+ cursor: pointer;
289
+ .post-content-title {
290
+ padding: 1rem 1rem 0;
291
+ word-break: break-word;
292
+ }
293
+ }
294
+ .social-preview-wrapper.has-image {
295
+ margin-bottom: 5px;
296
+ }
297
+ .social-preview-wrapper,
298
+ .image-preview-wrapper,
299
+ .link-preview-wrapper {
300
+ width: 100%;
301
+ &[data-is-reply='true'] {
302
+ padding-right: 1rem;
303
+ padding-left: 1rem;
304
+ }
305
+ }
306
+ .post-topics {
307
+ padding: 0 1rem;
308
+ }
309
+
310
+ .post-reaction {
311
+ background: none;
312
+ border-radius: 0 0 6px 6px;
313
+ &.hide-top-border {
314
+ ::before {
315
+ display: none;
316
+ }
317
+ }
318
+ }
319
+ .most-engaging-wrapper {
320
+ padding: 1rem;
321
+ cursor: pointer;
322
+ .author-avatar-wrapper {
323
+ width: 2rem;
324
+ height: 2rem;
325
+ font-size: 1rem;
326
+ }
327
+ .see-more-comments {
328
+ width: 100%;
329
+ padding: 12px 0 0;
330
+ text-align: unset;
331
+ }
332
+ }
333
+ &[data-most-engaging='true'] {
334
+ border: none;
335
+ ${utils.MediaQueries.mbDown} {
336
+ margin: 1rem;
337
+ border: 1px solid #e4e8ec;
338
+ }
339
+ }
340
+ .top-divider {
341
+ border-color: #e4e8ec;
342
+ }
343
+ .popover {
344
+ .popover-menu__btn {
345
+ display: flex;
346
+ width: 1.5rem;
347
+ height: 1rem;
348
+ align-items: center;
349
+ justify-content: center;
350
+ padding: 0;
351
+ background: transparent;
352
+
353
+ &:hover {
354
+ background-color: transparent;
355
+ }
356
+ }
357
+ .popover-menu__content {
358
+ &.--position-bottom {
359
+ &.--align-end {
360
+ &::before {
361
+ right: 12.5px;
362
+ }
363
+ }
364
+ }
365
+ }
366
+ }
367
+
368
+ &[data-is-marrybaby='true'] {
369
+ border: 1px solid #f3f3f3;
370
+ border-radius: 1rem;
371
+ /* shadow */
372
+
373
+ box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.08);
374
+ .image-preview-wrapper,
375
+ .link-preview-wrapper {
376
+ padding-right: 1rem;
377
+ padding-left: 1rem;
378
+ }
379
+ .popover {
380
+ .popover-menu__btn {
381
+ width: 24px;
382
+ height: 24px;
383
+ ${utils.MediaQueries.mbDown} {
384
+ width: 18px;
385
+ height: 18px;
386
+ }
387
+ }
388
+ .popover-menu__content {
389
+ &.--position-bottom {
390
+ &.--align-end {
391
+ &::before {
392
+ right: 1rem;
393
+ }
394
+ width: 350px;
395
+ ${utils.MediaQueries.mbDown} {
396
+ max-width: calc(320px - 2rem);
397
+ }
398
+ }
399
+ }
400
+ }
401
+ }
402
+ .most-engaging-wrapper {
403
+ position: relative;
404
+ padding: 0;
405
+ &::before {
406
+ position: absolute;
407
+ z-index: 5;
408
+ top: 0;
409
+ left: 50%;
410
+ width: calc(100% - 2rem);
411
+ height: 1px;
412
+ background: #f3f3f3;
413
+ content: ' ';
414
+ transform: translateX(-50%);
415
+ }
416
+ }
417
+ ${utils.MediaQueries.mbDown} {
418
+ margin-bottom: 12px;
419
+ }
420
+ }
421
+ `;
422
+
423
+ 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";
424
+ var IconDelete = img$1;
425
+
426
+ const CardReplyPopover = ({ onDeleteComment, commentId, className = '', popoverClassName = '', }) => {
427
+ const { data: { env: { isMarryBaby }, locale, }, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
428
+ const { t } = useTranslations.useTranslations();
429
+ const [isOpenLeavePopup, setIsOpenLeavePopup] = React.useState(false);
430
+ const { authActionWrapper } = useTogetherAuthRequiredAction.useTogetherAuthRequiredAction();
431
+ return (React__default["default"].createElement("div", { className: className, onClick: (e) => {
432
+ e.preventDefault();
433
+ e.stopPropagation();
434
+ } },
435
+ isOpenLeavePopup && (React__default["default"].createElement(index.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: () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
436
+ var _a;
437
+ if (!commentId)
438
+ return;
439
+ const res = yield index.deleteComment({ id: commentId, locale });
440
+ if ((res === null || res === void 0 ? void 0 : res.status) === 1) {
441
+ onDeleteComment && onDeleteComment();
442
+ pushNotifications({
443
+ title: '',
444
+ message: t('notification.success'),
445
+ type: 'success',
446
+ });
447
+ }
448
+ else {
449
+ pushNotifications({
450
+ title: '',
451
+ message: ((_a = res === null || res === void 0 ? void 0 : res.messages) === null || _a === void 0 ? void 0 : _a[0]) || t('notification.failure'),
452
+ type: 'danger',
453
+ });
454
+ }
455
+ }), onClose: () => setIsOpenLeavePopup(false) })),
456
+ React__default["default"].createElement(treePopoverMenu.TreePopoverMenu, { position: "bottom", align: "end", data: {
457
+ isShowheader: false,
458
+ type: 'list',
459
+ list: [
460
+ // {
461
+ // icon: _href('/svg/icon-share-on-media.svg'),
462
+ // label: f({ id: 'morePopover.share' }),
463
+ // subTree: {
464
+ // title: f({ id: 'morePopover.shareOn' }),
465
+ // isShowheader: true,
466
+ // type: 'jsx',
467
+ // jsxType: TreeJSXType.share,
468
+ // data: {
469
+ // shareUrl: shareUrl,
470
+ // shareTitle: shareTitle,
471
+ // },
472
+ // },
473
+ // },
474
+ // {
475
+ // icon: _href('/svg/icon-tab-edit-2.svg'),
476
+ // label: f({ id: 'actionPopover.edit' }),
477
+ // onClick: onEditPost,
478
+ // },
479
+ {
480
+ icon: IconTrashBin,
481
+ label: t('actionPopover.delete'),
482
+ onClick: () => {
483
+ authActionWrapper(() => {
484
+ setIsOpenLeavePopup(true);
485
+ });
486
+ },
487
+ },
488
+ ],
489
+ }, className: popoverClassName, toggleButtonContent: React__default["default"].createElement("img", { src: isMarryBaby ? MBMoreSolid : IconKebab, loading: "lazy" }), buttonProps: {
490
+ // isLoading: loading,
491
+ } })));
492
+ };
493
+
494
+ const StyledContainer$1 = styled__default["default"].div `
495
+ .add-link {
496
+ color: ${theme.theme.colors.primaryBase};
497
+ }
498
+ `;
499
+ const StyledAlertTag = styled__default["default"].div `
500
+ margin: 16px 0;
501
+ background: ${theme.theme.colors.yellow50};
502
+ padding: 5px 10px;
503
+ border-radius: 2px;
504
+
505
+ .icon {
506
+ display: inline-block;
507
+ vertical-align: middle;
508
+ margin-right: 6px;
509
+ }
510
+ `;
511
+ const StyledSourceItemWrapper = styled__default["default"].div `
512
+ display: flex;
513
+ align-items: center;
514
+ gap: 8px;
515
+ `;
516
+ const StyledListItems$1 = styled__default["default"].div `
517
+ padding: 8px 16px;
518
+ `;
519
+ const StyledInputWrapper = styled__default["default"].div `
520
+ margin-bottom: 12px;
521
+ width: 100%;
522
+ `;
523
+
524
+ const StyledContainer = styled__default["default"].div ``;
525
+ const StyledHeader = styled__default["default"].div `
526
+ margin-bottom: 16px;
527
+ `;
528
+ const StyledListItems = styled__default["default"].div `
529
+ display: flex;
530
+ flex-wrap: wrap;
531
+ row-gap: 16px;
532
+ ${utils.MediaQueries.tdUp} {
533
+ align-items: center;
534
+ column-gap: 24px;
535
+ }
536
+ `;
537
+ const StyledItem$1 = styled__default["default"].a `
538
+ display: flex;
539
+ align-items: center;
540
+ gap: 16px;
541
+ ${utils.MediaQueries.mbDown} {
542
+ width: 100%;
543
+ justify-content: space-between;
544
+ }
545
+ `;
546
+ const StyledItemInfo = styled__default["default"].div `
547
+ display: flex;
548
+ align-items: center;
549
+ gap: 16px;
550
+ `;
551
+ const StyledThumb = styled__default["default"].div `
552
+ border-radius: ${theme.theme.borderRadius};
553
+ overflow: hidden;
554
+ width: 48px;
555
+ height: 48px;
556
+ img {
557
+ object-fit: cover;
558
+ width: 100%;
559
+ height: 100%;
560
+ }
561
+ `;
562
+
563
+ const RecommentCategories = ({ categories }) => {
564
+ const { t } = useTranslations.useTranslations();
565
+ const { data: { locale, env: { isMarryBaby }, }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
566
+ const url = routing.getCurrentBaseUrl(locale, isMarryBaby);
567
+ return (React__default["default"].createElement(StyledContainer, null,
568
+ React__default["default"].createElement(StyledHeader, null,
569
+ React__default["default"].createElement(index$2.Heading, { tag: "h6", as: "h5" }, t('cardReply.recommentCategories.heading'))),
570
+ React__default["default"].createElement(StyledListItems, null, categories.map((i) => (React__default["default"].createElement(StyledItem$1, { href: url + i.permalink, key: String(i.termId), target: "_blank" },
571
+ React__default["default"].createElement(StyledItemInfo, null,
572
+ React__default["default"].createElement(StyledThumb, null,
573
+ React__default["default"].createElement("img", { src: i.featureImage ||
574
+ index$1.CommonGAssets.getAssetPath(isMarryBaby ? 'mb-logo.svg' : '/logo/logomark.png'), alt: i.displayName, loading: "lazy" })),
575
+ React__default["default"].createElement(index$3.Text, { size: "s3", weight: "bold" }, i.displayName)),
576
+ React__default["default"].createElement(other.ArrowRight, { size: 20, color: theme.theme.colors.gray400 })))))));
577
+ };
578
+
579
+ const StyledItem = styled__default["default"].a `
580
+ padding: 12px 0;
581
+ display: flex;
582
+ flex-direction: column;
583
+ gap: 8px;
584
+ border-top: 1px solid ${theme.theme.colors.neutral100};
585
+ text-decoration: none;
586
+
587
+ &:first-child {
588
+ border-top: 0;
589
+ }
590
+ `;
591
+
592
+ const SourceItem = ({ postTitle, articleReviewed, modifiedTime, href, }) => {
593
+ const { t } = useTranslations.useTranslations();
594
+ const getDetail = (() => {
595
+ const { expert, editor, is_author } = articleReviewed;
596
+ if (expert) {
597
+ const result = {
598
+ name: expert.display_name,
599
+ role: 'expert',
600
+ avatar: expert.avatar,
601
+ };
602
+ if (is_author) {
603
+ return Object.assign({ title: t('articleAuthor.title.written-by') }, result);
604
+ }
605
+ else {
606
+ if (expert.role === 'expert') {
607
+ // Is Expert
608
+ return Object.assign({ title: t('articleAuthor.title.expert') }, result);
609
+ }
610
+ else {
611
+ // Is medical
612
+ return Object.assign({ title: t('articleAuthor.title.medical') }, result);
613
+ }
614
+ }
615
+ }
616
+ else if (editor) {
617
+ return {
618
+ title: t('articleAuthor.title.fact-check'),
619
+ name: editor.display_name,
620
+ avatar: editor.avatar,
621
+ };
622
+ }
623
+ })();
624
+ return (React__default["default"].createElement(StyledItem, { href: href, title: postTitle, target: "_blank" },
625
+ React__default["default"].createElement(index$3.Text, { size: "s3", as: "h5", weight: "bold" }, postTitle),
626
+ React__default["default"].createElement("div", null,
627
+ React__default["default"].createElement(index.CardAuthor, { avatar: getDetail === null || getDetail === void 0 ? void 0 : getDetail.avatar, avatarProps: {
628
+ size: 32,
629
+ }, name: getDetail === null || getDetail === void 0 ? void 0 : getDetail.name, role: getDetail === null || getDetail === void 0 ? void 0 : getDetail.role, hideBackground: true },
630
+ React__default["default"].createElement(index.CardAuthor.SubTextRow, null,
631
+ React__default["default"].createElement(index.CardAuthor.SubText, null, getDetail === null || getDetail === void 0 ? void 0 :
632
+ getDetail.title,
633
+ ' ',
634
+ React__default["default"].createElement("span", { style: { color: theme.theme.colors.gray800 } }, getDetail === null || getDetail === void 0 ? void 0 : getDetail.name)),
635
+ React__default["default"].createElement(index.CardAuthor.SubDivider, null),
636
+ React__default["default"].createElement(index.CardAuthor.SubText, null, modifiedTime))))));
637
+ };
638
+
639
+ var styles$1 = {"accordion":"CnNZq8D","header":"F4mmgSy","heading":"_8jLruY3","headingIcon":"FE8w-fe","panel":"Yd2a9Nj","chevron":"A7QrQ7A"};
640
+
641
+ const SourceList = (_a) => {
642
+ var { listUrl: listUrlInit, hideSourceList, categorySlug, editMode, collapseSource, onListChange, isMarryBaby } = _a, rest = tslib_es6.__rest(_a, ["listUrl", "hideSourceList", "categorySlug", "editMode", "collapseSource", "onListChange", "isMarryBaby"]);
643
+ const { t } = useTranslations.useTranslations();
644
+ const [listUrl, setListUrl] = React.useState(listUrlInit || []);
645
+ const [data, setData] = React.useState([]);
646
+ const [categories, setCategories] = React.useState([]);
647
+ const [loading, setLoading] = React.useState(false);
648
+ React.useEffect(() => {
649
+ !hideSourceList &&
650
+ (() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
651
+ setLoading(true);
652
+ const listPaths = listUrl.map((i) => {
653
+ const url = new URL(i);
654
+ const pathArr = String(url.pathname)
655
+ .split('/')
656
+ .filter((i) => i != '');
657
+ const origin = url.origin;
658
+ const isMarrySite = origin.search('marrybaby.vn') !== -1;
659
+ return {
660
+ isMarrySite,
661
+ path: pathArr[pathArr.length - 1],
662
+ href: i,
663
+ };
664
+ });
665
+ const listApi = [
666
+ ...listPaths.map((i) => togetherComponentGlobalContext.callApi(i.isMarrySite
667
+ ? togetherComponentGlobalContext.getMarryBabyApiPath(togetherComponentGlobalContext.DISCOVER_PATHS.GET_PREVIEW_ARTICLE, {
668
+ fullSlug: i.path,
669
+ }, true)
670
+ : togetherComponentGlobalContext.getDiscoverApiPath(togetherComponentGlobalContext.DISCOVER_PATHS.GET_PREVIEW_ARTICLE, {
671
+ fullSlug: i.path,
672
+ }, true), 'GET')),
673
+ ];
674
+ const res = yield Promise.all(listApi);
675
+ setData(res
676
+ .map((i, index) => {
677
+ var _a, _b;
678
+ return ((_a = i === null || i === void 0 ? void 0 : i.data) === null || _a === void 0 ? void 0 : _a.post) && Object.assign(Object.assign({}, dataTransform.formatArticle((_b = i === null || i === void 0 ? void 0 : i.data) === null || _b === void 0 ? void 0 : _b.post)), { href: listPaths[index].href });
679
+ })
680
+ .filter(Boolean));
681
+ setLoading(false);
682
+ }))();
683
+ }, []);
684
+ React.useEffect(() => {
685
+ !hideSourceList &&
686
+ (data === null || data === void 0 ? void 0 : data.length) === 0 &&
687
+ categorySlug &&
688
+ (() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
689
+ var _a;
690
+ const res = yield togetherComponentGlobalContext.callApi(isMarryBaby
691
+ ? togetherComponentGlobalContext.getMarryBabyApiPath(togetherComponentGlobalContext.DISCOVER_PATHS.GET_CATEGORY_OR_ARTICLE_DETAIL, {
692
+ fullSlug: categorySlug,
693
+ }, true)
694
+ : togetherComponentGlobalContext.getDiscoverApiPath(togetherComponentGlobalContext.DISCOVER_PATHS.GET_CATEGORY_OR_ARTICLE_DETAIL, {
695
+ fullSlug: categorySlug,
696
+ }, true), 'GET');
697
+ (res === null || res === void 0 ? void 0 : res.data) && setCategories([dataTransform.formatCategory((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.category)]);
698
+ }))();
699
+ }, [data]);
700
+ const handleRemoveItem = (idx) => {
701
+ setListUrl((old) => {
702
+ const tmp = [...old];
703
+ tmp.splice(idx, 1);
704
+ return tmp;
705
+ });
706
+ setData((old) => {
707
+ const tmp = [...old];
708
+ tmp.splice(idx, 1);
709
+ return tmp;
710
+ });
711
+ };
712
+ React.useEffect(() => {
713
+ onListChange === null || onListChange === void 0 ? void 0 : onListChange(listUrl);
714
+ }, [listUrl]);
715
+ return (React__default["default"].createElement("div", Object.assign({}, rest),
716
+ !editMode && (React__default["default"].createElement(StyledAlertTag, null,
717
+ React__default["default"].createElement("img", { className: "icon", src: index$1.CommonGAssets.getAssetPath('warning.svg'), alt: "warning", style: { marginBottom: '3px', width: '18px' }, loading: "lazy" }),
718
+ React__default["default"].createElement(index$3.Text, { size: "s3", as: "span", dangerouslySetInnerHTML: {
719
+ __html: t('cardReply.disclaimer'),
720
+ } }))),
721
+ !hideSourceList ? (loading ? (React__default["default"].createElement(index.Loading, null)) : data.length > 0 || editMode ? (React__default["default"].createElement(StyledContainer$1, null,
722
+ React__default["default"].createElement(core.Accordion, { defaultValue: !collapseSource && 'accordion', styles: {
723
+ control: {
724
+ borderRadius: 'inherit',
725
+ '&[aria-expanded="false"]': {
726
+ borderBottom: 0,
727
+ },
728
+ },
729
+ chevron: {
730
+ width: '32px',
731
+ height: '32px',
732
+ },
733
+ content: {
734
+ padding: 0,
735
+ borderBottom: 0,
736
+ borderTop: `1px solid ${theme.theme.colors.neutral100}`,
737
+ },
738
+ item: {
739
+ marginBottom: '16px',
740
+ borderTopLeftRadius: '8px',
741
+ borderTopRightRadius: '8px',
742
+ border: `1px solid ${theme.theme.colors.neutral100}`,
743
+ borderBottomLeftRadius: '8px',
744
+ borderBottomRightRadius: '8px',
745
+ '&[data-active]': {
746
+ borderBottomLeftRadius: 0,
747
+ borderBottomRightRadius: 0,
748
+ },
749
+ },
750
+ }, chevron: React__default["default"].createElement("div", { className: styles$1.chevron },
751
+ React__default["default"].createElement(other.ArrowDown, { color: theme.theme.colors.gray600, size: 20 })) },
752
+ React__default["default"].createElement(core.Accordion.Item, { value: "accordion" },
753
+ React__default["default"].createElement(core.Accordion.Control, null,
754
+ React__default["default"].createElement("div", { className: styles$1.header },
755
+ React__default["default"].createElement(index$2.Heading, { as: "h4", tag: "h6" }, t('cardReply.source')))),
756
+ React__default["default"].createElement(core.Accordion.Panel, null,
757
+ React__default["default"].createElement(StyledListItems$1, null,
758
+ (data || []).map((i, idx) => (React__default["default"].createElement(StyledSourceItemWrapper, { key: String(idx) },
759
+ typeof i === 'object' ? (React__default["default"].createElement(SourceItem, Object.assign({}, i))) : (React__default["default"].createElement(StyledInputWrapper, null,
760
+ React__default["default"].createElement(index$4.Input, { style: { width: '100%' }, name: "source-list", value: i || '', size: "sm", onChange: (v) => {
761
+ setListUrl((old) => {
762
+ const tmp = [...old];
763
+ tmp[idx] = v;
764
+ return tmp;
765
+ });
766
+ setData((old) => {
767
+ const tmp = [...old];
768
+ tmp[idx] = v;
769
+ return tmp;
770
+ });
771
+ } }))),
772
+ editMode && (React__default["default"].createElement(index$5.Button, { size: "md", color: "transparent", icon: React__default["default"].createElement(other.Trash, null), onClick: () => handleRemoveItem(idx) }))))),
773
+ editMode && (React__default["default"].createElement(index$5.Button, { className: "add-link", color: "transparent", size: "md", icon: React__default["default"].createElement(core$1.Plus, { color: theme.theme.colors.primaryBase, size: 18 }), onClick: () => {
774
+ setListUrl((old) => [...old, '']);
775
+ setData((old) => [...old, '']);
776
+ } }, "Add source")))))))) : (React__default["default"].createElement(RecommentCategories, { categories: categories }))) : null));
777
+ };
778
+
779
+ const StyledCardPost = styled__default["default"].div `
780
+ position: relative;
781
+ margin-bottom: 0;
782
+ background: white;
783
+ border-radius: ${theme.theme.borderRadius};
784
+
785
+ .verify-tag {
786
+ margin-top: 12px;
787
+ }
788
+
789
+ .post-author {
790
+ &.with-popover {
791
+ padding-right: 2.6rem;
792
+ }
793
+ .author-avatar-wrapper {
794
+ width: 40px;
795
+ height: 40px;
796
+ font-size: 20px;
797
+ ${utils.MediaQueries.mbDown} {
798
+ width: 32px;
799
+ height: 32px;
800
+ font-size: 16px;
801
+ }
802
+ }
803
+ }
804
+ .image-preview-wrapper,
805
+ .link-preview-wrapper {
806
+ width: 100%;
807
+ &[data-is-reply='true'] {
808
+ padding-right: 1rem;
809
+ padding-left: 1rem;
810
+ }
811
+ }
812
+ .post-reaction {
813
+ background: none;
814
+ border-radius: 0 0 6px 6px;
815
+ }
816
+ &[data-is-reply='true'] {
817
+ > .post-author .author-avatar-wrapper {
818
+ width: 20px;
819
+ height: 20px;
820
+ font-size: 10px;
821
+ }
822
+ }
823
+ &[data-is-reply='false'] {
824
+ border: 1px solid #e4e8ec;
825
+ }
826
+ .expert-wrapper {
827
+ width: 100%;
828
+ }
829
+ &[data-has-booking='true'] {
830
+ display: grid;
831
+ .post-author {
832
+ background-color: ${theme.theme.colors.primary50};
833
+ }
834
+ .btn-wrapper {
835
+ padding: 0 16px;
836
+ .btn-booking {
837
+ width: 100%;
838
+ margin: 12px 0;
839
+ }
840
+ }
841
+ }
842
+
843
+ .comment-reply-wrapper {
844
+ padding: 0 1rem;
845
+ .more-cmt {
846
+ .chevron-right {
847
+ height: 1rem;
848
+ width: 1rem;
849
+ vertical-align: middle;
850
+ }
851
+ }
852
+ }
853
+ .top-divider {
854
+ border-color: #e4e8ec;
855
+ }
856
+ .popover {
857
+ position: absolute;
858
+ top: 1.5rem;
859
+ right: 1rem;
860
+ .popover-menu__btn {
861
+ display: flex;
862
+ width: 1rem;
863
+ height: 1rem;
864
+ align-items: center;
865
+ justify-content: center;
866
+ padding: 0;
867
+ background: transparent;
868
+
869
+ &:hover {
870
+ background-color: transparent;
871
+ }
872
+
873
+ .popover-menu__content {
874
+ &.--position-bottom {
875
+ &.--align-end {
876
+ &::before {
877
+ right: 12.5px;
878
+ }
879
+ }
880
+ }
881
+ }
882
+ }
883
+ }
884
+
885
+ &[data-is-marrybaby='true'] {
886
+ &[data-is-reply='false'] {
887
+ border: none;
888
+ }
889
+ .image-preview-wrapper,
890
+ .link-preview-wrapper {
891
+ padding-right: 1rem;
892
+ padding-left: 1rem;
893
+ }
894
+ .popover {
895
+ .popover-menu__btn {
896
+ width: 24px;
897
+ height: 24px;
898
+ }
899
+ }
900
+
901
+ margin-left: 56px;
902
+ ${utils.MediaQueries.mbDown} {
903
+ margin-left: 40px;
904
+ }
905
+ > .post-author {
906
+ margin-left: -56px;
907
+ ${utils.MediaQueries.mbDown} {
908
+ margin-left: -40px;
909
+ }
910
+ .author-info {
911
+ align-items: center;
912
+ display: flex;
913
+ align-items: center;
914
+ .author-info-top {
915
+ width: 100%;
916
+ }
917
+ .author-info-text-wrapper {
918
+ justify-content: space-between;
919
+ }
920
+ }
921
+ .author-avatar-wrapper {
922
+ width: 40px;
923
+ height: 40px;
924
+ font-size: 20px;
925
+ ${utils.MediaQueries.mbDown} {
926
+ width: 24px;
927
+ height: 24px;
928
+ font-size: 12px;
929
+ }
930
+ }
931
+ }
932
+ &[data-is-reply] {
933
+ > .post-author {
934
+ .author-avatar-wrapper {
935
+ width: 40px;
936
+ height: 40px;
937
+ font-size: 20px;
938
+ ${utils.MediaQueries.mbDown} {
939
+ width: 24px;
940
+ height: 24px;
941
+ font-size: 12px;
942
+ }
943
+ }
944
+ }
945
+ }
946
+
947
+ .comment-reply-wrapper {
948
+ padding-right: 0;
949
+ padding-left: 0;
950
+ }
951
+ .post-reaction {
952
+ &::after {
953
+ position: absolute;
954
+ bottom: 0;
955
+ left: 50%;
956
+ width: calc(100% - 2rem);
957
+ height: 1px;
958
+ background: #f3f3f3;
959
+ content: ' ';
960
+ transform: translateX(-50%);
961
+ }
962
+ }
963
+ .post-content-wrapper {
964
+ padding-top: 0;
965
+ padding-bottom: 0;
966
+ ${utils.MediaQueries.mbDown} {
967
+ padding-left: 0.5rem;
968
+ }
969
+ }
970
+
971
+ ${utils.MediaQueries.mbDown} {
972
+ margin-bottom: 12px;
973
+ }
974
+ }
975
+ `;
976
+ const StyledSourceList = styled__default["default"](SourceList) `
977
+ margin-top: 12px;
978
+ padding: 0.5rem 1rem 1rem;
979
+ `;
980
+
981
+ var styles = {"button":"-dzIuHr"};
982
+
983
+ const VerifiedTag = ({ userId, avatar, name, role, title, className, }) => {
984
+ const { t } = useTranslations.useTranslations();
985
+ const [openPopup, setOpenPopup] = React.useState(false);
986
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
987
+ React__default["default"].createElement(index$5.Button, { className: `${styles.button} ${className}`, color: "success", size: "xs", onClick: () => setOpenPopup(true), style: {
988
+ padding: '5px 8px',
989
+ marginBottom: '12px',
990
+ borderRadius: '4px',
991
+ } },
992
+ React__default["default"].createElement("span", { className: "text" },
993
+ React__default["default"].createElement(other.Endorse, { isSolid: true, size: 18, color: theme.theme.colors.green800, className: "icon" }),
994
+ t('cardReply.verifyBy', {
995
+ name: `${name || ''}`,
996
+ }))),
997
+ React__default["default"].createElement(index.ProfileDetailModal, { open: openPopup, onClose: () => setOpenPopup(false), profileModalProps: { zIndex: 1000 } },
998
+ React__default["default"].createElement(index.ProfileDetail, { authorProps: {
999
+ userId,
1000
+ avatar: avatar,
1001
+ name,
1002
+ role,
1003
+ title,
1004
+ }, hideQuestionTab: true }))));
1005
+ };
1006
+
1007
+ 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";
1008
+ var ChevronRightActive = img;
1009
+
1010
+ const COMMENT_LIMIT = 4;
1011
+ const CardReply = ({ className, style, comment: CommentProps, type = 'comment', level = 0, replyingId, onPostCommentSuccess, post, onDeleteComment, refetchComment, hasQuickBookingEnable, handleMakeAppointment, cardAuthorProps, maxChars = 600, disableShortenContent, }) => {
1012
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
1013
+ const { data: { locale, userInfo, env: { isMarryBaby }, }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
1014
+ const { t } = useTranslations.useTranslations();
1015
+ const [comment, setComment] = React.useState(CommentProps || null);
1016
+ const { id, countLikes, content, replies = [], images = [], author, liked, link, mentionedUser, mentions, } = comment;
1017
+ const { text, replyingTo } = index.decodeCommentBody(content);
1018
+ const { authActionWrapper } = useTogetherAuthRequiredAction.useTogetherAuthRequiredAction({
1019
+ _joinCommunityIds: [(_a = post === null || post === void 0 ? void 0 : post.community) === null || _a === void 0 ? void 0 : _a.id],
1020
+ _joinTopicIds: (_b = post === null || post === void 0 ? void 0 : post.topics) === null || _b === void 0 ? void 0 : _b.map((t) => t.id),
1021
+ });
1022
+ const [maxRepliesShow, setMaxRepliesShow] = React.useState(COMMENT_LIMIT);
1023
+ const isCommented = (userInfo === null || userInfo === void 0 ? void 0 : userInfo.id)
1024
+ ? replies === null || replies === void 0 ? void 0 : replies.some((c) => c.author.id === userInfo.id)
1025
+ : false;
1026
+ const addNewReply = (comment) => {
1027
+ setComment((old) => {
1028
+ // somehow this set state run twice
1029
+ // => we need to check unique comment id before add to array
1030
+ if (!old.replies.find((c) => c.id === comment.id)) {
1031
+ old.replies.unshift(comment);
1032
+ const newComment = Object.assign(Object.assign({}, old), { replies: old.replies.slice(), countReplies: old.countReplies + 1 });
1033
+ refetchComment && refetchComment(newComment);
1034
+ return newComment;
1035
+ }
1036
+ return old;
1037
+ });
1038
+ };
1039
+ const [showInputComment, setShowInputComment] = React.useState(false);
1040
+ const sortedReplies = React.useMemo(() => {
1041
+ if (type !== 'comment' || !replies || replies.length == 0)
1042
+ return replies;
1043
+ return replies.sort((a, b) => {
1044
+ const timeA = new Date(a.createdAt).getTime();
1045
+ const timeB = new Date(b.createdAt).getTime();
1046
+ if (timeA > timeB)
1047
+ return -1;
1048
+ if (timeA < timeB)
1049
+ return 1;
1050
+ return 0;
1051
+ });
1052
+ }, [type, replies]);
1053
+ const mergeCountReplies = (replies === null || replies === void 0 ? void 0 : replies.length) || 0;
1054
+ const hasPopover = String(author === null || author === void 0 ? void 0 : author.email) &&
1055
+ (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) &&
1056
+ String(author === null || author === void 0 ? void 0 : author.email) === String(userInfo === null || userInfo === void 0 ? void 0 : userInfo.email);
1057
+ // const isAnonymousOfCurAuthor =
1058
+ // post?.isAnonymous && post?.author?.username === author?.username
1059
+ // const name = isAnonymousOfCurAuthor
1060
+ // ? t('cardPost.anonymous')
1061
+ // : author?.name || author?.username || ''
1062
+ // const avatar = isAnonymousOfCurAuthor ? DEFAULT_AVATAR_IMG : author?.avatar
1063
+ // const username = isAnonymousOfCurAuthor
1064
+ // ? t('cardPost.anonymous')
1065
+ // : author?.username || author?.name || ''
1066
+ const name = (author === null || author === void 0 ? void 0 : author.name) || (author === null || author === void 0 ? void 0 : author.username) || '';
1067
+ const username = (author === null || author === void 0 ? void 0 : author.username) || (author === null || author === void 0 ? void 0 : author.name) || '';
1068
+ const avatar = author === null || author === void 0 ? void 0 : author.avatar;
1069
+ const authorRole = (post === null || post === void 0 ? void 0 : post.isAnonymous) ? undefined : author === null || author === void 0 ? void 0 : author.role;
1070
+ const listMentions = [
1071
+ ...((post === null || post === void 0 ? void 0 : post.isAnonymous)
1072
+ ? [
1073
+ {
1074
+ id: ((_c = post === null || post === void 0 ? void 0 : post.author) === null || _c === void 0 ? void 0 : _c.id) || 0,
1075
+ name: t('cardPost.anonymous'),
1076
+ },
1077
+ ]
1078
+ : []),
1079
+ ...(mentions || []),
1080
+ ];
1081
+ const [hospitalInfo, setHospitalInfo] = React.useState(null);
1082
+ const [doctorInfo, setDoctorInfo] = React.useState(null);
1083
+ React.useEffect(() => {
1084
+ if (author === null || author === void 0 ? void 0 : author.hospitalId) {
1085
+ const fetchHospitalDetail = (hospitalId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1086
+ var _a;
1087
+ const response = yield togetherComponentGlobalContext.callApi(togetherComponentGlobalContext.getCarePath(togetherComponentGlobalContext.CARE_PATHS.GET_HOSPITAL_INFO, {
1088
+ hospital_branch_id: hospitalId,
1089
+ website_url: index$8.domainLocales[locale],
1090
+ }), 'get');
1091
+ if ((_a = response === null || response === void 0 ? void 0 : response._data) === null || _a === void 0 ? void 0 : _a.branch) {
1092
+ setHospitalInfo(response === null || response === void 0 ? void 0 : response._data.branch);
1093
+ }
1094
+ });
1095
+ fetchHospitalDetail(author.hospitalId);
1096
+ }
1097
+ if (author === null || author === void 0 ? void 0 : author.doctorId) {
1098
+ const fetchDoctorDetail = (doctorId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1099
+ var _b;
1100
+ const response = yield togetherComponentGlobalContext.callApi(togetherComponentGlobalContext.getCarePath(togetherComponentGlobalContext.CARE_PATHS.GET_DOCTOR_INFO, {
1101
+ doctorId: doctorId,
1102
+ website_url: index$8.domainLocales[locale],
1103
+ }), 'get');
1104
+ if ((_b = response === null || response === void 0 ? void 0 : response._data) === null || _b === void 0 ? void 0 : _b.doctor) {
1105
+ setDoctorInfo(response === null || response === void 0 ? void 0 : response._data.doctor);
1106
+ }
1107
+ });
1108
+ fetchDoctorDetail(author.doctorId);
1109
+ }
1110
+ }, [author.hospitalId, author.doctorId]);
1111
+ const isDoctorAvailable = (doctorInfo === null || doctorInfo === void 0 ? void 0 : doctorInfo.valid_outpatient) || (doctorInfo === null || doctorInfo === void 0 ? void 0 : doctorInfo.valid_telemedicine);
1112
+ const isHospitalAvailable = ((hospitalInfo === null || hospitalInfo === void 0 ? void 0 : hospitalInfo.total_available_service) ||
1113
+ (hospitalInfo === null || hospitalInfo === void 0 ? void 0 : hospitalInfo.total_available_doctor)) > 0;
1114
+ const hasQuickBooking = hasQuickBookingEnable && (isDoctorAvailable || isHospitalAvailable);
1115
+ const isChatbotAuthor = ((_d = comment === null || comment === void 0 ? void 0 : comment.author) === null || _d === void 0 ? void 0 : _d.type) === 'chatbot';
1116
+ return (React__default["default"].createElement(useTogetherAuthRequiredAction.TogetherAuthConfigContextProvider, { defaultParams: {
1117
+ _joinCommunityIds: [(_e = post === null || post === void 0 ? void 0 : post.community) === null || _e === void 0 ? void 0 : _e.id],
1118
+ _joinTopicIds: (_f = post === null || post === void 0 ? void 0 : post.topics) === null || _f === void 0 ? void 0 : _f.map((t) => t.id),
1119
+ } },
1120
+ React__default["default"].createElement(StyledCardPost, { className: className, style: style, "data-is-reply": !!level, "data-is-marrybaby": isMarryBaby, "data-has-booking": hasQuickBooking },
1121
+ type === 'reply' && React__default["default"].createElement(index$6.Divider, { className: "top-divider", type: "solid" }),
1122
+ React__default["default"].createElement("div", { style: { padding: '16px 16px 0' } },
1123
+ React__default["default"].createElement(index.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,
1124
+ // miniIcon="./svg/icon-tag.svg"
1125
+ // authorLabelType={getAuthorLabelFromRoles(author?.role || [])}
1126
+ 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) ||
1127
+ (Boolean(post === null || post === void 0 ? void 0 : post.isAnonymous) &&
1128
+ ((_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)),
1129
+ Boolean(comment === null || comment === void 0 ? void 0 : comment.isVerify) && !Boolean(comment === null || comment === void 0 ? void 0 : comment.isOppose) && (React__default["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" }))),
1130
+ React__default["default"].createElement(index.PostContent, { className: "post-content-wrapper", replyingTo: replyingTo, mentionedUser: mentionedUser, description: text, mentions: listMentions, maxChars: maxChars, disableShortenContent: disableShortenContent }),
1131
+ React__default["default"].createElement("span", null),
1132
+ React__default["default"].createElement("span", null),
1133
+ images && images.length > 0 ? (React__default["default"].createElement("div", { key: "image-preview", className: "image-preview-wrapper", "data-is-reply": true },
1134
+ React__default["default"].createElement(index.PostImagePreview, { images: images, authorName: author === null || author === void 0 ? void 0 : author.username }))) : null,
1135
+ (!images || images.length === 0) && link ? (React__default["default"].createElement("div", { key: "link-preview", className: "link-preview-wrapper", "data-is-reply": true },
1136
+ React__default["default"].createElement(index$7.CardLink, { url: link }))) : null,
1137
+ type !== 'most-engaging' ? (React__default["default"].createElement(React__default["default"].Fragment, null,
1138
+ isChatbotAuthor && (React__default["default"].createElement(StyledSourceList, { listUrl: comment === null || comment === void 0 ? void 0 : comment.source, categorySlug: comment === null || comment === void 0 ? void 0 : comment.categorySlug })),
1139
+ React__default["default"].createElement(treePopoverMenu.CardReactions, { type: treePopoverMenu.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(() => {
1140
+ setShowInputComment(true);
1141
+ }), onLikeClick: () => authActionWrapper(() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1142
+ if (id) {
1143
+ const res = yield index.likeUnlikeComment({
1144
+ commentId: id,
1145
+ setLike: !liked,
1146
+ locale,
1147
+ });
1148
+ if (res.status === 1) {
1149
+ setComment((old) => {
1150
+ return Object.assign(Object.assign({}, old), { liked: !liked, countLikes: old.countLikes + (!liked ? 1 : -1) });
1151
+ });
1152
+ }
1153
+ }
1154
+ })) }),
1155
+ showInputComment && (React__default["default"].createElement(index.InputCommentBar, { replyingId: replyingId || comment.id, replyToName: name, isReply: true, onClose: () => setShowInputComment(false), onPostSuccess: (comment) => {
1156
+ if (type === 'reply') {
1157
+ onPostCommentSuccess && onPostCommentSuccess(comment);
1158
+ }
1159
+ else {
1160
+ addNewReply(comment);
1161
+ }
1162
+ }, post: post, replyingUser: author })),
1163
+ type === 'comment' && replies && replies.length > 0 ? (React__default["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 :
1164
+ _o.map((reply) => (React__default["default"].createElement(CardReply, { key: reply.id, comment: reply, type: "reply", className: "comment-reply-item", level: level + 1, replyingId: id, onPostCommentSuccess: addNewReply, post: post, onDeleteComment: () => {
1165
+ setComment((old) => {
1166
+ return Object.assign(Object.assign({}, old), { replies: old.replies.filter((r) => r.id !== reply.id), countReplies: old.countReplies - 1 });
1167
+ });
1168
+ }, handleMakeAppointment: handleMakeAppointment, hasQuickBookingEnable: hasQuickBookingEnable }))),
1169
+ mergeCountReplies > maxRepliesShow && (React__default["default"].createElement(React__default["default"].Fragment, null,
1170
+ React__default["default"].createElement(index$6.Divider, { className: "top-divider", type: "solid" }),
1171
+ React__default["default"].createElement(index$5.Button, { className: "more-cmt", size: "lg", color: "ghost", onClick: () => setMaxRepliesShow((m) => m + COMMENT_LIMIT) },
1172
+ t('comment.seeMoreReplies', {
1173
+ count: mergeCountReplies - maxRepliesShow,
1174
+ }),
1175
+ React__default["default"].createElement("img", { className: "chevron-right", src: ChevronRightActive, loading: "lazy" })))))) : null)) : null,
1176
+ hasPopover && (React__default["default"].createElement(CardReplyPopover, { onDeleteComment: onDeleteComment, className: "popover", commentId: comment.id })))));
1177
+ };
1178
+
1179
+ const getMostEngagingComment = (postId, locale) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1180
+ var _a, _b, _c;
1181
+ const commentsRes = yield togetherComponentGlobalContext.callApiWithOptionalAuth(togetherComponentGlobalContext.getApiPath(togetherComponentGlobalContext.PATHS.COMMENT.LIST, {
1182
+ postId: postId,
1183
+ _locale: locale,
1184
+ sort: 'popularity',
1185
+ perPage: 1,
1186
+ withoutReply: 1,
1187
+ }), 'GET');
1188
+ 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(dataTransform.formatComment)) === null || _c === void 0 ? void 0 : _c[0];
1189
+ });
1190
+ 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, }) => {
1191
+ const [post, setPost] = React.useState(postProp);
1192
+ const [isOpenSharePopup, setIsOpenSharePopup] = React.useState(false);
1193
+ const [mostEngagingComment, setMostEngagingComment] = React.useState(mostEngagingCommentProp);
1194
+ const { community, topics, author, slug, isPin, liked, photos, mentions, title, description, previewUrl, likesCount, commentsCount, id, commented, } = post;
1195
+ const { data: { locale, env: { isMarryBaby, togetherBasePath }, }, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
1196
+ const { t } = useTranslations.useTranslations();
1197
+ const [showInputComment, setShowInputComment] = React.useState(propsShowInputComment);
1198
+ const postRelativeHref = `${togetherBasePath}/${(community === null || community === void 0 ? void 0 : community.slug) || '_'}/${slug || ''}`;
1199
+ const postHref = `${togetherComponentGlobalContext.getCurrentBaseUrl(locale)}${postRelativeHref}`;
1200
+ const { authActionWrapper } = useTogetherAuthRequiredAction.useTogetherAuthRequiredAction((community === null || community === void 0 ? void 0 : community.slug)
1201
+ ? {
1202
+ _joinCommunityIds: [community.id],
1203
+ _joinTopicIds: topics === null || topics === void 0 ? void 0 : topics.map((t) => t.id),
1204
+ // _location: postHref,
1205
+ }
1206
+ : undefined);
1207
+ const [isLikeLoading, setIsLikeLoading] = React.useState(false);
1208
+ React.useEffect(() => {
1209
+ setShowInputComment(propsShowInputComment);
1210
+ }, [propsShowInputComment]);
1211
+ const name = (author === null || author === void 0 ? void 0 : author.name) || (author === null || author === void 0 ? void 0 : author.username) || '';
1212
+ const username = (author === null || author === void 0 ? void 0 : author.username) || (author === null || author === void 0 ? void 0 : author.name) || '';
1213
+ const avatar = author === null || author === void 0 ? void 0 : author.avatar;
1214
+ const authorRole = (post === null || post === void 0 ? void 0 : post.isAnonymous) ? undefined : author === null || author === void 0 ? void 0 : author.role;
1215
+ const [hospitalInfo, setHospitalInfo] = React.useState(null);
1216
+ const [doctorInfo, setDoctorInfo] = React.useState(null);
1217
+ React.useEffect(() => {
1218
+ if (author === null || author === void 0 ? void 0 : author.hospitalId) {
1219
+ const fetchHospitalDetail = (hospitalId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1220
+ var _a;
1221
+ const response = yield togetherComponentGlobalContext.callApi(togetherComponentGlobalContext.getCarePath(togetherComponentGlobalContext.CARE_PATHS.GET_HOSPITAL_INFO, {
1222
+ hospital_branch_id: hospitalId,
1223
+ website_url: togetherComponentGlobalContext.domainLocales[locale],
1224
+ }), 'get');
1225
+ if ((_a = response === null || response === void 0 ? void 0 : response._data) === null || _a === void 0 ? void 0 : _a.branch) {
1226
+ setHospitalInfo(response === null || response === void 0 ? void 0 : response._data.branch);
1227
+ }
1228
+ });
1229
+ fetchHospitalDetail(author.hospitalId);
1230
+ }
1231
+ if (author === null || author === void 0 ? void 0 : author.doctorId) {
1232
+ const fetchDoctorDetail = (doctorId) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1233
+ var _b;
1234
+ const response = yield togetherComponentGlobalContext.callApi(togetherComponentGlobalContext.getCarePath(togetherComponentGlobalContext.CARE_PATHS.GET_DOCTOR_INFO, {
1235
+ doctorId: doctorId,
1236
+ website_url: togetherComponentGlobalContext.domainLocales[locale],
1237
+ }), 'get');
1238
+ if ((_b = response === null || response === void 0 ? void 0 : response._data) === null || _b === void 0 ? void 0 : _b.doctor) {
1239
+ setDoctorInfo(response === null || response === void 0 ? void 0 : response._data.doctor);
1240
+ }
1241
+ });
1242
+ fetchDoctorDetail(author.doctorId);
1243
+ }
1244
+ }, [author.hospitalId, author.doctorId]);
1245
+ const isDoctorAvailable = (doctorInfo === null || doctorInfo === void 0 ? void 0 : doctorInfo.valid_outpatient) || (doctorInfo === null || doctorInfo === void 0 ? void 0 : doctorInfo.valid_telemedicine);
1246
+ const isHospitalAvailable = ((hospitalInfo === null || hospitalInfo === void 0 ? void 0 : hospitalInfo.total_available_service) ||
1247
+ (hospitalInfo === null || hospitalInfo === void 0 ? void 0 : hospitalInfo.total_available_doctor)) > 0;
1248
+ const hasQuickBooking = hasQuickBookingEnable && (isDoctorAvailable || isHospitalAvailable);
1249
+ React.useEffect(() => {
1250
+ (() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1251
+ if (id &&
1252
+ commentsCount &&
1253
+ showMostEngaging &&
1254
+ !(mostEngagingCommentProp === null || mostEngagingCommentProp === void 0 ? void 0 : mostEngagingCommentProp.id)) {
1255
+ const comment = yield getMostEngagingComment(id, locale);
1256
+ setMostEngagingComment(comment);
1257
+ }
1258
+ }))();
1259
+ }, [id, locale, commentsCount, showMostEngaging, mostEngagingCommentProp === null || mostEngagingCommentProp === void 0 ? void 0 : mostEngagingCommentProp.id]);
1260
+ React.useEffect(() => {
1261
+ setMostEngagingComment(mostEngagingCommentProp);
1262
+ }, [mostEngagingCommentProp === null || mostEngagingCommentProp === void 0 ? void 0 : mostEngagingCommentProp.id]);
1263
+ const onPostCommentSuccess = (comment) => {
1264
+ if (commentsCount === 0 && !(mostEngagingComment === null || mostEngagingComment === void 0 ? void 0 : mostEngagingComment.id)) {
1265
+ setMostEngagingComment(comment);
1266
+ }
1267
+ setPost((p) => (Object.assign(Object.assign({}, p), { commentsCount: p.commentsCount + 1, commented: true })));
1268
+ onPostCommentSuccessProp && onPostCommentSuccessProp(comment);
1269
+ };
1270
+ const onDeleteComment = (comment) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1271
+ if (commentsCount > 1 &&
1272
+ (mostEngagingComment === null || mostEngagingComment === void 0 ? void 0 : mostEngagingComment.id) &&
1273
+ (mostEngagingComment === null || mostEngagingComment === void 0 ? void 0 : mostEngagingComment.id) === (comment === null || comment === void 0 ? void 0 : comment.id)) {
1274
+ const newMostEngaging = yield getMostEngagingComment(id, locale);
1275
+ setMostEngagingComment(newMostEngaging);
1276
+ }
1277
+ setPost((p) => (Object.assign(Object.assign({}, p), { commentsCount: p.commentsCount - 1 })));
1278
+ onDeleteCommentProp && onDeleteCommentProp(comment);
1279
+ });
1280
+ return (React__default["default"].createElement(useTogetherAuthRequiredAction.TogetherAuthConfigContextProvider, { defaultParams: (community === null || community === void 0 ? void 0 : community.slug)
1281
+ ? {
1282
+ _joinCommunityIds: [community.id],
1283
+ _joinTopicIds: topics === null || topics === void 0 ? void 0 : topics.map((t) => t.id),
1284
+ // _location: postHref,
1285
+ }
1286
+ : undefined },
1287
+ isOpenSharePopup && (React__default["default"].createElement(index.SharePopup, { url: postHref, avatar: constants.DEFAULT_IMG, text: title, onClose: () => setIsOpenSharePopup(false) })),
1288
+ React__default["default"].createElement(StyledCardPost$1, { className: className, style: style, "data-is-marrybaby": isMarryBaby },
1289
+ isPin ? React__default["default"].createElement(treePopoverMenu.LabelPin, { className: "post-pin" }) : null,
1290
+ React__default["default"].createElement("div", { style: { position: 'relative', padding: '1rem 1rem 0' } },
1291
+ React__default["default"].createElement(index.CardAuthor, Object.assign({ avatar: avatar, name: name, username: username, url: disableCardLink ? undefined : postRelativeHref, community: community,
1292
+ // miniIcon="./svg/icon-tag.svg"
1293
+ 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["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))),
1294
+ React__default["default"].createElement("a", { href: disableCardLink ? undefined : postRelativeHref, className: "post-content-link-wrapper" },
1295
+ title && (React__default["default"].createElement(index$2.Heading, { className: "post-content-title", as: "h2", tag: "h5", fontWeight: "bold", "data-testid": "Title of the Post" }, innertext__default["default"](title))),
1296
+ React__default["default"].createElement(index.PostContent, { className: "post-content-wrapper", description: description, disableShortenContent: disableShortenContent, mentions: mentions, "data-testid": "Content of the Post" })),
1297
+ React__default["default"].createElement("span", null),
1298
+ React__default["default"].createElement("span", null),
1299
+ React__default["default"].createElement("div", { key: "tag-topic" }, topics && topics.length > 0 ? (React__default["default"].createElement(treePopoverMenu.TagTopic, { topics: topics, className: "post-topics" })) : null),
1300
+ React__default["default"].createElement("div", { key: "social-preview" }, (post === null || post === void 0 ? void 0 : post.introUrl) ? (React__default["default"].createElement("div", { className: `social-preview-wrapper ${!!(photos === null || photos === void 0 ? void 0 : photos.length) ? 'has-image' : ''}` },
1301
+ React__default["default"].createElement(index.SocialLinkPreview, { url: post.introUrl, image: post.bannerImage }))) : null),
1302
+ React__default["default"].createElement("div", { key: "image-preview" }, !!(photos === null || photos === void 0 ? void 0 : photos.length) ? (React__default["default"].createElement("div", { className: "image-preview-wrapper" },
1303
+ React__default["default"].createElement(index.PostImagePreview, { images: photos, authorName: author === null || author === void 0 ? void 0 : author.name }))) : null),
1304
+ React__default["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["default"].createElement("div", { className: "link-preview-wrapper" },
1305
+ React__default["default"].createElement(index$7.CardLink, { title: previewUrl.title, url: previewUrl.url, image: previewUrl.image }))) : null),
1306
+ React__default["default"].createElement(treePopoverMenu.CardReactions, { isMarryBaby: isMarryBaby, type: treePopoverMenu.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(() => {
1307
+ onCommentClick ? onCommentClick() : setShowInputComment((v) => !v);
1308
+ }), onCommentCountClick: () => {
1309
+ authActionWrapper(() => {
1310
+ isMarryBaby
1311
+ ? setShowInputComment(true)
1312
+ : onCommentCountClick
1313
+ ? onCommentCountClick()
1314
+ : !disableCardLink && (window.location.href = postRelativeHref);
1315
+ });
1316
+ }, onShareClick: () => {
1317
+ setIsOpenSharePopup(true);
1318
+ }, onLikeClick: () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1319
+ if (!id || isLikeLoading)
1320
+ return;
1321
+ setIsLikeLoading(true);
1322
+ try {
1323
+ const res = yield index.likeUnlikePost({
1324
+ id,
1325
+ locale,
1326
+ });
1327
+ if ((res === null || res === void 0 ? void 0 : res.status) !== 1) {
1328
+ pushNotifications(index.getDefaultFailNoti(t));
1329
+ }
1330
+ else {
1331
+ setPost((p) => (Object.assign(Object.assign({}, p), { likesCount: (p.likesCount || 0) + (!p.liked ? 1 : -1), liked: !p.liked })));
1332
+ }
1333
+ }
1334
+ catch (_a) {
1335
+ pushNotifications(index.getDefaultFailNoti(t));
1336
+ }
1337
+ setIsLikeLoading(false);
1338
+ }), showingMostEngaging: !!(showMostEngaging && (mostEngagingComment === null || mostEngagingComment === void 0 ? void 0 : mostEngagingComment.id)) }),
1339
+ showInputComment && (React__default["default"].createElement(index.InputCommentBar, { isMainCmt: !propsShowInputComment, onClose: () => setShowInputComment(false), onPostSuccess: onPostCommentSuccess, post: post })),
1340
+ showMostEngaging && (mostEngagingComment === null || mostEngagingComment === void 0 ? void 0 : mostEngagingComment.id) ? (React__default["default"].createElement("div", { className: "most-engaging-wrapper", onClick: (e) => {
1341
+ if (onMostEngagingCommentClick) {
1342
+ e.stopPropagation();
1343
+ onMostEngagingCommentClick();
1344
+ }
1345
+ else
1346
+ window.location.href = postRelativeHref;
1347
+ } },
1348
+ React__default["default"].createElement(CardReply, { hasQuickBookingEnable: hasQuickBookingEnable, handleMakeAppointment: handleMakeAppointment, comment: mostEngagingComment, post: post, onDeleteComment: () => {
1349
+ onDeleteComment && onDeleteComment(mostEngagingComment);
1350
+ }, className: "most-engaging-comment", type: "most-engaging", key: mostEngagingComment.id, cardAuthorProps: cardAuthorProps }),
1351
+ commentsCount > 1 && !hideViewMoreComment && (React__default["default"].createElement(index$5.Button, { className: "see-more-comments", color: "ghost", size: "md" }, t('comment.seeMoreComments', {
1352
+ count: commentsCount - 1,
1353
+ }))))) : null,
1354
+ InlineCommentsComponent)));
1355
+ };
1356
+
1357
+ exports.CardPost = CardPost;
1358
+ exports.CardPostPopoverMore = CardPostPopoverMore;
1359
+ exports.CardReply = CardReply;
1360
+ exports.CardReplyPopover = CardReplyPopover;
1361
+ exports.SourceList = SourceList;
1362
+ exports.VerifiedTag = VerifiedTag;