@hhgtech/hhg-components 1.26.77 → 1.26.78
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.
- package/build/babyGrowth.js +2 -2
- package/build/cache.js +1 -1
- package/build/care.js +1 -1
- package/build/components/mantine/tabs/index.d.ts +2 -3
- package/build/components.js +1 -1
- package/build/constants.js +1 -1
- package/build/{core-76852e1e.js → core-6c13ac93.js} +1 -1
- package/build/{dataTransform-1a0c47c9.js → dataTransform-9b96697d.js} +1 -1
- package/build/ecom.js +1 -1
- package/build/esm/babyGrowth.js +7 -7
- package/build/esm/cache.js +1 -1
- package/build/esm/care.js +1 -1
- package/build/esm/components.js +1 -1
- package/build/esm/constants.js +1 -1
- package/build/esm/{core-bf29c4da.js → core-5d5bef88.js} +1 -1
- package/build/esm/{dataTransform-abc1b8c5.js → dataTransform-72f03a9b.js} +1 -1
- package/build/esm/ecom.js +1 -1
- package/build/esm/{fixedBottomAdBlock-5abdaf41.js → fixedBottomAdBlock-6ccd3f76.js} +1 -1
- package/build/esm/footer.js +1 -1
- package/build/esm/gAssets.js +1 -1
- package/build/esm/{getDynamicHealthTool-c7b85613.js → getDynamicHealthTool-10789dfb.js} +1 -1
- package/build/esm/{getSocialList-dca20053.js → getSocialList-8b019a64.js} +1 -1
- package/build/esm/hooks.js +1 -1
- package/build/esm/i18n.js +1 -1
- package/build/esm/{index-00515101.js → index-028ceeb9.js} +1 -1
- package/build/esm/{index-dda70478.js → index-07fc0c05.js} +2 -2
- package/build/esm/{index-036ee565.js → index-0a1c242a.js} +1 -1
- package/build/esm/{index-11f88ca8.js → index-1b93ef0f.js} +1 -1
- package/build/esm/{index-c41699a9.js → index-2215d68f.js} +1 -1
- package/build/esm/{index-20fe866b.js → index-2f44c069.js} +1 -1
- package/build/esm/{index-80bef2f8.js → index-308babef.js} +1 -1
- package/build/esm/{index-d2713624.js → index-31064c30.js} +1 -1
- package/build/esm/{index-c40fffcb.js → index-529f30e2.js} +1 -1
- package/build/esm/index-5694f07e.js +1 -0
- package/build/esm/{index-d7c48dc7.js → index-58dc48d8.js} +1 -1
- package/build/esm/index-63c4ba6b.js +1 -0
- package/build/esm/{index-da7cf04c.js → index-970a7eb0.js} +1 -1
- package/build/esm/{index-0da3bb05.js → index-97c5e5aa.js} +1 -1
- package/build/esm/index-b80c910c.js +1 -0
- package/build/esm/{index-075526fc.js → index-bdcf02d1.js} +1 -1
- package/build/esm/{index-cd8b6c99.js → index-be00d0db.js} +1 -1
- package/build/esm/{index-28a8939a.js → index-c9acebcd.js} +1 -1
- package/build/esm/{index-0f09ecd8.js → index-cd979eef.js} +1 -1
- package/build/esm/{index-a60485e0.js → index-d0e50440.js} +1 -1
- package/build/esm/{index-eafed0fb.js → index-e6868891.js} +1 -1
- package/build/esm/{index-20fb7b58.js → index-fcecaa7d.js} +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/{index.styled-40c23a45.js → index.styled-66f20e0f.js} +1 -1
- package/build/esm/{index.styled-ecd8593a.js → index.styled-a53c6d25.js} +1 -1
- package/build/esm/{index.styled-af234633.js → index.styled-a5772fa0.js} +6 -6
- package/build/esm/lead.js +1 -1
- package/build/esm/mantine.js +1 -1
- package/build/esm/misc.js +1 -1
- package/build/esm/navigation.js +1 -1
- package/build/esm/onboarding.js +1 -1
- package/build/esm/pwg.js +2 -2
- package/build/esm/{routing-807653a4.js → routing-474f0395.js} +1 -1
- package/build/esm/{screenSizeContext-6f9575de.js → screenSizeContext-7df25130.js} +4 -4
- package/build/esm/together.js +1 -1
- package/build/esm/translationsContext-e1b113ab.js +1 -0
- package/build/esm/translationsProvider-04bd7539.js +1 -0
- package/build/esm/{types-01e0a9e9.js → types-05296a9e.js} +1 -1
- package/build/esm/{types-829974a9.js → types-b8ccf4e7.js} +143 -144
- package/build/esm/types.js +1 -1
- package/build/esm/{useHealthToolCache-182bb1c9.js → useHealthToolCache-3a427f7d.js} +1 -1
- package/build/esm/{useRafState-2ab13cc8.js → useRafState-37aeb55b.js} +1 -1
- package/build/esm/{useTranslations-b0fc04a0.js → useTranslations-c82ca698.js} +1 -1
- package/build/esm/{utils-e1220184.js → utils-874b4b93.js} +4 -4
- package/build/esm/vaccination.js +4 -4
- package/build/{fixedBottomAdBlock-21f21ce6.js → fixedBottomAdBlock-d8549495.js} +1 -1
- package/build/footer.js +1 -1
- package/build/gAssets.js +1 -1
- package/build/getDynamicHealthTool-3aa224ba.js +1 -0
- package/build/{getSocialList-5d5f08ca.js → getSocialList-1d904833.js} +1 -1
- package/build/hooks.js +1 -1
- package/build/i18n.js +1 -1
- package/build/{index-5ca678e5.js → index-0cf7da16.js} +1 -1
- package/build/{index-df26fa49.js → index-1e0d1ad4.js} +1 -1
- package/build/{index-a2815cc3.js → index-24359f62.js} +1 -1
- package/build/{index-6d7720a1.js → index-37553ebc.js} +2 -2
- package/build/index-5898712c.js +1 -0
- package/build/{index-9f522d94.js → index-6454232b.js} +1 -1
- package/build/{index-571245c9.js → index-658a7d60.js} +1 -1
- package/build/{index-9c464e45.js → index-6fb09a3b.js} +1 -1
- package/build/{index-6e0f097c.js → index-70d48bae.js} +1 -1
- package/build/{index-55df9387.js → index-729eb71c.js} +1 -1
- package/build/{index-02905eb6.js → index-8813d7b5.js} +1 -1
- package/build/{index-fb502017.js → index-8c8de50a.js} +1 -1
- package/build/{index-1fdd13cf.js → index-97db8edf.js} +1 -1
- package/build/{index-55fef0a5.js → index-a4632eac.js} +1 -1
- package/build/{index-fab5f98a.js → index-b89a15a7.js} +1 -1
- package/build/{index-79ded7b0.js → index-bff3b40e.js} +1 -1
- package/build/{index-5b811ac9.js → index-c890c32d.js} +1 -1
- package/build/{index-e0243d99.js → index-cdcbac00.js} +1 -1
- package/build/{index-2c296740.js → index-de30c0be.js} +1 -1
- package/build/{index-13fb5c20.js → index-e03a10e8.js} +1 -1
- package/build/{index-ff3cca2c.js → index-f66673c8.js} +1 -1
- package/build/{index-99d358b0.js → index-fae30c25.js} +1 -1
- package/build/index.js +1 -1
- package/build/{index.styled-85d4db5b.js → index.styled-25a704cb.js} +3 -3
- package/build/{index.styled-35faf4d5.js → index.styled-53f32922.js} +1 -1
- package/build/{index.styled-9b8171a4.js → index.styled-f8ab0097.js} +1 -1
- package/build/lead.js +1 -1
- package/build/mantine.js +1 -1
- package/build/misc.js +1 -1
- package/build/navigation.js +1 -1
- package/build/onboarding.js +1 -1
- package/build/pwg.js +1 -1
- package/build/{routing-45b9d791.js → routing-7f23b855.js} +1 -1
- package/build/screenSizeContext-11883242.js +81 -0
- package/build/together.js +1 -1
- package/build/translationsContext-bd368228.js +1 -0
- package/build/translationsProvider-d1cd788a.js +1 -0
- package/build/{types-124735be.js → types-359f96fe.js} +143 -144
- package/build/{types-44319b37.js → types-cffa84b7.js} +1 -1
- package/build/types.js +1 -1
- package/build/{useHealthToolCache-3eeae9c2.js → useHealthToolCache-e82d64d7.js} +1 -1
- package/build/{useRafState-4724b69b.js → useRafState-6fe3213c.js} +1 -1
- package/build/useTranslations-e0bc8660.js +1 -0
- package/build/{utils-9b56ecde.js → utils-22d1381d.js} +1 -1
- package/build/vaccination.js +1 -1
- package/package.json +1 -1
- package/build/esm/index-4763cb0e.js +0 -1
- package/build/esm/index-53ff3fc7.js +0 -1
- package/build/esm/index-c742a8b0.js +0 -1
- package/build/esm/translationsContext-5d6ae5bc.js +0 -1
- package/build/esm/translationsProvider-27bf4e3e.js +0 -1
- package/build/getDynamicHealthTool-b9b7da0b.js +0 -1
- package/build/index-1df4f5cf.js +0 -1
- package/build/screenSizeContext-0b1c2c7e.js +0 -81
- package/build/translationsContext-ba06fd90.js +0 -1
- package/build/translationsProvider-f11b8982.js +0 -1
- package/build/useTranslations-ecb51065.js +0 -1
- /package/build/{BMI_BOYS.percentile.monthly-a61f121c.js → BMI_BOYS.percentile.monthly-30807afc.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-5d8c445b.js → BMI_BOYS.percentile.weekly-e22d587f.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-0c08a881.js → BMI_BOYS.percentile.yearly-ac6705a0.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-dad37273.js → BMI_BOYS.zscore.monthly-891bd101.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-89cf0aec.js → BMI_BOYS.zscore.weekly-d185f10d.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-654f1485.js → BMI_BOYS.zscore.yearly-f5e46b5e.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-80a868d4.js → BMI_GIRLS.percentile.monthly-9d2ef588.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-e94fa568.js → BMI_GIRLS.percentile.weekly-30d18404.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-1fb75a94.js → BMI_GIRLS.percentile.yearly-e403996a.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-04ee6a3c.js → BMI_GIRLS.zscore.monthly-7ed8c6ce.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-978b14be.js → BMI_GIRLS.zscore.weekly-2bad10c5.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-c46c7baa.js → BMI_GIRLS.zscore.yearly-cc7eab3f.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-a46f8c0a.js → HEAD CIRCUM_BOYS.percentile.monthly-ab77805c.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-aa05788d.js → HEAD CIRCUM_BOYS.percentile.weekly-0b380513.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-69d97954.js → HEAD CIRCUM_BOYS.percentile.yearly-f99b0c9d.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-0aaf7389.js → HEAD CIRCUM_BOYS.zscore.monthly-0eb4b812.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-89a9b256.js → HEAD CIRCUM_BOYS.zscore.weekly-80273228.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-0cc5d999.js → HEAD CIRCUM_BOYS.zscore.yearly-177da9e8.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-b4871e45.js → HEAD CIRCUM_GIRLS.percentile.monthly-b305ed19.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-d4066b62.js → HEAD CIRCUM_GIRLS.percentile.weekly-a79d6af9.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-6431d42b.js → HEAD CIRCUM_GIRLS.percentile.yearly-5ef6fa1b.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-0972b624.js → HEAD CIRCUM_GIRLS.zscore.monthly-2de43e02.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-fe1a7e9a.js → HEAD CIRCUM_GIRLS.zscore.weekly-17b22fcd.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-208cbb1d.js → HEAD CIRCUM_GIRLS.zscore.yearly-fdff18b7.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-a2f63b53.js → HEIGHT_BOYS.percentile.monthly-b975f6b5.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-efb9b4da.js → HEIGHT_BOYS.percentile.weekly-36234aff.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-2ed3ba54.js → HEIGHT_BOYS.percentile.yearly-a236c22d.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-7ace0852.js → HEIGHT_BOYS.zscore.monthly-91b4baba.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-92ef6fab.js → HEIGHT_BOYS.zscore.weekly-c1234307.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-3244c378.js → HEIGHT_BOYS.zscore.yearly-19b23773.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-db231252.js → HEIGHT_GIRLS.percentile.monthly-d605452e.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-2adfd96c.js → HEIGHT_GIRLS.percentile.weekly-c258c049.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-85b12383.js → HEIGHT_GIRLS.percentile.yearly-c85d9800.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-1ab59517.js → HEIGHT_GIRLS.zscore.monthly-5dc7354f.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-6e0192bb.js → HEIGHT_GIRLS.zscore.weekly-599c3c5d.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-f07a1164.js → HEIGHT_GIRLS.zscore.yearly-8e052666.js} +0 -0
- /package/build/{Onboarding-ef0026fc.js → Onboarding-a7f1c726.js} +0 -0
- /package/build/{Visible-cba1bb48.js → Visible-8a98d149.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-72fb080e.js → WEIGHT_BOYS.percentile.monthly-1bef9894.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-d10e60eb.js → WEIGHT_BOYS.percentile.weekly-9064d021.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-1c7b8b54.js → WEIGHT_BOYS.percentile.yearly-b011e1ae.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-97d07eab.js → WEIGHT_BOYS.zscore.monthly-4c42fe9f.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-173279e1.js → WEIGHT_BOYS.zscore.weekly-aecf2697.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-0d005c27.js → WEIGHT_BOYS.zscore.yearly-b3afd823.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-5a042795.js → WEIGHT_GIRLS.percentile.monthly-b9605bcd.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-45431a77.js → WEIGHT_GIRLS.percentile.weekly-1e9ed516.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-63cdeb83.js → WEIGHT_GIRLS.percentile.yearly-0f8211a3.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-60c26703.js → WEIGHT_GIRLS.zscore.monthly-6fe64a2e.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-8196ec45.js → WEIGHT_GIRLS.zscore.weekly-b399025f.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-93eaad1b.js → WEIGHT_GIRLS.zscore.yearly-2c3e6f4f.js} +0 -0
- /package/build/{constants-0148ba3e.js → constants-3fe9d63e.js} +0 -0
- /package/build/{cookieHelper-dac88eba.js → cookieHelper-19ea025c.js} +0 -0
- /package/build/{dataTransform-86bd33e2.js → dataTransform-4295b66e.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-658bf3e9.js → BMI_BOYS.percentile.monthly-9e8b5e7b.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-a4eaf785.js → BMI_BOYS.percentile.weekly-71e6c8af.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-2ff5da73.js → BMI_BOYS.percentile.yearly-a47654bf.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-d05c2792.js → BMI_BOYS.zscore.monthly-5a25ad0e.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-f8ae621f.js → BMI_BOYS.zscore.weekly-677c38cb.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-9477e7e0.js → BMI_BOYS.zscore.yearly-21a9cfcf.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-875bb68a.js → BMI_GIRLS.percentile.monthly-7609f9fe.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-e5a3472e.js → BMI_GIRLS.percentile.weekly-8cf21aa5.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-6f745e55.js → BMI_GIRLS.percentile.yearly-6380efec.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-acd17d93.js → BMI_GIRLS.zscore.monthly-793229b9.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-d9d5c748.js → BMI_GIRLS.zscore.weekly-53ddb3ba.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-03e3edb0.js → BMI_GIRLS.zscore.yearly-5a7ed20f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-f42c2164.js → HEAD CIRCUM_BOYS.percentile.monthly-4c2dab5c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-59a4d782.js → HEAD CIRCUM_BOYS.percentile.weekly-34ee115e.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-c9deaf61.js → HEAD CIRCUM_BOYS.percentile.yearly-bcd6bb9d.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-39a7bf24.js → HEAD CIRCUM_BOYS.zscore.monthly-6dfb40df.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-40d20662.js → HEAD CIRCUM_BOYS.zscore.weekly-d4469b2a.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-5b4708bd.js → HEAD CIRCUM_BOYS.zscore.yearly-63470d35.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-eb05242b.js → HEAD CIRCUM_GIRLS.percentile.monthly-c5831ab1.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-ffddec12.js → HEAD CIRCUM_GIRLS.percentile.weekly-9cb54ddd.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-b4bfe0f0.js → HEAD CIRCUM_GIRLS.percentile.yearly-03ea570d.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-d14c698a.js → HEAD CIRCUM_GIRLS.zscore.monthly-d5547f72.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-1cd18628.js → HEAD CIRCUM_GIRLS.zscore.weekly-acd5a834.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-760193ee.js → HEAD CIRCUM_GIRLS.zscore.yearly-ccd8f2c9.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-d4fe2e84.js → HEIGHT_BOYS.percentile.monthly-92cce238.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-d2293971.js → HEIGHT_BOYS.percentile.weekly-b63e88d3.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-b1ab8c74.js → HEIGHT_BOYS.percentile.yearly-f02a23cb.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-932d6b93.js → HEIGHT_BOYS.zscore.monthly-816997fa.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-d84d7386.js → HEIGHT_BOYS.zscore.weekly-2942d911.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-ecebea4d.js → HEIGHT_BOYS.zscore.yearly-4c4ddd7c.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-c3fa9f5c.js → HEIGHT_GIRLS.percentile.monthly-8455a93d.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-341cd946.js → HEIGHT_GIRLS.percentile.weekly-e6e8511f.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-f17be139.js → HEIGHT_GIRLS.percentile.yearly-b855d440.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-4786bd0b.js → HEIGHT_GIRLS.zscore.monthly-931e6843.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-c4af111f.js → HEIGHT_GIRLS.zscore.weekly-2ed8138e.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-e0660fed.js → HEIGHT_GIRLS.zscore.yearly-4b7f5532.js} +0 -0
- /package/build/esm/{Onboarding-c78a082b.js → Onboarding-0d390a7e.js} +0 -0
- /package/build/esm/{Visible-c8c46797.js → Visible-51c104d4.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-6918e22c.js → WEIGHT_BOYS.percentile.monthly-a213dee1.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-e49b4839.js → WEIGHT_BOYS.percentile.weekly-5bf0d4cf.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-6fc24cf8.js → WEIGHT_BOYS.percentile.yearly-6f21b73b.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-32c31366.js → WEIGHT_BOYS.zscore.monthly-b06729e0.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-d9bc0e4f.js → WEIGHT_BOYS.zscore.weekly-7ce70e39.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-60944d85.js → WEIGHT_BOYS.zscore.yearly-78cb02f9.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-29525f78.js → WEIGHT_GIRLS.percentile.monthly-a25ab68a.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-e181b7d4.js → WEIGHT_GIRLS.percentile.weekly-6dbd8348.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-0a0ebfab.js → WEIGHT_GIRLS.percentile.yearly-ea547573.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-a5013667.js → WEIGHT_GIRLS.zscore.monthly-3d2dac19.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-52c7ca98.js → WEIGHT_GIRLS.zscore.weekly-196a5acb.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-02976188.js → WEIGHT_GIRLS.zscore.yearly-b57f695e.js} +0 -0
- /package/build/esm/{constants-e0e1f3af.js → constants-bbf9ff1e.js} +0 -0
- /package/build/esm/{cookieHelper-645ee730.js → cookieHelper-64b2d633.js} +0 -0
- /package/build/esm/{dataTransform-2ca319f7.js → dataTransform-a77e6a93.js} +0 -0
- /package/build/esm/{index-4bd03a58.js → index-85608020.js} +0 -0
- /package/build/esm/{isProduction-0cff20bf.js → isProduction-a5a1f5b5.js} +0 -0
- /package/build/esm/{localizeNumberFormat-7c1579eb.js → localizeNumberFormat-49b847fd.js} +0 -0
- /package/build/esm/{normalizeLink-f684d390.js → normalizeLink-bab96905.js} +0 -0
- /package/build/esm/{theme-7af6d141.js → theme-5634f75c.js} +0 -0
- /package/build/esm/{tslib.es6-16065c04.js → tslib.es6-24360486.js} +0 -0
- /package/build/esm/{types-e397b730.js → types-57b4bf53.js} +0 -0
- /package/build/esm/{useIsInit-f5de1828.js → useIsInit-13acffb5.js} +0 -0
- /package/build/esm/{useOutsideClick-bff348b1.js → useOutsideClick-74ec4ceb.js} +0 -0
- /package/build/esm/{useScrollbarSize-03addf5b.js → useScrollbarSize-22cb7784.js} +0 -0
- /package/build/esm/{useUniqueId-3af3be5d.js → useUniqueId-9207f143.js} +0 -0
- /package/build/esm/{utils-9f6dcc74.js → utils-265e7646.js} +0 -0
- /package/build/{index-85e0eb9d.js → index-ca3a35f1.js} +0 -0
- /package/build/{isProduction-d1798c89.js → isProduction-739eb23f.js} +0 -0
- /package/build/{localizeNumberFormat-35208be0.js → localizeNumberFormat-04564045.js} +0 -0
- /package/build/{normalizeLink-9a84e2d6.js → normalizeLink-bedc93a3.js} +0 -0
- /package/build/{theme-46214f6c.js → theme-ce33ba3c.js} +0 -0
- /package/build/{tslib.es6-a12e0ed5.js → tslib.es6-28c50672.js} +0 -0
- /package/build/{types-aabcdab9.js → types-f490d6fd.js} +0 -0
- /package/build/{useIsInit-79a5b5d5.js → useIsInit-af399917.js} +0 -0
- /package/build/{useOutsideClick-521195fb.js → useOutsideClick-85f388f7.js} +0 -0
- /package/build/{useScrollbarSize-03e379c5.js → useScrollbarSize-3914fcd8.js} +0 -0
- /package/build/{useUniqueId-a1f484a1.js → useUniqueId-4eda1b9c.js} +0 -0
- /package/build/{utils-e4120b96.js → utils-8757f7c9.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,_ as t}from"./tslib.es6-
|
|
1
|
+
import{a as e,_ as t}from"./tslib.es6-24360486.js";import*as a from"react";import o,{createContext as n,useContext as i,useState as l,useRef as r,useEffect as s,useMemo as c,useCallback as d}from"react";import{useMantineTheme as m,createStyles as p,Flex as u,Checkbox as g,Portal as h,Anchor as v,Accordion as b,Popover as f}from"@mantine/core";import{a as y}from"./index-d0e50440.js";import{u as w}from"./useTranslations-c82ca698.js";import x from"innertext";import{t as E}from"./theme-5634f75c.js";import{H as C,a4 as k,I as N,J as A,a5 as L,a6 as T,a7 as P,a8 as I,K as S,a9 as M,Y as z,aa as j,ab as F,ac as B,ad as O,ae as R}from"./index-07fc0c05.js";import{CommonGAssets as V}from"./gAssets.js";import"@mantine/dates";import{D,d as U}from"./index-c9acebcd.js";import"./Onboarding-0d390a7e.js";import W from"dayjs";import"./screenSizeContext-7df25130.js";import Z,{keyframes as H,css as q}from"styled-components";import{M as _,t as G,c as Q,a as K}from"./utils-265e7646.js";import"./isProduction-a5a1f5b5.js";import"./index-1b93ef0f.js";import"@mantine/hooks";import{T as X,au as $,av as Y,aw as J,ax as ee,ay as te,az as ae,aA as oe,U as ne,aB as ie,aC as le,aD as re,aE as se,aF as ce,aG as de,aH as me,aI as pe,aJ as ue,aK as ge,aL as he,aM as ve,aN as be,aO as fe,aP as ye}from"./index.styled-66f20e0f.js";import{I as we,A as xe,B as Ee,D as Ce}from"./index-b80c910c.js";import{e as ke,c as Ne,P as Ae,g as Le,b as Te,h as Pe,i as Ie}from"./dataTransform-72f03a9b.js";import{T as Se}from"./index-028ceeb9.js";import{I as Me}from"./index-be00d0db.js";import ze from"lodash/debounce";import je from"react-contenteditable";import{B as Fe}from"./index-97c5e5aa.js";import{d as Be,g as Oe}from"./cookieHelper-64b2d633.js";import*as Re from"react-dom";import"./index-58dc48d8.js";import"./index-529f30e2.js";import"./index.styled-a53c6d25.js";import{format as Ve}from"date-fns";import"react-day-picker/DayPickerInput";import"./index-31064c30.js";import"lodash/throttle";import"keen-slider/react";import"./types-57b4bf53.js";import"react-hook-form";import"date-fns/locale/en-US";import"date-fns/locale/id";import"date-fns/locale/vi";import"date-fns/locale/zh-TW";import"./index.styled-a5772fa0.js";import"uuid";import"string-format";import De from"dayjs/plugin/relativeTime";import{M as Ue}from"./index-970a7eb0.js";import{a as We}from"./useUniqueId-9207f143.js";import"./translationsContext-e1b113ab.js";import{g as Ze}from"./routing-474f0395.js";const He=e=>a.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},e),a.createElement("path",{d:"M3.99403 3.32695C3.86141 3.32698 3.73181 3.36657 3.62181 3.44065C3.5118 3.51472 3.42638 3.61992 3.37648 3.7428C3.32658 3.86567 3.31445 4.00064 3.34165 4.13044C3.36885 4.26024 3.43415 4.37898 3.52919 4.47148L7.05784 8.00013L3.52919 11.5288C3.46521 11.5902 3.41413 11.6638 3.37894 11.7452C3.34375 11.8266 3.32516 11.9142 3.32425 12.0029C3.32335 12.0916 3.34015 12.1796 3.37368 12.2617C3.40721 12.3438 3.45678 12.4185 3.5195 12.4812C3.58222 12.5439 3.65682 12.5935 3.73894 12.627C3.82106 12.6605 3.90904 12.6773 3.99774 12.6764C4.08643 12.6755 4.17405 12.6569 4.25547 12.6217C4.33689 12.5865 4.41047 12.5355 4.4719 12.4715L8.00054 8.94283L11.5292 12.4715C11.5906 12.5355 11.6642 12.5865 11.7456 12.6217C11.827 12.6569 11.9147 12.6755 12.0034 12.6764C12.092 12.6773 12.18 12.6605 12.2621 12.627C12.3443 12.5935 12.4189 12.5439 12.4816 12.4812C12.5443 12.4185 12.5939 12.3439 12.6274 12.2617C12.6609 12.1796 12.6777 12.0916 12.6768 12.0029C12.6759 11.9142 12.6573 11.8266 12.6222 11.7452C12.587 11.6638 12.5359 11.5902 12.4719 11.5288L8.94325 8.00013L12.4719 4.47148C12.5682 4.37784 12.634 4.25728 12.6607 4.1256C12.6873 3.99392 12.6735 3.85726 12.6212 3.73354C12.5688 3.60982 12.4803 3.5048 12.3672 3.43224C12.2542 3.35969 12.1218 3.32299 11.9875 3.32695C11.8143 3.33211 11.6499 3.4045 11.5292 3.52877L8.00054 7.05742L4.4719 3.52877C4.40977 3.46491 4.33548 3.41415 4.2534 3.37948C4.17132 3.34482 4.08313 3.32696 3.99403 3.32695Z"})),qe=n({}),_e=({children:e,defaultParams:t})=>o.createElement(qe.Provider,{value:{defaultParams:t}},e),Ge=e=>{const{data:{userInfo:t,env:{togetherBasePath:a}}}=i(X),{defaultParams:o}=i(qe)||{},n=null==t?void 0:t.id,l=t&&"number"==typeof t.communities_interacted&&0===t.communities_interacted;return{authActionWrapper:(t,i)=>{const r=Object.assign(Object.assign(Object.assign({},o),e),i);if(!n||l){n||Be($),(null==r?void 0:r._joinCommunityIds)&&(localStorage.setItem("to_join_community_ids",JSON.stringify(Array.from(new Set((JSON.parse(localStorage.getItem("to_join_community_ids")||"[]")||[]).concat(r._joinCommunityIds).filter(Boolean))))),null==r||delete r._joinCommunityIds),(null==r?void 0:r._joinTopicIds)&&(localStorage.setItem("to_join_topic_ids",JSON.stringify(Array.from(new Set((JSON.parse(localStorage.getItem("to_join_topic_ids")||"[]")||[]).concat(r._joinTopicIds).filter(Boolean))))),null==r||delete r._joinTopicIds);const e=(null==r?void 0:r._location)||window.location.href;return null==r||delete r._location,window.location.href=Y(e,r,a),null}return t&&t()},params:Object.assign(Object.assign({},o),e)}},Qe=Z.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
@@ -959,7 +959,141 @@ import{a as e,_ as t}from"./tslib.es6-16065c04.js";import*as a from"react";impor
|
|
|
959
959
|
width: 24px;
|
|
960
960
|
height: 24px;
|
|
961
961
|
}
|
|
962
|
-
`;const ta=({isOpen:e=!0,onClose:t,enableAnimation:a=!0,hospitalId:n,locale:i,isMobile:r,overwriteProfileProps:d,avatarFallback:m=V.getAssetPath("avatar.jpg"),trackingCategory:p="Together"})=>{const{t:u}=w(),[g,h]=l(null),[v,b]=l(!1);s((()=>{if(e&&n&&String(null==g?void 0:g.id)!==String(n)){b(!0);try{h(null),J(ie(le.GET_HOSPITAL_INFO,{hospital_branch_id:n,website_url:re[i]}),"get").then((e=>{h(Object.assign(Object.assign({},null==e?void 0:e._data.branch),d))}))}catch(e){console.error(e)}b(!1)}}),[e,n,null==g?void 0:g.id]);const f=(null==g?void 0:g.specialties)||[],y=c((()=>f.map((e=>e.name))),[f]);return o.createElement(o.Fragment,null,o.createElement($t,{"data-open":e,"data-animation":a,onClick:e=>e.stopPropagation()},v||!g?o.createElement(Xe,null):o.createElement("div",{className:"popup-content"},o.createElement("div",{className:"close-button",onClick:t},o.createElement("img",{src:Ut,style:{width:20,height:20},alt:"close-icon"})),o.createElement("div",{className:"main-info"},o.createElement("div",{className:"border-banner"}),o.createElement("div",{className:"avatar-title"},o.createElement(Jt,null,o.createElement("div",{className:"image-container"},o.createElement("div",{style:{position:"relative"}},o.createElement(we,{src:null==g?void 0:g.logo,className:"profile-image",alt:"avatar",fallbackSrc:m}),o.createElement("img",{className:"badge-avatar",src:Wt,alt:"badge"})))),o.createElement(ea,null,o.createElement(Se,{size:"s3",type:"semiBold",className:"full-name"},null==g?void 0:g.name),o.createElement("div",{className:"specialty"},f&&o.createElement(Se,{size:"p4",color:E.colors.gray800},y.join(" • "),"•"),o.createElement("a",{href:se({id:g.id,name:g.name,slug:g.slug,locale:i}),className:"organisation",target:"_blank",rel:"noreferrer"},o.createElement(Se,{size:"p4",className:"organisation",color:E.colors.gray800,style:{textDecoration:"underline"}},null==g?void 0:g.name))))),!r&&o.createElement("a",{href:se({id:g.id,name:g.name,slug:g.slug,locale:i})},o.createElement("div",{className:"btn-wrapper"},o.createElement(Fe,{color:"primary",size:"md",className:"btn-booking"},u("careBooking.bookAnAppointment"))))),o.createElement(ea,null,o.createElement("div",{className:"experience"},o.createElement(Se,{type:"bold",size:"s3",color:E.colors.gray800,style:{paddingBottom:16}},u("hospital.content.description").toUpperCase()),o.createElement(Se,{size:"p2",color:E.colors.gray500},g.about),r?o.createElement("a",{href:se({id:g.id,name:g.name,slug:g.slug,locale:i})},o.createElement("div",{className:"btn-wrapper"},o.createElement(Fe,{color:"primary",size:"md",className:"btn-booking"},u("careBooking.bookAnAppointment")))):o.createElement("a",{href:se({id:g.id,name:g.name,slug:g.slug,locale:i})},o.createElement(Se,{size:"s4",color:"#2D87F3",as:"span","data-event-category":p,"data-event-action":"See Full Hospital Profile","data-event-label":oe(i)+se({id:g.id,name:g.name,slug:g.slug,locale:i})},u("home.seeHospital"))))))),o.createElement(Yt,{"data-open":e,onClick:e=>{e.stopPropagation(),t()}}))};var aa="_2UKyiK1",oa="E5ga-tI",na="_8Y2nWXX",ia="d0T7kSP";const la=({open:e,onClose:t,children:a,profileModalProps:n})=>{const{t:i}=w();return o.createElement(Ue,Object.assign({className:aa,opened:e,onClose:t,overlayOpacity:.2,overflow:"inside",styles:{inner:{padding:0,justifyContent:"flex-end"},modal:{height:"100%",borderRadius:0},body:{padding:"24px",maxHeight:"100%"},content:{maxHeight:"100%",height:"100%",borderRadius:0}},title:"Profile"},n),o.createElement("div",{className:oa},o.createElement("div",{className:na},i("profilePanel.modal.heading")),o.createElement("div",{className:ia,onClick:t},o.createElement(He,null))),a)};var ra=p((()=>({root:{},authorBadge:{background:"yellow"}})));W.extend(De);const sa=n({}),ca=({siteType:e})=>{const{t:t}=w(),{handleMakeAppointment:a,doctorId:n,hospitalId:l,currentUrl:r}=i(sa);return o.createElement(Fe,{theme:e,color:"primary",size:"xs",onClick:e=>{null==a||a(n,l),e.stopPropagation()},dataEventCategory:"Care",dataEventAction:"Comment - Quick Booking",dataEventLabel:r,icon:o.createElement(T,{className:"buttonIcon",size:18}),iconPosition:"right",style:{whiteSpace:"nowrap"}},o.createElement("span",null,t("careBooking.bookAnAppointment")))},da=e=>{const{className:t="",community:a,name:n,username:r,url:c,avatar:d,role:m,title:p,userType:g="user",expertId:h,isMarryBaby:v,doctorId:b,hospitalId:f,hasQuickBooking:y,handleMakeAppointment:x,communityTrackingAttr:C,isAnonymous:k,showDetailPopup:N,subLine:A,authActionWrapper:T,profileProps:P,profileModalProps:I,extendEle:S,avatarProps:M,hideInfo:z,timeText:j,onCloseFromPost:F,avatarIcon:B,badgeIconSize:O,hideBackground:R,children:D,styles:W,dataEventCategory:Z,dataEventAction:H,dataEventLabel:q}=e,{data:{locale:_,router:Q,env:{isMarryBaby:K,togetherBasePath:$}}}=i(X),{t:Y}=w(),{classes:J}=ra(void 0,{name:"CardAuthor",styles:W}),ee="boolean"==typeof v?v:K,te=ee?"marryBaby":"helloSites",ae=k?Y("cardPost.anonymous"):n||r||"",oe=k?V.getAssetPath("avatar.jpg"):d,ne=k?void 0:m,[ie,le]=l(!1),{asPath:re}=Q||{},se=`https://${U[_]}${re}`,ce=()=>{if(k||"chatbot"===g)return!1;N?me(!0):c&&(window.location.href=c)};s((()=>{G(ie)}),[ie]);const[de,me]=l(!1),pe="expert"===(null==e?void 0:e.role),[ue,ge]=l(null);return s((()=>{de&&!ue&&Promise.resolve().then((function(){return Vn})).then((e=>{ge((()=>e.ProfileDetail))}))}),[de]),o.createElement(sa.Provider,{value:{handleMakeAppointment:x,doctorId:b,hospitalId:f,currentUrl:se}},o.createElement(la,{open:de,onClose:()=>me(!1),profileModalProps:I},ue&&o.createElement(ue,Object.assign({currentPageUrl:q,authorProps:{userId:null==e?void 0:e.userId,avatar:oe,name:null==e?void 0:e.name,role:null==e?void 0:e.role,title:null==e?void 0:e.title},authActionWrapper:T,onCloseFromPost:()=>{me(!1),null==F||F()}},P))),"expert"===ne&&h?o.createElement(Xt,{isOpen:ie,onClose:()=>le(!1),expertId:h}):null,"expert"===ne&&b?o.createElement(Zt,{isOpen:ie,onClose:()=>le(!1),doctorId:b,locale:_}):null,"expert"===ne&&f?o.createElement(ta,{isOpen:ie,onClose:()=>le(!1),hospitalId:f,locale:_}):null,o.createElement("div",{className:`hhg-card-author ${J.root} ${t} ${pe?"expert-author":""}`,"data-background":!R&&pe,"data-is-marrybaby":ee},o.createElement(Ft,{dataEventCategory:Z,dataEventAction:H,dataEventLabel:q,onAvatarClick:ce,avatarProps:Object.assign(Object.assign({avatar:k?V.getAssetPath(ee?"anomyous-avatar-1.svg":"anomyous-avatar.svg"):oe,username:ae},M),{style:{cursor:k||!c&&!N?"default":"pointer"}}),avatarIcon:B||pe&&o.createElement(Ct,{size:O||15})},D?o.createElement("div",{onClick:ce},D):!z&&o.createElement(Ft.Row,null,o.createElement(Ft.ColLeft,null,o.createElement(u,{align:"center",onClick:ce},o.createElement(Ft.MainText,{onClick:ce},ae,"chatbot"===g?o.createElement(o.Fragment,null," ",o.createElement(L,{color:E.colors.primaryBase,size:16,style:{display:"inline-block",transform:"translate(0, 2px)"}})):ne&&o.createElement(xe,{className:J.authorBadge,siteType:te,role:ne,title:p,style:{verticalAlign:"bottom"}}))),A||o.createElement(Ft.SubTextRow,null,(null==a?void 0:a.name)&&o.createElement(Ft.SubText,null,o.createElement("a",Object.assign({href:(null==a?void 0:a.slug)&&a.isActive&&!a.isHidden?`${$}/${null==a?void 0:a.slug}`:void 0,className:"author-community-name"},C),`${null==a?void 0:a.name}`)),j&&o.createElement(o.Fragment,null,o.createElement(Ft.SubDivider,null),o.createElement(Ft.SubText,{className:"time-text"},j)))),y&&o.createElement(Ft.ColRight,null,o.createElement(ca,{siteType:te})))),S&&S))};da.BookingBtn=ca,da.MainText=Ft.MainText,da.SubText=Ft.SubText,da.SubTextRow=Ft.SubTextRow,da.SubDivider=Ft.SubDivider;const ma=e=>({message:e("notification.failure"),type:"danger"});var pa="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 ua=/<mocka ([^>]*)data-url="true"[^<>]*>(.*?)<\/mocka>/gim,ga=/((?:=")|(?:data-url="true">)|)(https?:\/\/(www\.)?(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))/gim,ha=/\[a\+href="([^<"]+)"(?:\+text=\"([^<"]+)")?\]/gim,va=/<mention [^>]*data-id="([^<"]+)"[^>]*>([^<]+)<\/mention>/gim,ba=/<mention [^>]*data-id="([^<"]+)" [^\>]*data-name="([^<"]+)"[^>]*>([^<]+)<\/mention>/gim,fa=/\[mention\+id="([^<"]+)"([^\]]*)\]/gim,ya=/^(https?:\/\/(www\.)?(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))$/gim,wa=/^((https?:\/\/)?(www\.)?(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))$/gim,xa=/<a [^>]*href="([^>"]+)"[^>]*>([^<]+)<\/a>/gim,Ea=/<mocka [^\>]*data-bad-word="[^\"]*" [^\>]*data-error="true"[^\>]*>(.*?)<\/mocka>/gim,Ca=({url:e,text:t,method:a})=>{const o=t.indexOf(t.trimStart()),n=t.trimEnd().length,i=t.substring(0,o),l=t.substring(o,n),r=t.substring(n);return"edit"===a?`${i}<mocka data-href="${e}" data-url="true">${l}</mocka>${r}`:"display"===a&&(e.startsWith("http://")||e.startsWith("https://"))?`${i}<a href="${e}" target="_blank">${l}</a>${r}`:t},ka=(e,t)=>e.replace(ha,((e,a,o)=>Ca({text:o||a,url:a,method:t}))).replace(xa,((e,a,o)=>Ca({text:o||a,url:a,method:t}))),Na=(e,t=[])=>e.replace(fa,((e,a,o)=>{const n=t.find((e=>String(e.id)===a));if(!n){if(!o)return"";let e="";return o.replace(/\+name="([^<"]+)"/i,((t,a)=>(e=a,t))),`<mention data-id="${a}" data-name="${e}">${e}</mention>`}return`<mention data-id="${a}" data-name="${n.name}">${n.name}</mention>`})),Aa=e=>{const t=[];return e.replace(/(\&)+/g,"&").replace(ga,((e,a,o)=>('="'!==a&&'data-url="true">'!==a&&t.push(o),e))),t},La=(e,t)=>{const a=[];return e.replace(va,((e,t)=>(a.push(t),e))).replace(fa,((e,t)=>(a.push(t),e))),t?a:Array.from(new Set(a)).slice(0,30)},Ta=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Pa=e=>e.replace(Ea,"$1"),Ia=(e,t=(e=>e))=>((e,t=(e=>e))=>{var a;return t(null===(a=e.replace(/(\ )+/g," ").replace(/(\&)+/g,"&"))||void 0===a?void 0:a.replace(/(\u200c|‌)+/g,"").replace(ga,((e,t,a)=>'="'!==t&&'data-url="true">'!==t?`<a href="${a}" target="_blank">${a}</a>`:e)).replace(ua,((e,t,a)=>{var o;const n=null===(o=t.match(/data-href="([^"]*)"/im))||void 0===o?void 0:o[1];return n?`<a href="${n}" target="_blank">${a}</a>`:`<a href="${a}" target="_blank">${a}</a>`})))})((e=>e.replace(va,((e,t,a)=>`[mention+id="${t}"+name="${a}"]`)))(Pa(e)),t),Sa=["hellobacsi.com","hellosehat.com","hellodoktor.com","hellokrupet.com","hellodoctor.com.ph","hellokhunmor.com","hellosayarwon.com","helloyishi.com.tw","helloswasthya.com","marrybaby.vn"],Ma=e=>e.match(wa)?e.startsWith("https://")||e.startsWith("http://")?e:`https://${e}`:"",za=(e,t)=>{const a=t.filter(Boolean);if(e&&a.length>0){return Pa(e).replace(new RegExp(`\\b(${a.map((e=>Ta(e))).join("|")})\\b`,"gi"),((e,t)=>{const a=document.createElement("mocka");return a.setAttribute("data-bad-word",t),a.setAttribute("data-error","true"),a.innerText=t,`${a.outerHTML}`}))}return e},ja=(t,a,o)=>"string"==typeof t?Promise.resolve(t):e(void 0,void 0,void 0,(function*(){var e;const n=new FormData;if(t.type.startsWith("image/gif"))n.append("image",t);else{const e=yield import("browser-image-compression"),a=yield e.default(t,{maxSizeMB:.4,maxWidthOrHeight:1536,useWebWorker:!0});n.append("image",a)}const i=o?ue:ge,l=yield i(ee(o?pe.COMMENT.IMAGE_UPLOAD:te.COMMENT.IMAGE_UPLOAD,{_locale:a}),"POST",{data:n});return(null===(e=null==l?void 0:l.data)||void 0===e?void 0:e.image)||""})),Fa=(e,t)=>{const[a,o]=l(e||[]);return{onSelectImages:n=>{const i=n.target.files;if(i)if(t&&e){t((e||a).concat(Array.from(i)))}else o((a=>{const o=e||a;return t&&t(o.concat(Array.from(i))),o.concat(Array.from(i))}))},onRemoveImage:a=>{if(t&&e){const o=e;o.splice(a,1),t(o.slice())}else o((o=>{const n=e||o;return n.splice(a,1),t&&t(n.slice()),n.slice()}))},onRemoveAllImages:()=>{t?t([]):o([])},imageSrcs:c((()=>(e||a).map((e=>"string"==typeof e?e:URL.createObjectURL(e)))),[e,a]),imageFiles:e||a}},Ba=Z.div`
|
|
962
|
+
`;const ta=({isOpen:e=!0,onClose:t,enableAnimation:a=!0,hospitalId:n,locale:i,isMobile:r,overwriteProfileProps:d,avatarFallback:m=V.getAssetPath("avatar.jpg"),trackingCategory:p="Together"})=>{const{t:u}=w(),[g,h]=l(null),[v,b]=l(!1);s((()=>{if(e&&n&&String(null==g?void 0:g.id)!==String(n)){b(!0);try{h(null),J(ie(le.GET_HOSPITAL_INFO,{hospital_branch_id:n,website_url:re[i]}),"get").then((e=>{h(Object.assign(Object.assign({},null==e?void 0:e._data.branch),d))}))}catch(e){console.error(e)}b(!1)}}),[e,n,null==g?void 0:g.id]);const f=(null==g?void 0:g.specialties)||[],y=c((()=>f.map((e=>e.name))),[f]);return o.createElement(o.Fragment,null,o.createElement($t,{"data-open":e,"data-animation":a,onClick:e=>e.stopPropagation()},v||!g?o.createElement(Xe,null):o.createElement("div",{className:"popup-content"},o.createElement("div",{className:"close-button",onClick:t},o.createElement("img",{src:Ut,style:{width:20,height:20},alt:"close-icon"})),o.createElement("div",{className:"main-info"},o.createElement("div",{className:"border-banner"}),o.createElement("div",{className:"avatar-title"},o.createElement(Jt,null,o.createElement("div",{className:"image-container"},o.createElement("div",{style:{position:"relative"}},o.createElement(we,{src:null==g?void 0:g.logo,className:"profile-image",alt:"avatar",fallbackSrc:m}),o.createElement("img",{className:"badge-avatar",src:Wt,alt:"badge"})))),o.createElement(ea,null,o.createElement(Se,{size:"s3",type:"semiBold",className:"full-name"},null==g?void 0:g.name),o.createElement("div",{className:"specialty"},f&&o.createElement(Se,{size:"p4",color:E.colors.gray800},y.join(" • "),"•"),o.createElement("a",{href:se({id:g.id,name:g.name,slug:g.slug,locale:i}),className:"organisation",target:"_blank",rel:"noreferrer"},o.createElement(Se,{size:"p4",className:"organisation",color:E.colors.gray800,style:{textDecoration:"underline"}},null==g?void 0:g.name))))),!r&&o.createElement("a",{href:se({id:g.id,name:g.name,slug:g.slug,locale:i})},o.createElement("div",{className:"btn-wrapper"},o.createElement(Fe,{color:"primary",size:"md",className:"btn-booking"},u("careBooking.bookAnAppointment"))))),o.createElement(ea,null,o.createElement("div",{className:"experience"},o.createElement(Se,{type:"bold",size:"s3",color:E.colors.gray800,style:{paddingBottom:16}},u("hospital.content.description").toUpperCase()),o.createElement(Se,{size:"p2",color:E.colors.gray500},g.about),r?o.createElement("a",{href:se({id:g.id,name:g.name,slug:g.slug,locale:i})},o.createElement("div",{className:"btn-wrapper"},o.createElement(Fe,{color:"primary",size:"md",className:"btn-booking"},u("careBooking.bookAnAppointment")))):o.createElement("a",{href:se({id:g.id,name:g.name,slug:g.slug,locale:i})},o.createElement(Se,{size:"s4",color:"#2D87F3",as:"span","data-event-category":p,"data-event-action":"See Full Hospital Profile","data-event-label":oe(i)+se({id:g.id,name:g.name,slug:g.slug,locale:i})},u("home.seeHospital"))))))),o.createElement(Yt,{"data-open":e,onClick:e=>{e.stopPropagation(),t()}}))};var aa="_2UKyiK1",oa="E5ga-tI",na="_8Y2nWXX",ia="d0T7kSP";const la=({open:e,onClose:t,children:a,profileModalProps:n})=>{const{t:i}=w();return o.createElement(Ue,Object.assign({className:aa,opened:e,onClose:t,overlayOpacity:.2,overflow:"inside",styles:{inner:{padding:0,justifyContent:"flex-end"},modal:{height:"100%",borderRadius:0},body:{padding:"24px",maxHeight:"100%"},content:{maxHeight:"100%",height:"100%",borderRadius:0}},title:"Profile"},n),o.createElement("div",{className:oa},o.createElement("div",{className:na},i("profilePanel.modal.heading")),o.createElement("div",{className:ia,onClick:t},o.createElement(He,null))),a)};var ra=p((()=>({root:{},authorBadge:{background:"yellow"}})));W.extend(De);const sa=n({}),ca=({siteType:e})=>{const{t:t}=w(),{handleMakeAppointment:a,doctorId:n,hospitalId:l,currentUrl:r}=i(sa);return o.createElement(Fe,{theme:e,color:"primary",size:"xs",onClick:e=>{null==a||a(n,l),e.stopPropagation()},dataEventCategory:"Care",dataEventAction:"Comment - Quick Booking",dataEventLabel:r,icon:o.createElement(T,{className:"buttonIcon",size:18}),iconPosition:"right",style:{whiteSpace:"nowrap"}},o.createElement("span",null,t("careBooking.bookAnAppointment")))},da=e=>{const{className:t="",community:a,name:n,username:r,url:c,avatar:d,role:m,title:p,userType:g="user",expertId:h,isMarryBaby:v,doctorId:b,hospitalId:f,hasQuickBooking:y,handleMakeAppointment:x,communityTrackingAttr:C,isAnonymous:k,showDetailPopup:N,subLine:A,authActionWrapper:T,profileProps:P,profileModalProps:I,extendEle:S,avatarProps:M,hideInfo:z,timeText:j,onCloseFromPost:F,avatarIcon:B,badgeIconSize:O,hideBackground:R,children:D,styles:W,dataEventCategory:Z,dataEventAction:H,dataEventLabel:q}=e,{data:{locale:_,router:Q,env:{isMarryBaby:K,togetherBasePath:$}}}=i(X),{t:Y}=w(),{classes:J}=ra(void 0,{name:"CardAuthor",styles:W}),ee="boolean"==typeof v?v:K,te=ee?"marryBaby":"helloSites",ae=k?Y("cardPost.anonymous"):n||r||"",oe=k?V.getAssetPath("avatar.jpg"):d,ne=k?void 0:m,[ie,le]=l(!1),{asPath:re}=Q||{},se=`https://${U[_]}${re}`,ce=()=>{if(k||"chatbot"===g)return!1;N?me(!0):c&&(window.location.href=c)};s((()=>{G(ie)}),[ie]);const[de,me]=l(!1),pe="expert"===(null==e?void 0:e.role),[ue,ge]=l(null);return s((()=>{de&&!ue&&Promise.resolve().then((function(){return Vn})).then((e=>{ge((()=>e.ProfileDetail))}))}),[de]),o.createElement(sa.Provider,{value:{handleMakeAppointment:x,doctorId:b,hospitalId:f,currentUrl:se}},o.createElement(la,{open:de,onClose:()=>me(!1),profileModalProps:I},ue&&o.createElement(ue,Object.assign({currentPageUrl:q,authorProps:{userId:null==e?void 0:e.userId,avatar:oe,name:null==e?void 0:e.name,role:null==e?void 0:e.role,title:null==e?void 0:e.title},authActionWrapper:T,onCloseFromPost:()=>{me(!1),null==F||F()}},P))),"expert"===ne&&h?o.createElement(Xt,{isOpen:ie,onClose:()=>le(!1),expertId:h}):null,"expert"===ne&&b?o.createElement(Zt,{isOpen:ie,onClose:()=>le(!1),doctorId:b,locale:_}):null,"expert"===ne&&f?o.createElement(ta,{isOpen:ie,onClose:()=>le(!1),hospitalId:f,locale:_}):null,o.createElement("div",{className:`hhg-card-author ${J.root} ${t} ${pe?"expert-author":""}`,"data-background":!R&&pe,"data-is-marrybaby":ee},o.createElement(Ft,{dataEventCategory:Z,dataEventAction:H,dataEventLabel:q,onAvatarClick:ce,avatarProps:Object.assign(Object.assign({avatar:k?V.getAssetPath(ee?"anomyous-avatar-1.svg":"anomyous-avatar.svg"):oe,username:ae},M),{style:{cursor:k||!c&&!N?"default":"pointer"}}),avatarIcon:B||pe&&o.createElement(Ct,{size:O||15})},D?o.createElement("div",{onClick:ce},D):!z&&o.createElement(Ft.Row,null,o.createElement(Ft.ColLeft,null,o.createElement(u,{align:"center",onClick:ce},o.createElement(Ft.MainText,{onClick:ce},ae,"chatbot"===g?o.createElement(o.Fragment,null," ",o.createElement(L,{color:E.colors.primaryBase,size:16,style:{display:"inline-block",transform:"translate(0, 2px)"}})):ne&&o.createElement(xe,{className:J.authorBadge,siteType:te,role:ne,title:p,style:{verticalAlign:"bottom"}}))),A||o.createElement(Ft.SubTextRow,null,(null==a?void 0:a.name)&&o.createElement(Ft.SubText,null,o.createElement("a",Object.assign({href:(null==a?void 0:a.slug)&&a.isActive&&!a.isHidden?`${$}/${null==a?void 0:a.slug}`:void 0,className:"author-community-name"},C),`${null==a?void 0:a.name}`)),j&&o.createElement(o.Fragment,null,o.createElement(Ft.SubDivider,null),o.createElement(Ft.SubText,{className:"time-text"},j)))),y&&o.createElement(Ft.ColRight,null,o.createElement(ca,{siteType:te})))),S&&S))};da.BookingBtn=ca,da.MainText=Ft.MainText,da.SubText=Ft.SubText,da.SubTextRow=Ft.SubTextRow,da.SubDivider=Ft.SubDivider;const ma=e=>({message:e("notification.failure"),type:"danger"}),pa=Z.div`
|
|
963
|
+
position: relative;
|
|
964
|
+
display: flex;
|
|
965
|
+
height: 100%;
|
|
966
|
+
flex-direction: column;
|
|
967
|
+
padding: 16px 24px;
|
|
968
|
+
|
|
969
|
+
.input-group-container {
|
|
970
|
+
flex: 1;
|
|
971
|
+
padding-right: 2px;
|
|
972
|
+
padding-left: 2px;
|
|
973
|
+
margin-bottom: 0.5rem;
|
|
974
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
975
|
+
overflow-y: auto;
|
|
976
|
+
scrollbar-width: none; /* Firefox */
|
|
977
|
+
&::-webkit-scrollbar {
|
|
978
|
+
display: none;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
.input-group {
|
|
983
|
+
:not(:last-child) {
|
|
984
|
+
margin-bottom: 0.6rem;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
input:focus,
|
|
988
|
+
textarea:focus,
|
|
989
|
+
[contenteditable='true'] {
|
|
990
|
+
outline: none;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
label {
|
|
994
|
+
margin-bottom: 5px;
|
|
995
|
+
color: ${e=>e.theme.colors.gray600};
|
|
996
|
+
/* font-family: 'Open Sans', sans-serif; */
|
|
997
|
+
font-size: 13px;
|
|
998
|
+
font-weight: bold;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
.input-group-label {
|
|
1002
|
+
margin-bottom: 5px;
|
|
1003
|
+
color: ${e=>e.theme.colors.gray600};
|
|
1004
|
+
/* font-family: 'Open Sans', sans-serif; */
|
|
1005
|
+
font-size: 13px;
|
|
1006
|
+
font-weight: bold;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
.input-notification {
|
|
1010
|
+
display: flex;
|
|
1011
|
+
|
|
1012
|
+
& > img {
|
|
1013
|
+
width: 16px;
|
|
1014
|
+
height: 16px;
|
|
1015
|
+
margin-top: 1.5px;
|
|
1016
|
+
margin-right: 8px;
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
.tag-list {
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
.warning {
|
|
1025
|
+
margin-top: 16px;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
.submit-btn {
|
|
1029
|
+
width: 100%;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
.switch-label {
|
|
1033
|
+
display: flex;
|
|
1034
|
+
align-items: center;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
.swich-input-group {
|
|
1038
|
+
padding: 12px 16px;
|
|
1039
|
+
border-radius: 8px;
|
|
1040
|
+
background: ${E.colors.neutral50};
|
|
1041
|
+
|
|
1042
|
+
&.askdoctor-switch {
|
|
1043
|
+
background: ${E.colors.primary50};
|
|
1044
|
+
&.mb-color {
|
|
1045
|
+
background: ${E.mbColors.tonePink};
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
|
|
1049
|
+
.mantine-Switch-labelWrapper {
|
|
1050
|
+
flex-grow: 1;
|
|
1051
|
+
}
|
|
1052
|
+
.mantine-Checkbox-body {
|
|
1053
|
+
display: flex;
|
|
1054
|
+
width: 100%;
|
|
1055
|
+
align-items: center;
|
|
1056
|
+
justify-content: space-between;
|
|
1057
|
+
}
|
|
1058
|
+
.mantine-Switch-track {
|
|
1059
|
+
margin-bottom: 0;
|
|
1060
|
+
}
|
|
1061
|
+
.label-txt {
|
|
1062
|
+
font-weight: normal;
|
|
1063
|
+
font-size: 14px;
|
|
1064
|
+
color: ${E.colors.gray800};
|
|
1065
|
+
margin-left: 10px;
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
`,ua=Z.div`
|
|
1069
|
+
display: flex;
|
|
1070
|
+
width: 100%;
|
|
1071
|
+
align-items: center;
|
|
1072
|
+
justify-content: space-between;
|
|
1073
|
+
padding: 12px 16px;
|
|
1074
|
+
border-radius: 8px;
|
|
1075
|
+
background: ${E.colors.primary50};
|
|
1076
|
+
|
|
1077
|
+
&[data-is-marry-baby='true'] {
|
|
1078
|
+
background: ${E.mbColors.tonePink};
|
|
1079
|
+
}
|
|
1080
|
+
.switch-label {
|
|
1081
|
+
display: flex;
|
|
1082
|
+
align-items: center;
|
|
1083
|
+
gap: 12px;
|
|
1084
|
+
}
|
|
1085
|
+
margin-bottom: 12px;
|
|
1086
|
+
`,ga=Z.div`
|
|
1087
|
+
margin-bottom: 12px;
|
|
1088
|
+
color: ${E.colors.red700};
|
|
1089
|
+
svg {
|
|
1090
|
+
margin-right: 5px;
|
|
1091
|
+
}
|
|
1092
|
+
svg,
|
|
1093
|
+
span {
|
|
1094
|
+
vertical-align: middle;
|
|
1095
|
+
}
|
|
1096
|
+
`;var ha="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 va=/<mocka ([^>]*)data-url="true"[^<>]*>(.*?)<\/mocka>/gim,ba=/((?:=")|(?:data-url="true">)|)(https?:\/\/(www\.)?(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))/gim,fa=/\[a\+href="([^<"]+)"(?:\+text=\"([^<"]+)")?\]/gim,ya=/<mention [^>]*data-id="([^<"]+)"[^>]*>([^<]+)<\/mention>/gim,wa=/<mention [^>]*data-id="([^<"]+)" [^\>]*data-name="([^<"]+)"[^>]*>([^<]+)<\/mention>/gim,xa=/\[mention\+id="([^<"]+)"([^\]]*)\]/gim,Ea=/^(https?:\/\/(www\.)?(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))$/gim,Ca=/^((https?:\/\/)?(www\.)?(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))$/gim,ka=/<a [^>]*href="([^>"]+)"[^>]*>([^<]+)<\/a>/gim,Na=/<mocka [^\>]*data-bad-word="[^\"]*" [^\>]*data-error="true"[^\>]*>(.*?)<\/mocka>/gim,Aa=({url:e,text:t,method:a})=>{const o=t.indexOf(t.trimStart()),n=t.trimEnd().length,i=t.substring(0,o),l=t.substring(o,n),r=t.substring(n);return"edit"===a?`${i}<mocka data-href="${e}" data-url="true">${l}</mocka>${r}`:"display"===a&&(e.startsWith("http://")||e.startsWith("https://"))?`${i}<a href="${e}" target="_blank">${l}</a>${r}`:t},La=(e,t)=>e.replace(fa,((e,a,o)=>Aa({text:o||a,url:a,method:t}))).replace(ka,((e,a,o)=>Aa({text:o||a,url:a,method:t}))),Ta=(e,t=[])=>e.replace(xa,((e,a,o)=>{const n=t.find((e=>String(e.id)===a));if(!n){if(!o)return"";let e="";return o.replace(/\+name="([^<"]+)"/i,((t,a)=>(e=a,t))),`<mention data-id="${a}" data-name="${e}">${e}</mention>`}return`<mention data-id="${a}" data-name="${n.name}">${n.name}</mention>`})),Pa=e=>{const t=[];return e.replace(/(\&)+/g,"&").replace(ba,((e,a,o)=>('="'!==a&&'data-url="true">'!==a&&t.push(o),e))),t},Ia=(e,t)=>{const a=[];return e.replace(ya,((e,t)=>(a.push(t),e))).replace(xa,((e,t)=>(a.push(t),e))),t?a:Array.from(new Set(a)).slice(0,30)},Sa=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Ma=e=>e.replace(Na,"$1"),za=(e,t=(e=>e))=>((e,t=(e=>e))=>{var a;return t(null===(a=e.replace(/(\ )+/g," ").replace(/(\&)+/g,"&"))||void 0===a?void 0:a.replace(/(\u200c|‌)+/g,"").replace(ba,((e,t,a)=>'="'!==t&&'data-url="true">'!==t?`<a href="${a}" target="_blank">${a}</a>`:e)).replace(va,((e,t,a)=>{var o;const n=null===(o=t.match(/data-href="([^"]*)"/im))||void 0===o?void 0:o[1];return n?`<a href="${n}" target="_blank">${a}</a>`:`<a href="${a}" target="_blank">${a}</a>`})))})((e=>e.replace(ya,((e,t,a)=>`[mention+id="${t}"+name="${a}"]`)))(Ma(e)),t),ja=["hellobacsi.com","hellosehat.com","hellodoktor.com","hellokrupet.com","hellodoctor.com.ph","hellokhunmor.com","hellosayarwon.com","helloyishi.com.tw","helloswasthya.com","marrybaby.vn"],Fa=e=>e.match(Ca)?e.startsWith("https://")||e.startsWith("http://")?e:`https://${e}`:"",Ba=(e,t)=>{const a=t.filter(Boolean);if(e&&a.length>0){return Ma(e).replace(new RegExp(`\\b(${a.map((e=>Sa(e))).join("|")})\\b`,"gi"),((e,t)=>{const a=document.createElement("mocka");return a.setAttribute("data-bad-word",t),a.setAttribute("data-error","true"),a.innerText=t,`${a.outerHTML}`}))}return e},Oa=(t,a,o)=>"string"==typeof t?Promise.resolve(t):e(void 0,void 0,void 0,(function*(){var e;const n=new FormData;if(t.type.startsWith("image/gif"))n.append("image",t);else{const e=yield import("browser-image-compression"),a=yield e.default(t,{maxSizeMB:.4,maxWidthOrHeight:1536,useWebWorker:!0});n.append("image",a)}const i=o?ue:ge,l=yield i(ee(o?pe.COMMENT.IMAGE_UPLOAD:te.COMMENT.IMAGE_UPLOAD,{_locale:a}),"POST",{data:n});return(null===(e=null==l?void 0:l.data)||void 0===e?void 0:e.image)||""})),Ra=(e,t)=>{const[a,o]=l(e||[]);return{onSelectImages:n=>{const i=n.target.files;if(i)if(t&&e){t((e||a).concat(Array.from(i)))}else o((a=>{const o=e||a;return t&&t(o.concat(Array.from(i))),o.concat(Array.from(i))}))},onRemoveImage:a=>{if(t&&e){const o=e;o.splice(a,1),t(o.slice())}else o((o=>{const n=e||o;return n.splice(a,1),t&&t(n.slice()),n.slice()}))},onRemoveAllImages:()=>{t?t([]):o([])},imageSrcs:c((()=>(e||a).map((e=>"string"==typeof e?e:URL.createObjectURL(e)))),[e,a]),imageFiles:e||a}},Va=Z.div`
|
|
963
1097
|
input:focus,
|
|
964
1098
|
textarea:focus,
|
|
965
1099
|
[contenteditable='true'] {
|
|
@@ -1078,7 +1212,7 @@ import{a as e,_ as t}from"./tslib.es6-16065c04.js";import*as a from"react";impor
|
|
|
1078
1212
|
margin-right: 8px;
|
|
1079
1213
|
}
|
|
1080
1214
|
}
|
|
1081
|
-
`,
|
|
1215
|
+
`,Da=Z.div`
|
|
1082
1216
|
height: 100%;
|
|
1083
1217
|
position: relative;
|
|
1084
1218
|
width: 100%;
|
|
@@ -1277,7 +1411,7 @@ import{a as e,_ as t}from"./tslib.es6-16065c04.js";import*as a from"react";impor
|
|
|
1277
1411
|
}
|
|
1278
1412
|
}
|
|
1279
1413
|
}
|
|
1280
|
-
`;let Ra=null;function Va(e){var t,a;let o=-1;if(void 0!==window.getSelection){const n=window.getSelection();if((null==n?void 0:n.rangeCount)&&(null==n?void 0:n.rangeCount)>0){const n=null===(t=window.getSelection())||void 0===t?void 0:t.getRangeAt(0);if(n){const t=n.cloneRange();t.selectNodeContents(e),t.setEnd(n.endContainer,n.endOffset),o=Da(t.cloneContents().childNodes,o);const i=null===(a=n.endContainer.parentElement)||void 0===a?void 0:a.closest("mocka"),l=n.endContainer.nodeValue||n.endContainer.outerHTML;i&&(null==l?void 0:l.length)&&(o=o-n.endOffset+(i.outerHTML.length-(null==i?void 0:i.outerHTML.lastIndexOf(l))))}}}return o}function Da(e,t){return e.forEach(((a,o)=>{const n=o+1===e.length;if(a.nodeType===Node.ELEMENT_NODE){const e=a.outerHTML;if(!n)return void(t+=e.length);t+=e.indexOf(">")+1,t=Da(a.childNodes,t)}else a.nodeType===Node.TEXT_NODE&&(t+=(a.nodeValue||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").length)})),t}e(void 0,void 0,void 0,(function*(){if("undefined"==typeof window)return;const e=yield import("react-quill");Ra=e.default;const t=e.Quill||Ra.Quill;t.register("modules/preserveWhiteSpace",class{constructor(e,t){this.quill=e,this.options=t,e.container.style.whiteSpace="pre-line"}});const a=t.import("blots/inline");class o extends a{static create(e){if(!e)return super.create(!1);const t=super.create(e);return o.setNodeConfigurations(t,e),t}static formats(e){return!(!e.innerText||!(e.getAttribute("data-href")||e.getAttribute("data-url")||e.getAttribute("data-error")||e.getAttribute("data-bad-word")))&&{"data-bad-word":e.getAttribute("data-bad-word"),"data-error":e.getAttribute("data-error"),"data-href":e.getAttribute("data-href"),"data-url":e.getAttribute("data-url"),"data-text":e.innerText||e.getAttribute("data-href")}}static setNodeConfigurations(e,t){var a,o;t&&(null===(o=null===(a=null==t?void 0:t["data-text"])||void 0===a?void 0:a.replace(/(\ )+/g," "))||void 0===o?void 0:o.replace(/(\u200c|‌)+/g,""))&&(t["data-bad-word"]&&e.setAttribute("data-bad-word",t["data-bad-word"]),t["data-href"]&&e.setAttribute("data-href",t["data-href"]),t["data-error"]&&e.setAttribute("data-error",t["data-error"]),t["data-url"]&&e.setAttribute("data-url",t["data-url"]))}}o.blotName="mocka1",o.tagName="mocka",t.register(o);class n extends a{static create(e){if(!e)return super.create(!1);const t=super.create(e);return n.setNodeConfigurations(t,e),t}static formats(e){return!(!e.getAttribute("data-name")||!e.getAttribute("data-id"))&&{"data-name":e.getAttribute("data-name"),"data-id":e.getAttribute("data-id")}}static setNodeConfigurations(e,t){var a,o;t&&t["data-id"]&&(null===(o=null===(a=null==t?void 0:t["data-name"])||void 0===a?void 0:a.replace(/(\ )+/g," "))||void 0===o?void 0:o.replace(/(\u200c|‌)+/g,""))&&(t["data-id"]&&e.setAttribute("data-id",t["data-id"]),t["data-name"]&&e.setAttribute("data-name",t["data-name"]))}}n.blotName="mention",n.tagName="mention",t.register(n)}));const Ua=(e,t)=>{var a;const{formatUrl:o,bannedWords:n=[]}=t||{},i=e.replace(/<font [^\>]*>(.+)<\/font>/gim,((e,t)=>t.replace(/<u[^\>]*>(.+)<\/u>/gim,"$1"))).replace(ba,((e,t,a,o)=>{if(o!==a){const e=a.split(" "),n=e.findIndex(((t,a)=>{const n=e.slice(0,a+1).join(" ");return!o.startsWith(n)}));if(0===n)return`@${o}`;{const a=(n<0?e:e.slice(0,n)).join(" "),i=o.slice(a.length).trim();return console.log(n,a,i),`<mention data-id="${t}" data-name="${a}">${a}</mention> ${i} `}}return e}));if(!o)return{value:za(i,n)};let l=(e=>e.replace(Ea,((e,t)=>{const a=document.createElement("div");a.innerHTML=e;const o=a.firstChild;return(null==o?void 0:o.innerText)!==(null==o?void 0:o.getAttribute("data-bad-word"))?t:e})))((e=>{var t,a;return null===(a=null===(t=e.replace(/(\ )+/g," "))||void 0===t?void 0:t.replace(/(\u200c|‌)+/g,""))||void 0===a?void 0:a.replace(ua,((e,t,a)=>{var o;const n=null===(o=t.match(/data-href="([^"]*)"/im))||void 0===o?void 0:o[1];return!n||n===a||a.match(ya)?a:n?`<a href="${n}">${a}</a>`:`<a href="${a}">${a}</a>`})).replace(ga,((e,t,a)=>{if('="'!==t&&'data-url="true">'!==t){const e=a.toLowerCase(),t=`${e.startsWith("http")?"":" https://"}${e}`;return Ca({text:t,url:t,method:"edit"})}return e})).replace(xa,((e,t,a)=>Ca({text:a||t,url:t,method:"edit"})))})(i));const r=(e=>{var t;return[...Aa(e),...(null===(t=e.match(ua))||void 0===t?void 0:t.map((e=>{var t,a;const o=null===(t=e.match(/data-href="([^"]*)"/im))||void 0===t?void 0:t[1],n=null===(a=e.match(/>(.*?)<\/mocka>/im))||void 0===a?void 0:a[1];return o||n})))||[]].filter((e=>!!e))})(i);if(r){const e=[];let t="";return r.forEach((t=>{if(t)try{const a=new URL(t);Sa.some((e=>a.origin.endsWith(e)))||e.push(t)}catch(a){e.push(t)}})),e.length>0&&(l=l.replace(new RegExp(`data-url="true">(${e.map(Ta).join("|")})<`,"gi"),'data-error="true" data-url="true">$1<').replace(new RegExp(`data-href="(${e.map(Ta).join("|")})" data-url="true">`,"gi"),'data-href="$1" data-error="true" data-url="true">')),t=null===(a=r.filter((t=>-1===e.indexOf(t))))||void 0===a?void 0:a[0],{invalidUrls:e,previewUrl:t,value:za(l,n)}}return{value:za(l,n)}},Wa=({html:t,onChange:a,className:n,style:c,onImagePickerClick:m,bannedWords:p=[],onInvalidUrlsChange:u,onPreviewUrlChange:g,setEditorRef:h,isReplying:v})=>{var b,f,y,w;const x=r([]);x.current=p;const[E,C]=l([]),[k,N]=l(null),{data:{locale:A}}=i(X),L=(null==p?void 0:p.join(","))||"";s((()=>{var e,t;const a=null===(t=null===(e=F.current)||void 0===e?void 0:e.getEditor())||void 0===t?void 0:t.root.innerHTML;I(a)}),[L]);const T=e=>{k&&k.url===e||(N({url:e,isFetching:!0}),J(ee(te.FETCH_PREVIEW,{_locale:A}),"POST",{data:{link:e}}).then((t=>{var a,o,n,i;N({title:null===(a=null==t?void 0:t.data)||void 0===a?void 0:a.title,description:null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.description,image:(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.image)||(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.logo),url:e})})).catch((()=>{N(null)})))},P=r(T);P.current=T;const I=d(ze((e=>{if(e){const t=Ua(e,{bannedWords:x.current,formatUrl:!0}),{invalidUrls:o,previewUrl:n,value:i}=t;o&&C(o),n?P.current(n):N(null),i!==e&&(null==a||a(i))}}),500),[]);s((()=>{u&&u(E)}),[E]),s((()=>{g&&((null==k?void 0:k.url)?g({title:k.title||"",url:k.url||"",image:k.image||"",description:k.description||""}):g(null))}),[k]);const S=r(m);S.current=m;const M=We(),z=r({toolbar:{handlers:{image:()=>{var e;return null===(e=S.current)||void 0===e?void 0:e.call(S)},link:()=>!1},container:"#toolbar-"+M},preserveWhiteSpace:!0}),j=r(-1),F=r(null);h&&(null===(f=null===(b=F.current)||void 0===b?void 0:b.getEditor())||void 0===f?void 0:f.root)&&h(null===(w=null===(y=F.current)||void 0===y?void 0:y.getEditor())||void 0===w?void 0:w.root);const B=()=>{var e,t,a,o,n,i,l,r;if(null===(t=null===(e=F.current)||void 0===e?void 0:e.getEditor())||void 0===t?void 0:t.root){const e=Va(null===(o=null===(a=F.current)||void 0===a?void 0:a.getEditor())||void 0===o?void 0:o.root),t=null===(i=null===(n=F.current)||void 0===n?void 0:n.getEditor())||void 0===i?void 0:i.root.innerHTML;if(e>=0&&e<t.length){if(La(t,!0).length<30-(v?1:0)){const e=function(e){var t,a;let o=null;if(void 0!==window.getSelection){const n=window.getSelection();if((null==n?void 0:n.rangeCount)&&(null==n?void 0:n.rangeCount)>0){const n=null===(t=window.getSelection())||void 0===t?void 0:t.getRangeAt(0);if(n){const t=n.cloneRange();t.selectNodeContents(e),t.setEnd(n.endContainer,n.endOffset);const i=(t.endContainer.nodeValue||"").substring(0,n.endOffset),l=i.lastIndexOf("@");if(l+1<i.length&&(0===l||" @"===i.slice(l-1,l+1))){const e=null===(a=i.slice(l+1))||void 0===a?void 0:a.trim();if(e){t.setStart(n.endContainer,l);const a=t.cloneRange();a.setStart(a.endContainer,l),o={name:e,rect:t.getBoundingClientRect(),replaceRange:a}}}}}}return o}(null===(r=null===(l=F.current)||void 0===l?void 0:l.getEditor())||void 0===r?void 0:r.root);e?(U(e.name,e.rect),H.current=e.replaceRange):(H.current=null,U("",null))}else H.current=null,U("",null);j.current=e}}else R([])},[O,R]=l([]),[V,D]=l({top:0,left:0}),U=d(ze(((t,a,o)=>e(void 0,void 0,void 0,(function*(){var e,n,i,l;if(!t||!DOMRect)return R([]);const r=yield((null===(e=Oe($))||void 0===e?void 0:e.length)||0)>0?ge(ee(te.SEARCH_USER,{_locale:A,name:t}),"get"):ue(ee(pe.SEARCH_USER,{_locale:A,name:t}),"get");G(0),R(null===(i=null===(n=null==r?void 0:r.data)||void 0===n?void 0:n.users)||void 0===i?void 0:i.filter((e=>!(null==o?void 0:o.includes(String(e.id))))));const s=a,c=null===(l=Z.current)||void 0===l?void 0:l.getBoundingClientRect();if(s&&c){const e=343,t=256,a={top:s.bottom-c.top,width:"min(343px, 100%)",maxHeight:t};c.width-(s.left-c.left)<e?a.right=0:a.left=s.left-c.left,D(a)}}))),500),[]),W=(e,t)=>{var a,o,n;if(H.current){H.current.deleteContents();const i=document.createElement("mention");i.setAttribute("data-id",e),i.setAttribute("data-name",t),i.innerText=t;const l=document.createTextNode(" ");H.current.insertNode(l),H.current.insertNode(i);(null===(o=null===(a=F.current)||void 0===a?void 0:a.getEditor())||void 0===o?void 0:o.root).focus();const r=null===(n=window.getSelection())||void 0===n?void 0:n.getRangeAt(0);null==r||r.setStart(H.current.endContainer,H.current.endOffset),null==r||r.setEnd(H.current.endContainer,H.current.endOffset)}R([])},Z=r(null),H=r(null),q=r(null),[_,G]=l(0);return s((()=>{if(q.current){const e=q.current,t=e.children.item(_);if(t){const a=e.getBoundingClientRect(),o=t.getBoundingClientRect();t.offsetTop<e.scrollTop?e.scrollTop=t.offsetTop:t.offsetTop+o.height>e.scrollTop+a.height&&(e.scrollTop=t.offsetTop-a.height+o.height)}}}),[_]),s((()=>{const e=function(e){var t;(null===(t=Z.current)||void 0===t?void 0:t.contains(e.target))||R([])};return window.addEventListener("click",e,{passive:!0}),()=>{window.removeEventListener("click",e)}}),[]),o.createElement(Oa,{ref:Z,className:n,style:c,onKeyDownCapture:e=>{if(null==O?void 0:O.length){let t=!1;if("ArrowDown"===e.key)t=!0,G((e=>e+1>=O.length?0:e+1));else if("Escape"===e.key)t=!0,G(0),R([]);else if("ArrowUp"===e.key)t=!0,G((e=>e-1<0?O.length-1:e-1));else if("Enter"===e.key||"Tab"===e.key){const e=O[_];e&&(t=!0,W(e.id,e.name))}if(t)return e.preventDefault(),!1}}},o.createElement(Za,{id:M,onAddLink:(e,t)=>{var o,n;const i=j.current+1,l=null===(n=null===(o=F.current)||void 0===o?void 0:o.getEditor())||void 0===n?void 0:n.root.innerHTML,r=((null==l?void 0:l.substring(0,i))||"")+`<mocka data-href="${t}" data-url="true">${e}</mocka> `+((null==l?void 0:l.substring(i))||"");null==a||a(r),I(r)}}),Ra&&o.createElement(Ra,{ref:F,theme:"snow",value:t,onChange:e=>{null==a||a(e),I(e),B()},onChangeSelection:()=>{B()},modules:z.current,formats:["mocka1","mention","id","key","bold","italic","underline","list","bullet"]}),!!(null==O?void 0:O.length)&&o.createElement("div",{ref:q,className:"mention-search-container",style:V},O.map(((e,t)=>o.createElement("div",{className:"mention-search-item "+(_===t?"item-selected":""),key:e.id,onClick:t=>{t.preventDefault(),t.stopPropagation(),W(e.id,e.name)},onMouseEnter:()=>{G(t)}},o.createElement(ne,{className:"search-avatar",username:e.name,avatar:e.avatar}),o.createElement("div",null,o.createElement(Se,{size:"p2"},e.name),o.createElement(Se,{size:"p4",color:"#595959"},"@",e.username)))))))},Za=({onAddLink:e,id:t})=>o.createElement("div",{id:"toolbar-"+t,onClick:e=>{e.preventDefault(),e.stopPropagation()}},o.createElement("span",{className:"ql-formats"},o.createElement("button",{className:"ql-bold",type:"button"}),o.createElement("button",{className:"ql-italic",type:"button"}),o.createElement("button",{className:"ql-underline",type:"button"})),o.createElement("span",{className:"ql-formats"},o.createElement("button",{className:"ql-list",value:"ordered",type:"button"}),o.createElement("button",{className:"ql-list",value:"bullet",type:"button"})),o.createElement("span",{className:"ql-formats"},o.createElement("button",{className:"ql-image",type:"button"}),e&&o.createElement(ft,{className:"link-tool-wrapper",toggleButtonContent:o.createElement("img",{className:"link-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='M9.54545 16H7.09091C6.55368 16 6.02172 15.8965 5.52539 15.6955C5.02905 15.4945 4.57808 15.1999 4.1982 14.8284C3.43101 14.0783 3 13.0609 3 12C3 10.9391 3.43101 9.92172 4.1982 9.17157C4.96539 8.42143 6.00593 8 7.09091 8H9.54545M13.9256 8H16.9091C17.4463 8 17.9783 8.10346 18.4746 8.30448C18.9709 8.5055 19.4219 8.80014 19.8018 9.17157C20.1817 9.54301 20.483 9.98396 20.6886 10.4693C20.8942 10.9546 21 11.4747 21 12C21 12.5253 20.8942 13.0454 20.6886 13.5307C20.483 14.016 20.1817 14.457 19.8018 14.8284C19.4219 15.1999 18.9709 15.4945 18.4746 15.6955C17.9783 15.8965 17.4463 16 16.9091 16H13.9256' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9 12H15' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e"}),buttonProps:{size:"md",color:"transparent"},align:"end"},(({setShow:t})=>o.createElement(qa,{onAddUrl:e,setShow:t}))))),Ha=["notification.limitUrlDomain","notification.urlWrongFormat"],qa=({onAddUrl:e,setShow:t})=>{const{data:{env:{isMarryBaby:a}}}=i(X),{t:n}=w(),[r,s]=l(""),[c,d]=l(""),[m,p]=l(-1),u=r.trim()&&c.trim()&&m<0;return o.createElement("div",{className:"link-tool-popover"},o.createElement(Me,{name:"url",value:r,size:"md",label:"URL",placeholder:n("placeholder.enterUrlHere"),type:"text",className:"link-input-url",onChange:e=>{s(e),(e=>{const t=Ma(e.trim());try{const e=new URL(t);return e.protocol.startsWith("http")?Sa.some((t=>e.origin.endsWith("/"+t)||e.origin.endsWith("."+t)))?(p(-1),!0):(p(0),!1):(p(1),!1)}catch(e){return p(1),!1}})(e)}}),m>=0&&o.createElement(Se,{size:"c2",className:"error-text"},n(Ha[m])),o.createElement(Me,{name:"text",value:c,size:"md",label:n("createPost.urlText"),placeholder:n("placeholder.enterUrlTextHere"),type:"text",className:"link-input-text",onChange:e=>d(e)}),o.createElement("div",{"data-is-marrybaby":a,className:"link-input-button-wrapper"},o.createElement(Fe,{theme:a?"marryBaby":"helloSites",size:"sm",color:"primary",className:"link-input-button",onClick:()=>{u&&(e(c.trim(),Ma(r.trim())),t&&t(!1))},isDisabled:!u},n("insert"))))};var _a="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 Ga=({className:e,style:t,bannedWords:a=[],value:n,onChange:i,onPreviewUrlChange:c,onInvalidUrlsChange:d,onImageFilesChange:m,imageFiles:p,isReplying:u})=>{const{t:g}=w(),[h,v]=l(null),b=r(null),{onSelectImages:f,onRemoveImage:y,imageSrcs:C}=Fa(p,m);return s((()=>{c&&((null==h?void 0:h.url)?c({title:h.title||"",url:h.url||"",image:h.image||"",description:h.description||""}):c(null))}),[h]),o.createElement(Ba,{className:e,style:t},o.createElement(Se,{size:"p4",className:"description-label"},g("createPost.popup.description")),o.createElement("div",{className:"textarea-control"},o.createElement("div",{className:"textarea-wrapper"},o.createElement(Wa,{html:n||"",onChange:i,bannedWords:a,onImagePickerClick:()=>{var e;return null===(e=b.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:v,onInvalidUrlsChange:d,isReplying:u}))),o.createElement(Se,{size:"p4",className:"count-string"},g("character"),": ",x(n||"").length),(!C||0===C.length)&&h&&o.createElement("div",{className:"link-preview-wrapper"},h.isFetching?o.createElement(Xe,null):o.createElement(o.Fragment,null,o.createElement(Ye,{title:h.title,url:h.url||"#",image:h.image,noRefetch:!0}),o.createElement("img",{src:_a,className:"icon-close",onClick:()=>v(null)}))),o.createElement("input",{ref:b,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:f}),C.length>he?o.createElement("div",{className:"input-notification"},o.createElement("img",{src:pa}),o.createElement(Se,{size:"p4",color:E.colors.alertWarning},g("createPost.popup.warningImage"))):null,C.length>0&&o.createElement("div",{className:"image-gallery"},C.map(((e,t)=>o.createElement("div",{key:t,className:"image-item"},o.createElement("img",{src:e}),o.createElement("img",{className:"close-btn",src:_a,onClick:()=>y(t)}))))))},Qa=Z.div`
|
|
1414
|
+
`;let Ua=null;function Wa(e){var t,a;let o=-1;if(void 0!==window.getSelection){const n=window.getSelection();if((null==n?void 0:n.rangeCount)&&(null==n?void 0:n.rangeCount)>0){const n=null===(t=window.getSelection())||void 0===t?void 0:t.getRangeAt(0);if(n){const t=n.cloneRange();t.selectNodeContents(e),t.setEnd(n.endContainer,n.endOffset),o=Za(t.cloneContents().childNodes,o);const i=null===(a=n.endContainer.parentElement)||void 0===a?void 0:a.closest("mocka"),l=n.endContainer.nodeValue||n.endContainer.outerHTML;i&&(null==l?void 0:l.length)&&(o=o-n.endOffset+(i.outerHTML.length-(null==i?void 0:i.outerHTML.lastIndexOf(l))))}}}return o}function Za(e,t){return e.forEach(((a,o)=>{const n=o+1===e.length;if(a.nodeType===Node.ELEMENT_NODE){const e=a.outerHTML;if(!n)return void(t+=e.length);t+=e.indexOf(">")+1,t=Za(a.childNodes,t)}else a.nodeType===Node.TEXT_NODE&&(t+=(a.nodeValue||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").length)})),t}e(void 0,void 0,void 0,(function*(){if("undefined"==typeof window)return;const e=yield import("react-quill");Ua=e.default;const t=e.Quill||Ua.Quill;t.register("modules/preserveWhiteSpace",class{constructor(e,t){this.quill=e,this.options=t,e.container.style.whiteSpace="pre-line"}});const a=t.import("blots/inline");class o extends a{static create(e){if(!e)return super.create(!1);const t=super.create(e);return o.setNodeConfigurations(t,e),t}static formats(e){return!(!e.innerText||!(e.getAttribute("data-href")||e.getAttribute("data-url")||e.getAttribute("data-error")||e.getAttribute("data-bad-word")))&&{"data-bad-word":e.getAttribute("data-bad-word"),"data-error":e.getAttribute("data-error"),"data-href":e.getAttribute("data-href"),"data-url":e.getAttribute("data-url"),"data-text":e.innerText||e.getAttribute("data-href")}}static setNodeConfigurations(e,t){var a,o;t&&(null===(o=null===(a=null==t?void 0:t["data-text"])||void 0===a?void 0:a.replace(/(\ )+/g," "))||void 0===o?void 0:o.replace(/(\u200c|‌)+/g,""))&&(t["data-bad-word"]&&e.setAttribute("data-bad-word",t["data-bad-word"]),t["data-href"]&&e.setAttribute("data-href",t["data-href"]),t["data-error"]&&e.setAttribute("data-error",t["data-error"]),t["data-url"]&&e.setAttribute("data-url",t["data-url"]))}}o.blotName="mocka1",o.tagName="mocka",t.register(o);class n extends a{static create(e){if(!e)return super.create(!1);const t=super.create(e);return n.setNodeConfigurations(t,e),t}static formats(e){return!(!e.getAttribute("data-name")||!e.getAttribute("data-id"))&&{"data-name":e.getAttribute("data-name"),"data-id":e.getAttribute("data-id")}}static setNodeConfigurations(e,t){var a,o;t&&t["data-id"]&&(null===(o=null===(a=null==t?void 0:t["data-name"])||void 0===a?void 0:a.replace(/(\ )+/g," "))||void 0===o?void 0:o.replace(/(\u200c|‌)+/g,""))&&(t["data-id"]&&e.setAttribute("data-id",t["data-id"]),t["data-name"]&&e.setAttribute("data-name",t["data-name"]))}}n.blotName="mention",n.tagName="mention",t.register(n)}));const Ha=(e,t)=>{var a;const{formatUrl:o,bannedWords:n=[]}=t||{},i=e.replace(/<font [^\>]*>(.+)<\/font>/gim,((e,t)=>t.replace(/<u[^\>]*>(.+)<\/u>/gim,"$1"))).replace(wa,((e,t,a,o)=>{if(o!==a){const e=a.split(" "),n=e.findIndex(((t,a)=>{const n=e.slice(0,a+1).join(" ");return!o.startsWith(n)}));if(0===n)return`@${o}`;{const a=(n<0?e:e.slice(0,n)).join(" "),i=o.slice(a.length).trim();return console.log(n,a,i),`<mention data-id="${t}" data-name="${a}">${a}</mention> ${i} `}}return e}));if(!o)return{value:Ba(i,n)};let l=(e=>e.replace(Na,((e,t)=>{const a=document.createElement("div");a.innerHTML=e;const o=a.firstChild;return(null==o?void 0:o.innerText)!==(null==o?void 0:o.getAttribute("data-bad-word"))?t:e})))((e=>{var t,a;return null===(a=null===(t=e.replace(/(\ )+/g," "))||void 0===t?void 0:t.replace(/(\u200c|‌)+/g,""))||void 0===a?void 0:a.replace(va,((e,t,a)=>{var o;const n=null===(o=t.match(/data-href="([^"]*)"/im))||void 0===o?void 0:o[1];return!n||n===a||a.match(Ea)?a:n?`<a href="${n}">${a}</a>`:`<a href="${a}">${a}</a>`})).replace(ba,((e,t,a)=>{if('="'!==t&&'data-url="true">'!==t){const e=a.toLowerCase(),t=`${e.startsWith("http")?"":" https://"}${e}`;return Aa({text:t,url:t,method:"edit"})}return e})).replace(ka,((e,t,a)=>Aa({text:a||t,url:t,method:"edit"})))})(i));const r=(e=>{var t;return[...Pa(e),...(null===(t=e.match(va))||void 0===t?void 0:t.map((e=>{var t,a;const o=null===(t=e.match(/data-href="([^"]*)"/im))||void 0===t?void 0:t[1],n=null===(a=e.match(/>(.*?)<\/mocka>/im))||void 0===a?void 0:a[1];return o||n})))||[]].filter((e=>!!e))})(i);if(r){const e=[];let t="";return r.forEach((t=>{if(t)try{const a=new URL(t);ja.some((e=>a.origin.endsWith(e)))||e.push(t)}catch(a){e.push(t)}})),e.length>0&&(l=l.replace(new RegExp(`data-url="true">(${e.map(Sa).join("|")})<`,"gi"),'data-error="true" data-url="true">$1<').replace(new RegExp(`data-href="(${e.map(Sa).join("|")})" data-url="true">`,"gi"),'data-href="$1" data-error="true" data-url="true">')),t=null===(a=r.filter((t=>-1===e.indexOf(t))))||void 0===a?void 0:a[0],{invalidUrls:e,previewUrl:t,value:Ba(l,n)}}return{value:Ba(l,n)}},qa=({html:t,onChange:a,className:n,style:c,onImagePickerClick:m,bannedWords:p=[],onInvalidUrlsChange:u,onPreviewUrlChange:g,setEditorRef:h,isReplying:v})=>{var b,f,y,w;const x=r([]);x.current=p;const[E,C]=l([]),[k,N]=l(null),{data:{locale:A}}=i(X),L=(null==p?void 0:p.join(","))||"";s((()=>{var e,t;const a=null===(t=null===(e=F.current)||void 0===e?void 0:e.getEditor())||void 0===t?void 0:t.root.innerHTML;I(a)}),[L]);const T=e=>{k&&k.url===e||(N({url:e,isFetching:!0}),J(ee(te.FETCH_PREVIEW,{_locale:A}),"POST",{data:{link:e}}).then((t=>{var a,o,n,i;N({title:null===(a=null==t?void 0:t.data)||void 0===a?void 0:a.title,description:null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.description,image:(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.image)||(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.logo),url:e})})).catch((()=>{N(null)})))},P=r(T);P.current=T;const I=d(ze((e=>{if(e){const t=Ha(e,{bannedWords:x.current,formatUrl:!0}),{invalidUrls:o,previewUrl:n,value:i}=t;o&&C(o),n?P.current(n):N(null),i!==e&&(null==a||a(i))}}),500),[]);s((()=>{u&&u(E)}),[E]),s((()=>{g&&((null==k?void 0:k.url)?g({title:k.title||"",url:k.url||"",image:k.image||"",description:k.description||""}):g(null))}),[k]);const S=r(m);S.current=m;const M=We(),z=r({toolbar:{handlers:{image:()=>{var e;return null===(e=S.current)||void 0===e?void 0:e.call(S)},link:()=>!1},container:"#toolbar-"+M},preserveWhiteSpace:!0}),j=r(-1),F=r(null);h&&(null===(f=null===(b=F.current)||void 0===b?void 0:b.getEditor())||void 0===f?void 0:f.root)&&h(null===(w=null===(y=F.current)||void 0===y?void 0:y.getEditor())||void 0===w?void 0:w.root);const B=()=>{var e,t,a,o,n,i,l,r;if(null===(t=null===(e=F.current)||void 0===e?void 0:e.getEditor())||void 0===t?void 0:t.root){const e=Wa(null===(o=null===(a=F.current)||void 0===a?void 0:a.getEditor())||void 0===o?void 0:o.root),t=null===(i=null===(n=F.current)||void 0===n?void 0:n.getEditor())||void 0===i?void 0:i.root.innerHTML;if(e>=0&&e<t.length){if(Ia(t,!0).length<30-(v?1:0)){const e=function(e){var t,a;let o=null;if(void 0!==window.getSelection){const n=window.getSelection();if((null==n?void 0:n.rangeCount)&&(null==n?void 0:n.rangeCount)>0){const n=null===(t=window.getSelection())||void 0===t?void 0:t.getRangeAt(0);if(n){const t=n.cloneRange();t.selectNodeContents(e),t.setEnd(n.endContainer,n.endOffset);const i=(t.endContainer.nodeValue||"").substring(0,n.endOffset),l=i.lastIndexOf("@");if(l+1<i.length&&(0===l||" @"===i.slice(l-1,l+1))){const e=null===(a=i.slice(l+1))||void 0===a?void 0:a.trim();if(e){t.setStart(n.endContainer,l);const a=t.cloneRange();a.setStart(a.endContainer,l),o={name:e,rect:t.getBoundingClientRect(),replaceRange:a}}}}}}return o}(null===(r=null===(l=F.current)||void 0===l?void 0:l.getEditor())||void 0===r?void 0:r.root);e?(U(e.name,e.rect),H.current=e.replaceRange):(H.current=null,U("",null))}else H.current=null,U("",null);j.current=e}}else R([])},[O,R]=l([]),[V,D]=l({top:0,left:0}),U=d(ze(((t,a,o)=>e(void 0,void 0,void 0,(function*(){var e,n,i,l;if(!t||!DOMRect)return R([]);const r=yield((null===(e=Oe($))||void 0===e?void 0:e.length)||0)>0?ge(ee(te.SEARCH_USER,{_locale:A,name:t}),"get"):ue(ee(pe.SEARCH_USER,{_locale:A,name:t}),"get");G(0),R(null===(i=null===(n=null==r?void 0:r.data)||void 0===n?void 0:n.users)||void 0===i?void 0:i.filter((e=>!(null==o?void 0:o.includes(String(e.id))))));const s=a,c=null===(l=Z.current)||void 0===l?void 0:l.getBoundingClientRect();if(s&&c){const e=343,t=256,a={top:s.bottom-c.top,width:"min(343px, 100%)",maxHeight:t};c.width-(s.left-c.left)<e?a.right=0:a.left=s.left-c.left,D(a)}}))),500),[]),W=(e,t)=>{var a,o,n;if(H.current){H.current.deleteContents();const i=document.createElement("mention");i.setAttribute("data-id",e),i.setAttribute("data-name",t),i.innerText=t;const l=document.createTextNode(" ");H.current.insertNode(l),H.current.insertNode(i);(null===(o=null===(a=F.current)||void 0===a?void 0:a.getEditor())||void 0===o?void 0:o.root).focus();const r=null===(n=window.getSelection())||void 0===n?void 0:n.getRangeAt(0);null==r||r.setStart(H.current.endContainer,H.current.endOffset),null==r||r.setEnd(H.current.endContainer,H.current.endOffset)}R([])},Z=r(null),H=r(null),q=r(null),[_,G]=l(0);return s((()=>{if(q.current){const e=q.current,t=e.children.item(_);if(t){const a=e.getBoundingClientRect(),o=t.getBoundingClientRect();t.offsetTop<e.scrollTop?e.scrollTop=t.offsetTop:t.offsetTop+o.height>e.scrollTop+a.height&&(e.scrollTop=t.offsetTop-a.height+o.height)}}}),[_]),s((()=>{const e=function(e){var t;(null===(t=Z.current)||void 0===t?void 0:t.contains(e.target))||R([])};return window.addEventListener("click",e,{passive:!0}),()=>{window.removeEventListener("click",e)}}),[]),o.createElement(Da,{ref:Z,className:n,style:c,onKeyDownCapture:e=>{if(null==O?void 0:O.length){let t=!1;if("ArrowDown"===e.key)t=!0,G((e=>e+1>=O.length?0:e+1));else if("Escape"===e.key)t=!0,G(0),R([]);else if("ArrowUp"===e.key)t=!0,G((e=>e-1<0?O.length-1:e-1));else if("Enter"===e.key||"Tab"===e.key){const e=O[_];e&&(t=!0,W(e.id,e.name))}if(t)return e.preventDefault(),!1}}},o.createElement(_a,{id:M,onAddLink:(e,t)=>{var o,n;const i=j.current+1,l=null===(n=null===(o=F.current)||void 0===o?void 0:o.getEditor())||void 0===n?void 0:n.root.innerHTML,r=((null==l?void 0:l.substring(0,i))||"")+`<mocka data-href="${t}" data-url="true">${e}</mocka> `+((null==l?void 0:l.substring(i))||"");null==a||a(r),I(r)}}),Ua&&o.createElement(Ua,{ref:F,theme:"snow",value:t,onChange:e=>{null==a||a(e),I(e),B()},onChangeSelection:()=>{B()},modules:z.current,formats:["mocka1","mention","id","key","bold","italic","underline","list","bullet"]}),!!(null==O?void 0:O.length)&&o.createElement("div",{ref:q,className:"mention-search-container",style:V},O.map(((e,t)=>o.createElement("div",{className:"mention-search-item "+(_===t?"item-selected":""),key:e.id,onClick:t=>{t.preventDefault(),t.stopPropagation(),W(e.id,e.name)},onMouseEnter:()=>{G(t)}},o.createElement(ne,{className:"search-avatar",username:e.name,avatar:e.avatar}),o.createElement("div",null,o.createElement(Se,{size:"p2"},e.name),o.createElement(Se,{size:"p4",color:"#595959"},"@",e.username)))))))},_a=({onAddLink:e,id:t})=>o.createElement("div",{id:"toolbar-"+t,onClick:e=>{e.preventDefault(),e.stopPropagation()}},o.createElement("span",{className:"ql-formats"},o.createElement("button",{className:"ql-bold",type:"button"}),o.createElement("button",{className:"ql-italic",type:"button"}),o.createElement("button",{className:"ql-underline",type:"button"})),o.createElement("span",{className:"ql-formats"},o.createElement("button",{className:"ql-list",value:"ordered",type:"button"}),o.createElement("button",{className:"ql-list",value:"bullet",type:"button"})),o.createElement("span",{className:"ql-formats"},o.createElement("button",{className:"ql-image",type:"button"}),e&&o.createElement(ft,{className:"link-tool-wrapper",toggleButtonContent:o.createElement("img",{className:"link-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='M9.54545 16H7.09091C6.55368 16 6.02172 15.8965 5.52539 15.6955C5.02905 15.4945 4.57808 15.1999 4.1982 14.8284C3.43101 14.0783 3 13.0609 3 12C3 10.9391 3.43101 9.92172 4.1982 9.17157C4.96539 8.42143 6.00593 8 7.09091 8H9.54545M13.9256 8H16.9091C17.4463 8 17.9783 8.10346 18.4746 8.30448C18.9709 8.5055 19.4219 8.80014 19.8018 9.17157C20.1817 9.54301 20.483 9.98396 20.6886 10.4693C20.8942 10.9546 21 11.4747 21 12C21 12.5253 20.8942 13.0454 20.6886 13.5307C20.483 14.016 20.1817 14.457 19.8018 14.8284C19.4219 15.1999 18.9709 15.4945 18.4746 15.6955C17.9783 15.8965 17.4463 16 16.9091 16H13.9256' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9 12H15' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e"}),buttonProps:{size:"md",color:"transparent"},align:"end"},(({setShow:t})=>o.createElement(Qa,{onAddUrl:e,setShow:t}))))),Ga=["notification.limitUrlDomain","notification.urlWrongFormat"],Qa=({onAddUrl:e,setShow:t})=>{const{data:{env:{isMarryBaby:a}}}=i(X),{t:n}=w(),[r,s]=l(""),[c,d]=l(""),[m,p]=l(-1),u=r.trim()&&c.trim()&&m<0;return o.createElement("div",{className:"link-tool-popover"},o.createElement(Me,{name:"url",value:r,size:"md",label:"URL",placeholder:n("placeholder.enterUrlHere"),type:"text",className:"link-input-url",onChange:e=>{s(e),(e=>{const t=Fa(e.trim());try{const e=new URL(t);return e.protocol.startsWith("http")?ja.some((t=>e.origin.endsWith("/"+t)||e.origin.endsWith("."+t)))?(p(-1),!0):(p(0),!1):(p(1),!1)}catch(e){return p(1),!1}})(e)}}),m>=0&&o.createElement(Se,{size:"c2",className:"error-text"},n(Ga[m])),o.createElement(Me,{name:"text",value:c,size:"md",label:n("createPost.urlText"),placeholder:n("placeholder.enterUrlTextHere"),type:"text",className:"link-input-text",onChange:e=>d(e)}),o.createElement("div",{"data-is-marrybaby":a,className:"link-input-button-wrapper"},o.createElement(Fe,{theme:a?"marryBaby":"helloSites",size:"sm",color:"primary",className:"link-input-button",onClick:()=>{u&&(e(c.trim(),Fa(r.trim())),t&&t(!1))},isDisabled:!u},n("insert"))))};var Ka="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 Xa=({className:e,style:t,bannedWords:a=[],value:n,onChange:i,onPreviewUrlChange:c,onInvalidUrlsChange:d,onImageFilesChange:m,imageFiles:p,isReplying:u})=>{const{t:g}=w(),[h,v]=l(null),b=r(null),{onSelectImages:f,onRemoveImage:y,imageSrcs:C}=Ra(p,m);return s((()=>{c&&((null==h?void 0:h.url)?c({title:h.title||"",url:h.url||"",image:h.image||"",description:h.description||""}):c(null))}),[h]),o.createElement(Va,{className:e,style:t},o.createElement(Se,{size:"p4",className:"description-label"},g("createPost.popup.description")),o.createElement("div",{className:"textarea-control"},o.createElement("div",{className:"textarea-wrapper"},o.createElement(qa,{html:n||"",onChange:i,bannedWords:a,onImagePickerClick:()=>{var e;return null===(e=b.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:v,onInvalidUrlsChange:d,isReplying:u}))),o.createElement(Se,{size:"p4",className:"count-string"},g("character"),": ",x(n||"").length),(!C||0===C.length)&&h&&o.createElement("div",{className:"link-preview-wrapper"},h.isFetching?o.createElement(Xe,null):o.createElement(o.Fragment,null,o.createElement(Ye,{title:h.title,url:h.url||"#",image:h.image,noRefetch:!0}),o.createElement("img",{src:Ka,className:"icon-close",onClick:()=>v(null)}))),o.createElement("input",{ref:b,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:f}),C.length>he?o.createElement("div",{className:"input-notification"},o.createElement("img",{src:ha}),o.createElement(Se,{size:"p4",color:E.colors.alertWarning},g("createPost.popup.warningImage"))):null,C.length>0&&o.createElement("div",{className:"image-gallery"},C.map(((e,t)=>o.createElement("div",{key:t,className:"image-item"},o.createElement("img",{src:e}),o.createElement("img",{className:"close-btn",src:Ka,onClick:()=>y(t)}))))))},$a=Z.div`
|
|
1281
1415
|
input:focus,
|
|
1282
1416
|
textarea:focus,
|
|
1283
1417
|
[contenteditable='true'] {
|
|
@@ -1335,7 +1469,7 @@ import{a as e,_ as t}from"./tslib.es6-16065c04.js";import*as a from"react";impor
|
|
|
1335
1469
|
font-size: 11px;
|
|
1336
1470
|
text-align: right;
|
|
1337
1471
|
}
|
|
1338
|
-
`,
|
|
1472
|
+
`,Ya=(e,t)=>{if(!t)return e;const{limit:a,bannedWords:o=[]}=t,n="number"==typeof a&&a>=0?e.substring(0,a):e;return Ba(n,o)},Ja=({className:e,style:t,bannedWords:a=[],value:n,onChange:i})=>{var c;const{t:m}=w(),[p,u]=l(""),g=r(null);s((()=>{if(g.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=g.current;return t.addEventListener("paste",e,{passive:!0}),()=>t.removeEventListener("paste",e)}}),[g]);const h=(null==a?void 0:a.join(","))||"";s((()=>{var e;if(h){const t=null===(e=g.current)||void 0===e?void 0:e.innerText;if(t){const e=Ba(t,a);e!==t&&(i&&i(e),u(e))}}}),[h]);const v=d(ze((()=>{if(g.current){const e=Ya(g.current.innerText,{limit:120,bannedWords:a});i&&i(e),u(e)}}),300),[]);return s((()=>{setTimeout((()=>{var e;null===(e=g.current)||void 0===e||e.focus()}),500)}),[]),o.createElement($a,{className:e,style:t},o.createElement(Me,{name:"title",value:n||p,size:"md",label:m("createPost.title"),CustomInput:o.createElement(je,{innerRef:g,html:n||p,onChange:()=>{if(g.current&&g.current.innerText!==(n||p)){const e=Ya(g.current.innerText,{bannedWords:a});i&&i(e),u(e),v()}},className:"title-input"})}),o.createElement(Se,{size:"p4",className:"count-string"},m("createPost.popup.wordCount",{count:(null===(c=g.current)||void 0===c?void 0:c.innerText.length)||0,max:120})))},eo=Z.div`
|
|
1339
1473
|
display: flex;
|
|
1340
1474
|
width: 100%;
|
|
1341
1475
|
flex-wrap: wrap;
|
|
@@ -1384,142 +1518,7 @@ import{a as e,_ as t}from"./tslib.es6-16065c04.js";import*as a from"react";impor
|
|
|
1384
1518
|
}
|
|
1385
1519
|
}
|
|
1386
1520
|
}
|
|
1387
|
-
`,Ya=({className:t,style:a,topics:n,communityId:d,onChange:m,isLoading:p,disabled:u,forceTopics:g,selectedTopics:h,noFetch:v,dataEventCategory:b,dataEventAction:f,dataEventLabel:y})=>{const{data:{locale:w,env:{isMarryBaby:x}}}=i(X),[E,C]=l(n?[...n]:[]),[k,N]=l(h?[...h]:[]),[A,L]=l(!1),T=r(n);T.current=n,s((()=>{var t;!d||v||(null===(t=T.current)||void 0===t?void 0:t.length)||(C([]),L(!0),e(void 0,void 0,void 0,(function*(){var e;try{const t=yield J(ee(te.TOPIC.LIST,{communityId:d,_locale:w}),"GET"),a=null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.topics;Array.isArray(a)&&C((()=>(null==a?void 0:a.map(ke).sort(((e,t)=>(e.order||0)-(t.order||0))))||[]))}catch(e){console.log(e),L(!1)}L(!1)})))}),[d,v]);const P=null==n?void 0:n.map((e=>e.id)).join("-"),I=null==E?void 0:E.map((e=>e.id)).join("-"),S=null==g?void 0:g.map((e=>e.id)).join("-");s((()=>{n&&void 0!==P&&P!==I&&C(n)}),[n,P,I]);const M=c((()=>E.filter((e=>!(null==g?void 0:g.some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)))))),[I,S]);return o.createElement($a,{"data-is-marrybaby":x,className:t,style:a},g.map((e=>o.createElement(Ja,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:!0,selected:!0,dataEventAction:f,dataEventCategory:b,dataEventLabel:y}))),M.map((e=>o.createElement(Ja,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:u,selected:(h||k).some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)),onClick:()=>{const t=h||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),m&&h?m(t.slice()):(m&&m(t.slice()),N(t.slice()))},dataEventAction:f,dataEventCategory:b,dataEventLabel:y}))),(p||A)&&o.createElement(Xe,{className:"topic-spinner"}))},Ja=e=>{var{topic:a,disabled:n,selected:i,onClick:l}=e,r=t(e,["topic","disabled","selected","onClick"]);return o.createElement("div",Object.assign({className:"tag-item"+(i?" --active":""),"data-disabled":n,onClick:n?void 0:l},r),a.name)},eo=Z.div`
|
|
1388
|
-
position: relative;
|
|
1389
|
-
display: flex;
|
|
1390
|
-
height: 100%;
|
|
1391
|
-
flex-direction: column;
|
|
1392
|
-
padding: 16px 24px;
|
|
1393
|
-
|
|
1394
|
-
.input-group-container {
|
|
1395
|
-
flex: 1;
|
|
1396
|
-
padding-right: 2px;
|
|
1397
|
-
padding-left: 2px;
|
|
1398
|
-
margin-bottom: 0.5rem;
|
|
1399
|
-
-ms-overflow-style: none; /* IE and Edge */
|
|
1400
|
-
overflow-y: auto;
|
|
1401
|
-
scrollbar-width: none; /* Firefox */
|
|
1402
|
-
&::-webkit-scrollbar {
|
|
1403
|
-
display: none;
|
|
1404
|
-
}
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
.input-group {
|
|
1408
|
-
:not(:last-child) {
|
|
1409
|
-
margin-bottom: 0.6rem;
|
|
1410
|
-
}
|
|
1411
|
-
|
|
1412
|
-
input:focus,
|
|
1413
|
-
textarea:focus,
|
|
1414
|
-
[contenteditable='true'] {
|
|
1415
|
-
outline: none;
|
|
1416
|
-
}
|
|
1417
|
-
|
|
1418
|
-
label {
|
|
1419
|
-
margin-bottom: 5px;
|
|
1420
|
-
color: ${e=>e.theme.colors.gray600};
|
|
1421
|
-
/* font-family: 'Open Sans', sans-serif; */
|
|
1422
|
-
font-size: 13px;
|
|
1423
|
-
font-weight: bold;
|
|
1424
|
-
}
|
|
1425
|
-
|
|
1426
|
-
.input-group-label {
|
|
1427
|
-
margin-bottom: 5px;
|
|
1428
|
-
color: ${e=>e.theme.colors.gray600};
|
|
1429
|
-
/* font-family: 'Open Sans', sans-serif; */
|
|
1430
|
-
font-size: 13px;
|
|
1431
|
-
font-weight: bold;
|
|
1432
|
-
}
|
|
1433
|
-
|
|
1434
|
-
.input-notification {
|
|
1435
|
-
display: flex;
|
|
1436
|
-
|
|
1437
|
-
& > img {
|
|
1438
|
-
width: 16px;
|
|
1439
|
-
height: 16px;
|
|
1440
|
-
margin-top: 1.5px;
|
|
1441
|
-
margin-right: 8px;
|
|
1442
|
-
}
|
|
1443
|
-
}
|
|
1444
|
-
|
|
1445
|
-
.tag-list {
|
|
1446
|
-
}
|
|
1447
|
-
}
|
|
1448
|
-
|
|
1449
|
-
.warning {
|
|
1450
|
-
margin-top: 16px;
|
|
1451
|
-
}
|
|
1452
|
-
|
|
1453
|
-
.submit-btn {
|
|
1454
|
-
width: 100%;
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
.switch-label {
|
|
1458
|
-
display: flex;
|
|
1459
|
-
align-items: center;
|
|
1460
|
-
}
|
|
1461
|
-
|
|
1462
|
-
.swich-input-group {
|
|
1463
|
-
padding: 12px 16px;
|
|
1464
|
-
border-radius: 8px;
|
|
1465
|
-
background: ${E.colors.neutral50};
|
|
1466
|
-
|
|
1467
|
-
&.askdoctor-switch {
|
|
1468
|
-
background: ${E.colors.primary50};
|
|
1469
|
-
&.mb-color {
|
|
1470
|
-
background: ${E.mbColors.tonePink};
|
|
1471
|
-
}
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
.mantine-Switch-labelWrapper {
|
|
1475
|
-
flex-grow: 1;
|
|
1476
|
-
}
|
|
1477
|
-
.mantine-Checkbox-body {
|
|
1478
|
-
display: flex;
|
|
1479
|
-
width: 100%;
|
|
1480
|
-
align-items: center;
|
|
1481
|
-
justify-content: space-between;
|
|
1482
|
-
}
|
|
1483
|
-
.mantine-Switch-track {
|
|
1484
|
-
margin-bottom: 0;
|
|
1485
|
-
}
|
|
1486
|
-
.label-txt {
|
|
1487
|
-
font-weight: normal;
|
|
1488
|
-
font-size: 14px;
|
|
1489
|
-
color: ${E.colors.gray800};
|
|
1490
|
-
margin-left: 10px;
|
|
1491
|
-
}
|
|
1492
|
-
}
|
|
1493
|
-
`,to=Z.div`
|
|
1494
|
-
display: flex;
|
|
1495
|
-
width: 100%;
|
|
1496
|
-
align-items: center;
|
|
1497
|
-
justify-content: space-between;
|
|
1498
|
-
padding: 12px 16px;
|
|
1499
|
-
border-radius: 8px;
|
|
1500
|
-
background: ${E.colors.primary50};
|
|
1501
|
-
|
|
1502
|
-
&[data-is-marry-baby='true'] {
|
|
1503
|
-
background: ${E.mbColors.tonePink};
|
|
1504
|
-
}
|
|
1505
|
-
.switch-label {
|
|
1506
|
-
display: flex;
|
|
1507
|
-
align-items: center;
|
|
1508
|
-
gap: 12px;
|
|
1509
|
-
}
|
|
1510
|
-
margin-bottom: 12px;
|
|
1511
|
-
`,ao=Z.div`
|
|
1512
|
-
margin-bottom: 12px;
|
|
1513
|
-
color: ${E.colors.red700};
|
|
1514
|
-
svg {
|
|
1515
|
-
margin-right: 5px;
|
|
1516
|
-
}
|
|
1517
|
-
svg,
|
|
1518
|
-
span {
|
|
1519
|
-
display: inline-block;
|
|
1520
|
-
vertical-align: middle;
|
|
1521
|
-
}
|
|
1522
|
-
`,oo=({className:t,style:a,onPostCreatedEdited:n,onClose:r,communities:c=[],forceSelectCommunity:d,forceSelectTopics:m,articleId:p,optionalTopic:u,editPostData:h,defaultCommunity:v,defaultTopics:b,noFetchTopic:f,hideTopicList:C,selectAskDoctor:k,showAskDoctorOptions:N,currentPageUrl:L})=>{const T=!!(null==h?void 0:h.id),{data:{locale:M,env:{isMarryBaby:z}},action:{pushNotifications:j,sanitizeFunction:F}}=i(X),{t:B}=w(),[O,R]=l(!1),[D,U]=l(k),[W,Z]=l(!1),[H,q]=l(!1),[_,G]=l(""),[K,$]=l(""),[Y,J]=l(d?{label:d.name,value:`${d.id||""}-${d.mappedCategoryId||""}`}:{label:B("community.choose"),value:""}),[ae,oe]=l([...m]||[]),[ne,ie]=l([]),[le,re]=l([]),se=d||c.find((e=>`${e.id||""}-${e.mappedCategoryId||""}`===Y.value)),ce=d?[d]:c.filter((e=>e.isActive)).sort(((e,t)=>e.name>t.name?1:e.name<t.name?-1:0)),[de,me]=l(null),[pe,ue]=l([]),ve=_&&x(K)&&(u||!u&&ae.length>0)&&se&&(!ne||ne.length<=he)&&!(null==pe?void 0:pe.length)&&!H;s((()=>{if(h){const e=h;G(e.title||""),$(Na(ka(e.description||"","edit"),e.mentions)),J({label:e.community.name,value:`${e.community.id||""}-${e.community.mappedCategoryId||""}`}),oe(e.topics||[]),ie(e.photos||[]),R(!!e.isAnonymous||!1),U(!!e.isAskDoctor||!1)}else v&&J({label:v.name,value:`${v.id||""}-${v.mappedCategoryId||""}`}),b&&oe(b)}),[]);const be=()=>e(void 0,void 0,void 0,(function*(){var t,a,o,i,l,s,c,d,m;if(N&&void 0===D)return Z(!0),!1;const u=yield(({title:t,description:a,communityId:o,imageFiles:n,previewUrl:i,topicIds:l,locale:r,sanitizeFunction:s,categoryCommunityId:c,categoryTopicIds:d,introUrl:m,bannerUrl:p,scheduleTime:u,isAnonymous:g,isAskDoctor:h})=>e(void 0,void 0,void 0,(function*(){const e=new FormData,v=Pa(a),b=Pa(t),f=La(v);if(e.append("title",b),e.append("description",Ia(v,s)),c?e.append("category_community",String(c)):o&&e.append("community_id",String(o)),e.append("is_anonymous",g?"1":"0"),e.append("is_question",h?"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",Q(i.url)),(null==i?void 0:i.image)&&e.append("preview_image",Q(i.image)),null==l||l.forEach((t=>{e.append("topics[]",String(t||""))})),null==d||d.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(ja(e,r))}),2e3*t)})))));null==t||t.filter(Boolean).slice(0,he).forEach(((t,a)=>{e.append(`images[${a}]`,t)}))}else e.append("images","");return null==f||f.forEach((t=>{e.append("mention_ids[]",t)})),e.append("intro_url",m||""),e.append("banner",p||""),u&&(e.append("post_type","scheduled"),e.append("schedule_datetime",u)),e})))({title:_,description:K,communityId:String((null==se?void 0:se.id)||""),imageFiles:ne,previewUrl:de,topicIds:null==ae?void 0:ae.map((e=>String(e.id||""))).filter(Boolean),locale:M,sanitizeFunction:F,categoryCommunityId:String((null==se?void 0:se.mappedCategoryId)||""),categoryTopicIds:null==ae?void 0:ae.map((e=>String(e.mappedCategoryId||""))).filter(Boolean),isAnonymous:O?1:0,isAskDoctor:D?1:0});let g;p&&u.append("article_id",p),T?(null==h?void 0:h.id)&&(g=yield(({id:t,locale:a,formData:o})=>e(void 0,void 0,void 0,(function*(){return yield ge(ee(te.POST.UPDATE,{id:t,_locale:a}),"POST",{data:o})})))({id:h.id,formData:u,locale:M})):g=yield(({locale:t,formData:a,isArticleComment:o})=>e(void 0,void 0,void 0,(function*(){return yield ge(ee(o?te.POST.CREATE_ARTICLE_COMMENT:te.POST.CREATE,{_locale:t}),"POST",{data:a})})))({formData:u,locale:M,isArticleComment:!(null==se?void 0:se.id)&&!!(null==se?void 0:se.mappedCategoryId)});const v=null==g?void 0:g.data;(null==v?void 0:v.id)&&!(null===(a=null===(t=null==g?void 0:g.messages)||void 0===t?void 0:t.moderation)||void 0===a?void 0:a.type)?(j({message:B("createPost.popup.success"),type:"success"}),(e=>{n&&n(Ne(e),T),r&&r()})(v)):"banned"===(null===(i=null===(o=null==g?void 0:g.messages)||void 0===o?void 0:o.moderation)||void 0===i?void 0:i.type)?(j({title:B("notification.post.blocked.title"),message:B("notification.post.blocked.message"),type:"danger"}),g.messages.moderation.words&&re(g.messages.moderation.words)):"suspect"===(null===(s=null===(l=null==g?void 0:g.messages)||void 0===l?void 0:l.moderation)||void 0===s?void 0:s.type)?(j({title:B("notification.post.suspect.title"),message:B("notification.post.suspect.message"),type:"warning"}),r&&r()):(null===(d=null===(c=null==g?void 0:g.messages)||void 0===c?void 0:c.find)||void 0===d?void 0:d.call(c,(e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(j({message:B("notification.suspend.message"),type:"danger"}),r&&r()):j({message:(null===(m=null==g?void 0:g.messages)||void 0===m?void 0:m[0])||B("notification.failure"),type:"danger"})}));return o.createElement(eo,{className:t,style:a},o.createElement("div",{className:"input-group-container"},o.createElement(Xa,{className:"input-group",bannedWords:le,value:_,onChange:G}),o.createElement(Ga,{className:"input-group",bannedWords:le,value:K,onChange:$,onPreviewUrlChange:me,onInvalidUrlsChange:ue,onImageFilesChange:ie,imageFiles:ne}),N&&o.createElement(to,{"data-is-marry-baby":z},o.createElement("div",{className:"switch-label"},o.createElement(P,{isMarryBaby:z,size:z?32:24,color:E.colors.primaryBase,className:"label-icon"}),o.createElement("span",{className:"label-txt"},B("createPost.askDoctor"))),o.createElement(Ee,{value:D,choices:[{label:B("createPost.askDoctorChoice.yes"),value:!0,dataEventCategory:"Together",dataEventAction:"Write Post Click - Ask Doctor",dataEventLabel:L},{label:B("createPost.askDoctorChoice.no"),value:!1}],onChange:e=>{"boolean"==typeof e&&(Z(!1),U(e))}})),W&&o.createElement(ao,null,o.createElement(I,{isSolid:!0,color:E.colors.red700,size:14}),o.createElement(A,{size:"p3",as:"span",color:E.colors.red700},B("createPost.message.askDoctorRequire"))),o.createElement("div",{className:"input-group"},o.createElement(A,{size:"p4",className:"input-group-label"},B("admin.community")),o.createElement(y,{options:(null==ce?void 0:ce.map((e=>({label:e.name,value:`${e.id||""}-${e.mappedCategoryId||""}`}))))||[],id:"community-picker",placeholder:B("community.choose"),value:Y,dropdownLabelTrackingAttributes:{"data-event-category":"Together","data-event-action":"Write Post Click - Choose Community/Topic","data-event-label":L},onChange:e=>{J({label:e.label,value:String(e.value)}),oe([])},disabled:!!d}),o.createElement(A,{size:"sm",className:"warning",color:E.colors.gray400},"* ",B("commentPopup.warning.newPost"))),!C&&o.createElement("div",{className:"input-group"},o.createElement(A,{size:"p4",className:"input-group-label"},B("tab.topic")),o.createElement("div",{className:"input-notification"},o.createElement("img",{src:se?"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":pa}),o.createElement(A,{size:"base",color:E.colors.gray500},B(se?"createPost.popup.primary":"createPost.popup.warning"))),se&&o.createElement(Ya,{className:"tag-list",communityId:se.id,forceTopics:m,onChange:oe,selectedTopics:ae,noFetch:f,dataEventCategory:"Together",dataEventAction:"Write Post Click - Choose Community/Topic",dataEventLabel:L}))),o.createElement("div",{className:"form-action"},o.createElement("div",{className:"input-group"},o.createElement(g,{className:"swich-input-group",labelPosition:"left",name:"PostAnonymous",checked:O,color:z?"pink":void 0,"data-event-category":"Together","data-event-action":"Write Post Click - Incognito","data-event-label":L,label:o.createElement("div",{className:"switch-label"},o.createElement("img",{className:"label-icon",src:V.getAssetPath("anomyous-avatar.svg"),alt:"anomyous avatar",style:{marginRight:"10px",width:"24px"}}),o.createElement("span",{className:"label-txt"},B("createPost.postAnonymous"))),value:"Post Anonymous",onChange:e=>R(e.currentTarget.checked),styles:{body:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},label:{display:"flex",alignItems:"center"}}})),o.createElement("div",{className:"input-group"},o.createElement(S,{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(void 0,void 0,void 0,(function*(){if(ve&&!H){q(!0);try{yield be()}catch(e){console.error(e),j(ma(B))}q(!1)}})),disabled:!ve,loading:H},B("createPost.popup.submit")))))},no=Z.div`
|
|
1521
|
+
`,to=({className:t,style:a,topics:n,communityId:d,onChange:m,isLoading:p,disabled:u,forceTopics:g,selectedTopics:h,noFetch:v,dataEventCategory:b,dataEventAction:f,dataEventLabel:y})=>{const{data:{locale:w,env:{isMarryBaby:x}}}=i(X),[E,C]=l(n?[...n]:[]),[k,N]=l(h?[...h]:[]),[A,L]=l(!1),T=r(n);T.current=n,s((()=>{var t;!d||v||(null===(t=T.current)||void 0===t?void 0:t.length)||(C([]),L(!0),e(void 0,void 0,void 0,(function*(){var e;try{const t=yield J(ee(te.TOPIC.LIST,{communityId:d,_locale:w}),"GET"),a=null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.topics;Array.isArray(a)&&C((()=>(null==a?void 0:a.map(ke).sort(((e,t)=>(e.order||0)-(t.order||0))))||[]))}catch(e){console.log(e),L(!1)}L(!1)})))}),[d,v]);const P=null==n?void 0:n.map((e=>e.id)).join("-"),I=null==E?void 0:E.map((e=>e.id)).join("-"),S=null==g?void 0:g.map((e=>e.id)).join("-");s((()=>{n&&void 0!==P&&P!==I&&C(n)}),[n,P,I]);const M=c((()=>E.filter((e=>!(null==g?void 0:g.some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)))))),[I,S]);return o.createElement(eo,{"data-is-marrybaby":x,className:t,style:a},g.map((e=>o.createElement(ao,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:!0,selected:!0,dataEventAction:f,dataEventCategory:b,dataEventLabel:y}))),M.map((e=>o.createElement(ao,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:u,selected:(h||k).some((t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId)),onClick:()=>{const t=h||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),m&&h?m(t.slice()):(m&&m(t.slice()),N(t.slice()))},dataEventAction:f,dataEventCategory:b,dataEventLabel:y}))),(p||A)&&o.createElement(Xe,{className:"topic-spinner"}))},ao=e=>{var{topic:a,disabled:n,selected:i,onClick:l}=e,r=t(e,["topic","disabled","selected","onClick"]);return o.createElement("div",Object.assign({className:"tag-item"+(i?" --active":""),"data-disabled":n,onClick:n?void 0:l},r),a.name)},oo=({className:t,style:a,onPostCreatedEdited:n,onClose:r,communities:c=[],forceSelectCommunity:d,forceSelectTopics:m,articleId:p,optionalTopic:u,editPostData:h,defaultCommunity:v,defaultTopics:b,noFetchTopic:f,hideTopicList:C,selectAskDoctor:k,showAskDoctorOptions:N,currentPageUrl:L})=>{const T=!!(null==h?void 0:h.id),{data:{locale:M,env:{isMarryBaby:z}},action:{pushNotifications:j,sanitizeFunction:F}}=i(X),{t:B}=w(),[O,R]=l(!1),[D,U]=l(k),[W,Z]=l(!1),[H,q]=l(!1),[_,G]=l(!1),[K,$]=l(""),[Y,J]=l(""),[ae,oe]=l(d?{label:d.name,value:`${d.id||""}-${d.mappedCategoryId||""}`}:{label:B("community.choose"),value:""}),[ne,ie]=l([...m]||[]),[le,re]=l([]),[se,ce]=l([]),de=d||c.find((e=>`${e.id||""}-${e.mappedCategoryId||""}`===ae.value)),me=d?[d]:c.filter((e=>e.isActive)).sort(((e,t)=>e.name>t.name?1:e.name<t.name?-1:0)),[pe,ue]=l(null),[ve,be]=l([]),fe=K&&!H&&x(Y)&&(u||!u&&ne.length>0)&&de&&(!le||le.length<=he)&&!(null==ve?void 0:ve.length)&&!_;s((()=>{if(h){const e=h;$(e.title||""),J(Ta(La(e.description||"","edit"),e.mentions)),oe({label:e.community.name,value:`${e.community.id||""}-${e.community.mappedCategoryId||""}`}),ie(e.topics||[]),re(e.photos||[]),R(!!e.isAnonymous||!1),U(!!e.isAskDoctor||!1)}else v&&oe({label:v.name,value:`${v.id||""}-${v.mappedCategoryId||""}`}),b&&ie(b)}),[]),s((()=>{q(""!==K&&!/[a-zA-Z]/.test(K))}),[K]);const ye=()=>e(void 0,void 0,void 0,(function*(){var t,a,o,i,l,s,c,d,m;if(N&&void 0===D)return Z(!0),!1;const u=yield(({title:t,description:a,communityId:o,imageFiles:n,previewUrl:i,topicIds:l,locale:r,sanitizeFunction:s,categoryCommunityId:c,categoryTopicIds:d,introUrl:m,bannerUrl:p,scheduleTime:u,isAnonymous:g,isAskDoctor:h})=>e(void 0,void 0,void 0,(function*(){const e=new FormData,v=Ma(a),b=Ma(t),f=Ia(v);if(e.append("title",b),e.append("description",za(v,s)),c?e.append("category_community",String(c)):o&&e.append("community_id",String(o)),e.append("is_anonymous",g?"1":"0"),e.append("is_question",h?"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",Q(i.url)),(null==i?void 0:i.image)&&e.append("preview_image",Q(i.image)),null==l||l.forEach((t=>{e.append("topics[]",String(t||""))})),null==d||d.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(Oa(e,r))}),2e3*t)})))));null==t||t.filter(Boolean).slice(0,he).forEach(((t,a)=>{e.append(`images[${a}]`,t)}))}else e.append("images","");return null==f||f.forEach((t=>{e.append("mention_ids[]",t)})),e.append("intro_url",m||""),e.append("banner",p||""),u&&(e.append("post_type","scheduled"),e.append("schedule_datetime",u)),e})))({title:K,description:Y,communityId:String((null==de?void 0:de.id)||""),imageFiles:le,previewUrl:pe,topicIds:null==ne?void 0:ne.map((e=>String(e.id||""))).filter(Boolean),locale:M,sanitizeFunction:F,categoryCommunityId:String((null==de?void 0:de.mappedCategoryId)||""),categoryTopicIds:null==ne?void 0:ne.map((e=>String(e.mappedCategoryId||""))).filter(Boolean),isAnonymous:O?1:0,isAskDoctor:D?1:0});let g;p&&u.append("article_id",p),T?(null==h?void 0:h.id)&&(g=yield(({id:t,locale:a,formData:o})=>e(void 0,void 0,void 0,(function*(){return yield ge(ee(te.POST.UPDATE,{id:t,_locale:a}),"POST",{data:o})})))({id:h.id,formData:u,locale:M})):g=yield(({locale:t,formData:a,isArticleComment:o})=>e(void 0,void 0,void 0,(function*(){return yield ge(ee(o?te.POST.CREATE_ARTICLE_COMMENT:te.POST.CREATE,{_locale:t}),"POST",{data:a})})))({formData:u,locale:M,isArticleComment:!(null==de?void 0:de.id)&&!!(null==de?void 0:de.mappedCategoryId)});const v=null==g?void 0:g.data;(null==v?void 0:v.id)&&!(null===(a=null===(t=null==g?void 0:g.messages)||void 0===t?void 0:t.moderation)||void 0===a?void 0:a.type)?(j({message:B("createPost.popup.success"),type:"success"}),(e=>{n&&n(Ne(e),T),r&&r()})(v)):"banned"===(null===(i=null===(o=null==g?void 0:g.messages)||void 0===o?void 0:o.moderation)||void 0===i?void 0:i.type)?(j({title:B("notification.post.blocked.title"),message:B("notification.post.blocked.message"),type:"danger"}),g.messages.moderation.words&&ce(g.messages.moderation.words)):"suspect"===(null===(s=null===(l=null==g?void 0:g.messages)||void 0===l?void 0:l.moderation)||void 0===s?void 0:s.type)?(j({title:B("notification.post.suspect.title"),message:B("notification.post.suspect.message"),type:"warning"}),r&&r()):(null===(d=null===(c=null==g?void 0:g.messages)||void 0===c?void 0:c.find)||void 0===d?void 0:d.call(c,(e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(j({message:B("notification.suspend.message"),type:"danger"}),r&&r()):j({message:(null===(m=null==g?void 0:g.messages)||void 0===m?void 0:m[0])||B("notification.failure"),type:"danger"})}));return o.createElement(pa,{className:t,style:a},o.createElement("div",{className:"input-group-container"},o.createElement(Ja,{className:"input-group",bannedWords:se,value:K,onChange:$}),H&&o.createElement(ga,null,o.createElement(P,{isSolid:!0,color:E.colors.red700,size:14}),o.createElement(A,{size:"p3",as:"span",color:E.colors.red700},B("createPost.popup.specialCharErr"))),o.createElement(Xa,{className:"input-group",bannedWords:se,value:Y,onChange:J,onPreviewUrlChange:ue,onInvalidUrlsChange:be,onImageFilesChange:re,imageFiles:le}),N&&o.createElement(ua,{"data-is-marry-baby":z},o.createElement("div",{className:"switch-label"},o.createElement(I,{isMarryBaby:z,size:z?32:24,color:E.colors.primaryBase,className:"label-icon"}),o.createElement("span",{className:"label-txt"},B("createPost.askDoctor"))),o.createElement(Ee,{value:D,choices:[{label:B("createPost.askDoctorChoice.yes"),value:!0,dataEventCategory:"Together",dataEventAction:"Write Post Click - Ask Doctor",dataEventLabel:L},{label:B("createPost.askDoctorChoice.no"),value:!1}],onChange:e=>{"boolean"==typeof e&&(Z(!1),U(e))}})),W&&o.createElement(ga,null,o.createElement(P,{isSolid:!0,color:E.colors.red700,size:14}),o.createElement(A,{size:"p3",as:"span",color:E.colors.red700},B("createPost.message.askDoctorRequire"))),o.createElement("div",{className:"input-group"},o.createElement(A,{size:"p4",className:"input-group-label"},B("admin.community")),o.createElement(y,{options:(null==me?void 0:me.map((e=>({label:e.name,value:`${e.id||""}-${e.mappedCategoryId||""}`}))))||[],id:"community-picker",placeholder:B("community.choose"),value:ae,dropdownLabelTrackingAttributes:{"data-event-category":"Together","data-event-action":"Write Post Click - Choose Community/Topic","data-event-label":L},onChange:e=>{oe({label:e.label,value:String(e.value)}),ie([])},disabled:!!d}),o.createElement(A,{size:"sm",className:"warning",color:E.colors.gray400},"* ",B("commentPopup.warning.newPost"))),!C&&o.createElement("div",{className:"input-group"},o.createElement(A,{size:"p4",className:"input-group-label"},B("tab.topic")),o.createElement("div",{className:"input-notification"},o.createElement("img",{src:de?"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":ha}),o.createElement(A,{size:"base",color:E.colors.gray500},B(de?"createPost.popup.primary":"createPost.popup.warning"))),de&&o.createElement(to,{className:"tag-list",communityId:de.id,forceTopics:m,onChange:ie,selectedTopics:ne,noFetch:f,dataEventCategory:"Together",dataEventAction:"Write Post Click - Choose Community/Topic",dataEventLabel:L}))),o.createElement("div",{className:"form-action"},o.createElement("div",{className:"input-group"},o.createElement(g,{className:"swich-input-group",labelPosition:"left",name:"PostAnonymous",checked:O,color:z?"pink":void 0,"data-event-category":"Together","data-event-action":"Write Post Click - Incognito","data-event-label":L,label:o.createElement("div",{className:"switch-label"},o.createElement("img",{className:"label-icon",src:V.getAssetPath("anomyous-avatar.svg"),alt:"anomyous avatar",style:{marginRight:"10px",width:"24px"}}),o.createElement("span",{className:"label-txt"},B("createPost.postAnonymous"))),value:"Post Anonymous",onChange:e=>R(e.currentTarget.checked),styles:{body:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},label:{display:"flex",alignItems:"center"}}})),o.createElement("div",{className:"input-group"},o.createElement(S,{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(void 0,void 0,void 0,(function*(){if(fe&&!_){G(!0);try{yield ye()}catch(e){console.error(e),j(ma(B))}G(!1)}})),disabled:!fe,loading:_},B("createPost.popup.submit")))))},no=Z.div`
|
|
1523
1522
|
[data-type='confirm'] {
|
|
1524
1523
|
width: min(360px, 100%);
|
|
1525
1524
|
height: auto;
|
|
@@ -1975,7 +1974,7 @@ import{a as e,_ as t}from"./tslib.es6-16065c04.js";import*as a from"react";impor
|
|
|
1975
1974
|
}
|
|
1976
1975
|
}
|
|
1977
1976
|
}
|
|
1978
|
-
`,po=n({});const uo=({isReply:t,className:a,onClose:n,replyToName:c,style:d,replyingId:m,replyingUser:p,onPostSuccess:u,post:g,isMarryBaby:h})=>{const{action:{pushNotifications:v,sanitizeFunction:b},data:{userInfo:f,locale:y,env:{isMarryBaby:x}}}=i(X),E="boolean"==typeof h?h:x,{t:C}=w(),{onSelectImages:k,onRemoveImage:N,imageSrcs:A,onRemoveAllImages:L,imageFiles:T}=
|
|
1977
|
+
`,po=n({});const uo=({isReply:t,className:a,onClose:n,replyToName:c,style:d,replyingId:m,replyingUser:p,onPostSuccess:u,post:g,isMarryBaby:h})=>{const{action:{pushNotifications:v,sanitizeFunction:b},data:{userInfo:f,locale:y,env:{isMarryBaby:x}}}=i(X),E="boolean"==typeof h?h:x,{t:C}=w(),{onSelectImages:k,onRemoveImage:N,imageSrcs:A,onRemoveAllImages:L,imageFiles:T}=Ra(),[P,I]=l(""),{trigger:S}=i(po),[M,z]=l(!1),j=r(null),F=r(null),B=r(null),[O,R]=l([]),[V,D]=l([]),[U,W]=l(null);return s((()=>{var e;null===(e=B.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout((()=>{var e;null===(e=F.current)||void 0===e||e.focus()}),400)}),[S]),o.createElement(mo,{"data-is-reply":t,className:a,style:d},t&&o.createElement("div",{className:"reply-to-container"},o.createElement(Se,{size:"p4"},o.createElement("span",{dangerouslySetInnerHTML:{__html:C("inputComment.replyTo",{name:`<span style="color: #2D87F3; cursor: pointer">@${c||""}</span>`})}})),o.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:()=>n&&n()})),o.createElement("div",{className:"input-container",ref:B},o.createElement(ne,{className:"avatar-wrapper "+(t?"avatar-wrapper-reply":""),avatar:(null==f?void 0:f.id)?f.avatar:ve,username:(null==f?void 0:f.name)||(null==f?void 0:f.username)}),o.createElement("input",{ref:j,onChange:k,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),o.createElement(Me,{value:P,name:"input",size:"md",className:"input-wrapper",displayIcon:o.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"}),CustomInput:o.createElement("div",{className:"as-input"},o.createElement(qa,{className:"textarea",html:P,onChange:I,onImagePickerClick:()=>{var e;return null===(e=j.current)||void 0===e?void 0:e.click()},bannedWords:V,onPreviewUrlChange:W,onInvalidUrlsChange:R,setEditorRef:e=>F.current=e,isReplying:t}))}),o.createElement(Fe,{theme:E?"marryBaby":"helloSites",className:"send-button",size:"sm",onClick:()=>e(void 0,void 0,void 0,(function*(){var a,o,i,l,r,s,c,d,h;if((null==g?void 0:g.id)&&!M){z(!0);try{const f=e=>{I(""),L(),n&&n();const t=Le(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),u&&u(t)},w=yield(({postId:t,message:a,photos:o,link:n,locale:i,sanitizeFunction:l,replyingUserId:r,replyingUserName:s,replyingId:c})=>e(void 0,void 0,void 0,(function*(){const e=new FormData;let d=za(a.replace(/(\ )+/g," "),l);const m=Ia(d);return o&&o.length>0&&(yield Promise.all(null==o?void 0:o.map((e=>Oa(e,i))))).filter(Boolean).slice(0,he).forEach((t=>{e.append("images[]",t)})),n&&e.append("link",n),null==m||m.forEach((t=>{e.append("mention_ids[]",t)})),e.append("post_id",t),c&&e.append("parent_id",c),r&&(m.unshift(r),d=`[mention+id="${r}"+name="${(s||"").replace('"',"'")}"]${d}`,e.append("parent_user_id",String(r))),e.append("content",d),e.append("content",d),e})))(Object.assign({message:P,photos:T,postId:String(g.id),link:null==U?void 0:U.url,sanitizeFunction:b,locale:y},t&&m?{replyingUserId:String((null==p?void 0:p.id)||(null===(a=null==g?void 0:g.author)||void 0===a?void 0:a.id)||""),replyingId:m,replyingUserName:(null==p?void 0:p.name)||(null==p?void 0:p.username)||""}:{})),x=yield t&&m?((t,a)=>e(void 0,void 0,void 0,(function*(){return ge(ee(te.COMMENT.REPLY,{_locale:a}),"POST",{data:t})})))(w,y):((t,a)=>e(void 0,void 0,void 0,(function*(){return ge(ee(te.COMMENT.CREATE,{_locale:a}),"POST",{data:t})})))(w,y),E=null==x?void 0:x.data;(null==E?void 0:E.id)&&!(null===(i=null===(o=null==x?void 0:x.messages)||void 0===o?void 0:o.moderation)||void 0===i?void 0:i.type)?f(x):"banned"===(null===(r=null===(l=null==x?void 0:x.messages)||void 0===l?void 0:l.moderation)||void 0===r?void 0:r.type)?(v({title:C("notification.comment.blocked.title"),message:C("notification.comment.blocked.message"),type:"danger"}),x.messages.moderation.words&&D(x.messages.moderation.words)):"suspect"===(null===(c=null===(s=null==x?void 0:x.messages)||void 0===s?void 0:s.moderation)||void 0===c?void 0:c.type)?(v({title:C("notification.comment.suspect.title"),message:C("notification.comment.suspect.message"),type:"warning"}),I(""),L(),n&&n()):(null===(d=null==x?void 0:x.messages)||void 0===d?void 0:d.find((e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(v({message:C("notification.suspend.message"),type:"warning"}),I(""),L(),n&&n()):v({title:"",message:(null===(h=null==x?void 0:x.messages)||void 0===h?void 0:h[0])||C("notification.comment.somethingWrong"),type:"danger"})}catch(e){v({title:"",message:C("notification.comment.somethingWrong"),type:"danger"})}z(!1)}})),isLoading:M,isDisabled:!!(null==O?void 0:O.length)||M||!P||(null==P?void 0:P.length)<2||!P.trim()},o.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"}))),(null==O?void 0:O.length)?o.createElement("div",{className:"error-text"},C("notification.limitUrlDomain")):null,(!A||0===A.length)&&U&&o.createElement("div",{className:"link-preview-wrapper"},U.isFetching?o.createElement(Xe,null):o.createElement(o.Fragment,null,o.createElement(Ye,{title:U.title,url:U.url||"#",image:U.image,noRefetch:!0}),o.createElement("img",{src:Ka,className:"icon-close",onClick:()=>W(null)}))),A&&A.length>0&&o.createElement("div",{className:"preview-images-container"},A.map(((e,t)=>o.createElement("div",{key:t,className:"image-src-wrapper"},o.createElement("img",{className:"preview-image",src:e}),o.createElement("img",{src:Ka,className:"icon-close-circle",onClick:()=>N(t)}))))))},go=Z.a`
|
|
1979
1978
|
* {
|
|
1980
1979
|
pointer-events: none;
|
|
1981
1980
|
}
|
|
@@ -2290,7 +2289,7 @@ import{a as e,_ as t}from"./tslib.es6-16065c04.js";import*as a from"react";impor
|
|
|
2290
2289
|
}
|
|
2291
2290
|
}
|
|
2292
2291
|
}
|
|
2293
|
-
`;var Co=p((e=>({root:{mention:{color:e.fn.primaryColor()},a:{"&,&:visited,&:focus":{color:e.fn.primaryColor()}},".create-post-link":{display:"inline",color:e.fn.primaryColor(),cursor:"pointer"}}})));const ko=e=>{var{trackingCategory:a,url:n,className:d,style:m,replyingTo:p,mentionedUser:u,description:g,disableShortenContent:h,mentions:b=[],maxChars:f=1e3,hideShowAllBtn:y,styles:x,onClickCreatePostLink:E}=e,C=t(e,["trackingCategory","url","className","style","replyingTo","mentionedUser","description","disableShortenContent","mentions","maxChars","hideShowAllBtn","styles","onClickCreatePostLink"]);const{classes:k,theme:N}=Co(void 0,{name:"PostContent",styles:x}),[A,L]=l(!1),{t:T}=w(),{authActionWrapper:P}=Ge(),[I,S]=l(!1),M=
|
|
2292
|
+
`;var Co=p((e=>({root:{mention:{color:e.fn.primaryColor()},a:{"&,&:visited,&:focus":{color:e.fn.primaryColor()}},".create-post-link":{display:"inline",color:e.fn.primaryColor(),cursor:"pointer"}}})));const ko=e=>{var{trackingCategory:a,url:n,className:d,style:m,replyingTo:p,mentionedUser:u,description:g,disableShortenContent:h,mentions:b=[],maxChars:f=1e3,hideShowAllBtn:y,styles:x,onClickCreatePostLink:E}=e,C=t(e,["trackingCategory","url","className","style","replyingTo","mentionedUser","description","disableShortenContent","mentions","maxChars","hideShowAllBtn","styles","onClickCreatePostLink"]);const{classes:k,theme:N}=Co(void 0,{name:"PostContent",styles:x}),[A,L]=l(!1),{t:T}=w(),{authActionWrapper:P}=Ge(),[I,S]=l(!1),M=Ta(La(g||"","display"),b),{action:{sanitizeFunction:z}}=i(X),j=c((()=>{const e=z(M||"");if(h||A)return{showContent:e,hasSeeMore:!1};const t=e.slice(0,f),a=f-27*((t.match(/<\/div>/g)||[]).length-1),o=(t||"").slice(0,a<40?40:a),n=z(o.replace(/(<|<\/)( +|[a-zA-Z]*)$/gi,"")),i=n.length<e.length-10;return{showContent:i?n:e,hasSeeMore:i}}),[h,A,M]),F=(null==u?void 0:u.name)||p,B="expert"===(null==u?void 0:u.role)&&!!(null==u?void 0:u.partnerId),O=r(null),R=e=>{e.preventDefault(),null==E||E()};return s((()=>{var e;return null===(e=null==O?void 0:O.current)||void 0===e||e.querySelectorAll("[data-create-post]").forEach((e=>{e.addEventListener("click",R,{passive:!0})})),()=>{var e;null===(e=null==O?void 0:O.current)||void 0===e||e.querySelectorAll("[data-create-post]").forEach((e=>{e.removeEventListener("click",R,!1)}))}}),[h,A,M]),o.createElement(o.Fragment,null,B&&o.createElement(Xt,{isOpen:I,onClose:()=>S(!1),expertId:String(null==u?void 0:u.partnerId)}),o.createElement(Eo,Object.assign({ref:O,className:`${k.root} ${d} no-replace-click`,style:m,mentionColor:N.fn.primaryColor()},C),F&&o.createElement(v,{onClick:()=>B&&S(!0),className:"post-content-replying"},"@",F),(null==g?void 0:g.startsWith("[mention+id="))&&o.createElement("span",{className:"post-content-replying tag-only",style:{color:N.fn.primaryColor()}},"@"),o.createElement("span",{dangerouslySetInnerHTML:{__html:j.showContent},className:"post-content "+(j.hasSeeMore?"has-see-more":"")}),j.hasSeeMore&&!A&&o.createElement("span",null,"... ",!y&&o.createElement(v,Object.assign({onClick:e=>{e.preventDefault(),e.stopPropagation(),P((()=>L(!0)))},className:"see-more-text"},a?{"data-event-category":a,"data-event-action":"See More Post Click","data-event-label":n}:{}),T("post.seeMore")))))},No=Z.div`
|
|
2294
2293
|
padding: 14px 16px 14px 17px;
|
|
2295
2294
|
background: ${e=>e.bgColor};
|
|
2296
2295
|
border-left: 3px solid ${e=>e.highlight};
|
|
@@ -3076,4 +3075,4 @@ import{a as e,_ as t}from"./tslib.es6-16065c04.js";import*as a from"react";impor
|
|
|
3076
3075
|
`,yi=Z(bi)`
|
|
3077
3076
|
margin-top: 12px;
|
|
3078
3077
|
padding: 0.5rem 1rem 1rem;
|
|
3079
|
-
`;var wi="-dzIuHr";const xi=({userId:e,avatar:t,name:a,role:n,title:i,className:r})=>{const{t:s}=w(),[c,d]=l(!1);return o.createElement(o.Fragment,null,o.createElement(Fe,{className:`${wi} ${r}`,color:"success",size:"xs",onClick:()=>d(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},o.createElement("span",{className:"text"},o.createElement(N.Endorse,{isSolid:!0,size:18,color:E.colors.green800,className:"icon"}),s("cardReply.verifyBy",{name:`${a||""}`}))),o.createElement(la,{open:c,onClose:()=>d(!1),profileModalProps:{zIndex:1e3}},o.createElement(Rn,{authorProps:{userId:e,avatar:t,name:a,role:n,title:i},hideQuestionTab:!0})))};const Ei=({className:t,style:a,comment:n,type:r="comment",level:d=0,replyingId:m,onPostCommentSuccess:p,post:u,onDeleteComment:g,refetchComment:h,hasQuickBookingEnable:v,handleMakeAppointment:b,cardAuthorProps:f,maxChars:y=600,disableShortenContent:x})=>{var E,C,k,N,A,L,T,P,I,S,M,z;const{data:{locale:j,userInfo:F,env:{isMarryBaby:B}}}=i(X),{t:O}=w(),[R,V]=l(n||null),{id:D,countLikes:W,content:Z,replies:H=[],images:q=[],author:_,liked:G,link:Q,mentionedUser:K,mentions:$}=R,{text:Y,replyingTo:ae}=(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}=Ge({_joinCommunityIds:[null===(E=null==u?void 0:u.community)||void 0===E?void 0:E.id],_joinTopicIds:null===(C=null==u?void 0:u.topics)||void 0===C?void 0:C.map((e=>e.id))}),[ne,re]=l(4),se=!!(null==F?void 0:F.id)&&(null==H?void 0:H.some((e=>e.author.id===F.id))),ce=e=>{V((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 h&&h(a),a}return t}))},[de,me]=l(!1),pe=c((()=>"comment"===r&&H&&0!=H.length?H.sort(((e,t)=>{const a=new Date(e.createdAt).getTime(),o=new Date(t.createdAt).getTime();return a>o?-1:a<o?1:0})):H),[r,H]),ue=(null==H?void 0:H.length)||0,he=String(null==_?void 0:_.email)&&(null==F?void 0:F.email)&&String(null==_?void 0:_.email)===String(null==F?void 0:F.email),ve=(null==_?void 0:_.name)||(null==_?void 0:_.username)||"",be=(null==_?void 0:_.username)||(null==_?void 0:_.name)||"",fe=null==_?void 0:_.avatar,ye=(null==u?void 0:u.isAnonymous)||null==_?void 0:_.role,we=[...(null==u?void 0:u.isAnonymous)?[{id:(null===(k=null==u?void 0:u.author)||void 0===k?void 0:k.id)||0,name:O("cardPost.anonymous")}]:[],...$||[]],[xe,Ee]=l(null),[ke,Ne]=l(null);s((()=>{if(null==_?void 0:_.hospitalId){const t=t=>e(void 0,void 0,void 0,(function*(){var e;const a=yield J(ie(le.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:U[j]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&Ee(null==a?void 0:a._data.branch)}));t(_.hospitalId)}if(null==_?void 0:_.doctorId){const t=t=>e(void 0,void 0,void 0,(function*(){var e;const a=yield J(ie(le.GET_DOCTOR_INFO,{doctorId:t,website_url:U[j]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&Ne(null==a?void 0:a._data.doctor)}));t(_.doctorId)}}),[_.hospitalId,_.doctorId]);const Ae=(null==ke?void 0:ke.valid_outpatient)||(null==ke?void 0:ke.valid_telemedicine),Le=((null==xe?void 0:xe.total_available_service)||(null==xe?void 0:xe.total_available_doctor))>0,Te=v&&(Ae||Le),Pe="chatbot"===(null===(N=null==R?void 0:R.author)||void 0===N?void 0:N.type);return o.createElement(_e,{defaultParams:{_joinCommunityIds:[null===(A=null==u?void 0:u.community)||void 0===A?void 0:A.id],_joinTopicIds:null===(L=null==u?void 0:u.topics)||void 0===L?void 0:L.map((e=>e.id))}},o.createElement(fi,{className:t,style:a,"data-is-reply":!!d,"data-is-marrybaby":B,"data-has-booking":Te},"reply"===r&&o.createElement(Ce,{className:"top-divider",type:"solid"}),o.createElement("div",{style:{padding:"16px 16px 0"}},o.createElement(da,Object.assign({avatar:fe,name:ve,username:be,timeText:null==u?void 0:u.createdTime,community:null==u?void 0:u.community,className:"post-author "+(he?"with-popover":""),type:r,userId:null==_?void 0:_.id,role:ye,expertId:null==_?void 0:_.partnerId,title:null==_?void 0:_.title,doctorId:null==_?void 0:_.doctorId,hospitalId:null==_?void 0:_.hospitalId,hasQuickBooking:Te,handleMakeAppointment:b,isAnonymous:!!(null==u?void 0:u.isAnonymous),hideBackground:Pe,userType:null==_?void 0:_.type},f)),Boolean(null==R?void 0:R.isVerify)&&!Boolean(null==R?void 0:R.isOppose)&&o.createElement(xi,{title:null===(T=null==R?void 0:R.userVerify)||void 0===T?void 0:T.title,name:null===(P=null==R?void 0:R.userVerify)||void 0===P?void 0:P.name,userId:null===(I=null==R?void 0:R.userVerify)||void 0===I?void 0:I.id,role:null===(S=null==R?void 0:R.userVerify)||void 0===S?void 0:S.role,avatar:null===(M=null==R?void 0:R.userVerify)||void 0===M?void 0:M.avatar,className:"verify-tag"})),o.createElement(ko,{className:"post-content-wrapper",replyingTo:ae,mentionedUser:K,description:Y,mentions:we,maxChars:y,disableShortenContent:x}),o.createElement("span",null),o.createElement("span",null),q&&q.length>0?o.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},o.createElement(qo,{images:q,authorName:null==_?void 0:_.username})):null,q&&0!==q.length||!Q?null:o.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},o.createElement(Ye,{url:Q})),"most-engaging"!==r?o.createElement(o.Fragment,null,Pe&&o.createElement(yi,{listUrl:null==R?void 0:R.source,categorySlug:null==R?void 0:R.categorySlug}),o.createElement(dt,{type:nt.reply,loveCount:W,replyCount:ue,className:"post-reaction",liked:G,isReplied:se,hideCommentIcon:"reply"===r||Pe,hasShare:!1,onCommentClick:()=>oe((()=>me((e=>!e)))),onCommentCountClick:()=>oe((()=>{me(!0)})),onLikeClick:()=>oe((()=>e(void 0,void 0,void 0,(function*(){if(D){const t=yield(({commentId:t,setLike:a=!1,locale:o})=>e(void 0,void 0,void 0,(function*(){return ge(ee(a?te.COMMENT.LIKE:te.COMMENT.UNLIKE,{_locale:o,id:t}),"GET")})))({commentId:D,setLike:!G,locale:j});1===t.status&&V((e=>Object.assign(Object.assign({},e),{liked:!G,countLikes:e.countLikes+(G?-1:1)})))}}))))}),de&&o.createElement(uo,{replyingId:m||R.id,replyToName:ve,isReply:!0,onClose:()=>me(!1),onPostSuccess:e=>{"reply"===r?p&&p(e):ce(e)},post:u,replyingUser:_}),"comment"===r&&H&&H.length>0?o.createElement("div",{className:"comment-reply-wrapper"},null===(z=null==pe?void 0:pe.slice(0,ne))||void 0===z?void 0:z.map((e=>o.createElement(Ei,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:d+1,replyingId:D,onPostCommentSuccess:ce,post:u,onDeleteComment:()=>{V((t=>Object.assign(Object.assign({},t),{replies:t.replies.filter((t=>t.id!==e.id)),countReplies:t.countReplies-1})))},handleMakeAppointment:b,hasQuickBookingEnable:v}))),ue>ne&&o.createElement(o.Fragment,null,o.createElement(Ce,{className:"top-divider",type:"solid"}),o.createElement(Fe,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>re((e=>e+4))},O("comment.seeMoreReplies",{count:ue-ne}),o.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"})))):null):null,he&&o.createElement(Jn,{onDeleteComment:g,className:"popover",commentId:R.id})))},Ci=(t,a)=>e(void 0,void 0,void 0,(function*(){var e,o,n;const i=yield ye(ee(te.COMMENT.LIST,{postId:t,_locale:a,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(n=null===(o=null===(e=null==i?void 0:i.data)||void 0===e?void 0:e.comments)||void 0===o?void 0:o.map(Le))||void 0===n?void 0:n[0]})),ki=({className:t,style:a,hideViewMoreComment:n,showMostEngaging:r,onCommentClick:c,onCommentCountClick:d,onMostEngagingCommentClick:m,onPostCommentSuccess:p,disableCardLink:u,disableShortenContent:g,onDeletePost:h,onEditPost:v,post:b,mostEngagingComment:f,onDeleteComment:y,showInputComment:E,InlineCommentsComponent:k,hasQuickBookingEnable:N,handleMakeAppointment:A,cardAuthorProps:L})=>{const[T,P]=l(b),[I,S]=l(!1),[M,z]=l(f),{community:j,topics:F,author:B,slug:O,isPin:R,liked:V,photos:D,mentions:U,title:W,description:Z,previewUrl:H,likesCount:q,commentsCount:_,id:G,commented:Q}=T,{data:{locale:K,env:{isMarryBaby:$,togetherBasePath:Y}},action:{pushNotifications:ne}}=i(X),{t:se}=w(),[ce,de]=l(E),me=`${Y}/${(null==j?void 0:j.slug)||"_"}/${O||""}`,pe=`${oe(K)}${me}`,{authActionWrapper:ue}=Ge((null==j?void 0:j.slug)?{_joinCommunityIds:[j.id],_joinTopicIds:null==F?void 0:F.map((e=>e.id))}:void 0),[he,ve]=l(!1);s((()=>{de(E)}),[E]);const be=(null==B?void 0:B.name)||(null==B?void 0:B.username)||"",fe=(null==B?void 0:B.username)||(null==B?void 0:B.name)||"",ye=null==B?void 0:B.avatar,we=(null==T?void 0:T.isAnonymous)||null==B?void 0:B.role,[xe,Ee]=l(null),[Ce,ke]=l(null);s((()=>{if(null==B?void 0:B.hospitalId){(t=>e(void 0,void 0,void 0,(function*(){var e;const a=yield J(ie(le.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:re[K]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&Ee(null==a?void 0:a._data.branch)})))(B.hospitalId)}if(null==B?void 0:B.doctorId){(t=>e(void 0,void 0,void 0,(function*(){var e;const a=yield J(ie(le.GET_DOCTOR_INFO,{doctorId:t,website_url:re[K]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&ke(null==a?void 0:a._data.doctor)})))(B.doctorId)}}),[B.hospitalId,B.doctorId]);const Ne=(null==Ce?void 0:Ce.valid_outpatient)||(null==Ce?void 0:Ce.valid_telemedicine),Ae=((null==xe?void 0:xe.total_available_service)||(null==xe?void 0:xe.total_available_doctor))>0,Le=N&&(Ne||Ae);s((()=>{e(void 0,void 0,void 0,(function*(){if(G&&_&&r&&!(null==f?void 0:f.id)){const e=yield Ci(G,K);z(e)}}))}),[G,K,_,r,null==f?void 0:f.id]),s((()=>{z(f)}),[null==f?void 0:f.id]);const Te=t=>e(void 0,void 0,void 0,(function*(){if(_>1&&(null==M?void 0:M.id)&&(null==M?void 0:M.id)===(null==t?void 0:t.id)){const e=yield Ci(G,K);z(e)}P((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1}))),y&&y(t)}));return o.createElement(_e,{defaultParams:(null==j?void 0:j.slug)?{_joinCommunityIds:[j.id],_joinTopicIds:null==F?void 0:F.map((e=>e.id))}:void 0},I&&o.createElement(bo,{url:pe,avatar:ae,text:W,onClose:()=>S(!1)}),o.createElement(Yn,{className:t,style:a,"data-is-marrybaby":$},R?o.createElement(ht,{className:"post-pin"}):null,o.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},o.createElement(da,Object.assign({avatar:ye,name:be,username:fe,url:u?void 0:me,community:j,timeText:null==T?void 0:T.createdTime,className:"post-author",role:we,userId:null==B?void 0:B.id,expertId:null==B?void 0:B.partnerId,doctorId:null==B?void 0:B.doctorId,hospitalId:null==B?void 0:B.hospitalId,title:null==B?void 0:B.title,hasQuickBooking:Le,handleMakeAppointment:A,"data-testid":"name",isAnonymous:!!(null==T?void 0:T.isAnonymous),extendEle:o.createElement($n,{authorEmail:String(null==B?void 0:B.email),onDeletePost:h,shareUrl:pe,post:T,className:"popover",onEditPost:v})},L))),o.createElement("a",{href:u?void 0:me,className:"post-content-link-wrapper"},W&&o.createElement(C,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},x(W)),o.createElement(ko,{className:"post-content-wrapper",description:Z,disableShortenContent:g,mentions:U,"data-testid":"Content of the Post"})),o.createElement("span",null),o.createElement("span",null),o.createElement("div",{key:"tag-topic"},F&&F.length>0?o.createElement(pt,{topics:F,className:"post-topics"}):null),o.createElement("div",{key:"social-preview"},(null==T?void 0:T.introUrl)?o.createElement("div",{className:"social-preview-wrapper "+((null==D?void 0:D.length)?"has-image":"")},o.createElement(Go,{url:T.introUrl,image:T.bannerImage})):null),o.createElement("div",{key:"image-preview"},(null==D?void 0:D.length)?o.createElement("div",{className:"image-preview-wrapper"},o.createElement(qo,{images:D,authorName:null==B?void 0:B.name})):null),o.createElement("div",{key:"link-preview"},(null==T?void 0:T.introUrl)||(null==D?void 0:D.length)||!(null==H?void 0:H.url)?null:o.createElement("div",{className:"link-preview-wrapper"},o.createElement(Ye,{title:H.title,url:H.url,image:H.image}))),o.createElement(dt,{isMarryBaby:$,type:nt.post,loveCount:q,replyCount:_,className:"post-reaction "+((null==D?void 0:D.length)||(null==H?void 0:H.url)?"hide-top-border":""),liked:he?!V:V,isReplied:Q,onCommentClick:()=>ue((()=>{c?c():de((e=>!e))})),onCommentCountClick:()=>{ue((()=>{$?de(!0):d?d():!u&&(window.location.href=me)}))},onShareClick:()=>{S(!0)},onLikeClick:()=>e(void 0,void 0,void 0,(function*(){if(G&&!he){ve(!0);try{const t=yield(({id:t,locale:a})=>e(void 0,void 0,void 0,(function*(){if(t)return yield ge(ee(te.POST.LIKE,{id:t,_locale:a}),"GET")})))({id:G,locale:K});1!==(null==t?void 0:t.status)?ne(ma(se)):P((e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked})))}catch(e){ne(ma(se))}ve(!1)}})),showingMostEngaging:!(!r||!(null==M?void 0:M.id))}),ce&&o.createElement(uo,{isMainCmt:!E,onClose:()=>de(!1),onPostSuccess:e=>{0!==_||(null==M?void 0:M.id)||z(e),P((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0}))),p&&p(e)},post:T}),r&&(null==M?void 0:M.id)?o.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{m?(e.stopPropagation(),m()):window.location.href=me}},o.createElement(Ei,{hasQuickBookingEnable:N,handleMakeAppointment:A,comment:M,post:T,onDeleteComment:()=>{Te&&Te(M)},className:"most-engaging-comment",type:"most-engaging",key:M.id,cardAuthorProps:L}),_>1&&!n&&o.createElement(Fe,{className:"see-more-comments",color:"ghost",size:"md"},se("comment.seeMoreComments",{count:_-1}))):null,k))};var Ni=Object.freeze({__proto__:null});export{Bn as A,Hn as B,Ye as C,ki as D,$n as E,Ei as F,Jn as G,ft as H,uo as I,bi as J,He as K,Xe as L,co as P,bo as S,qe as T,xi as V,_e as a,dt as b,pt as c,gt as d,ht as e,Et as f,da as g,oo as h,Ga as i,Xa as j,Xt as k,Zt as l,ta as m,Ya as n,so as o,xo as p,vo as q,ko as r,Mo as s,Ni as t,Ge as u,Vo as v,qo as w,Go as x,la as y,Rn as z};
|
|
3078
|
+
`;var wi="-dzIuHr";const xi=({userId:e,avatar:t,name:a,role:n,title:i,className:r})=>{const{t:s}=w(),[c,d]=l(!1);return o.createElement(o.Fragment,null,o.createElement(Fe,{className:`${wi} ${r}`,color:"success",size:"xs",onClick:()=>d(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},o.createElement("span",{className:"text"},o.createElement(N.Endorse,{isSolid:!0,size:18,color:E.colors.green800,className:"icon"}),s("cardReply.verifyBy",{name:`${a||""}`}))),o.createElement(la,{open:c,onClose:()=>d(!1),profileModalProps:{zIndex:1e3}},o.createElement(Rn,{authorProps:{userId:e,avatar:t,name:a,role:n,title:i},hideQuestionTab:!0})))};const Ei=({className:t,style:a,comment:n,type:r="comment",level:d=0,replyingId:m,onPostCommentSuccess:p,post:u,onDeleteComment:g,refetchComment:h,hasQuickBookingEnable:v,handleMakeAppointment:b,cardAuthorProps:f,maxChars:y=600,disableShortenContent:x})=>{var E,C,k,N,A,L,T,P,I,S,M,z;const{data:{locale:j,userInfo:F,env:{isMarryBaby:B}}}=i(X),{t:O}=w(),[R,V]=l(n||null),{id:D,countLikes:W,content:Z,replies:H=[],images:q=[],author:_,liked:G,link:Q,mentionedUser:K,mentions:$}=R,{text:Y,replyingTo:ae}=(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}=Ge({_joinCommunityIds:[null===(E=null==u?void 0:u.community)||void 0===E?void 0:E.id],_joinTopicIds:null===(C=null==u?void 0:u.topics)||void 0===C?void 0:C.map((e=>e.id))}),[ne,re]=l(4),se=!!(null==F?void 0:F.id)&&(null==H?void 0:H.some((e=>e.author.id===F.id))),ce=e=>{V((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 h&&h(a),a}return t}))},[de,me]=l(!1),pe=c((()=>"comment"===r&&H&&0!=H.length?H.sort(((e,t)=>{const a=new Date(e.createdAt).getTime(),o=new Date(t.createdAt).getTime();return a>o?-1:a<o?1:0})):H),[r,H]),ue=(null==H?void 0:H.length)||0,he=String(null==_?void 0:_.email)&&(null==F?void 0:F.email)&&String(null==_?void 0:_.email)===String(null==F?void 0:F.email),ve=(null==_?void 0:_.name)||(null==_?void 0:_.username)||"",be=(null==_?void 0:_.username)||(null==_?void 0:_.name)||"",fe=null==_?void 0:_.avatar,ye=(null==u?void 0:u.isAnonymous)||null==_?void 0:_.role,we=[...(null==u?void 0:u.isAnonymous)?[{id:(null===(k=null==u?void 0:u.author)||void 0===k?void 0:k.id)||0,name:O("cardPost.anonymous")}]:[],...$||[]],[xe,Ee]=l(null),[ke,Ne]=l(null);s((()=>{if(null==_?void 0:_.hospitalId){const t=t=>e(void 0,void 0,void 0,(function*(){var e;const a=yield J(ie(le.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:U[j]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&Ee(null==a?void 0:a._data.branch)}));t(_.hospitalId)}if(null==_?void 0:_.doctorId){const t=t=>e(void 0,void 0,void 0,(function*(){var e;const a=yield J(ie(le.GET_DOCTOR_INFO,{doctorId:t,website_url:U[j]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&Ne(null==a?void 0:a._data.doctor)}));t(_.doctorId)}}),[_.hospitalId,_.doctorId]);const Ae=(null==ke?void 0:ke.valid_outpatient)||(null==ke?void 0:ke.valid_telemedicine),Le=((null==xe?void 0:xe.total_available_service)||(null==xe?void 0:xe.total_available_doctor))>0,Te=v&&(Ae||Le),Pe="chatbot"===(null===(N=null==R?void 0:R.author)||void 0===N?void 0:N.type);return o.createElement(_e,{defaultParams:{_joinCommunityIds:[null===(A=null==u?void 0:u.community)||void 0===A?void 0:A.id],_joinTopicIds:null===(L=null==u?void 0:u.topics)||void 0===L?void 0:L.map((e=>e.id))}},o.createElement(fi,{className:t,style:a,"data-is-reply":!!d,"data-is-marrybaby":B,"data-has-booking":Te},"reply"===r&&o.createElement(Ce,{className:"top-divider",type:"solid"}),o.createElement("div",{style:{padding:"16px 16px 0"}},o.createElement(da,Object.assign({avatar:fe,name:ve,username:be,timeText:null==u?void 0:u.createdTime,community:null==u?void 0:u.community,className:"post-author "+(he?"with-popover":""),type:r,userId:null==_?void 0:_.id,role:ye,expertId:null==_?void 0:_.partnerId,title:null==_?void 0:_.title,doctorId:null==_?void 0:_.doctorId,hospitalId:null==_?void 0:_.hospitalId,hasQuickBooking:Te,handleMakeAppointment:b,isAnonymous:!!(null==u?void 0:u.isAnonymous),hideBackground:Pe,userType:null==_?void 0:_.type},f)),Boolean(null==R?void 0:R.isVerify)&&!Boolean(null==R?void 0:R.isOppose)&&o.createElement(xi,{title:null===(T=null==R?void 0:R.userVerify)||void 0===T?void 0:T.title,name:null===(P=null==R?void 0:R.userVerify)||void 0===P?void 0:P.name,userId:null===(I=null==R?void 0:R.userVerify)||void 0===I?void 0:I.id,role:null===(S=null==R?void 0:R.userVerify)||void 0===S?void 0:S.role,avatar:null===(M=null==R?void 0:R.userVerify)||void 0===M?void 0:M.avatar,className:"verify-tag"})),o.createElement(ko,{className:"post-content-wrapper",replyingTo:ae,mentionedUser:K,description:Y,mentions:we,maxChars:y,disableShortenContent:x}),o.createElement("span",null),o.createElement("span",null),q&&q.length>0?o.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},o.createElement(qo,{images:q,authorName:null==_?void 0:_.username})):null,q&&0!==q.length||!Q?null:o.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},o.createElement(Ye,{url:Q})),"most-engaging"!==r?o.createElement(o.Fragment,null,Pe&&o.createElement(yi,{listUrl:null==R?void 0:R.source,categorySlug:null==R?void 0:R.categorySlug}),o.createElement(dt,{type:nt.reply,loveCount:W,replyCount:ue,className:"post-reaction",liked:G,isReplied:se,hideCommentIcon:"reply"===r||Pe,hasShare:!1,onCommentClick:()=>oe((()=>me((e=>!e)))),onCommentCountClick:()=>oe((()=>{me(!0)})),onLikeClick:()=>oe((()=>e(void 0,void 0,void 0,(function*(){if(D){const t=yield(({commentId:t,setLike:a=!1,locale:o})=>e(void 0,void 0,void 0,(function*(){return ge(ee(a?te.COMMENT.LIKE:te.COMMENT.UNLIKE,{_locale:o,id:t}),"GET")})))({commentId:D,setLike:!G,locale:j});1===t.status&&V((e=>Object.assign(Object.assign({},e),{liked:!G,countLikes:e.countLikes+(G?-1:1)})))}}))))}),de&&o.createElement(uo,{replyingId:m||R.id,replyToName:ve,isReply:!0,onClose:()=>me(!1),onPostSuccess:e=>{"reply"===r?p&&p(e):ce(e)},post:u,replyingUser:_}),"comment"===r&&H&&H.length>0?o.createElement("div",{className:"comment-reply-wrapper"},null===(z=null==pe?void 0:pe.slice(0,ne))||void 0===z?void 0:z.map((e=>o.createElement(Ei,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:d+1,replyingId:D,onPostCommentSuccess:ce,post:u,onDeleteComment:()=>{V((t=>Object.assign(Object.assign({},t),{replies:t.replies.filter((t=>t.id!==e.id)),countReplies:t.countReplies-1})))},handleMakeAppointment:b,hasQuickBookingEnable:v}))),ue>ne&&o.createElement(o.Fragment,null,o.createElement(Ce,{className:"top-divider",type:"solid"}),o.createElement(Fe,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>re((e=>e+4))},O("comment.seeMoreReplies",{count:ue-ne}),o.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"})))):null):null,he&&o.createElement(Jn,{onDeleteComment:g,className:"popover",commentId:R.id})))},Ci=(t,a)=>e(void 0,void 0,void 0,(function*(){var e,o,n;const i=yield ye(ee(te.COMMENT.LIST,{postId:t,_locale:a,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(n=null===(o=null===(e=null==i?void 0:i.data)||void 0===e?void 0:e.comments)||void 0===o?void 0:o.map(Le))||void 0===n?void 0:n[0]})),ki=({className:t,style:a,hideViewMoreComment:n,showMostEngaging:r,onCommentClick:c,onCommentCountClick:d,onMostEngagingCommentClick:m,onPostCommentSuccess:p,disableCardLink:u,disableShortenContent:g,onDeletePost:h,onEditPost:v,post:b,mostEngagingComment:f,onDeleteComment:y,showInputComment:E,InlineCommentsComponent:k,hasQuickBookingEnable:N,handleMakeAppointment:A,cardAuthorProps:L})=>{const[T,P]=l(b),[I,S]=l(!1),[M,z]=l(f),{community:j,topics:F,author:B,slug:O,isPin:R,liked:V,photos:D,mentions:U,title:W,description:Z,previewUrl:H,likesCount:q,commentsCount:_,id:G,commented:Q}=T,{data:{locale:K,env:{isMarryBaby:$,togetherBasePath:Y}},action:{pushNotifications:ne}}=i(X),{t:se}=w(),[ce,de]=l(E),me=`${Y}/${(null==j?void 0:j.slug)||"_"}/${O||""}`,pe=`${oe(K)}${me}`,{authActionWrapper:ue}=Ge((null==j?void 0:j.slug)?{_joinCommunityIds:[j.id],_joinTopicIds:null==F?void 0:F.map((e=>e.id))}:void 0),[he,ve]=l(!1);s((()=>{de(E)}),[E]);const be=(null==B?void 0:B.name)||(null==B?void 0:B.username)||"",fe=(null==B?void 0:B.username)||(null==B?void 0:B.name)||"",ye=null==B?void 0:B.avatar,we=(null==T?void 0:T.isAnonymous)||null==B?void 0:B.role,[xe,Ee]=l(null),[Ce,ke]=l(null);s((()=>{if(null==B?void 0:B.hospitalId){(t=>e(void 0,void 0,void 0,(function*(){var e;const a=yield J(ie(le.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:re[K]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.branch)&&Ee(null==a?void 0:a._data.branch)})))(B.hospitalId)}if(null==B?void 0:B.doctorId){(t=>e(void 0,void 0,void 0,(function*(){var e;const a=yield J(ie(le.GET_DOCTOR_INFO,{doctorId:t,website_url:re[K]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&ke(null==a?void 0:a._data.doctor)})))(B.doctorId)}}),[B.hospitalId,B.doctorId]);const Ne=(null==Ce?void 0:Ce.valid_outpatient)||(null==Ce?void 0:Ce.valid_telemedicine),Ae=((null==xe?void 0:xe.total_available_service)||(null==xe?void 0:xe.total_available_doctor))>0,Le=N&&(Ne||Ae);s((()=>{e(void 0,void 0,void 0,(function*(){if(G&&_&&r&&!(null==f?void 0:f.id)){const e=yield Ci(G,K);z(e)}}))}),[G,K,_,r,null==f?void 0:f.id]),s((()=>{z(f)}),[null==f?void 0:f.id]);const Te=t=>e(void 0,void 0,void 0,(function*(){if(_>1&&(null==M?void 0:M.id)&&(null==M?void 0:M.id)===(null==t?void 0:t.id)){const e=yield Ci(G,K);z(e)}P((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1}))),y&&y(t)}));return o.createElement(_e,{defaultParams:(null==j?void 0:j.slug)?{_joinCommunityIds:[j.id],_joinTopicIds:null==F?void 0:F.map((e=>e.id))}:void 0},I&&o.createElement(bo,{url:pe,avatar:ae,text:W,onClose:()=>S(!1)}),o.createElement(Yn,{className:t,style:a,"data-is-marrybaby":$},R?o.createElement(ht,{className:"post-pin"}):null,o.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},o.createElement(da,Object.assign({avatar:ye,name:be,username:fe,url:u?void 0:me,community:j,timeText:null==T?void 0:T.createdTime,className:"post-author",role:we,userId:null==B?void 0:B.id,expertId:null==B?void 0:B.partnerId,doctorId:null==B?void 0:B.doctorId,hospitalId:null==B?void 0:B.hospitalId,title:null==B?void 0:B.title,hasQuickBooking:Le,handleMakeAppointment:A,"data-testid":"name",isAnonymous:!!(null==T?void 0:T.isAnonymous),extendEle:o.createElement($n,{authorEmail:String(null==B?void 0:B.email),onDeletePost:h,shareUrl:pe,post:T,className:"popover",onEditPost:v})},L))),o.createElement("a",{href:u?void 0:me,className:"post-content-link-wrapper"},W&&o.createElement(C,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},x(W)),o.createElement(ko,{className:"post-content-wrapper",description:Z,disableShortenContent:g,mentions:U,"data-testid":"Content of the Post"})),o.createElement("span",null),o.createElement("span",null),o.createElement("div",{key:"tag-topic"},F&&F.length>0?o.createElement(pt,{topics:F,className:"post-topics"}):null),o.createElement("div",{key:"social-preview"},(null==T?void 0:T.introUrl)?o.createElement("div",{className:"social-preview-wrapper "+((null==D?void 0:D.length)?"has-image":"")},o.createElement(Go,{url:T.introUrl,image:T.bannerImage})):null),o.createElement("div",{key:"image-preview"},(null==D?void 0:D.length)?o.createElement("div",{className:"image-preview-wrapper"},o.createElement(qo,{images:D,authorName:null==B?void 0:B.name})):null),o.createElement("div",{key:"link-preview"},(null==T?void 0:T.introUrl)||(null==D?void 0:D.length)||!(null==H?void 0:H.url)?null:o.createElement("div",{className:"link-preview-wrapper"},o.createElement(Ye,{title:H.title,url:H.url,image:H.image}))),o.createElement(dt,{isMarryBaby:$,type:nt.post,loveCount:q,replyCount:_,className:"post-reaction "+((null==D?void 0:D.length)||(null==H?void 0:H.url)?"hide-top-border":""),liked:he?!V:V,isReplied:Q,onCommentClick:()=>ue((()=>{c?c():de((e=>!e))})),onCommentCountClick:()=>{ue((()=>{$?de(!0):d?d():!u&&(window.location.href=me)}))},onShareClick:()=>{S(!0)},onLikeClick:()=>e(void 0,void 0,void 0,(function*(){if(G&&!he){ve(!0);try{const t=yield(({id:t,locale:a})=>e(void 0,void 0,void 0,(function*(){if(t)return yield ge(ee(te.POST.LIKE,{id:t,_locale:a}),"GET")})))({id:G,locale:K});1!==(null==t?void 0:t.status)?ne(ma(se)):P((e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked})))}catch(e){ne(ma(se))}ve(!1)}})),showingMostEngaging:!(!r||!(null==M?void 0:M.id))}),ce&&o.createElement(uo,{isMainCmt:!E,onClose:()=>de(!1),onPostSuccess:e=>{0!==_||(null==M?void 0:M.id)||z(e),P((e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0}))),p&&p(e)},post:T}),r&&(null==M?void 0:M.id)?o.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{m?(e.stopPropagation(),m()):window.location.href=me}},o.createElement(Ei,{hasQuickBookingEnable:N,handleMakeAppointment:A,comment:M,post:T,onDeleteComment:()=>{Te&&Te(M)},className:"most-engaging-comment",type:"most-engaging",key:M.id,cardAuthorProps:L}),_>1&&!n&&o.createElement(Fe,{className:"see-more-comments",color:"ghost",size:"md"},se("comment.seeMoreComments",{count:_-1}))):null,k))};var Ni=Object.freeze({__proto__:null});export{Bn as A,Hn as B,Ye as C,ki as D,$n as E,Ei as F,Jn as G,ft as H,uo as I,bi as J,He as K,Xe as L,co as P,bo as S,qe as T,xi as V,_e as a,dt as b,pt as c,gt as d,ht as e,Et as f,da as g,oo as h,Xa as i,Ja as j,Xt as k,Zt as l,ta as m,to as n,so as o,xo as p,vo as q,ko as r,Mo as s,Ni as t,Ge as u,Vo as v,qo as w,Go as x,la as y,Rn as z};
|