(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7462],{46440:function(e,t,o){"use strict";o.d(t,{L:function(){return r}});var l=o(67294),n=o(58499),a=o(57849),i="PD6nRZX";const r=({className:e,size:t="md"})=>{const{t:o}=(0,n.u)();return l.createElement("div",{className:`${i} ${e}`},l.createElement(a.B,{size:t,color:"transparent",isLoading:!0},o("loading")))}},37462:function(e,t,o){"use strict";o.d(t,{P:function(){return D},T:function(){return ke},U:function(){return Ne},a:function(){return Te},b:function(){return Se}});var l=o(22470),n=o(67294),a=o(90411),i=o.n(a),r=o(9496),s=o(46440),d=o(51905),c=o(22078),u=o(47440),v=o(6318),m=o(44036),p=o(73285),g=o(28833),h=o(53515),E=o(19827),y=o(43125),b=o(88125),f=o(86496),C=o(81588),k=o(58499),N=o(10917),S=o(26792),T=o(89981),x=o(67128),P=o(83129),w=o(32763),A=o(93867),_=o(27835),I=o(42396),L=o(57849);const O=A.Z.div` padding: 0.5rem 1rem 1rem; line-height: 1.5; word-break: break-word; .post-content-replying { margin-right: 5px; cursor: pointer; display: inline-block; &.tag-only { margin-right: 0; } } .post-content { display: inline; white-space: pre-wrap; /* > *:first-child, */ > mention:first-child ~ * { &:not(ul), &:not(ol) { display: inline-block; } } > mention:first-child { margin-right: 5px; } &.has-see-more { *:last-child { &:not(ul), &:not(ol) { display: inline; } } } img { width: 100%; height: unset; } ul, ol { list-style-position: inside; padding-left: 1rem; display: block; } ol { list-style-type: decimal; } ul { list-style-type: disc; } mention { color: ${e=>e.mentionColor||"#1890ff"}; padding-right: 4px; :hover { text-decoration: underline; } } .markdown { white-space: normal; p, ul, ol { margin-top: 1em; &:first-child { margin-top: 0; } } li { margin-top: 0.5em; &:first-child { margin-top: 0; } } } } `,$=A.Z.span` overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: ${e=>e.line||1}; display: -webkit-box; -webkit-box-orient: vertical; &.post-content-show-all { display: block; } `,B=A.Z.span` padding-left: 2px; background-color: ${N.r.colors.white}; bottom: 8px; position: absolute; right: 0; z-index: 10; cursor: pointer; `;var R=(0,m.k)((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 D=e=>{var{trackingCategory:t,url:o,className:a,style:i,replyingTo:r,mentionedUser:s,description:d,disableShortenContent:c,mentions:v=[],maxChars:m=1e3,maxLines:g,hideShowAllBtn:h,styles:E,onClickCreatePostLink:y}=e,b=(0,l._)(e,["trackingCategory","url","className","style","replyingTo","mentionedUser","description","disableShortenContent","mentions","maxChars","maxLines","hideShowAllBtn","styles","onClickCreatePostLink"]);const{classes:C,theme:N}=R(void 0,{name:"PostContent",styles:E}),[S,T]=(0,n.useState)(!1),[x,P]=(0,n.useState)(!1),{t:w}=(0,k.u)(),{authActionWrapper:A}=(0,_.iV)(),[L,D]=(0,n.useState)(!1),M=(0,I.d)((0,I.b)(d||"","display"),v),{action:{sanitizeFunction:U}}=(0,n.useContext)(u.T),j=(0,n.useMemo)((()=>{const e=U(M||"");if(c||S)return{showContent:e,hasSeeMore:!1};const t=e.slice(0,m),o=m-27*((t.match(/<\/div>/g)||[]).length-1),l=(t||"").slice(0,o<40?40:o),n=U(l.replace(/(<|<\/)( +|[a-zA-Z]*)$/gi,"")),a=n.lengthn.createElement(n.Fragment,null,"... ",!h&&n.createElement(p.e,Object.assign({onClick:e=>{e.preventDefault(),e.stopPropagation(),A((()=>T(!0)))},className:"see-more-text"},t?{"data-event-category":t,"data-event-action":"See More Post Click","data-event-label":o}:{}),w("post.seeMore")))),[h,o,t]),W=e=>{e.preventDefault(),null===y||void 0===y||y()};return(0,n.useEffect)((()=>{var e;return null===(e=null===q||void 0===q?void 0:q.current)||void 0===e||e.querySelectorAll("[data-create-post]").forEach((e=>{e.addEventListener("click",W,{passive:!0})})),()=>{var e;null===(e=null===q||void 0===q?void 0:q.current)||void 0===e||e.querySelectorAll("[data-create-post]").forEach((e=>{e.removeEventListener("click",W,!1)}))}}),[c,S,M]),(0,n.useEffect)((()=>{var e;F.current&&M&&g&&((e=F.current).scrollHeight>e.clientHeight?P(!0):P(!1))}),[M,g]),n.createElement(n.Fragment,null,z&&n.createElement(f.P,{isOpen:L,onClose:()=>D(!1),expertId:String(null===s||void 0===s?void 0:s.partnerId)}),n.createElement(O,Object.assign({ref:q,className:`${C.root} ${a} no-replace-click`,style:i,mentionColor:N.fn.primaryColor()},b),G&&n.createElement(p.e,{onClick:()=>z&&D(!0),className:"post-content-replying"},"@",G),(null===d||void 0===d?void 0:d.startsWith("[mention+id="))&&n.createElement("span",{className:"post-content-replying tag-only",style:{color:N.fn.primaryColor()}},"@"),g?n.createElement(n.Fragment,null,n.createElement($,{dangerouslySetInnerHTML:{__html:M},className:"post-content-line "+(S?"post-content-show-all":""),line:g,ref:F}),x&&!S&&n.createElement(B,null,Q())):n.createElement(n.Fragment,null,n.createElement("span",{dangerouslySetInnerHTML:{__html:j.showContent},className:"post-content "+(j.hasSeeMore?"has-see-more":"")}),j.hasSeeMore&&!S&&n.createElement("span",null,Q()))))};var M="l5fL1xL",U="L-aGKo7";const j=({children:e,className:t=""})=>n.createElement("div",{className:`${M} ${t}`},e),G=({children:e,className:t=""})=>n.createElement("div",{className:`${U} ${t}`},e);var z="eaR8ATZ",q="xM-7K0a",F="DZmf3s7";const Q=({src:e,defaultSrc:t=y.C.getAssetPath("logo/logomark.png"),ratio:o=1,size:l=80,radius:a=8,alt:i,className:r=""})=>n.createElement("div",{className:r},n.createElement("div",{className:F,style:{width:`${l}px`,height:l*o+"px",borderRadius:`${a}px`}},n.createElement(b.I,{src:e,backupSrc:t,alt:i}))),W=({category:e,title:t,src:o,children:l,className:a=""})=>n.createElement("div",{className:`${z} ${a}`},n.createElement(Q,{src:o}),n.createElement("div",{className:q},l||n.createElement("div",null,e&&n.createElement(j,null,e),t&&n.createElement(G,null,t))));W.CategoryText=j,W.Title=G;const Z=({featureImage:e,postTitle:t,author:o,categories:l,isReview:a,className:i=""})=>{var r;const s=a?"Medically reviewed by Jobelle Ann Dela Cruz Bigalbal, MD":"Written by Jobelle Ann Dela Cruz Bigalbal, MD";return n.createElement(W,{src:e,className:i},n.createElement(n.Fragment,null,n.createElement(W.CategoryText,null,null===(r=null===l||void 0===l?void 0:l[0])||void 0===r?void 0:r.name),n.createElement(W.Title,null,t),n.createElement(f.d,{avatarProps:Object.assign(Object.assign({},o),{size:32}),subTitle:n.createElement(n.Fragment,null,s,n.createElement(f.d.SubDivider,null),"Dec 12, 2022")})))};var V={container:"SFSgnOz",header:"Tf3aoVa",heading:"TOt4QXl",headingIcon:"_5XYN1KT",accBodyGroup:"yE-tZRj",accBodyGroupItem:"LXiGuGT",accBodyGroupDesc:"r4rx-6v",subTitle:"XrHh8-C",subIcon:"c5-Yecd",group:"UBj6nWr",groupBody:"_2vptVBd",articleCardLink:"ZPDAwiR",relatedList:"_6wJn-NR",socialItem:"_21XDdFv",mbChevronWrapper:"LSyr3Zo"};const Y=(0,n.createContext)({}),H=({className:e=""})=>{var t,o,l,a,i;const{t:r}=(0,k.u)(),{info:s,isMarryBaby:d,currentPageUrl:c}=(0,n.useContext)(Y),u=null===s||void 0===s?void 0:s.data,m=[{type:C.S.LinkedIn,icon:y.C.getAssetPath("linkedin.svg"),url:null===(t=null===s||void 0===s?void 0:s.contact)||void 0===t?void 0:t.linkedin,eventAction:"Doctor Profile - Linkedin"},{type:C.S.Instagram,icon:y.C.getAssetPath("instagram.svg"),url:null===(o=null===s||void 0===s?void 0:s.contact)||void 0===o?void 0:o.instagram,eventAction:"Doctor Profile - Instagram"},{type:C.S.Facebook,icon:y.C.getAssetPath("facebook.svg"),url:null===(l=null===s||void 0===s?void 0:s.contact)||void 0===l?void 0:l.facebook,eventAction:"Doctor Profile - Facebook"},{type:C.S.Youtube,icon:y.C.getAssetPath("youtube.svg"),url:null===(a=null===s||void 0===s?void 0:s.contact)||void 0===a?void 0:a.youtube,eventAction:"Doctor Profile - Youtube"},{type:C.S.Tiktok,icon:y.C.getAssetPath("tiktok.svg"),url:null===(i=null===s||void 0===s?void 0:s.contact)||void 0===i?void 0:i.tiktok,eventAction:"Doctor Profile - TikTok"}],p=[...((null===s||void 0===s?void 0:s.experiences)||[]).length>0?[{key:"experience",heading:r("profilePanel.experience"),iconSrc:y.C.getAssetPath(d?"award-doc-mb.svg":"award-doc.svg"),eventAction:"Doctor Experience Click",panel:n.createElement("div",{className:V.accBodyGroup},null===s||void 0===s?void 0:s.experiences.map(((e,t)=>n.createElement("div",{className:V.accBodyGroupItem,key:String(t)},n.createElement("div",{className:V.accBodyGroupTitle},e.title),n.createElement("div",{className:V.accBodyGroupDesc},n.createElement("p",null,e.organization),n.createElement("p",null,e.duration))))))}]:[],...((null===s||void 0===s?void 0:s.educations)||[]).length>0?[{key:"education",heading:r("profilePanel.education"),iconSrc:y.C.getAssetPath(d?"book-mb.svg":"book.svg"),eventAction:"Doctor Degree Click",panel:n.createElement("div",{className:V.accBodyGroup},null===s||void 0===s?void 0:s.educations.map(((e,t)=>n.createElement("div",{className:V.accBodyGroupItem,key:String(t)},n.createElement("div",{className:V.accBodyGroupTitle},e.schoolName),n.createElement("div",{className:V.accBodyGroupDesc},n.createElement("p",null,e.study),n.createElement("p",null,e.completedYear))))))}]:[],...((null===s||void 0===s?void 0:s.awards)||[]).length>0?[{key:"awards",heading:r("profilePanel.awards"),iconSrc:y.C.getAssetPath(d?"award-mb.svg":"award.svg"),eventAction:"Doctor Award Click",panel:n.createElement("div",{className:V.accBodyGroup},null===s||void 0===s?void 0:s.awards.map(((e,t)=>n.createElement("div",{className:V.accBodyGroupTitle,key:t},e.title))))}]:[]],E=(null===s||void 0===s?void 0:s.relatedPosts)||[],b=m.filter((e=>e.url));return n.createElement("div",{className:`${V.container} ${e}`,"data-is-marrybaby":d},p.length>0&&n.createElement(g.U,{defaultValue:p[0].key,chevron:d?n.createElement("div",{className:V.mbChevronWrapper},n.createElement(v.Z,{size:12,color:N.r.mbColors.midGray})):n.createElement(v.Z,{color:N.r.colors.gray400}),styles:{chevron:{"&[data-rotate]":{".minus-path":{display:"block"},".plus-path":{display:"none"}}},content:{display:"flex",flexDirection:"column",gap:"16px",padding:"0"},item:{border:0},control:{paddingLeft:0,"&:hover":{background:"transparent"},"*":{pointerEvents:"none"}}}},p.map((e=>n.createElement(g.U.Item,{key:e.key,value:e.key},n.createElement(g.U.Control,{"data-event-category":"Together","data-event-action":e.eventAction,"data-event-label":c},n.createElement("div",{className:V.header},n.createElement("div",{className:V.headingIcon},n.createElement("img",{src:e.iconSrc,loading:"lazy"})),n.createElement("div",{className:V.heading},e.heading))),n.createElement(g.U.Panel,null,e.panel))))),E.length>0&&n.createElement("div",{className:V.group},n.createElement("div",{className:V.subTitle},n.createElement("img",{className:V.subIcon,src:y.C.getAssetPath(d?"mb-logo.svg":"logo/circle-solid.svg"),loading:"lazy"}),r("profilePanel.publishedArticles")),n.createElement("div",{className:`${V.relatedList}`},null===s||void 0===s?void 0:s.relatedPosts.map((e=>n.createElement("a",{key:String(e.id),href:`${window.location.origin}${null===e||void 0===e?void 0:e.permalink}`,className:V.articleCardLink},n.createElement(Z,Object.assign({className:"article-card"},Object.assign(Object.assign({},e),!e.author&&{author:{displayName:null===u||void 0===u?void 0:u.name,avatar:null===u||void 0===u?void 0:u.avatar}}),{isReview:!0}))))))),b.length>0&&n.createElement("div",{className:V.group},n.createElement("div",{className:V.subTitle},n.createElement("img",{className:V.subIcon,src:y.C.getAssetPath(d?"social-mb.svg":"social.svg"),loading:"lazy"}),r("profilePanel.socialLinks")),n.createElement("div",{className:V.groupBody},n.createElement(h.k,null,m.map(((e,t)=>e.url&&n.createElement("div",{className:V.socialItem,key:t},n.createElement("a",{href:e.url,target:"_blank",rel:"noreferrer"},n.createElement("img",{src:e.icon,loading:"lazy",width:"32px","data-event-category":"Together","data-event-action":e.eventAction,"data-event-label":c})))))))))};var J={container:"GYUElSy",question:"_3C6QpT1",questionTitle:"_9M9VYL6",community:"_1RuSyv3",questionCard:"_1IG-eEp"};const X=({post:e,className:t=""})=>{var o,l,a,i,r,s,d,c;const{t:v}=(0,k.u)(),{data:{userInfo:m,env:{togetherBasePath:p}}}=(0,n.useContext)(u.T),{authActionWrapper:g,authorProps:h,currentPageUrl:E}=(0,n.useContext)(Y),y=`${window.location.origin}${p}/${null===(o=null===e||void 0===e?void 0:e.community)||void 0===o?void 0:o.slug}/${null===e||void 0===e?void 0:e.slug}/`;return n.createElement("div",{className:`${J.container} ${t}`},n.createElement("div",{className:J.header},n.createElement("div",{className:J.question},v("profilePanel.question")," ",n.createElement(x.b,{className:J.questionTitle,href:"#",onClick:()=>{(null===m||void 0===m?void 0:m.id)||null===g||void 0===g||g((()=>window.location.href=y),{_location:y})}},"#",null===e||void 0===e?void 0:e.title)),n.createElement("div",{className:J.community},null===(l=null===e||void 0===e?void 0:e.community)||void 0===l?void 0:l.name," - ",null===e||void 0===e?void 0:e.createdTime)),n.createElement("div",{className:J.questionCard},n.createElement(f.C,Object.assign({className:"card-author"},h,{role:"user",avatarIcon:n.createElement(S.Z,null),subLine:n.createElement(f.C.SubTextRow,null,n.createElement(f.C.SubText,null,null===(r=null===(i=null===(a=null===e||void 0===e?void 0:e.expertAnswer)||void 0===a?void 0:a.answer)||void 0===i?void 0:i[0])||void 0===r?void 0:r.createdTime))})),n.createElement(D,{className:"post-content-wrapper",description:(null===(c=null===(d=null===(s=null===e||void 0===e?void 0:e.expertAnswer)||void 0===s?void 0:s.answer)||void 0===d?void 0:d[0])||void 0===c?void 0:c.content)||"",mentions:null===e||void 0===e?void 0:e.mentions,"data-testid":"Content of the Post"})),n.createElement(w.B,{variant:"secondary","data-event-category":"Together","data-event-action":"Doctor Reply Click","data-event-label":E,size:"md",onClick:()=>{(null===m||void 0===m?void 0:m.id)?window.location.href=y:null===g||void 0===g||g((()=>window.location.href=y),{_location:y})}},v("profilePanel.anserwing.viewFull")))};var K="MrdoES3",ee="_8fd7YMs",te="DomiQfw",oe="-b2qnfL";const le=({message:e,buttonTxt:t,imgSrc:o,onBtnClick:l})=>{const{siteType:a,isMarryBaby:i}=(0,n.useContext)(Y);return n.createElement("div",{className:ee},n.createElement("div",{className:te},n.createElement("img",{src:o||y.C.getAssetPath(i?"comments-mb.svg":"comments.svg"),loading:"lazy"})),e&&n.createElement("div",{className:oe},e),t&&n.createElement(L.B,{size:"md",theme:a,color:"secondary",onClick:l},t))},ne=({id:e})=>{const{t:t}=(0,k.u)(),{data:{locale:o}}=(0,n.useContext)(u.T),{authorProps:a}=(0,n.useContext)(Y),[i,r]=(0,n.useState)(null),[v,m]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{e&&(0,l.a)(void 0,void 0,void 0,(function*(){var t;m(!0);const l=yield(0,u.c)((0,u.e)(c.yy.USER.LIST_ANSWERS,{_locale:o,id:e}),"GET"),n=((null===(t=null===l||void 0===l?void 0:l.data)||void 0===t?void 0:t.replies)||[]).map(d.a);r(n),m(!1)}))}),[]),n.createElement("div",{className:K},v?n.createElement(s.L,null):null!==i&&(i.length>0?i.map((e=>n.createElement(X,{className:"post-card",key:e.id,post:e}))):n.createElement(le,{message:t("profilePanel.emptyPostMess.content",{name:(null===a||void 0===a?void 0:a.name)||(null===a||void 0===a?void 0:a.username)})})))};var ae="toEutn7",ie="drdisHs";const re=e=>{var t,o,a,i,{post:r}=e,s=(0,l._)(e,["post"]);const{data:{env:{togetherBasePath:d}}}=(0,n.useContext)(u.T);return n.createElement(n.Fragment,null,n.createElement("div",Object.assign({},s,{className:`${ae} ${(null===s||void 0===s?void 0:s.className)||""}`}),n.createElement(f.C,{className:"card-author",avatar:null===(t=null===r||void 0===r?void 0:r.author)||void 0===t?void 0:t.avatar,name:(null===(o=null===r||void 0===r?void 0:r.author)||void 0===o?void 0:o.name)||(null===(a=null===r||void 0===r?void 0:r.author)||void 0===a?void 0:a.username),isAnonymous:Boolean(null===r||void 0===r?void 0:r.isAnonymous),subLine:n.createElement(f.C.SubTextRow,null,n.createElement(f.C.SubText,null,null===r||void 0===r?void 0:r.createdTime))}),n.createElement(x.b,{href:`${window.location.origin}${d}/${null===(i=null===r||void 0===r?void 0:r.community)||void 0===i?void 0:i.slug}/${null===r||void 0===r?void 0:r.slug}/`,className:ie,rel:"noreferrer"},null===r||void 0===r?void 0:r.title)))};var se={accordion:"I-uIJ6E",header:"_41WRsj2",heading:"AcOGL93",headingIcon:"JD3dWJN",panel:"dKAgnS8",chevron:"L2Q9T6m",container:"h-pSmhX"};const de=()=>{var e,t;const{t:o}=(0,k.u)(),{data:{locale:a,userInfo:i}}=(0,n.useContext)(u.T),{onSkipQuestion:r,countValues:v,setCountValues:m}=(0,n.useContext)(Y),[p,h]=(0,n.useState)(),[E,b]=(0,n.useState)([]),[f,C]=(0,n.useState)(!1),S=null===i||void 0===i?void 0:i.id;(0,n.useEffect)((()=>{S&&(0,l.a)(void 0,void 0,void 0,(function*(){var e;C(!0);const t=yield(0,u.b)((0,u.e)(c.yy.USER.LIST_QUESTION_NEED_REPLY,{_locale:a}),"GET"),o=[],l=Object.create({});((null===(e=null===t||void 0===t?void 0:t.data)||void 0===e?void 0:e.communities)||[]).filter((e=>((null===e||void 0===e?void 0:e.question)||[]).length>0)).map((e=>{l[e.id]=e.question.map(d.a),delete e.question,o.push((0,d.f)(e))})),b(o),h(l),C(!1)}))}),[]);const x=({id:e,communityId:t})=>{if(e&&t&&p){const o=Object.assign(Object.assign({},p),{[t]:[...((null===p||void 0===p?void 0:p[t])||[]).filter((t=>t.id!==e))]});let l=0;Object.keys(o).map((e=>l+=o[e].length||0)),h(o),m(Object.assign(Object.assign({},v),{total_question:l})),null===r||void 0===r||r(l)}};return n.createElement("div",{className:se.container},f?n.createElement(s.L,null):(null===v||void 0===v?void 0:v.total_question)>0?E.length>0&&n.createElement(g.U,{className:se.accordion,defaultValue:String((null===(t=E[null===(e=Object.keys(E))||void 0===e?void 0:e[0]])||void 0===t?void 0:t.id)||""),styles:e=>({control:{padding:"16px",border:`1px solid ${e.colors.neutral[1]}`,borderTopLeftRadius:"8px",borderTopRightRadius:"8px",'&[aria-expanded="false"]':{borderBottom:0}},chevron:{width:"32px",height:"32px"},content:{padding:0,border:`1px solid ${e.colors.neutral[1]}`,borderTop:0,borderBottom:0},label:{padding:0},item:{marginBottom:"16px"}}),chevron:n.createElement("div",{className:se.chevron},n.createElement(T.Z,{color:N.r.colors.gray600,size:20}))},E.map((e=>{const t=p&&(null===p||void 0===p?void 0:p[e.id])||[];return t.length>0&&n.createElement(g.U.Item,{key:e.id,value:String(e.id)},n.createElement(g.U.Control,null,n.createElement("div",{className:se.header},n.createElement("div",{className:se.headingIcon},n.createElement("img",{src:e.thumbnail,loading:"lazy"})),n.createElement("div",{className:se.heading},e.name))),n.createElement(g.U.Panel,null,n.createElement("div",{className:se.body},t.map((e=>n.createElement(re,{className:"question-card",key:e.id,post:e,onSkip:x}))))))}))):n.createElement(le,{message:o("profilePanel.emptyCareMess.content"),imgSrc:y.C.getAssetPath("questions.svg")}))};var ce="GA-zc-O",ue="A18McWD",ve="IB049vj",me="_8I--vEV";const pe=({post:e,className:t=""})=>{var o;const{data:{userInfo:l,env:{togetherBasePath:a}}}=(0,n.useContext)(u.T),{t:i}=(0,k.u)(),r=(0,E.rZ)(),{authActionWrapper:s,authorProps:d}=(0,n.useContext)(Y),c=`${window.location.origin}${a}/${null===(o=null===e||void 0===e?void 0:e.community)||void 0===o?void 0:o.slug}/${null===e||void 0===e?void 0:e.slug}/`;return n.createElement("div",{className:`${ce} ${t}`},n.createElement("div",{className:ve},n.createElement("a",{"data-event-category":"Together","data-event-action":"Click Post","data-event-label":c,className:me,href:c,onClick:e=>{(null===l||void 0===l?void 0:l.id)||(e.preventDefault(),null===s||void 0===s||s((()=>window.location.href=c),{_location:c}))}}),n.createElement(f.d,{className:"card-author",avatarProps:{avatar:null===d||void 0===d?void 0:d.avatar,size:32}},n.createElement(f.C.MainText,{className:ue},null===e||void 0===e?void 0:e.title),n.createElement(f.C.SubTextRow,null,n.createElement(f.C.SubText,null,null===e||void 0===e?void 0:e.createdTime))),n.createElement(D,{className:"post-content-wrapper",description:null===e||void 0===e?void 0:e.description,mentions:null===e||void 0===e?void 0:e.mentions,maxChars:200,"data-testid":"Content of the Post",hideShowAllBtn:!0}),n.createElement(P.T,{size:"p3",color:r.fn.primaryColor()},i("post.seeMore"))))};var ge="TSMHoEM";const he=()=>{const{t:e}=(0,k.u)(),{data:{locale:t}}=(0,n.useContext)(u.T),{authorId:o,authorProps:a,isAuthorLogin:i,onCloseFromPost:r}=(0,n.useContext)(Y),[v,m]=(0,n.useState)(null),[p,g]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{o&&(0,l.a)(void 0,void 0,void 0,(function*(){var e;g(!0);const l=yield(0,u.c)((0,u.e)(c.yy.USER.LIST_POST,{_locale:t,id:o,isAnonymous:0}),"GET"),n=((null===(e=null===l||void 0===l?void 0:l.data)||void 0===e?void 0:e.posts)||[]).map(d.a);m(n),g(!1)}))}),[o]),n.createElement("div",{className:ge},p?n.createElement(s.L,null):null!==v&&(v.length>0?v.map((e=>n.createElement(pe,{className:"post-card",key:e.id,post:e}))):n.createElement(le,{message:e("profilePanel.emptyPostMess.content",{name:(null===a||void 0===a?void 0:a.name)||(null===a||void 0===a?void 0:a.username)||""}),buttonTxt:i&&e("profilePanel.createPost"),onBtnClick:()=>{null===r||void 0===r||r()}})))};var Ee="_4Vekw96",ye="DIJdGcB",be="aQSt4-Q";const fe=e=>e?{title:null===e||void 0===e?void 0:e.title,organization:null===e||void 0===e?void 0:e.organization,duration:e.duration}:{},Ce=e=>e?{completedYear:null===e||void 0===e?void 0:e.completed_year,schoolName:e.school_name,study:e.study}:{};var ke,Ne;!function(e){e[e.About=0]="About",e[e.Care=1]="Care",e[e.Answer=2]="Answer",e[e.Posts=3]="Posts"}(ke||(ke={})),function(e){e[e.Expert=0]="Expert",e[e.User=1]="User"}(Ne||(Ne={}));const Se={experiences:[],relatedPosts:[],educations:[],awards:[],contact:{},data:{}},Te=e=>{var t,{authorProps:o,selectedTab:a,authActionWrapper:v,onSkipQuestion:m,onCloseFromPost:p,hideQuestionTab:g,hideAnswerTab:h,showSkipQuestionTag:E,rolesToShowQuestionsTab:y=["expert"],currentPageUrl:b}=e,C=(0,l._)(e,["authorProps","selectedTab","authActionWrapper","onSkipQuestion","onCloseFromPost","hideQuestionTab","hideAnswerTab","showSkipQuestionTag","rolesToShowQuestionsTab","currentPageUrl"]);const{data:{locale:N,userInfo:S,env:{isMarryBaby:T}}}=(0,n.useContext)(u.T),{t:x}=(0,k.u)(),P=null===o||void 0===o?void 0:o.role,w=null===S||void 0===S?void 0:S.role,A=String(null===o||void 0===o?void 0:o.userId),[_,I]=(0,n.useState)(),[L,O]=(0,n.useState)(!1),[$,B]=(0,n.useState)(),R=(null===S||void 0===S?void 0:S._togetherUserId)===(null===o||void 0===o?void 0:o.userId),D=[...-1!==y.indexOf(P)?[{value:ke.About,text:x("profilePanel.tabs.highlight"),content:n.createElement(H,{id:A,info:$}),dataEventCategory:"Together",dataEventAction:"Doctor Profile Click",dataEventLabel:b}]:[],{value:ke.Posts,text:x("profilePanel.tabs.posts"),content:n.createElement(he,null),hasCountResult:!0,keyOfCountApi:"post",keyOfResult:"total_post"},...g||-1===y.indexOf(w)||(null===S||void 0===S?void 0:S._togetherUserId)!==(null===o||void 0===o?void 0:o.userId)?[]:[{value:ke.Care,text:`${x("profilePanel.tabs.care")}`,content:n.createElement(de,null),hasCountResult:!0,keyOfCountApi:"question",keyOfResult:"total_question",dataEventCategory:"Together",dataEventAction:"Doctor Questions Click",dataEventLabel:b}],...h||-1===y.indexOf(P)?[]:[{value:ke.Answer,text:`${x("profilePanel.tabs.expertAnswer")}`,content:n.createElement(ne,{id:A}),hasCountResult:!0,keyOfCountApi:"reply",keyOfResult:"total_reply",dataEventCategory:"Together",dataEventAction:"Doctor Reply Tab Click",dataEventLabel:b}]],[M,U]=(0,n.useState)(null),[j,G]=(0,n.useState)(null),z={value:String(j),dataList:M,onTabChange:e=>G(Number(e))},q=null===D||void 0===D?void 0:D.filter((e=>null===e||void 0===e?void 0:e.hasCountResult));(0,n.useEffect)((()=>{(0,l.a)(void 0,void 0,void 0,(function*(){var e,t,o,l,n,i,r,s,v,m;O(!0);const p=yield Promise.all([(0,u.c)((0,u.e)(c.yy.USER.DETAIL,{_locale:N,id:A}),"GET"),...q.map((e=>(0,u.c)((0,u.e)(c.yy.USER.COUNT_TABS,{_locale:N,id:A,[e.keyOfCountApi]:1}),"GET")))]),[g]=p,h={data:null===g||void 0===g?void 0:g.data,experiences:((null===(t=null===(e=null===g||void 0===g?void 0:g.data)||void 0===e?void 0:e.fields)||void 0===t?void 0:t.experiences)||[]).map(fe),relatedPosts:((null===(o=null===g||void 0===g?void 0:g.data)||void 0===o?void 0:o.related_post)||[]).map((e=>(0,d.g)(e.post))),educations:((null===(n=null===(l=null===g||void 0===g?void 0:g.data)||void 0===l?void 0:l.fields)||void 0===n?void 0:n.educations)||[]).map(Ce),awards:(null===(r=null===(i=null===g||void 0===g?void 0:g.data)||void 0===i?void 0:i.fields)||void 0===r?void 0:r.awards_accreditations)||[],contact:(null===(v=null===(s=null===g||void 0===g?void 0:g.data)||void 0===s?void 0:s.fields)||void 0===v?void 0:v.contact)||{}};1===(null===g||void 0===g?void 0:g.status)&&B(h);const E=(null===h||void 0===h?void 0:h.relatedPosts)||[],y=Object.keys(h.contact).map((e=>{var t;return""!==(null===(t=null===h||void 0===h?void 0:h.contact)||void 0===t?void 0:t[e])})),b=[...(null===h||void 0===h?void 0:h.experiences)||[],...(null===h||void 0===h?void 0:h.educations)||[],...(null===h||void 0===h?void 0:h.awards)||[]],f=E.length>0||y.length>0||b.length>0,C={},k=q.map(((e,t)=>{var o,l,n;const a=(null===(n=null===(l=null===(o=p[t+1])||void 0===o?void 0:o.data)||void 0===l?void 0:l.counting)||void 0===n?void 0:n[e.keyOfResult])||0;return a>0?(C[e.keyOfResult]=a,e):-1!==[ke.Care,ke.Posts].indexOf(e.value)?e:void 0})).filter(Boolean).map((e=>e.value)),S=D.map((e=>{const t=Object.assign(Object.assign({},e),{text:e.text+(e.keyOfResult?` (${(null===C||void 0===C?void 0:C[e.keyOfResult])||"0"})`:"")});return t.hasCountResult?-1!==k.indexOf(t.value)?t:void 0:t.value===ke.About?f&&t:t})).filter(Boolean);U(S),G(a||(null===(m=null===S||void 0===S?void 0:S[0])||void 0===m?void 0:m.value)),I(C),O(!1)}))}),[]);const F=null===$||void 0===$?void 0:$.data;return n.createElement(Y.Provider,{value:{isMarryBaby:T,siteType:T?"marryBaby":"helloSites",authorId:String((null===o||void 0===o?void 0:o.userId)||""),authActionWrapper:v,onSkipQuestion:m,info:$,authorProps:o,onCloseFromPost:p,countValues:_,setCountValues:I,isAuthorLogin:R,showSkipQuestionTag:E,currentPageUrl:b}},n.createElement("div",Object.assign({},C,{className:`${Ee} ${(null===C||void 0===C?void 0:C.className)||""}`,"data-is-marrybaby":T}),L?n.createElement(s.L,null):n.createElement(n.Fragment,null,n.createElement(f.C,Object.assign({},o,{className:"card-author",showDetailPopup:!1,subLine:"expert"===(null===o||void 0===o?void 0:o.role)?(null===F||void 0===F?void 0:F.specialty)&&(null===F||void 0===F?void 0:F.organisation)&&n.createElement(f.C.SubTextRow,null,(null===F||void 0===F?void 0:F.specialty)&&n.createElement(n.Fragment,null,n.createElement(f.C.SubText,null,null===F||void 0===F?void 0:F.specialty),n.createElement(f.C.SubDivider,null)),n.createElement(f.C.SubText,null,null===F||void 0===F?void 0:F.organisation)):(null===F||void 0===F?void 0:F.created_at)&&n.createElement(f.C.SubTextRow,null,n.createElement(f.C.SubText,null,x("profilePanel.joined")," ",i()(null===F||void 0===F?void 0:F.created_at).toNow(!0)))})),"expert"===P&&n.createElement("div",{className:ye,dangerouslySetInnerHTML:{__html:null===(t=null===$||void 0===$?void 0:$.data)||void 0===t?void 0:t.description}}),null!==M&&null!==j&&(M.length>0?n.createElement("div",{className:be},n.createElement(r.T,Object.assign({},z))):n.createElement(le,{message:x("profilePanel.emptyPostMess.content",{text:(null===o||void 0===o?void 0:o.name)||(null===o||void 0===o?void 0:o.username)||""})})))))}}}]);