"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8674],{YRXs:function(e,t,i){i.d(t,{B:function(){return h},C:function(){return M},E:function(){return N},F:function(){return O},G:function(){return v},N:function(){return y},S:function(){return x},V:function(){return w},a:function(){return E},c:function(){return T},d:function(){return I},e:function(){return C},f:function(){return S},g:function(){return f},h:function(){return U},i:function(){return A}});var o,n,l,a,r,s,d,c,p,u,m,g,v,h,E,_,b,T,I,y,S,f,w,x,R=i("375z");(o=v||(v={})).Boy="boy",o.Girl="girl",(n=h||(h={}))[n.Height=0]="Height",n[n.Weight=1]="Weight",n[n.Head=2]="Head",n[n.BMI=3]="BMI",(l=E||(E={}))[l.Weekly=0]="Weekly",l[l.Monthly=1]="Monthly",l[l.Yearly=2]="Yearly",(a=_||(_={}))[a.Height=0]="Height",a[a.Weight=1]="Weight",a[a.Head=2]="Head",a[a.BMI=3]="BMI",a[a.Record=4]="Record",(r=b||(b={}))[r.Phone=0]="Phone",r[r.OTP=1]="OTP",r[r.OTPEmail=2]="OTPEmail",r[r.PersonalInfo=3]="PersonalInfo",r[r.UpdatePassword=4]="UpdatePassword",r[r.Result=5]="Result",r[r.DynamicForm=6]="DynamicForm",(s=T||(T={}))[s.HEAD=0]="HEAD",s[s.TAIL=1]="TAIL",s[s.MIDDLE=2]="MIDDLE",s[s.CONNECT=3]="CONNECT",s[s.SSO=4]="SSO",s[s.MULTIPLE=5]="MULTIPLE",(d=I||(I={}))[d.UNDEFINED=-1]="UNDEFINED",d[d.TEXT=0]="TEXT",d[d.IMAGE=1]="IMAGE",d[d.FORM=2]="FORM",d[d.CONDITION=3]="CONDITION",d[d.POLL=4]="POLL",d[d.FINAL_STANDARD=5]="FINAL_STANDARD",d[d.FINAL=6]="FINAL",d[d.FINAL_THANK_YOU=7]="FINAL_THANK_YOU",d[d.RATING=8]="RATING",d[d.REACTION=9]="REACTION",d[d.REVIEW=10]="REVIEW",d[d.RESULT_POLL=11]="RESULT_POLL",d[d.RESULT_RATING=12]="RESULT_RATING",d[d.RESULT_REACTION=13]="RESULT_REACTION",d[d.OTP=14]="OTP";let C=[I.FINAL,I.FINAL_STANDARD,I.FINAL_THANK_YOU];(c=y||(y={})).BOT_TEXT="bot-text",c.BOT_IMAGE="bot-image",c.BOT_BACKGROUND_IMAGE="bot-background-image",c.BOT_BUTTON="bot-button",c.BOT_URL="bot-url",c.BOT_RECALCULATE="bot-recalculate",c.BOT_BOOKING="bot-booking",c.BOT_MAIN_TITLE="bot-main-title",c.BOT_MAIN_IMAGE="bot-main-image",c.BOT_MAIN_BODY="bot-main-body",c.BOT_MAIN_BUTTON="bot-main-button",c.BOT_SUB_TITLE="bot-sub-title",c.BOT_SUB_BODY="bot-sub-body",c.BOT_LANDING_PAGE_URL="bot-landing-page-url",c.BOT_LANDING_PAGE_BUTTON="bot-landing-page-button",c.BOT_RISK_SCREEN="bot-risk-screen",c.BOT_RELATED_ARTICLE="bot-related-article",c.THANK_YOU_IMAGE="thank-you-image",c.THANK_YOU_TITLE="thank-you-title",c.THANK_YOU_BODY="thank-you-body",c.TOTAL_LINE="total-line",c.BOT_SUBMISSION="bot-submission",c.BOT_EVENT_SUBMISSION="bot-event-submission",c.BOT_SUGGESTED_SERVICE="bot-suggested-service",c.SSO_INTENT="sso-intent",(p=S||(S={})).ACTION_CONDITION="action-condition",p.ACTION_INTERNAL="action-internal",p.ACTION_EXTERNAL="action-external",p.ACTION_SSO_REDIRECT="action-sso-redirect",p.ACTION_MULTIPLE_BUTTON="action-multiple-button",p.USER_CHOICE_TEXT="user-choice-text",p.USER_CHOICE_TEXT_BY_INPUT="user-choice-text-by-input",p.USER_CHOICE_NEXT="user-choice-next",p.USER_CHOICE_IMAGE="user-choice-image",p.USER_SUBMIT_TEXT="user-submit-text",p.USER_SUBMIT_NUMBER="user-submit-number",p.USER_SUBMIT_NAME="user-submit-name",p.USER_SUBMIT_PHONE="user-submit-phone",p.USER_SUBMIT_EMAIL="user-submit-email",p.USER_SUBMIT_DROPDOWN="user-submit-dropdown",p.USER_SUBMIT_DATE="user-submit-date",p.USER_SUBMIT_DOB="user-submit-dob",p.USER_SUBMIT_CONFIRM="user-submit-confirm",p.USER_SUBMIT_SEND="user-submit-send",p.USER_SUBMIT_RESEND="user-submit-resend",p.USER_SUBMIT_ADDRESS="user-submit-address",p.USER_SUBMIT_ADDRESS_PROVINCE="user-submit-address-province",p.USER_SUBMIT_ADDRESS_DISTRICT="user-submit-address-district",p.USER_SUBMIT_ADDRESS_COMMUNE="user-submit-address-commune",p.USER_SUBMIT_BMI="user-submit-bmi",p.USER_SUBMIT_BMI_HIDDEN="user-submit-bmi-hidden",p.USER_SUBMIT_TERMS="user-submit-terms",p.USER_SUBMIT_GENDER="user-submit-gender",p.USER_SUBMIT_OTP="user-submit-otp",p.USER_SUBMIT_WHATSAPP="user-submit-whatsapp",p.POLL_CHOICE="poll-choice",p.POLL_CHOICE_TEXT_BY_INPUT="poll-choice-text-by-input",p.POLL_CHOICE_IMAGE="poll-choice-image",p.POLL_BUTTON="poll-button",p.RATING_STAR="rating-star",p.RATING_DESCRIPTION="rating-description",p.RATING_BUTTON="rating-button",p.LIKE_CHOICE="like-choice",p.DISLIKE_CHOICE="dislike-choice",p.REVIEW_CHOICE="review-choice",p.REVIEW_DESCRIPTION="review-description",p.REVIEW_BUTTON="review-button",p.RESULT_BUTTON="result-button",p.POLL_RESULT="poll-result",p.USER_SUBMIT_GOOGLE_API_ADDRESS="user-submit-google-api-address";let O=[S.USER_SUBMIT_ADDRESS_PROVINCE,S.USER_SUBMIT_ADDRESS_DISTRICT,S.USER_SUBMIT_ADDRESS_COMMUNE,S.USER_SUBMIT_ADDRESS];(u=f||(f={}))[u.UNLIMITED=0]="UNLIMITED",u[u.EXACT_NUMBER=1]="EXACT_NUMBER",u[u.RANGE=2]="RANGE";let N={[S.USER_SUBMIT_EMAIL]:"email",[S.USER_SUBMIT_TEXT]:"text",[S.USER_SUBMIT_DROPDOWN]:"text",[S.USER_SUBMIT_NAME]:"name",[S.USER_SUBMIT_NUMBER]:"number",[S.USER_SUBMIT_ADDRESS]:"address",[S.USER_SUBMIT_PHONE]:"tel",[S.USER_SUBMIT_OTP]:"tel",[S.USER_SUBMIT_WHATSAPP]:"tel",[S.USER_SUBMIT_DATE]:"date",[S.USER_SUBMIT_CONFIRM]:"confirm",[S.USER_SUBMIT_SEND]:"submit",[S.USER_SUBMIT_TERMS]:"terms",[S.USER_SUBMIT_ADDRESS_PROVINCE]:"province",[S.USER_SUBMIT_ADDRESS_DISTRICT]:"district",[S.USER_SUBMIT_ADDRESS_COMMUNE]:"commune",[S.USER_SUBMIT_BMI]:"bmi",[S.USER_SUBMIT_GENDER]:"gender",[S.POLL_CHOICE]:"poll",[S.POLL_CHOICE_TEXT_BY_INPUT]:"poll",[S.POLL_CHOICE_IMAGE]:"poll",[S.RATING_STAR]:"rating",[S.RATING_DESCRIPTION]:"text",[S.LIKE_CHOICE]:"like",[S.DISLIKE_CHOICE]:"dislike",[S.REVIEW_CHOICE]:"review",[S.USER_SUBMIT_GOOGLE_API_ADDRESS]:"google-api-address",[S.USER_SUBMIT_DOB]:"dob"},U={FRU:"FRU",survey:"Survey",ristScreener:"risk_screener",voucherAcuvue:"ACUVUE"};(m=w||(w={})).VIDEO="video",m.SHORTS="short",m.PODCAST="podcast",m.LIVESTREAM="live-stream",(g=x||(x={})).Facebook="facebook",g.Zalo="zalo",g.Twitter="twitter",g.WhatsApp="whatsApp",g.Line="line",g.Instagram="instagram",g.LinkedIn="linkedin",g.Youtube="youtube",g.Tiktok="tiktok",g.Telegram="telegram",g.Viber="viber";let M={DD:{id:"common.day",defaultMessage:"Day"},MM:{id:"common.month",defaultMessage:"Month"},YYYY:{id:"common.year",defaultMessage:"Year"}};var A=Object.freeze({__proto__:null,get SocialType(){return x},COMMON_DATE_TRANSLATE_KEY:M,get Gender(){return v},get BabyGrowthChartType(){return h},get BabyGrowthChartDuration(){return E},get BabyGrowthResultTab(){return _},get LOCALE(){return R.L},get OnboardingStep(){return b},get NodePosition(){return T},get NodeType(){return I},NodeFinalTypes:C,get NodeIntentType(){return y},get NodeActionType(){return S},FULL_KEY_ADDRESS:O,get NodeMultipleOptions(){return f},ELEMENT_CONTROL_INPUT_TYPE:N,SubotType:U,get VideoType(){return w}})},h12z:function(e,t,i){i.d(t,{M:function(){return MarryBabyText},a:function(){return MarryBabyHeading}});var o=i("T/vS"),n=i("q1tI"),l=i("rBCA"),a=i("iBNF");let r=(0,l.Z)(e=>{var{type:t}=e,i=(0,o.a)(e,["type"]);return n.createElement(t,i)})` color: var(--text-color, ${a.r.mbColors.dark}); font-family: Krub; font-weight: 600; letter-spacing: -0.2px; &[data-type='headline-1'] { font-size: 40px; line-height: 60px; } &[data-type='headline-2'] { font-size: 32px; line-height: 48px; } &[data-type='headline-3'] { font-size: 24px; line-height: 40px; } &[data-type='headline-4'] { font-size: 18px; line-height: 32px; } `,s=l.Z.p` color: var(--text-color, ${a.r.mbColors.dark}); letter-spacing: -0.2px; &[data-type='subtitle-1'] { font-size: 16px; font-weight: 600; line-height: 26px; } &[data-type='subtitle-2'] { font-size: 14px; font-weight: 500; line-height: 24px; } &[data-type='subtitle-3'] { font-size: 12px; font-weight: 500; line-height: 20px; } &[data-type='bodytext-1'] { font-size: 16px; font-weight: 400; line-height: 28px; } &[data-type='bodytext-2'] { font-size: 14px; font-weight: 400; line-height: 24px; } &[data-type='bodytext-3'] { font-size: 12px; font-weight: 400; line-height: 20px; } &[data-type='caption-1'] { font-size: 10px; font-weight: 500; letter-spacing: -0.1px; line-height: 14px; } &[data-type='caption-2'] { font-size: 10px; font-weight: 400; letter-spacing: -0.1px; line-height: 14px; } `,MarryBabyHeading=e=>{var{type:t,color:i,style:l}=e,a=(0,o.a)(e,["type","color","style"]);return n.createElement(r,Object.assign({type:t,"data-type":{h1:"headline-1",h2:"headline-2",h3:"headline-3",h4:"headline-4"}[t],style:Object.assign(Object.assign({},i&&{"--text-color":i}),l)},a))},MarryBabyText=e=>{var{type:t,color:i,style:l}=e,a=(0,o.a)(e,["type","color","style"]);return n.createElement(s,Object.assign({"data-type":t,style:Object.assign(Object.assign({},l),i&&{"--text-color":i})},a))}},"Ci9+":function(e,t,i){i.d(t,{C:function(){return CardPost},S:function(){return SourceList},V:function(){return VerifiedTag},a:function(){return CardPostPopoverMore},b:function(){return CardReply},c:function(){return CardReplyPopover}});var o=i("T/vS"),n=i("q1tI"),l=i("WTZ1"),a=i("Mjd7"),r=i("Z+18"),s=i("ns0B"),d=i.n(s),c=i("c3l/"),p=i("0dn/"),u=i("OzIV"),m=i("aZjv"),g=i("GAI/"),v=i("8yea"),h=i("rBCA"),E=i("un+D"),_=i("iBNF"),b=i("eKPt"),T=i("IQVP"),I=i("TUdM"),y=i("OZ05"),S=i("RzjD"),f=i("/eVK"),w=i("6+FN"),x=i("zzXX"),R=i("vWP/"),C=i("VLUI"),O=i("h84G"),N=i("MZpI"),U=i("QaGV"),M=i("bpvy"),A=i("NIaq"),k=i("dDw1"),B=i("iLR0"),D=i("Rnw3"),P=i("xrdX"),L="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath fill='%233E3F58' d='M5 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2M19 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2M12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2'/%3e%3c/svg%3e",j="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='3' height='13' fill='none'%3e%3ccircle cx='1.583' cy='6.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 6.417)'/%3e%3ccircle cx='1.583' cy='1.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 1.417)'/%3e%3ccircle cx='1.583' cy='11.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 11.417)'/%3e%3c/svg%3e",z="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M2 4h12'/%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M5.333 4V2.667a1.333 1.333 0 0 1 1.334-1.334h2.666a1.334 1.334 0 0 1 1.334 1.334V4m2 0v9.333a1.334 1.334 0 0 1-1.334 1.334H4.667a1.334 1.334 0 0 1-1.334-1.334V4zM6.667 7.333v4M9.333 7.333v4'/%3e%3c/svg%3e";let CardPostPopoverMore=({authorEmail:e,onDeletePost:t,shareUrl:i,post:l,className:a="",popoverClassName:s="",onEditPost:d})=>{let{data:{locale:h,userInfo:E,env:{isMarryBaby:_}}}=(0,n.useContext)(g.T),{t:b}=(0,r.u)(),[T,I]=(0,n.useState)(!1),[y,S]=(0,n.useState)(!1),[f,w]=(0,n.useState)(!1),{authActionWrapper:x}=(0,m.iV)(),R=e&&(null==E?void 0:E.email)&&e===String(null==E?void 0:E.email);return n.createElement("div",{className:a,onClick:e=>{e.preventDefault(),e.stopPropagation()}},f&&n.createElement(c.S,{url:i,text:null==l?void 0:l.title,onClose:()=>w(!1)}),y&&n.createElement(c.P,{thumbnail:p.C.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:b("popup.deletePost.title"),description:b("popup.deletePost.description"),acceptText:b("popup.deletePost.accept"),cancelText:b("popup.deletePost.cancel"),onAccept:()=>(0,o._)(void 0,void 0,void 0,function*(){if((null==l?void 0:l.id)&&!T){I(!0);try{let e=yield(0,c.h)({id:l.id,locale:h});(null==e?void 0:e.status)===1&&(null==t||t())}catch(e){}I(!1)}}),onClose:()=>S(!1)}),n.createElement(v.b,{className:s,toggleButtonContent:n.createElement("img",{src:_?L:j,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:T},data:R?{isShowheader:!1,type:"list",list:[{icon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M7.17 3.236H2.995a1.193 1.193 0 0 0-1.193 1.192v8.35a1.193 1.193 0 0 0 1.193 1.192h8.35a1.193 1.193 0 0 0 1.192-1.192V8.603'/%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M11.643 2.341a1.265 1.265 0 0 1 1.789 1.79L7.766 9.795l-2.385.596.596-2.385z'/%3e%3c/svg%3e",label:b("actionPopover.edit"),onClick:d},{icon:z,label:b("actionPopover.delete"),onClick:()=>{x(()=>S(!0))}}]}:{isShowheader:!1,type:"list",list:[{icon:c.i,label:b("morePopover.report"),subTree:{title:b("morePopover.report.title"),description:b("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(u.R).map(e=>({label:u.R[e].label,reason:u.R[e].reportReasonText,reasonValue:e})).map(e=>({label:b(e.label),subTree:{title:b("morePopover.reportSubmit.title"),description:b("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>n.createElement(c.b,{reason:e.reasonValue,reasonText:b(e.reason),postId:null==l?void 0:l.id,onClose:()=>t&&t(!1)})}}))}}]}}))},G=h.Z.div` position: relative; margin-bottom: 24px; background: white; border-radius: ${_.r.borderRadius}; a { text-decoration: none; } ${E.M.mbDown} { margin-bottom: 8px; } &.flat-top { border-top-left-radius: 0; border-top-right-radius: 0; } .post-pin { padding: 0.5rem 1rem; border-radius: ${_.r.borderRadius} 6px 0 0; } .post-author { display: flex; align-items: center; justify-content: space-between; &.comment { padding-right: 2.6rem; } .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${E.M.mbDown} { width: 32px; height: 32px; font-size: 16px; } } } .post-content-link-wrapper { color: inherit; cursor: pointer; .post-content-title { padding: 1rem 1rem 0; word-break: break-word; } } .social-preview-wrapper.has-image { margin-bottom: 5px; } .social-preview-wrapper, .image-preview-wrapper, .link-preview-wrapper { width: 100%; &[data-is-reply='true'] { padding-right: 1rem; padding-left: 1rem; } } .post-topics { padding: 0 1rem; } .post-reaction { background: none; border-radius: 0 0 6px 6px; &.hide-top-border { ::before { display: none; } } } .most-engaging-wrapper { padding: 1rem; cursor: pointer; .author-avatar-wrapper { width: 2rem; height: 2rem; font-size: 1rem; } .see-more-comments { width: 100%; padding: 12px 0 0; text-align: unset; } } &[data-most-engaging='true'] { border: none; ${E.M.mbDown} { margin: 1rem; border: 1px solid #e4e8ec; } } .top-divider { border-color: #e4e8ec; } .popover { .popover-menu__btn { display: flex; width: 1.5rem; height: 1rem; align-items: center; justify-content: center; padding: 0; background: transparent; &:hover { background-color: transparent; } } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 12.5px; } } } } } &[data-is-marrybaby='true'] { border: 1px solid #f3f3f3; border-radius: 1rem; /* shadow */ box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.08); .image-preview-wrapper, .link-preview-wrapper { padding-right: 1rem; padding-left: 1rem; } .popover { .popover-menu__btn { width: 24px; height: 24px; ${E.M.mbDown} { width: 18px; height: 18px; } } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 1rem; } width: 350px; ${E.M.mbDown} { max-width: calc(320px - 2rem); } } } } } .most-engaging-wrapper { position: relative; padding: 0; &::before { position: absolute; z-index: 5; top: 0; left: 50%; width: calc(100% - 2rem); height: 1px; background: #f3f3f3; content: ' '; transform: translateX(-50%); } } ${E.M.mbDown} { margin-bottom: 12px; } } `;var H="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 13.333 8 10.37l-4 2.963V3.852c0-.314.12-.616.335-.838.214-.222.505-.347.808-.347h5.714c.303 0 .594.125.808.347s.335.524.335.838z'/%3e%3c/svg%3e";let CardReplyPopover=({onDeleteComment:e,commentId:t,className:i="",popoverClassName:l=""})=>{let{data:{env:{isMarryBaby:a},locale:s},action:{pushNotifications:d}}=(0,n.useContext)(g.T),{t:p}=(0,r.u)(),[u,h]=(0,n.useState)(!1),{authActionWrapper:E}=(0,m.iV)();return n.createElement("div",{className:i,onClick:e=>{e.preventDefault(),e.stopPropagation()}},u&&n.createElement(c.P,{thumbnail:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cg stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' clip-path='url(%23a)'%3e%3cpath d='M2 4.008h12m-8.667 0V2.675a1.333 1.333 0 0 1 1.334-1.333h2.666a1.333 1.333 0 0 1 1.334 1.333v1.333m2 0v9.334a1.333 1.333 0 0 1-1.334 1.333H4.667a1.333 1.333 0 0 1-1.334-1.333V4.008zm-6 3.334v4m2.666-4v4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='a'%3e%3cpath fill='white' d='M0 .008h16v16H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",isThumbnailIcon:!0,title:p("popup.deleteComment.title"),description:p("popup.deleteComment.description"),acceptText:p("popup.deletePost.accept"),cancelText:p("popup.deletePost.cancel"),onAccept:()=>(0,o._)(void 0,void 0,void 0,function*(){var i;if(!t)return;let o=yield(0,c.j)({id:t,locale:s});(null==o?void 0:o.status)===1?(e&&e(),d({title:"",message:p("notification.success"),type:"success"})):d({title:"",message:(null===(i=null==o?void 0:o.messages)||void 0===i?void 0:i[0])||p("notification.failure"),type:"danger"})}),onClose:()=>h(!1)}),n.createElement(v.b,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:z,label:p("actionPopover.delete"),onClick:()=>{E(()=>{h(!0)})}}]},className:l,toggleButtonContent:n.createElement("img",{src:a?L:j,loading:"lazy"}),buttonProps:{}}))},V=h.Z.div` .add-link { color: ${_.r.colors.primaryBase}; } `,$=h.Z.div` margin: 16px 0; background: ${_.r.colors.yellow50}; padding: 5px 10px; border-radius: 2px; .icon { display: inline-block; vertical-align: middle; margin-right: 6px; } `,F=h.Z.div` display: flex; align-items: center; gap: 8px; `,Z=h.Z.div` padding: 8px 16px; `,Y=h.Z.div` margin-bottom: 12px; width: 100%; `,W=h.Z.div``,K=h.Z.div` margin-bottom: 16px; `,X=h.Z.div` display: flex; flex-wrap: wrap; row-gap: 16px; ${E.M.tdUp} { align-items: center; column-gap: 24px; } `,Q=h.Z.a` display: flex; align-items: center; gap: 16px; ${E.M.mbDown} { width: 100%; justify-content: space-between; } `,q=h.Z.div` display: flex; align-items: center; gap: 16px; `,J=h.Z.div` border-radius: ${_.r.borderRadius}; overflow: hidden; width: 48px; height: 48px; img { object-fit: cover; width: 100%; height: 100%; } `,RecommentCategories=({categories:e})=>{let{t}=(0,r.u)(),{data:{locale:i,env:{isMarryBaby:o}}}=(0,n.useContext)(g.T),l=(0,D.g)(i,o);return n.createElement(W,null,n.createElement(K,null,n.createElement(a.H,{tag:"h6",as:"h5"},t("cardReply.recommentCategories.heading"))),n.createElement(X,null,e.map(e=>n.createElement(Q,{href:l+e.permalink,key:String(e.termId),target:"_blank"},n.createElement(q,null,n.createElement(J,null,n.createElement("img",{src:e.featureImage||p.C.getAssetPath(o?"mb-logo.svg":"/logo/logomark.png"),alt:e.displayName,loading:"lazy"})),n.createElement(k.T,{size:"s3",weight:"bold"},e.displayName)),n.createElement(C.Z,{size:20,color:_.r.colors.gray400})))))},ee=h.Z.a` padding: 12px 0; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid ${_.r.colors.neutral100}; text-decoration: none; &:first-child { border-top: 0; } `,SourceItem=({postTitle:e,articleReviewed:t,modifiedTime:i,href:o})=>{let{t:l}=(0,r.u)(),a=(()=>{let{expert:e,editor:i,is_author:o}=t;if(e){let t={name:e.display_name,role:"expert",avatar:e.avatar};return o?Object.assign({title:l("articleAuthor.title.written-by")},t):"expert"===e.role?Object.assign({title:l("articleAuthor.title.expert")},t):Object.assign({title:l("articleAuthor.title.medical")},t)}if(i)return{title:l("articleAuthor.title.fact-check"),name:i.display_name,avatar:i.avatar}})();return n.createElement(ee,{href:o,title:e,target:"_blank"},n.createElement(k.T,{size:"s3",as:"h5",weight:"bold"},e),n.createElement("div",null,n.createElement(y.C,{avatar:null==a?void 0:a.avatar,avatarProps:{size:32},name:null==a?void 0:a.name,role:null==a?void 0:a.role,hideBackground:!0},n.createElement(y.C.SubTextRow,null,n.createElement(y.C.SubText,null,null==a?void 0:a.title," ",n.createElement("span",{style:{color:_.r.colors.gray800}},null==a?void 0:a.name)),n.createElement(y.C.SubDivider,null),n.createElement(y.C.SubText,null,i)))))};var et={header:"F4mmgSy",chevron:"A7QrQ7A"};let SourceList=e=>{var{listUrl:t,hideSourceList:i,categorySlug:s,editMode:d,collapseSource:c,onListChange:u,isMarryBaby:m}=e,v=(0,o.a)(e,["listUrl","hideSourceList","categorySlug","editMode","collapseSource","onListChange","isMarryBaby"]);let{t:h}=(0,r.u)(),[E,I]=(0,n.useState)(t||[]),[y,S]=(0,n.useState)([]),[f,w]=(0,n.useState)([]),[x,C]=(0,n.useState)(!1);(0,n.useEffect)(()=>{i||(0,o._)(void 0,void 0,void 0,function*(){C(!0);let e=E.map(e=>{let t=new URL(e),i=String(t.pathname).split("/").filter(e=>""!=e),o=t.origin,n=-1!==o.search("marrybaby.vn");return{isMarrySite:n,path:i[i.length-1],href:e}}),t=[...e.map(e=>(0,g.c)(e.isMarrySite?(0,g.s)(T.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0):(0,g.g)(T.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0),"GET"))],i=yield Promise.all(t);S(i.map((t,i)=>{var o,n;return(null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.post)&&Object.assign(Object.assign({},(0,b.f)(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.post)),{href:e[i].href})}).filter(Boolean)),C(!1)})},[]),(0,n.useEffect)(()=>{!i&&(null==y?void 0:y.length)===0&&s&&(0,o._)(void 0,void 0,void 0,function*(){var e;let t=yield(0,g.c)(m?(0,g.s)(T.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0):(0,g.g)(T.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0),"GET");(null==t?void 0:t.data)&&w([(0,b.h)(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.category)])})},[y]);let handleRemoveItem=e=>{I(t=>{let i=[...t];return i.splice(e,1),i}),S(t=>{let i=[...t];return i.splice(e,1),i})};return(0,n.useEffect)(()=>{null==u||u(E)},[E]),n.createElement("div",Object.assign({},v),!d&&n.createElement($,null,n.createElement("img",{className:"icon",src:p.C.getAssetPath("warning.svg"),alt:"warning",style:{marginBottom:"3px",width:"18px"},loading:"lazy"}),n.createElement(k.T,{size:"s3",as:"span",dangerouslySetInnerHTML:{__html:h("cardReply.disclaimer")}})),i?null:x?n.createElement(B.L,null):y.length>0||d?n.createElement(V,null,n.createElement(M.U,{defaultValue:!c&&"accordion",styles:{control:{borderRadius:"inherit",'&[aria-expanded="false"]':{borderBottom:0}},chevron:{width:"32px",height:"32px"},content:{padding:0,borderBottom:0,borderTop:`1px solid ${_.r.colors.neutral100}`},item:{marginBottom:"16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",border:`1px solid ${_.r.colors.neutral100}`,borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px","&[data-active]":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},chevron:n.createElement("div",{className:et.chevron},n.createElement(O.Z,{color:_.r.colors.gray600,size:20}))},n.createElement(M.U.Item,{value:"accordion"},n.createElement(M.U.Control,null,n.createElement("div",{className:et.header},n.createElement(a.H,{as:"h4",tag:"h6"},h("cardReply.source")))),n.createElement(M.U.Panel,null,n.createElement(Z,null,(y||[]).map((e,t)=>n.createElement(F,{key:String(t)},"object"==typeof e?n.createElement(SourceItem,Object.assign({},e)):n.createElement(Y,null,n.createElement(A.I,{style:{width:"100%"},name:"source-list",value:e||"",size:"sm",onChange:e=>{I(i=>{let o=[...i];return o[t]=e,o}),S(i=>{let o=[...i];return o[t]=e,o})}})),d&&n.createElement(l.B,{size:"md",color:"transparent",icon:n.createElement(N.Z,null),onClick:()=>handleRemoveItem(t)}))),d&&n.createElement(l.B,{className:"add-link",color:"transparent",size:"md",icon:n.createElement(R.Z,{color:_.r.colors.primaryBase,size:18}),onClick:()=>{I(e=>[...e,""]),S(e=>[...e,""])}},"Add source")))))):n.createElement(RecommentCategories,{categories:f}))},ei=h.Z.div` position: relative; margin-bottom: 0; background: white; border-radius: ${_.r.borderRadius}; .verify-tag { margin-top: 12px; } .post-author { &.with-popover { padding-right: 2.6rem; } .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${E.M.mbDown} { width: 32px; height: 32px; font-size: 16px; } } } .image-preview-wrapper, .link-preview-wrapper { width: 100%; &[data-is-reply='true'] { padding-right: 1rem; padding-left: 1rem; } } .post-reaction { background: none; border-radius: 0 0 6px 6px; } &[data-is-reply='true'] { > .post-author .author-avatar-wrapper { width: 20px; height: 20px; font-size: 10px; } } &[data-is-reply='false'] { border: 1px solid #e4e8ec; } .expert-wrapper { width: 100%; } &[data-has-booking='true'] { display: grid; .post-author { background-color: ${_.r.colors.primary50}; } .btn-wrapper { padding: 0 16px; .btn-booking { width: 100%; margin: 12px 0; } } } .comment-reply-wrapper { padding: 0 1rem; .more-cmt { .chevron-right { height: 1rem; width: 1rem; vertical-align: middle; } } } .top-divider { border-color: #e4e8ec; } .popover { position: absolute; top: 1.5rem; right: 1rem; .popover-menu__btn { display: flex; width: 1rem; height: 1rem; align-items: center; justify-content: center; padding: 0; background: transparent; &:hover { background-color: transparent; } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 12.5px; } } } } } } &[data-is-marrybaby='true'] { &[data-is-reply='false'] { border: none; } .image-preview-wrapper, .link-preview-wrapper { padding-right: 1rem; padding-left: 1rem; } .popover { .popover-menu__btn { width: 24px; height: 24px; } } margin-left: 56px; ${E.M.mbDown} { margin-left: 40px; } > .post-author { margin-left: -56px; ${E.M.mbDown} { margin-left: -40px; } .author-info { align-items: center; display: flex; align-items: center; .author-info-top { width: 100%; } .author-info-text-wrapper { justify-content: space-between; } } .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${E.M.mbDown} { width: 24px; height: 24px; font-size: 12px; } } } &[data-is-reply] { > .post-author { .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${E.M.mbDown} { width: 24px; height: 24px; font-size: 12px; } } } } .comment-reply-wrapper { padding-right: 0; padding-left: 0; } .post-reaction { &::after { position: absolute; bottom: 0; left: 50%; width: calc(100% - 2rem); height: 1px; background: #f3f3f3; content: ' '; transform: translateX(-50%); } } .post-content-wrapper { padding-top: 0; padding-bottom: 0; ${E.M.mbDown} { padding-left: 0.5rem; } } ${E.M.mbDown} { margin-bottom: 12px; } } `,eo=(0,h.Z)(SourceList)` margin-top: 12px; padding: 0.5rem 1rem 1rem; `,VerifiedTag=({userId:e,avatar:t,name:i,role:o,title:a,className:s})=>{let{t:d}=(0,r.u)(),[c,p]=(0,n.useState)(!1);return n.createElement(n.Fragment,null,n.createElement(l.B,{className:`-dzIuHr ${s}`,color:"success",size:"xs",onClick:()=>p(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},n.createElement("span",{className:"text"},n.createElement(U.Z,{isSolid:!0,size:18,color:_.r.colors.green800,className:"icon"}),d("cardReply.verifyBy",{name:`${i||""}`}))),n.createElement(y.c,{open:c,onClose:()=>p(!1),profileModalProps:{zIndex:1e3}},n.createElement(S.a,{authorProps:{userId:e,avatar:t,name:i,role:o,title:a},hideQuestionTab:!0})))},CardReply=({className:e,style:t,comment:i,type:a="comment",level:s=0,replyingId:d,onPostCommentSuccess:p,post:u,onDeleteComment:h,refetchComment:E,hasQuickBookingEnable:_,handleMakeAppointment:b,cardAuthorProps:w,maxChars:R=600,disableShortenContent:C})=>{var O,N,U,M,A,k,B,D,L,j,z,G,H;let{data:{locale:V,userInfo:$,env:{isMarryBaby:F}}}=(0,n.useContext)(g.T),{t:Z}=(0,r.u)(),[Y,W]=(0,n.useState)(i||null),{id:K,countLikes:X,content:Q,replies:q=[],images:J=[],author:ee,liked:et,link:en,mentionedUser:el,mentions:ea}=Y,{text:er,replyingTo:es}=(0,c.k)(Q),{authActionWrapper:ed}=(0,m.iV)({_joinCommunityIds:[null===(O=null==u?void 0:u.community)||void 0===O?void 0:O.id],_joinTopicIds:null===(N=null==u?void 0:u.topics)||void 0===N?void 0:N.map(e=>e.id)}),[ec,ep]=(0,n.useState)(4),eu=null!=$&&!!$.id&&(null==q?void 0:q.some(e=>e.author.id===$.id)),addNewReply=e=>{W(t=>{if(!t.replies.find(t=>t.id===e.id)){t.replies.unshift(e);let i=Object.assign(Object.assign({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return E&&E(i),i}return t})},[em,eg]=(0,n.useState)(!1),ev=(0,n.useMemo)(()=>"comment"===a&&q&&0!=q.length?q.sort((e,t)=>{let i=new Date(e.createdAt).getTime(),o=new Date(t.createdAt).getTime();return i>o?-1:i{var e,t;(null==ee?void 0:ee.hospitalId)&&(e=ee.hospitalId,(0,o._)(void 0,void 0,void 0,function*(){var t;let i=yield(0,g.c)((0,g.b)(T.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:P.v[V]}),"get");(null===(t=null==i?void 0:i._data)||void 0===t?void 0:t.branch)&&ef(null==i?void 0:i._data.branch)})),(null==ee?void 0:ee.doctorId)&&(t=ee.doctorId,(0,o._)(void 0,void 0,void 0,function*(){var e;let i=yield(0,g.c)((0,g.b)(T.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:P.v[V]}),"get");(null===(e=null==i?void 0:i._data)||void 0===e?void 0:e.doctor)&&ex(null==i?void 0:i._data.doctor)}))},[ee.hospitalId,ee.doctorId]);let eR=(null==ew?void 0:ew.valid_outpatient)||(null==ew?void 0:ew.valid_telemedicine),eC=((null==eS?void 0:eS.total_available_service)||(null==eS?void 0:eS.total_available_doctor))>0,eO=_&&(eR||eC),eN=(null===(M=null==Y?void 0:Y.author)||void 0===M?void 0:M.type)==="chatbot";return n.createElement(m.I_,{defaultParams:{_joinCommunityIds:[null===(A=null==u?void 0:u.community)||void 0===A?void 0:A.id],_joinTopicIds:null===(k=null==u?void 0:u.topics)||void 0===k?void 0:k.map(e=>e.id)}},n.createElement(ei,{className:e,style:t,"data-is-reply":!!s,"data-is-marrybaby":F,"data-has-booking":eO},"reply"===a&&n.createElement(x.D,{className:"top-divider",type:"solid"}),n.createElement("div",{style:{padding:"16px 16px 0"}},n.createElement(y.C,Object.assign({avatar:eT,name:e_,username:eb,timeText:null==u?void 0:u.createdTime,community:null==u?void 0:u.community,className:`post-author ${eE?"with-popover":""}`,type:a,userId:null==ee?void 0:ee.id,role:eI,expertId:null==ee?void 0:ee.partnerId,title:null==ee?void 0:ee.title,doctorId:null==ee?void 0:ee.doctorId,hospitalId:null==ee?void 0:ee.hospitalId,hasQuickBooking:eO,handleMakeAppointment:b,isAnonymous:(null==Y?void 0:Y.isAnonymous)||!!(null==u?void 0:u.isAnonymous)&&(null===(B=null==u?void 0:u.author)||void 0===B?void 0:B.username)===(null==ee?void 0:ee.username),hideBackground:eN,userType:null==ee?void 0:ee.type},w)),!!(null==Y?void 0:Y.isVerify)&&!(null==Y?void 0:Y.isOppose)&&n.createElement(VerifiedTag,{title:null===(D=null==Y?void 0:Y.userVerify)||void 0===D?void 0:D.title,name:null===(L=null==Y?void 0:Y.userVerify)||void 0===L?void 0:L.name,userId:null===(j=null==Y?void 0:Y.userVerify)||void 0===j?void 0:j.id,role:null===(z=null==Y?void 0:Y.userVerify)||void 0===z?void 0:z.role,avatar:null===(G=null==Y?void 0:Y.userVerify)||void 0===G?void 0:G.avatar,className:"verify-tag"})),n.createElement(S.P,{className:"post-content-wrapper",replyingTo:es,mentionedUser:el,description:er,mentions:ey,maxChars:R,disableShortenContent:C}),n.createElement("span",null),n.createElement("span",null),J&&J.length>0?n.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},n.createElement(f.a,{images:J,authorName:null==ee?void 0:ee.username})):null,(!J||0===J.length)&&en?n.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},n.createElement(I.C,{url:en})):null,"most-engaging"!==a?n.createElement(n.Fragment,null,eN&&n.createElement(eo,{listUrl:null==Y?void 0:Y.source,categorySlug:null==Y?void 0:Y.categorySlug}),n.createElement(v.C,{type:v.c.reply,loveCount:X,replyCount:eh,className:"post-reaction",liked:et,isReplied:eu,hideCommentIcon:"reply"===a||eN,hasShare:!1,onCommentClick:()=>ed(()=>eg(e=>!e)),onCommentCountClick:()=>ed(()=>{eg(!0)}),onLikeClick:()=>ed(()=>(0,o._)(void 0,void 0,void 0,function*(){if(K){let e=yield(0,c.l)({commentId:K,setLike:!et,locale:V});1===e.status&&W(e=>Object.assign(Object.assign({},e),{liked:!et,countLikes:e.countLikes+(et?-1:1)}))}}))}),em&&n.createElement(c.I,{replyingId:d||Y.id,replyToName:e_,isReply:!0,onClose:()=>eg(!1),onPostSuccess:e=>{"reply"===a?p&&p(e):addNewReply(e)},post:u,replyingUser:ee}),"comment"===a&&q&&q.length>0?n.createElement("div",{className:"comment-reply-wrapper"},null===(H=null==ev?void 0:ev.slice(0,ec))||void 0===H?void 0:H.map(e=>n.createElement(CardReply,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:s+1,replyingId:K,onPostCommentSuccess:addNewReply,post:u,onDeleteComment:()=>{W(t=>Object.assign(Object.assign({},t),{replies:t.replies.filter(t=>t.id!==e.id),countReplies:t.countReplies-1}))},handleMakeAppointment:b,hasQuickBookingEnable:_})),eh>ec&&n.createElement(n.Fragment,null,n.createElement(x.D,{className:"top-divider",type:"solid"}),n.createElement(l.B,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>ep(e=>e+4)},Z("comment.seeMoreReplies",{count:eh-ec}),n.createElement("img",{className:"chevron-right",src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%232D87F3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 12 4-4-4-4'/%3e%3c/svg%3e",loading:"lazy"})))):null):null,eE&&n.createElement(CardReplyPopover,{onDeleteComment:h,className:"popover",commentId:Y.id})))},getMostEngagingComment=(e,t)=>(0,o._)(void 0,void 0,void 0,function*(){var i,o,n;let l=yield(0,g.t)((0,g.f)(T.yy.COMMENT.LIST,{postId:e,_locale:t,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(n=null===(o=null===(i=null==l?void 0:l.data)||void 0===i?void 0:i.comments)||void 0===o?void 0:o.map(b.g))||void 0===n?void 0:n[0]}),CardPost=({className:e,style:t,hideViewMoreComment:i,showMostEngaging:s,onCommentClick:p,onCommentCountClick:h,onMostEngagingCommentClick:E,onPostCommentSuccess:_,disableCardLink:b,disableShortenContent:x,onDeletePost:R,onEditPost:C,post:O,mostEngagingComment:N,onDeleteComment:U,showInputComment:M,InlineCommentsComponent:A,hasQuickBookingEnable:k,handleMakeAppointment:B,onSaveUnsaveSuccess:D,cardAuthorProps:P,verticalReactions:L=!1})=>{let[j,z]=(0,n.useState)(O),[V,$]=(0,n.useState)(!1),[F,Z]=(0,n.useState)(N),{community:Y,topics:W,author:K,slug:X,isPin:Q,liked:q,photos:J,mentions:ee,title:et,description:ei,previewUrl:eo,likesCount:en,commentsCount:el,id:ea,commented:er}=j,{data:{locale:es,togetherUserId:ed,userInfo:ec,env:{isMarryBaby:ep,togetherBasePath:eu}},action:{pushNotifications:em}}=(0,n.useContext)(g.T),eg=!!(null==ec?void 0:ec.id),{t:ev}=(0,r.u)(),[eh,eE]=(0,n.useState)(M),e_=`${eu}/${(null==Y?void 0:Y.slug)||"_"}/${X||""}`,eb=`${(0,g.l)(es)}${e_}`,{authActionWrapper:eT}=(0,m.iV)((null==Y?void 0:Y.slug)?{_joinCommunityIds:[Y.id],_joinTopicIds:null==W?void 0:W.map(e=>e.id)}:void 0),[eI,ey]=(0,n.useState)(!1);(0,n.useEffect)(()=>{eE(M)},[M]);let eS=(null==K?void 0:K.name)||(null==K?void 0:K.username)||"",ef=(null==K?void 0:K.username)||(null==K?void 0:K.name)||"",ew=null==K?void 0:K.avatar,ex=(null==j?void 0:j.isAnonymous)?void 0:null==K?void 0:K.role,[eR,eC]=(0,n.useState)(null),[eO,eN]=(0,n.useState)(null);(0,n.useEffect)(()=>{var e,t;(null==K?void 0:K.hospitalId)&&(e=K.hospitalId,(0,o._)(void 0,void 0,void 0,function*(){var t;let i=yield(0,g.c)((0,g.b)(T.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:g.m[es]}),"get");(null===(t=null==i?void 0:i._data)||void 0===t?void 0:t.branch)&&eC(null==i?void 0:i._data.branch)})),(null==K?void 0:K.doctorId)&&(t=K.doctorId,(0,o._)(void 0,void 0,void 0,function*(){var e;let i=yield(0,g.c)((0,g.b)(T.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:g.m[es]}),"get");(null===(e=null==i?void 0:i._data)||void 0===e?void 0:e.doctor)&&eN(null==i?void 0:i._data.doctor)}))},[K.hospitalId,K.doctorId]);let eU=(null==eO?void 0:eO.valid_outpatient)||(null==eO?void 0:eO.valid_telemedicine),eM=((null==eR?void 0:eR.total_available_service)||(null==eR?void 0:eR.total_available_doctor))>0;(0,n.useEffect)(()=>{(0,o._)(void 0,void 0,void 0,function*(){if(ea&&el&&s&&!(null==N?void 0:N.id)){let e=yield getMostEngagingComment(ea,es);Z(e)}})},[ea,es,el,s,null==N?void 0:N.id]),(0,n.useEffect)(()=>{Z(N)},[null==N?void 0:N.id]);let onDeleteComment=e=>(0,o._)(void 0,void 0,void 0,function*(){if(el>1&&(null==F?void 0:F.id)&&(null==F?void 0:F.id)===(null==e?void 0:e.id)){let e=yield getMostEngagingComment(ea,es);Z(e)}z(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1})),U&&U(e)});return n.createElement(m.I_,{defaultParams:(null==Y?void 0:Y.slug)?{_joinCommunityIds:[Y.id],_joinTopicIds:null==W?void 0:W.map(e=>e.id)}:void 0},V&&n.createElement(c.S,{url:eb,avatar:u.a,text:et,onClose:()=>$(!1)}),n.createElement(G,{className:e,style:t,"data-is-marrybaby":ep},Q?n.createElement(v.a,{className:"post-pin"}):null,n.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},n.createElement(y.C,Object.assign({avatar:ew,name:eS,username:ef,url:b?void 0:e_,community:Y,timeText:null==j?void 0:j.createdTime,className:"post-author",role:ex,userId:null==K?void 0:K.id,expertId:null==K?void 0:K.partnerId,doctorId:null==K?void 0:K.doctorId,hospitalId:null==K?void 0:K.hospitalId,title:null==K?void 0:K.title,hasQuickBooking:k&&(eU||eM),handleMakeAppointment:B,"data-testid":"name",isAnonymous:!!(null==j?void 0:j.isAnonymous),extendEle:n.createElement(CardPostPopoverMore,{authorEmail:String(null==K?void 0:K.email),onDeletePost:R,shareUrl:eb,post:j,className:"popover",onEditPost:C})},P))),n.createElement("a",{href:b?void 0:e_,className:"post-content-link-wrapper"},et&&n.createElement(a.H,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},d()(et)),n.createElement(S.P,{className:"post-content-wrapper",description:ei,disableShortenContent:x,mentions:ee,"data-testid":"Content of the Post"})),n.createElement("span",null),n.createElement("span",null),n.createElement("div",{key:"tag-topic"},W&&W.length>0?n.createElement(v.T,{topics:W,className:"post-topics"}):null),n.createElement("div",{key:"social-preview"},(null==j?void 0:j.introUrl)?n.createElement("div",{className:`social-preview-wrapper ${(null==J?void 0:J.length)?"has-image":""}`},n.createElement(w.S,{url:j.introUrl,image:j.bannerImage})):null),n.createElement("div",{key:"image-preview"},(null==J?void 0:J.length)?n.createElement("div",{className:"image-preview-wrapper"},n.createElement(f.a,{images:J,authorName:null==K?void 0:K.name,isSensitive:!!(null==j?void 0:j.isSensitive)})):null),n.createElement("div",{key:"link-preview"},(null==j?void 0:j.introUrl)||(null==J?void 0:J.length)||null==eo||!eo.url?null:n.createElement("div",{className:"link-preview-wrapper"},n.createElement(I.C,{title:eo.title,url:eo.url,image:eo.image}))),n.createElement(v.C,{isMarryBaby:ep,type:v.c.post,loveCount:en,replyCount:el,className:`post-reaction ${(null==J?void 0:J.length)||(null==eo?void 0:eo.url)?"hide-top-border":""}`,liked:eI?!q:q,isReplied:er,isSaved:(null==j?void 0:j.bookmarked)||!1,onCommentClick:()=>eT(()=>{p?p():eE(e=>!e)}),onCommentCountClick:()=>{eT(()=>{ep?eE(!0):h?h():b||(window.location.href=e_)})},onShareClick:()=>{$(!0)},onLikeClick:()=>(0,o._)(void 0,void 0,void 0,function*(){eT(()=>(0,o._)(void 0,void 0,void 0,function*(){if(ea&&!eI){ey(!0);try{let e=yield(0,c.m)({id:ea,locale:es});(null==e?void 0:e.status)!==1?em((0,c.g)(ev)):z(e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked}))}catch(e){em((0,c.g)(ev))}ey(!1)}}))}),onSaveClick:()=>{eT(()=>(0,o._)(void 0,void 0,void 0,function*(){if((null==ec?void 0:ec.id)&&(null==j?void 0:j.id)){if(null==j?void 0:j.bookmarked){let e=yield(0,g.e)((0,g.f)(T.yy.BOOKMARK.DELETE,{_locale:es}),"DELETE",{headers:{"Content-Type":"application/json"},data:{post_id:String(j.id)}});(null==e?void 0:e.status)===1?(em({title:"",message:ev("post.remove.success"),type:"success",displayIcon:H}),null==D||D()):em({title:"",message:ev("post.remove.failed"),type:"danger",displayIcon:H})}else{let e=yield(0,g.e)((0,g.f)(T.yy.BOOKMARK.CREATE,{_locale:es}),"POST",{headers:{"Content-Type":"application/json"},data:{user_id:ed||ec.id,post_id:j.id}});(null==e?void 0:e.status)===1?(em({title:"",message:ev("post.save.success"),type:"success",displayIcon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23595959'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 13.333 8 10.37l-4 2.963V3.852c0-.314.12-.616.335-.838.214-.222.505-.347.808-.347h5.714c.303 0 .594.125.808.347s.335.524.335.838z'/%3e%3c/svg%3e"}),null==D||D()):em({title:"",message:ev("post.save.failed"),type:"danger",displayIcon:H})}}}))},onGoToUrl:e=>{let t=e?`${eb}${e}`:eb;eg?window.location.href=t:eT(()=>window.location.href=t)},showingMostEngaging:!!(s&&(null==F?void 0:F.id)),isVertical:L}),eh&&n.createElement(c.I,{isMainCmt:!M,onClose:()=>eE(!1),onPostSuccess:e=>{0!==el||(null==F?void 0:F.id)||Z(e),z(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0})),_&&_(e)},post:j}),s&&(null==F?void 0:F.id)?n.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{E?(e.stopPropagation(),E()):window.location.href=e_}},n.createElement(CardReply,{hasQuickBookingEnable:k,handleMakeAppointment:B,comment:F,post:j,onDeleteComment:()=>{onDeleteComment&&onDeleteComment(F)},className:"most-engaging-comment",type:"most-engaging",key:F.id,cardAuthorProps:P}),el>1&&!i&&n.createElement(l.B,{className:"see-more-comments",color:"ghost",size:"md"},ev("comment.seeMoreComments",{count:el-1}))):null,A))}},cFN4:function(e,t,i){i.d(t,{T:function(){return Text}});var o=i("T/vS"),n=i("q1tI"),l=i("dDw1");let Text=e=>{var{size:t="base",type:i="regular"}=e,a=(0,o.a)(e,["size","type"]);return n.createElement(l.T,Object.assign({size:t,weight:"caption"===i?"bold":i,"data-size":t,"data-type":i,"data-word-wrap":a.wordWrap,"data-is-uppercase":a.isUppercase},a))}}}]);