@hhgtech/hhg-components 1.27.123 → 1.27.124

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 (281) hide show
  1. package/build/babyGrowth.js +2 -2
  2. package/build/cache.js +1 -1
  3. package/build/care.js +1 -1
  4. package/build/components.js +1 -1
  5. package/build/constants.js +1 -1
  6. package/build/{core-c2066759.js → core-2677ffe8.js} +1 -1
  7. package/build/ecom.js +1 -1
  8. package/build/esm/babyGrowth.js +4 -4
  9. package/build/esm/cache.js +1 -1
  10. package/build/esm/care.js +1 -1
  11. package/build/esm/components.js +1 -1
  12. package/build/esm/constants.js +1 -1
  13. package/build/esm/{core-0975bf40.js → core-7ae30083.js} +1 -1
  14. package/build/esm/ecom.js +1 -1
  15. package/build/esm/{fixedBottomAdBlock-ca71e1b6.js → fixedBottomAdBlock-660792ef.js} +1 -1
  16. package/build/esm/footer.js +1 -1
  17. package/build/esm/gAssets.js +1 -1
  18. package/build/esm/{getDynamicHealthTool-34498540.js → getDynamicHealthTool-c771566e.js} +1 -1
  19. package/build/esm/{getSocialList-62f073cd.js → getSocialList-bec7829d.js} +1 -1
  20. package/build/esm/hooks.js +1 -1
  21. package/build/esm/i18n-values/en-PH.js +1 -1
  22. package/build/esm/i18n-values/hi-IN.js +1 -1
  23. package/build/esm/i18n-values/id-ID.js +1 -1
  24. package/build/esm/i18n-values/km-KH.js +1 -1
  25. package/build/esm/i18n-values/my-MM.js +1 -1
  26. package/build/esm/i18n-values/th-TH.js +1 -1
  27. package/build/esm/i18n-values/tl-PH.js +1 -1
  28. package/build/esm/i18n-values/vi-VN.js +1 -1
  29. package/build/esm/i18n-values/vi-VN_MB.js +1 -1
  30. package/build/esm/i18n-values/zh-TW.js +1 -1
  31. package/build/esm/i18n.js +1 -1
  32. package/build/esm/i18nV2.js +1 -1
  33. package/build/esm/{index-bda1a9c4.js → index-0eee890e.js} +1 -1
  34. package/build/esm/{index-677676f8.js → index-114b0994.js} +1 -1
  35. package/build/esm/{index-fecb1aeb.js → index-1d2daa95.js} +1 -1
  36. package/build/esm/index-235f43fe.js +1 -0
  37. package/build/esm/{index-404b41f0.js → index-2daca7dd.js} +1 -1
  38. package/build/esm/{index-b3429d5e.js → index-400dbcf2.js} +1 -1
  39. package/build/esm/{index-077c1262.js → index-4bf3154c.js} +1 -1
  40. package/build/esm/{index-8f032520.js → index-5ee3ec4a.js} +1 -1
  41. package/build/esm/{index-b5930d9c.js → index-61e1459d.js} +1 -1
  42. package/build/esm/{index-668ad758.js → index-635cd132.js} +1 -1
  43. package/build/esm/index-6384bfbc.js +1 -0
  44. package/build/esm/{index-872e4dff.js → index-716f19eb.js} +1 -1
  45. package/build/esm/{index-63bc45f8.js → index-7fd9c29c.js} +1 -1
  46. package/build/esm/{index-c6e59639.js → index-94068e3f.js} +1 -1
  47. package/build/esm/{index-6c33e11e.js → index-c9e74f1d.js} +1 -1
  48. package/build/esm/{index-f456a254.js → index-d1512ba9.js} +1 -1
  49. package/build/esm/index-d217485f.js +1 -0
  50. package/build/esm/{index-bb16c1c0.js → index-ddc6611a.js} +1 -1
  51. package/build/esm/{index-08fbc732.js → index-ddf66d49.js} +1 -1
  52. package/build/esm/{index-69c5d984.js → index-f0e3970a.js} +1 -1
  53. package/build/esm/{index-7e5cfea8.js → index-f4691f44.js} +1 -1
  54. package/build/esm/index.js +1 -1
  55. package/build/esm/{index.styled-7fd65e56.js → index.styled-80ac962e.js} +4 -4
  56. package/build/esm/{index.styled-8fd2215d.js → index.styled-8f15b66e.js} +4 -4
  57. package/build/esm/{index.styled-47e6c75d.js → index.styled-a17185a3.js} +2 -2
  58. package/build/esm/{index.styles-f76ba299.js → index.styles-84264296.js} +1 -1
  59. package/build/esm/lead.js +1 -1
  60. package/build/esm/mantine.js +1 -1
  61. package/build/esm/misc.js +1 -1
  62. package/build/esm/navigation.js +1 -1
  63. package/build/esm/{normalizeLink-1bd77e98.js → normalizeLink-08f6b8bc.js} +1 -1
  64. package/build/esm/onboarding.js +1 -1
  65. package/build/esm/onboardingV2.js +1 -1
  66. package/build/esm/pwg.js +5 -5
  67. package/build/esm/together.js +1 -1
  68. package/build/esm/{types-b9a08e0c.js → types-1ae195b5.js} +1 -1
  69. package/build/esm/{types-e93580b6.js → types-db4ca794.js} +1 -1
  70. package/build/esm/types.js +1 -1
  71. package/build/esm/{useCategory-4ce85b2c.js → useCategory-59efba9b.js} +1 -1
  72. package/build/esm/useHealthToolCache-f99a226a.js +1 -0
  73. package/build/esm/{useRafState-8018d22c.js → useRafState-042b9b4e.js} +1 -1
  74. package/build/esm/{useTranslations-fb78eaa6.js → useTranslations-2a6726ad.js} +1 -1
  75. package/build/esm/{utils-bf60cd28.js → utils-30bfad1b.js} +1 -1
  76. package/build/esm/vaccination.js +12 -12
  77. package/build/{fixedBottomAdBlock-fb4577e6.js → fixedBottomAdBlock-11bc37d1.js} +1 -1
  78. package/build/footer.js +1 -1
  79. package/build/gAssets.js +1 -1
  80. package/build/{getDynamicHealthTool-ab63ba31.js → getDynamicHealthTool-c3ec7203.js} +1 -1
  81. package/build/{getSocialList-f8b201e4.js → getSocialList-9959c4bc.js} +1 -1
  82. package/build/hooks.js +1 -1
  83. package/build/i18n-values/en-PH.js +1 -1
  84. package/build/i18n-values/hi-IN.js +1 -1
  85. package/build/i18n-values/id-ID.js +1 -1
  86. package/build/i18n-values/km-KH.js +1 -1
  87. package/build/i18n-values/my-MM.js +1 -1
  88. package/build/i18n-values/th-TH.js +1 -1
  89. package/build/i18n-values/tl-PH.js +1 -1
  90. package/build/i18n-values/vi-VN.js +1 -1
  91. package/build/i18n-values/vi-VN_MB.js +1 -1
  92. package/build/i18n-values/zh-TW.js +1 -1
  93. package/build/i18n.js +1 -1
  94. package/build/i18nV2.js +1 -1
  95. package/build/index-0af2e00e.js +1 -0
  96. package/build/{index-5fc5cad2.js → index-126c526c.js} +1 -1
  97. package/build/index-146c0662.js +1 -0
  98. package/build/{index-ea685c28.js → index-19063c94.js} +3 -3
  99. package/build/{index-5d4709d4.js → index-2654ea13.js} +1 -1
  100. package/build/{index-8d24595c.js → index-2f2b9b6f.js} +1 -1
  101. package/build/{index-cc6c1571.js → index-3a498415.js} +1 -1
  102. package/build/{index-2bf5d581.js → index-45a27811.js} +1 -1
  103. package/build/{index-4279ffe1.js → index-46d9cba7.js} +1 -1
  104. package/build/{index-828e7d0c.js → index-623e5f9e.js} +1 -1
  105. package/build/{index-6df88b82.js → index-65622957.js} +1 -1
  106. package/build/{index-96446ba1.js → index-6968d72c.js} +1 -1
  107. package/build/{index-190ed381.js → index-94f6ea66.js} +1 -1
  108. package/build/{index-ce84b8a1.js → index-9e1e27c4.js} +1 -1
  109. package/build/{index-bc368d6c.js → index-9faf9072.js} +1 -1
  110. package/build/{index-c5b36de4.js → index-b90a3e0d.js} +1 -1
  111. package/build/{index-d1f8ff9f.js → index-c917bb6a.js} +1 -1
  112. package/build/index-cb93a5a5.js +1 -0
  113. package/build/{index-0abc96e8.js → index-cd875ad3.js} +1 -1
  114. package/build/{index-9fd0f50f.js → index-dd83265f.js} +1 -1
  115. package/build/{index-464d865b.js → index-f8959db6.js} +2 -2
  116. package/build/index.js +1 -1
  117. package/build/{index.styled-ca402c7e.js → index.styled-5782fa6c.js} +5 -5
  118. package/build/{index.styled-70fc1693.js → index.styled-8786f3c7.js} +3 -3
  119. package/build/{index.styled-82ccf966.js → index.styled-fb3b67b4.js} +2 -2
  120. package/build/{index.styles-7e6f1ade.js → index.styles-e11660ee.js} +1 -1
  121. package/build/lead.js +1 -1
  122. package/build/mantine.js +1 -1
  123. package/build/misc.js +1 -1
  124. package/build/navigation.js +1 -1
  125. package/build/{normalizeLink-e0bf8cb3.js → normalizeLink-013048ff.js} +1 -1
  126. package/build/onboarding.js +1 -1
  127. package/build/onboardingV2.js +1 -1
  128. package/build/pwg.js +1 -1
  129. package/build/together.js +1 -1
  130. package/build/{types-deb4ea14.js → types-198d6aa6.js} +1 -1
  131. package/build/{types-81245c95.js → types-a9a8b6da.js} +1 -1
  132. package/build/types.js +1 -1
  133. package/build/{useCategory-c9c00b56.js → useCategory-642c5d6e.js} +1 -1
  134. package/build/{useHealthToolCache-e847f293.js → useHealthToolCache-be0f5a6c.js} +1 -1
  135. package/build/{useRafState-296ffa25.js → useRafState-36fa6aa1.js} +1 -1
  136. package/build/{useTranslations-1317bce3.js → useTranslations-10d0cd79.js} +1 -1
  137. package/build/utils-79d816c1.js +1 -0
  138. package/build/vaccination.js +1 -1
  139. package/package.json +1 -1
  140. package/build/esm/index-0d325239.js +0 -1
  141. package/build/esm/index-4ab10697.js +0 -1
  142. package/build/esm/index-86adbb1b.js +0 -1
  143. package/build/esm/useHealthToolCache-c751423d.js +0 -1
  144. package/build/index-7d78b945.js +0 -1
  145. package/build/index-8da99d43.js +0 -1
  146. package/build/index-d70cdd28.js +0 -1
  147. package/build/utils-0f409696.js +0 -1
  148. /package/build/{BMI_BOYS.percentile.monthly-faf0bcd6.js → BMI_BOYS.percentile.monthly-149c39a8.js} +0 -0
  149. /package/build/{BMI_BOYS.percentile.weekly-6fdda5d8.js → BMI_BOYS.percentile.weekly-00f91ec1.js} +0 -0
  150. /package/build/{BMI_BOYS.percentile.yearly-debfdcc2.js → BMI_BOYS.percentile.yearly-c2fdd8ef.js} +0 -0
  151. /package/build/{BMI_BOYS.zscore.monthly-085c678c.js → BMI_BOYS.zscore.monthly-938480af.js} +0 -0
  152. /package/build/{BMI_BOYS.zscore.weekly-052c4826.js → BMI_BOYS.zscore.weekly-09b37919.js} +0 -0
  153. /package/build/{BMI_BOYS.zscore.yearly-a5a2c959.js → BMI_BOYS.zscore.yearly-3573e4a9.js} +0 -0
  154. /package/build/{BMI_GIRLS.percentile.monthly-94bb8933.js → BMI_GIRLS.percentile.monthly-83375318.js} +0 -0
  155. /package/build/{BMI_GIRLS.percentile.weekly-b0978da3.js → BMI_GIRLS.percentile.weekly-90d70211.js} +0 -0
  156. /package/build/{BMI_GIRLS.percentile.yearly-d11cbd55.js → BMI_GIRLS.percentile.yearly-4de59211.js} +0 -0
  157. /package/build/{BMI_GIRLS.zscore.monthly-4b93b0e2.js → BMI_GIRLS.zscore.monthly-10c1e6e1.js} +0 -0
  158. /package/build/{BMI_GIRLS.zscore.weekly-fbaa2b52.js → BMI_GIRLS.zscore.weekly-92e033a1.js} +0 -0
  159. /package/build/{BMI_GIRLS.zscore.yearly-4b4c3d38.js → BMI_GIRLS.zscore.yearly-e338a676.js} +0 -0
  160. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-c1c620c1.js → HEAD CIRCUM_BOYS.percentile.monthly-2c03f51a.js} +0 -0
  161. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-b339f7c1.js → HEAD CIRCUM_BOYS.percentile.weekly-bb797f18.js} +0 -0
  162. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-1ea4d46f.js → HEAD CIRCUM_BOYS.percentile.yearly-b73f8979.js} +0 -0
  163. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-307e8d2e.js → HEAD CIRCUM_BOYS.zscore.monthly-bb29b03a.js} +0 -0
  164. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-4661b0ff.js → HEAD CIRCUM_BOYS.zscore.weekly-3dea97fe.js} +0 -0
  165. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-14f4cb6b.js → HEAD CIRCUM_BOYS.zscore.yearly-b3df7539.js} +0 -0
  166. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-d9cd02c3.js → HEAD CIRCUM_GIRLS.percentile.monthly-a99ae1b6.js} +0 -0
  167. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-6c4dea2d.js → HEAD CIRCUM_GIRLS.percentile.weekly-e73fed83.js} +0 -0
  168. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-06b86aad.js → HEAD CIRCUM_GIRLS.percentile.yearly-a9b97026.js} +0 -0
  169. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-123e08cd.js → HEAD CIRCUM_GIRLS.zscore.monthly-cac3664d.js} +0 -0
  170. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-a0a4b988.js → HEAD CIRCUM_GIRLS.zscore.weekly-6b51389f.js} +0 -0
  171. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-83de6718.js → HEAD CIRCUM_GIRLS.zscore.yearly-672a7fce.js} +0 -0
  172. /package/build/{HEIGHT_BOYS.percentile.monthly-bc86b190.js → HEIGHT_BOYS.percentile.monthly-86583084.js} +0 -0
  173. /package/build/{HEIGHT_BOYS.percentile.weekly-0568f442.js → HEIGHT_BOYS.percentile.weekly-41d345a6.js} +0 -0
  174. /package/build/{HEIGHT_BOYS.percentile.yearly-a2b26101.js → HEIGHT_BOYS.percentile.yearly-9cb053de.js} +0 -0
  175. /package/build/{HEIGHT_BOYS.zscore.monthly-22aa07ad.js → HEIGHT_BOYS.zscore.monthly-a6aff577.js} +0 -0
  176. /package/build/{HEIGHT_BOYS.zscore.weekly-fab23651.js → HEIGHT_BOYS.zscore.weekly-b63dd8fb.js} +0 -0
  177. /package/build/{HEIGHT_BOYS.zscore.yearly-66917eb5.js → HEIGHT_BOYS.zscore.yearly-096cf2ab.js} +0 -0
  178. /package/build/{HEIGHT_GIRLS.percentile.monthly-0c1c0014.js → HEIGHT_GIRLS.percentile.monthly-a97ddc4b.js} +0 -0
  179. /package/build/{HEIGHT_GIRLS.percentile.weekly-868b19d0.js → HEIGHT_GIRLS.percentile.weekly-68a4d45e.js} +0 -0
  180. /package/build/{HEIGHT_GIRLS.percentile.yearly-5855f018.js → HEIGHT_GIRLS.percentile.yearly-3a1fb2fb.js} +0 -0
  181. /package/build/{HEIGHT_GIRLS.zscore.monthly-47b108b7.js → HEIGHT_GIRLS.zscore.monthly-7b9252a0.js} +0 -0
  182. /package/build/{HEIGHT_GIRLS.zscore.weekly-a8f53fe3.js → HEIGHT_GIRLS.zscore.weekly-953e138f.js} +0 -0
  183. /package/build/{HEIGHT_GIRLS.zscore.yearly-83354989.js → HEIGHT_GIRLS.zscore.yearly-dcf8dfac.js} +0 -0
  184. /package/build/{Onboarding-d141cba2.js → Onboarding-e89cd92f.js} +0 -0
  185. /package/build/{Visible-aeb4045c.js → Visible-b5af9ea7.js} +0 -0
  186. /package/build/{WEIGHT_BOYS.percentile.monthly-53352044.js → WEIGHT_BOYS.percentile.monthly-59b8e928.js} +0 -0
  187. /package/build/{WEIGHT_BOYS.percentile.weekly-f37b3fe8.js → WEIGHT_BOYS.percentile.weekly-b957985d.js} +0 -0
  188. /package/build/{WEIGHT_BOYS.percentile.yearly-dd5c05cc.js → WEIGHT_BOYS.percentile.yearly-c9367a8a.js} +0 -0
  189. /package/build/{WEIGHT_BOYS.zscore.monthly-8491b55b.js → WEIGHT_BOYS.zscore.monthly-c66285a2.js} +0 -0
  190. /package/build/{WEIGHT_BOYS.zscore.weekly-71bcecee.js → WEIGHT_BOYS.zscore.weekly-1a0f69d3.js} +0 -0
  191. /package/build/{WEIGHT_BOYS.zscore.yearly-135dd7c7.js → WEIGHT_BOYS.zscore.yearly-e39af9f9.js} +0 -0
  192. /package/build/{WEIGHT_GIRLS.percentile.monthly-fdfbf584.js → WEIGHT_GIRLS.percentile.monthly-6b4eec36.js} +0 -0
  193. /package/build/{WEIGHT_GIRLS.percentile.weekly-5eedc223.js → WEIGHT_GIRLS.percentile.weekly-f6db90cd.js} +0 -0
  194. /package/build/{WEIGHT_GIRLS.percentile.yearly-e90bc230.js → WEIGHT_GIRLS.percentile.yearly-2984069f.js} +0 -0
  195. /package/build/{WEIGHT_GIRLS.zscore.monthly-0a1a2650.js → WEIGHT_GIRLS.zscore.monthly-cdf2d6e0.js} +0 -0
  196. /package/build/{WEIGHT_GIRLS.zscore.weekly-e06910ff.js → WEIGHT_GIRLS.zscore.weekly-4342d1ee.js} +0 -0
  197. /package/build/{WEIGHT_GIRLS.zscore.yearly-1161ee12.js → WEIGHT_GIRLS.zscore.yearly-ae0f1cb8.js} +0 -0
  198. /package/build/{constants-5274b0fa.js → constants-d04930bd.js} +0 -0
  199. /package/build/{cookieHelper-daa7dc3f.js → cookieHelper-930da89d.js} +0 -0
  200. /package/build/{dataTransform-233276eb.js → dataTransform-c8f67078.js} +0 -0
  201. /package/build/esm/{BMI_BOYS.percentile.monthly-db5891f8.js → BMI_BOYS.percentile.monthly-5bc4a316.js} +0 -0
  202. /package/build/esm/{BMI_BOYS.percentile.weekly-06df601f.js → BMI_BOYS.percentile.weekly-0aebc2c2.js} +0 -0
  203. /package/build/esm/{BMI_BOYS.percentile.yearly-8af8a1a1.js → BMI_BOYS.percentile.yearly-54f531ae.js} +0 -0
  204. /package/build/esm/{BMI_BOYS.zscore.monthly-efd16752.js → BMI_BOYS.zscore.monthly-de484a45.js} +0 -0
  205. /package/build/esm/{BMI_BOYS.zscore.weekly-4d692fce.js → BMI_BOYS.zscore.weekly-c0e6a2ee.js} +0 -0
  206. /package/build/esm/{BMI_BOYS.zscore.yearly-f136a1f9.js → BMI_BOYS.zscore.yearly-e0e11ead.js} +0 -0
  207. /package/build/esm/{BMI_GIRLS.percentile.monthly-1fd9e93a.js → BMI_GIRLS.percentile.monthly-79df8d22.js} +0 -0
  208. /package/build/esm/{BMI_GIRLS.percentile.weekly-201d8e1d.js → BMI_GIRLS.percentile.weekly-ffc4b787.js} +0 -0
  209. /package/build/esm/{BMI_GIRLS.percentile.yearly-46ac63fc.js → BMI_GIRLS.percentile.yearly-d1e16d02.js} +0 -0
  210. /package/build/esm/{BMI_GIRLS.zscore.monthly-ace52b3b.js → BMI_GIRLS.zscore.monthly-44ba19f7.js} +0 -0
  211. /package/build/esm/{BMI_GIRLS.zscore.weekly-645a3833.js → BMI_GIRLS.zscore.weekly-75b082af.js} +0 -0
  212. /package/build/esm/{BMI_GIRLS.zscore.yearly-1e3fe010.js → BMI_GIRLS.zscore.yearly-eecb3681.js} +0 -0
  213. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-37ae868d.js → HEAD CIRCUM_BOYS.percentile.monthly-6b44e0b5.js} +0 -0
  214. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-ab6dcd19.js → HEAD CIRCUM_BOYS.percentile.weekly-4d415873.js} +0 -0
  215. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-ef84c320.js → HEAD CIRCUM_BOYS.percentile.yearly-0c94c47e.js} +0 -0
  216. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-f1e3be25.js → HEAD CIRCUM_BOYS.zscore.monthly-7ff98046.js} +0 -0
  217. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-de5c9958.js → HEAD CIRCUM_BOYS.zscore.weekly-c2d749d2.js} +0 -0
  218. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-c76bef74.js → HEAD CIRCUM_BOYS.zscore.yearly-a611fa0f.js} +0 -0
  219. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-56a664d2.js → HEAD CIRCUM_GIRLS.percentile.monthly-869bc323.js} +0 -0
  220. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-030fa792.js → HEAD CIRCUM_GIRLS.percentile.weekly-e4dbb5cc.js} +0 -0
  221. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-12fcb069.js → HEAD CIRCUM_GIRLS.percentile.yearly-262c8fa2.js} +0 -0
  222. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-5bb55da0.js → HEAD CIRCUM_GIRLS.zscore.monthly-6424e8af.js} +0 -0
  223. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-7600aa2b.js → HEAD CIRCUM_GIRLS.zscore.weekly-3b057248.js} +0 -0
  224. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-54cc5911.js → HEAD CIRCUM_GIRLS.zscore.yearly-ed59bf39.js} +0 -0
  225. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-eb4d9a2d.js → HEIGHT_BOYS.percentile.monthly-1878a4d0.js} +0 -0
  226. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-a0843711.js → HEIGHT_BOYS.percentile.weekly-c32dac3e.js} +0 -0
  227. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-a91644ec.js → HEIGHT_BOYS.percentile.yearly-5b2e6515.js} +0 -0
  228. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-79aa7e98.js → HEIGHT_BOYS.zscore.monthly-cdf78c11.js} +0 -0
  229. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-fbcfeecf.js → HEIGHT_BOYS.zscore.weekly-9bf8e0a7.js} +0 -0
  230. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-f929174c.js → HEIGHT_BOYS.zscore.yearly-e531fec7.js} +0 -0
  231. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-4bf4b4d6.js → HEIGHT_GIRLS.percentile.monthly-4a3d6d5e.js} +0 -0
  232. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-830e4dac.js → HEIGHT_GIRLS.percentile.weekly-2b4f2c41.js} +0 -0
  233. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-65f1e094.js → HEIGHT_GIRLS.percentile.yearly-c8b40037.js} +0 -0
  234. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-d99b2e7f.js → HEIGHT_GIRLS.zscore.monthly-67bc81da.js} +0 -0
  235. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-cf56b679.js → HEIGHT_GIRLS.zscore.weekly-63d04a2d.js} +0 -0
  236. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-a429854a.js → HEIGHT_GIRLS.zscore.yearly-63eab4d6.js} +0 -0
  237. /package/build/esm/{Onboarding-6f63373e.js → Onboarding-31b3a30c.js} +0 -0
  238. /package/build/esm/{Visible-69680124.js → Visible-bc29c4b2.js} +0 -0
  239. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-7d21a8ec.js → WEIGHT_BOYS.percentile.monthly-3c25331d.js} +0 -0
  240. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-acab2d2b.js → WEIGHT_BOYS.percentile.weekly-6ca9c60c.js} +0 -0
  241. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-43aaea1e.js → WEIGHT_BOYS.percentile.yearly-ee604c89.js} +0 -0
  242. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-1ddf9007.js → WEIGHT_BOYS.zscore.monthly-4caa7530.js} +0 -0
  243. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-90324102.js → WEIGHT_BOYS.zscore.weekly-67984e80.js} +0 -0
  244. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-6bbcfd47.js → WEIGHT_BOYS.zscore.yearly-b02c9422.js} +0 -0
  245. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-b33827e8.js → WEIGHT_GIRLS.percentile.monthly-48794e0a.js} +0 -0
  246. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-df7398cf.js → WEIGHT_GIRLS.percentile.weekly-11ca82bb.js} +0 -0
  247. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-d6b749d4.js → WEIGHT_GIRLS.percentile.yearly-66f30fd4.js} +0 -0
  248. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-a189a67f.js → WEIGHT_GIRLS.zscore.monthly-a4bb9145.js} +0 -0
  249. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-4e9a2078.js → WEIGHT_GIRLS.zscore.weekly-bc4b1f1e.js} +0 -0
  250. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-b0581843.js → WEIGHT_GIRLS.zscore.yearly-2661bfb1.js} +0 -0
  251. /package/build/esm/{constants-18526b3f.js → constants-b3b346a4.js} +0 -0
  252. /package/build/esm/{cookieHelper-c559a980.js → cookieHelper-07052ace.js} +0 -0
  253. /package/build/esm/{dataTransform-18554841.js → dataTransform-e4fc6392.js} +0 -0
  254. /package/build/esm/{index-7a13c037.js → index-bc199281.js} +0 -0
  255. /package/build/esm/{isProduction-113a4b10.js → isProduction-7a7c6ecc.js} +0 -0
  256. /package/build/esm/{localizeNumberFormat-7ac5f753.js → localizeNumberFormat-0874e73b.js} +0 -0
  257. /package/build/esm/{number-709f2f73.js → number-05c45808.js} +0 -0
  258. /package/build/esm/{paths-8a83e062.js → paths-6a6772c7.js} +0 -0
  259. /package/build/esm/{screenSizeContext-6c665bac.js → screenSizeContext-fa90677d.js} +0 -0
  260. /package/build/esm/{theme-e09e9875.js → theme-62002a29.js} +0 -0
  261. /package/build/esm/{translationsContext-30e14033.js → translationsContext-233071ee.js} +0 -0
  262. /package/build/esm/{tslib.es6-7a94e4cc.js → tslib.es6-99366ebb.js} +0 -0
  263. /package/build/esm/{types-2ae92b95.js → types-f9c83a14.js} +0 -0
  264. /package/build/esm/{useIsInit-72cdd8de.js → useIsInit-b28ee850.js} +0 -0
  265. /package/build/esm/{useOutsideClick-7cd56fe5.js → useOutsideClick-f6b5cd0e.js} +0 -0
  266. /package/build/esm/{useScrollbarSize-8a23eb91.js → useScrollbarSize-e304779e.js} +0 -0
  267. /package/build/esm/{useUniqueId-e09e9e8d.js → useUniqueId-ec49984b.js} +0 -0
  268. /package/build/{index-6680fbcd.js → index-c48e2136.js} +0 -0
  269. /package/build/{isProduction-ed26692e.js → isProduction-a9c34dc0.js} +0 -0
  270. /package/build/{localizeNumberFormat-bed0f4a7.js → localizeNumberFormat-17c3c4b6.js} +0 -0
  271. /package/build/{number-3867c618.js → number-f2401651.js} +0 -0
  272. /package/build/{paths-48acbafe.js → paths-daf0280c.js} +0 -0
  273. /package/build/{screenSizeContext-021f82c6.js → screenSizeContext-33e6c658.js} +0 -0
  274. /package/build/{theme-dc87077d.js → theme-dd5f10d8.js} +0 -0
  275. /package/build/{translationsContext-627c9071.js → translationsContext-bded011e.js} +0 -0
  276. /package/build/{tslib.es6-5976a9fa.js → tslib.es6-bb49a3d1.js} +0 -0
  277. /package/build/{types-95ecc08a.js → types-13e699dc.js} +0 -0
  278. /package/build/{useIsInit-d151b841.js → useIsInit-692e6042.js} +0 -0
  279. /package/build/{useOutsideClick-f5e962a5.js → useOutsideClick-4a2f0e3a.js} +0 -0
  280. /package/build/{useScrollbarSize-dad626c2.js → useScrollbarSize-8eed9d3a.js} +0 -0
  281. /package/build/{useUniqueId-bf049d59.js → useUniqueId-d8647562.js} +0 -0
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("./tslib.es6-5976a9fa.js"),t=require("react"),a=require("./useTranslations-1317bce3.js"),i=require("lodash/debounce"),o=require("./constants-5274b0fa.js"),l=require("./index-8d24595c.js"),n=require("styled-components"),s=require("./index-bc368d6c.js"),r=require("./theme-dc87077d.js"),c=require("./screenSizeContext-021f82c6.js"),d=require("react-loading-skeleton"),u=require("lodash/shuffle"),p=require("./useOutsideClick-f5e962a5.js"),h=require("./paths-48acbafe.js"),g=require("@mantine/core"),f=require("./index-0abc96e8.js"),m=require("./cookieHelper-daa7dc3f.js"),C=require("./index-c5b36de4.js"),b=require("string-format");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function v(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var x=v(t),E=y(t),S=y(i),w=y(n),L=y(d),O=y(u),k=y(b);const I=e=>x.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},e),x.createElement("path",{d:"M7.99969 9.38055L5.45236 6.83322C5.17636 6.55722 4.72836 6.55722 4.45236 6.83322C4.17636 7.10922 4.17636 7.55722 4.45236 7.83322L7.52836 10.9092C7.78903 11.1699 8.21103 11.1699 8.47103 10.9092L11.547 7.83322C11.823 7.55722 11.823 7.10922 11.547 6.83322C11.271 6.55722 10.823 6.55722 10.547 6.83322L7.99969 9.38055Z"}));function T(){const[e,a]=t.useState((()=>{if("undefined"==typeof window)return"unset";if(m.getCookie(f.USER_GEOLOCATION_COORDINATES_COOKIE))return"granted";const e=!location.protocol.includes("https")&&"localhost"!==location.hostname;return!navigator.geolocation||e?"denied":"unset"})),[i,o]=t.useState((()=>{if("undefined"==typeof window)return null;const e=m.getCookie(f.USER_GEOLOCATION_COORDINATES_COOKIE);if(e)try{return JSON.parse(e)}catch(e){console.log(e)}return null})),l=t.useCallback((function(){navigator.geolocation&&navigator.geolocation.getCurrentPosition((e=>{const t={lat:""+Math.round(1e7*e.coords.latitude)/1e7,lng:""+Math.round(1e7*e.coords.longitude)/1e7};m.setCookie(f.USER_GEOLOCATION_COORDINATES_COOKIE,JSON.stringify(t),{minutes:15}),o(t),a("granted")}),(()=>{m.deleteCookie(f.USER_GEOLOCATION_COORDINATES_COOKIE),a("denied")}))}),[]);return t.useMemo((()=>({geoLocationPermission:e,geoLocationCoordinates:i,requestGeoLocation:l})),[e,i])}const j=w.default.div``,M=w.default.div`
1
+ "use strict";var e=require("./tslib.es6-bb49a3d1.js"),t=require("react"),a=require("./useTranslations-10d0cd79.js"),i=require("lodash/debounce"),o=require("./constants-d04930bd.js"),l=require("./index-2f2b9b6f.js"),n=require("styled-components"),s=require("./index-9faf9072.js"),r=require("./theme-dd5f10d8.js"),c=require("./screenSizeContext-33e6c658.js"),d=require("react-loading-skeleton"),u=require("lodash/shuffle"),p=require("./useOutsideClick-4a2f0e3a.js"),h=require("./paths-daf0280c.js"),g=require("@mantine/core"),f=require("./index-cd875ad3.js"),m=require("./cookieHelper-930da89d.js"),C=require("./index-b90a3e0d.js"),b=require("string-format");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function v(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var x=v(t),E=y(t),S=y(i),w=y(n),L=y(d),O=y(u),k=y(b);const I=e=>x.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},e),x.createElement("path",{d:"M7.99969 9.38055L5.45236 6.83322C5.17636 6.55722 4.72836 6.55722 4.45236 6.83322C4.17636 7.10922 4.17636 7.55722 4.45236 7.83322L7.52836 10.9092C7.78903 11.1699 8.21103 11.1699 8.47103 10.9092L11.547 7.83322C11.823 7.55722 11.823 7.10922 11.547 6.83322C11.271 6.55722 10.823 6.55722 10.547 6.83322L7.99969 9.38055Z"}));function T(){const[e,a]=t.useState((()=>{if("undefined"==typeof window)return"unset";if(m.getCookie(f.USER_GEOLOCATION_COORDINATES_COOKIE))return"granted";const e=!location.protocol.includes("https")&&"localhost"!==location.hostname;return!navigator.geolocation||e?"denied":"unset"})),[i,o]=t.useState((()=>{if("undefined"==typeof window)return null;const e=m.getCookie(f.USER_GEOLOCATION_COORDINATES_COOKIE);if(e)try{return JSON.parse(e)}catch(e){console.log(e)}return null})),l=t.useCallback((function(){navigator.geolocation&&navigator.geolocation.getCurrentPosition((e=>{const t={lat:""+Math.round(1e7*e.coords.latitude)/1e7,lng:""+Math.round(1e7*e.coords.longitude)/1e7};m.setCookie(f.USER_GEOLOCATION_COORDINATES_COOKIE,JSON.stringify(t),{minutes:15}),o(t),a("granted")}),(()=>{m.deleteCookie(f.USER_GEOLOCATION_COORDINATES_COOKIE),a("denied")}))}),[]);return t.useMemo((()=>({geoLocationPermission:e,geoLocationCoordinates:i,requestGeoLocation:l})),[e,i])}const j=w.default.div``,M=w.default.div`
2
2
  --searchbar-z-index: 305;
3
3
  &[data-is-modal='true'] {
4
4
  position: fixed;
@@ -1 +1 @@
1
- "use strict";var e=require("./tslib.es6-5976a9fa.js"),t=require("react"),a=require("@mantine/core"),l=require("./index-6df88b82.js"),o=require("./useTranslations-1317bce3.js"),n=require("innertext"),i=require("./theme-dc87077d.js"),r=require("./index-c5b36de4.js"),s=require("./index.styles-7e6f1ade.js");require("@mantine/dates");var d=require("./index-0abc96e8.js");require("./Onboarding-d141cba2.js");var c=require("./gAssets.js");require("dayjs");var u=require("./screenSizeContext-021f82c6.js");require("styled-components"),require("./isProduction-ed26692e.js");var m=require("./index-464d865b.js");require("@mantine/hooks");var p=require("./index-5d4709d4.js"),v=require("./index.styled-ca402c7e.js"),g=require("./index-bc368d6c.js"),f=require("./index-8d24595c.js"),h=require("lodash/debounce"),y=require("react-contenteditable");require("./useCategory-c9c00b56.js");var C=require("./index-2bf5d581.js"),E=require("react-dom");function w(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function k(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,l.get?l:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}require("date-fns"),require("react-day-picker/DayPickerInput"),require("./index-ea685c28.js"),require("lodash/throttle"),require("./types-95ecc08a.js"),require("react-hook-form"),require("date-fns/locale/en-US"),require("date-fns/locale/id"),require("date-fns/locale/vi"),require("date-fns/locale/zh-TW"),require("./index.styled-82ccf966.js"),require("uuid"),require("./utils-0f409696.js"),require("string-format");var b=w(t),P=w(n),T=w(h),S=w(y),x=k(E);const N=({title:o,url:n,image:i,logo:r,className:d,style:c,noRefetch:u})=>{const{data:{locale:m,env:{isMarryBaby:p}}}=t.useContext(s.TogetherComponentGlobalContext),[v,f]=t.useState(!1),h=a.useMantineTheme(),y=t.useRef(u);y.current=u;const[C,E]=t.useState(null);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(!y.current){if(!n)return E(null);E((e=>Object.assign(Object.assign({},e),{isFetching:!0}))),s.callApi(s.getApiPath(s.PATHS.FETCH_PREVIEW,{_locale:m}),"POST",{data:{link:n},headers:{"Content-Type":"application/json"}}).then((e=>{var t,a,l;f(!1),E({title:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.title,url:n,image:(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.image)||(null===(l=null==e?void 0:e.data)||void 0===l?void 0:l.logo)})})).catch((()=>{E(null)}))}}))}),[n]);const w=(null==C?void 0:C.image)||i,k=(null==C?void 0:C.title)||o,P=(null==C?void 0:C.logo)||r,T=(null==C?void 0:C.url)||n,S=T.replace("http://","").replace("https://","").split(/[/?#]/)[0],x=t.useRef(!1);return b.default.createElement(l.StyledCardLink,{"data-is-marrybaby":p,className:`${d} no-replace-click`,style:c,color:h.colors[h.primaryColor][0]},b.default.createElement("a",{href:T,target:"_blank",rel:"noreferrer"},w&&b.default.createElement("div",{className:"link-image-wrapper"},!p&&b.default.createElement("img",{className:"link-image-blur",src:w,onError:e=>{x.current||(x.current=!0,e.currentTarget.src=s.DEFAULT_IMG)},loading:"lazy"}),b.default.createElement("img",{className:"link-image",src:w,onError:e=>{x.current||(x.current=!0,e.currentTarget.src=s.DEFAULT_IMG)},loading:"lazy"})),b.default.createElement("div",{className:"link-info-container"},b.default.createElement(g.Text,{size:"n1"},p&&P&&!v&&b.default.createElement("img",{className:"link-logo",src:P,onError:()=>f(!0),loading:"lazy"}),S),b.default.createElement(s.Heading,{tag:"h6"},k))))};const A=({onClick:e,color:a,className:n,style:i})=>{const{data:{env:{isMarryBaby:r}}}=t.useContext(s.TogetherComponentGlobalContext),{t:d}=o.useTranslations();return b.default.createElement(l.LabelSortPin,{label:b.default.createElement(b.default.Fragment,null,r&&b.default.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M3.5 19.9999L7.87 15.6299' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.95634 11.294C4.56534 11.685 4.56534 12.318 4.95634 12.708L7.87434 15.626L10.7923 18.544C11.1833 18.935 11.8163 18.935 12.2063 18.544L13.3813 17.369C13.5693 17.181 13.6743 16.927 13.6743 16.662V12.726L16.5743 9.82597L18.8833 9.94897C19.1663 9.96397 19.4433 9.85797 19.6433 9.65797L20.2173 9.08397C20.6083 8.69297 20.6083 8.05997 20.2173 7.66997L15.8313 3.28397C15.4403 2.89297 14.8073 2.89297 14.4173 3.28397L13.8433 3.85797C13.6423 4.05897 13.5363 4.33497 13.5523 4.61797L13.6753 6.92697L10.7753 9.82697H6.83834C6.57334 9.82697 6.31834 9.93197 6.13134 10.12L4.95634 11.294V11.294Z' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M16.5699 9.83018L13.6699 6.93018' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3c/svg%3e",loading:"lazy"})," ",d("label.pinnedPost")),rightLabel:!r&&b.default.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cline x1='7.18605' y1='7.68219' x2='3.68219' y2='13.8139' stroke='%23FEA21E' stroke-linecap='round'/%3e%3cpath d='M3.24591 7.78426C3.21275 7.84168 3.20376 7.90993 3.22092 7.97398C3.23808 8.03803 3.27998 8.09264 3.3374 8.12579L8.78429 11.2706C8.90385 11.3396 9.05674 11.2986 9.12578 11.1791C9.71191 10.1641 9.71348 8.97262 9.23682 7.99339L10.8583 5.18521C11.5115 5.00603 12.0982 4.57973 12.4638 3.94629C12.5328 3.82672 12.4919 3.67383 12.3723 3.6048L8.18237 1.18584C8.12494 1.15268 8.0567 1.1437 7.99265 1.16086C7.92861 1.17803 7.874 1.21993 7.84086 1.27736C7.47521 1.91077 7.39934 2.63194 7.57065 3.28723L5.94919 6.09545C4.86323 6.1723 3.83201 6.76934 3.24591 7.78426Z' fill='%23FEA21E' stroke='%23FEA21E' stroke-width='0.5' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"}),onClick:e,color:"white",className:`label-pinned ${n}`,style:i})},I=e=>({message:e("notification.failure"),type:"danger"});var _="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%23FE921D'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const M=(e,a)=>{const[l,o]=t.useState(e||[]);return{onSelectImages:t=>{const n=t.target.files;if(n)if(a&&e){a((e||l).concat(Array.from(n)))}else o((t=>{const l=e||t;return a&&a(l.concat(Array.from(n))),l.concat(Array.from(n))}))},onRemoveImage:t=>{if(a&&e){const l=e;l.splice(t,1),a(l.slice())}else o((l=>{const o=e||l;return o.splice(t,1),a&&a(o.slice()),o.slice()}))},onRemoveAllImages:()=>{a?a([]):o([])},imageSrcs:t.useMemo((()=>(e||l).map((e=>"string"==typeof e?e:URL.createObjectURL(e)))),[e,l]),imageFiles:e||l}};var L="data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 22.9844C17.5228 22.9844 22 18.5072 22 12.9844C22 7.46153 17.5228 2.98438 12 2.98438C6.47715 2.98438 2 7.46153 2 12.9844C2 18.5072 6.47715 22.9844 12 22.9844Z' fill='%23262626'/%3e%3cpath d='M14.8281 10.1562L9.17127 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.17188 10.1562L14.8287 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const j=({className:e,style:a,bannedWords:n=[],value:r,onChange:d,onPreviewUrlChange:c,onInvalidUrlsChange:u,onImageFilesChange:m,imageFiles:p,isReplying:v})=>{const{t:f}=o.useTranslations(),[h,y]=t.useState(null),C=t.useRef(null),{onSelectImages:E,onRemoveImage:w,imageSrcs:k}=M(p,m);return t.useEffect((()=>{c&&((null==h?void 0:h.url)?c({title:h.title||"",url:h.url||"",image:h.image||"",description:h.description||""}):c(null))}),[h]),b.default.createElement(l.StyledCreatePostDescription,{className:e,style:a},b.default.createElement(g.Text,{size:"p4",className:"description-label"},f("createPost.popup.description")),b.default.createElement("div",{className:"textarea-control"},b.default.createElement("div",{className:"textarea-wrapper"},b.default.createElement(l.RichTextEditor,{html:r||"",onChange:d,bannedWords:n,onImagePickerClick:()=>{var e;return null===(e=C.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:y,onInvalidUrlsChange:u,isReplying:v}))),b.default.createElement(g.Text,{size:"p4",className:"count-string"},f("character"),": ",P.default(r||"").length),(!k||0===k.length)&&h&&b.default.createElement("div",{className:"link-preview-wrapper"},h.isFetching?b.default.createElement(l.Loading,null):b.default.createElement(b.default.Fragment,null,b.default.createElement(N,{title:h.title,url:h.url||"#",image:h.image,noRefetch:!0}),b.default.createElement("img",{src:L,className:"icon-close",onClick:()=>y(null),loading:"lazy"}))),b.default.createElement("input",{ref:C,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:E}),k.length>s.MAX_IMAGE_UPLOADS?b.default.createElement("div",{className:"input-notification"},b.default.createElement("img",{src:_,loading:"lazy"}),b.default.createElement(g.Text,{size:"p4",color:i.theme.colors.alertWarning},f("createPost.popup.warningImage"))):null,k.length>0&&b.default.createElement("div",{className:"image-gallery"},k.map(((e,t)=>b.default.createElement("div",{key:t,className:"image-item"},b.default.createElement("img",{src:e,loading:"lazy"}),b.default.createElement("img",{className:"close-btn",src:L,onClick:()=>w(t),loading:"lazy"}))))))},R=(e,t)=>{if(!t)return e;const{limit:a,bannedWords:o=[]}=t,n="number"==typeof a&&a>=0?e.substring(0,a):e;return l.highlightBadWords(n,o)},B=({className:e,style:a,bannedWords:n=[],value:i,onChange:r})=>{var s;const{t:d}=o.useTranslations(),[c,u]=t.useState(""),m=t.useRef(null);t.useEffect((()=>{if(m.current){const e=e=>{var t;e.preventDefault();const a=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/plain");document.execCommand("insertHTML",!1,a)},t=m.current;return t.addEventListener("paste",e,{passive:!0}),()=>t.removeEventListener("paste",e)}}),[m]);const p=(null==n?void 0:n.join(","))||"";t.useEffect((()=>{var e;if(p){const t=null===(e=m.current)||void 0===e?void 0:e.innerText;if(t){const e=l.highlightBadWords(t,n);e!==t&&(r&&r(e),u(e))}}}),[p]);const v=t.useCallback(T.default((()=>{if(m.current){const e=R(m.current.innerText,{limit:120,bannedWords:n});r&&r(e),u(e)}}),300),[]);return t.useEffect((()=>{setTimeout((()=>{var e;null===(e=m.current)||void 0===e||e.focus()}),500)}),[]),b.default.createElement(l.StyledCreatePostTitle,{className:e,style:a},b.default.createElement(f.Input,{name:"title",value:i||c,size:"md",label:d("createPost.title"),CustomInput:b.default.createElement(S.default,{innerRef:m,html:i||c,onChange:()=>{if(m.current&&m.current.innerText!==(i||c)){const e=R(m.current.innerText,{bannedWords:n});r&&r(e),u(e),v()}},className:"title-input"})}),b.default.createElement(g.Text,{size:"p4",className:"count-string"},d("createPost.popup.wordCount",{count:(null===(s=m.current)||void 0===s?void 0:s.innerText.length)||0,max:120})))},O=({className:a,style:o,topics:n,communityId:i,onChange:r,isLoading:d,disabled:c,forceTopics:u,selectedTopics:m,noFetch:p,dataEventCategory:g,dataEventAction:f,dataEventLabel:h})=>{const{data:{locale:y,env:{isMarryBaby:C}}}=t.useContext(s.TogetherComponentGlobalContext),[E,w]=t.useState(n?[...n]:[]),[k,P]=t.useState(m?[...m]:[]),[T,S]=t.useState(!1),x=t.useRef(n);x.current=n,t.useEffect((()=>{var t;!i||p||(null===(t=x.current)||void 0===t?void 0:t.length)||(w([]),S(!0),e.__awaiter(void 0,void 0,void 0,(function*(){var e;try{const t=yield s.callApi(s.getApiPath(s.PATHS.TOPIC.LIST,{communityId:i,_locale:y}),"GET"),a=null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.topics;Array.isArray(a)&&w((()=>(null==a?void 0:a.map(v.formatTopic).sort(((e,t)=>(e.order||0)-(t.order||0))))||[]))}catch(e){console.log(e),S(!1)}S(!1)})))}),[i,p]);const N=null==n?void 0:n.map((e=>e.id)).join("-"),A=null==E?void 0:E.map((e=>e.id)).join("-"),I=null==u?void 0:u.map((e=>e.id)).join("-");t.useEffect((()=>{n&&void 0!==N&&N!==A&&w(n)}),[n,N,A]);const _=t.useMemo((()=>E.filter((e=>!(null==u?void 0:u.some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)))))),[A,I]);return b.default.createElement(l.StyledTopicSelectList,{"data-is-marrybaby":C,className:a,style:o},u.map((e=>b.default.createElement(z,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:!0,selected:!0,dataEventAction:f,dataEventCategory:g,dataEventLabel:h}))),_.map((e=>b.default.createElement(z,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:c,selected:(m||k).some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)),onClick:()=>{const t=m||k,a=t.findIndex((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId));-1!==a?t.splice(a,1):t.push(e),r&&m?r(t.slice()):(r&&r(t.slice()),P(t.slice()))},dataEventAction:f,dataEventCategory:g,dataEventLabel:h}))),(d||T)&&b.default.createElement(l.Loading,{className:"topic-spinner"}))},z=t=>{var{topic:a,disabled:l,selected:o,onClick:n}=t,i=e.__rest(t,["topic","disabled","selected","onClick"]);return b.default.createElement("div",Object.assign({className:"tag-item"+(o?" --active":""),"data-disabled":l,onClick:l?void 0:n},i),a.name)},D=({className:e,isMarryBaby:a,style:o,title:n,description:i,acceptText:r,cancelText:d,onAccept:c,onCancel:m,thumbnail:p,isThumbnailIcon:v,onClose:f,acceptBtnTracking:h,acceptBtnProps:y,cancelBtnProps:E})=>{const{data:{env:{isMarryBaby:w}}}=t.useContext(s.TogetherComponentGlobalContext),k="boolean"==typeof a?a:w,[P,T]=t.useState(!1);return t.useEffect((()=>(u.toggleNoScroll(!0),setTimeout((()=>T(!0)),0),()=>u.toggleNoScroll(!1))),[]),"undefined"==typeof window?null:x.createPortal(b.default.createElement(l.StyledPopupDanger,{"data-is-marrybaby":k,className:e,style:o,"data-open":P},b.default.createElement(l.PopupFrame,{className:"popup-frame",isOpen:P,onClose:f},b.default.createElement("div",{className:"confirm-dialog",onClick:e=>e.stopPropagation()},b.default.createElement("div",{className:"confirm-content"},p&&b.default.createElement("div",{className:"thumbnail-container "+(v?"is-icon":"")},b.default.createElement("img",{className:"thumbnail",src:p,loading:"lazy"})),b.default.createElement(s.Heading,{className:"title",tag:"h2"},n),b.default.createElement(g.Text,{className:"desc",size:"lg"},i),b.default.createElement("div",{className:"btn-group"},b.default.createElement(C.Button,Object.assign({theme:k?"marryBaby":"helloSites",size:"md",color:"tertiary",onClick:()=>{null==c||c(),null==f||f()}},y,h),r),b.default.createElement(C.Button,Object.assign({theme:k?"marryBaby":"helloSites",size:"md",onClick:()=>{null==m||m(),null==f||f()}},E),d)))),k&&p&&b.default.createElement("div",{className:"thumbnail-container is-mobile "+(v?"is-icon":"")},b.default.createElement("img",{className:"thumbnail",src:p,loading:"lazy"})))),u.getPopupWrapperDom())};const F=({isReply:a,className:n,onClose:i,replyToName:r,style:d,replyingId:c,replyingUser:u,onPostSuccess:m,post:p,isMarryBaby:h})=>{const{action:{pushNotifications:y,sanitizeFunction:E},data:{userInfo:w,locale:k,env:{isMarryBaby:P}}}=t.useContext(s.TogetherComponentGlobalContext),T="boolean"==typeof h?h:P,{t:S}=o.useTranslations(),{onSelectImages:x,onRemoveImage:A,imageSrcs:I,onRemoveAllImages:_,imageFiles:j}=M(),[R,B]=t.useState(""),{trigger:O}=t.useContext(l.MainInputTriggerContext),[z,D]=t.useState(!1),F=t.useRef(null),U=t.useRef(null),H=t.useRef(null),[q,W]=t.useState([]),[V,$]=t.useState([]),[G,Z]=t.useState(null);return t.useEffect((()=>{var e;null===(e=H.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout((()=>{var e;null===(e=U.current)||void 0===e||e.focus()}),400)}),[O]),b.default.createElement(l.StyledInputCommentBar,{"data-is-reply":a,className:n,style:d},a&&b.default.createElement("div",{className:"reply-to-container"},b.default.createElement(g.Text,{size:"p4"},b.default.createElement("span",{dangerouslySetInnerHTML:{__html:S("inputComment.replyTo",{name:`<span style="color: #2D87F3; cursor: pointer">@${r||""}</span>`})}})),b.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8.00016' cy='8.50004' r='6.66667' fill='white' stroke='%23404040'/%3e%3cpath d='M10 6.5L6 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6 6.5L10 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-close-comment",onClick:()=>i&&i(),loading:"lazy"})),b.default.createElement("div",{className:"input-container",ref:H},b.default.createElement(v.UserAvatar,{className:"avatar-wrapper "+(a?"avatar-wrapper-reply":""),avatar:(null==w?void 0:w.id)?w.avatar:s.DEFAULT_AVATAR_IMG,username:(null==w?void 0:w.name)||(null==w?void 0:w.username)}),b.default.createElement("input",{ref:F,onChange:x,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),b.default.createElement(f.Input,{value:R,name:"input",size:"md",className:"input-wrapper",displayIcon:b.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.7543 4.85352H4.49227C4.01776 4.85352 3.56268 5.04201 3.22715 5.37754C2.89162 5.71307 2.70313 6.16815 2.70312 6.64266V19.1667C2.70313 19.6412 2.89162 20.0963 3.22715 20.4318C3.56268 20.7673 4.01776 20.9558 4.49227 20.9558H17.0163C17.4908 20.9558 17.9459 20.7673 18.2814 20.4318C18.6169 20.0963 18.8054 19.6412 18.8054 19.1667V12.9047' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M17.4633 3.51187C17.8192 3.15599 18.3019 2.95605 18.8052 2.95605C19.3085 2.95605 19.7912 3.15599 20.147 3.51187C20.5029 3.86775 20.7029 4.35044 20.7029 4.85373C20.7029 5.35702 20.5029 5.83971 20.147 6.19559L11.6486 14.694L8.07031 15.5886L8.96489 12.0103L17.4633 3.51187Z' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"}),CustomInput:b.default.createElement("div",{className:"as-input"},b.default.createElement(l.RichTextEditor,{className:"textarea",html:R,onChange:B,onImagePickerClick:()=>{var e;return null===(e=F.current)||void 0===e?void 0:e.click()},bannedWords:V,onPreviewUrlChange:Z,onInvalidUrlsChange:W,setEditorRef:e=>U.current=e,isReplying:a}))}),b.default.createElement(C.Button,{theme:T?"marryBaby":"helloSites",className:"send-button",size:"sm",onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){var t,o,n,r,d,g,f,h,C;if((null==p?void 0:p.id)&&!z){D(!0);try{const w=e=>{B(""),_(),i&&i();const t=v.formatComment(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),m&&m(t)},b=yield(({postId:t,message:a,photos:o,link:n,locale:i,sanitizeFunction:r,replyingUserId:d,replyingUserName:c,replyingId:u})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=new FormData;let m=l.encodePostContent(a.replace(/(\&nbsp;)+/g," "),r);const p=l.getMentionIdsFromString(m);return o&&o.length>0&&(yield Promise.all(null==o?void 0:o.map((e=>l.uploadAndGetSrc(e,i))))).filter(Boolean).slice(0,s.MAX_IMAGE_UPLOADS).forEach((t=>{e.append("images[]",t)})),n&&e.append("link",n),null==p||p.forEach((t=>{e.append("mention_ids[]",t)})),e.append("post_id",t),u&&e.append("parent_id",u),d&&(p.unshift(d),m=`[mention+id="${d}"+name="${(c||"").replace('"',"'")}"]${m}`,e.append("parent_user_id",String(d))),e.append("content",m),e.append("content",m),e})))(Object.assign({message:R,photos:j,postId:String(p.id),link:null==G?void 0:G.url,sanitizeFunction:E,locale:k},a&&c?{replyingUserId:String((null==u?void 0:u.id)||(null===(t=null==p?void 0:p.author)||void 0===t?void 0:t.id)||""),replyingId:c,replyingUserName:(null==u?void 0:u.name)||(null==u?void 0:u.username)||""}:{})),P=yield a&&c?((t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){return s.callApiWithAuth(s.getApiPath(s.PATHS.COMMENT.REPLY,{_locale:a}),"POST",{data:t})})))(b,k):((t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){return s.callApiWithAuth(s.getApiPath(s.PATHS.COMMENT.CREATE,{_locale:a}),"POST",{data:t})})))(b,k),T=null==P?void 0:P.data;(null==T?void 0:T.id)&&!(null===(n=null===(o=null==P?void 0:P.messages)||void 0===o?void 0:o.moderation)||void 0===n?void 0:n.type)?w(P):"banned"===(null===(d=null===(r=null==P?void 0:P.messages)||void 0===r?void 0:r.moderation)||void 0===d?void 0:d.type)?(y({title:S("notification.comment.blocked.title"),message:S("notification.comment.blocked.message"),type:"danger"}),P.messages.moderation.words&&$(P.messages.moderation.words)):"suspect"===(null===(f=null===(g=null==P?void 0:P.messages)||void 0===g?void 0:g.moderation)||void 0===f?void 0:f.type)?(y({title:S("notification.comment.suspect.title"),message:S("notification.comment.suspect.message"),type:"warning"}),B(""),_(),i&&i()):(null===(h=null==P?void 0:P.messages)||void 0===h?void 0:h.find((e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(y({message:S("notification.suspend.message"),type:"warning"}),B(""),_(),i&&i()):y({title:"",message:(null===(C=null==P?void 0:P.messages)||void 0===C?void 0:C[0])||S("notification.comment.somethingWrong"),type:"danger"})}catch(e){y({title:"",message:S("notification.comment.somethingWrong"),type:"danger"})}D(!1)}})),isLoading:z,isDisabled:!!(null==q?void 0:q.length)||z||!R||(null==R?void 0:R.length)<2||!R.trim()},b.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='20' height='21' viewBox='0 0 20 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.5 9.73438L3.75 13.4844L7.5 17.2344' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M16.25 4.73438L16.25 10.3026C16.25 11.1464 15.9208 11.9557 15.3347 12.5524C14.7487 13.1491 13.9538 13.4844 13.125 13.4844L3.75 13.4844' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-enter",loading:"lazy"}))),(null==q?void 0:q.length)?b.default.createElement("div",{className:"error-text"},S("notification.limitUrlDomain")):null,(!I||0===I.length)&&G&&b.default.createElement("div",{className:"link-preview-wrapper"},G.isFetching?b.default.createElement(l.Loading,null):b.default.createElement(b.default.Fragment,null,b.default.createElement(N,{title:G.title,url:G.url||"#",image:G.image,noRefetch:!0}),b.default.createElement("img",{src:L,className:"icon-close",onClick:()=>Z(null),loading:"lazy"}))),I&&I.length>0&&b.default.createElement("div",{className:"preview-images-container"},I.map(((e,t)=>b.default.createElement("div",{key:t,className:"image-src-wrapper"},b.default.createElement("img",{className:"preview-image",src:e,loading:"lazy"}),b.default.createElement("img",{src:L,className:"icon-close-circle",onClick:()=>A(t),loading:"lazy"}))))))};var U="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 5V8' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11H8.00708' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const H=({className:a,style:n,reason:r,reasonText:d,onClose:c,postId:u})=>{const{data:{locale:m,env:{isMarryBaby:p}},action:{pushNotifications:v}}=t.useContext(s.TogetherComponentGlobalContext),{t:f}=o.useTranslations(),[h,y]=t.useState(!1);return b.default.createElement(l.StyledSubmitReportForm,{"data-is-marrybaby":p,className:a,style:n},b.default.createElement("ul",{className:"report-list"},b.default.createElement("li",{className:"report-item"},b.default.createElement("img",{src:U,loading:"lazy"}),b.default.createElement(g.Text,{className:"__label",color:i.theme.colors.gray800,size:"p4"},d))),b.default.createElement(C.Button,{theme:p?"marryBaby":"helloSites",className:"report-submit",size:"lg",color:"primary",isLoading:h,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(u&&!h){y(!0);try{const e=yield(({id:e,reason:t,locale:a})=>{const l=new FormData;return l.append("reason",t),s.callApiWithAuth(s.getApiPath(s.PATHS.POST.REPORT,{_locale:a,id:e}),"POST",{data:l})})({id:u,reason:r,locale:m});1===(null==e?void 0:e.status)&&(v({message:"Post reported",type:"success"}),c&&c())}catch(e){}y(!1)}}))},f("submit")))};const q=({className:e,style:n,authorName:i,images:r,onClose:s,onOpenSingleView:d,alt:c})=>{const{t:u}=o.useTranslations(),[m,p]=t.useState(!1);return t.useEffect((()=>{setTimeout((()=>{p(!0)}),0)}),[]),b.default.createElement(a.Portal,null,b.default.createElement(l.StyledImagePreviewPopup,{className:e,style:n,"data-open":m},b.default.createElement("div",{className:"top-bar"},b.default.createElement("img",{className:"icon-arrow-left",src:"data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.0508 18.0607L4.00078 12.0367L10.0508 6.01172' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4.00195 12.0352L19.002 12.0352' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",onClick:s,alt:"go back",loading:"lazy"}),b.default.createElement(g.Text,{size:"p2",type:"bold",style:{textAlign:"center"}},u("previewPhotos.title",{name:i}))),b.default.createElement("div",{className:"container"},r.map(((e,t)=>b.default.createElement("img",{className:"img-preview",key:t,src:e,onClick:()=>null==d?void 0:d(t),alt:c,loading:"lazy"}))))),",")};var W="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12.8125L10 8.8125L6 4.8125' stroke='white' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const V=({initialViewIndex:e,images:o,onClose:n,alt:i})=>{const[r,s]=t.useState(e),[d,c]=t.useState(!1);t.useEffect((()=>{setTimeout((()=>{c(!0)}),0)}),[]);const u=null==o?void 0:o[r],m=0===r,p=!(null==o?void 0:o.length)||r===(null==o?void 0:o.length)-1;return b.default.createElement(a.Portal,null,b.default.createElement(l.StyledImagePreviewContainer,{"data-open":d&&!!u},b.default.createElement(l.StyledImagePreviewTopbar,null,b.default.createElement("img",{src:l.img,className:"icon-close",onClick:n,alt:"close",loading:"lazy"})),u&&r>=0&&b.default.createElement(b.default.Fragment,null,b.default.createElement(l.StyledImagePreviewWrapper,null,b.default.createElement("img",{className:"img-preview",src:u,alt:i,loading:"lazy"}),b.default.createElement(l.StyledArrowWrapper,{"data-disabled":m,onClick:()=>!m&&s(r-1)},b.default.createElement(l.StyledCircleArrow,null,b.default.createElement("img",{src:W,style:{transform:"rotate(180deg)"},alt:"left arrow","data-disabled":m,loading:"lazy"}))),b.default.createElement(l.StyledArrowWrapper,{"data-right":!0,"data-disabled":p,onClick:()=>!p&&s(r+1)},b.default.createElement(l.StyledCircleArrow,null,b.default.createElement("img",{src:W,alt:"right arrow","data-disabled":p,loading:"lazy"})))))))},$=({image:e,showIcon:a=!0})=>{const[o,n]=t.useState(!0);return b.default.createElement(l.StyledWrapper$1,{"data-is-blurred":o,onClick:e=>o&&e.stopPropagation()},b.default.createElement("img",{loading:"lazy",className:"img-preview",src:e}),b.default.createElement(l.StyledInner,{onClick:e=>{e.stopPropagation(),n(!o)}},a&&b.default.createElement(l.StyledIcon,null,o?b.default.createElement("svg",{width:"22",height:"20",viewBox:"0 0 22 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.71 2.5399C1.32 2.1499 1.32 1.5199 1.71 1.1299C2.1 0.739902 2.74 0.739902 3.13 1.1299L19.44 17.4599C19.83 17.8499 19.83 18.4799 19.44 18.8699C19.05 19.2599 18.42 19.2599 18.03 18.8699L15.31 16.1499C13.97 16.6699 12.52 16.9699 11 16.9699C6 16.9699 1.73 13.8599 0 9.4699C0.77 7.4999 2.06 5.7999 3.68 4.5099L1.71 2.5399ZM16 9.4699C16 6.7099 13.76 4.4699 11 4.4699C10.49 4.4699 10 4.5699 9.53 4.7099L7.36 2.5399C8.51 2.1699 9.73 1.9699 11 1.9699C16 1.9699 20.27 5.0799 22 9.4599C21.31 11.2199 20.21 12.7599 18.82 13.9899L15.76 10.9299C15.9 10.4699 16 9.9799 16 9.4699ZM11 14.4699C8.24 14.4699 6 12.2299 6 9.4699C6 8.6999 6.18 7.9699 6.49 7.3299L8.06 8.8999C8.03 9.0799 8 9.2699 8 9.4699C8 11.1299 9.34 12.4699 11 12.4699C11.2 12.4699 11.38 12.4399 11.57 12.3999L13.14 13.9699C12.49 14.2899 11.77 14.4699 11 14.4699ZM13.97 9.1399C13.82 7.7399 12.72 6.6499 11.33 6.4999L13.97 9.1399Z",fill:"white"})):b.default.createElement("svg",{width:"23",height:"16",viewBox:"0 0 23 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.default.createElement("path",{d:"M11.9999 0C5.14188 0 1.88558 5.87864 1.09558 7.55664C0.963582 7.83664 0.963582 8.16141 1.09558 8.44141C1.88558 10.1204 5.14188 16 11.9999 16C18.8339 16 22.0924 10.1629 22.8964 8.46094C23.0344 8.16794 23.0344 7.83206 22.8964 7.53906C22.0924 5.83706 18.8339 0 11.9999 0ZM11.9999 3C14.7609 3 16.9999 5.239 16.9999 8C16.9999 10.761 14.7609 13 11.9999 13C9.23888 13 6.99988 10.761 6.99988 8C6.99988 5.239 9.23888 3 11.9999 3ZM11.9999 5C11.2042 5 10.4412 5.31607 9.87856 5.87868C9.31595 6.44129 8.99988 7.20435 8.99988 8C8.99988 8.79565 9.31595 9.55871 9.87856 10.1213C10.4412 10.6839 11.2042 11 11.9999 11C12.7955 11 13.5586 10.6839 14.1212 10.1213C14.6838 9.55871 14.9999 8.79565 14.9999 8C14.9999 7.20435 14.6838 6.44129 14.1212 5.87868C13.5586 5.31607 12.7955 5 11.9999 5Z",fill:"#2D87F3"})))))},G=({className:e,images:a=[],style:n,authorName:i,isSensitive:r=!1,alt:d})=>{const{data:{env:{isMarryBaby:c}}}=t.useContext(s.TogetherComponentGlobalContext),{t:m}=o.useTranslations(),p="+ "+((a.length||0)-4),[v,g]=t.useState(!1),[f,h]=t.useState(-1),y=a.length>5,C=t.useRef(!1);return t.useEffect((()=>()=>{C.current&&u.toggleNoScroll(!1)}),[]),t.useEffect((()=>{v||f>=0?(u.toggleNoScroll(!0),C.current=!0):(u.toggleNoScroll(!1),C.current=!1)}),[v,f]),b.default.createElement(b.default.Fragment,null,r&&b.default.createElement(l.StyledNotificationBar,{message:m("sensitiveMask.contentWarningDescription"),icon:b.default.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.00002 0.666748C4.40002 0.666748 0.666687 4.40008 0.666687 9.00008C0.666687 13.6001 4.40002 17.3334 9.00002 17.3334C13.6 17.3334 17.3334 13.6001 17.3334 9.00008C17.3334 4.40008 13.6 0.666748 9.00002 0.666748ZM9.00002 9.83341C8.54169 9.83341 8.16669 9.45841 8.16669 9.00008V5.66675C8.16669 5.20842 8.54169 4.83342 9.00002 4.83342C9.45835 4.83342 9.83335 5.20842 9.83335 5.66675V9.00008C9.83335 9.45841 9.45835 9.83341 9.00002 9.83341ZM8.16669 11.5001V13.1667H9.83335V11.5001H8.16669Z",fill:"#FE921D"}))}),b.default.createElement(l.StyledPostImagePreview,{className:e,style:n,"data-image-count":y?5:a.length||0,"data-is-marrybaby":c,"data-cursor-pointer":!r},null==a?void 0:a.slice(0,5).map(((e,t)=>{const a=4===t&&y;return b.default.createElement("div",{className:"img-wrapper",key:t,onClick:()=>{t>=4&&y?g(!0):h(t)}},r&&b.default.createElement($,{image:e,showIcon:!a}),!c&&b.default.createElement("img",{loading:"lazy",className:"img-preview-blur",src:e,alt:d}),b.default.createElement("img",{loading:"lazy",className:"img-preview",src:e,alt:d}),a&&b.default.createElement("div",{className:"img-more-overlay"},b.default.createElement(s.Heading,{tag:"h1",as:"h2",color:"white"},p)))}))),v&&b.default.createElement(q,{authorName:i||"",images:a,onClose:()=>g(!1),onOpenSingleView:h,alt:d}),f>=0&&b.default.createElement(V,{images:a,initialViewIndex:f,onClose:()=>h(-1),alt:d}))},Z=({url:o,image:n,className:i,style:r,autoPlay:d=!0})=>{const{data:{locale:c}}=t.useContext(s.TogetherComponentGlobalContext),[u,p]=t.useState(null);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(!n){if(!o)return p(null);p((e=>Object.assign(Object.assign({},e),{isFetching:!0}))),s.callApi(s.getApiPath(s.PATHS.FETCH_PREVIEW,{_locale:c}),"POST",{data:{link:o},headers:{"Content-Type":"application/json"}}).then((e=>{var t,a;p({url:o,image:(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.image)||(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.logo)})})).catch((()=>{p(null)}))}}))}),[o,n]);const v=n||(null==u?void 0:u.image),g=(null==u?void 0:u.url)||o,f=t.useMemo((()=>l.youtubeVidIdGetter(g)),[g]),h=t.useMemo((()=>g.includes("facebook.com")||g.includes("fb.watch")),[g]),y=t.useRef(0),C=t.useRef(0),[E,w]=t.useState(!1);t.useEffect((()=>{const e=()=>{var e;const t=null===(e=k.current)||void 0===e?void 0:e.getBoundingClientRect();let a=!1;t&&(!y.current||Math.abs((y.current-t.width)/(null==t?void 0:t.width))>.2)&&(y.current=Math.floor(t.width),a=!0),t&&(!C.current||Math.abs((C.current-t.height)/(null==t?void 0:t.height))>.2)&&(C.current=Math.floor(t.height),a=!0),a&&w((e=>!e))};return e(),window.addEventListener("resize",e,{passive:!0}),()=>{window.removeEventListener("resize",e)}}),[]);const k=t.useRef(null),P=a.useMantineTheme();return b.default.createElement(l.StyledSocialLinkPreview,{className:`${i} no-replace-click`,style:r,ref:k,color:P.colors[P.primaryColor][0]},n||!f&&!h?b.default.createElement("a",{href:g,target:"_blank",rel:"noreferrer"},b.default.createElement("div",{className:"link-image-wrapper "+((null==u?void 0:u.isFetching)?"fetching":"")},(null==u?void 0:u.isFetching)?b.default.createElement(l.Loading,{className:"loading-spinner"}):b.default.createElement(m.ImageWrap,{className:"link-image",src:v||s.DEFAULT_IMG,backupSrc:s.DEFAULT_IMG,alt:g}))):b.default.createElement("div",{className:"link-image-wrapper"},f?b.default.createElement("iframe",{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${f}?&autoplay=${d?1:0}&mute=1&enablejsapi=1`,frameBorder:"0",allowFullScreen:!0,style:{position:"absolute",top:0,left:0,border:"none",overflow:"hidden"},loading:"lazy"}):h?b.default.createElement("iframe",{key:String(E),src:`https://www.facebook.com/plugins/video.php?href=${encodeURIComponent(g)}&autoplay=${d?1:0}&show_text=false&t=0&width=${y.current}&height=${C.current}`,style:{position:"absolute",top:"50%",left:"50%",border:"none",overflow:"hidden",height:C.current,width:y.current,transform:"translate(-50%, -50%)"},scrolling:"no",frameBorder:"0",allowFullScreen:!0,allow:"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share",loading:"lazy"}):null))};var Q="KsWg8i6",K="_9tS0EUN",X="kyyRKlb",J="-Uqqka-";var Y="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10Z' fill='%233E3F58'/%3e %3cpath d='M19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10Z' fill='%233E3F58'/%3e %3cpath d='M12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z' fill='%233E3F58'/%3e %3c/svg%3e",ee="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='%23595959' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",te="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",ae="data:image/svg+xml,%3csvg width='3' height='13' viewBox='0 0 3 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='1.58326' cy='6.41663' r='1.25' transform='rotate(89.9997 1.58326 6.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='1.41663' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 1.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='11.4166' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 11.4166)' fill='%23595959'/%3e%3c/svg%3e",le="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 5.33337C13.1046 5.33337 14 4.43794 14 3.33337C14 2.2288 13.1046 1.33337 12 1.33337C10.8954 1.33337 10 2.2288 10 3.33337C10 4.43794 10.8954 5.33337 12 5.33337Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M12 14.6666C13.1046 14.6666 14 13.7712 14 12.6666C14 11.5621 13.1046 10.6666 12 10.6666C10.8954 10.6666 10 11.5621 10 12.6666C10 13.7712 10.8954 14.6666 12 14.6666Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.72668 9.00665L10.28 11.66' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M10.2734 4.33997L5.72668 6.9933' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",oe="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2 4H3.33333H14' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.33334 3.99992V2.66659C5.33334 2.31296 5.47382 1.97382 5.72387 1.72378C5.97392 1.47373 6.31305 1.33325 6.66668 1.33325H9.33334C9.68697 1.33325 10.0261 1.47373 10.2762 1.72378C10.5262 1.97382 10.6667 2.31296 10.6667 2.66659V3.99992M12.6667 3.99992V13.3333C12.6667 13.6869 12.5262 14.026 12.2762 14.2761C12.0261 14.5261 11.687 14.6666 11.3333 14.6666H4.66668C4.31305 14.6666 3.97392 14.5261 3.72387 14.2761C3.47382 14.026 3.33334 13.6869 3.33334 13.3333V3.99992H12.6667Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6.66666 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.33334 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const ne=({authorEmail:a,onDeletePost:n,shareUrl:i,post:r,className:d="",popoverClassName:u="",onBookmark:m,onRemoveBookmark:p,onEditPost:v})=>{const{data:{locale:g,userInfo:f,togetherUserId:h,env:{isMarryBaby:y}},action:{pushNotifications:C}}=t.useContext(s.TogetherComponentGlobalContext),{t:E}=o.useTranslations(),[w,k]=t.useState(!1),[P,T]=t.useState(!1),[S,x]=t.useState(!1),{authActionWrapper:N}=l.useTogetherAuthRequiredAction(),A=a&&(null==f?void 0:f.email)&&a===String(null==f?void 0:f.email);return b.default.createElement("div",{className:d,onClick:e=>{e.preventDefault(),e.stopPropagation()}},S&&b.default.createElement(l.SharePopup,{url:i,text:null==r?void 0:r.title,onClose:()=>x(!1)}),P&&b.default.createElement(D,{thumbnail:c.CommonGAssets.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:E("popup.deletePost.title"),description:E("popup.deletePost.description"),acceptText:E("popup.deletePost.accept"),cancelText:E("popup.deletePost.cancel"),onAccept:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if((null==r?void 0:r.id)&&!w){k(!0);try{const t=yield(({id:t,locale:a})=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t)return yield s.callApiWithAuth(s.getApiPath(s.PATHS.POST.DELETE,{id:t,_locale:a}),"DELETE")})))({id:r.id,locale:g});1===(null==t?void 0:t.status)&&(null==n||n())}catch(e){}k(!1)}})),onClose:()=>T(!1)}),b.default.createElement(l.TreePopoverMenu,{className:u,toggleButtonContent:b.default.createElement("img",{src:y?Y:ae,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:w},data:A?{isShowheader:!1,type:"list",list:[{icon:le,label:E("morePopover.share"),onClick:()=>x(!0)},{icon:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.16952 3.2356H2.99484C2.6785 3.2356 2.37512 3.36126 2.15143 3.58495C1.92774 3.80863 1.80208 4.11202 1.80208 4.42836V12.7777C1.80208 13.094 1.92774 13.3974 2.15143 13.6211C2.37512 13.8448 2.6785 13.9705 2.99484 13.9705H11.3442C11.6605 13.9705 11.9639 13.8448 12.1876 13.6211C12.4113 13.3974 12.537 13.094 12.537 12.7777V8.60303' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M11.6425 2.341C11.8798 2.10375 12.2016 1.97046 12.5371 1.97046C12.8726 1.97046 13.1944 2.10375 13.4317 2.341C13.6689 2.57826 13.8022 2.90005 13.8022 3.23558C13.8022 3.57111 13.6689 3.89289 13.4317 4.13015L7.76607 9.79578L5.38054 10.3922L5.97692 8.00663L11.6425 2.341Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",label:E("actionPopover.edit"),onClick:v},{icon:oe,label:E("actionPopover.delete"),onClick:()=>{N((()=>T(!0)))}}]}:{isShowheader:!1,type:"list",list:[{icon:le,label:E("morePopover.share"),onClick:()=>x(!0)},{icon:(null==r?void 0:r.bookmarked)?ee:te,label:(null==r?void 0:r.bookmarked)?E("morePopover.unsavePost"):E("morePopover.savePost"),onClick:()=>{N((()=>e.__awaiter(void 0,void 0,void 0,(function*(){if((null==f?void 0:f.id)&&(null==r?void 0:r.id))if(null==r?void 0:r.bookmarked){const e=yield s.callApiWithAuth(s.getApiPath(s.PATHS.BOOKMARK.DELETE,{_locale:g}),"DELETE",{data:{post_id:String(r.id)}});1===(null==e?void 0:e.status)?(C({title:"",message:"Removed saved post",type:"success",displayIcon:te}),p&&p()):C({title:"",message:"Remove failed",type:"danger",displayIcon:te})}else{const e=yield s.callApiWithAuth(s.getApiPath(s.PATHS.BOOKMARK.CREATE,{_locale:g}),"POST",{data:{user_id:h||f.id,post_id:r.id}});1===(null==e?void 0:e.status)?(C({title:"",message:"Post saved",type:"success",displayIcon:ee}),m&&m()):C({title:"",message:"Post saved failed",type:"danger",displayIcon:te})}}))))}},{icon:U,label:E("morePopover.report"),subTree:{title:E("morePopover.report.title"),description:E("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(s.REPORT_REASON_MAP).map((e=>({label:s.REPORT_REASON_MAP[e].label,reason:s.REPORT_REASON_MAP[e].reportReasonText,reasonValue:e}))).map((e=>({label:E(e.label),subTree:{title:E("morePopover.reportSubmit.title"),description:E("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>b.default.createElement(H,{reason:e.reasonValue,reasonText:E(e.reason),postId:null==r?void 0:r.id,onClose:()=>t&&t(!1)})}})))}}]}}))};const ie=({onDeleteComment:a,commentId:n,className:i="",popoverClassName:r=""})=>{const{data:{env:{isMarryBaby:d},locale:c},action:{pushNotifications:u}}=t.useContext(s.TogetherComponentGlobalContext),{t:m}=o.useTranslations(),[p,v]=t.useState(!1),{authActionWrapper:g}=l.useTogetherAuthRequiredAction();return b.default.createElement("div",{className:i,onClick:e=>{e.preventDefault(),e.stopPropagation()}},p&&b.default.createElement(D,{thumbnail:"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(%23clip0)'%3e%3cpath d='M2 4.008h12M5.333 4.008V2.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.008h9.334ZM6.667 7.342v4M9.333 7.342v4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0'%3e%3cpath fill='white' d='M0 .008h16v16H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",isThumbnailIcon:!0,title:m("popup.deleteComment.title"),description:m("popup.deleteComment.description"),acceptText:m("popup.deletePost.accept"),cancelText:m("popup.deletePost.cancel"),onAccept:()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;if(!n)return;const t=yield(({id:e,locale:t})=>s.callApiWithAuth(s.getApiPath(s.PATHS.COMMENT.DELETE,{_locale:t,id:e}),"DELETE"))({id:n,locale:c});1===(null==t?void 0:t.status)?(a&&a(),u({title:"",message:m("notification.success"),type:"success"})):u({title:"",message:(null===(e=null==t?void 0:t.messages)||void 0===e?void 0:e[0])||m("notification.failure"),type:"danger"})})),onClose:()=>v(!1)}),b.default.createElement(l.TreePopoverMenu,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:oe,label:m("actionPopover.delete"),onClick:()=>{g((()=>{v(!0)}))}}]},className:r,toggleButtonContent:b.default.createElement("img",{src:d?Y:ae,loading:"lazy"}),buttonProps:{}}))};var re="-dzIuHr";const se=({userId:e,avatar:a,name:n,role:s,title:d,className:c})=>{const{t:u}=o.useTranslations(),[m,p]=t.useState(!1);return b.default.createElement(b.default.Fragment,null,b.default.createElement(C.Button,{className:`${re} ${c}`,color:"success",size:"xs",onClick:()=>p(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},b.default.createElement("span",{className:"text"},b.default.createElement(r.Icon.Endorse,{isSolid:!0,size:18,color:i.theme.colors.green800,className:"icon"}),u("cardReply.verifyBy",{name:`${n||""}`}))),b.default.createElement(l.ProfileDetailModal,{open:m,onClose:()=>p(!1),profileModalProps:{zIndex:1e3}},b.default.createElement(l.ProfileDetail,{authorProps:{userId:e,avatar:a,name:n,role:s,title:d},hideQuestionTab:!0})))};const de=({className:a,style:n,comment:i,type:r="comment",level:c=0,replyingId:u,onPostCommentSuccess:m,post:v,onDeleteComment:g,refetchComment:f,hasQuickBookingEnable:h,handleMakeAppointment:y,cardAuthorProps:E,maxChars:w=600,disableShortenContent:k})=>{var P,T,S,x,A,I,_,M,L,j,R,B,O;const{data:{locale:z,userInfo:D,env:{isMarryBaby:U}}}=t.useContext(s.TogetherComponentGlobalContext),{t:H}=o.useTranslations(),[q,W]=t.useState(i||null),{id:V,countLikes:$,content:Z,replies:Q=[],images:K=[],author:X,liked:J,link:Y,mentionedUser:ee,mentions:te}=q,{text:ae,replyingTo:le}=(e=>{try{const t=e.match(/\[@([^\]]+)\]/),a=t?t[0].replace("[@","").replace("]",""):"";return{text:e.replace(/\[@([^\]]+)\]/,"").trim(),replyingTo:a}}catch(e){}return{text:""}})(Z),{authActionWrapper:oe}=l.useTogetherAuthRequiredAction({_joinCommunityIds:[null===(P=null==v?void 0:v.community)||void 0===P?void 0:P.id],_joinTopicIds:null===(T=null==v?void 0:v.topics)||void 0===T?void 0:T.map((e=>e.id))}),[ne,re]=t.useState(4),ce=!!(null==D?void 0:D.id)&&(null==Q?void 0:Q.some((e=>e.author.id===D.id))),ue=e=>{W((t=>{if(!t.replies.find((t=>t.id===e.id))){t.replies.unshift(e);const a=Object.assign(Object.assign({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return f&&f(a),a}return t}))},[me,pe]=t.useState(!1),ve=t.useMemo((()=>"comment"===r&&Q&&0!=Q.length?Q.sort(((e,t)=>{const a=new Date(e.createdAt).getTime(),l=new Date(t.createdAt).getTime();return a>l?-1:a<l?1:0})):Q),[r,Q]),ge=(null==Q?void 0:Q.length)||0,fe=String(null==X?void 0:X.email)&&(null==D?void 0:D.email)&&String(null==X?void 0:X.email)===String(null==D?void 0:D.email),he=(null==X?void 0:X.name)||(null==X?void 0:X.username)||"",ye=(null==X?void 0:X.username)||(null==X?void 0:X.name)||"",Ce=null==X?void 0:X.avatar,Ee=(null==v?void 0:v.isAnonymous)||null==X?void 0:X.role,we=[...(null==v?void 0:v.isAnonymous)?[{id:(null===(S=null==v?void 0:v.author)||void 0===S?void 0:S.id)||0,name:H("cardPost.anonymous")}]:[],...te||[]],[ke,be]=t.useState(null),[Pe,Te]=t.useState(null);t.useEffect((()=>{if(null==X?void 0:X.hospitalId){const t=t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield s.callApi(s.getCarePath(s.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:d.domainLocales[z]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&be(null==a?void 0:a._data.branch)}));t(X.hospitalId)}if(null==X?void 0:X.doctorId){const t=t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield s.callApi(s.getCarePath(s.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:t,website_url:d.domainLocales[z]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&Te(null==a?void 0:a._data.doctor)}));t(X.doctorId)}}),[X.hospitalId,X.doctorId]);const Se=(null==Pe?void 0:Pe.valid_outpatient)||(null==Pe?void 0:Pe.valid_telemedicine),xe=((null==ke?void 0:ke.total_available_service)||(null==ke?void 0:ke.total_available_doctor))>0,Ne=h&&(Se||xe),Ae="chatbot"===(null===(x=null==q?void 0:q.author)||void 0===x?void 0:x.type);return b.default.createElement(l.TogetherAuthConfigContextProvider,{defaultParams:{_joinCommunityIds:[null===(A=null==v?void 0:v.community)||void 0===A?void 0:A.id],_joinTopicIds:null===(I=null==v?void 0:v.topics)||void 0===I?void 0:I.map((e=>e.id))}},b.default.createElement(l.StyledCardPost,{className:a,style:n,"data-is-reply":!!c,"data-is-marrybaby":U,"data-has-booking":Ne},"reply"===r&&b.default.createElement(p.Divider,{className:"top-divider",type:"solid"}),b.default.createElement("div",{style:{padding:"16px 16px 0"}},b.default.createElement(l.CardAuthor,Object.assign({avatar:Ce,name:he,username:ye,timeText:null==v?void 0:v.createdTime,community:null==v?void 0:v.community,className:"post-author "+(fe?"with-popover":""),type:r,userId:null==X?void 0:X.id,role:Ee,expertId:null==X?void 0:X.partnerId,title:null==X?void 0:X.title,doctorId:null==X?void 0:X.doctorId,hospitalId:null==X?void 0:X.hospitalId,hasQuickBooking:Ne,handleMakeAppointment:y,isAnonymous:(null==q?void 0:q.isAnonymous)||Boolean(null==v?void 0:v.isAnonymous)&&(null===(_=null==v?void 0:v.author)||void 0===_?void 0:_.username)===(null==X?void 0:X.username),hideBackground:Ae,userType:null==X?void 0:X.type},E)),Boolean(null==q?void 0:q.isVerify)&&!Boolean(null==q?void 0:q.isOppose)&&b.default.createElement(se,{title:null===(M=null==q?void 0:q.userVerify)||void 0===M?void 0:M.title,name:null===(L=null==q?void 0:q.userVerify)||void 0===L?void 0:L.name,userId:null===(j=null==q?void 0:q.userVerify)||void 0===j?void 0:j.id,role:null===(R=null==q?void 0:q.userVerify)||void 0===R?void 0:R.role,avatar:null===(B=null==q?void 0:q.userVerify)||void 0===B?void 0:B.avatar,className:"verify-tag"})),b.default.createElement(l.PostContent,{className:"post-content-wrapper",replyingTo:le,mentionedUser:ee,description:ae,mentions:we,maxChars:w,disableShortenContent:k}),b.default.createElement("span",null),b.default.createElement("span",null),K&&K.length>0?b.default.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},b.default.createElement(G,{images:K,authorName:null==X?void 0:X.username})):null,K&&0!==K.length||!Y?null:b.default.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},b.default.createElement(N,{url:Y})),"most-engaging"!==r?b.default.createElement(b.default.Fragment,null,Ae&&b.default.createElement(l.StyledSourceList,{listUrl:null==q?void 0:q.source,categorySlug:null==q?void 0:q.categorySlug}),b.default.createElement(l.CardReactions,{type:l.CardReactionType.reply,loveCount:$,replyCount:ge,className:"post-reaction",liked:J,isReplied:ce,hideCommentIcon:"reply"===r||Ae,hasShare:!1,onCommentClick:()=>oe((()=>pe((e=>!e)))),onCommentCountClick:()=>oe((()=>{pe(!0)})),onLikeClick:()=>oe((()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(V){const t=yield(({commentId:t,setLike:a=!1,locale:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return s.callApiWithAuth(s.getApiPath(a?s.PATHS.COMMENT.LIKE:s.PATHS.COMMENT.UNLIKE,{_locale:l,id:t}),"GET")})))({commentId:V,setLike:!J,locale:z});1===t.status&&W((e=>Object.assign(Object.assign({},e),{liked:!J,countLikes:e.countLikes+(J?-1:1)})))}}))))}),me&&b.default.createElement(F,{replyingId:u||q.id,replyToName:he,isReply:!0,onClose:()=>pe(!1),onPostSuccess:e=>{"reply"===r?m&&m(e):ue(e)},post:v,replyingUser:X}),"comment"===r&&Q&&Q.length>0?b.default.createElement("div",{className:"comment-reply-wrapper"},null===(O=null==ve?void 0:ve.slice(0,ne))||void 0===O?void 0:O.map((e=>b.default.createElement(de,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:c+1,replyingId:V,onPostCommentSuccess:ue,post:v,onDeleteComment:()=>{W((t=>Object.assign(Object.assign({},t),{replies:t.replies.filter((t=>t.id!==e.id)),countReplies:t.countReplies-1})))},handleMakeAppointment:y,hasQuickBookingEnable:h}))),ge>ne&&b.default.createElement(b.default.Fragment,null,b.default.createElement(p.Divider,{className:"top-divider",type:"solid"}),b.default.createElement(C.Button,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>re((e=>e+4))},H("comment.seeMoreReplies",{count:ge-ne}),b.default.createElement("img",{className:"chevron-right",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12L10 8L6 4' stroke='%232D87F3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"})))):null):null,fe&&b.default.createElement(ie,{onDeleteComment:g,className:"popover",commentId:q.id})))},ce=(t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){var e,l,o;const n=yield s.callApiWithOptionalAuth(s.getApiPath(s.PATHS.COMMENT.LIST,{postId:t,_locale:a,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(o=null===(l=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.comments)||void 0===l?void 0:l.map(v.formatComment))||void 0===o?void 0:o[0]}));var ue=Object.freeze({__proto__:null});exports.CardLink=N,exports.CardPost=({className:a,style:n,hideViewMoreComment:i,showMostEngaging:r,onCommentClick:d,onCommentCountClick:c,onMostEngagingCommentClick:u,onPostCommentSuccess:m,disableCardLink:p,disableShortenContent:v,onDeletePost:g,onEditPost:f,post:h,mostEngagingComment:y,onDeleteComment:E,showInputComment:w,InlineCommentsComponent:k,hasQuickBookingEnable:T,handleMakeAppointment:S,cardAuthorProps:x})=>{const[_,M]=t.useState(h),[L,j]=t.useState(!1),[R,B]=t.useState(y),{community:O,topics:z,author:D,slug:U,isPin:H,liked:q,photos:W,mentions:V,title:$,description:Q,previewUrl:K,likesCount:X,commentsCount:J,id:Y,commented:ee}=_,{data:{locale:te,env:{isMarryBaby:ae,togetherBasePath:le}},action:{pushNotifications:oe}}=t.useContext(s.TogetherComponentGlobalContext),{t:ie}=o.useTranslations(),[re,se]=t.useState(w),ue=`${le}/${(null==O?void 0:O.slug)||"_"}/${U||""}`,me=`${s.getCurrentBaseUrl(te)}${ue}`,{authActionWrapper:pe}=l.useTogetherAuthRequiredAction((null==O?void 0:O.slug)?{_joinCommunityIds:[O.id],_joinTopicIds:null==z?void 0:z.map((e=>e.id))}:void 0),[ve,ge]=t.useState(!1);t.useEffect((()=>{se(w)}),[w]);const fe=(null==D?void 0:D.name)||(null==D?void 0:D.username)||"",he=(null==D?void 0:D.username)||(null==D?void 0:D.name)||"",ye=null==D?void 0:D.avatar,Ce=(null==_?void 0:_.isAnonymous)||null==D?void 0:D.role,[Ee,we]=t.useState(null),[ke,be]=t.useState(null);t.useEffect((()=>{if(null==D?void 0:D.hospitalId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield s.callApi(s.getCarePath(s.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:s.domainLocales[te]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&we(null==a?void 0:a._data.branch)})))(D.hospitalId)}if(null==D?void 0:D.doctorId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield s.callApi(s.getCarePath(s.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:t,website_url:s.domainLocales[te]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&be(null==a?void 0:a._data.doctor)})))(D.doctorId)}}),[D.hospitalId,D.doctorId]);const Pe=(null==ke?void 0:ke.valid_outpatient)||(null==ke?void 0:ke.valid_telemedicine),Te=((null==Ee?void 0:Ee.total_available_service)||(null==Ee?void 0:Ee.total_available_doctor))>0,Se=T&&(Pe||Te);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(Y&&J&&r&&!(null==y?void 0:y.id)){const e=yield ce(Y,te);B(e)}}))}),[Y,te,J,r,null==y?void 0:y.id]),t.useEffect((()=>{B(y)}),[null==y?void 0:y.id]);const xe=t=>e.__awaiter(void 0,void 0,void 0,(function*(){if(J>1&&(null==R?void 0:R.id)&&(null==R?void 0:R.id)===(null==t?void 0:t.id)){const e=yield ce(Y,te);B(e)}M((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1}))),E&&E(t)}));return b.default.createElement(l.TogetherAuthConfigContextProvider,{defaultParams:(null==O?void 0:O.slug)?{_joinCommunityIds:[O.id],_joinTopicIds:null==z?void 0:z.map((e=>e.id))}:void 0},L&&b.default.createElement(l.SharePopup,{url:me,avatar:s.DEFAULT_IMG,text:$,onClose:()=>j(!1)}),b.default.createElement(l.StyledCardPost$1,{className:a,style:n,"data-is-marrybaby":ae},H?b.default.createElement(A,{className:"post-pin"}):null,b.default.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},b.default.createElement(l.CardAuthor,Object.assign({avatar:ye,name:fe,username:he,url:p?void 0:ue,community:O,timeText:null==_?void 0:_.createdTime,className:"post-author",role:Ce,userId:null==D?void 0:D.id,expertId:null==D?void 0:D.partnerId,doctorId:null==D?void 0:D.doctorId,hospitalId:null==D?void 0:D.hospitalId,title:null==D?void 0:D.title,hasQuickBooking:Se,handleMakeAppointment:S,"data-testid":"name",isAnonymous:!!(null==_?void 0:_.isAnonymous),extendEle:b.default.createElement(ne,{authorEmail:String(null==D?void 0:D.email),onDeletePost:g,shareUrl:me,post:_,className:"popover",onEditPost:f})},x))),b.default.createElement("a",{href:p?void 0:ue,className:"post-content-link-wrapper"},$&&b.default.createElement(s.Heading,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},P.default($)),b.default.createElement(l.PostContent,{className:"post-content-wrapper",description:Q,disableShortenContent:v,mentions:V,"data-testid":"Content of the Post"})),b.default.createElement("span",null),b.default.createElement("span",null),b.default.createElement("div",{key:"tag-topic"},z&&z.length>0?b.default.createElement(l.TagTopic,{topics:z,className:"post-topics"}):null),b.default.createElement("div",{key:"social-preview"},(null==_?void 0:_.introUrl)?b.default.createElement("div",{className:"social-preview-wrapper "+((null==W?void 0:W.length)?"has-image":"")},b.default.createElement(Z,{url:_.introUrl,image:_.bannerImage})):null),b.default.createElement("div",{key:"image-preview"},(null==W?void 0:W.length)?b.default.createElement("div",{className:"image-preview-wrapper"},b.default.createElement(G,{images:W,authorName:null==D?void 0:D.name})):null),b.default.createElement("div",{key:"link-preview"},(null==_?void 0:_.introUrl)||(null==W?void 0:W.length)||!(null==K?void 0:K.url)?null:b.default.createElement("div",{className:"link-preview-wrapper"},b.default.createElement(N,{title:K.title,url:K.url,image:K.image}))),b.default.createElement(l.CardReactions,{isMarryBaby:ae,type:l.CardReactionType.post,loveCount:X,replyCount:J,className:"post-reaction "+((null==W?void 0:W.length)||(null==K?void 0:K.url)?"hide-top-border":""),liked:ve?!q:q,isReplied:ee,onCommentClick:()=>pe((()=>{d?d():se((e=>!e))})),onCommentCountClick:()=>{pe((()=>{ae?se(!0):c?c():!p&&(window.location.href=ue)}))},onShareClick:()=>{j(!0)},onLikeClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(Y&&!ve){ge(!0);try{const t=yield(({id:t,locale:a})=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t)return yield s.callApiWithAuth(s.getApiPath(s.PATHS.POST.LIKE,{id:t,_locale:a}),"GET")})))({id:Y,locale:te});1!==(null==t?void 0:t.status)?oe(I(ie)):M((e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked})))}catch(e){oe(I(ie))}ge(!1)}})),showingMostEngaging:!(!r||!(null==R?void 0:R.id))}),re&&b.default.createElement(F,{isMainCmt:!w,onClose:()=>se(!1),onPostSuccess:e=>{0!==J||(null==R?void 0:R.id)||B(e),M((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0}))),m&&m(e)},post:_}),r&&(null==R?void 0:R.id)?b.default.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{u?(e.stopPropagation(),u()):window.location.href=ue}},b.default.createElement(de,{hasQuickBookingEnable:T,handleMakeAppointment:S,comment:R,post:_,onDeleteComment:()=>{xe&&xe(R)},className:"most-engaging-comment",type:"most-engaging",key:R.id,cardAuthorProps:x}),J>1&&!i&&b.default.createElement(C.Button,{className:"see-more-comments",color:"ghost",size:"md"},ie("comment.seeMoreComments",{count:J-1}))):null,k))},exports.CardPostPopoverMore=ne,exports.CardReply=de,exports.CardReplyPopover=ie,exports.CreateNewPostContent=({className:n,style:d,onPostCreatedEdited:m,onClose:g,communities:f=[],forceSelectCommunity:h,forceSelectTopics:y,articleId:C,optionalTopic:E,editPostData:w,defaultCommunity:k,defaultTopics:T,noFetchTopic:S,hideTopicList:x,selectAskDoctor:N,showAskDoctorOptions:A,currentPageUrl:M})=>{const L=!!(null==w?void 0:w.id),{data:{locale:R,env:{isMarryBaby:z}},action:{pushNotifications:D,sanitizeFunction:F}}=t.useContext(s.TogetherComponentGlobalContext),{t:U}=o.useTranslations(),[H,q]=t.useState(!1),[W,V]=t.useState(N),[$,G]=t.useState(!1),[Z,Q]=t.useState(!1),[K,X]=t.useState(!1),[J,Y]=t.useState(""),[ee,te]=t.useState(""),[ae,le]=t.useState(h?{label:h.name,value:`${h.id||""}-${h.mappedCategoryId||""}`}:{label:U("community.choose"),value:""}),[oe,ne]=t.useState([...y]||[]),[ie,re]=t.useState([]),[se,de]=t.useState([]),ce=h||f.find((e=>`${e.id||""}-${e.mappedCategoryId||""}`===ae.value)),ue=h?[h]:f.filter((e=>e.isActive)).sort(((e,t)=>e.name>t.name?1:e.name<t.name?-1:0)),[me,pe]=t.useState(null),[ve,ge]=t.useState([]),fe=J&&!Z&&P.default(ee)&&(E||!E&&oe.length>0)&&ce&&(!ie||ie.length<=s.MAX_IMAGE_UPLOADS)&&!(null==ve?void 0:ve.length)&&!K;t.useEffect((()=>{if(w){const e=w;Y(e.title||""),te(l.decodeMention(l.decodePostUrl(e.description||"","edit"),e.mentions)),le({label:e.community.name,value:`${e.community.id||""}-${e.community.mappedCategoryId||""}`}),ne(e.topics||[]),re(e.photos||[]),q(!!e.isAnonymous||!1),V(!!e.isAskDoctor||!1)}else k&&le({label:k.name,value:`${k.id||""}-${k.mappedCategoryId||""}`}),T&&ne(T)}),[]),t.useEffect((()=>{Q(""!==J&&!/[a-zA-Z]/.test(J))}),[J]);const he=()=>e.__awaiter(void 0,void 0,void 0,(function*(){var t,a,o,n,i,r,d,c,p;if(A&&void 0===W)return G(!0),!1;const f=yield(({title:t,description:a,communityId:o,imageFiles:n,previewUrl:i,topicIds:r,locale:d,sanitizeFunction:c,categoryCommunityId:m,categoryTopicIds:p,introUrl:v,bannerUrl:g,scheduleTime:f,isAnonymous:h,isAskDoctor:y})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=new FormData,C=l.removeBannedWordWrapper(a),E=l.removeBannedWordWrapper(t),w=l.getMentionIdsFromString(C);if(e.append("title",E),e.append("description",l.encodePostContent(C,c)),m?e.append("category_community",String(m)):o&&e.append("community_id",String(o)),e.append("is_anonymous",h?"1":"0"),e.append("is_question",y?"1":"0"),(null==i?void 0:i.title)&&e.append("preview_title",i.title),(null==i?void 0:i.description)&&e.append("preview_description",i.description),(null==i?void 0:i.url)&&e.append("preview_link",u.safeEncodeURI(i.url)),(null==i?void 0:i.image)&&e.append("preview_image",u.safeEncodeURI(i.image)),null==r||r.forEach((t=>{e.append("topics[]",String(t||""))})),null==p||p.forEach((t=>{e.append("category_topics[]",String(t||""))})),null==n?void 0:n.length){const t=yield Promise.all(n.map(((e,t)=>new Promise((a=>{setTimeout((()=>{a(l.uploadAndGetSrc(e,d))}),2e3*t)})))));null==t||t.filter(Boolean).slice(0,s.MAX_IMAGE_UPLOADS).forEach(((t,a)=>{e.append(`images[${a}]`,t)}))}else e.append("images","");return null==w||w.forEach((t=>{e.append("mention_ids[]",t)})),e.append("intro_url",v||""),e.append("banner",g||""),f&&(e.append("post_type","scheduled"),e.append("schedule_datetime",f)),e})))({title:J,description:ee,communityId:String((null==ce?void 0:ce.id)||""),imageFiles:ie,previewUrl:me,topicIds:null==oe?void 0:oe.map((e=>String(e.id||""))).filter(Boolean),locale:R,sanitizeFunction:F,categoryCommunityId:String((null==ce?void 0:ce.mappedCategoryId)||""),categoryTopicIds:null==oe?void 0:oe.map((e=>String(e.mappedCategoryId||""))).filter(Boolean),isAnonymous:H?1:0,isAskDoctor:W?1:0});let h;C&&f.append("article_id",C),L?(null==w?void 0:w.id)&&(h=yield(({id:t,locale:a,formData:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield s.callApiWithAuth(s.getApiPath(s.PATHS.POST.UPDATE,{id:t,_locale:a}),"POST",{data:l})})))({id:w.id,formData:f,locale:R})):h=yield(({locale:t,formData:a,isArticleComment:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield s.callApiWithAuth(s.getApiPath(l?s.PATHS.POST.CREATE_ARTICLE_COMMENT:s.PATHS.POST.CREATE,{_locale:t}),"POST",{data:a})})))({formData:f,locale:R,isArticleComment:!(null==ce?void 0:ce.id)&&!!(null==ce?void 0:ce.mappedCategoryId)});const y=null==h?void 0:h.data;(null==y?void 0:y.id)&&!(null===(a=null===(t=null==h?void 0:h.messages)||void 0===t?void 0:t.moderation)||void 0===a?void 0:a.type)?(D({message:U("createPost.popup.success"),type:"success"}),(e=>{m&&m(v.formatPost(e),L),g&&g()})(y)):"banned"===(null===(n=null===(o=null==h?void 0:h.messages)||void 0===o?void 0:o.moderation)||void 0===n?void 0:n.type)?(D({title:U("notification.post.blocked.title"),message:U("notification.post.blocked.message"),type:"danger"}),h.messages.moderation.words&&de(h.messages.moderation.words)):"suspect"===(null===(r=null===(i=null==h?void 0:h.messages)||void 0===i?void 0:i.moderation)||void 0===r?void 0:r.type)?(D({title:U("notification.post.suspect.title"),message:U("notification.post.suspect.message"),type:"warning"}),g&&g()):(null===(c=null===(d=null==h?void 0:h.messages)||void 0===d?void 0:d.find)||void 0===c?void 0:c.call(d,(e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(D({message:U("notification.suspend.message"),type:"danger"}),g&&g()):D({message:(null===(p=null==h?void 0:h.messages)||void 0===p?void 0:p[0])||U("notification.failure"),type:"danger"})}));return b.default.createElement(l.StyledCreateNewPost,{className:n,style:d},b.default.createElement("div",{className:"input-group-container"},b.default.createElement(B,{className:"input-group",bannedWords:se,value:J,onChange:Y}),Z&&b.default.createElement(l.StyledError,null,b.default.createElement(r.Info,{isSolid:!0,color:i.theme.colors.red700,size:14}),b.default.createElement(s.Text,{size:"p3",as:"span",color:i.theme.colors.red700},U("createPost.popup.specialCharErr"))),b.default.createElement(j,{className:"input-group",bannedWords:se,value:ee,onChange:te,onPreviewUrlChange:pe,onInvalidUrlsChange:ge,onImageFilesChange:re,imageFiles:ie}),A&&b.default.createElement(l.StyledIsQuestion,{"data-is-marry-baby":z},b.default.createElement("div",{className:"switch-label"},b.default.createElement(r.Ask,{isMarryBaby:z,size:z?32:24,color:i.theme.colors.primaryBase,className:"label-icon"}),b.default.createElement("span",{className:"label-txt"},U("createPost.askDoctor"))),b.default.createElement(p.BtnChoice,{value:W,choices:[{label:U("createPost.askDoctorChoice.yes"),value:!0,dataEventCategory:"Together",dataEventAction:"Write Post Click - Ask Doctor",dataEventLabel:M},{label:U("createPost.askDoctorChoice.no"),value:!1}],onChange:e=>{"boolean"==typeof e&&(G(!1),V(e))}})),$&&b.default.createElement(l.StyledError,null,b.default.createElement(r.Info,{isSolid:!0,color:i.theme.colors.red700,size:14}),b.default.createElement(s.Text,{size:"p3",as:"span",color:i.theme.colors.red700},U("createPost.message.askDoctorRequire"))),b.default.createElement("div",{className:"input-group"},b.default.createElement(s.Text,{size:"p4",className:"input-group-label"},U("admin.community")),b.default.createElement(l.Dropdown,{options:(null==ue?void 0:ue.map((e=>({label:e.name,value:`${e.id||""}-${e.mappedCategoryId||""}`}))))||[],id:"community-picker",placeholder:U("community.choose"),value:ae,dropdownLabelTrackingAttributes:{"data-event-category":"Together","data-event-action":"Write Post Click - Choose Community/Topic","data-event-label":M},onChange:e=>{le({label:e.label,value:String(e.value)}),ne([])},disabled:!!h}),b.default.createElement(s.Text,{size:"sm",className:"warning",color:i.theme.colors.gray400},"* ",U("commentPopup.warning.newPost"))),!x&&b.default.createElement("div",{className:"input-group"},b.default.createElement(s.Text,{size:"p4",className:"input-group-label"},U("tab.topic")),b.default.createElement("div",{className:"input-notification"},b.default.createElement("img",{src:ce?"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%232D87F3'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e":_,loading:"lazy"}),b.default.createElement(s.Text,{size:"base",color:i.theme.colors.gray500},U(ce?"createPost.popup.primary":"createPost.popup.warning"))),ce&&b.default.createElement(O,{className:"tag-list",communityId:ce.id,forceTopics:y,onChange:ne,selectedTopics:oe,noFetch:S,dataEventCategory:"Together",dataEventAction:"Write Post Click - Choose Community/Topic",dataEventLabel:M}))),b.default.createElement("div",{className:"form-action"},b.default.createElement("div",{className:"input-group"},b.default.createElement(a.Checkbox,{className:"swich-input-group",labelPosition:"left",name:"PostAnonymous",checked:H,color:z?"pink":void 0,"data-event-category":"Together","data-event-action":"Write Post Click - Incognito","data-event-label":M,label:b.default.createElement("div",{className:"switch-label"},b.default.createElement("img",{className:"label-icon",src:c.CommonGAssets.getAssetPath("anomyous-avatar.svg"),alt:"anomyous avatar",style:{marginRight:"10px",width:"24px"},loading:"lazy"}),b.default.createElement("span",{className:"label-txt"},U("createPost.postAnonymous"))),value:"Post Anonymous",onChange:e=>q(e.currentTarget.checked),styles:{body:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},label:{display:"flex",alignItems:"center"}}})),b.default.createElement("div",{className:"input-group"},b.default.createElement(s.Button,{className:"submit-btn pointer-event-child-none",size:"lg","data-event-category":"Ask Doctor","data-event-action":"Submit Question","data-event-label":window.location.href,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(fe&&!K){X(!0);try{yield he()}catch(e){console.error(e),D(I(U))}X(!1)}})),disabled:!fe,loading:K},U("createPost.popup.submit")))))},exports.CreatePostDescription=j,exports.CreatePostTitle=B,exports.ImagePreviewPopup=q,exports.InputCommentBar=F,exports.LabelPin=A,exports.PopupDanger=D,exports.PostImagePreview=G,exports.PostSingleImageViewPopup=V,exports.SkipQuestionOfExpertBtn=l=>{var{post:n,onSkip:i,btnText:d,currentPageUrl:c}=l,u=e.__rest(l,["post","onSkip","btnText","currentPageUrl"]);const{t:m}=o.useTranslations(),{data:{locale:p},action:{pushNotifications:v}}=t.useContext(s.TogetherComponentGlobalContext),[g,f]=t.useState(!1),[h,y]=t.useState(!1),C=a.useMantineTheme(),E=t.useCallback((()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;y(!0);const t=yield s.callApiWithAuth(s.getApiPath(s.PATHS.USER.SKIP_QUESTION,{_locale:p,id:null==n?void 0:n.id}),"PUT");1===(null==t?void 0:t.status)?(null==i||i({id:(null==n?void 0:n.id)||"",communityId:(null===(e=null==n?void 0:n.community)||void 0===e?void 0:e.id)||""}),f(!1),v({title:"",message:"Skip success",type:"success"})):v({title:"",message:null==t?void 0:t.messages,type:"danger"}),y(!1)}))),[]);return b.default.createElement(a.Popover,{width:327,withArrow:!0,shadow:"md",opened:g},b.default.createElement(a.Popover.Target,null,b.default.createElement("div",Object.assign({className:`${Q} ${(null==u?void 0:u.className)||""}`,onClick:()=>f(!0)},u),d||m("profilePanel.questionNotClear"))),b.default.createElement(a.Popover.Dropdown,null,b.default.createElement("div",null,b.default.createElement("div",{className:K},m("profilePanel.skipQuestion.heading")),b.default.createElement("div",{className:X},m("profilePanel.skipQuestion.content")),b.default.createElement("div",{className:J},b.default.createElement(s.Button,{size:"md",variant:"secondary",leftIcon:b.default.createElement(r.Close,{color:C.fn.primaryColor(),size:24}),onClick:()=>f(!1),styles:()=>({leftIcon:{marginRight:0}})}),b.default.createElement(s.Button,{variant:"primary",size:"md",leftIcon:b.default.createElement(r.Check,{color:"white",size:24}),onClick:E,loading:h,"data-event-category":"Together","data-event-action":"Unclear Question Click","data-event-label":c,styles:()=>({leftIcon:{marginRight:0}})})))))},exports.SocialLinkPreview=Z,exports.SubmitReportForm=H,exports.TopicSelectList=O,exports.VerifiedTag=se,exports.types=ue;
1
+ "use strict";var e=require("./tslib.es6-bb49a3d1.js"),t=require("react"),a=require("@mantine/core"),l=require("./index-65622957.js"),o=require("./useTranslations-10d0cd79.js"),n=require("innertext"),i=require("./theme-dd5f10d8.js"),r=require("./index-b90a3e0d.js"),s=require("./index.styles-e11660ee.js");require("@mantine/dates");var d=require("./index-cd875ad3.js");require("./Onboarding-e89cd92f.js");var c=require("./gAssets.js");require("dayjs");var u=require("./screenSizeContext-33e6c658.js");require("styled-components"),require("./isProduction-a9c34dc0.js");var m=require("./index-f8959db6.js");require("@mantine/hooks");var p=require("./index-2654ea13.js"),v=require("./index.styled-5782fa6c.js"),g=require("./index-9faf9072.js"),f=require("./index-2f2b9b6f.js"),h=require("lodash/debounce"),y=require("react-contenteditable");require("./useCategory-642c5d6e.js");var C=require("./index-45a27811.js"),E=require("react-dom");function w(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function k(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,l.get?l:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}require("date-fns"),require("react-day-picker/DayPickerInput"),require("./index-19063c94.js"),require("lodash/throttle"),require("./types-13e699dc.js"),require("react-hook-form"),require("date-fns/locale/en-US"),require("date-fns/locale/id"),require("date-fns/locale/vi"),require("date-fns/locale/zh-TW"),require("./index.styled-fb3b67b4.js"),require("uuid"),require("./utils-79d816c1.js"),require("string-format");var b=w(t),P=w(n),T=w(h),S=w(y),x=k(E);const N=({title:o,url:n,image:i,logo:r,className:d,style:c,noRefetch:u})=>{const{data:{locale:m,env:{isMarryBaby:p}}}=t.useContext(s.TogetherComponentGlobalContext),[v,f]=t.useState(!1),h=a.useMantineTheme(),y=t.useRef(u);y.current=u;const[C,E]=t.useState(null);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(!y.current){if(!n)return E(null);E((e=>Object.assign(Object.assign({},e),{isFetching:!0}))),s.callApi(s.getApiPath(s.PATHS.FETCH_PREVIEW,{_locale:m}),"POST",{data:{link:n},headers:{"Content-Type":"application/json"}}).then((e=>{var t,a,l;f(!1),E({title:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.title,url:n,image:(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.image)||(null===(l=null==e?void 0:e.data)||void 0===l?void 0:l.logo)})})).catch((()=>{E(null)}))}}))}),[n]);const w=(null==C?void 0:C.image)||i,k=(null==C?void 0:C.title)||o,P=(null==C?void 0:C.logo)||r,T=(null==C?void 0:C.url)||n,S=T.replace("http://","").replace("https://","").split(/[/?#]/)[0],x=t.useRef(!1);return b.default.createElement(l.StyledCardLink,{"data-is-marrybaby":p,className:`${d} no-replace-click`,style:c,color:h.colors[h.primaryColor][0]},b.default.createElement("a",{href:T,target:"_blank",rel:"noreferrer"},w&&b.default.createElement("div",{className:"link-image-wrapper"},!p&&b.default.createElement("img",{className:"link-image-blur",src:w,onError:e=>{x.current||(x.current=!0,e.currentTarget.src=s.DEFAULT_IMG)},loading:"lazy"}),b.default.createElement("img",{className:"link-image",src:w,onError:e=>{x.current||(x.current=!0,e.currentTarget.src=s.DEFAULT_IMG)},loading:"lazy"})),b.default.createElement("div",{className:"link-info-container"},b.default.createElement(g.Text,{size:"n1"},p&&P&&!v&&b.default.createElement("img",{className:"link-logo",src:P,onError:()=>f(!0),loading:"lazy"}),S),b.default.createElement(s.Heading,{tag:"h6"},k))))};const A=({onClick:e,color:a,className:n,style:i})=>{const{data:{env:{isMarryBaby:r}}}=t.useContext(s.TogetherComponentGlobalContext),{t:d}=o.useTranslations();return b.default.createElement(l.LabelSortPin,{label:b.default.createElement(b.default.Fragment,null,r&&b.default.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M3.5 19.9999L7.87 15.6299' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.95634 11.294C4.56534 11.685 4.56534 12.318 4.95634 12.708L7.87434 15.626L10.7923 18.544C11.1833 18.935 11.8163 18.935 12.2063 18.544L13.3813 17.369C13.5693 17.181 13.6743 16.927 13.6743 16.662V12.726L16.5743 9.82597L18.8833 9.94897C19.1663 9.96397 19.4433 9.85797 19.6433 9.65797L20.2173 9.08397C20.6083 8.69297 20.6083 8.05997 20.2173 7.66997L15.8313 3.28397C15.4403 2.89297 14.8073 2.89297 14.4173 3.28397L13.8433 3.85797C13.6423 4.05897 13.5363 4.33497 13.5523 4.61797L13.6753 6.92697L10.7753 9.82697H6.83834C6.57334 9.82697 6.31834 9.93197 6.13134 10.12L4.95634 11.294V11.294Z' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M16.5699 9.83018L13.6699 6.93018' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3c/svg%3e",loading:"lazy"})," ",d("label.pinnedPost")),rightLabel:!r&&b.default.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cline x1='7.18605' y1='7.68219' x2='3.68219' y2='13.8139' stroke='%23FEA21E' stroke-linecap='round'/%3e%3cpath d='M3.24591 7.78426C3.21275 7.84168 3.20376 7.90993 3.22092 7.97398C3.23808 8.03803 3.27998 8.09264 3.3374 8.12579L8.78429 11.2706C8.90385 11.3396 9.05674 11.2986 9.12578 11.1791C9.71191 10.1641 9.71348 8.97262 9.23682 7.99339L10.8583 5.18521C11.5115 5.00603 12.0982 4.57973 12.4638 3.94629C12.5328 3.82672 12.4919 3.67383 12.3723 3.6048L8.18237 1.18584C8.12494 1.15268 8.0567 1.1437 7.99265 1.16086C7.92861 1.17803 7.874 1.21993 7.84086 1.27736C7.47521 1.91077 7.39934 2.63194 7.57065 3.28723L5.94919 6.09545C4.86323 6.1723 3.83201 6.76934 3.24591 7.78426Z' fill='%23FEA21E' stroke='%23FEA21E' stroke-width='0.5' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"}),onClick:e,color:"white",className:`label-pinned ${n}`,style:i})},I=e=>({message:e("notification.failure"),type:"danger"});var _="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%23FE921D'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const M=(e,a)=>{const[l,o]=t.useState(e||[]);return{onSelectImages:t=>{const n=t.target.files;if(n)if(a&&e){a((e||l).concat(Array.from(n)))}else o((t=>{const l=e||t;return a&&a(l.concat(Array.from(n))),l.concat(Array.from(n))}))},onRemoveImage:t=>{if(a&&e){const l=e;l.splice(t,1),a(l.slice())}else o((l=>{const o=e||l;return o.splice(t,1),a&&a(o.slice()),o.slice()}))},onRemoveAllImages:()=>{a?a([]):o([])},imageSrcs:t.useMemo((()=>(e||l).map((e=>"string"==typeof e?e:URL.createObjectURL(e)))),[e,l]),imageFiles:e||l}};var L="data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 22.9844C17.5228 22.9844 22 18.5072 22 12.9844C22 7.46153 17.5228 2.98438 12 2.98438C6.47715 2.98438 2 7.46153 2 12.9844C2 18.5072 6.47715 22.9844 12 22.9844Z' fill='%23262626'/%3e%3cpath d='M14.8281 10.1562L9.17127 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.17188 10.1562L14.8287 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const j=({className:e,style:a,bannedWords:n=[],value:r,onChange:d,onPreviewUrlChange:c,onInvalidUrlsChange:u,onImageFilesChange:m,imageFiles:p,isReplying:v})=>{const{t:f}=o.useTranslations(),[h,y]=t.useState(null),C=t.useRef(null),{onSelectImages:E,onRemoveImage:w,imageSrcs:k}=M(p,m);return t.useEffect((()=>{c&&((null==h?void 0:h.url)?c({title:h.title||"",url:h.url||"",image:h.image||"",description:h.description||""}):c(null))}),[h]),b.default.createElement(l.StyledCreatePostDescription,{className:e,style:a},b.default.createElement(g.Text,{size:"p4",className:"description-label"},f("createPost.popup.description")),b.default.createElement("div",{className:"textarea-control"},b.default.createElement("div",{className:"textarea-wrapper"},b.default.createElement(l.RichTextEditor,{html:r||"",onChange:d,bannedWords:n,onImagePickerClick:()=>{var e;return null===(e=C.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:y,onInvalidUrlsChange:u,isReplying:v}))),b.default.createElement(g.Text,{size:"p4",className:"count-string"},f("character"),": ",P.default(r||"").length),(!k||0===k.length)&&h&&b.default.createElement("div",{className:"link-preview-wrapper"},h.isFetching?b.default.createElement(l.Loading,null):b.default.createElement(b.default.Fragment,null,b.default.createElement(N,{title:h.title,url:h.url||"#",image:h.image,noRefetch:!0}),b.default.createElement("img",{src:L,className:"icon-close",onClick:()=>y(null),loading:"lazy"}))),b.default.createElement("input",{ref:C,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:E}),k.length>s.MAX_IMAGE_UPLOADS?b.default.createElement("div",{className:"input-notification"},b.default.createElement("img",{src:_,loading:"lazy"}),b.default.createElement(g.Text,{size:"p4",color:i.theme.colors.alertWarning},f("createPost.popup.warningImage"))):null,k.length>0&&b.default.createElement("div",{className:"image-gallery"},k.map(((e,t)=>b.default.createElement("div",{key:t,className:"image-item"},b.default.createElement("img",{src:e,loading:"lazy"}),b.default.createElement("img",{className:"close-btn",src:L,onClick:()=>w(t),loading:"lazy"}))))))},R=(e,t)=>{if(!t)return e;const{limit:a,bannedWords:o=[]}=t,n="number"==typeof a&&a>=0?e.substring(0,a):e;return l.highlightBadWords(n,o)},B=({className:e,style:a,bannedWords:n=[],value:i,onChange:r})=>{var s;const{t:d}=o.useTranslations(),[c,u]=t.useState(""),m=t.useRef(null);t.useEffect((()=>{if(m.current){const e=e=>{var t;e.preventDefault();const a=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/plain");document.execCommand("insertHTML",!1,a)},t=m.current;return t.addEventListener("paste",e,{passive:!0}),()=>t.removeEventListener("paste",e)}}),[m]);const p=(null==n?void 0:n.join(","))||"";t.useEffect((()=>{var e;if(p){const t=null===(e=m.current)||void 0===e?void 0:e.innerText;if(t){const e=l.highlightBadWords(t,n);e!==t&&(r&&r(e),u(e))}}}),[p]);const v=t.useCallback(T.default((()=>{if(m.current){const e=R(m.current.innerText,{limit:120,bannedWords:n});r&&r(e),u(e)}}),300),[]);return t.useEffect((()=>{setTimeout((()=>{var e;null===(e=m.current)||void 0===e||e.focus()}),500)}),[]),b.default.createElement(l.StyledCreatePostTitle,{className:e,style:a},b.default.createElement(f.Input,{name:"title",value:i||c,size:"md",label:d("createPost.title"),CustomInput:b.default.createElement(S.default,{innerRef:m,html:i||c,onChange:()=>{if(m.current&&m.current.innerText!==(i||c)){const e=R(m.current.innerText,{bannedWords:n});r&&r(e),u(e),v()}},className:"title-input"})}),b.default.createElement(g.Text,{size:"p4",className:"count-string"},d("createPost.popup.wordCount",{count:(null===(s=m.current)||void 0===s?void 0:s.innerText.length)||0,max:120})))},O=({className:a,style:o,topics:n,communityId:i,onChange:r,isLoading:d,disabled:c,forceTopics:u,selectedTopics:m,noFetch:p,dataEventCategory:g,dataEventAction:f,dataEventLabel:h})=>{const{data:{locale:y,env:{isMarryBaby:C}}}=t.useContext(s.TogetherComponentGlobalContext),[E,w]=t.useState(n?[...n]:[]),[k,P]=t.useState(m?[...m]:[]),[T,S]=t.useState(!1),x=t.useRef(n);x.current=n,t.useEffect((()=>{var t;!i||p||(null===(t=x.current)||void 0===t?void 0:t.length)||(w([]),S(!0),e.__awaiter(void 0,void 0,void 0,(function*(){var e;try{const t=yield s.callApi(s.getApiPath(s.PATHS.TOPIC.LIST,{communityId:i,_locale:y}),"GET"),a=null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.topics;Array.isArray(a)&&w((()=>(null==a?void 0:a.map(v.formatTopic).sort(((e,t)=>(e.order||0)-(t.order||0))))||[]))}catch(e){console.log(e),S(!1)}S(!1)})))}),[i,p]);const N=null==n?void 0:n.map((e=>e.id)).join("-"),A=null==E?void 0:E.map((e=>e.id)).join("-"),I=null==u?void 0:u.map((e=>e.id)).join("-");t.useEffect((()=>{n&&void 0!==N&&N!==A&&w(n)}),[n,N,A]);const _=t.useMemo((()=>E.filter((e=>!(null==u?void 0:u.some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)))))),[A,I]);return b.default.createElement(l.StyledTopicSelectList,{"data-is-marrybaby":C,className:a,style:o},u.map((e=>b.default.createElement(z,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:!0,selected:!0,dataEventAction:f,dataEventCategory:g,dataEventLabel:h}))),_.map((e=>b.default.createElement(z,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:c,selected:(m||k).some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)),onClick:()=>{const t=m||k,a=t.findIndex((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId));-1!==a?t.splice(a,1):t.push(e),r&&m?r(t.slice()):(r&&r(t.slice()),P(t.slice()))},dataEventAction:f,dataEventCategory:g,dataEventLabel:h}))),(d||T)&&b.default.createElement(l.Loading,{className:"topic-spinner"}))},z=t=>{var{topic:a,disabled:l,selected:o,onClick:n}=t,i=e.__rest(t,["topic","disabled","selected","onClick"]);return b.default.createElement("div",Object.assign({className:"tag-item"+(o?" --active":""),"data-disabled":l,onClick:l?void 0:n},i),a.name)},D=({className:e,isMarryBaby:a,style:o,title:n,description:i,acceptText:r,cancelText:d,onAccept:c,onCancel:m,thumbnail:p,isThumbnailIcon:v,onClose:f,acceptBtnTracking:h,acceptBtnProps:y,cancelBtnProps:E})=>{const{data:{env:{isMarryBaby:w}}}=t.useContext(s.TogetherComponentGlobalContext),k="boolean"==typeof a?a:w,[P,T]=t.useState(!1);return t.useEffect((()=>(u.toggleNoScroll(!0),setTimeout((()=>T(!0)),0),()=>u.toggleNoScroll(!1))),[]),"undefined"==typeof window?null:x.createPortal(b.default.createElement(l.StyledPopupDanger,{"data-is-marrybaby":k,className:e,style:o,"data-open":P},b.default.createElement(l.PopupFrame,{className:"popup-frame",isOpen:P,onClose:f},b.default.createElement("div",{className:"confirm-dialog",onClick:e=>e.stopPropagation()},b.default.createElement("div",{className:"confirm-content"},p&&b.default.createElement("div",{className:"thumbnail-container "+(v?"is-icon":"")},b.default.createElement("img",{className:"thumbnail",src:p,loading:"lazy"})),b.default.createElement(s.Heading,{className:"title",tag:"h2"},n),b.default.createElement(g.Text,{className:"desc",size:"lg"},i),b.default.createElement("div",{className:"btn-group"},b.default.createElement(C.Button,Object.assign({theme:k?"marryBaby":"helloSites",size:"md",color:"tertiary",onClick:()=>{null==c||c(),null==f||f()}},y,h),r),b.default.createElement(C.Button,Object.assign({theme:k?"marryBaby":"helloSites",size:"md",onClick:()=>{null==m||m(),null==f||f()}},E),d)))),k&&p&&b.default.createElement("div",{className:"thumbnail-container is-mobile "+(v?"is-icon":"")},b.default.createElement("img",{className:"thumbnail",src:p,loading:"lazy"})))),u.getPopupWrapperDom())};const F=({isReply:a,className:n,onClose:i,replyToName:r,style:d,replyingId:c,replyingUser:u,onPostSuccess:m,post:p,isMarryBaby:h})=>{const{action:{pushNotifications:y,sanitizeFunction:E},data:{userInfo:w,locale:k,env:{isMarryBaby:P}}}=t.useContext(s.TogetherComponentGlobalContext),T="boolean"==typeof h?h:P,{t:S}=o.useTranslations(),{onSelectImages:x,onRemoveImage:A,imageSrcs:I,onRemoveAllImages:_,imageFiles:j}=M(),[R,B]=t.useState(""),{trigger:O}=t.useContext(l.MainInputTriggerContext),[z,D]=t.useState(!1),F=t.useRef(null),U=t.useRef(null),H=t.useRef(null),[q,W]=t.useState([]),[V,$]=t.useState([]),[G,Z]=t.useState(null);return t.useEffect((()=>{var e;null===(e=H.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout((()=>{var e;null===(e=U.current)||void 0===e||e.focus()}),400)}),[O]),b.default.createElement(l.StyledInputCommentBar,{"data-is-reply":a,className:n,style:d},a&&b.default.createElement("div",{className:"reply-to-container"},b.default.createElement(g.Text,{size:"p4"},b.default.createElement("span",{dangerouslySetInnerHTML:{__html:S("inputComment.replyTo",{name:`<span style="color: #2D87F3; cursor: pointer">@${r||""}</span>`})}})),b.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8.00016' cy='8.50004' r='6.66667' fill='white' stroke='%23404040'/%3e%3cpath d='M10 6.5L6 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6 6.5L10 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-close-comment",onClick:()=>i&&i(),loading:"lazy"})),b.default.createElement("div",{className:"input-container",ref:H},b.default.createElement(v.UserAvatar,{className:"avatar-wrapper "+(a?"avatar-wrapper-reply":""),avatar:(null==w?void 0:w.id)?w.avatar:s.DEFAULT_AVATAR_IMG,username:(null==w?void 0:w.name)||(null==w?void 0:w.username)}),b.default.createElement("input",{ref:F,onChange:x,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),b.default.createElement(f.Input,{value:R,name:"input",size:"md",className:"input-wrapper",displayIcon:b.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.7543 4.85352H4.49227C4.01776 4.85352 3.56268 5.04201 3.22715 5.37754C2.89162 5.71307 2.70313 6.16815 2.70312 6.64266V19.1667C2.70313 19.6412 2.89162 20.0963 3.22715 20.4318C3.56268 20.7673 4.01776 20.9558 4.49227 20.9558H17.0163C17.4908 20.9558 17.9459 20.7673 18.2814 20.4318C18.6169 20.0963 18.8054 19.6412 18.8054 19.1667V12.9047' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M17.4633 3.51187C17.8192 3.15599 18.3019 2.95605 18.8052 2.95605C19.3085 2.95605 19.7912 3.15599 20.147 3.51187C20.5029 3.86775 20.7029 4.35044 20.7029 4.85373C20.7029 5.35702 20.5029 5.83971 20.147 6.19559L11.6486 14.694L8.07031 15.5886L8.96489 12.0103L17.4633 3.51187Z' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"}),CustomInput:b.default.createElement("div",{className:"as-input"},b.default.createElement(l.RichTextEditor,{className:"textarea",html:R,onChange:B,onImagePickerClick:()=>{var e;return null===(e=F.current)||void 0===e?void 0:e.click()},bannedWords:V,onPreviewUrlChange:Z,onInvalidUrlsChange:W,setEditorRef:e=>U.current=e,isReplying:a}))}),b.default.createElement(C.Button,{theme:T?"marryBaby":"helloSites",className:"send-button",size:"sm",onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){var t,o,n,r,d,g,f,h,C;if((null==p?void 0:p.id)&&!z){D(!0);try{const w=e=>{B(""),_(),i&&i();const t=v.formatComment(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),m&&m(t)},b=yield(({postId:t,message:a,photos:o,link:n,locale:i,sanitizeFunction:r,replyingUserId:d,replyingUserName:c,replyingId:u})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=new FormData;let m=l.encodePostContent(a.replace(/(\&nbsp;)+/g," "),r);const p=l.getMentionIdsFromString(m);return o&&o.length>0&&(yield Promise.all(null==o?void 0:o.map((e=>l.uploadAndGetSrc(e,i))))).filter(Boolean).slice(0,s.MAX_IMAGE_UPLOADS).forEach((t=>{e.append("images[]",t)})),n&&e.append("link",n),null==p||p.forEach((t=>{e.append("mention_ids[]",t)})),e.append("post_id",t),u&&e.append("parent_id",u),d&&(p.unshift(d),m=`[mention+id="${d}"+name="${(c||"").replace('"',"'")}"]${m}`,e.append("parent_user_id",String(d))),e.append("content",m),e.append("content",m),e})))(Object.assign({message:R,photos:j,postId:String(p.id),link:null==G?void 0:G.url,sanitizeFunction:E,locale:k},a&&c?{replyingUserId:String((null==u?void 0:u.id)||(null===(t=null==p?void 0:p.author)||void 0===t?void 0:t.id)||""),replyingId:c,replyingUserName:(null==u?void 0:u.name)||(null==u?void 0:u.username)||""}:{})),P=yield a&&c?((t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){return s.callApiWithAuth(s.getApiPath(s.PATHS.COMMENT.REPLY,{_locale:a}),"POST",{data:t})})))(b,k):((t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){return s.callApiWithAuth(s.getApiPath(s.PATHS.COMMENT.CREATE,{_locale:a}),"POST",{data:t})})))(b,k),T=null==P?void 0:P.data;(null==T?void 0:T.id)&&!(null===(n=null===(o=null==P?void 0:P.messages)||void 0===o?void 0:o.moderation)||void 0===n?void 0:n.type)?w(P):"banned"===(null===(d=null===(r=null==P?void 0:P.messages)||void 0===r?void 0:r.moderation)||void 0===d?void 0:d.type)?(y({title:S("notification.comment.blocked.title"),message:S("notification.comment.blocked.message"),type:"danger"}),P.messages.moderation.words&&$(P.messages.moderation.words)):"suspect"===(null===(f=null===(g=null==P?void 0:P.messages)||void 0===g?void 0:g.moderation)||void 0===f?void 0:f.type)?(y({title:S("notification.comment.suspect.title"),message:S("notification.comment.suspect.message"),type:"warning"}),B(""),_(),i&&i()):(null===(h=null==P?void 0:P.messages)||void 0===h?void 0:h.find((e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(y({message:S("notification.suspend.message"),type:"warning"}),B(""),_(),i&&i()):y({title:"",message:(null===(C=null==P?void 0:P.messages)||void 0===C?void 0:C[0])||S("notification.comment.somethingWrong"),type:"danger"})}catch(e){y({title:"",message:S("notification.comment.somethingWrong"),type:"danger"})}D(!1)}})),isLoading:z,isDisabled:!!(null==q?void 0:q.length)||z||!R||(null==R?void 0:R.length)<2||!R.trim()},b.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='20' height='21' viewBox='0 0 20 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.5 9.73438L3.75 13.4844L7.5 17.2344' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M16.25 4.73438L16.25 10.3026C16.25 11.1464 15.9208 11.9557 15.3347 12.5524C14.7487 13.1491 13.9538 13.4844 13.125 13.4844L3.75 13.4844' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-enter",loading:"lazy"}))),(null==q?void 0:q.length)?b.default.createElement("div",{className:"error-text"},S("notification.limitUrlDomain")):null,(!I||0===I.length)&&G&&b.default.createElement("div",{className:"link-preview-wrapper"},G.isFetching?b.default.createElement(l.Loading,null):b.default.createElement(b.default.Fragment,null,b.default.createElement(N,{title:G.title,url:G.url||"#",image:G.image,noRefetch:!0}),b.default.createElement("img",{src:L,className:"icon-close",onClick:()=>Z(null),loading:"lazy"}))),I&&I.length>0&&b.default.createElement("div",{className:"preview-images-container"},I.map(((e,t)=>b.default.createElement("div",{key:t,className:"image-src-wrapper"},b.default.createElement("img",{className:"preview-image",src:e,loading:"lazy"}),b.default.createElement("img",{src:L,className:"icon-close-circle",onClick:()=>A(t),loading:"lazy"}))))))};var U="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 5V8' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11H8.00708' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const H=({className:a,style:n,reason:r,reasonText:d,onClose:c,postId:u})=>{const{data:{locale:m,env:{isMarryBaby:p}},action:{pushNotifications:v}}=t.useContext(s.TogetherComponentGlobalContext),{t:f}=o.useTranslations(),[h,y]=t.useState(!1);return b.default.createElement(l.StyledSubmitReportForm,{"data-is-marrybaby":p,className:a,style:n},b.default.createElement("ul",{className:"report-list"},b.default.createElement("li",{className:"report-item"},b.default.createElement("img",{src:U,loading:"lazy"}),b.default.createElement(g.Text,{className:"__label",color:i.theme.colors.gray800,size:"p4"},d))),b.default.createElement(C.Button,{theme:p?"marryBaby":"helloSites",className:"report-submit",size:"lg",color:"primary",isLoading:h,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(u&&!h){y(!0);try{const e=yield(({id:e,reason:t,locale:a})=>{const l=new FormData;return l.append("reason",t),s.callApiWithAuth(s.getApiPath(s.PATHS.POST.REPORT,{_locale:a,id:e}),"POST",{data:l})})({id:u,reason:r,locale:m});1===(null==e?void 0:e.status)&&(v({message:"Post reported",type:"success"}),c&&c())}catch(e){}y(!1)}}))},f("submit")))};const q=({className:e,style:n,authorName:i,images:r,onClose:s,onOpenSingleView:d,alt:c})=>{const{t:u}=o.useTranslations(),[m,p]=t.useState(!1);return t.useEffect((()=>{setTimeout((()=>{p(!0)}),0)}),[]),b.default.createElement(a.Portal,null,b.default.createElement(l.StyledImagePreviewPopup,{className:e,style:n,"data-open":m},b.default.createElement("div",{className:"top-bar"},b.default.createElement("img",{className:"icon-arrow-left",src:"data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.0508 18.0607L4.00078 12.0367L10.0508 6.01172' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4.00195 12.0352L19.002 12.0352' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",onClick:s,alt:"go back",loading:"lazy"}),b.default.createElement(g.Text,{size:"p2",type:"bold",style:{textAlign:"center"}},u("previewPhotos.title",{name:i}))),b.default.createElement("div",{className:"container"},r.map(((e,t)=>b.default.createElement("img",{className:"img-preview",key:t,src:e,onClick:()=>null==d?void 0:d(t),alt:c,loading:"lazy"}))))),",")};var W="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12.8125L10 8.8125L6 4.8125' stroke='white' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const V=({initialViewIndex:e,images:o,onClose:n,alt:i})=>{const[r,s]=t.useState(e),[d,c]=t.useState(!1);t.useEffect((()=>{setTimeout((()=>{c(!0)}),0)}),[]);const u=null==o?void 0:o[r],m=0===r,p=!(null==o?void 0:o.length)||r===(null==o?void 0:o.length)-1;return b.default.createElement(a.Portal,null,b.default.createElement(l.StyledImagePreviewContainer,{"data-open":d&&!!u},b.default.createElement(l.StyledImagePreviewTopbar,null,b.default.createElement("img",{src:l.img,className:"icon-close",onClick:n,alt:"close",loading:"lazy"})),u&&r>=0&&b.default.createElement(b.default.Fragment,null,b.default.createElement(l.StyledImagePreviewWrapper,null,b.default.createElement("img",{className:"img-preview",src:u,alt:i,loading:"lazy"}),b.default.createElement(l.StyledArrowWrapper,{"data-disabled":m,onClick:()=>!m&&s(r-1)},b.default.createElement(l.StyledCircleArrow,null,b.default.createElement("img",{src:W,style:{transform:"rotate(180deg)"},alt:"left arrow","data-disabled":m,loading:"lazy"}))),b.default.createElement(l.StyledArrowWrapper,{"data-right":!0,"data-disabled":p,onClick:()=>!p&&s(r+1)},b.default.createElement(l.StyledCircleArrow,null,b.default.createElement("img",{src:W,alt:"right arrow","data-disabled":p,loading:"lazy"})))))))},$=({image:e,showIcon:a=!0})=>{const[o,n]=t.useState(!0);return b.default.createElement(l.StyledWrapper$1,{"data-is-blurred":o,onClick:e=>o&&e.stopPropagation()},b.default.createElement("img",{loading:"lazy",className:"img-preview",src:e}),b.default.createElement(l.StyledInner,{onClick:e=>{e.stopPropagation(),n(!o)}},a&&b.default.createElement(l.StyledIcon,null,o?b.default.createElement("svg",{width:"22",height:"20",viewBox:"0 0 22 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.71 2.5399C1.32 2.1499 1.32 1.5199 1.71 1.1299C2.1 0.739902 2.74 0.739902 3.13 1.1299L19.44 17.4599C19.83 17.8499 19.83 18.4799 19.44 18.8699C19.05 19.2599 18.42 19.2599 18.03 18.8699L15.31 16.1499C13.97 16.6699 12.52 16.9699 11 16.9699C6 16.9699 1.73 13.8599 0 9.4699C0.77 7.4999 2.06 5.7999 3.68 4.5099L1.71 2.5399ZM16 9.4699C16 6.7099 13.76 4.4699 11 4.4699C10.49 4.4699 10 4.5699 9.53 4.7099L7.36 2.5399C8.51 2.1699 9.73 1.9699 11 1.9699C16 1.9699 20.27 5.0799 22 9.4599C21.31 11.2199 20.21 12.7599 18.82 13.9899L15.76 10.9299C15.9 10.4699 16 9.9799 16 9.4699ZM11 14.4699C8.24 14.4699 6 12.2299 6 9.4699C6 8.6999 6.18 7.9699 6.49 7.3299L8.06 8.8999C8.03 9.0799 8 9.2699 8 9.4699C8 11.1299 9.34 12.4699 11 12.4699C11.2 12.4699 11.38 12.4399 11.57 12.3999L13.14 13.9699C12.49 14.2899 11.77 14.4699 11 14.4699ZM13.97 9.1399C13.82 7.7399 12.72 6.6499 11.33 6.4999L13.97 9.1399Z",fill:"white"})):b.default.createElement("svg",{width:"23",height:"16",viewBox:"0 0 23 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.default.createElement("path",{d:"M11.9999 0C5.14188 0 1.88558 5.87864 1.09558 7.55664C0.963582 7.83664 0.963582 8.16141 1.09558 8.44141C1.88558 10.1204 5.14188 16 11.9999 16C18.8339 16 22.0924 10.1629 22.8964 8.46094C23.0344 8.16794 23.0344 7.83206 22.8964 7.53906C22.0924 5.83706 18.8339 0 11.9999 0ZM11.9999 3C14.7609 3 16.9999 5.239 16.9999 8C16.9999 10.761 14.7609 13 11.9999 13C9.23888 13 6.99988 10.761 6.99988 8C6.99988 5.239 9.23888 3 11.9999 3ZM11.9999 5C11.2042 5 10.4412 5.31607 9.87856 5.87868C9.31595 6.44129 8.99988 7.20435 8.99988 8C8.99988 8.79565 9.31595 9.55871 9.87856 10.1213C10.4412 10.6839 11.2042 11 11.9999 11C12.7955 11 13.5586 10.6839 14.1212 10.1213C14.6838 9.55871 14.9999 8.79565 14.9999 8C14.9999 7.20435 14.6838 6.44129 14.1212 5.87868C13.5586 5.31607 12.7955 5 11.9999 5Z",fill:"#2D87F3"})))))},G=({className:e,images:a=[],style:n,authorName:i,isSensitive:r=!1,alt:d})=>{const{data:{env:{isMarryBaby:c}}}=t.useContext(s.TogetherComponentGlobalContext),{t:m}=o.useTranslations(),p="+ "+((a.length||0)-4),[v,g]=t.useState(!1),[f,h]=t.useState(-1),y=a.length>5,C=t.useRef(!1);return t.useEffect((()=>()=>{C.current&&u.toggleNoScroll(!1)}),[]),t.useEffect((()=>{v||f>=0?(u.toggleNoScroll(!0),C.current=!0):(u.toggleNoScroll(!1),C.current=!1)}),[v,f]),b.default.createElement(b.default.Fragment,null,r&&b.default.createElement(l.StyledNotificationBar,{message:m("sensitiveMask.contentWarningDescription"),icon:b.default.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.00002 0.666748C4.40002 0.666748 0.666687 4.40008 0.666687 9.00008C0.666687 13.6001 4.40002 17.3334 9.00002 17.3334C13.6 17.3334 17.3334 13.6001 17.3334 9.00008C17.3334 4.40008 13.6 0.666748 9.00002 0.666748ZM9.00002 9.83341C8.54169 9.83341 8.16669 9.45841 8.16669 9.00008V5.66675C8.16669 5.20842 8.54169 4.83342 9.00002 4.83342C9.45835 4.83342 9.83335 5.20842 9.83335 5.66675V9.00008C9.83335 9.45841 9.45835 9.83341 9.00002 9.83341ZM8.16669 11.5001V13.1667H9.83335V11.5001H8.16669Z",fill:"#FE921D"}))}),b.default.createElement(l.StyledPostImagePreview,{className:e,style:n,"data-image-count":y?5:a.length||0,"data-is-marrybaby":c,"data-cursor-pointer":!r},null==a?void 0:a.slice(0,5).map(((e,t)=>{const a=4===t&&y;return b.default.createElement("div",{className:"img-wrapper",key:t,onClick:()=>{t>=4&&y?g(!0):h(t)}},r&&b.default.createElement($,{image:e,showIcon:!a}),!c&&b.default.createElement("img",{loading:"lazy",className:"img-preview-blur",src:e,alt:d}),b.default.createElement("img",{loading:"lazy",className:"img-preview",src:e,alt:d}),a&&b.default.createElement("div",{className:"img-more-overlay"},b.default.createElement(s.Heading,{tag:"h1",as:"h2",color:"white"},p)))}))),v&&b.default.createElement(q,{authorName:i||"",images:a,onClose:()=>g(!1),onOpenSingleView:h,alt:d}),f>=0&&b.default.createElement(V,{images:a,initialViewIndex:f,onClose:()=>h(-1),alt:d}))},Z=({url:o,image:n,className:i,style:r,autoPlay:d=!0})=>{const{data:{locale:c}}=t.useContext(s.TogetherComponentGlobalContext),[u,p]=t.useState(null);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(!n){if(!o)return p(null);p((e=>Object.assign(Object.assign({},e),{isFetching:!0}))),s.callApi(s.getApiPath(s.PATHS.FETCH_PREVIEW,{_locale:c}),"POST",{data:{link:o},headers:{"Content-Type":"application/json"}}).then((e=>{var t,a;p({url:o,image:(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.image)||(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.logo)})})).catch((()=>{p(null)}))}}))}),[o,n]);const v=n||(null==u?void 0:u.image),g=(null==u?void 0:u.url)||o,f=t.useMemo((()=>l.youtubeVidIdGetter(g)),[g]),h=t.useMemo((()=>g.includes("facebook.com")||g.includes("fb.watch")),[g]),y=t.useRef(0),C=t.useRef(0),[E,w]=t.useState(!1);t.useEffect((()=>{const e=()=>{var e;const t=null===(e=k.current)||void 0===e?void 0:e.getBoundingClientRect();let a=!1;t&&(!y.current||Math.abs((y.current-t.width)/(null==t?void 0:t.width))>.2)&&(y.current=Math.floor(t.width),a=!0),t&&(!C.current||Math.abs((C.current-t.height)/(null==t?void 0:t.height))>.2)&&(C.current=Math.floor(t.height),a=!0),a&&w((e=>!e))};return e(),window.addEventListener("resize",e,{passive:!0}),()=>{window.removeEventListener("resize",e)}}),[]);const k=t.useRef(null),P=a.useMantineTheme();return b.default.createElement(l.StyledSocialLinkPreview,{className:`${i} no-replace-click`,style:r,ref:k,color:P.colors[P.primaryColor][0]},n||!f&&!h?b.default.createElement("a",{href:g,target:"_blank",rel:"noreferrer"},b.default.createElement("div",{className:"link-image-wrapper "+((null==u?void 0:u.isFetching)?"fetching":"")},(null==u?void 0:u.isFetching)?b.default.createElement(l.Loading,{className:"loading-spinner"}):b.default.createElement(m.ImageWrap,{className:"link-image",src:v||s.DEFAULT_IMG,backupSrc:s.DEFAULT_IMG,alt:g}))):b.default.createElement("div",{className:"link-image-wrapper"},f?b.default.createElement("iframe",{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${f}?&autoplay=${d?1:0}&mute=1&enablejsapi=1`,frameBorder:"0",allowFullScreen:!0,style:{position:"absolute",top:0,left:0,border:"none",overflow:"hidden"},loading:"lazy"}):h?b.default.createElement("iframe",{key:String(E),src:`https://www.facebook.com/plugins/video.php?href=${encodeURIComponent(g)}&autoplay=${d?1:0}&show_text=false&t=0&width=${y.current}&height=${C.current}`,style:{position:"absolute",top:"50%",left:"50%",border:"none",overflow:"hidden",height:C.current,width:y.current,transform:"translate(-50%, -50%)"},scrolling:"no",frameBorder:"0",allowFullScreen:!0,allow:"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share",loading:"lazy"}):null))};var Q="KsWg8i6",K="_9tS0EUN",X="kyyRKlb",J="-Uqqka-";var Y="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10Z' fill='%233E3F58'/%3e %3cpath d='M19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10Z' fill='%233E3F58'/%3e %3cpath d='M12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z' fill='%233E3F58'/%3e %3c/svg%3e",ee="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='%23595959' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",te="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",ae="data:image/svg+xml,%3csvg width='3' height='13' viewBox='0 0 3 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='1.58326' cy='6.41663' r='1.25' transform='rotate(89.9997 1.58326 6.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='1.41663' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 1.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='11.4166' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 11.4166)' fill='%23595959'/%3e%3c/svg%3e",le="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 5.33337C13.1046 5.33337 14 4.43794 14 3.33337C14 2.2288 13.1046 1.33337 12 1.33337C10.8954 1.33337 10 2.2288 10 3.33337C10 4.43794 10.8954 5.33337 12 5.33337Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M12 14.6666C13.1046 14.6666 14 13.7712 14 12.6666C14 11.5621 13.1046 10.6666 12 10.6666C10.8954 10.6666 10 11.5621 10 12.6666C10 13.7712 10.8954 14.6666 12 14.6666Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.72668 9.00665L10.28 11.66' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M10.2734 4.33997L5.72668 6.9933' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",oe="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2 4H3.33333H14' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.33334 3.99992V2.66659C5.33334 2.31296 5.47382 1.97382 5.72387 1.72378C5.97392 1.47373 6.31305 1.33325 6.66668 1.33325H9.33334C9.68697 1.33325 10.0261 1.47373 10.2762 1.72378C10.5262 1.97382 10.6667 2.31296 10.6667 2.66659V3.99992M12.6667 3.99992V13.3333C12.6667 13.6869 12.5262 14.026 12.2762 14.2761C12.0261 14.5261 11.687 14.6666 11.3333 14.6666H4.66668C4.31305 14.6666 3.97392 14.5261 3.72387 14.2761C3.47382 14.026 3.33334 13.6869 3.33334 13.3333V3.99992H12.6667Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6.66666 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.33334 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";const ne=({authorEmail:a,onDeletePost:n,shareUrl:i,post:r,className:d="",popoverClassName:u="",onBookmark:m,onRemoveBookmark:p,onEditPost:v})=>{const{data:{locale:g,userInfo:f,togetherUserId:h,env:{isMarryBaby:y}},action:{pushNotifications:C}}=t.useContext(s.TogetherComponentGlobalContext),{t:E}=o.useTranslations(),[w,k]=t.useState(!1),[P,T]=t.useState(!1),[S,x]=t.useState(!1),{authActionWrapper:N}=l.useTogetherAuthRequiredAction(),A=a&&(null==f?void 0:f.email)&&a===String(null==f?void 0:f.email);return b.default.createElement("div",{className:d,onClick:e=>{e.preventDefault(),e.stopPropagation()}},S&&b.default.createElement(l.SharePopup,{url:i,text:null==r?void 0:r.title,onClose:()=>x(!1)}),P&&b.default.createElement(D,{thumbnail:c.CommonGAssets.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:E("popup.deletePost.title"),description:E("popup.deletePost.description"),acceptText:E("popup.deletePost.accept"),cancelText:E("popup.deletePost.cancel"),onAccept:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if((null==r?void 0:r.id)&&!w){k(!0);try{const t=yield(({id:t,locale:a})=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t)return yield s.callApiWithAuth(s.getApiPath(s.PATHS.POST.DELETE,{id:t,_locale:a}),"DELETE")})))({id:r.id,locale:g});1===(null==t?void 0:t.status)&&(null==n||n())}catch(e){}k(!1)}})),onClose:()=>T(!1)}),b.default.createElement(l.TreePopoverMenu,{className:u,toggleButtonContent:b.default.createElement("img",{src:y?Y:ae,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:w},data:A?{isShowheader:!1,type:"list",list:[{icon:le,label:E("morePopover.share"),onClick:()=>x(!0)},{icon:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.16952 3.2356H2.99484C2.6785 3.2356 2.37512 3.36126 2.15143 3.58495C1.92774 3.80863 1.80208 4.11202 1.80208 4.42836V12.7777C1.80208 13.094 1.92774 13.3974 2.15143 13.6211C2.37512 13.8448 2.6785 13.9705 2.99484 13.9705H11.3442C11.6605 13.9705 11.9639 13.8448 12.1876 13.6211C12.4113 13.3974 12.537 13.094 12.537 12.7777V8.60303' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M11.6425 2.341C11.8798 2.10375 12.2016 1.97046 12.5371 1.97046C12.8726 1.97046 13.1944 2.10375 13.4317 2.341C13.6689 2.57826 13.8022 2.90005 13.8022 3.23558C13.8022 3.57111 13.6689 3.89289 13.4317 4.13015L7.76607 9.79578L5.38054 10.3922L5.97692 8.00663L11.6425 2.341Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",label:E("actionPopover.edit"),onClick:v},{icon:oe,label:E("actionPopover.delete"),onClick:()=>{N((()=>T(!0)))}}]}:{isShowheader:!1,type:"list",list:[{icon:le,label:E("morePopover.share"),onClick:()=>x(!0)},{icon:(null==r?void 0:r.bookmarked)?ee:te,label:(null==r?void 0:r.bookmarked)?E("morePopover.unsavePost"):E("morePopover.savePost"),onClick:()=>{N((()=>e.__awaiter(void 0,void 0,void 0,(function*(){if((null==f?void 0:f.id)&&(null==r?void 0:r.id))if(null==r?void 0:r.bookmarked){const e=yield s.callApiWithAuth(s.getApiPath(s.PATHS.BOOKMARK.DELETE,{_locale:g}),"DELETE",{data:{post_id:String(r.id)}});1===(null==e?void 0:e.status)?(C({title:"",message:"Removed saved post",type:"success",displayIcon:te}),p&&p()):C({title:"",message:"Remove failed",type:"danger",displayIcon:te})}else{const e=yield s.callApiWithAuth(s.getApiPath(s.PATHS.BOOKMARK.CREATE,{_locale:g}),"POST",{data:{user_id:h||f.id,post_id:r.id}});1===(null==e?void 0:e.status)?(C({title:"",message:"Post saved",type:"success",displayIcon:ee}),m&&m()):C({title:"",message:"Post saved failed",type:"danger",displayIcon:te})}}))))}},{icon:U,label:E("morePopover.report"),subTree:{title:E("morePopover.report.title"),description:E("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(s.REPORT_REASON_MAP).map((e=>({label:s.REPORT_REASON_MAP[e].label,reason:s.REPORT_REASON_MAP[e].reportReasonText,reasonValue:e}))).map((e=>({label:E(e.label),subTree:{title:E("morePopover.reportSubmit.title"),description:E("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>b.default.createElement(H,{reason:e.reasonValue,reasonText:E(e.reason),postId:null==r?void 0:r.id,onClose:()=>t&&t(!1)})}})))}}]}}))};const ie=({onDeleteComment:a,commentId:n,className:i="",popoverClassName:r=""})=>{const{data:{env:{isMarryBaby:d},locale:c},action:{pushNotifications:u}}=t.useContext(s.TogetherComponentGlobalContext),{t:m}=o.useTranslations(),[p,v]=t.useState(!1),{authActionWrapper:g}=l.useTogetherAuthRequiredAction();return b.default.createElement("div",{className:i,onClick:e=>{e.preventDefault(),e.stopPropagation()}},p&&b.default.createElement(D,{thumbnail:"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(%23clip0)'%3e%3cpath d='M2 4.008h12M5.333 4.008V2.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.008h9.334ZM6.667 7.342v4M9.333 7.342v4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0'%3e%3cpath fill='white' d='M0 .008h16v16H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",isThumbnailIcon:!0,title:m("popup.deleteComment.title"),description:m("popup.deleteComment.description"),acceptText:m("popup.deletePost.accept"),cancelText:m("popup.deletePost.cancel"),onAccept:()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;if(!n)return;const t=yield(({id:e,locale:t})=>s.callApiWithAuth(s.getApiPath(s.PATHS.COMMENT.DELETE,{_locale:t,id:e}),"DELETE"))({id:n,locale:c});1===(null==t?void 0:t.status)?(a&&a(),u({title:"",message:m("notification.success"),type:"success"})):u({title:"",message:(null===(e=null==t?void 0:t.messages)||void 0===e?void 0:e[0])||m("notification.failure"),type:"danger"})})),onClose:()=>v(!1)}),b.default.createElement(l.TreePopoverMenu,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:oe,label:m("actionPopover.delete"),onClick:()=>{g((()=>{v(!0)}))}}]},className:r,toggleButtonContent:b.default.createElement("img",{src:d?Y:ae,loading:"lazy"}),buttonProps:{}}))};var re="-dzIuHr";const se=({userId:e,avatar:a,name:n,role:s,title:d,className:c})=>{const{t:u}=o.useTranslations(),[m,p]=t.useState(!1);return b.default.createElement(b.default.Fragment,null,b.default.createElement(C.Button,{className:`${re} ${c}`,color:"success",size:"xs",onClick:()=>p(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},b.default.createElement("span",{className:"text"},b.default.createElement(r.Icon.Endorse,{isSolid:!0,size:18,color:i.theme.colors.green800,className:"icon"}),u("cardReply.verifyBy",{name:`${n||""}`}))),b.default.createElement(l.ProfileDetailModal,{open:m,onClose:()=>p(!1),profileModalProps:{zIndex:1e3}},b.default.createElement(l.ProfileDetail,{authorProps:{userId:e,avatar:a,name:n,role:s,title:d},hideQuestionTab:!0})))};const de=({className:a,style:n,comment:i,type:r="comment",level:c=0,replyingId:u,onPostCommentSuccess:m,post:v,onDeleteComment:g,refetchComment:f,hasQuickBookingEnable:h,handleMakeAppointment:y,cardAuthorProps:E,maxChars:w=600,disableShortenContent:k})=>{var P,T,S,x,A,I,_,M,L,j,R,B,O;const{data:{locale:z,userInfo:D,env:{isMarryBaby:U}}}=t.useContext(s.TogetherComponentGlobalContext),{t:H}=o.useTranslations(),[q,W]=t.useState(i||null),{id:V,countLikes:$,content:Z,replies:Q=[],images:K=[],author:X,liked:J,link:Y,mentionedUser:ee,mentions:te}=q,{text:ae,replyingTo:le}=(e=>{try{const t=e.match(/\[@([^\]]+)\]/),a=t?t[0].replace("[@","").replace("]",""):"";return{text:e.replace(/\[@([^\]]+)\]/,"").trim(),replyingTo:a}}catch(e){}return{text:""}})(Z),{authActionWrapper:oe}=l.useTogetherAuthRequiredAction({_joinCommunityIds:[null===(P=null==v?void 0:v.community)||void 0===P?void 0:P.id],_joinTopicIds:null===(T=null==v?void 0:v.topics)||void 0===T?void 0:T.map((e=>e.id))}),[ne,re]=t.useState(4),ce=!!(null==D?void 0:D.id)&&(null==Q?void 0:Q.some((e=>e.author.id===D.id))),ue=e=>{W((t=>{if(!t.replies.find((t=>t.id===e.id))){t.replies.unshift(e);const a=Object.assign(Object.assign({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return f&&f(a),a}return t}))},[me,pe]=t.useState(!1),ve=t.useMemo((()=>"comment"===r&&Q&&0!=Q.length?Q.sort(((e,t)=>{const a=new Date(e.createdAt).getTime(),l=new Date(t.createdAt).getTime();return a>l?-1:a<l?1:0})):Q),[r,Q]),ge=(null==Q?void 0:Q.length)||0,fe=String(null==X?void 0:X.email)&&(null==D?void 0:D.email)&&String(null==X?void 0:X.email)===String(null==D?void 0:D.email),he=(null==X?void 0:X.name)||(null==X?void 0:X.username)||"",ye=(null==X?void 0:X.username)||(null==X?void 0:X.name)||"",Ce=null==X?void 0:X.avatar,Ee=(null==v?void 0:v.isAnonymous)||null==X?void 0:X.role,we=[...(null==v?void 0:v.isAnonymous)?[{id:(null===(S=null==v?void 0:v.author)||void 0===S?void 0:S.id)||0,name:H("cardPost.anonymous")}]:[],...te||[]],[ke,be]=t.useState(null),[Pe,Te]=t.useState(null);t.useEffect((()=>{if(null==X?void 0:X.hospitalId){const t=t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield s.callApi(s.getCarePath(s.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:d.domainLocales[z]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&be(null==a?void 0:a._data.branch)}));t(X.hospitalId)}if(null==X?void 0:X.doctorId){const t=t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield s.callApi(s.getCarePath(s.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:t,website_url:d.domainLocales[z]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&Te(null==a?void 0:a._data.doctor)}));t(X.doctorId)}}),[X.hospitalId,X.doctorId]);const Se=(null==Pe?void 0:Pe.valid_outpatient)||(null==Pe?void 0:Pe.valid_telemedicine),xe=((null==ke?void 0:ke.total_available_service)||(null==ke?void 0:ke.total_available_doctor))>0,Ne=h&&(Se||xe),Ae="chatbot"===(null===(x=null==q?void 0:q.author)||void 0===x?void 0:x.type);return b.default.createElement(l.TogetherAuthConfigContextProvider,{defaultParams:{_joinCommunityIds:[null===(A=null==v?void 0:v.community)||void 0===A?void 0:A.id],_joinTopicIds:null===(I=null==v?void 0:v.topics)||void 0===I?void 0:I.map((e=>e.id))}},b.default.createElement(l.StyledCardPost,{className:a,style:n,"data-is-reply":!!c,"data-is-marrybaby":U,"data-has-booking":Ne},"reply"===r&&b.default.createElement(p.Divider,{className:"top-divider",type:"solid"}),b.default.createElement("div",{style:{padding:"16px 16px 0"}},b.default.createElement(l.CardAuthor,Object.assign({avatar:Ce,name:he,username:ye,timeText:null==v?void 0:v.createdTime,community:null==v?void 0:v.community,className:"post-author "+(fe?"with-popover":""),type:r,userId:null==X?void 0:X.id,role:Ee,expertId:null==X?void 0:X.partnerId,title:null==X?void 0:X.title,doctorId:null==X?void 0:X.doctorId,hospitalId:null==X?void 0:X.hospitalId,hasQuickBooking:Ne,handleMakeAppointment:y,isAnonymous:(null==q?void 0:q.isAnonymous)||Boolean(null==v?void 0:v.isAnonymous)&&(null===(_=null==v?void 0:v.author)||void 0===_?void 0:_.username)===(null==X?void 0:X.username),hideBackground:Ae,userType:null==X?void 0:X.type},E)),Boolean(null==q?void 0:q.isVerify)&&!Boolean(null==q?void 0:q.isOppose)&&b.default.createElement(se,{title:null===(M=null==q?void 0:q.userVerify)||void 0===M?void 0:M.title,name:null===(L=null==q?void 0:q.userVerify)||void 0===L?void 0:L.name,userId:null===(j=null==q?void 0:q.userVerify)||void 0===j?void 0:j.id,role:null===(R=null==q?void 0:q.userVerify)||void 0===R?void 0:R.role,avatar:null===(B=null==q?void 0:q.userVerify)||void 0===B?void 0:B.avatar,className:"verify-tag"})),b.default.createElement(l.PostContent,{className:"post-content-wrapper",replyingTo:le,mentionedUser:ee,description:ae,mentions:we,maxChars:w,disableShortenContent:k}),b.default.createElement("span",null),b.default.createElement("span",null),K&&K.length>0?b.default.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},b.default.createElement(G,{images:K,authorName:null==X?void 0:X.username})):null,K&&0!==K.length||!Y?null:b.default.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},b.default.createElement(N,{url:Y})),"most-engaging"!==r?b.default.createElement(b.default.Fragment,null,Ae&&b.default.createElement(l.StyledSourceList,{listUrl:null==q?void 0:q.source,categorySlug:null==q?void 0:q.categorySlug}),b.default.createElement(l.CardReactions,{type:l.CardReactionType.reply,loveCount:$,replyCount:ge,className:"post-reaction",liked:J,isReplied:ce,hideCommentIcon:"reply"===r||Ae,hasShare:!1,onCommentClick:()=>oe((()=>pe((e=>!e)))),onCommentCountClick:()=>oe((()=>{pe(!0)})),onLikeClick:()=>oe((()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(V){const t=yield(({commentId:t,setLike:a=!1,locale:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return s.callApiWithAuth(s.getApiPath(a?s.PATHS.COMMENT.LIKE:s.PATHS.COMMENT.UNLIKE,{_locale:l,id:t}),"GET")})))({commentId:V,setLike:!J,locale:z});1===t.status&&W((e=>Object.assign(Object.assign({},e),{liked:!J,countLikes:e.countLikes+(J?-1:1)})))}}))))}),me&&b.default.createElement(F,{replyingId:u||q.id,replyToName:he,isReply:!0,onClose:()=>pe(!1),onPostSuccess:e=>{"reply"===r?m&&m(e):ue(e)},post:v,replyingUser:X}),"comment"===r&&Q&&Q.length>0?b.default.createElement("div",{className:"comment-reply-wrapper"},null===(O=null==ve?void 0:ve.slice(0,ne))||void 0===O?void 0:O.map((e=>b.default.createElement(de,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:c+1,replyingId:V,onPostCommentSuccess:ue,post:v,onDeleteComment:()=>{W((t=>Object.assign(Object.assign({},t),{replies:t.replies.filter((t=>t.id!==e.id)),countReplies:t.countReplies-1})))},handleMakeAppointment:y,hasQuickBookingEnable:h}))),ge>ne&&b.default.createElement(b.default.Fragment,null,b.default.createElement(p.Divider,{className:"top-divider",type:"solid"}),b.default.createElement(C.Button,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>re((e=>e+4))},H("comment.seeMoreReplies",{count:ge-ne}),b.default.createElement("img",{className:"chevron-right",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12L10 8L6 4' stroke='%232D87F3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",loading:"lazy"})))):null):null,fe&&b.default.createElement(ie,{onDeleteComment:g,className:"popover",commentId:q.id})))},ce=(t,a)=>e.__awaiter(void 0,void 0,void 0,(function*(){var e,l,o;const n=yield s.callApiWithOptionalAuth(s.getApiPath(s.PATHS.COMMENT.LIST,{postId:t,_locale:a,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(o=null===(l=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.comments)||void 0===l?void 0:l.map(v.formatComment))||void 0===o?void 0:o[0]}));var ue=Object.freeze({__proto__:null});exports.CardLink=N,exports.CardPost=({className:a,style:n,hideViewMoreComment:i,showMostEngaging:r,onCommentClick:d,onCommentCountClick:c,onMostEngagingCommentClick:u,onPostCommentSuccess:m,disableCardLink:p,disableShortenContent:v,onDeletePost:g,onEditPost:f,post:h,mostEngagingComment:y,onDeleteComment:E,showInputComment:w,InlineCommentsComponent:k,hasQuickBookingEnable:T,handleMakeAppointment:S,cardAuthorProps:x})=>{const[_,M]=t.useState(h),[L,j]=t.useState(!1),[R,B]=t.useState(y),{community:O,topics:z,author:D,slug:U,isPin:H,liked:q,photos:W,mentions:V,title:$,description:Q,previewUrl:K,likesCount:X,commentsCount:J,id:Y,commented:ee}=_,{data:{locale:te,env:{isMarryBaby:ae,togetherBasePath:le}},action:{pushNotifications:oe}}=t.useContext(s.TogetherComponentGlobalContext),{t:ie}=o.useTranslations(),[re,se]=t.useState(w),ue=`${le}/${(null==O?void 0:O.slug)||"_"}/${U||""}`,me=`${s.getCurrentBaseUrl(te)}${ue}`,{authActionWrapper:pe}=l.useTogetherAuthRequiredAction((null==O?void 0:O.slug)?{_joinCommunityIds:[O.id],_joinTopicIds:null==z?void 0:z.map((e=>e.id))}:void 0),[ve,ge]=t.useState(!1);t.useEffect((()=>{se(w)}),[w]);const fe=(null==D?void 0:D.name)||(null==D?void 0:D.username)||"",he=(null==D?void 0:D.username)||(null==D?void 0:D.name)||"",ye=null==D?void 0:D.avatar,Ce=(null==_?void 0:_.isAnonymous)||null==D?void 0:D.role,[Ee,we]=t.useState(null),[ke,be]=t.useState(null);t.useEffect((()=>{if(null==D?void 0:D.hospitalId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield s.callApi(s.getCarePath(s.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:s.domainLocales[te]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&we(null==a?void 0:a._data.branch)})))(D.hospitalId)}if(null==D?void 0:D.doctorId){(t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const a=yield s.callApi(s.getCarePath(s.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:t,website_url:s.domainLocales[te]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&be(null==a?void 0:a._data.doctor)})))(D.doctorId)}}),[D.hospitalId,D.doctorId]);const Pe=(null==ke?void 0:ke.valid_outpatient)||(null==ke?void 0:ke.valid_telemedicine),Te=((null==Ee?void 0:Ee.total_available_service)||(null==Ee?void 0:Ee.total_available_doctor))>0,Se=T&&(Pe||Te);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if(Y&&J&&r&&!(null==y?void 0:y.id)){const e=yield ce(Y,te);B(e)}}))}),[Y,te,J,r,null==y?void 0:y.id]),t.useEffect((()=>{B(y)}),[null==y?void 0:y.id]);const xe=t=>e.__awaiter(void 0,void 0,void 0,(function*(){if(J>1&&(null==R?void 0:R.id)&&(null==R?void 0:R.id)===(null==t?void 0:t.id)){const e=yield ce(Y,te);B(e)}M((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1}))),E&&E(t)}));return b.default.createElement(l.TogetherAuthConfigContextProvider,{defaultParams:(null==O?void 0:O.slug)?{_joinCommunityIds:[O.id],_joinTopicIds:null==z?void 0:z.map((e=>e.id))}:void 0},L&&b.default.createElement(l.SharePopup,{url:me,avatar:s.DEFAULT_IMG,text:$,onClose:()=>j(!1)}),b.default.createElement(l.StyledCardPost$1,{className:a,style:n,"data-is-marrybaby":ae},H?b.default.createElement(A,{className:"post-pin"}):null,b.default.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},b.default.createElement(l.CardAuthor,Object.assign({avatar:ye,name:fe,username:he,url:p?void 0:ue,community:O,timeText:null==_?void 0:_.createdTime,className:"post-author",role:Ce,userId:null==D?void 0:D.id,expertId:null==D?void 0:D.partnerId,doctorId:null==D?void 0:D.doctorId,hospitalId:null==D?void 0:D.hospitalId,title:null==D?void 0:D.title,hasQuickBooking:Se,handleMakeAppointment:S,"data-testid":"name",isAnonymous:!!(null==_?void 0:_.isAnonymous),extendEle:b.default.createElement(ne,{authorEmail:String(null==D?void 0:D.email),onDeletePost:g,shareUrl:me,post:_,className:"popover",onEditPost:f})},x))),b.default.createElement("a",{href:p?void 0:ue,className:"post-content-link-wrapper"},$&&b.default.createElement(s.Heading,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},P.default($)),b.default.createElement(l.PostContent,{className:"post-content-wrapper",description:Q,disableShortenContent:v,mentions:V,"data-testid":"Content of the Post"})),b.default.createElement("span",null),b.default.createElement("span",null),b.default.createElement("div",{key:"tag-topic"},z&&z.length>0?b.default.createElement(l.TagTopic,{topics:z,className:"post-topics"}):null),b.default.createElement("div",{key:"social-preview"},(null==_?void 0:_.introUrl)?b.default.createElement("div",{className:"social-preview-wrapper "+((null==W?void 0:W.length)?"has-image":"")},b.default.createElement(Z,{url:_.introUrl,image:_.bannerImage})):null),b.default.createElement("div",{key:"image-preview"},(null==W?void 0:W.length)?b.default.createElement("div",{className:"image-preview-wrapper"},b.default.createElement(G,{images:W,authorName:null==D?void 0:D.name})):null),b.default.createElement("div",{key:"link-preview"},(null==_?void 0:_.introUrl)||(null==W?void 0:W.length)||!(null==K?void 0:K.url)?null:b.default.createElement("div",{className:"link-preview-wrapper"},b.default.createElement(N,{title:K.title,url:K.url,image:K.image}))),b.default.createElement(l.CardReactions,{isMarryBaby:ae,type:l.CardReactionType.post,loveCount:X,replyCount:J,className:"post-reaction "+((null==W?void 0:W.length)||(null==K?void 0:K.url)?"hide-top-border":""),liked:ve?!q:q,isReplied:ee,onCommentClick:()=>pe((()=>{d?d():se((e=>!e))})),onCommentCountClick:()=>{pe((()=>{ae?se(!0):c?c():!p&&(window.location.href=ue)}))},onShareClick:()=>{j(!0)},onLikeClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(Y&&!ve){ge(!0);try{const t=yield(({id:t,locale:a})=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t)return yield s.callApiWithAuth(s.getApiPath(s.PATHS.POST.LIKE,{id:t,_locale:a}),"GET")})))({id:Y,locale:te});1!==(null==t?void 0:t.status)?oe(I(ie)):M((e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked})))}catch(e){oe(I(ie))}ge(!1)}})),showingMostEngaging:!(!r||!(null==R?void 0:R.id))}),re&&b.default.createElement(F,{isMainCmt:!w,onClose:()=>se(!1),onPostSuccess:e=>{0!==J||(null==R?void 0:R.id)||B(e),M((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0}))),m&&m(e)},post:_}),r&&(null==R?void 0:R.id)?b.default.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{u?(e.stopPropagation(),u()):window.location.href=ue}},b.default.createElement(de,{hasQuickBookingEnable:T,handleMakeAppointment:S,comment:R,post:_,onDeleteComment:()=>{xe&&xe(R)},className:"most-engaging-comment",type:"most-engaging",key:R.id,cardAuthorProps:x}),J>1&&!i&&b.default.createElement(C.Button,{className:"see-more-comments",color:"ghost",size:"md"},ie("comment.seeMoreComments",{count:J-1}))):null,k))},exports.CardPostPopoverMore=ne,exports.CardReply=de,exports.CardReplyPopover=ie,exports.CreateNewPostContent=({className:n,style:d,onPostCreatedEdited:m,onClose:g,communities:f=[],forceSelectCommunity:h,forceSelectTopics:y,articleId:C,optionalTopic:E,editPostData:w,defaultCommunity:k,defaultTopics:T,noFetchTopic:S,hideTopicList:x,selectAskDoctor:N,showAskDoctorOptions:A,currentPageUrl:M})=>{const L=!!(null==w?void 0:w.id),{data:{locale:R,env:{isMarryBaby:z}},action:{pushNotifications:D,sanitizeFunction:F}}=t.useContext(s.TogetherComponentGlobalContext),{t:U}=o.useTranslations(),[H,q]=t.useState(!1),[W,V]=t.useState(N),[$,G]=t.useState(!1),[Z,Q]=t.useState(!1),[K,X]=t.useState(!1),[J,Y]=t.useState(""),[ee,te]=t.useState(""),[ae,le]=t.useState(h?{label:h.name,value:`${h.id||""}-${h.mappedCategoryId||""}`}:{label:U("community.choose"),value:""}),[oe,ne]=t.useState([...y]||[]),[ie,re]=t.useState([]),[se,de]=t.useState([]),ce=h||f.find((e=>`${e.id||""}-${e.mappedCategoryId||""}`===ae.value)),ue=h?[h]:f.filter((e=>e.isActive)).sort(((e,t)=>e.name>t.name?1:e.name<t.name?-1:0)),[me,pe]=t.useState(null),[ve,ge]=t.useState([]),fe=J&&!Z&&P.default(ee)&&(E||!E&&oe.length>0)&&ce&&(!ie||ie.length<=s.MAX_IMAGE_UPLOADS)&&!(null==ve?void 0:ve.length)&&!K;t.useEffect((()=>{if(w){const e=w;Y(e.title||""),te(l.decodeMention(l.decodePostUrl(e.description||"","edit"),e.mentions)),le({label:e.community.name,value:`${e.community.id||""}-${e.community.mappedCategoryId||""}`}),ne(e.topics||[]),re(e.photos||[]),q(!!e.isAnonymous||!1),V(!!e.isAskDoctor||!1)}else k&&le({label:k.name,value:`${k.id||""}-${k.mappedCategoryId||""}`}),T&&ne(T)}),[]),t.useEffect((()=>{Q(""!==J&&!/[a-zA-Z]/.test(J))}),[J]);const he=()=>e.__awaiter(void 0,void 0,void 0,(function*(){var t,a,o,n,i,r,d,c,p;if(A&&void 0===W)return G(!0),!1;const f=yield(({title:t,description:a,communityId:o,imageFiles:n,previewUrl:i,topicIds:r,locale:d,sanitizeFunction:c,categoryCommunityId:m,categoryTopicIds:p,introUrl:v,bannerUrl:g,scheduleTime:f,isAnonymous:h,isAskDoctor:y})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=new FormData,C=l.removeBannedWordWrapper(a),E=l.removeBannedWordWrapper(t),w=l.getMentionIdsFromString(C);if(e.append("title",E),e.append("description",l.encodePostContent(C,c)),m?e.append("category_community",String(m)):o&&e.append("community_id",String(o)),e.append("is_anonymous",h?"1":"0"),e.append("is_question",y?"1":"0"),(null==i?void 0:i.title)&&e.append("preview_title",i.title),(null==i?void 0:i.description)&&e.append("preview_description",i.description),(null==i?void 0:i.url)&&e.append("preview_link",u.safeEncodeURI(i.url)),(null==i?void 0:i.image)&&e.append("preview_image",u.safeEncodeURI(i.image)),null==r||r.forEach((t=>{e.append("topics[]",String(t||""))})),null==p||p.forEach((t=>{e.append("category_topics[]",String(t||""))})),null==n?void 0:n.length){const t=yield Promise.all(n.map(((e,t)=>new Promise((a=>{setTimeout((()=>{a(l.uploadAndGetSrc(e,d))}),2e3*t)})))));null==t||t.filter(Boolean).slice(0,s.MAX_IMAGE_UPLOADS).forEach(((t,a)=>{e.append(`images[${a}]`,t)}))}else e.append("images","");return null==w||w.forEach((t=>{e.append("mention_ids[]",t)})),e.append("intro_url",v||""),e.append("banner",g||""),f&&(e.append("post_type","scheduled"),e.append("schedule_datetime",f)),e})))({title:J,description:ee,communityId:String((null==ce?void 0:ce.id)||""),imageFiles:ie,previewUrl:me,topicIds:null==oe?void 0:oe.map((e=>String(e.id||""))).filter(Boolean),locale:R,sanitizeFunction:F,categoryCommunityId:String((null==ce?void 0:ce.mappedCategoryId)||""),categoryTopicIds:null==oe?void 0:oe.map((e=>String(e.mappedCategoryId||""))).filter(Boolean),isAnonymous:H?1:0,isAskDoctor:W?1:0});let h;C&&f.append("article_id",C),L?(null==w?void 0:w.id)&&(h=yield(({id:t,locale:a,formData:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield s.callApiWithAuth(s.getApiPath(s.PATHS.POST.UPDATE,{id:t,_locale:a}),"POST",{data:l})})))({id:w.id,formData:f,locale:R})):h=yield(({locale:t,formData:a,isArticleComment:l})=>e.__awaiter(void 0,void 0,void 0,(function*(){return yield s.callApiWithAuth(s.getApiPath(l?s.PATHS.POST.CREATE_ARTICLE_COMMENT:s.PATHS.POST.CREATE,{_locale:t}),"POST",{data:a})})))({formData:f,locale:R,isArticleComment:!(null==ce?void 0:ce.id)&&!!(null==ce?void 0:ce.mappedCategoryId)});const y=null==h?void 0:h.data;(null==y?void 0:y.id)&&!(null===(a=null===(t=null==h?void 0:h.messages)||void 0===t?void 0:t.moderation)||void 0===a?void 0:a.type)?(D({message:U("createPost.popup.success"),type:"success"}),(e=>{m&&m(v.formatPost(e),L),g&&g()})(y)):"banned"===(null===(n=null===(o=null==h?void 0:h.messages)||void 0===o?void 0:o.moderation)||void 0===n?void 0:n.type)?(D({title:U("notification.post.blocked.title"),message:U("notification.post.blocked.message"),type:"danger"}),h.messages.moderation.words&&de(h.messages.moderation.words)):"suspect"===(null===(r=null===(i=null==h?void 0:h.messages)||void 0===i?void 0:i.moderation)||void 0===r?void 0:r.type)?(D({title:U("notification.post.suspect.title"),message:U("notification.post.suspect.message"),type:"warning"}),g&&g()):(null===(c=null===(d=null==h?void 0:h.messages)||void 0===d?void 0:d.find)||void 0===c?void 0:c.call(d,(e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(D({message:U("notification.suspend.message"),type:"danger"}),g&&g()):D({message:(null===(p=null==h?void 0:h.messages)||void 0===p?void 0:p[0])||U("notification.failure"),type:"danger"})}));return b.default.createElement(l.StyledCreateNewPost,{className:n,style:d},b.default.createElement("div",{className:"input-group-container"},b.default.createElement(B,{className:"input-group",bannedWords:se,value:J,onChange:Y}),Z&&b.default.createElement(l.StyledError,null,b.default.createElement(r.Info,{isSolid:!0,color:i.theme.colors.red700,size:14}),b.default.createElement(s.Text,{size:"p3",as:"span",color:i.theme.colors.red700},U("createPost.popup.specialCharErr"))),b.default.createElement(j,{className:"input-group",bannedWords:se,value:ee,onChange:te,onPreviewUrlChange:pe,onInvalidUrlsChange:ge,onImageFilesChange:re,imageFiles:ie}),A&&b.default.createElement(l.StyledIsQuestion,{"data-is-marry-baby":z},b.default.createElement("div",{className:"switch-label"},b.default.createElement(r.Ask,{isMarryBaby:z,size:z?32:24,color:i.theme.colors.primaryBase,className:"label-icon"}),b.default.createElement("span",{className:"label-txt"},U("createPost.askDoctor"))),b.default.createElement(p.BtnChoice,{value:W,choices:[{label:U("createPost.askDoctorChoice.yes"),value:!0,dataEventCategory:"Together",dataEventAction:"Write Post Click - Ask Doctor",dataEventLabel:M},{label:U("createPost.askDoctorChoice.no"),value:!1}],onChange:e=>{"boolean"==typeof e&&(G(!1),V(e))}})),$&&b.default.createElement(l.StyledError,null,b.default.createElement(r.Info,{isSolid:!0,color:i.theme.colors.red700,size:14}),b.default.createElement(s.Text,{size:"p3",as:"span",color:i.theme.colors.red700},U("createPost.message.askDoctorRequire"))),b.default.createElement("div",{className:"input-group"},b.default.createElement(s.Text,{size:"p4",className:"input-group-label"},U("admin.community")),b.default.createElement(l.Dropdown,{options:(null==ue?void 0:ue.map((e=>({label:e.name,value:`${e.id||""}-${e.mappedCategoryId||""}`}))))||[],id:"community-picker",placeholder:U("community.choose"),value:ae,dropdownLabelTrackingAttributes:{"data-event-category":"Together","data-event-action":"Write Post Click - Choose Community/Topic","data-event-label":M},onChange:e=>{le({label:e.label,value:String(e.value)}),ne([])},disabled:!!h}),b.default.createElement(s.Text,{size:"sm",className:"warning",color:i.theme.colors.gray400},"* ",U("commentPopup.warning.newPost"))),!x&&b.default.createElement("div",{className:"input-group"},b.default.createElement(s.Text,{size:"p4",className:"input-group-label"},U("tab.topic")),b.default.createElement("div",{className:"input-notification"},b.default.createElement("img",{src:ce?"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%232D87F3'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e":_,loading:"lazy"}),b.default.createElement(s.Text,{size:"base",color:i.theme.colors.gray500},U(ce?"createPost.popup.primary":"createPost.popup.warning"))),ce&&b.default.createElement(O,{className:"tag-list",communityId:ce.id,forceTopics:y,onChange:ne,selectedTopics:oe,noFetch:S,dataEventCategory:"Together",dataEventAction:"Write Post Click - Choose Community/Topic",dataEventLabel:M}))),b.default.createElement("div",{className:"form-action"},b.default.createElement("div",{className:"input-group"},b.default.createElement(a.Checkbox,{className:"swich-input-group",labelPosition:"left",name:"PostAnonymous",checked:H,color:z?"pink":void 0,"data-event-category":"Together","data-event-action":"Write Post Click - Incognito","data-event-label":M,label:b.default.createElement("div",{className:"switch-label"},b.default.createElement("img",{className:"label-icon",src:c.CommonGAssets.getAssetPath("anomyous-avatar.svg"),alt:"anomyous avatar",style:{marginRight:"10px",width:"24px"},loading:"lazy"}),b.default.createElement("span",{className:"label-txt"},U("createPost.postAnonymous"))),value:"Post Anonymous",onChange:e=>q(e.currentTarget.checked),styles:{body:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},label:{display:"flex",alignItems:"center"}}})),b.default.createElement("div",{className:"input-group"},b.default.createElement(s.Button,{className:"submit-btn pointer-event-child-none",size:"lg","data-event-category":"Ask Doctor","data-event-action":"Submit Question","data-event-label":window.location.href,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(fe&&!K){X(!0);try{yield he()}catch(e){console.error(e),D(I(U))}X(!1)}})),disabled:!fe,loading:K},U("createPost.popup.submit")))))},exports.CreatePostDescription=j,exports.CreatePostTitle=B,exports.ImagePreviewPopup=q,exports.InputCommentBar=F,exports.LabelPin=A,exports.PopupDanger=D,exports.PostImagePreview=G,exports.PostSingleImageViewPopup=V,exports.SkipQuestionOfExpertBtn=l=>{var{post:n,onSkip:i,btnText:d,currentPageUrl:c}=l,u=e.__rest(l,["post","onSkip","btnText","currentPageUrl"]);const{t:m}=o.useTranslations(),{data:{locale:p},action:{pushNotifications:v}}=t.useContext(s.TogetherComponentGlobalContext),[g,f]=t.useState(!1),[h,y]=t.useState(!1),C=a.useMantineTheme(),E=t.useCallback((()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;y(!0);const t=yield s.callApiWithAuth(s.getApiPath(s.PATHS.USER.SKIP_QUESTION,{_locale:p,id:null==n?void 0:n.id}),"PUT");1===(null==t?void 0:t.status)?(null==i||i({id:(null==n?void 0:n.id)||"",communityId:(null===(e=null==n?void 0:n.community)||void 0===e?void 0:e.id)||""}),f(!1),v({title:"",message:"Skip success",type:"success"})):v({title:"",message:null==t?void 0:t.messages,type:"danger"}),y(!1)}))),[]);return b.default.createElement(a.Popover,{width:327,withArrow:!0,shadow:"md",opened:g},b.default.createElement(a.Popover.Target,null,b.default.createElement("div",Object.assign({className:`${Q} ${(null==u?void 0:u.className)||""}`,onClick:()=>f(!0)},u),d||m("profilePanel.questionNotClear"))),b.default.createElement(a.Popover.Dropdown,null,b.default.createElement("div",null,b.default.createElement("div",{className:K},m("profilePanel.skipQuestion.heading")),b.default.createElement("div",{className:X},m("profilePanel.skipQuestion.content")),b.default.createElement("div",{className:J},b.default.createElement(s.Button,{size:"md",variant:"secondary",leftIcon:b.default.createElement(r.Close,{color:C.fn.primaryColor(),size:24}),onClick:()=>f(!1),styles:()=>({leftIcon:{marginRight:0}})}),b.default.createElement(s.Button,{variant:"primary",size:"md",leftIcon:b.default.createElement(r.Check,{color:"white",size:24}),onClick:E,loading:h,"data-event-category":"Together","data-event-action":"Unclear Question Click","data-event-label":c,styles:()=>({leftIcon:{marginRight:0}})})))))},exports.SocialLinkPreview=Z,exports.SubmitReportForm=H,exports.TopicSelectList=O,exports.VerifiedTag=se,exports.types=ue;
package/build/types.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./Onboarding-d141cba2.js");Object.defineProperty(exports,"BabyGrowthChartDuration",{enumerable:!0,get:function(){return e.BabyGrowthChartDuration}}),Object.defineProperty(exports,"BabyGrowthChartType",{enumerable:!0,get:function(){return e.BabyGrowthChartType}}),Object.defineProperty(exports,"BabyGrowthResultTab",{enumerable:!0,get:function(){return e.BabyGrowthResultTab}}),Object.defineProperty(exports,"Gender",{enumerable:!0,get:function(){return e.Gender}}),Object.defineProperty(exports,"LOCALE",{enumerable:!0,get:function(){return e.LOCALE}}),Object.defineProperty(exports,"OnboardingStep",{enumerable:!0,get:function(){return e.OnboardingStep}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./Onboarding-e89cd92f.js");Object.defineProperty(exports,"BabyGrowthChartDuration",{enumerable:!0,get:function(){return e.BabyGrowthChartDuration}}),Object.defineProperty(exports,"BabyGrowthChartType",{enumerable:!0,get:function(){return e.BabyGrowthChartType}}),Object.defineProperty(exports,"BabyGrowthResultTab",{enumerable:!0,get:function(){return e.BabyGrowthResultTab}}),Object.defineProperty(exports,"Gender",{enumerable:!0,get:function(){return e.Gender}}),Object.defineProperty(exports,"LOCALE",{enumerable:!0,get:function(){return e.LOCALE}}),Object.defineProperty(exports,"OnboardingStep",{enumerable:!0,get:function(){return e.OnboardingStep}});
@@ -1 +1 @@
1
- "use strict";var e=require("react"),a=require("./Onboarding-d141cba2.js"),n=require("./useTranslations-1317bce3.js");const t={"vi-VN":"mang-thai","id-ID":"kehamilan","ms-MY":"kehamilan","km-KH":"ពពោះ","en-PH":"pregnancy","tl-PH":"pregnancy","th-TH":"การตั้งครรภ์","my-MM":"pregnancy","zh-TW":"pregnancy","hi-IN":"pregnancy"},b={[a.LOCALE.Vietnam]:{sexualWellness:"suc-khoe-tinh-duc",health:"suc-khoe",healthyEating:"an-uong-lanh-manh",skinHealth:"da-lieu",healthyHabit:"thoi-quen-lanh-manh",drug:"thuoc",womensHealth:"suc-khoe-phu-nu",fitness:"the-duc-the-thao",pregnancy:"mang-thai",parenting:"nuoi-day-con",diabetes:"tieu-duong-dai-thao-duong",healthyMind:"tam-ly-tam-than"},[a.LOCALE.Indonesia]:{pregnancy:"kehamilan",parenting:"parenting",health:"sehat",diabetes:"diabetes",womensHealth:"wanita",drug:"obat-suplemen",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Malaysia]:{pregnancy:"kehamilan",parenting:"keibubapaan",health:"kesihatan",diabetes:"kencing-manis",womensHealth:"kesihatan-wanita",drug:"ubat",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Cambodia]:{pregnancy:"%e1%9e%96%e1%9e%96%e1%9f%84%e1%9f%87",parenting:"%e1%9e%85%e1%9e%b7%e1%9e%89%e1%9f%92%e1%9e%85%e1%9e%b9%e1%9e%98%e1%9e%80%e1%9e%bc%e1%9e%93",health:"%e1%9e%9f%e1%9e%bb%e1%9e%81%e1%9e%97%e1%9e%b6%e1%9e%96%e1%9e%91%e1%9e%bc%e1%9e%91%e1%9f%85",diabetes:"%e1%9e%87%e1%9f%86%e1%9e%84%e1%9e%ba%e1%9e%91%e1%9e%b9%e1%9e%80%e1%9e%93%e1%9f%84%e1%9e%98%e1%9e%95%e1%9f%92%e1%9e%a2%e1%9f%82%e1%9e%98",womensHealth:"%e1%9e%9f%e1%9e%bb%e1%9e%81%e1%9e%97%e1%9e%b6%e1%9e%96%e1%9e%9f%e1%9f%92%e1%9e%8f%e1%9f%92%e1%9e%9a%e1%9e%b8",drug:"%e1%9e%b1%e1%9e%9f%e1%9e%90%e1%9e%93%e1%9e%b7%e1%9e%84%e1%9e%a2%e1%9e%b6%e1%9e%a0%e1%9e%b6%e1%9e%9a%e1%9e%94%e1%9f%86%e1%9e%94%e1%9f%89%e1%9e%93",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.PhilippinesEnglish]:{pregnancy:"pregnancy",parenting:"parenting",health:"health",diabetes:"diabetes",womensHealth:"womens-health",drug:"drugs-supplements",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.PhilippinesTagalog]:{pregnancy:"pagbubuntis",parenting:"pagiging-magulang",health:"kalusugan",diabetes:"diabetes-fil",womensHealth:"kalusugan-kababaihan",drug:"drugs-at-supplements",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Thailand]:{pregnancy:"%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87%e0%b8%84%e0%b8%a3%e0%b8%a3%e0%b8%a0%e0%b9%8c",parenting:"%e0%b8%9e%e0%b9%88%e0%b8%ad%e0%b9%81%e0%b8%a1%e0%b9%88%e0%b9%80%e0%b8%a5%e0%b8%b5%e0%b9%89%e0%b8%a2%e0%b8%87%e0%b8%a5%e0%b8%b9%e0%b8%81",health:"%e0%b8%aa%e0%b8%b8%e0%b8%82%e0%b8%a0%e0%b8%b2%e0%b8%9e",diabetes:"%e0%b9%82%e0%b8%a3%e0%b8%84%e0%b9%80%e0%b8%9a%e0%b8%b2%e0%b8%ab%e0%b8%a7%e0%b8%b2%e0%b8%99",womensHealth:"%e0%b8%aa%e0%b8%b8%e0%b8%82%e0%b8%a0%e0%b8%b2%e0%b8%9e%e0%b8%ab%e0%b8%8d%e0%b8%b4%e0%b8%87",drug:"%e0%b8%a2%e0%b8%b2%e0%b9%81%e0%b8%a5%e0%b8%b0%e0%b8%ad%e0%b8%b2%e0%b8%ab%e0%b8%b2%e0%b8%a3%e0%b9%80%e0%b8%aa%e0%b8%a3%e0%b8%b4%e0%b8%a1",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Myanmar]:{pregnancy:"pregnancy",parenting:"parenting",health:"health",diabetes:"diabetes",womensHealth:"womens-health",drug:"drugs-az",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Taiwan]:{pregnancy:"pregnancy",parenting:"parenting",health:"health",diabetes:"diabetes",womensHealth:"womens-health",drug:"drugs-supplement",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.India]:{pregnancy:"pregnancy",parenting:"parenting",health:"health",diabetes:"diabetes",womensHealth:"womens-health",diabetesEn:"en-diabetes",drug:"dawaai",sexualWellness:"",healthyEating:"",skinHealth:""}};exports.MAPPED_CATEGORY_SLUGS=b,exports.PREGNANCY_SLUG=t,exports.useCategory=a=>{const{locale:s}=n.useTranslations();return{isPregnancy:e.useMemo((()=>decodeURI(a.replace(/\//gi,"")).includes(t[s])),[]),isParenting:e.useMemo((()=>{var e;return decodeURI(a.replace(/\//gi,"")).includes(null===(e=b[s])||void 0===e?void 0:e.parenting)}),[]),type:e.useMemo((()=>function(e,a){const n=e.split("/");for(const e in a){const t=a[e];if(n.includes(t))return e}return null}(a,b[s])),[a,s])}};
1
+ "use strict";var e=require("react"),a=require("./Onboarding-e89cd92f.js"),n=require("./useTranslations-10d0cd79.js");const t={"vi-VN":"mang-thai","id-ID":"kehamilan","ms-MY":"kehamilan","km-KH":"ពពោះ","en-PH":"pregnancy","tl-PH":"pregnancy","th-TH":"การตั้งครรภ์","my-MM":"pregnancy","zh-TW":"pregnancy","hi-IN":"pregnancy"},b={[a.LOCALE.Vietnam]:{sexualWellness:"suc-khoe-tinh-duc",health:"suc-khoe",healthyEating:"an-uong-lanh-manh",skinHealth:"da-lieu",healthyHabit:"thoi-quen-lanh-manh",drug:"thuoc",womensHealth:"suc-khoe-phu-nu",fitness:"the-duc-the-thao",pregnancy:"mang-thai",parenting:"nuoi-day-con",diabetes:"tieu-duong-dai-thao-duong",healthyMind:"tam-ly-tam-than"},[a.LOCALE.Indonesia]:{pregnancy:"kehamilan",parenting:"parenting",health:"sehat",diabetes:"diabetes",womensHealth:"wanita",drug:"obat-suplemen",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Malaysia]:{pregnancy:"kehamilan",parenting:"keibubapaan",health:"kesihatan",diabetes:"kencing-manis",womensHealth:"kesihatan-wanita",drug:"ubat",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Cambodia]:{pregnancy:"%e1%9e%96%e1%9e%96%e1%9f%84%e1%9f%87",parenting:"%e1%9e%85%e1%9e%b7%e1%9e%89%e1%9f%92%e1%9e%85%e1%9e%b9%e1%9e%98%e1%9e%80%e1%9e%bc%e1%9e%93",health:"%e1%9e%9f%e1%9e%bb%e1%9e%81%e1%9e%97%e1%9e%b6%e1%9e%96%e1%9e%91%e1%9e%bc%e1%9e%91%e1%9f%85",diabetes:"%e1%9e%87%e1%9f%86%e1%9e%84%e1%9e%ba%e1%9e%91%e1%9e%b9%e1%9e%80%e1%9e%93%e1%9f%84%e1%9e%98%e1%9e%95%e1%9f%92%e1%9e%a2%e1%9f%82%e1%9e%98",womensHealth:"%e1%9e%9f%e1%9e%bb%e1%9e%81%e1%9e%97%e1%9e%b6%e1%9e%96%e1%9e%9f%e1%9f%92%e1%9e%8f%e1%9f%92%e1%9e%9a%e1%9e%b8",drug:"%e1%9e%b1%e1%9e%9f%e1%9e%90%e1%9e%93%e1%9e%b7%e1%9e%84%e1%9e%a2%e1%9e%b6%e1%9e%a0%e1%9e%b6%e1%9e%9a%e1%9e%94%e1%9f%86%e1%9e%94%e1%9f%89%e1%9e%93",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.PhilippinesEnglish]:{pregnancy:"pregnancy",parenting:"parenting",health:"health",diabetes:"diabetes",womensHealth:"womens-health",drug:"drugs-supplements",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.PhilippinesTagalog]:{pregnancy:"pagbubuntis",parenting:"pagiging-magulang",health:"kalusugan",diabetes:"diabetes-fil",womensHealth:"kalusugan-kababaihan",drug:"drugs-at-supplements",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Thailand]:{pregnancy:"%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87%e0%b8%84%e0%b8%a3%e0%b8%a3%e0%b8%a0%e0%b9%8c",parenting:"%e0%b8%9e%e0%b9%88%e0%b8%ad%e0%b9%81%e0%b8%a1%e0%b9%88%e0%b9%80%e0%b8%a5%e0%b8%b5%e0%b9%89%e0%b8%a2%e0%b8%87%e0%b8%a5%e0%b8%b9%e0%b8%81",health:"%e0%b8%aa%e0%b8%b8%e0%b8%82%e0%b8%a0%e0%b8%b2%e0%b8%9e",diabetes:"%e0%b9%82%e0%b8%a3%e0%b8%84%e0%b9%80%e0%b8%9a%e0%b8%b2%e0%b8%ab%e0%b8%a7%e0%b8%b2%e0%b8%99",womensHealth:"%e0%b8%aa%e0%b8%b8%e0%b8%82%e0%b8%a0%e0%b8%b2%e0%b8%9e%e0%b8%ab%e0%b8%8d%e0%b8%b4%e0%b8%87",drug:"%e0%b8%a2%e0%b8%b2%e0%b9%81%e0%b8%a5%e0%b8%b0%e0%b8%ad%e0%b8%b2%e0%b8%ab%e0%b8%b2%e0%b8%a3%e0%b9%80%e0%b8%aa%e0%b8%a3%e0%b8%b4%e0%b8%a1",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Myanmar]:{pregnancy:"pregnancy",parenting:"parenting",health:"health",diabetes:"diabetes",womensHealth:"womens-health",drug:"drugs-az",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.Taiwan]:{pregnancy:"pregnancy",parenting:"parenting",health:"health",diabetes:"diabetes",womensHealth:"womens-health",drug:"drugs-supplement",sexualWellness:"",healthyEating:"",skinHealth:""},[a.LOCALE.India]:{pregnancy:"pregnancy",parenting:"parenting",health:"health",diabetes:"diabetes",womensHealth:"womens-health",diabetesEn:"en-diabetes",drug:"dawaai",sexualWellness:"",healthyEating:"",skinHealth:""}};exports.MAPPED_CATEGORY_SLUGS=b,exports.PREGNANCY_SLUG=t,exports.useCategory=a=>{const{locale:s}=n.useTranslations();return{isPregnancy:e.useMemo((()=>decodeURI(a.replace(/\//gi,"")).includes(t[s])),[]),isParenting:e.useMemo((()=>{var e;return decodeURI(a.replace(/\//gi,"")).includes(null===(e=b[s])||void 0===e?void 0:e.parenting)}),[]),type:e.useMemo((()=>function(e,a){const n=e.split("/");for(const e in a){const t=a[e];if(n.includes(t))return e}return null}(a,b[s])),[a,s])}};
@@ -1 +1 @@
1
- "use strict";var e=require("./tslib.es6-5976a9fa.js"),t=require("react"),a=require("./getDynamicHealthTool-ab63ba31.js");exports.useHealthToolsCache=o=>{const[i,l]=t.useState([]);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){const e=yield a.getDynamicHealthToolWithCache(o);l(e)}))}),[a.getDynamicHealthToolWithCache,o]);const r=t.useCallback((e=>{var t;return(null===(t=i.find((t=>t.template===e)))||void 0===t?void 0:t.link)||""}),[i]);return{allTools:i,getHealthToolLink:r}};
1
+ "use strict";var e=require("./tslib.es6-bb49a3d1.js"),t=require("react"),a=require("./getDynamicHealthTool-c3ec7203.js");exports.useHealthToolsCache=o=>{const[i,l]=t.useState([]);t.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){const e=yield a.getDynamicHealthToolWithCache(o);l(e)}))}),[a.getDynamicHealthToolWithCache,o]);const c=t.useCallback((e=>{var t;return(null===(t=i.find((t=>t.template===e)))||void 0===t?void 0:t.link)||""}),[i]);return{allTools:i,getHealthToolLink:c}};
@@ -1 +1 @@
1
- "use strict";var e=require("./tslib.es6-5976a9fa.js"),t=require("react"),r=require("./cookieHelper-daa7dc3f.js"),n=require("./useUniqueId-bf049d59.js");function i(e){const t=(new TextEncoder).encode(e.trim().toLowerCase());return crypto.subtle.digest("SHA-256",t).then((e=>Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join("")))}exports.useFbDataLayer=n=>{const a=t.useRef("");t.useEffect((()=>(e.__awaiter(void 0,void 0,void 0,(function*(){var e,t,o,u,l;if(!a.current){let e=yield fetch("https://api.ipify.org").then((e=>e.text()));e||(e=yield fetch("https://icanhazip.com").then((e=>e.text()))),a.current=e}if(null===(t=null===(e=window.localStorage)||void 0===e?void 0:e.setItem)||void 0===t||t.call(e,"fbClientIp",JSON.stringify({client_ip_address:(null===(o=a.current)||void 0===o?void 0:o.replace("\n",""))||"",client_user_agent:navigator.userAgent||""})),null==n?void 0:n.id){const[e,t,a,o,c,s]=yield Promise.all([n.email?i(n.email):null,n.phone?i(n.phone):null,n.birthday?i(n.birthday.split("-").join("")):null,n.gender?"m":"f",n.city_name?i(n.city_name).then((e=>e.replace(/\s/g,""))):null,n.name?i(n.name):null]);r.getCookie("_fbc"),r.getCookie("_fbp");const d={user_id:n.id};s&&(d.fn=s),e&&(d.em=e),t&&(d.ph=t),a&&(d.db=a),c&&(d.ct=c),null===(l=null===(u=window.localStorage)||void 0===u?void 0:u.setItem)||void 0===l||l.call(u,"fbDataLayer_userInfo",JSON.stringify(d))}})),()=>{})),[n])},exports.usePrevious=e=>{const r=t.useRef(),i=t.useRef(e);return n.useInitialMount()||i.current===e||(r.current=i.current,i.current=e),r.current},exports.useRafState=e=>{const[r,n]=t.useState(e),i=t.useRef(0),a=t.useCallback((e=>{cancelAnimationFrame(i.current),i.current=requestAnimationFrame((()=>{n(e)}))}),[]);return t.useEffect((()=>()=>cancelAnimationFrame(i.current))),[r,a]};
1
+ "use strict";var e=require("./tslib.es6-bb49a3d1.js"),t=require("react"),r=require("./cookieHelper-930da89d.js"),n=require("./useUniqueId-d8647562.js");function i(e){const t=(new TextEncoder).encode(e.trim().toLowerCase());return crypto.subtle.digest("SHA-256",t).then((e=>Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join("")))}exports.useFbDataLayer=n=>{const a=t.useRef("");t.useEffect((()=>(e.__awaiter(void 0,void 0,void 0,(function*(){var e,t,o,u,l;if(!a.current){let e=yield fetch("https://api.ipify.org").then((e=>e.text()));e||(e=yield fetch("https://icanhazip.com").then((e=>e.text()))),a.current=e}if(null===(t=null===(e=window.localStorage)||void 0===e?void 0:e.setItem)||void 0===t||t.call(e,"fbClientIp",JSON.stringify({client_ip_address:(null===(o=a.current)||void 0===o?void 0:o.replace("\n",""))||"",client_user_agent:navigator.userAgent||""})),null==n?void 0:n.id){const[e,t,a,o,s,c]=yield Promise.all([n.email?i(n.email):null,n.phone?i(n.phone):null,n.birthday?i(n.birthday.split("-").join("")):null,n.gender?"m":"f",n.city_name?i(n.city_name).then((e=>e.replace(/\s/g,""))):null,n.name?i(n.name):null]);r.getCookie("_fbc"),r.getCookie("_fbp");const d={user_id:n.id};c&&(d.fn=c),e&&(d.em=e),t&&(d.ph=t),a&&(d.db=a),s&&(d.ct=s),null===(l=null===(u=window.localStorage)||void 0===u?void 0:u.setItem)||void 0===l||l.call(u,"fbDataLayer_userInfo",JSON.stringify(d))}})),()=>{})),[n])},exports.usePrevious=e=>{const r=t.useRef(),i=t.useRef(e);return n.useInitialMount()||i.current===e||(r.current=i.current,i.current=e),r.current},exports.useRafState=e=>{const[r,n]=t.useState(e),i=t.useRef(0),a=t.useCallback((e=>{cancelAnimationFrame(i.current),i.current=requestAnimationFrame((()=>{n(e)}))}),[]);return t.useEffect((()=>()=>cancelAnimationFrame(i.current))),[r,a]};
@@ -1 +1 @@
1
- "use strict";var e=require("react"),t=require("./translationsContext-627c9071.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=a(require("string-format"));exports.useTranslations=function(){const{values:a,locale:o}=e.useContext(t.TranslationsContext)||{locale:"en-PH"};return e.useMemo((()=>({t:(e,t)=>a?a[e]?t?n.default(a[e]||e,t):a[e]||e:(console.warn(`[useTranslations] Missing translation for key ${e} and locale ${o}`),t?n.default(e,t):e):(console.error("[useTranslations] t method called before translation values are loaded"),e),locale:o})),[a,o])};
1
+ "use strict";var e=require("react"),t=require("./translationsContext-bded011e.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=a(require("string-format"));exports.useTranslations=function(){const{values:a,locale:o}=e.useContext(t.TranslationsContext)||{locale:"en-PH"};return e.useMemo((()=>({t:(e,t)=>a?a[e]?t?n.default(a[e]||e,t):a[e]||e:(console.warn(`[useTranslations] Missing translation for key ${e} and locale ${o}`),t?n.default(e,t):e):(console.error("[useTranslations] t method called before translation values are loaded"),e),locale:o})),[a,o])};
@@ -0,0 +1 @@
1
+ "use strict";var i=require("./Onboarding-e89cd92f.js");const a={[i.LOCALE.Vietnam]:"VN",[i.LOCALE.Cambodia]:"KH",[i.LOCALE.Indonesia]:"ID",[i.LOCALE.Malaysia]:"MY",[i.LOCALE.PhilippinesEnglish]:"PH",[i.LOCALE.PhilippinesTagalog]:"PH",[i.LOCALE.Taiwan]:"TW",[i.LOCALE.Thailand]:"TH",[i.LOCALE.Myanmar]:"MM"};exports.MAPPED_LOCALE=a,exports.hiddenEmailChar=(i="")=>{const a=i.indexOf("@"),e=i.substring(0,a),n=e.length>3?3:e.length;return i.replace(i.substring(n,a),i.slice(n,a).replace(/./g,"x"))};
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./tslib.es6-5976a9fa.js"),t=require("react"),a=require("@mantine/core"),l=require("./index.styles-7e6f1ade.js");require("@mantine/dates"),require("./index-0abc96e8.js");var n=require("./Onboarding-d141cba2.js");require("./gAssets.js");var r=require("dayjs"),i=require("./screenSizeContext-021f82c6.js"),o=require("styled-components"),c=require("./theme-dc87077d.js");require("./isProduction-ed26692e.js");var s=require("./useTranslations-1317bce3.js");require("./index-464d865b.js");var d=require("@mantine/hooks");require("lodash/debounce"),require("./useCategory-c9c00b56.js");var u=require("./index-6680fbcd.js");require("./translationsContext-627c9071.js"),require("string-format");var m=require("./index-c5b36de4.js"),f=require("./index-5fc5cad2.js"),C=require("@mantine/form"),p=require("dayjs/plugin/customParseFormat"),g=require("./index-d70cdd28.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("./index-bc368d6c.js"),require("react-keyed-flatten-children"),require("@mantine/carousel"),require("./useUniqueId-bf049d59.js"),require("./cookieHelper-daa7dc3f.js"),require("slugify"),require("date-fns/locale"),require("lodash/throttle");var b=h(t),E=h(r),x=h(o),v=h(p);const y=x.default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./tslib.es6-bb49a3d1.js"),t=require("react"),a=require("@mantine/core"),l=require("./index.styles-e11660ee.js");require("@mantine/dates"),require("./index-cd875ad3.js");var n=require("./Onboarding-e89cd92f.js");require("./gAssets.js");var r=require("dayjs"),i=require("./screenSizeContext-33e6c658.js"),o=require("styled-components"),c=require("./theme-dd5f10d8.js");require("./isProduction-a9c34dc0.js");var s=require("./useTranslations-10d0cd79.js");require("./index-f8959db6.js");var d=require("@mantine/hooks");require("lodash/debounce"),require("./useCategory-642c5d6e.js");var u=require("./index-c48e2136.js");require("./translationsContext-bded011e.js"),require("string-format");var m=require("./index-b90a3e0d.js"),f=require("./index-126c526c.js"),C=require("@mantine/form"),p=require("dayjs/plugin/customParseFormat"),g=require("./index-146c0662.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("./index-9faf9072.js"),require("react-keyed-flatten-children"),require("@mantine/carousel"),require("./useUniqueId-d8647562.js"),require("./cookieHelper-930da89d.js"),require("slugify"),require("date-fns/locale"),require("lodash/throttle");var b=h(t),E=h(r),x=h(o),v=h(p);const y=x.default.div`
2
2
  position: relative;
3
3
  padding: 16px;
4
4
  min-height: 110px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hhgtech/hhg-components",
3
- "version": "1.27.123",
3
+ "version": "1.27.124",
4
4
  "main": "build/index.js",
5
5
  "module": "build/esm/index.js",
6
6
  "files": [