"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[137],{"+mQj":function(e,t,a){a.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 l=a("Cxxo"),n=a("q1tI"),i=a("JJ6e"),o=a("UESe"),r=a("bSpP"),s=a("ns0B"),d=a.n(s),c=a("CVgL"),m=a("Y6+v"),u=a("7R3W"),p=a("aZjv"),g=a("9E0F"),v=a("KF5v"),h=a("rBCA"),b=a("e0Et"),E=a("iBNF"),x=a("r0Za"),f=a("IQVP"),w=a("wupm"),y=a("PFNZ"),C=a("G2uU"),k=a("UUbN"),S=a("ugWB"),T=a("oXAm"),N=a("oTwY"),P=a("iZ8j"),I=a("e0pn"),z=a("LWwf"),A=a("PbOM"),_=a("bpvy"),j=a("kXWp"),R=a("Rh7u"),L=a("6a23"),O=a("kigt"),$=a("xrdX"),M="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",B="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",F="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:a,post:i,className:o="",popoverClassName:s="",onEditPost:d})=>{let{data:{locale:h,userInfo:b,env:{isMarryBaby:E}}}=(0,n.useContext)(g.T),{t:x}=(0,r.u)(),[f,w]=(0,n.useState)(!1),[y,C]=(0,n.useState)(!1),[k,S]=(0,n.useState)(!1),{authActionWrapper:T}=(0,p.iV)(),N=e&&(null==b?void 0:b.email)&&e===String(null==b?void 0:b.email);return n.createElement("div",{className:o,onClick:e=>{e.preventDefault(),e.stopPropagation()}},k&&n.createElement(c.S,{url:a,text:null==i?void 0:i.title,onClose:()=>S(!1)}),y&&n.createElement(c.P,{thumbnail:m.C.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:x("popup.deletePost.title"),description:x("popup.deletePost.description"),acceptText:x("popup.deletePost.accept"),cancelText:x("popup.deletePost.cancel"),onAccept:()=>(0,l.a)(void 0,void 0,void 0,function*(){if((null==i?void 0:i.id)&&!f){w(!0);try{let e=yield(0,c.h)({id:i.id,locale:h});(null==e?void 0:e.status)===1&&(null==t||t())}catch(e){}w(!1)}}),onClose:()=>C(!1)}),n.createElement(v.b,{className:s,toggleButtonContent:n.createElement("img",{src:E?M:B,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:f},data:N?{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:x("actionPopover.edit"),onClick:d},{icon:F,label:x("actionPopover.delete"),onClick:()=>{T(()=>C(!0))}}]}:{isShowheader:!1,type:"list",list:[{icon:c.i,label:x("morePopover.report"),subTree:{title:x("morePopover.report.title"),description:x("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:x(e.label),subTree:{title:x("morePopover.reportSubmit.title"),description:x("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>n.createElement(c.b,{reason:e.reasonValue,reasonText:x(e.reason),postId:null==i?void 0:i.id,onClose:()=>t&&t(!1)})}}))}}]}}))},D=h.Z.div` position: relative; margin-bottom: 24px; background: white; border-radius: ${E.r.borderRadius}; a { text-decoration: none; } ${b.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: ${E.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; ${b.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; ${b.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; ${b.M.mbDown} { width: 18px; height: 18px; } } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 1rem; } width: 350px; ${b.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%); } } ${b.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:a="",popoverClassName:i=""})=>{let{data:{env:{isMarryBaby:o},locale:s},action:{pushNotifications:d}}=(0,n.useContext)(g.T),{t:m}=(0,r.u)(),[u,h]=(0,n.useState)(!1),{authActionWrapper:b}=(0,p.iV)();return n.createElement("div",{className:a,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:m("popup.deleteComment.title"),description:m("popup.deleteComment.description"),acceptText:m("popup.deletePost.accept"),cancelText:m("popup.deletePost.cancel"),onAccept:()=>(0,l.a)(void 0,void 0,void 0,function*(){var a;if(!t)return;let l=yield(0,c.j)({id:t,locale:s});(null==l?void 0:l.status)===1?(e&&e(),d({title:"",message:m("notification.success"),type:"success"})):d({title:"",message:(null===(a=null==l?void 0:l.messages)||void 0===a?void 0:a[0])||m("notification.failure"),type:"danger"})}),onClose:()=>h(!1)}),n.createElement(v.b,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:F,label:m("actionPopover.delete"),onClick:()=>{b(()=>{h(!0)})}}]},className:i,toggleButtonContent:n.createElement("img",{src:o?M:B,loading:"lazy"}),buttonProps:{}}))},Z=h.Z.div` .add-link { color: ${E.r.colors.primaryBase}; } `,U=h.Z.div` margin: 16px 0; background: ${E.r.colors.yellow50}; padding: 5px 10px; border-radius: 2px; .icon { display: inline-block; vertical-align: middle; margin-right: 6px; } `,V=h.Z.div` display: flex; align-items: center; gap: 8px; `,Q=h.Z.div` padding: 8px 16px; `,q=h.Z.div` margin-bottom: 12px; width: 100%; `,W=h.Z.div``,G=h.Z.div` margin-bottom: 16px; `,K=h.Z.div` display: flex; flex-wrap: wrap; row-gap: 16px; ${b.M.tdUp} { align-items: center; column-gap: 24px; } `,Y=h.Z.a` display: flex; align-items: center; gap: 16px; ${b.M.mbDown} { width: 100%; justify-content: space-between; } `,X=h.Z.div` display: flex; align-items: center; gap: 16px; `,J=h.Z.div` border-radius: ${E.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:a,env:{isMarryBaby:l}}}=(0,n.useContext)(g.T),i=(0,O.g)(a,l);return n.createElement(W,null,n.createElement(G,null,n.createElement(o.H,{tag:"h6",as:"h5"},t("cardReply.recommentCategories.heading"))),n.createElement(K,null,e.map(e=>n.createElement(Y,{href:i+e.permalink,key:String(e.termId),target:"_blank"},n.createElement(X,null,n.createElement(J,null,n.createElement("img",{src:e.featureImage||m.C.getAssetPath(l?"mb-logo.svg":"/logo/logomark.png"),alt:e.displayName,loading:"lazy"})),n.createElement(R.T,{size:"s3",weight:"bold"},e.displayName)),n.createElement(P.Z,{size:20,color:E.r.colors.gray400})))))},ee=h.Z.a` padding: 12px 0; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid ${E.r.colors.neutral100}; text-decoration: none; &:first-child { border-top: 0; } `,SourceItem=({postTitle:e,articleReviewed:t,modifiedTime:a,href:l})=>{let{t:i}=(0,r.u)(),o=(()=>{let{expert:e,editor:a,is_author:l}=t;if(e){let t={name:e.display_name,role:"expert",avatar:e.avatar};return l?Object.assign({title:i("articleAuthor.title.written-by")},t):"expert"===e.role?Object.assign({title:i("articleAuthor.title.expert")},t):Object.assign({title:i("articleAuthor.title.medical")},t)}if(a)return{title:i("articleAuthor.title.fact-check"),name:a.display_name,avatar:a.avatar}})();return n.createElement(ee,{href:l,title:e,target:"_blank"},n.createElement(R.T,{size:"s3",as:"h5",weight:"bold"},e),n.createElement("div",null,n.createElement(y.C,{avatar:null==o?void 0:o.avatar,avatarProps:{size:32},name:null==o?void 0:o.name,role:null==o?void 0:o.role,hideBackground:!0},n.createElement(y.C.SubTextRow,null,n.createElement(y.C.SubText,null,null==o?void 0:o.title," ",n.createElement("span",{style:{color:E.r.colors.gray800}},null==o?void 0:o.name)),n.createElement(y.C.SubDivider,null),n.createElement(y.C.SubText,null,a)))))};var et={header:"F4mmgSy",chevron:"A7QrQ7A"};let SourceList=e=>{var{listUrl:t,hideSourceList:a,categorySlug:s,editMode:d,collapseSource:c,onListChange:u,isMarryBaby:p}=e,v=(0,l._)(e,["listUrl","hideSourceList","categorySlug","editMode","collapseSource","onListChange","isMarryBaby"]);let{t:h}=(0,r.u)(),[b,w]=(0,n.useState)(t||[]),[y,C]=(0,n.useState)([]),[k,S]=(0,n.useState)([]),[T,P]=(0,n.useState)(!1);(0,n.useEffect)(()=>{a||(0,l.a)(void 0,void 0,void 0,function*(){P(!0);let e=b.map(e=>{let t=new URL(e),a=String(t.pathname).split("/").filter(e=>""!=e),l=t.origin,n=-1!==l.search("marrybaby.vn");return{isMarrySite:n,path:a[a.length-1],href:e}}),t=[...e.map(e=>(0,g.c)(e.isMarrySite?(0,g.s)(f.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0):(0,g.o)(f.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0),"GET"))],a=yield Promise.all(t);C(a.map((t,a)=>{var l,n;return(null===(l=null==t?void 0:t.data)||void 0===l?void 0:l.post)&&Object.assign(Object.assign({},(0,x.g)(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.post)),{href:e[a].href})}).filter(Boolean)),P(!1)})},[]),(0,n.useEffect)(()=>{!a&&(null==y?void 0:y.length)===0&&s&&(0,l.a)(void 0,void 0,void 0,function*(){var e;let t=yield(0,g.c)(p?(0,g.s)(f.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0):(0,g.o)(f.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0),"GET");(null==t?void 0:t.data)&&S([(0,x.h)(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.category)])})},[y]);let handleRemoveItem=e=>{w(t=>{let a=[...t];return a.splice(e,1),a}),C(t=>{let a=[...t];return a.splice(e,1),a})};return(0,n.useEffect)(()=>{null==u||u(b)},[b]),n.createElement("div",Object.assign({},v),!d&&n.createElement(U,null,n.createElement("img",{className:"icon",src:m.C.getAssetPath("warning.svg"),alt:"warning",style:{marginBottom:"3px",width:"18px"},loading:"lazy"}),n.createElement(R.T,{size:"s3",as:"span",dangerouslySetInnerHTML:{__html:h("cardReply.disclaimer")}})),a?null:T?n.createElement(L.L,null):y.length>0||d?n.createElement(Z,null,n.createElement(_.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 ${E.r.colors.neutral100}`},item:{marginBottom:"16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",border:`1px solid ${E.r.colors.neutral100}`,borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px","&[data-active]":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},chevron:n.createElement("div",{className:et.chevron},n.createElement(I.Z,{color:E.r.colors.gray600,size:20}))},n.createElement(_.U.Item,{value:"accordion"},n.createElement(_.U.Control,null,n.createElement("div",{className:et.header},n.createElement(o.H,{as:"h4",tag:"h6"},h("cardReply.source")))),n.createElement(_.U.Panel,null,n.createElement(Q,null,(y||[]).map((e,t)=>n.createElement(V,{key:String(t)},"object"==typeof e?n.createElement(SourceItem,Object.assign({},e)):n.createElement(q,null,n.createElement(j.I,{style:{width:"100%"},name:"source-list",value:e||"",size:"sm",onChange:e=>{w(a=>{let l=[...a];return l[t]=e,l}),C(a=>{let l=[...a];return l[t]=e,l})}})),d&&n.createElement(i.B,{size:"md",color:"transparent",icon:n.createElement(z.Z,null),onClick:()=>handleRemoveItem(t)}))),d&&n.createElement(i.B,{className:"add-link",color:"transparent",size:"md",icon:n.createElement(N.Z,{color:E.r.colors.primaryBase,size:18}),onClick:()=>{w(e=>[...e,""]),C(e=>[...e,""])}},"Add source")))))):n.createElement(RecommentCategories,{categories:k}))},ea=h.Z.div` position: relative; margin-bottom: 0; background: white; border-radius: ${E.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; ${b.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: ${E.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; ${b.M.mbDown} { margin-left: 40px; } > .post-author { margin-left: -56px; ${b.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; ${b.M.mbDown} { width: 24px; height: 24px; font-size: 12px; } } } &[data-is-reply] { > .post-author { .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${b.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; ${b.M.mbDown} { padding-left: 0.5rem; } } ${b.M.mbDown} { margin-bottom: 12px; } } `,el=(0,h.Z)(SourceList)` margin-top: 12px; padding: 0.5rem 1rem 1rem; `,VerifiedTag=({userId:e,avatar:t,name:a,role:l,title:o,className:s})=>{let{t:d}=(0,r.u)(),[c,m]=(0,n.useState)(!1);return n.createElement(n.Fragment,null,n.createElement(i.B,{className:`-dzIuHr ${s}`,color:"success",size:"xs",onClick:()=>m(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},n.createElement("span",{className:"text"},n.createElement(A.Z,{isSolid:!0,size:18,color:E.r.colors.green800,className:"icon"}),d("cardReply.verifyBy",{name:`${a||""}`}))),n.createElement(y.c,{open:c,onClose:()=>m(!1),profileModalProps:{zIndex:1e3}},n.createElement(C.a,{authorProps:{userId:e,avatar:t,name:a,role:l,title:o},hideQuestionTab:!0})))},CardReply=({className:e,style:t,comment:a,type:o="comment",level:s=0,replyingId:d,onPostCommentSuccess:m,post:u,onDeleteComment:h,refetchComment:b,hasQuickBookingEnable:E,handleMakeAppointment:x,cardAuthorProps:S,maxChars:N=600,disableShortenContent:P})=>{var I,z,A,_,j,R,L,O,M,B,F,D,H;let{data:{locale:Z,userInfo:U,env:{isMarryBaby:V}}}=(0,n.useContext)(g.T),{t:Q}=(0,r.u)(),[q,W]=(0,n.useState)(a||null),{id:G,countLikes:K,content:Y,replies:X=[],images:J=[],author:ee,liked:et,link:en,mentionedUser:ei,mentions:eo}=q,{text:er,replyingTo:es}=(0,c.k)(Y),{authActionWrapper:ed}=(0,p.iV)({_joinCommunityIds:[null===(I=null==u?void 0:u.community)||void 0===I?void 0:I.id],_joinTopicIds:null===(z=null==u?void 0:u.topics)||void 0===z?void 0:z.map(e=>e.id)}),[ec,em]=(0,n.useState)(4),eu=null!=U&&!!U.id&&(null==X?void 0:X.some(e=>e.author.id===U.id)),addNewReply=e=>{W(t=>{if(!t.replies.find(t=>t.id===e.id)){t.replies.unshift(e);let a=Object.assign(Object.assign({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return b&&b(a),a}return t})},[ep,eg]=(0,n.useState)(!1),ev=(0,n.useMemo)(()=>"comment"===o&&X&&0!=X.length?X.sort((e,t)=>{let a=new Date(e.createdAt).getTime(),l=new Date(t.createdAt).getTime();return a>l?-1:a{var e,t;(null==ee?void 0:ee.hospitalId)&&(e=ee.hospitalId,(0,l.a)(void 0,void 0,void 0,function*(){var t;let a=yield(0,g.c)((0,g.g)(f.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:$.v[Z]}),"get");(null===(t=null==a?void 0:a._data)||void 0===t?void 0:t.branch)&&ek(null==a?void 0:a._data.branch)})),(null==ee?void 0:ee.doctorId)&&(t=ee.doctorId,(0,l.a)(void 0,void 0,void 0,function*(){var e;let a=yield(0,g.c)((0,g.g)(f.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:$.v[Z]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&eT(null==a?void 0:a._data.doctor)}))},[ee.hospitalId,ee.doctorId]);let eN=(null==eS?void 0:eS.valid_outpatient)||(null==eS?void 0:eS.valid_telemedicine),eP=((null==eC?void 0:eC.total_available_service)||(null==eC?void 0:eC.total_available_doctor))>0,eI=E&&(eN||eP),ez=(null===(_=null==q?void 0:q.author)||void 0===_?void 0:_.type)==="chatbot";return n.createElement(p.I_,{defaultParams:{_joinCommunityIds:[null===(j=null==u?void 0:u.community)||void 0===j?void 0:j.id],_joinTopicIds:null===(R=null==u?void 0:u.topics)||void 0===R?void 0:R.map(e=>e.id)}},n.createElement(ea,{className:e,style:t,"data-is-reply":!!s,"data-is-marrybaby":V,"data-has-booking":eI},"reply"===o&&n.createElement(T.D,{className:"top-divider",type:"solid"}),n.createElement("div",{style:{padding:"16px 16px 0"}},n.createElement(y.C,Object.assign({avatar:ef,name:eE,username:ex,timeText:null==u?void 0:u.createdTime,community:null==u?void 0:u.community,className:`post-author ${eb?"with-popover":""}`,type:o,userId:null==ee?void 0:ee.id,role:ew,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:eI,handleMakeAppointment:x,isAnonymous:(null==q?void 0:q.isAnonymous)||!!(null==u?void 0:u.isAnonymous)&&(null===(L=null==u?void 0:u.author)||void 0===L?void 0:L.username)===(null==ee?void 0:ee.username),hideBackground:ez,userType:null==ee?void 0:ee.type},S)),!!(null==q?void 0:q.isVerify)&&!(null==q?void 0:q.isOppose)&&n.createElement(VerifiedTag,{title:null===(O=null==q?void 0:q.userVerify)||void 0===O?void 0:O.title,name:null===(M=null==q?void 0:q.userVerify)||void 0===M?void 0:M.name,userId:null===(B=null==q?void 0:q.userVerify)||void 0===B?void 0:B.id,role:null===(F=null==q?void 0:q.userVerify)||void 0===F?void 0:F.role,avatar:null===(D=null==q?void 0:q.userVerify)||void 0===D?void 0:D.avatar,className:"verify-tag"})),n.createElement(C.P,{className:"post-content-wrapper",replyingTo:es,mentionedUser:ei,description:er,mentions:ey,maxChars:N,disableShortenContent:P}),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(k.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(w.C,{url:en})):null,"most-engaging"!==o?n.createElement(n.Fragment,null,ez&&n.createElement(el,{listUrl:null==q?void 0:q.source,categorySlug:null==q?void 0:q.categorySlug}),n.createElement(v.C,{type:v.c.reply,loveCount:K,replyCount:eh,className:"post-reaction",liked:et,isReplied:eu,hideCommentIcon:"reply"===o||ez,hasShare:!1,onCommentClick:()=>ed(()=>eg(e=>!e)),onCommentCountClick:()=>ed(()=>{eg(!0)}),onLikeClick:()=>ed(()=>(0,l.a)(void 0,void 0,void 0,function*(){if(G){let e=yield(0,c.l)({commentId:G,setLike:!et,locale:Z});1===e.status&&W(e=>Object.assign(Object.assign({},e),{liked:!et,countLikes:e.countLikes+(et?-1:1)}))}}))}),ep&&n.createElement(c.I,{replyingId:d||q.id,replyToName:eE,isReply:!0,onClose:()=>eg(!1),onPostSuccess:e=>{"reply"===o?m&&m(e):addNewReply(e)},post:u,replyingUser:ee}),"comment"===o&&X&&X.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:G,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:x,hasQuickBookingEnable:E})),eh>ec&&n.createElement(n.Fragment,null,n.createElement(T.D,{className:"top-divider",type:"solid"}),n.createElement(i.B,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>em(e=>e+4)},Q("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,eb&&n.createElement(CardReplyPopover,{onDeleteComment:h,className:"popover",commentId:q.id})))},getMostEngagingComment=(e,t)=>(0,l.a)(void 0,void 0,void 0,function*(){var a,l,n;let i=yield(0,g.t)((0,g.e)(f.yy.COMMENT.LIST,{postId:e,_locale:t,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(n=null===(l=null===(a=null==i?void 0:i.data)||void 0===a?void 0:a.comments)||void 0===l?void 0:l.map(x.e))||void 0===n?void 0:n[0]}),CardPost=({className:e,style:t,hideViewMoreComment:a,showMostEngaging:s,onCommentClick:m,onCommentCountClick:h,onMostEngagingCommentClick:b,onPostCommentSuccess:E,disableCardLink:x,disableShortenContent:T,onDeletePost:N,onEditPost:P,post:I,mostEngagingComment:z,onDeleteComment:A,showInputComment:_,InlineCommentsComponent:j,hasQuickBookingEnable:R,handleMakeAppointment:L,onSaveUnsaveSuccess:O,cardAuthorProps:$,verticalReactions:M=!1})=>{let[B,F]=(0,n.useState)(I),[Z,U]=(0,n.useState)(!1),[V,Q]=(0,n.useState)(z),{community:q,topics:W,author:G,slug:K,isPin:Y,liked:X,photos:J,mentions:ee,title:et,description:ea,previewUrl:el,likesCount:en,commentsCount:ei,id:eo,commented:er}=B,{data:{locale:es,togetherUserId:ed,userInfo:ec,env:{isMarryBaby:em,togetherBasePath:eu}},action:{pushNotifications:ep}}=(0,n.useContext)(g.T),eg=!!(null==ec?void 0:ec.id),{t:ev}=(0,r.u)(),[eh,eb]=(0,n.useState)(_),eE=`${eu}/${(null==q?void 0:q.slug)||"_"}/${K||""}`,ex=`${(0,g.k)(es)}${eE}`,{authActionWrapper:ef}=(0,p.iV)((null==q?void 0:q.slug)?{_joinCommunityIds:[q.id],_joinTopicIds:null==W?void 0:W.map(e=>e.id)}:void 0),[ew,ey]=(0,n.useState)(!1);(0,n.useEffect)(()=>{eb(_)},[_]);let eC=(null==G?void 0:G.name)||(null==G?void 0:G.username)||"",ek=(null==G?void 0:G.username)||(null==G?void 0:G.name)||"",eS=null==G?void 0:G.avatar,eT=(null==B?void 0:B.isAnonymous)?void 0:null==G?void 0:G.role,[eN,eP]=(0,n.useState)(null),[eI,ez]=(0,n.useState)(null);(0,n.useEffect)(()=>{var e,t;(null==G?void 0:G.hospitalId)&&(e=G.hospitalId,(0,l.a)(void 0,void 0,void 0,function*(){var t;let a=yield(0,g.c)((0,g.g)(f.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:g.l[es]}),"get");(null===(t=null==a?void 0:a._data)||void 0===t?void 0:t.branch)&&eP(null==a?void 0:a._data.branch)})),(null==G?void 0:G.doctorId)&&(t=G.doctorId,(0,l.a)(void 0,void 0,void 0,function*(){var e;let a=yield(0,g.c)((0,g.g)(f.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:g.l[es]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&ez(null==a?void 0:a._data.doctor)}))},[G.hospitalId,G.doctorId]);let eA=(null==eI?void 0:eI.valid_outpatient)||(null==eI?void 0:eI.valid_telemedicine),e_=((null==eN?void 0:eN.total_available_service)||(null==eN?void 0:eN.total_available_doctor))>0;(0,n.useEffect)(()=>{(0,l.a)(void 0,void 0,void 0,function*(){if(eo&&ei&&s&&!(null==z?void 0:z.id)){let e=yield getMostEngagingComment(eo,es);Q(e)}})},[eo,es,ei,s,null==z?void 0:z.id]),(0,n.useEffect)(()=>{Q(z)},[null==z?void 0:z.id]);let onDeleteComment=e=>(0,l.a)(void 0,void 0,void 0,function*(){if(ei>1&&(null==V?void 0:V.id)&&(null==V?void 0:V.id)===(null==e?void 0:e.id)){let e=yield getMostEngagingComment(eo,es);Q(e)}F(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1})),A&&A(e)});return n.createElement(p.I_,{defaultParams:(null==q?void 0:q.slug)?{_joinCommunityIds:[q.id],_joinTopicIds:null==W?void 0:W.map(e=>e.id)}:void 0},Z&&n.createElement(c.S,{url:ex,avatar:u.D,text:et,onClose:()=>U(!1)}),n.createElement(D,{className:e,style:t,"data-is-marrybaby":em},Y?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:eS,name:eC,username:ek,url:x?void 0:eE,community:q,timeText:null==B?void 0:B.createdTime,className:"post-author",role:eT,userId:null==G?void 0:G.id,expertId:null==G?void 0:G.partnerId,doctorId:null==G?void 0:G.doctorId,hospitalId:null==G?void 0:G.hospitalId,title:null==G?void 0:G.title,hasQuickBooking:R&&(eA||e_),handleMakeAppointment:L,"data-testid":"name",isAnonymous:!!(null==B?void 0:B.isAnonymous),extendEle:n.createElement(CardPostPopoverMore,{authorEmail:String(null==G?void 0:G.email),onDeletePost:N,shareUrl:ex,post:B,className:"popover",onEditPost:P})},$))),n.createElement("a",{href:x?void 0:eE,className:"post-content-link-wrapper"},et&&n.createElement(o.H,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},d()(et)),n.createElement(C.P,{className:"post-content-wrapper",description:ea,disableShortenContent:T,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==B?void 0:B.introUrl)?n.createElement("div",{className:`social-preview-wrapper ${(null==J?void 0:J.length)?"has-image":""}`},n.createElement(S.S,{url:B.introUrl,image:B.bannerImage})):null),n.createElement("div",{key:"image-preview"},(null==J?void 0:J.length)?n.createElement("div",{className:"image-preview-wrapper"},n.createElement(k.a,{images:J,authorName:null==G?void 0:G.name,isSensitive:!!(null==B?void 0:B.isSensitive)})):null),n.createElement("div",{key:"link-preview"},(null==B?void 0:B.introUrl)||(null==J?void 0:J.length)||null==el||!el.url?null:n.createElement("div",{className:"link-preview-wrapper"},n.createElement(w.C,{title:el.title,url:el.url,image:el.image}))),n.createElement(v.C,{isMarryBaby:em,type:v.c.post,loveCount:en,replyCount:ei,className:`post-reaction ${(null==J?void 0:J.length)||(null==el?void 0:el.url)?"hide-top-border":""}`,liked:ew?!X:X,isReplied:er,isSaved:(null==B?void 0:B.bookmarked)||!1,onCommentClick:()=>ef(()=>{m?m():eb(e=>!e)}),onCommentCountClick:()=>{ef(()=>{em?eb(!0):h?h():x||(window.location.href=eE)})},onShareClick:()=>{U(!0)},onLikeClick:()=>(0,l.a)(void 0,void 0,void 0,function*(){ef(()=>(0,l.a)(void 0,void 0,void 0,function*(){if(eo&&!ew){ey(!0);try{let e=yield(0,c.m)({id:eo,locale:es});(null==e?void 0:e.status)!==1?ep((0,c.g)(ev)):F(e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked}))}catch(e){ep((0,c.g)(ev))}ey(!1)}}))}),onSaveClick:()=>{ef(()=>(0,l.a)(void 0,void 0,void 0,function*(){if((null==ec?void 0:ec.id)&&(null==B?void 0:B.id)){if(null==B?void 0:B.bookmarked){let e=yield(0,g.b)((0,g.e)(f.yy.BOOKMARK.DELETE,{_locale:es}),"DELETE",{headers:{"Content-Type":"application/json"},data:{post_id:String(B.id)}});(null==e?void 0:e.status)===1?(ep({title:"",message:ev("post.remove.success"),type:"success",displayIcon:H}),null==O||O()):ep({title:"",message:ev("post.remove.failed"),type:"danger",displayIcon:H})}else{let e=yield(0,g.b)((0,g.e)(f.yy.BOOKMARK.CREATE,{_locale:es}),"POST",{headers:{"Content-Type":"application/json"},data:{user_id:ed||ec.id,post_id:B.id}});(null==e?void 0:e.status)===1?(ep({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==O||O()):ep({title:"",message:ev("post.save.failed"),type:"danger",displayIcon:H})}}}))},onGoToUrl:e=>{let t=e?`${ex}${e}`:ex;eg?window.location.href=t:ef(()=>window.location.href=t)},showingMostEngaging:!!(s&&(null==V?void 0:V.id)),isVertical:M}),eh&&n.createElement(c.I,{isMainCmt:!_,onClose:()=>eb(!1),onPostSuccess:e=>{0!==ei||(null==V?void 0:V.id)||Q(e),F(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0})),E&&E(e)},post:B}),s&&(null==V?void 0:V.id)?n.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{b?(e.stopPropagation(),b()):window.location.href=eE}},n.createElement(CardReply,{hasQuickBookingEnable:R,handleMakeAppointment:L,comment:V,post:B,onDeleteComment:()=>{onDeleteComment&&onDeleteComment(V)},className:"most-engaging-comment",type:"most-engaging",key:V.id,cardAuthorProps:$}),ei>1&&!a&&n.createElement(i.B,{className:"see-more-comments",color:"ghost",size:"md"},ev("comment.seeMoreComments",{count:ei-1}))):null,j))}},mBUm:function(e,t,a){a.d(t,{P:function(){return PillCarousel}});var l=a("Cxxo"),n=a("q1tI"),i=a("rBCA"),o=a("Y6+v"),r=a("iBNF"),s=a("CKJU"),d=a("f4Rk"),c=a("weOk"),m=a("PyPH");let u=i.Z.div` display: inline-flex; overflow: hidden; width: ${e=>e.size}px; height: ${e=>e.size}px; box-sizing: border-box; align-items: center; justify-content: center; border: 1px solid #e4e8ec; background-color: ${e=>e.backgroundColor||r.r.colors.white}; border-radius: ${e=>e.borderRadius||"50%"}; & > * { width: ${e=>e.iconSize}px; height: ${e=>e.iconSize}px; } `,p=i.Z.div` display: inline-block; height: 108px; background-color: ${r.r.colors.white}; border-radius: 60px; cursor: pointer; &.selected-week-pill { background-color: ${r.r.colors.pink100}; } & > div:first-child { margin: 4px 4px 0; } & > p { margin-top: 8px; text-align: center; } & > * { pointer-events: none; } `,g=[c.L.Myanmar,c.L.Taiwan],v=(0,i.Z)(e=>{var{icon:t,name:a,className:i,locale:c="en-PH",dataEventCategory:m,dataEventAction:v,dataEventLabel:h,onSelect:b}=e,E=(0,l._)(e,["icon","name","className","locale","dataEventCategory","dataEventAction","dataEventLabel","onSelect"]);let x=(0,n.useMemo)(()=>null==i?void 0:i.includes("selected-week-pill"),[i]);return n.createElement(p,Object.assign({onClick:b,className:i?"week-pill".concat(" non-pointer-event-child ",i):"week-pill non-pointer-event-child","data-event-category":m,"data-event-action":v,"data-event-label":h},E),n.createElement(u,{size:64,iconSize:40,backgroundColor:r.r.colors.white},n.createElement(s.I,{src:t||o.C.getAssetPath("week_default.png"),alt:`week ${a}`})),x?n.createElement(d.T,Object.assign({type:"semiBold",size:"n1",color:r.r.colors.gray800},g.includes(c)&&{style:{fontSize:"10px"}}),a):n.createElement(d.T,Object.assign({size:"n1",color:r.r.colors.gray600},g.includes(c)&&{style:{fontSize:"10px"}}),a))})` box-shadow: 0px 0px 24px rgba(0, 0, 0, 0.08); `,h=(0,i.Z)(m.f.Slide)` cursor: pointer; > div * { pointer-events: none; } `,b=(0,i.Z)(m.f)` .centerred-pill-wrapper { padding: 16px 0; } `,PillCarousel=e=>{var{data:t,isMobile:a,onSlideChange:i,pillProps:o,locale:r=c.L.Vietnam,blurFromIndex:s,blurLength:d}=e,m=(0,l._)(e,["data","isMobile","onSlideChange","pillProps","locale","blurFromIndex","blurLength"]);let[u,p]=(0,n.useState)("");return(0,n.useEffect)(()=>{p(window.location.href)},[]),n.createElement(b,Object.assign({},{withControls:!a,slideGap:16,blurFromCenter:!0,blurFromIndex:s||(a?2:4),blurLength:d||(a?1:3),onSlideChange:i},m,{selectSlideWhenClick:!0,previousControlIcon:n.createElement(Arrow,{currentUrl:u}),nextControlIcon:n.createElement(Arrow,{currentUrl:u,isRight:!0})}),e=>t.map((t,a)=>n.createElement(h,Object.assign({key:a,onClick:i,"data-event-category":"Health Tool","data-event-action":"Pregnancy Week Click","data-event-label":u,innerSlideProps:{"data-event-category":"Health Tool","data-event-action":"Pregnancy Week Click","data-event-label":u}},o),n.createElement("div",{className:"centerred-pill-wrapper"},n.createElement(v,{"data-event-category":"Health Tool","data-event-action":"Fetal Week Click","data-event-label":u,locale:r,name:t.name,icon:t.icon,className:a===e?"selected-week-pill pointer-event-child-none":"pointer-event-child-none"})))))},Arrow=({isRight:e,currentUrl:t})=>n.createElement("svg",{viewBox:"0 0 15 15",fill:"none",width:"16",height:"16",style:e?{transform:"rotate(-90deg)"}:{transform:"rotate(90deg)"},"data-event-category":"Health Tool","data-event-action":"Pregnancy Week Arrow Click","data-event-label":t,className:"pointer-event-child-none"},n.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))},"6a23":function(e,t,a){a.d(t,{L:function(){return Loading}});var l=a("q1tI"),n=a("JJ6e"),i=a("bSpP"),o=a("AeFk"),r=a("rBCA"),s=a("iBNF");let d=r.Z.div` display: flex; align-items: center; justify-content: center; padding: 1em; button { position: relative; } `,c=o.F4` 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } `;r.Z.div` display: flex; width: fit-content; width: -moz-fit-content; flex-direction: column; align-items: center; justify-content: center; padding: 1rem 2rem; background: white; border-radius: ${s.r.borderRadius}; box-shadow: -1px 1px 2px rgba(67, 70, 74, 0.0001), -2px 2px 5px rgba(67, 86, 100, 0.123689); .loading-spinner { width: 24px; height: 24px; margin-bottom: 0.5rem; animation: ${c} 1.2s linear infinite; } &[data-is-marrybaby='true'] { box-shadow: none; } `;let Loading=({className:e,size:t="md"})=>{let{t:a}=(0,i.u)();return l.createElement(d,{className:e},l.createElement(n.B,{size:t,color:"transparent",isLoading:!0},a("loading")))}},MKPs:function(e,t,a){a.r(t),a.d(t,{ProfileChatbot:function(){return ProfileChatbot},TabDataInit:function(){return w},TabName:function(){return i},UserType:function(){return o}});var l,n,i,o,r=a("Cxxo"),s=a("q1tI"),d=a("m0au"),c=a("YSyo"),m=a("r0Za"),u=a("IQVP"),p=a("9E0F"),g=a("kd6S"),v=a("oTwY"),h=a("4JiQ"),b=a("PFNZ"),E=a("weOk");a("NmYn"),a("gY0P"),a("Wgwc"),a("QgiU"),a("rBCA");let x=(0,s.createContext)({}),Faqs=({faqs:e})=>{let[t,a]=(0,s.useState)([]),handleClick=e=>{if(t.includes(e)){let l=t.filter(t=>t!==e);a(l)}else a(t=>[...t,e])};return s.createElement("div",{className:"_0NhMo6T"},e.map((e,a)=>{let l=t.includes(a);return s.createElement("div",{className:"nrZtZ-u",key:a},s.createElement("div",{className:"faq-item",onClick:()=>handleClick(a)},s.createElement("div",{className:"faq-question",dangerouslySetInnerHTML:{__html:e.question||""}}),l?s.createElement(g.Z,null):s.createElement(v.Z,null)),s.createElement(h.U,{in:l,className:"faq-answer"},s.createElement("div",{dangerouslySetInnerHTML:{__html:e.answer||""}})))}))};var f={container:"_2ugC2Ll",body:"CCwRHCd",description:"RF63WXG",cardAuthorWrapper:"PIaeC0v"};let formatExperience=e=>e?{title:null==e?void 0:e.title,organization:null==e?void 0:e.organization,duration:e.duration}:{},formatEducation=e=>e?{completedYear:null==e?void 0:e.completed_year,schoolName:e.school_name,study:e.study}:{};(l=i||(i={}))[l.About=0]="About",l[l.Care=1]="Care",l[l.Answer=2]="Answer",l[l.Posts=3]="Posts",(n=o||(o={}))[n.Expert=0]="Expert",n[n.User=1]="User";let w={experiences:[],relatedPosts:[],educations:[],awards:[],contact:{},data:{}},ProfileChatbot=e=>{var{authorProps:t,authActionWrapper:a,onSkipQuestion:l,onCloseFromPost:n,onChatWithBot:i,showSkipQuestionTag:o,currentPageUrl:g}=e,v=(0,r._)(e,["authorProps","authActionWrapper","onSkipQuestion","onCloseFromPost","onChatWithBot","showSkipQuestionTag","currentPageUrl"]);let{data:{locale:h,userInfo:w,env:{isMarryBaby:y}}}=(0,s.useContext)(p.T),C=String(null==t?void 0:t.userId),[k,S]=(0,s.useState)(),[T,N]=(0,s.useState)(!1),[P,I]=(0,s.useState)(),[z,A]=(0,s.useState)([]),[_,j]=(0,s.useState)(""),R=(null==w?void 0:w._togetherUserId)===(null==t?void 0:t.userId),[L,O]=(0,s.useState)(1),$={value:String(L),dataList:[{value:"1",text:"FAQs",content:s.createElement(Faqs,{faqs:z})}],onTabChange:e=>O(Number(e))};return(0,s.useEffect)(()=>{(0,r.a)(void 0,void 0,void 0,function*(){var e,t,a,l,n,i,o,r,s,d,c;N(!0);let g=yield Promise.all([(0,p.c)((0,p.e)(u.yy.USER.DETAIL,{_locale:h,id:C}),"GET"),(0,p.c)((0,p.e)(u.yy.CHATBOT.PROFILE,{_locale:h}),"GET"),(0,p.c)((0,p.e)(u.yy.CHATBOT.FAQS_LIST,{_locale:h}),"GET")]),[v,b,E]=g,x={data:null==v?void 0:v.data,experiences:((null===(t=null===(e=null==v?void 0:v.data)||void 0===e?void 0:e.fields)||void 0===t?void 0:t.experiences)||[]).map(formatExperience),relatedPosts:((null===(a=null==v?void 0:v.data)||void 0===a?void 0:a.related_post)||[]).map(e=>(0,m.g)(e.post)),educations:((null===(n=null===(l=null==v?void 0:v.data)||void 0===l?void 0:l.fields)||void 0===n?void 0:n.educations)||[]).map(formatEducation),awards:(null===(o=null===(i=null==v?void 0:v.data)||void 0===i?void 0:i.fields)||void 0===o?void 0:o.awards_accreditations)||[],contact:(null===(s=null===(r=null==v?void 0:v.data)||void 0===r?void 0:r.fields)||void 0===s?void 0:s.contact)||{}};(null==v?void 0:v.status)===1&&I(x),A((null===(d=null==E?void 0:E.data)||void 0===d?void 0:d.faqs)||[]),j((null===(c=null==b?void 0:b.data)||void 0===c?void 0:c.description)||""),N(!1)})},[]),s.createElement(x.Provider,{value:{isMarryBaby:y,siteType:y?"marryBaby":"helloSites",authorId:String((null==t?void 0:t.userId)||""),authActionWrapper:a,onSkipQuestion:l,info:P,authorProps:t,onCloseFromPost:n,countValues:k,setCountValues:S,isAuthorLogin:R,showSkipQuestionTag:o,currentPageUrl:g}},s.createElement("div",Object.assign({},v,{className:`${f.container} ${(null==v?void 0:v.className)||""}`,"data-is-marrybaby":y}),T?s.createElement(c.L,null):s.createElement(s.Fragment,null,s.createElement("div",{className:f.cardAuthorWrapper},s.createElement(b.C,Object.assign({},t,{className:"card-author",showDetailPopup:!1,showChatbotButton:h===E.L.Vietnam,onChatWithBot:i}))),s.createElement("div",{className:f.description,dangerouslySetInnerHTML:{__html:_}}),z.length>0&&s.createElement("div",{className:f.body},s.createElement(d.T,Object.assign({},$))))))}},PFNZ:function(e,t,a){a.d(t,{C:function(){return CardAuthor},P:function(){return PopupExpert},a:function(){return PopupDoctor},b:function(){return PopupHospital},c:function(){return ProfileDetailModal},d:function(){return CardAuthor$1}});var l=a("q1tI"),n=a("rCoo"),i=a("dgD7"),o=a("/npG"),r=a("Eso5"),s=a("SPK5"),d=a("mAfZ"),c=a("mYVa"),m=a("Wgwc"),u=a.n(m),p=a("QgiU"),g=a.n(p),v=a("bSpP"),h=a("e0Et"),b=a("XH30"),E=a("S41O"),x=a("Cxxo"),f=a("Sbqh"),w=a("CKJU"),y=a("Y6+v"),C=a("9E0F"),k=a("JJ6e"),S=a("Rh7u"),T=a("iBNF"),N=a("rBCA"),P=a("IQVP"),I=a("6a23"),z=a("UESe"),A=a("6Vio"),_=a("xrdX");let MainText=({children:e,className:t=""})=>l.createElement("div",{className:`tMiOKib ${t}`},e),SubText=({children:e,className:t=""})=>l.createElement("div",{className:`uDcqD-2 ${t}`},e);var j={container:"sTU4T4I",info:"tCql9Je",avatarWrapper:"_3j7uYhH",avatarIcon:"PHABgoT"};let CardAuthor$1=({avatarProps:e,title:t,subTitle:a,children:n,className:i="",style:o,onAvatarClick:r,avatarIcon:s,dataEventCategory:d,dataEventAction:c,dataEventLabel:m})=>l.createElement("div",{className:`${j.container} ${i}`,style:o},l.createElement("div",{className:j.avatarWrapper,onClick:r,"data-event-category":d,"data-event-action":c,"data-event-label":m},l.createElement(f.U,Object.assign({},e)),s&&l.createElement("div",{className:j.avatarIcon},s)),l.createElement("div",{className:`${j.info} ${i}`,style:{minHeight:`${(null==e?void 0:e.size)||40}px`}},n||l.createElement(l.Fragment,null,t&&l.createElement(MainText,null,t),a&&l.createElement(SubText,null,a))));CardAuthor$1.MainText=MainText,CardAuthor$1.SubText=SubText,CardAuthor$1.SubDivider=({className:e=""})=>l.createElement("span",{className:`m-HVXw1 ${e}`}),CardAuthor$1.Row=({children:e,className:t=""})=>l.createElement("div",{className:`dZWeHns ${t} row`},e),CardAuthor$1.ColLeft=({children:e,className:t=""})=>l.createElement("div",{className:`${t} col-left`},e),CardAuthor$1.ColRight=({children:e,className:t=""})=>l.createElement("div",{className:`${t} col-right`},e),CardAuthor$1.SubTextRow=e=>{var{children:t,className:a=""}=e,n=(0,x._)(e,["children","className"]);return l.createElement("div",Object.assign({className:`pDlsows ${a}`},n),t)};var R=(0,o.k)(()=>({root:{verticalAlign:"bottom"}}));let L=(0,l.createContext)({}),AuthorBadgeItem=({styles:e,className:t,classNames:a})=>{let{role:n,siteType:i,title:o}=(0,l.useContext)(L),{cx:r,classes:s}=R(void 0,{name:"AuthorBadgeItem",styles:e,classNames:a});return n?l.createElement(b.A,{className:r(s.root,t),siteType:i,role:n,title:o}):null};var O=(0,o.k)(()=>({root:{}}));let $=N.Z.div` position: fixed; left: 50%; width: 343px; background-color: ${T.r.colors.white}; border-radius: ${T.r.borderRadius}; box-shadow: 0px 0px 4px ${T.r.colors.gray200}; transform: translate(-50%, -50%); transition: all 0.5s ease-in-out; ${h.M.tdUp} { width: 750px; } &[data-animation='true'] { transition: all 0.5s ease-in-out; } &[data-open='true'] { z-index: 400; top: 50%; opacity: 1; visibility: visible; } &[data-open='false'] { top: -50%; } .popup-content { ${h.M.mbDown} { display: block; } display: flex; position: relative; z-index: 111; height: 100%; .button-see-more { margin: 32px 0; padding: 0; > * { display: inline-block; } } .close-button { position: absolute; z-index: 100; top: 10px; right: 10px; cursor: pointer; width: unset; height: unset; img { width: 100%; height: 100%; border-radius: 50%; } } } .main-info { padding-bottom: 32px; background-color: ${T.r.colors.primary50}; border-radius: ${T.r.borderRadius}; .btn-booking { display: flex; margin: 12px auto; } .avatar-title { position: relative; width: 100%; padding-top: 46px; text-align: center; } } `,M=N.Z.div` position: fixed; z-index: 110; top: 0; left: 0; width: 100%; height: 100%; align-items: center; background: rgba(38, 38, 38, 0.3); &[data-open='false'] { display: none; } `,B=N.Z.div` .image-container { .badge-avatar { position: absolute; right: 0; bottom: 0; top: 0; } } display: flex; justify-content: center; padding-bottom: 15px; text-align: center; .profile-image { width: 100px; min-width: 100px; height: 100px; min-height: 100px; border-radius: 50%; object-fit: cover; } .badge-avatar { width: 24px; height: 24px; } `,F=N.Z.div` position: relative; z-index: 9; .specialty { display: flex; flex-wrap: wrap; justify-content: center; } padding: 0px 16px; text-align: center; .specialty { justify-content: center; } .experience { padding: 16px 0px 32px; text-align: left; .btn-wrapper { margin-top: 24px; } } p { max-width: 100%; -webkit-line-clamp: 4; -webkit-box-orient: vertical; text-overflow: ellipsis; overflow: hidden; } `,D=N.Z.ul` padding-left: 18px; li { list-style-type: disc; } `;var H="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%23262626' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M18 6 6 18M6 6l12 12'/%3e%3c/svg%3e",Z="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none'%3e%3cpath fill='white' stroke='%23E4E8EC' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M9 17A8 8 0 1 0 9 1a8 8 0 0 0 0 16'/%3e%3cpath fill='%23FF5331' d='M10.333 7.667V5H7.667v2.667H5v2.667h2.667V13h2.666v-2.666H13V7.667z'/%3e%3c/svg%3e";let PopupDoctor=({isOpen:e=!0,onClose:t,enableAnimation:a=!0,doctorId:n,locale:i,isMobile:o,overwriteProfileProps:r,avatarFallback:s=y.C.getAssetPath("avatar.jpg"),trackingCategory:d="Together"})=>{var c,m,u;let{t:p}=(0,v.u)(),[g,h]=(0,l.useState)(null),[b,E]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if(e&&n&&String(null==g?void 0:g.id)!==String(n)){E(!0);try{h(null),(0,C.c)((0,C.g)(P.tC.GET_DOCTOR_INFO,{doctorId:n,website_url:C.l[i]}),"get").then(e=>{h(Object.assign(Object.assign({},null==e?void 0:e._data.doctor),r))})}catch(e){console.error(e)}E(!1)}},[e,n,null==g?void 0:g.id]);let x=(null==g?void 0:g.experiences)||[],f=(null==g?void 0:g.specialties)||[],N=f.map(e=>(null==e?void 0:e.name)||e).join(" • "),z=x.map(e=>{try{return JSON.parse(e.description)}catch(t){return e.description}}).filter(e=>e.content),renderExperienceText=e=>(null==e?void 0:e.year)?`${e.year} ${null==e?void 0:e.content}`:(null==e?void 0:e.content)?e.content:"string"==typeof e?e:"";return l.createElement(l.Fragment,null,l.createElement($,{"data-open":e,"data-animation":a,onClick:e=>e.stopPropagation()},b||!g?l.createElement(I.L,null):l.createElement("div",{className:"popup-content"},l.createElement("div",{className:"close-button",onClick:t},l.createElement("img",{src:H,style:{width:20,height:20},alt:"close-icon",loading:"lazy"})),l.createElement("div",{className:"main-info"},l.createElement("div",{className:"border-banner"}),l.createElement("div",{className:"avatar-title"},l.createElement(B,null,l.createElement("div",{className:"image-container"},l.createElement("div",{style:{position:"relative"}},l.createElement(w.I,{src:null==g?void 0:g.avatar,backupSrc:s,className:"profile-image",alt:"avatar"}),l.createElement("img",{className:"badge-avatar",src:Z,alt:"badge",loading:"lazy"})))),l.createElement(F,null,l.createElement(S.T,{size:"s3",weight:"semiBold",className:"full-name"},null==g?void 0:g.name),l.createElement("div",{className:"specialty"},N&&l.createElement(l.Fragment,null,l.createElement(S.T,{size:"p4",color:T.r.colors.gray800},N," • ")),l.createElement("a",{href:(0,C.m)({id:null===(c=null==g?void 0:g.organization)||void 0===c?void 0:c.id,name:null===(m=null==g?void 0:g.organization)||void 0===m?void 0:m.name,slug:null===(u=null==g?void 0:g.organization)||void 0===u?void 0:u.slug,locale:i}),className:"organisation",target:"_blank",rel:"noreferrer"},l.createElement(S.T,{size:"p4",className:"organisation",color:T.r.colors.gray800,style:{textDecoration:"underline"}},null==g?void 0:g.organization.name))))),!o&&l.createElement("div",{className:"btn-wrapper"},l.createElement("a",{href:(0,C.n)({name:g.name,id:g.id,locale:i})},l.createElement(k.B,{color:"primary",size:"md",className:"btn-booking"},p("careBooking.bookAnAppointment"))))),z&&l.createElement(F,null,l.createElement("div",{className:"experience"},l.createElement(S.T,{weight:"bold",size:"s3",color:T.r.colors.gray800,style:{paddingBottom:16}},p("expert.content.description").toUpperCase()),l.createElement(D,null,z.map((e,t)=>l.createElement("li",{key:t},l.createElement(S.T,{size:"p2"},renderExperienceText(e))))),o?l.createElement("div",{className:"btn-wrapper"},l.createElement("a",{href:(0,C.n)({name:g.name,id:g.id,locale:i})},l.createElement(k.B,{color:"primary",size:"md",className:"btn-booking"},p("careBooking.bookAnAppointment")))):l.createElement("a",{href:(0,C.n)({name:g.name,id:g.id,locale:i})},l.createElement(S.T,{size:"s4",color:"#2D87F3",style:{paddingTop:24},"data-event-category":d,"data-event-action":"See Full Doctor Profile","data-event-label":(0,C.k)(i)+(0,C.n)({name:g.name,id:g.id,locale:i})},p("home.seeExpert"))))))),l.createElement(M,{"data-open":e,onClick:e=>{e.stopPropagation(),t()}}))},U=N.Z.div` position: fixed; left: 50%; width: 343px; background-color: ${T.r.colors.white}; border-radius: ${T.r.borderRadius}; box-shadow: 0px 0px 4px ${T.r.colors.gray200}; transform: translate(-50%, -50%); transition: all 0.5s ease-in-out; ${h.M.tdUp} { width: 750px; } &[data-animation='true'] { transition: all 0.5s ease-in-out; } &[data-open='true'] { z-index: 400; top: 50%; opacity: 1; visibility: visible; } &[data-open='false'] { top: -50%; } .popup-content { ${h.M.mbDown} { display: block; } display: flex; position: relative; z-index: 111; height: 100%; .button-see-more { margin: 32px 0; padding: 0; > * { display: inline-block; } } .close-button { position: absolute; z-index: 100; top: 10px; right: 10px; cursor: pointer; width: unset; height: unset; img { width: 100%; height: 100%; border-radius: 50%; } } } .main-info { padding-bottom: 32px; background-color: ${T.r.colors.primary50}; border-radius: ${T.r.borderRadius}; .avatar-title { position: relative; width: 100%; padding-top: 46px; text-align: center; } } `,V=N.Z.div` position: fixed; z-index: 110; top: 0; left: 0; width: 100%; height: 100%; align-items: center; background: rgba(38, 38, 38, 0.3); &[data-open='false'] { display: none; } `,Q=N.Z.div` .image-container { .badge-avatar { position: absolute; right: 0; bottom: 0; top: 0; } } display: flex; justify-content: center; padding-bottom: 15px; text-align: center; .profile-image { width: 100px; min-width: 100px; height: 100px; min-height: 100px; border-radius: 50%; object-fit: cover; } .badge-avatar { width: 24px; height: 24px; } `,q=N.Z.div` position: relative; z-index: 9; .specialty { display: flex; flex-wrap: wrap; justify-content: center; } padding: 0px 16px; text-align: center; .specialty { justify-content: center; } .experience { padding: 16px 0px 32px; text-align: left; .btn-wrapper { margin-top: 24px; } } p { max-width: 100%; -webkit-line-clamp: 4; -webkit-box-orient: vertical; text-overflow: ellipsis; overflow: hidden; } `,W=N.Z.div` display: flex; margin-top: 8px; .bullet-point { width: 24px; height: 24px; } `;var G="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath fill='%2345A4FF' d='M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12'/%3e%3cpath fill='%232D87F3' d='M24 12a12 12 0 0 0-.128-1.758l-5.077-5.077L5.041 18.958l4.858 4.858c.682.12 1.384.184 2.1.184 6.628 0 12-5.373 12-12Z'/%3e%3cpath fill='white' d='M9.014 17.824 5.04 18.959l1.135-3.973 2.368.47z'/%3e%3cpath fill='%23F7F9FC' d='M8.544 15.456 5.041 18.96l3.972-1.135z'/%3e%3cpath fill='%23E4E8EC' d='M6.467 18.552 5.45 17.533l-.41 1.427 1.426-.407Z'/%3e%3cpath fill='%23D2D6DC' d='m5.957 18.043-.916.916 1.426-.407z'/%3e%3cpath fill='%23FFD658' d='m15.828 5.331 2.837 2.837-9.651 9.652-2.838-2.837z'/%3e%3cpath fill='%23FFC326' d='m7.594 16.404 9.651-9.651 1.419 1.418-9.652 9.652z'/%3e%3cpath fill='%23FF5331' d='m18.312 8.525-2.837-2.838 1.123-1.123c.44-.44 1.154-.44 1.595 0l1.243 1.243c.44.44.44 1.154 0 1.594z'/%3e%3cpath fill='%23F44D2C' d='m18.816 5.186-1.921 1.92 1.418 1.419 1.124-1.124c.44-.44.44-1.154 0-1.594l-.622-.621Z'/%3e%3c/svg%3e";let K={author:G,edtior:G,expert:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3ccircle cx='12' cy='12' r='12' fill='%23FFCB37'/%3e%3ccircle cx='12' cy='12' r='10.5' fill='%23FE921D'/%3e%3cpath fill='white' d='M11.443 5.137a.6.6 0 0 1 1.114 0l1.436 3.577a.6.6 0 0 0 .516.375l3.846.26a.6.6 0 0 1 .344 1.06l-2.958 2.471a.6.6 0 0 0-.197.607l.94 3.738a.6.6 0 0 1-.9.655l-3.265-2.05a.6.6 0 0 0-.638 0l-3.265 2.05a.6.6 0 0 1-.9-.655l.94-3.738a.6.6 0 0 0-.198-.607L5.3 10.41a.6.6 0 0 1 .344-1.06l3.846-.26a.6.6 0 0 0 .517-.375z'/%3e%3c/svg%3e","fact-check":"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath fill='%2300C076' d='M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16'/%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='m11.946 5.466-5.28 4.8-2.4-2.182'/%3e%3c/svg%3e",medical:Z},PopupExpert=({trackingCategory:e="Together",locale:t,isOpen:a=!0,onClose:n,enableAnimation:i=!0,expertId:o,overwriteProfileProps:r,avatarFallback:s=y.C.getAssetPath("avatar.jpg")})=>{let{t:d}=(0,v.u)(),[c,m]=(0,l.useState)(null),[u,p]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{if(a&&o&&String(null==c?void 0:c.user_id)!==String(o)){p(!0);try{m(null),(0,C.c)((0,C.o)(P.D9.GET_EXPERT_BY_ID,{id:o}),"get").then(e=>{m(Object.assign(Object.assign({},null==e?void 0:e.data),r))})}catch(e){console.error(e)}p(!1)}},[a,o,null==c?void 0:c.user_id]),l.createElement(l.Fragment,null,l.createElement(U,{"data-open":a,"data-animation":i,onClick:e=>e.stopPropagation()},u||!c?l.createElement(I.L,null):l.createElement("div",{className:"popup-content"},l.createElement("div",{className:"close-button",onClick:n},l.createElement("img",{src:H,style:{width:20,height:20},alt:"close-icon",loading:"lazy"})),l.createElement("div",{className:"main-info"},l.createElement("div",{className:"border-banner"}),l.createElement("div",{className:"avatar-title"},l.createElement(Q,null,l.createElement("div",{className:"image-container"},l.createElement("div",{style:{position:"relative"}},l.createElement(w.I,{src:null==c?void 0:c.avatar,className:"profile-image",alt:"avatar",backupSrc:s}),l.createElement("img",{className:"badge-avatar",src:K[null==c?void 0:c.role],alt:"badge",loading:"lazy"})))),l.createElement(q,null,l.createElement(S.T,{size:"s3",className:"full-name",weight:"semiBold"},null==c?void 0:c.display_name),l.createElement("div",null,l.createElement(S.T,{size:"p4",color:T.r.colors.gray800},null==c?void 0:c.specialty," • "),l.createElement("a",{href:null==c?void 0:c.organisation_url,className:"organisation",target:"_blank",rel:"noreferrer"},l.createElement(S.T,{size:"p4",className:"organisation",color:T.r.colors.gray800,style:{textDecoration:"underline"}},null==c?void 0:c.organisation)))))),l.createElement(q,null,l.createElement("div",{className:"experience"},l.createElement(S.T,{weight:"bold",size:"p4",color:T.r.colors.gray800,style:{paddingBottom:16}},d("expert.content.description").toUpperCase()),l.createElement("div",{className:"list-items"},null!=c&&!!c.experiences&&c.experiences.filter(e=>!!(e&&(e.title||e.organization))).slice(0,3).map((e,t)=>l.createElement(W,{key:t},l.createElement("img",{className:"bullet-point",src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3ccircle cx='12' cy='12' r='2' fill='%232D87F3'/%3e%3c/svg%3e",alt:"point",loading:"lazy"}),l.createElement("div",{className:"text-contain"},l.createElement(z.H,{tag:"h6",color:T.r.colors.gray800},null==e?void 0:e.title),l.createElement(S.T,{size:"p2",color:T.r.colors.gray500},null==e?void 0:e.organization))))),l.createElement("a",{href:null==c?void 0:c.profile_url,style:{display:"inline-block",paddingTop:24}},l.createElement(S.T,{as:"span",size:"s4",color:"#2D87F3","data-event-category":e,"data-event-action":"See Full Doctor Profile","data-event-label":(0,C.k)(t)+(null==c?void 0:c.profile_url)},d("home.seeExpert"))))))),l.createElement(V,{"data-open":a,onClick:e=>{e.stopPropagation(),n()}}))},Y=N.Z.div` position: fixed; left: 50%; width: 343px; background-color: ${T.r.colors.white}; border-radius: ${T.r.borderRadius}; box-shadow: 0px 0px 4px ${T.r.colors.gray200}; transform: translate(-50%, -50%); transition: all 0.5s ease-in-out; ${h.M.tdUp} { width: 750px; } &[data-animation='true'] { transition: all 0.5s ease-in-out; } &[data-open='true'] { z-index: 400; top: 50%; opacity: 1; visibility: visible; } &[data-open='false'] { top: -50%; } .popup-content { ${h.M.mbDown} { display: block; } display: flex; position: relative; z-index: 111; height: 100%; .button-see-more { margin: 32px 0; padding: 0; > * { display: inline-block; } } .close-button { position: absolute; z-index: 100; top: 10px; right: 10px; cursor: pointer; width: unset; height: unset; img { width: 100%; height: 100%; border-radius: 50%; } } } .main-info { padding-bottom: 32px; background-color: ${T.r.colors.primary50}; border-radius: ${T.r.borderRadius}; .btn-booking { display: flex; margin: 12px auto; } .avatar-title { position: relative; width: 100%; padding-top: 46px; text-align: center; } } `,X=N.Z.div` position: fixed; z-index: 110; top: 0; left: 0; width: 100%; height: 100%; align-items: center; background: rgba(38, 38, 38, 0.3); &[data-open='false'] { display: none; } `,J=N.Z.div` .image-container { .badge-avatar { position: absolute; right: 0; bottom: 0; top: 0; } } display: flex; justify-content: center; padding-bottom: 15px; text-align: center; .profile-image { width: 100px; min-width: 100px; height: 100px; min-height: 100px; border-radius: 50%; object-fit: cover; } .badge-avatar { width: 24px; height: 24px; } `,ee=N.Z.div` position: relative; z-index: 9; .specialty { display: block; min-width: 240px; } padding: 0px 16px; text-align: center; .specialty { justify-content: center; } .experience { padding: 16px 0px 32px; text-align: left; .btn-wrapper { margin-top: 24px; } } p { max-width: 100%; } `,PopupHospital=({isOpen:e=!0,onClose:t,enableAnimation:a=!0,hospitalId:n,locale:i,isMobile:o,overwriteProfileProps:r,avatarFallback:s=y.C.getAssetPath("avatar.jpg"),trackingCategory:d="Together"})=>{let{t:c}=(0,v.u)(),[m,u]=(0,l.useState)(null),[p,g]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if(e&&n&&String(null==m?void 0:m.id)!==String(n)){g(!0);try{u(null),(0,C.c)((0,C.g)(P.tC.GET_HOSPITAL_INFO,{hospital_branch_id:n,website_url:C.l[i]}),"get").then(e=>{u(Object.assign(Object.assign({},null==e?void 0:e._data.branch),r))})}catch(e){console.error(e)}g(!1)}},[e,n,null==m?void 0:m.id]);let h=(null==m?void 0:m.specialties)||[],b=(0,l.useMemo)(()=>h.map(e=>e.name),[h]);return l.createElement(l.Fragment,null,l.createElement(Y,{"data-open":e,"data-animation":a,onClick:e=>e.stopPropagation()},p||!m?l.createElement(I.L,null):l.createElement("div",{className:"popup-content"},l.createElement("div",{className:"close-button",onClick:t},l.createElement("img",{src:H,style:{width:20,height:20},alt:"close-icon",loading:"lazy"})),l.createElement("div",{className:"main-info"},l.createElement("div",{className:"border-banner"}),l.createElement("div",{className:"avatar-title"},l.createElement(J,null,l.createElement("div",{className:"image-container"},l.createElement("div",{style:{position:"relative"}},l.createElement(w.I,{src:null==m?void 0:m.logo,className:"profile-image",alt:"avatar",backupSrc:s}),l.createElement("img",{className:"badge-avatar",src:Z,alt:"badge",loading:"lazy"})))),l.createElement(ee,null,l.createElement(S.T,{size:"s3",weight:"semiBold",className:"full-name"},null==m?void 0:m.name),l.createElement("div",{className:"specialty"},h&&l.createElement(S.T,{size:"p4",color:T.r.colors.gray800},b.join(" • "),"•"),l.createElement("a",{href:(0,C.m)({id:m.id,name:m.name,slug:m.slug,locale:i}),className:"organisation",target:"_blank",rel:"noreferrer"},l.createElement(S.T,{size:"p4",className:"organisation",color:T.r.colors.gray800,style:{textDecoration:"underline"}},null==m?void 0:m.name))))),!o&&l.createElement("a",{href:(0,C.m)({id:m.id,name:m.name,slug:m.slug,locale:i})},l.createElement("div",{className:"btn-wrapper"},l.createElement(k.B,{color:"primary",size:"md",className:"btn-booking"},c("careBooking.bookAnAppointment"))))),l.createElement(ee,null,l.createElement("div",{className:"experience"},l.createElement(S.T,{weight:"bold",size:"s3",color:T.r.colors.gray800,style:{paddingBottom:16}},c("hospital.content.description").toUpperCase()),l.createElement(S.T,{size:"p2",color:T.r.colors.gray500},m.about),o?l.createElement("a",{href:(0,C.m)({id:m.id,name:m.name,slug:m.slug,locale:i})},l.createElement("div",{className:"btn-wrapper"},l.createElement(k.B,{color:"primary",size:"md",className:"btn-booking"},c("careBooking.bookAnAppointment")))):l.createElement("a",{href:(0,C.m)({id:m.id,name:m.name,slug:m.slug,locale:i})},l.createElement(S.T,{size:"s4",color:"#2D87F3",as:"span","data-event-category":d,"data-event-action":"See Full Hospital Profile","data-event-label":(0,C.k)(i)+(0,C.m)({id:m.id,name:m.name,slug:m.slug,locale:i})},c("home.seeHospital"))))))),l.createElement(X,{"data-open":e,onClick:e=>{e.stopPropagation(),t()}}))},ProfileDetailModal=({open:e,onClose:t,children:a,profileModalProps:n})=>{let{t:i}=(0,v.u)();return l.createElement(A.M,Object.assign({title:i("profilePanel.modal.heading"),titleProps:!0,className:"_2UKyiK1",opened:e,onClose:t,overlayOpacity:.2,overflow:"inside",transitionProps:{transition:"slide-left"},styles:{header:{borderBottom:0},inner:{padding:0,justifyContent:"flex-end"},modal:{height:"100%",borderRadius:0},body:{maxHeight:"100%"},content:{maxHeight:"100%",height:"100%",borderRadius:0}}},n),a)};u().extend(g());let CardAuthor=e=>{let{className:t="",community:o,name:m,username:u,url:p,avatar:g,role:x,title:f,userType:k="user",expertId:S,specialty:N,organisation:P,isMarryBaby:I,doctorId:z,hospitalId:A,hasQuickBooking:j,handleMakeAppointment:R,communityTrackingAttr:$,isAnonymous:M,showDetailPopup:B,showChatbotButton:F=!1,subLine:D,authActionWrapper:H,profileProps:Z,profileModalProps:U,extendEle:V,avatarProps:Q,hideInfo:q,timeText:W,onCloseFromPost:G,onChatWithBot:K,avatarIcon:Y,badgeIconSize:X,hideBackground:J,children:ee,styles:et,dataEventCategory:ea,dataEventAction:el,dataEventLabel:en}=e,{data:{locale:ei,router:eo,env:{isMarryBaby:er,togetherBasePath:es}}}=(0,l.useContext)(C.T),{isMobile:ed}=(0,w.u)(),{t:ec}=(0,v.u)(),{classes:em}=O(void 0,{name:"CardAuthor",styles:et}),eu="boolean"==typeof I?I:er,ep=eu?"marryBaby":"helloSites",eg=M?ec("cardPost.anonymous"):m||u||"",ev=M?y.C.getAssetPath("avatar.jpg"):g,eh=M?void 0:x,[eb,eE]=(0,l.useState)(!1),{asPath:ex}=eo||{},ef=`https://${_.v[ei]}${ex}`,onAuthorClick=()=>{if(M)return!1;B?ey(!0):p&&(window.location.href=p)};(0,l.useEffect)(()=>{(0,h.t)(eb)},[eb]);let[ew,ey]=(0,l.useState)(!1),eC=(null==e?void 0:e.role)==="expert",ek=!!(z||A),eS=["expert"===eh&&P&&l.createElement("span",null,P),"expert"===eh&&N&&l.createElement("span",null,N),!("expert"===eh&&N&&P)&&(null==o?void 0:o.name)&&l.createElement("a",Object.assign({href:(null==o?void 0:o.slug)&&o.isActive&&!o.isHidden?`${es}/${null==o?void 0:o.slug}/`:void 0,className:"author-community-name"},$),`${null==o?void 0:o.name}`),W&&l.createElement("span",null,W)].filter(Boolean),[eT,eN]=(0,l.useState)(null);return(0,l.useEffect)(()=>{ew&&!eT&&("chatbot"===k?Promise.all([a.e(5231),a.e(7797),a.e(5454),a.e(5481),a.e(1964),a.e(9214),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(4190),a.e(4584),a.e(8261),a.e(9301),a.e(7884),a.e(891),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"MKPs")).then(e=>{eN(()=>e.ProfileChatbot)}):Promise.all([a.e(9409),a.e(6259),a.e(1818),a.e(7519),a.e(761),a.e(2189),a.e(5231),a.e(7797),a.e(5454),a.e(5481),a.e(1964),a.e(9214),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(4190),a.e(4584),a.e(8261),a.e(9301),a.e(7884),a.e(891),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"aUqw")).then(e=>{eN(()=>e.ProfileDetail)}))},[ew,k]),l.createElement(L.Provider,{value:{displayName:eg,title:f,role:eh,siteType:ep,handleMakeAppointment:R,doctorId:z,hospitalId:A,currentUrl:ef}},l.createElement(ProfileDetailModal,{open:ew,onClose:()=>ey(!1),profileModalProps:U},eT&&l.createElement(eT,Object.assign({currentPageUrl:en,authActionWrapper:H,onCloseFromPost:()=>{ey(!1),null==G||G()},onChatWithBot:K},Z,{authorProps:Object.assign({userId:null==e?void 0:e.userId,avatar:ev,name:null==e?void 0:e.name,role:null==e?void 0:e.role,title:null==e?void 0:e.title,doctorId:z,hospitalId:A,hasQuickBooking:j,userType:k},null==Z?void 0:Z.authorProps)}))),"expert"===eh&&S?l.createElement(PopupExpert,{isOpen:eb,onClose:()=>eE(!1),expertId:S}):null,"expert"===eh&&z?l.createElement(PopupDoctor,{isOpen:eb,onClose:()=>eE(!1),doctorId:z,locale:ei}):null,"expert"===eh&&A?l.createElement(PopupHospital,{isOpen:eb,onClose:()=>eE(!1),hospitalId:A,locale:ei}):null,l.createElement("div",{className:`hhg-card-author ${em.root} ${t} ${eC?"expert-author":""}`,"data-background":!J&&eC,"data-is-marrybaby":eu},l.createElement(CardAuthor$1,{dataEventCategory:ea,dataEventAction:el,dataEventLabel:en,onAvatarClick:onAuthorClick,avatarProps:Object.assign(Object.assign({avatar:M?y.C.getAssetPath(eu?"anomyous-avatar-1.svg":"anomyous-avatar.svg"):ev,username:eg},Q),{style:{cursor:!M&&(p||B)?"pointer":"default"}}),avatarIcon:Y||eC&&l.createElement(n.Z,{size:X||15})},ee?l.createElement("div",{onClick:onAuthorClick},ee):!q&&l.createElement(CardAuthor$1.Row,null,l.createElement(CardAuthor$1.ColLeft,null,l.createElement(s.k,{align:"center",onClick:onAuthorClick},l.createElement(CardAuthor$1.MainText,{onClick:onAuthorClick},eg,"chatbot"===k?l.createElement(l.Fragment,null," ",l.createElement(i.Z,{color:T.r.colors.primaryBase,size:16,style:{display:"inline-block",transform:"translate(0, 2px)"}}),F&&l.createElement("div",{style:{marginTop:"8px"}},l.createElement(d.z,{color:"primary",size:"xs",variant:"filled",type:"button",leftIcon:l.createElement(E.I.App,{size:16}),onClick:()=>{null==K||K()}},ec("chatbot.with.me")))):l.createElement(AuthorBadgeItem,null))),D||l.createElement(CardAuthor$1.SubTextRow,{style:j?{position:"relative"}:{}},eS.map((e,t)=>l.createElement(l.Fragment,null,0!==t&&l.createElement(CardAuthor$1.SubDivider,null),l.createElement(CardAuthor$1.SubText,null,e))),j&&ek&&l.createElement(r.x,{sx:{marginTop:(0,c.h)(5)}},l.createElement(b.B,{bookingId:z||A,bookingType:z?"doctor":A?"hospital":void 0,size:ed?"xs":"sm"})))))),V&&V))};CardAuthor.MainText=CardAuthor$1.MainText,CardAuthor.SubText=CardAuthor$1.SubText,CardAuthor.SubTextRow=CardAuthor$1.SubTextRow,CardAuthor.SubDivider=CardAuthor$1.SubDivider,CardAuthor.AuthorBadge=AuthorBadgeItem,CardAuthor.DisplayName=()=>{let{displayName:e}=(0,l.useContext)(L);return l.createElement(r.x,null,e)}},XDoA:function(e,t,a){a.d(t,{B:function(){return BmiForm},H:function(){return I},N:function(){return NewsletterCheckbox},Q:function(){return Question1Label},a:function(){return Question2Label},b:function(){return Question2Description}});var l=a("Cxxo"),n=a("q1tI"),i=a("wUmw"),o=a("d207"),r=a("7R3W"),s=a("/npG"),d=a("SPK5"),c=a("Eso5"),m=a("C/sX"),u=a("iuhU"),p=a("mYVa"),g=a("OAL+"),v=a("PyPH"),h=a("Rh7u"),b=a("yUAr"),E=a("bSpP"),x=a("soDd"),f=a("Ukun"),w=a("Lcsm"),y=a("weOk"),C=a("xrdX"),k=a("mx4j");let Question1Label=e=>{var{LabelWrapper:t}=e,a=(0,l._)(e,["LabelWrapper"]);let{t:i}=(0,E.u)(),o=t?{}:Object.assign({size:"p2"},a),r=t||h.T;return n.createElement(r,Object.assign({},o),i("bmi.question.weightLossSupport"))},Question2Label=e=>{var{LabelWrapper:t}=e,a=(0,l._)(e,["LabelWrapper"]);let{t:i}=(0,E.u)(),o=t?{}:Object.assign({size:"p2"},a),r=t||h.T;return n.createElement(r,Object.assign({},o),i("bmi.question.glp1Awareness"))},Question2Description=e=>{var{LabelWrapper:t}=e,a=(0,l._)(e,["LabelWrapper"]);let{t:i}=(0,E.u)(),o=t?{}:Object.assign({size:"p2"},a),r=t||h.T;return n.createElement(r,Object.assign({},o),i("bmi.question.glp1Awareness.desc"))},S=(0,n.createContext)({});var T=(0,s.k)(()=>({label:{marginTop:2,cursor:"pointer",userSelect:"none"}}));let NewsletterCheckbox=e=>{var{labelTextProps:t,checked:a,LabelWrapper:i,useCollapse:o=!0}=e,r=(0,l._)(e,["labelTextProps","checked","LabelWrapper","useCollapse"]);let{t:s}=(0,E.u)(),[m,u]=(0,n.useState)(!o),[p,g]=(0,n.useState)(!0),[b,x]=(0,n.useState)(a),f=i?{}:Object.assign({size:"p3"},t),w=i||h.T,{classes:y}=T(void 0,{name:"NewsletterCheckbox"});return n.createElement(d.k,{gap:8,align:"flex-start"},n.createElement(v.d,Object.assign({},r,{label:void 0,size:"sm",checked:b,onChange:e=>{p?g(!1):x(e.currentTarget.checked)},styles:{labelWrapper:{display:"none"}}})),n.createElement(c.x,null,n.createElement(w,Object.assign({},f,{onClick:()=>{o&&u(e=>!e)},className:y.label,lineClamp:m?void 0:1}),s("bmi.newsletter.label"))))},DefaultForm=e=>{var t,a,o,r,s,p,g;let{t:h,locale:b}=(0,E.u)(),{classes:w={}}=(0,n.useContext)(f.C),{control:k,bmiGenerated:T,linkTool:N,submitProps:P,withAdditionalQuestion:z,classes:A={}}=(0,n.useContext)(S),_={body:{alignItems:"center"}};return n.createElement(x.H,Object.assign({formLayout:"default"},e),n.createElement(I,{isMobile:e.isMobile,gutter:4},n.createElement(I.Row,{px:16},n.createElement(I.Col,{span:12},n.createElement(i.Qr,{name:"gender",control:k,rules:null===(t=T.gender)||void 0===t?void 0:t.rule,render:({field:{onChange:e},fieldState:{error:t}})=>n.createElement("div",null,n.createElement(I.GenderControl,{LabelWrapper:I.Label,error:void 0,onChange:e,gap:4}),(null==t?void 0:t.message)&&n.createElement(I.Error,{label:t.message}))})),n.createElement(I.Col,{span:12},n.createElement(i.Qr,{name:"age",control:k,rules:null===(a=T.age)||void 0===a?void 0:a.rule,render:({field:{name:e,value:t,onChange:a},fieldState:{error:l}})=>n.createElement("div",null,n.createElement(I.InputNumber,{label:n.createElement(I.Label,null,h("bmi.ageInput")),placeholder:h("tools.inputPlaceholder",{content:"25"}),name:e,value:t,onChange:a,min:0,rightSection:h("bmi.ageInput.desc"),classNames:{rightSection:A.inputRightSection}}),(null==l?void 0:l.message)&&n.createElement(I.Error,{label:l.message}))})),n.createElement(I.Col,{span:12},n.createElement(i.Qr,{name:"height",control:k,rules:null===(o=T.height)||void 0===o?void 0:o.rule,render:({field:{name:e,value:t,onChange:a},fieldState:{error:l}})=>n.createElement("div",null,n.createElement(I.InputNumber,{label:n.createElement(I.Label,null,h("bmi.heightInput")),rightSection:h("bmi.heightInput.desc"),placeholder:h("tools.inputPlaceholder",{content:b===y.L.Myanmar?6:170}),name:e,value:t,onChange:a,min:0,classNames:{rightSection:A.inputRightSection}}),(null==l?void 0:l.message)&&n.createElement(I.Error,{label:l.message}))})),n.createElement(I.Col,{span:12},n.createElement(i.Qr,{name:"weight",control:k,rules:null===(r=T.weight)||void 0===r?void 0:r.rule,render:({field:{name:e,value:t,onChange:a},fieldState:{error:l}})=>n.createElement("div",null,n.createElement(I.InputNumber,{label:n.createElement(I.Label,null,h("bmi.weightInput")),rightSection:h("bmi.weightInput.desc"),placeholder:h("tools.inputPlaceholder",{content:b===y.L.Myanmar?130:60}),name:e,value:t,onChange:a,precision:1,min:0,classNames:{rightSection:A.inputRightSection}}),(null==l?void 0:l.message)&&n.createElement(I.Error,{label:l.message}))}))),z?n.createElement(n.Fragment,null,n.createElement(m.r,{gutter:4,px:16},n.createElement(I.Col,null,n.createElement(i.Qr,{name:"question1",control:k,rules:null===(s=T.question1)||void 0===s?void 0:s.rule,render:({field:{value:e,onChange:t,name:a},fieldState:{error:l}})=>n.createElement("div",null,n.createElement(v.R.Group,{name:a,value:e,onChange:t,sx:{flex:1},label:n.createElement(Question1Label,{LabelWrapper:I.Label}),size:"lg"},n.createElement(d.k,{gap:"lg"},n.createElement(v.R,{size:"sm",value:"1",label:n.createElement(I.OptionLabel,null,h("switchBtn.yes")),styles:_}),n.createElement(v.R,{size:"sm",value:"0",label:n.createElement(I.OptionLabel,null,h("switchBtn.no")),styles:_}))),(null==l?void 0:l.message)&&n.createElement(I.Error,{label:l.message}))})),n.createElement(I.Col,null,n.createElement(i.Qr,{name:"question2",control:k,rules:null===(p=T.question2)||void 0===p?void 0:p.rule,render:({field:{name:e,value:t,onChange:a},fieldState:{error:l}})=>n.createElement("div",null,n.createElement(v.R.Group,{name:e,value:t,onChange:a,sx:{flex:1},label:n.createElement(Question2Label,{LabelWrapper:I.Label}),size:"lg",description:b!==y.L.Malaysia&&n.createElement(Question2Description,{LabelWrapper:I.SubLabel})},n.createElement(d.k,{gap:"lg"},n.createElement(v.R,{size:"sm",value:"1",label:n.createElement(I.OptionLabel,null,h("switchBtn.yes")),styles:_}),n.createElement(v.R,{size:"sm",value:"0",label:n.createElement(I.OptionLabel,null,h("switchBtn.no")),styles:_}))),(null==l?void 0:l.message)&&n.createElement(I.Error,{label:l.message}))}))),n.createElement(c.x,{className:(0,u.default)(A.newsletterBlock,w.newsletterBlock)},n.createElement(m.r,{gutter:8,px:16,py:12},n.createElement(I.Col,null,n.createElement(i.Qr,{name:"newsletter",control:k,rules:null===(g=T.newsletter)||void 0===g?void 0:g.rule,render:e=>{var t=e.field,{value:a,onChange:i,name:o}=t,r=(0,l._)(t,["value","onChange","name"]);return n.createElement(NewsletterCheckbox,Object.assign({size:"sm",onChange:e=>i(e.currentTarget.checked),name:o,checked:!!a},r))}})),n.createElement(I.Col,null,n.createElement(x.H.Submit,Object.assign({className:"bmi-btn bmi--btn-submit",dataEventCategory:"Health Tool",dataEventAction:"BMI",dataEventLabel:`https://${C.v[b]}/${N}`,type:"submit",fullWidth:!0},P),h("bmi.submit")))))):n.createElement(c.x,{px:16,sx:{paddingBottom:8}},n.createElement(x.H.Submit,Object.assign({className:"bmi-btn bmi--btn-submit",dataEventCategory:"Health Tool",dataEventAction:"BMI",dataEventLabel:`https://${C.v[b]}/${N}`,type:"submit",fullWidth:!0},P),h("bmi.submit")))))};var N=(0,s.k)(e=>({newsletterBlock:{backgroundColor:e.colors.neutral[0],borderBottomLeftRadius:"inherit",borderBottomRightRadius:"inherit",".bmi-btn":{marginTop:0}},inputRightSection:{fontSize:(0,p.h)(13),lineHeight:(0,p.h)(24),color:e.colors.gray[4],justifyContent:"flex-end",paddingRight:8,whiteSpace:"nowrap"}}));let InlineForm=e=>{var t,a,o,r,s,m,b,k;let{t:T,locale:N}=(0,E.u)(),{control:P,bmiGenerated:I,isTouched:z,linkTool:A,submitProps:_,withAdditionalQuestion:j}=(0,n.useContext)(S),{classes:R={},variant:L}=(0,n.useContext)(f.C),{classes:O={}}=(0,n.useContext)(S);return n.createElement(x.H,Object.assign({formLayout:"inline"},e),n.createElement(i.Qr,{name:"gender",control:P,rules:null===(t=I.gender)||void 0===t?void 0:t.rule,render:({field:{onChange:e},fieldState:{error:t}})=>n.createElement(x.H.FormRow,null,n.createElement(x.H.BorderInlineControl,{label:T("tools.selectGender"),width:"none",errorMess:z&&(null==t?void 0:t.message)},n.createElement(w.G,{type:"radio",hideLabel:!0,error:z?n.createElement(n.Fragment,null):"",onChange:e})))}),n.createElement(i.Qr,{name:"age",control:P,rules:null===(a=I.age)||void 0===a?void 0:a.rule,render:({field:{name:e,value:t,onChange:a},fieldState:{error:l}})=>n.createElement(x.H.FormRow,null,n.createElement(x.H.BorderInlineControl,{label:T("bmi.ageInput"),errorMess:z&&(null==l?void 0:l.message)},n.createElement(v.I.Number,{placeholder:T("tools.inputPlaceholder",{content:"25"}),name:e,value:t,onChange:a,error:z&&(null==l?void 0:l.message)?n.createElement(n.Fragment,null):"",min:0,rightSection:n.createElement(x.H.Unit,null,T("tools.yearsOld")),styles:()=>({rightSection:{width:"auto"}})})))}),n.createElement(i.Qr,{name:"height",control:P,rules:null===(o=I.height)||void 0===o?void 0:o.rule,render:({field:{name:e,value:t,onChange:a},fieldState:{error:l}})=>n.createElement(x.H.FormRow,null,n.createElement(x.H.BorderInlineControl,{label:T("bmi.heightInput"),errorMess:z&&(null==l?void 0:l.message)},n.createElement(v.I.Number,{placeholder:T("tools.inputPlaceholder",{content:N===y.L.Myanmar?6:170}),name:e,value:t,onChange:a,min:0,error:z&&(null==l?void 0:l.message)?n.createElement(n.Fragment,null):"",rightSection:n.createElement(x.H.Unit,null,T("bmi.heightInput.desc"))})))}),n.createElement(i.Qr,{name:"weight",control:P,rules:null===(r=I.weight)||void 0===r?void 0:r.rule,render:({field:{name:e,value:t,onChange:a},fieldState:{error:l}})=>n.createElement(x.H.FormRow,null,n.createElement(x.H.BorderInlineControl,{label:T("bmi.weightInput"),errorMess:z&&(null==l?void 0:l.message)},n.createElement(v.I.Number,{placeholder:T("tools.inputPlaceholder",{content:N===y.L.Myanmar?130:60}),name:e,value:t,onChange:a,error:z&&(null==l?void 0:l.message)?n.createElement(n.Fragment,null):"",precision:1,min:0,rightSection:n.createElement(x.H.Unit,null,T("bmi.weightInput.desc"))})))}),j?n.createElement(n.Fragment,null,n.createElement(i.Qr,{name:"question1",control:P,rules:null===(s=I.question1)||void 0===s?void 0:s.rule,render:({field:{value:e,onChange:t,name:a},fieldState:{error:l}})=>n.createElement(x.H.FormRow,null,n.createElement(v.R.Group,{name:a,value:e,onChange:t,sx:{flex:1},label:n.createElement(h.T,{size:"s4",weight:"semiBold",span:!0},T("bmi.question.weightLossSupport")),size:"lg"},n.createElement(d.k,{gap:"lg",sx:{paddingTop:(0,p.h)(8)}},n.createElement(v.R,{size:"sm",value:"1",label:T("switchBtn.yes")}),n.createElement(v.R,{size:"sm",value:"0",label:T("switchBtn.no")}))),z&&(null==l?void 0:l.message)&&n.createElement(v.e,{label:l.message,textProps:{size:"p4"},sx:{marginTop:6}}))}),n.createElement(i.Qr,{name:"question2",control:P,rules:null===(m=I.question2)||void 0===m?void 0:m.rule,render:({field:{name:e,value:t,onChange:a},fieldState:{error:l}})=>n.createElement(x.H.FormRow,null,n.createElement(v.R.Group,{name:e,value:t,onChange:a,sx:{flex:1},label:n.createElement(h.T,{size:"s4",weight:"semiBold",span:!0},T("bmi.question.glp1Awareness")),size:"lg",description:N!==y.L.Malaysia&&n.createElement(h.T,{style:{fontSize:"10px"},span:!0},T("bmi.question.glp1Awareness.desc"))},n.createElement(d.k,{gap:"lg",sx:{paddingTop:(0,p.h)(8)}},n.createElement(v.R,{size:"sm",value:"1",label:T("switchBtn.yes")}),n.createElement(v.R,{size:"sm",value:"0",label:T("switchBtn.no")}))),z&&(null==l?void 0:l.message)&&n.createElement(v.e,{label:l.message,textProps:{size:"p4"},sx:{marginTop:6}}))}),"gray"===L||"violet"===L?n.createElement(n.Fragment,null,n.createElement(i.Qr,{name:"newsletter",control:P,rules:null===(b=I.newsletter)||void 0===b?void 0:b.rule,render:e=>{var t=e.field,{value:a,onChange:i,name:o}=t,r=(0,l._)(t,["value","onChange","name"]);return n.createElement(x.H.FormRow,null,n.createElement(v.d,Object.assign({size:"sm",label:n.createElement(h.T,{size:"p3"},T("bmi.newsletter.label")),onChange:e=>i(e.currentTarget.checked),name:o,checked:!!a},r)))}}),n.createElement(x.H.FormRow,{className:(0,u.default)(R.submitWrapper)},n.createElement(x.H.Submit,Object.assign({className:(0,u.default)("bmi-btn bmi--btn-submit",R.submitBtn),dataEventCategory:"Health Tool",dataEventAction:"BMI",dataEventLabel:`https://${C.v[N]}/${A}`,type:"submit"},_),T("bmi.submit")))):n.createElement(x.H.FormRow,{py:16,className:(0,u.default)(O.newsletterBlock,R.newsletterBlock)},n.createElement(g.K,{spacing:16},n.createElement(i.Qr,{name:"newsletter",control:P,rules:null===(k=I.newsletter)||void 0===k?void 0:k.rule,render:e=>{var t=e.field,{value:a,onChange:i,name:o}=t,r=(0,l._)(t,["value","onChange","name"]);return n.createElement(NewsletterCheckbox,Object.assign({size:"sm",labelTextProps:{size:"p4"},onChange:e=>i(e.currentTarget.checked),name:o,checked:!!a,useCollapse:!1},r))}}),n.createElement(c.x,{className:(0,u.default)(R.submitWrapper)},n.createElement(x.H.Submit,Object.assign({className:(0,u.default)("bmi-btn bmi--btn-submit",R.submitBtn),dataEventCategory:"Health Tool",dataEventAction:"BMI",dataEventLabel:`https://${C.v[N]}/${A}`,type:"submit"},_),T("bmi.submit")))))):n.createElement(x.H.FormRow,{className:(0,u.default)(R.submitWrapper)},n.createElement(x.H.Submit,Object.assign({className:"bmi-btn bmi--btn-submit",dataEventCategory:"Health Tool",dataEventAction:"BMI",dataEventLabel:`https://${C.v[N]}/${A}`,type:"submit"},_),T("bmi.submit"))))},BmiForm=e=>{var{value:t,onChange:a,onSubmit:s,bmiGenerated:d,bmiUnit:c,formLayout:m="default",submitProps:u,withAdditionalQuestion:p,isMobile:g}=e,v=(0,l._)(e,["value","onChange","onSubmit","bmiGenerated","bmiUnit","formLayout","submitProps","withAdditionalQuestion","isMobile"]);let{classes:h}=N(void 0,{name:"BmiForm"}),[x,f]=(0,n.useState)(!1),{control:w,handleSubmit:y,setValue:C,watch:T}=(0,i.cI)({defaultValues:{question1:void 0,question2:void 0,newsletter:!0}}),P=T(),{locale:I}=(0,E.u)(),{getHealthToolLink:z}=(0,o.u)(I),A=(0,n.useMemo)(()=>z(r.H.OVULATION),[z]),onInValid=()=>{f(!0)};(0,n.useEffect)(()=>{Object.keys(t||{}).forEach(e=>{C(e,null==t?void 0:t[e],{shouldTouch:!1,shouldDirty:!1,shouldValidate:!1})})},[t]),(0,n.useEffect)(()=>{a&&a(P)},[P]);let _=Object.assign({onSubmit:y(e=>(0,l.a)(void 0,void 0,void 0,function*(){let t=c.heightConvert(e.height),a=c.weightConvert(e.weight),l=Object.assign(Object.assign({},e),{height:t,weight:a,bmi:(0,k.F)({height:t,weight:a})});onInValid(),s&&s(l)}),onInValid)},v);return n.createElement(b.T,{variant:b.C.LEADGEN},n.createElement(S.Provider,{value:{control:w,bmiGenerated:d,isTouched:x,linkTool:A,submitProps:u,withAdditionalQuestion:p,classes:h}},"inline"===m?n.createElement(InlineForm,Object.assign({},_)):n.createElement(DefaultForm,Object.assign({},_,{isMobile:g}))))},P=(0,n.createContext)({}),Error=e=>{let{errorLabelSize:t}=(0,n.useContext)(P);return n.createElement(v.e,Object.assign({textProps:{size:t},sx:{marginTop:5}},e))};var I=Object.assign(e=>{var t,a,i,o,r,s,{children:d,isMobile:c}=e,m=(0,l._)(e,["children","isMobile"]);let u=Object.assign({isMobile:c,labelSize:null!==(t=m.labelSize)&&void 0!==t?t:c?"p2":"s4",subLabelSize:null!==(a=m.subLabelSize)&&void 0!==a?a:"subText",optionLabelSize:null!==(i=m.optionLabelSize)&&void 0!==i?i:c?"p2":"s4",inputSize:null!==(o=m.inputSize)&&void 0!==o?o:c?"sm":"md",gutter:null!==(r=m.gutter)&&void 0!==r?r:c?4:12,errorLabelSize:null!==(s=m.errorLabelSize)&&void 0!==s?s:"p3"},m);return n.createElement(P.Provider,{value:u},d)},{Row:e=>{var{children:t}=e,a=(0,l._)(e,["children"]);let{gutter:i}=(0,n.useContext)(P);return n.createElement(m.r,Object.assign({gutter:i},a),t)},Col:e=>{var{children:t}=e,a=(0,l._)(e,["children"]);return n.createElement(m.r.Col,Object.assign({span:12},a),t)},SubLabel:e=>{var{children:t}=e,a=(0,l._)(e,["children"]);let{subLabelSize:i}=(0,n.useContext)(P);return n.createElement(h.T,Object.assign({size:i},a),t)},Label:e=>{var{children:t}=e,a=(0,l._)(e,["children"]);let{labelSize:i}=(0,n.useContext)(P);return n.createElement(h.T,Object.assign({size:i,weight:"semiBold"},a,{span:!0}),t)},OptionLabel:e=>{var{children:t}=e,a=(0,l._)(e,["children"]);let{optionLabelSize:i}=(0,n.useContext)(P);return n.createElement(h.T,Object.assign({size:i,weight:"regular"},a,{span:!0}),t)},Input:v.I,InputNumber:e=>{var{error:t}=e,a=(0,l._)(e,["error"]);let{inputSize:i}=(0,n.useContext)(P);return n.createElement("div",null,n.createElement(v.I.Number,Object.assign({size:i},a)),t&&n.createElement(Error,{label:t}))},GenderControl:e=>{let{inputSize:t}=(0,n.useContext)(P);return n.createElement(w.G,Object.assign({size:t},e))},Error})},izrS:function(e,t,a){a.d(t,{u:function(){return l}});var l=(0,a("/npG").k)(e=>({root:{},inner:{},content:{borderRadius:16},header:{borderBottom:`1px solid ${e.colors.neutral[1]}`,marginRight:0,marginBottom:0,padding:"12px"},overlay:{},title:{fontSize:16,fontWeight:700,lineHeight:1.5},body:{},close:{cursor:"pointer",width:"unset",height:"unset",svg:{width:"24px !important",height:"24px !important"}}}))},"/scx":function(e,t,a){a.d(t,{L:function(){return LabelSorting}});var l,n,i=a("q1tI"),o=a("Rh7u"),r=a("9E0F"),s=a("KF5v");(l=n||(n={})).latest="latest",l.oldest="oldest",l.popular="popular";let LabelSorting=({onChange:e,className:t,style:a,leftLabel:l,rightLabel:n,color:d,value:c,choices:m})=>{let{data:{env:{isMarryBaby:u}}}=(0,i.useContext)(r.T);return i.createElement(s.L,{label:l,rightLabel:i.createElement(s.b,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:m.map(t=>({label:t.label,onClick:()=>e&&e(String(t.value)),selected:t.value===c,className:"bold-item"}))},toggleButtonContent:i.createElement("div",{style:{display:"flex"}},i.createElement(o.T,{style:{display:"flex",alignItems:"center",fontWeight:"normal",marginRight:12},size:"p4"},n),i.createElement("img",{src:u?"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%233E3F58' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m8 14 4 4 4-4M16 10l-4-4-4 4'/%3e%3c/svg%3e":"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath fill='%238C8C8C' d='M4.5 7h7a.46.46 0 0 0 .351-.165.56.56 0 0 0 .149-.39q0-.226-.149-.391l-3.5-3.89a.458.458 0 0 0-.703 0l-3.5 3.89a.56.56 0 0 0-.148.39q0 .226.148.391Q4.298 7 4.5 7M11.5 9h-7a.46.46 0 0 0-.352.165.56.56 0 0 0-.148.39q0 .226.148.391l3.5 3.889a.46.46 0 0 0 .703 0l3.5-3.889a.56.56 0 0 0 .149-.39q0-.226-.149-.391A.46.46 0 0 0 11.5 9'/%3e%3c/svg%3e",style:{width:16,height:16,alignSelf:"center"},loading:"lazy"}))}),color:"gray",className:t,style:a})}},OH7u:function(e,t,a){a.d(t,{c:function(){return convertLocalizedStringToNumber},f:function(){return formatPhoneNumber},l:function(){return localizeNumberFormat}});var l=a("A9bs");let localizeNumberFormat=(e,t,a=2)=>Intl.NumberFormat(void 0,{maximumFractionDigits:a}).format(e),convertLocalizedStringToNumber=e=>Number(e.replace(/,/gi,".")),formatPhoneNumber=e=>{try{let t=(0,l.parsePhoneNumber)(e,"VN");if(!(null==t?void 0:t.number))throw Error("Invalid number");return(0,l.formatPhoneNumber)(t.number)}catch(t){return console.log("\uD83D\uDE80 ~ formatPhoneNumber ~ error:",t),e}}},qh5g:function(e,t,a){a.d(t,{L:function(){return o}});var l=a("q1tI"),n=a("Y6+v"),i=a("CKJU");let o=(0,l.memo)(({type:e,width:t,height:a,isLight:o})=>{let r=(0,l.useMemo)(()=>{switch(e){case"hellobacsi":return{width:t||"107px",height:a||"24px",src:n.C.getAssetPath("logo/hellobacsi.png"),srcLight:n.C.getAssetPath("logo/hellobacsi-light.png")};case"hellodoktor":return{width:t||"127px",height:a||"24px",src:n.C.getAssetPath("logo/hellodoktor.png")};case"hellosehat":return{width:t||"121px",height:a||"27px",src:n.C.getAssetPath("logo/hellosehat.png")};case"hellojiankang":return{width:t||"87px",height:a||"24px",src:n.C.getAssetPath("logo/hellojiankang.png")};case"hellohealth":return{width:t||"123px",height:a||"24px",src:n.C.getAssetPath("logo/hellohealth.png")};case"hellotogether":return{width:t||"150px",height:a||"24px",src:n.C.getAssetPath("logo/hellotogether.png")};case"hellocare":return{width:t||"99px",height:a||"24px",src:n.C.getAssetPath("logo/hellocare.png")};case"hellodoctor":return{width:t||"127px",height:a||"24px",src:n.C.getAssetPath("logo/hellodoctor.png")};case"hellokrupet":return{width:t||"101px",height:a||"24px",src:n.C.getAssetPath("logo/hellokrupet.png")};case"hellosayarwon":return{width:t||"111px",height:a||"24px",src:n.C.getAssetPath("logo/hellosayarwon.png")};case"helloyishi":return{width:t||"89px",height:a||"24px",src:n.C.getAssetPath("logo/helloyishi.png")};case"hellokhunmor":return{width:t||"123px",height:a||"24px",src:n.C.getAssetPath("logo/hellokhunmor.png")};case"helloswasthya":return{width:t||"105px",height:a||"24px",src:n.C.getAssetPath("logo/helloswasthya.png")};case"logomark":return{width:t||"60px",height:a||"57px",src:n.C.getAssetPath("logo/logomark.png")};case"marryBaby":return{width:t||"145px",height:a||"28px",src:n.C.getAssetPath("logo/marrybaby.png")};default:return null}},[e,t,a]),{src:s,width:d,height:c,srcLight:m}=r||{};return l.createElement(i.I,{alt:`${e} logo`,className:"main-logo-icon",src:o&&m||s,style:{width:d,height:c}})})}}]);