"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5464],{vq0H:function(e,t,o){o.d(t,{I:function(){return ImageWrap},u:function(){return useScreenSize}});var r=o("q1tI"),a=o("HMwR"),i=o("z/kP"),n=o("rBCA");let getIsMobile=()=>"undefined"!=typeof window&&window.innerWidth"undefined"!=typeof window&&window.innerWidth>=a.B.BREAK_POINT_MOBILE&&window.innerWidth{let[e,t]=(0,r.useState)(getIsMobile()),[o,a]=(0,r.useState)(getIsLargeMobile());return(0,r.useEffect)(()=>{let handleResize=()=>{t(getIsMobile()),a(getIsLargeMobile())};return window.addEventListener("resize",handleResize,{passive:!0}),()=>{window.removeEventListener("resize",handleResize)}},[]),{isMobile:e,isLargeMobile:o}},ImageWrap=e=>{var{alt:t,backupSrc:o,src:a,placeholderSrc:n,style:s,ref:d}=e,c=(0,i._)(e,["alt","backupSrc","src","placeholderSrc","style","ref"]);let[p,u]=(0,r.useState)(!1);return r.createElement(l,Object.assign({loading:"lazy",alt:t,onError:()=>!p&&u(!0),src:p?o||a:a||o,style:Object.assign(Object.assign({},n?{backgroundImage:`url(${n})`}:{}),s),"data-has-placeholder":!!n,ref:d},c))},l=n.Z.img` &[data-has-placeholder='true'] { background-position: center; background-repeat: no-repeat; background-size: cover; } `},vjVn:function(e,t,o){o.d(t,{B:function(){return BtnChoice}});var r=o("q1tI"),a=o("g8xC"),i=o("rBCA");let n=i.Z.div` display: flex; align-items: center; gap: 8px; button[data-color='tertiary'] { background: white; } `,BtnChoice=({value:e,choices:t,className:o,onChange:i})=>{let[l,s]=(0,r.useState)(e);return(0,r.useEffect)(()=>{s(e)},[e]),r.createElement(n,{className:o},t.map((e,t)=>r.createElement(a.B,{dataEventCategory:e.dataEventCategory,dataEventAction:e.dataEventAction,dataEventLabel:e.dataEventLabel,size:"sm",variant:e.value===l?"primary":"tertiary",className:e.value===l?"btn-choice-selected":"",key:t,onClick:()=>{s(e.value),null==i||i(e.value)}},e.label||"")))}},"4B16":function(e,t,o){o.d(t,{B:function(){return h},C:function(){return M},E:function(){return R},F:function(){return N},G:function(){return v},N:function(){return _},S:function(){return T},V:function(){return S},a:function(){return b},c:function(){return y},d:function(){return w},e:function(){return k},f:function(){return x},g:function(){return I},h:function(){return O},i:function(){return U}});var r,a,i,n,l,s,d,c,p,u,m,g,v,h,b,E,f,y,w,_,x,I,S,T,C=o("r9m4");(r=v||(v={})).Boy="boy",r.Girl="girl",(a=h||(h={}))[a.Height=0]="Height",a[a.Weight=1]="Weight",a[a.Head=2]="Head",a[a.BMI=3]="BMI",(i=b||(b={}))[i.Weekly=0]="Weekly",i[i.Monthly=1]="Monthly",i[i.Yearly=2]="Yearly",(n=E||(E={}))[n.Height=0]="Height",n[n.Weight=1]="Weight",n[n.Head=2]="Head",n[n.BMI=3]="BMI",n[n.Record=4]="Record",(l=f||(f={}))[l.Phone=0]="Phone",l[l.OTP=1]="OTP",l[l.OTPEmail=2]="OTPEmail",l[l.PersonalInfo=3]="PersonalInfo",l[l.UpdatePassword=4]="UpdatePassword",l[l.Result=5]="Result",l[l.DynamicForm=6]="DynamicForm",(s=y||(y={}))[s.HEAD=0]="HEAD",s[s.TAIL=1]="TAIL",s[s.MIDDLE=2]="MIDDLE",s[s.CONNECT=3]="CONNECT",s[s.SSO=4]="SSO",s[s.MULTIPLE=5]="MULTIPLE",(d=w||(w={}))[d.UNDEFINED=-1]="UNDEFINED",d[d.TEXT=0]="TEXT",d[d.IMAGE=1]="IMAGE",d[d.FORM=2]="FORM",d[d.CONDITION=3]="CONDITION",d[d.POLL=4]="POLL",d[d.FINAL_STANDARD=5]="FINAL_STANDARD",d[d.FINAL=6]="FINAL",d[d.FINAL_THANK_YOU=7]="FINAL_THANK_YOU",d[d.RATING=8]="RATING",d[d.REACTION=9]="REACTION",d[d.REVIEW=10]="REVIEW",d[d.RESULT_POLL=11]="RESULT_POLL",d[d.RESULT_RATING=12]="RESULT_RATING",d[d.RESULT_REACTION=13]="RESULT_REACTION",d[d.OTP=14]="OTP";let k=[w.FINAL,w.FINAL_STANDARD,w.FINAL_THANK_YOU];(c=_||(_={})).BOT_TEXT="bot-text",c.BOT_IMAGE="bot-image",c.BOT_BACKGROUND_IMAGE="bot-background-image",c.BOT_BUTTON="bot-button",c.BOT_URL="bot-url",c.BOT_RECALCULATE="bot-recalculate",c.BOT_BOOKING="bot-booking",c.BOT_MAIN_TITLE="bot-main-title",c.BOT_MAIN_IMAGE="bot-main-image",c.BOT_MAIN_BODY="bot-main-body",c.BOT_MAIN_BUTTON="bot-main-button",c.BOT_SUB_TITLE="bot-sub-title",c.BOT_SUB_BODY="bot-sub-body",c.BOT_LANDING_PAGE_URL="bot-landing-page-url",c.BOT_LANDING_PAGE_BUTTON="bot-landing-page-button",c.BOT_RISK_SCREEN="bot-risk-screen",c.BOT_RELATED_ARTICLE="bot-related-article",c.THANK_YOU_IMAGE="thank-you-image",c.THANK_YOU_TITLE="thank-you-title",c.THANK_YOU_BODY="thank-you-body",c.TOTAL_LINE="total-line",c.BOT_SUBMISSION="bot-submission",c.BOT_EVENT_SUBMISSION="bot-event-submission",c.BOT_SUGGESTED_SERVICE="bot-suggested-service",c.SSO_INTENT="sso-intent",(p=x||(x={})).ACTION_CONDITION="action-condition",p.ACTION_INTERNAL="action-internal",p.ACTION_EXTERNAL="action-external",p.ACTION_SSO_REDIRECT="action-sso-redirect",p.ACTION_MULTIPLE_BUTTON="action-multiple-button",p.USER_CHOICE_TEXT="user-choice-text",p.USER_CHOICE_TEXT_BY_INPUT="user-choice-text-by-input",p.USER_CHOICE_NEXT="user-choice-next",p.USER_CHOICE_IMAGE="user-choice-image",p.USER_SUBMIT_TEXT="user-submit-text",p.USER_SUBMIT_NUMBER="user-submit-number",p.USER_SUBMIT_NAME="user-submit-name",p.USER_SUBMIT_PHONE="user-submit-phone",p.USER_SUBMIT_EMAIL="user-submit-email",p.USER_SUBMIT_DROPDOWN="user-submit-dropdown",p.USER_SUBMIT_DATE="user-submit-date",p.USER_SUBMIT_DOB="user-submit-dob",p.USER_SUBMIT_CONFIRM="user-submit-confirm",p.USER_SUBMIT_SEND="user-submit-send",p.USER_SUBMIT_RESEND="user-submit-resend",p.USER_SUBMIT_ADDRESS="user-submit-address",p.USER_SUBMIT_ADDRESS_PROVINCE="user-submit-address-province",p.USER_SUBMIT_ADDRESS_DISTRICT="user-submit-address-district",p.USER_SUBMIT_ADDRESS_COMMUNE="user-submit-address-commune",p.USER_SUBMIT_BMI="user-submit-bmi",p.USER_SUBMIT_BMI_HIDDEN="user-submit-bmi-hidden",p.USER_SUBMIT_TERMS="user-submit-terms",p.USER_SUBMIT_GENDER="user-submit-gender",p.USER_SUBMIT_OTP="user-submit-otp",p.USER_SUBMIT_WHATSAPP="user-submit-whatsapp",p.POLL_CHOICE="poll-choice",p.POLL_CHOICE_TEXT_BY_INPUT="poll-choice-text-by-input",p.POLL_CHOICE_IMAGE="poll-choice-image",p.POLL_BUTTON="poll-button",p.RATING_STAR="rating-star",p.RATING_DESCRIPTION="rating-description",p.RATING_BUTTON="rating-button",p.LIKE_CHOICE="like-choice",p.DISLIKE_CHOICE="dislike-choice",p.REVIEW_CHOICE="review-choice",p.REVIEW_DESCRIPTION="review-description",p.REVIEW_BUTTON="review-button",p.RESULT_BUTTON="result-button",p.POLL_RESULT="poll-result",p.USER_SUBMIT_GOOGLE_API_ADDRESS="user-submit-google-api-address";let N=[x.USER_SUBMIT_ADDRESS_PROVINCE,x.USER_SUBMIT_ADDRESS_DISTRICT,x.USER_SUBMIT_ADDRESS_COMMUNE,x.USER_SUBMIT_ADDRESS];(u=I||(I={}))[u.UNLIMITED=0]="UNLIMITED",u[u.EXACT_NUMBER=1]="EXACT_NUMBER",u[u.RANGE=2]="RANGE";let R={[x.USER_SUBMIT_EMAIL]:"email",[x.USER_SUBMIT_TEXT]:"text",[x.USER_SUBMIT_DROPDOWN]:"text",[x.USER_SUBMIT_NAME]:"name",[x.USER_SUBMIT_NUMBER]:"number",[x.USER_SUBMIT_ADDRESS]:"address",[x.USER_SUBMIT_PHONE]:"tel",[x.USER_SUBMIT_OTP]:"tel",[x.USER_SUBMIT_WHATSAPP]:"tel",[x.USER_SUBMIT_DATE]:"date",[x.USER_SUBMIT_CONFIRM]:"confirm",[x.USER_SUBMIT_SEND]:"submit",[x.USER_SUBMIT_TERMS]:"terms",[x.USER_SUBMIT_ADDRESS_PROVINCE]:"province",[x.USER_SUBMIT_ADDRESS_DISTRICT]:"district",[x.USER_SUBMIT_ADDRESS_COMMUNE]:"commune",[x.USER_SUBMIT_BMI]:"bmi",[x.USER_SUBMIT_GENDER]:"gender",[x.POLL_CHOICE]:"poll",[x.POLL_CHOICE_TEXT_BY_INPUT]:"poll",[x.POLL_CHOICE_IMAGE]:"poll",[x.RATING_STAR]:"rating",[x.RATING_DESCRIPTION]:"text",[x.LIKE_CHOICE]:"like",[x.DISLIKE_CHOICE]:"dislike",[x.REVIEW_CHOICE]:"review",[x.USER_SUBMIT_GOOGLE_API_ADDRESS]:"google-api-address",[x.USER_SUBMIT_DOB]:"dob"},O={FRU:"FRU",survey:"Survey",ristScreener:"risk_screener",voucherAcuvue:"ACUVUE"};(m=S||(S={})).VIDEO="video",m.SHORTS="short",m.PODCAST="podcast",m.LIVESTREAM="live-stream",(g=T||(T={})).Facebook="facebook",g.Zalo="zalo",g.Twitter="twitter",g.WhatsApp="whatsApp",g.Line="line",g.Instagram="instagram",g.LinkedIn="linkedin",g.Youtube="youtube",g.Tiktok="tiktok",g.Telegram="telegram",g.Viber="viber";let M={DD:{id:"common.day",defaultMessage:"Day"},MM:{id:"common.month",defaultMessage:"Month"},YYYY:{id:"common.year",defaultMessage:"Year"}};var U=Object.freeze({__proto__:null,get SocialType(){return T},COMMON_DATE_TRANSLATE_KEY:M,get Gender(){return v},get BabyGrowthChartType(){return h},get BabyGrowthChartDuration(){return b},get BabyGrowthResultTab(){return E},get LOCALE(){return C.L},get OnboardingStep(){return f},get NodePosition(){return y},get NodeType(){return w},NodeFinalTypes:k,get NodeIntentType(){return _},get NodeActionType(){return x},FULL_KEY_ADDRESS:N,get NodeMultipleOptions(){return I},ELEMENT_CONTROL_INPUT_TYPE:R,SubotType:O,get VideoType(){return S}})},OXNl:function(e,t,o){o.d(t,{A:function(){return Alert},B:function(){return Badge},C:function(){return CardCollapse},D:function(){return DragFreeCarousel},F:function(){return FileDropdown},G:function(){return Grid},H:function(){return HtmlContent},I:function(){return IconHeading},R:function(){return Radio},S:function(){return StepRenderer},T:function(){return Tag},U:function(){return Upload},a:function(){return BorderHeading},b:function(){return RateStars},c:function(){return Toggle},d:function(){return H},e:function(){return X},f:function(){return i},g:function(){return n}});var r,a,i,n,l=o("q1tI"),s=o("/kWL"),d=o("rBCA"),c=o("iBNF"),p=o("HMwR"),u=o("4JiQ"),m=o("mYVa"),g=o("iuhU"),v=o("Iblh"),h=o("4MaP"),b=o("FNss"),E=o("z/kP"),f=o("Vitr"),y=o("gEnE"),w=o("yVya"),_=o("rPIz"),x=o("uFLQ"),I=o("5kis"),S=o("Zdfy");let Upload=e=>l.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 18 18",fill:"none"},e),l.createElement("path",{d:"M9.82324 8.7033L10.8228 9.70287C10.9267 9.80662 11.056 9.8573 11.2107 9.85493C11.3655 9.85255 11.4948 9.79943 11.5987 9.69555C11.7026 9.59168 11.7545 9.46074 11.7545 9.30274C11.7545 9.14474 11.7026 9.01462 11.5987 8.91237L9.7353 7.04899C9.59968 6.91337 9.44149 6.84555 9.26074 6.84555C9.07999 6.84555 8.9218 6.91337 8.78618 7.04899L6.91549 8.91968C6.81174 9.02355 6.75987 9.15287 6.75987 9.30762C6.75987 9.46237 6.81174 9.59168 6.91549 9.69555C7.01937 9.79943 7.1503 9.85137 7.3083 9.85137C7.4663 9.85137 7.59643 9.79943 7.69868 9.69555L8.69824 8.7033L8.69824 11.5576C8.69824 11.717 8.75218 11.8506 8.86005 11.9583C8.96793 12.0662 9.10156 12.1201 9.26093 12.1201C9.42043 12.1201 9.55399 12.0662 9.66162 11.9583C9.76937 11.8506 9.82324 11.717 9.82324 11.5576L9.82324 8.7033ZM16.3857 9.3063C16.3857 10.2918 16.1987 11.2181 15.8247 12.0852C15.4507 12.9524 14.9432 13.7066 14.3021 14.348C13.6609 14.9894 12.907 15.4972 12.0402 15.8714C11.1735 16.2456 10.2474 16.4326 9.26205 16.4326C8.27655 16.4326 7.35024 16.2456 6.48312 15.8716C5.61599 15.4976 4.86174 14.9901 4.22037 14.3489C3.57899 13.7078 3.07118 12.9539 2.69693 12.0871C2.3228 11.2204 2.13574 10.2943 2.13574 9.30893C2.13574 8.32343 2.32274 7.39712 2.69674 6.52999C3.07074 5.66287 3.5783 4.90862 4.21943 4.26724C4.86055 3.62587 5.61449 3.11805 6.48124 2.7438C7.34799 2.36968 8.27405 2.18262 9.25943 2.18262C10.2449 2.18262 11.1712 2.36962 12.0384 2.74362C12.9055 3.11762 13.6597 3.62518 14.3011 4.2663C14.9425 4.90743 15.4503 5.66137 15.8246 6.52812C16.1987 7.39487 16.3857 8.32093 16.3857 9.3063ZM15.2607 9.30762C15.2607 7.63262 14.6795 6.21387 13.517 5.05137C12.3545 3.88887 10.9357 3.30762 9.26074 3.30762C7.58574 3.30762 6.16699 3.88887 5.00449 5.05137C3.84199 6.21387 3.26074 7.63262 3.26074 9.30762C3.26074 10.9826 3.84199 12.4014 5.00449 13.5639C6.16699 14.7264 7.58574 15.3076 9.26074 15.3076C10.9357 15.3076 12.3545 14.7264 13.517 13.5639C14.6795 12.4014 15.2607 10.9826 15.2607 9.30762Z",fill:"#595959"})),Alert=({style:e,onClose:t,text:o,type:r,contentIcon:a,closeIcon:i,className:n,description:d})=>l.createElement("div",{className:`CHw-fZZ ${n||""}`,style:e,"data-alert-type":r},l.createElement("div",{className:"_03U6VRS"},l.createElement("div",{className:"icon-title"},a,l.createElement(s.T,{weight:"bold",size:"label1"},o)),l.createElement(s.T,{weight:"regular",size:"p3"},d)),l.createElement("div",{className:"EO828Vv",onClick:t},i)),renderNotificationStyles=(e,t,o,r)=>{let a,i="";if("numeric"===e)switch(t){case"medium":i=` height: 16px; font-size: 11px; padding: 1px 6px; `;case"large":i=` height: 24px; font-size: 13px; padding: 1px 10px; `}let n="";o&&(n=` position: absolute; top: 0; left: 75%; `),o&&(a=` left: 70%; ${"large"===t?` top: -7px; `:"medium"===t?` top: -2px; width: 16px; height: 16px; `:""} `);let l="";switch(r){case"primary":l=` background: ${c.r.colors.primary50}; color: ${c.r.colors.primary600}; `;break;case"error":l=` background: ${c.r.colors.error}; color: white; `}switch(e){case"dot":return` ${n} width: 8px; height: 8px; font-size: 0px; border-radius: 50%; ${l} `;case"numeric":return` ${n} width: max-content; border-radius: 32px; ${i} ${a} ${l} `}},T=d.Z.div` position: relative; > div { width: max-content; position: relative; } span { font-weight: ${c.r.sizes.fwBold}; display: flex; justify-content: center; align-items: center; ${e=>renderNotificationStyles(e.notificationType,e.notificationSize,e.hasIcon,e.notificationColor)} } ${e=>e.hasIcon&&` svg { width: 40px; height: 40px; } `} `,Badge=({amount:e,type:t,size:o="medium",color:r="primary",icon:a,className:i})=>l.createElement(T,{"data-notification-type":t,"data-notification-size":o,"data-notification-color":r,"data-has-icon":!!a||void 0,notificationType:t,notificationSize:o,notificationColor:r,hasIcon:!!a,className:i},l.createElement("div",null,e&&l.createElement("span",null,e)," ",a&&l.createElement("div",null,a))),C=d.Z.h4` position: relative; line-height: 18px; &:after { position: absolute; top: 1px; left: 0; width: 4px; height: 18px; background-color: ${c.r.colors.primaryBase}; content: ''; } &[data-size='lg'] { font-size: 18px; padding-left: 12px; } &[data-size='sm'] { font-size: 14px; padding-left: 8px; &::after { width: 2px; height: 15px; } } &[data-type='bold'] { font-weight: ${c.r.sizes.fwBold}; } &[data-type='semiBold'] { font-weight: ${c.r.sizes.fwSemiBold}; } &[data-uppercase] { text-transform: uppercase; } ${p.M.mbDown} { &[data-size='lg'] { font-size: 16px; } } `,BorderHeading=({style:e,children:t,className:o,size:r="lg",type:a="bold",upperCase:i,as:n="h4",color:s})=>l.createElement(C,{style:Object.assign({color:s},e),className:o,"data-size":r,"data-type":a,"data-uppercase":i,as:n},t),k=(0,d.Z)(h.S)` flex-shrink: 0; color: ${c.r.colors.neutral800}; width: 16px; height: 16px; transition: transform 0.2s ease-in-out; transform: rotate(-180deg); &[data-is-collapsed='true'] { transform: rotate(0deg); } `,N=d.Z.div` background-color: white; .icon { width: 20px; height: 20px; flex-shrink: 0; color: ${c.r.colors.neutral800}; } .title-collapse { color: #111111; font-weight: var(--fwSemiBold); font-size: 1.0625rem; line-height: 1.5rem; flex-grow: 1; } .box-collapse { display: flex; padding: 1.5rem 1rem 1rem 1rem; gap: 0.75rem; align-items: center; } `;function CardCollapse({children:e,title:t,icon:o,defaultOpened:r=!0,haveCollapse:a=!0,id:i,className:n,as:d="h2"}){let[c,{toggle:p}]=(0,v.q)(r);return l.createElement(N,{id:i,className:n},l.createElement("div",{className:"box-collapse",onClick:()=>{a&&p()}},a&&o,l.createElement(s.T,{as:d,className:"title-collapse"},t),a&&l.createElement(k,{"data-is-collapsed":c})),l.createElement(u.U,{in:!a||c,transitionDuration:200,transitionTimingFunction:"ease"},e))}let R=d.Z.div` position: relative; box-sizing: border-box; border: 1px solid ${c.r.colors.gray200}; background: url('../../../public/bgSvg/arrow-down.svg') no-repeat; background-position: right 16px center; border-radius: ${c.r.borderRadius}; &[data-has-icons='true'] { border: none; background: ${c.r.colors.gray100}; img, svg { display: inline-block; max-width: 16px; margin-right: 6px; } span { vertical-align: middle; display: inline-block; } &:hover { box-shadow: none; } > div { position: relative; width: 100%; display: flex; align-items: center; box-sizing: border-box; } > div::after { content: ''; right: 12px; top: 50%; background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23595959' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A"); width: 10px; height: 8px; position: absolute; background-repeat: no-repeat; transform: translateY(-50%); } } &:hover { box-shadow: 0 0 2px 2px ${c.r.colors.primary200}; } `,O=d.Z.div` padding: 12px 18px 12px 16px; cursor: pointer; &[data-dropdown-open] { padding: 11px 15px 11px 15px; border: 1px solid ${c.r.colors.primaryBase}; border-radius: ${c.r.borderRadius}; box-shadow: 0 0 2px 2px ${c.r.colors.primary200}; } & > svg { height: 16px; width: 16px; } `,M=d.Z.ul` position: absolute; top: 100%; right: 0; left: 0; display: block; margin-top: 4px; background: ${c.r.colors.white}; border-radius: ${c.r.borderRadius}; box-shadow: -1px 1px 2px rgba(67, 70, 74, 0.0001), -2px 2px 5px rgba(67, 86, 100, 0.123689); cursor: pointer; &[data-has-icons='true'] { background: white; box-shadow: none; border: 1px solid ${c.r.colors.gray200}; filter: drop-shadow(0px 10px 16px rgba(0, 0, 0, 0.04)); } `,U=d.Z.li` margin: 8px; padding: 12px 18px 12px 16px; border-radius: ${c.r.borderRadius}; display: flex; &:hover, :active { background: ${c.r.colors.gray100}; } `,B=d.Z.div` display: flex; align-items: center; margin-right: 8px; & > svg { height: 16px; width: 16px; } `,ShareIconPathStyle=()=>l.createElement("style",null,".file-dropdown-path{fill:none;stroke:#595959;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5px}"),DefaultFileIcon=()=>l.createElement("svg",{id:"prefix__Layer_1","data-name":"Layer 1",viewBox:"0 0 12.17 14.83"},l.createElement("defs",null,l.createElement("clipPath",{id:"prefix__clip-path",transform:"translate(-1.92 -1.54)"},l.createElement("path",{fill:"none",d:"M0 .96h16v16H0z"}))),l.createElement("title",null,"File"),l.createElement("g",{clipPath:"url(#prefix__clip-path)"},l.createElement("path",{className:"file-dropdown-path",d:"M8.67 2.29H4a1.33 1.33 0 00-1.33 1.33v10.67A1.33 1.33 0 004 15.62h8a1.33 1.33 0 001.33-1.33V7z",transform:"translate(-1.92 -1.54)"}),l.createElement("path",{className:"file-dropdown-path",d:"M8.67 2.29V7h4.66",transform:"translate(-1.92 -1.54)"}))),DownloadIcon=()=>l.createElement("svg",{id:"prefix__Layer_1","data-name":"Layer 1",viewBox:"0 0 13.5 13.5"},l.createElement("title",null,"download"),l.createElement("path",{className:"file-dropdown-path",d:"M14 11v2.66A1.33 1.33 0 0112.67 15H3.33A1.33 1.33 0 012 13.62V11M4.67 7.62L8 11l3.33-3.34M8 11V3",transform:"translate(-1.25 -2.21)"})),UploadIcon=()=>l.createElement("svg",{id:"prefix__Layer_1","data-name":"Layer 1",viewBox:"0 0 13.5 13.5"},l.createElement("title",null,"upload"),l.createElement("path",{className:"file-dropdown-path",d:"M14 11v2.66A1.33 1.33 0 0112.67 15H3.33A1.33 1.33 0 012 13.62V11M11.33 6.29L8 3 4.67 6.29M8 3v8",transform:"translate(-1.25 -2.21)"})),FileDropdown=({className:e,value:t,options:o,onUploadSelected:r,id:a,placeholderIcon:i,placeholder:n,style:s})=>{let[d,c]=(0,l.useState)(!1),showDropdown=()=>c(!d),p=(0,l.useRef)(o.map(e=>"upload"===e.type&&l.createElement("input",{id:"uploader-dropdown-input-"+a+"-"+e.value,key:"uploader-dropdown-input-"+a+"-"+e.value,accept:e.fileAcceptedType,multiple:e.multiple,type:"file",style:{display:"none"},onChange:e=>{console.log("change"),r(e.target.files)}}))),onUpload=e=>{var t;null===(t=document.querySelector(e))||void 0===t||t.click()},onDownload=e=>{e&&window.open(e,"_blank")};return l.createElement(R,{className:e,"data-dropdown-open":!!d,id:a,"data-has-icons":!0,style:s,onBlur:()=>c(!1),tabIndex:0},l.createElement(ShareIconPathStyle,null),l.createElement(O,{onClick:showDropdown},i||l.createElement(DefaultFileIcon,null)," ",l.createElement("span",null,t&&t.value?t.label:n)),d&&l.createElement(M,{onClick:showDropdown,"data-has-icons":!0},o.map(e=>l.createElement(U,{key:`${a}-${e.value}`,"data-selected":t&&t.value===e.value||void 0,onClick:()=>"upload"===e.type?onUpload("#uploader-dropdown-input-"+a+"-"+e.value):onDownload(e.url)},l.createElement(B,null,e.icon||"download"===e.type?l.createElement(DownloadIcon,null):l.createElement(UploadIcon,null)),e.label))),l.createElement(l.Fragment,null,p.current))},A=d.Z.div` --columns: var(--grid-template-columns, repeat(var(--columns-count), 1fr)); --columns-desktop: var( --grid-template-columns-desktop, repeat(var(--columns-count-desktop), 1fr) ); display: grid; grid-template-columns: var(--columns); grid-gap: var(--grid-gap); align-items: var(--align-items); ${p.M.tdUp} { grid-template-columns: var(--columns-desktop); } > * { justify-self: var(--justify-children); } `,Grid=({className:e,columns:t,columnsDesktop:o,gridTemplateColumns:r,gridTemplateColumnsDesktop:a,gap:i,children:n,justifyChildren:s,style:d,alignItems:c})=>l.createElement(A,{className:e,style:Object.assign({"--columns-count":t,"--columns-count-desktop":o,"--grid-template-columns":r,"--grid-template-columns-desktop":a,"--justify-children":s,"--grid-gap":i,"--align-items":c},d)},n),Radio=({size:e="small",label:t,name:o,checked:r,value:a,className:i,isDisabled:n=!1,onChange:s,dataEventCategory:d,dataEventAction:c,dataEventLabel:p})=>{let u=!!c&&!!d&&!!p,m=u?{"data-event-category":d,"data-event-action":c,"data-event-label":p}:{};return l.createElement(b.R,Object.assign({size:"small"===e?"md":"lg",label:t,name:o,checked:r,value:a,className:i,disabled:n,onChange:e=>null==s?void 0:s(e.target.value)},m))},L=d.Z.div` display: inline-flex; gap: calc(var(--gap) * 1px); > svg { width: calc(var(--star-size) * 1px); height: calc(var(--star-size) * 1px); } &[data-selectable='true'] { > svg { cursor: pointer; } } `,StarHalfIcon=e=>l.createElement("svg",Object.assign({},e,{viewBox:"0 0 24 24",fill:"none"}),l.createElement("path",{d:"m139.287 144.772 5.17 3.12c.38.23.85-.11.75-.54l-1.37-5.88 4.56-3.95c.33-.29.16-.84-.29-.88l-6.01-.51-2.35-5.54a.498.498 0 0 0-.92 0l-2.35 5.54-6.01.51a.499.499 0 0 0-.28.88l4.56 3.95-1.37 5.88c-.1.43.37.77.75.54z",fill:"#E4E8EC"}),l.createElement("path",{d:"M139.289 144.771s.013-14.488 0-14.488a.49.49 0 0 0-.46.308l-2.35 5.54-6.01.51a.499.499 0 0 0-.28.88l4.56 3.95-1.37 5.88c-.1.43.37.77.75.54z",fill:"#FFC326"})),StarIcon=e=>{var{isFull:t}=e,o=(0,E._)(e,["isFull"]);return l.createElement("svg",Object.assign({},o,{viewBox:"0 0 32 32",fill:"none"}),l.createElement("path",{d:"m16 23.027 6.893 4.16c.507.306 1.134-.147 1-.72l-1.826-7.84 6.08-5.267a.67.67 0 0 0-.387-1.173l-8.013-.68-3.134-7.387a.664.664 0 0 0-1.226 0l-3.133 7.387-8.014.68a.668.668 0 0 0-.373 1.173l6.08 5.267-1.827 7.84c-.133.573.493 1.026 1 .72z",fill:t?"#FFC326":"#D2D6DC"}))},RateStars=({gap:e=2,size:t=24,star:o,totalStars:r=5,onSelect:a,hideEmptyStars:i,style:n,className:s})=>{let d=Math.floor(o),c=o-d>=.5?1:0,[p,u]=(0,l.useState)(null),m=p||d,g=p?0:c;return l.createElement(L,{"data-selectable":!!a,style:Object.assign({"--gap":e,"--star-size":t},n),className:s},Array.from({length:i?d+c:r}).map((e,t)=>{let onMouseOver=()=>!!a&&u(t+1),onMouseLeave=()=>!!a&&u(null);return t+1<=m?l.createElement(StarIcon,{key:t,onClick:()=>null==a?void 0:a(t+1),onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,isFull:!0}):t+1===m+g?l.createElement(StarHalfIcon,{key:t,onClick:()=>null==a?void 0:a(t+1),onMouseOver:onMouseOver,onMouseLeave:onMouseLeave}):l.createElement(StarIcon,{key:t,onClick:()=>null==a?void 0:a(t+1),onMouseOver:onMouseOver,onMouseLeave:onMouseLeave})}))},getTag=(e,t)=>{switch(e){case"yellow":{let e=t?c.r.colors.yellow50:c.r.colors.yellow600;return` background: ${e}; p { color: var( --text-props-color, ${c.r.colors.gray800} ); } `}case"standard":return` background: ${c.r.colors.white}; border: 1px solid ${c.r.colors.gray200}; p { color: var( --text-props-color, ${c.r.colors.gray800} ); } &:hover { background: ${c.r.colors.gray100}; } `;case"red":{let e=t?c.r.colors.red50:c.r.colors.red500;return` background: ${e}; `}case"green":{let e=t?c.r.colors.green50:c.r.colors.green500;return` background: ${e}; `}case"blue":{let e=t?c.r.colors.primary50:c.r.colors.primaryBase;return` background: ${e}; `}case"teal":{let e=t?c.r.colors.teal100:c.r.colors.teal600;return` background: ${e}; `}case"pink":{let e=t?c.r.colors.pink200:c.r.colors.pink800;return` background: ${e}; `}case"violet":{let e=t?c.r.colors.violet100:c.r.colors.violet500;return` background: ${e}; `}case"grey":{let e=t?c.r.colors.gray100:c.r.colors.gray600;return` background: ${e}; `}}},D=d.Z.div` --padding-horizontal: 8px; --pading-vertical: 2px; display: flex; align-items: center; justify-content: center; padding: var(--pading-vertical) var(--padding-horizontal); border-radius: 24px; ${e=>"sponsored"===e.tagType&&` --offset-size: 4px; display: flex; align-items: center; justify-content: center; box-sizing: content-box; position: relative; box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.08); border-radius: 0 4px 18px 0; height: 24px; width: 90px; border-left: var(--offset-size) solid ${c.r.colors.accentLight}; padding: 0; margin-left: calc(var(--offset-size) * -1); p { font-weight: ${c.r.sizes.fwBold}; color: var( --text-props-color, ${c.r.colors.secondaryDark} ); font-size: 11px; margin-left: calc(var(--offset-size) * -1); } &::after { width: calc(var(--offset-size) * 2); height: var(--offset-size); background: ${c.r.colors.accentMain}; position: absolute; left: calc(var(--offset-size) * -1); bottom: calc(var(--offset-size) * -1); clip-path: polygon(0 1%, 100% 0%, 100% 100%); content: ''; } `} ${e=>e.isInline&&` display: inline-block; `} ${e=>e.tagHasMorePadding&&` &[data-has-more-padding] { padding: calc(var(--pading-vertical) + 5px) var(--padding-horizontal); } `} p { ${e=>e.tagIsLight?` color: var(--text-props-color, #000); `:` color: var(--text-props-color, ${c.r.colors.white}); `} } ${e=>getTag(e.tagType,e.tagIsLight)} ${e=>e.tagIsSquared&&"sponsored"!==e.tagType&&` border-radius: 4px; `} ${e=>e.tagIsALink&&` cursor: pointer; `} &[data-is-selected], &:active { background: ${c.r.colors.primary50}; } `,Tag=({type:e,children:t,style:o,isInline:r,isSquared:a=!1,className:i,isLight:n,hasMorePadding:s,isLink:d,isSelected:c,textProps:p={size:"sm"}})=>{let u=p.color?{"--text-props-color":p.color}:{};return l.createElement(D,{"data-is-squared":a||void 0,"data-tag-type":e,"data-is-light":n||void 0,"data-has-more-padding":s||void 0,"data-is-inline":r||void 0,style:Object.assign(Object.assign({},o),u),className:i,"data-is-selected":c||void 0,"data-is-link":d||void 0,tagType:e,isInline:r,tagHasMorePadding:s,tagIsLight:n,tagIsSquared:a,tagIsALink:d},l.createElement(f.T,Object.assign({},p),t))},P="24px",$=(0,y.Z)(d.Z.span` position: relative; display: block; width: 40px; height: ${P}; background: #c3cbd4; border-radius: 100px; cursor: pointer; &:after { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: #fff; border-radius: 90px; content: ''; transition: 0.3s; } `,"hhgcomp-toggle-icon"),z=d.Z.span` padding-left: 15px; `,j=d.Z.div` height: ${P}; input[type='checkbox'] { width: 0; height: 0; visibility: hidden; } label { cursor: pointer; display: inline-flex; color: ${c.r.colors.gray600}; } input:checked + label ${$.classSelector} { background: ${c.r.colors.primaryBase}; &:after { left: calc(100% - 2px); transform: translateX(-100%); } } `,Toggle=({className:e,id:t,onChange:o,checked:r,style:a,label:i})=>l.createElement(j,{className:e,style:a},l.createElement("input",{type:"checkbox",id:t,onChange:o,checked:r}),l.createElement("label",{htmlFor:t},l.createElement($,null),i&&l.createElement(z,null,i))),H=(0,l.createContext)({currentStep:0,setCurrentStep:()=>!1,setMaxStep:()=>!1,nextStep:()=>!1,prevStep:()=>!1}),StepRenderer=({children:e,onStepChange:t})=>{let[o,r]=(0,l.useState)(0),[a,i]=(0,l.useState)(0),n=l.Children.count(e);return(0,l.useEffect)(()=>{i(n-1)},[n]),(0,l.useEffect)(()=>{null==t||t(o)},[o]),l.createElement(H.Provider,{value:{currentStep:o,setCurrentStep:r,setMaxStep:i,nextStep:()=>o+1<=a&&r(o+1),prevStep:()=>o-1>=0&&r(o-1)}},(0,w.Z)(e).map((e,t)=>{let r=t===o;return l.createElement(l.Fragment,{key:t},l.isValidElement(e)?e.props.alwaysRender||r?l.cloneElement(e,{isActive:t===o,stepIndex:t}):null:r?e:null)}))},F=d.Z.div` display: flex; align-items: center; gap: 8px; `,G=(0,d.Z)(_.H)` font-weight: var(--fwBold); `,IconHeading=({icon:e,title:t,className:o,style:r})=>l.createElement(F,{className:o,style:r},e,l.createElement(G,{tag:"h6",color:"var(--secondaryDark)"},t)),sanitizeHtml=e=>{if(!e)return"";let t=e.replace(/\n$/,"").replace(/\n/g,"
");return t},HtmlContent=({htmlContent:e,className:t})=>{let o=sanitizeHtml(e);return l.createElement("div",{className:t,dangerouslySetInnerHTML:{__html:o}})};(r=i||(i={})).ONE_TO_ONE="1:1",r.THREE_TO_ONE="3:1",(a=n||(n={})).PNG=".png",a.JPG=".jpg",a.JPEG=".jpeg";let getBase64=e=>new Promise((t,o)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=o,r.readAsDataURL(e)}),handleMultipleImageFiles=e=>(0,E.a)(void 0,void 0,void 0,function*(){if(0===e.length)return[];let t=yield Promise.all(e.map(e=>getBase64(e)));return t}),Z=d.Z.div` display: flex; flex-direction: column; .image-upload-input-error { margin-top: ${(0,m.h)(12)}; display: flex; flex-direction: column; gap: ${(0,m.h)(4)}; } `,V=d.Z.div` display: flex; flex-direction: column; gap: ${(0,m.h)(4)}; margin-top: ${(0,m.h)(4)}; span { color: ${c.r.colors.neutral500}; } `,W=d.Z.div` position: relative; width: fit-content; padding: ${(0,m.h)(8)} ${(0,m.h)(12)}; border-radius: ${(0,m.h)(12)}; border: ${(0,m.h)(1)} solid ${c.r.colors.neutral200}; cursor: pointer; display: flex; align-items: center; gap: ${(0,m.h)(8)}; margin-top: ${(0,m.h)(18)}; &.image-upload-dragover { border-color: ${c.r.colors.primaryBase}; } &.image-upload-error { border-color: ${c.r.colors.error}; } &.image-upload-disabled { cursor: not-allowed; background-color: ${c.r.colors.gray100}; color: ${c.r.colors.gray400}; border-color: ${c.r.colors.gray200}; } svg { width: ${(0,m.h)(18)}; height: ${(0,m.h)(18)}; } input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: -1; } `,Y=d.Z.div` position: relative; width: ${(0,m.h)(90)}; height: ${(0,m.h)(90)}; border-radius: ${(0,m.h)(12)}; overflow: hidden; background-color: ${c.r.colors.gray100}; display: flex; align-items: center; justify-content: center; img { width: 100%; height: 100%; object-fit: contain; } svg { width: ${(0,m.h)(14)}; height: ${(0,m.h)(14)}; color: ${c.r.colors.white}; } .image-upload-remove-button { cursor: pointer; position: absolute; top: ${(0,m.h)(6)}; right: ${(0,m.h)(6)}; background: ${c.r.colors.black}; border-radius: ${(0,m.h)(12)}; padding: ${(0,m.h)(2)}; display: flex; &:hover { opacity: 0.8; } } `,K=d.Z.div` display: flex; gap: ${(0,m.h)(8)}; margin-top: ${(0,m.h)(18)}; `,X=(0,l.forwardRef)(({label:e,name:t,error:o,acceptedTypes:r=[n.PNG,n.JPG,n.JPEG],maxSize:a=1,acceptedRatios:i,multiple:d=!1,disabled:p=!1,id:u,className:v,onChange:h,value:b,showValidationRules:f=!1,description:y,useBase64:w=!1,placeholder:_},S)=>{let{t:T}=(0,I.u)(),[C,k]=(0,l.useState)(!1),[N,R]=(0,l.useState)([]),O=(0,l.useRef)(null),M=!!o||N.length>0,U=(0,l.useMemo)(()=>b?Array.isArray(b)?b:[b]:[],[b]),B=(0,l.useCallback)(e=>{var t;let o=[],i="."+(null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase());r.includes(i)||o.push(`Unsupported file format. Please upload a ${r.join(", ")} file.`);let n=e.size/1048576;return n>a&&o.push(`File too large. Please upload an image smaller than ${a}MB.`),{file:e,isValid:0===o.length,errors:o}},[r,a]),A=(0,l.useCallback)(e=>new Promise(t=>{if(!i||!i.length||!e.type.startsWith("image/")){t([]);return}let o=new Image;o.onload=()=>{let e=o.width/o.height,r=`${e.toFixed(1)}:1`,a=i.some(t=>{let[o,r]=t.split(":"),a=parseInt(o)/parseInt(r);return .1>Math.abs(e-a)});t(a?[]:[`Image ratio ${r} is not accepted.`])},o.onerror=()=>t(["Invalid image file"]),o.src=URL.createObjectURL(e)}),[i]),L=(0,l.useMemo)(()=>U.map(e=>"string"==typeof e?e:e instanceof File?URL.createObjectURL(e):"").filter(Boolean),[U]),D=(0,l.useCallback)(e=>(0,E.a)(void 0,void 0,void 0,function*(){let o=Array.from(e),r=[],a=[];for(let e of o){let t=B(e),o=yield A(e),i=[...t.errors,...o];0===i.length?a.push(e):r.push(...i)}if(R(r),0===a.length)return;let i=w?yield handleMultipleImageFiles(a):a;h({target:{name:t,value:d?[...U,...i]:i.slice(0,1)}})}),[B,A,d,h,t,U]),removeFile=e=>{let o=U.filter((t,o)=>o!==e);R([]),h({target:{name:t,value:d?o:""}})},P=(0,l.useCallback)(e=>{O.current=e,"function"==typeof S?S(e):S&&(S.current=e)},[S]),$=(0,l.useCallback)(()=>{!p&&O.current&&O.current.click()},[p]),z=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),k(!0)},[]),j=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),k(!1)},[]),H=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),F=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),k(!1);let t=e.dataTransfer.files;t.length>0&&D(t)},[D]);return l.createElement(Z,{className:v},l.createElement("label",{htmlFor:u||t},"string"==typeof e?l.createElement(s.T,{size:"title2"},e):e,y&&l.createElement(s.T,{size:"p3",mt:(0,m.h)(4),color:c.r.colors.gray700},y)),f&&l.createElement(V,null,l.createElement(s.T,{size:"p3"},"Formats: ",r.join("/")),i&&l.createElement(s.T,{size:"p3"},"Max size: ",a,"MB - Accepted ratios:"," ",i.join("/"))),(d||0===U.length)&&l.createElement(W,{className:(0,g.default)(C&&"image-upload-dragover",M&&"image-upload-error",p&&"image-upload-disabled"),onDragEnter:z,onDragLeave:j,onDragOver:H,onDrop:F,onClick:$},l.createElement("input",{ref:P,type:"file",id:u||t,name:t,accept:r.join(","),multiple:d,onChange:e=>{let t=e.target.files;t&&t.length>0&&D(t)},disabled:p}),l.createElement(Upload,null),l.createElement(s.T,{size:"p3",fw:500},_||T("common.btn.uploadPhoto"))),U.length>0&&l.createElement(K,null,L.map((e,t)=>l.createElement(Y,{key:t},l.createElement("img",{src:e,alt:`Uploaded file ${t+1}`,className:"image-upload-preview-image"}),l.createElement("button",{onClick:e=>{e.stopPropagation(),removeFile(t)},className:"image-upload-remove-button"},l.createElement(x.C,null))))),M&&l.createElement("div",{className:"image-upload-input-error"},[...N,o].map(e=>l.createElement(s.T,{key:e,className:"error-text",size:"c1",color:c.r.colors.red600},e))))}),q=(0,d.Z)(S.l)` & .mantine-Carousel-control { width: auto; } `,DragFreeCarousel=e=>{var{children:t,gapItem:o=8,slideSize:r="auto",withControls:a=!1,withIndicators:i=!1,dragFree:n=!0,align:s="start"}=e,d=(0,E._)(e,["children","gapItem","slideSize","withControls","withIndicators","dragFree","align"]);return l.createElement(q,Object.assign({slideSize:r,slideGap:o,withControls:a,withIndicators:i,dragFree:n,align:s,containScroll:"trimSnaps"},d),l.Children.map(t,(e,t)=>l.createElement(S.l.Slide,{key:t},e)))}},ywl2:function(e,t,o){o.d(t,{T:function(){return m},a:function(){return getUserIdFromCookie},b:function(){return getSubotCookieId},c:function(){return getUserInfoFromCookie},d:function(){return getWindowId},e:function(){return checkUntilFinished},f:function(){return checkMobile},g:function(){return getHelloSitesUrl},h:function(){return clickAndOpenInNewTab},i:function(){return formatUrlWithEncrypedGa},j:function(){return isFakeEmail},k:function(){return getHhgIdFromCookie},o:function(){return overrideParamsByQuery},s:function(){return ssoIntents}});var r=o("NteX"),a=o("mGnJ"),i=o("4B16"),n=o("JIJ2"),l=o("hHL7"),s=o("GOBr"),d=o("xrdX");let c=["form_submit_meta","selected_actions","current_selected","current_keys","current_polls"],p=["bot_id","node_id","action_id","action_value","current_score","gtm_id","ga_client_id","is_new","title_url","url","window_id",...c],overrideParamsByQuery=(e,t)=>{let o=Object.keys(t);return o.map(o=>{let r=t[o];if("source"===o){e.is_new="first_login"===r;return}if(p.includes(o)){if(c.includes(o)){try{e[o]=JSON.parse(r)}catch(e){}return}if("account_id"===o||"current_score"===o||"bot_id"===o){e[o]=parseInt(r);return}e[o]=r}}),e},ssoIntents=e=>[{id:(0,l.Z)(),label:JSON.stringify({title:"",description:""}),type:i.N.SSO_INTENT,url:""},{id:(0,l.Z)(),label:JSON.stringify({title:e({id:"subot.myHealth.title",defaultMessage:"My Health"}),description:e({id:"subot.myHealth.description",defaultMessage:"Personal identifiers (like your name) will always be removed to protect your privacy. "})}),type:i.N.SSO_INTENT,url:"/images/subot/my-health.svg"},{id:(0,l.Z)(),label:JSON.stringify({title:e({id:"subot.saveData.title",defaultMessage:"Save Data"}),description:e({id:"subot.saveData.description",defaultMessage:"Hellobacsi would like to learn from your data to provide better healthcare for you"})}),type:i.N.SSO_INTENT,url:"/images/subot/file-storage.svg"},{id:(0,l.Z)(),label:JSON.stringify({title:e({id:"subot.productYourIdentifiers.title",defaultMessage:"Protect your identifiers"}),description:e({id:"subot.productYourIdentifiers.description",defaultMessage:"Personal identifiers (like your name) will always be removed to protect your privacy. "})}),type:i.N.SSO_INTENT,url:"/images/subot/shield.svg"}];function checkUntilFinished(e){let t=e.condition,o=e.finished,r=e.timeout||3e3,a=new Date().getTime(),i=setInterval(()=>{let e=new Date().getTime();(e-a>r||t())&&(clearInterval(i),o())},300)}let getHhgIdFromCookie=e=>{let t=r.c.parse(e||""),o=t["hhg-id"];return o||n.Z.get("hhg-id")||""},getSubotCookieId=e=>{if(e)return n.Z.set("hhg-id",e),e;let t=getHhgIdFromCookie();if(t)return t;let o=(0,l.Z)();return n.Z.set("hhg-id",o),o},getUserIdFromCookie=e=>{let t=r.c.parse(e||""),o=t[a.B],i=o||n.Z.get(a.B)||"";try{let e=i.split(".")[1],t=e.replace(/-/g,"+").replace(/_/g,"/"),o=decodeURIComponent(atob(t).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(o).sub}catch(e){return""}},getUserInfoFromCookie=e=>{let t=r.c.parse(e||""),o=t[a.B],i=o||n.Z.get(a.B)||"";try{let e=i.split(".")[1],t=e.replace(/-/g,"+").replace(/_/g,"/"),o=decodeURIComponent(atob(t).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join("")),r=JSON.parse(o);return{email:r.email,id:r.sub}}catch(e){return{email:"",id:0}}},u=(0,l.Z)(),getWindowId=()=>u,getHelloSitesUrl=(e,t)=>{let o=!t&&"undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname);return o?"http://localhost":`https://${s.y?"":"discover."}${d.v[e]}`},checkMobile=e=>{let t=e||("undefined"==typeof navigator?"":navigator.userAgent);return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substring(0,4)))},clickAndOpenInNewTab=e=>{let t=document.createElement("a");t.href=e,t.target="_blank",t.click()},m=30,isFakeEmail=e=>(null==e?void 0:e.endsWith("@hhg.com"))||(null==e?void 0:e.endsWith("@facebook.com"));function formatUrlWithEncrypedGa(e="",t=""){if(!e.startsWith("https://")||!t)return"";let o=new URL(e),r=o.searchParams;return r.get("hhgclid")?(r.delete("hhgclid"),r.set("hhgclid",t),`${o.origin}${o.pathname}?${r.toString()}`):e}},GqLv:function(e,t,o){o.d(t,{M:function(){return Modal}});var r=o("z/kP"),a=o("q1tI"),i=o("h8tX"),n=o("UhdZ");let Modal=e=>{var{styles:t,classNames:o,transitionProps:l}=e,s=(0,r._)(e,["styles","classNames","transitionProps"]);let{classes:d}=(0,n.u)(void 0,{name:"Modal",styles:t,classNames:o});return a.createElement(i.u,Object.assign({centered:!0,classNames:d,transitionProps:Object.assign({transition:"fade"},l),trapFocus:!1},s))}},"/Zfq":function(e,t,o){o.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 r=o("z/kP"),a=o("q1tI"),i=o("odgB"),n=o("rPIz"),l=o("5kis"),s=o("ns0B"),d=o.n(s),c=o("PKxV"),p=o("owZr"),u=o("6JAH"),m=o("aZjv"),g=o("EJrp"),v=o("BsoI"),h=o("rBCA"),b=o("HMwR"),E=o("iBNF"),f=o("OQ3V"),y=o("IQVP"),w=o("3uEO"),_=o("jkNU"),x=o("TAnM"),I=o("s5u8"),S=o("YUHs"),T=o("lAS2"),C=o("vWP/"),k=o("VLUI"),N=o("h84G"),R=o("MZpI"),O=o("QaGV"),M=o("bpvy"),U=o("/CSP"),B=o("/kWL"),A=o("Zin3"),L=o("Pt5v"),D=o("xrdX"),P="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",$="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='3' height='13' fill='none'%3e%3ccircle cx='1.583' cy='6.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 6.417)'/%3e%3ccircle cx='1.583' cy='1.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 1.417)'/%3e%3ccircle cx='1.583' cy='11.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 11.417)'/%3e%3c/svg%3e",z="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M2 4h12'/%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M5.333 4V2.667a1.333 1.333 0 0 1 1.334-1.334h2.666a1.334 1.334 0 0 1 1.334 1.334V4m2 0v9.333a1.334 1.334 0 0 1-1.334 1.334H4.667a1.334 1.334 0 0 1-1.334-1.334V4zM6.667 7.333v4M9.333 7.333v4'/%3e%3c/svg%3e";let CardPostPopoverMore=({authorEmail:e,onDeletePost:t,shareUrl:o,post:i,className:n="",popoverClassName:s="",onEditPost:d})=>{let{data:{locale:h,userInfo:b,env:{isMarryBaby:E}}}=(0,a.useContext)(g.T),{t:f}=(0,l.u)(),[y,w]=(0,a.useState)(!1),[_,x]=(0,a.useState)(!1),[I,S]=(0,a.useState)(!1),{authActionWrapper:T}=(0,m.iV)(),C=e&&(null==b?void 0:b.email)&&e===String(null==b?void 0:b.email);return a.createElement("div",{className:n,onClick:e=>{e.preventDefault(),e.stopPropagation()}},I&&a.createElement(c.S,{url:o,text:null==i?void 0:i.title,onClose:()=>S(!1)}),_&&a.createElement(c.P,{thumbnail:p.C.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:f("popup.deletePost.title"),description:f("popup.deletePost.description"),acceptText:f("popup.deletePost.accept"),cancelText:f("popup.deletePost.cancel"),onAccept:()=>(0,r.a)(void 0,void 0,void 0,function*(){if((null==i?void 0:i.id)&&!y){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:()=>x(!1)}),a.createElement(v.b,{className:s,toggleButtonContent:a.createElement("img",{src:E?P:$,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:y},data:C?{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:f("actionPopover.edit"),onClick:d},{icon:z,label:f("actionPopover.delete"),onClick:()=>{T(()=>x(!0))}}]}:{isShowheader:!1,type:"list",list:[{icon:c.i,label:f("morePopover.report"),subTree:{title:f("morePopover.report.title"),description:f("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:f(e.label),subTree:{title:f("morePopover.reportSubmit.title"),description:f("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>a.createElement(c.b,{reason:e.reasonValue,reasonText:f(e.reason),postId:null==i?void 0:i.id,onClose:()=>t&&t(!1)})}}))}}]}}))},j=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:o="",popoverClassName:i=""})=>{let{data:{env:{isMarryBaby:n},locale:s},action:{pushNotifications:d}}=(0,a.useContext)(g.T),{t:p}=(0,l.u)(),[u,h]=(0,a.useState)(!1),{authActionWrapper:b}=(0,m.iV)();return a.createElement("div",{className:o,onClick:e=>{e.preventDefault(),e.stopPropagation()}},u&&a.createElement(c.P,{thumbnail:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cg stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' clip-path='url(%23a)'%3e%3cpath d='M2 4.008h12m-8.667 0V2.675a1.333 1.333 0 0 1 1.334-1.333h2.666a1.333 1.333 0 0 1 1.334 1.333v1.333m2 0v9.334a1.333 1.333 0 0 1-1.334 1.333H4.667a1.333 1.333 0 0 1-1.334-1.333V4.008zm-6 3.334v4m2.666-4v4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='a'%3e%3cpath fill='white' d='M0 .008h16v16H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",isThumbnailIcon:!0,title:p("popup.deleteComment.title"),description:p("popup.deleteComment.description"),acceptText:p("popup.deletePost.accept"),cancelText:p("popup.deletePost.cancel"),onAccept:()=>(0,r.a)(void 0,void 0,void 0,function*(){var o;if(!t)return;let r=yield(0,c.j)({id:t,locale:s});(null==r?void 0:r.status)===1?(e&&e(),d({title:"",message:p("notification.success"),type:"success"})):d({title:"",message:(null===(o=null==r?void 0:r.messages)||void 0===o?void 0:o[0])||p("notification.failure"),type:"danger"})}),onClose:()=>h(!1)}),a.createElement(v.b,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:z,label:p("actionPopover.delete"),onClick:()=>{b(()=>{h(!0)})}}]},className:i,toggleButtonContent:a.createElement("img",{src:n?P:$,loading:"lazy"}),buttonProps:{}}))},F=h.Z.div` .add-link { color: ${E.r.colors.primaryBase}; } `,G=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; } `,Z=h.Z.div` display: flex; align-items: center; gap: 8px; `,V=h.Z.div` padding: 8px 16px; `,W=h.Z.div` margin-bottom: 12px; width: 100%; `,Y=h.Z.div``,K=h.Z.div` margin-bottom: 16px; `,X=h.Z.div` display: flex; flex-wrap: wrap; row-gap: 16px; ${b.M.tdUp} { align-items: center; column-gap: 24px; } `,q=h.Z.a` display: flex; align-items: center; gap: 16px; ${b.M.mbDown} { width: 100%; justify-content: space-between; } `,J=h.Z.div` display: flex; align-items: center; gap: 16px; `,Q=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,l.u)(),{data:{locale:o,env:{isMarryBaby:r}}}=(0,a.useContext)(g.T),i=(0,L.g)(o,r);return a.createElement(Y,null,a.createElement(K,null,a.createElement(n.H,{tag:"h6",as:"h5"},t("cardReply.recommentCategories.heading"))),a.createElement(X,null,e.map(e=>a.createElement(q,{href:i+e.permalink,key:String(e.termId),target:"_blank"},a.createElement(J,null,a.createElement(Q,null,a.createElement("img",{src:e.featureImage||p.C.getAssetPath(r?"mb-logo.svg":"/logo/logomark.png"),alt:e.displayName,loading:"lazy"})),a.createElement(B.T,{size:"s3",weight:"bold"},e.displayName)),a.createElement(k.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:o,href:r})=>{let{t:i}=(0,l.u)(),n=(()=>{let{expert:e,editor:o,is_author:r}=t;if(e){let t={name:e.display_name,role:"expert",avatar:e.avatar};return r?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(o)return{title:i("articleAuthor.title.fact-check"),name:o.display_name,avatar:o.avatar}})();return a.createElement(ee,{href:r,title:e,target:"_blank"},a.createElement(B.T,{size:"s3",as:"h5",weight:"bold"},e),a.createElement("div",null,a.createElement(_.C,{avatar:null==n?void 0:n.avatar,avatarProps:{size:32},name:null==n?void 0:n.name,role:null==n?void 0:n.role,hideBackground:!0},a.createElement(_.C.SubTextRow,null,a.createElement(_.C.SubText,null,null==n?void 0:n.title," ",a.createElement("span",{style:{color:E.r.colors.gray800}},null==n?void 0:n.name)),a.createElement(_.C.SubDivider,null),a.createElement(_.C.SubText,null,o)))))};var et={header:"F4mmgSy",chevron:"A7QrQ7A"};let SourceList=e=>{var{listUrl:t,hideSourceList:o,categorySlug:s,editMode:d,collapseSource:c,onListChange:u,isMarryBaby:m}=e,v=(0,r._)(e,["listUrl","hideSourceList","categorySlug","editMode","collapseSource","onListChange","isMarryBaby"]);let{t:h}=(0,l.u)(),[b,w]=(0,a.useState)(t||[]),[_,x]=(0,a.useState)([]),[I,S]=(0,a.useState)([]),[T,k]=(0,a.useState)(!1);(0,a.useEffect)(()=>{o||(0,r.a)(void 0,void 0,void 0,function*(){k(!0);let e=b.map(e=>{let t=new URL(e),o=String(t.pathname).split("/").filter(e=>""!=e),r=t.origin,a=-1!==r.search("marrybaby.vn");return{isMarrySite:a,path:o[o.length-1],href:e}}),t=[...e.map(e=>(0,g.c)(e.isMarrySite?(0,g.s)(y.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0):(0,g.g)(y.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0),"GET"))],o=yield Promise.all(t);x(o.map((t,o)=>{var r,a;return(null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.post)&&Object.assign(Object.assign({},(0,f.b)(null===(a=null==t?void 0:t.data)||void 0===a?void 0:a.post)),{href:e[o].href})}).filter(Boolean)),k(!1)})},[]),(0,a.useEffect)(()=>{!o&&(null==_?void 0:_.length)===0&&s&&(0,r.a)(void 0,void 0,void 0,function*(){var e;let t=yield(0,g.c)(m?(0,g.s)(y.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0):(0,g.g)(y.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0),"GET");(null==t?void 0:t.data)&&S([(0,f.h)(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.category)])})},[_]);let handleRemoveItem=e=>{w(t=>{let o=[...t];return o.splice(e,1),o}),x(t=>{let o=[...t];return o.splice(e,1),o})};return(0,a.useEffect)(()=>{null==u||u(b)},[b]),a.createElement("div",Object.assign({},v),!d&&a.createElement(G,null,a.createElement("img",{className:"icon",src:p.C.getAssetPath("warning.svg"),alt:"warning",style:{marginBottom:"3px",width:"18px"},loading:"lazy"}),a.createElement(B.T,{size:"s3",as:"span",dangerouslySetInnerHTML:{__html:h("cardReply.disclaimer")}})),o?null:T?a.createElement(A.L,null):_.length>0||d?a.createElement(F,null,a.createElement(M.U,{defaultValue:!c&&"accordion",styles:{control:{borderRadius:"inherit",'&[aria-expanded="false"]':{borderBottom:0}},chevron:{width:"32px",height:"32px"},content:{padding:0,borderBottom:0,borderTop:`1px solid ${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:a.createElement("div",{className:et.chevron},a.createElement(N.Z,{color:E.r.colors.gray600,size:20}))},a.createElement(M.U.Item,{value:"accordion"},a.createElement(M.U.Control,null,a.createElement("div",{className:et.header},a.createElement(n.H,{as:"h4",tag:"h6"},h("cardReply.source")))),a.createElement(M.U.Panel,null,a.createElement(V,null,(_||[]).map((e,t)=>a.createElement(Z,{key:String(t)},"object"==typeof e?a.createElement(SourceItem,Object.assign({},e)):a.createElement(W,null,a.createElement(U.I,{style:{width:"100%"},name:"source-list",value:e||"",size:"sm",onChange:e=>{w(o=>{let r=[...o];return r[t]=e,r}),x(o=>{let r=[...o];return r[t]=e,r})}})),d&&a.createElement(i.B,{size:"md",color:"transparent",icon:a.createElement(R.Z,null),onClick:()=>handleRemoveItem(t)}))),d&&a.createElement(i.B,{className:"add-link",color:"transparent",size:"md",icon:a.createElement(C.Z,{color:E.r.colors.primaryBase,size:18}),onClick:()=>{w(e=>[...e,""]),x(e=>[...e,""])}},"Add source")))))):a.createElement(RecommentCategories,{categories:I}))},eo=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; } } `,er=(0,h.Z)(SourceList)` margin-top: 12px; padding: 0.5rem 1rem 1rem; `,VerifiedTag=({userId:e,avatar:t,name:o,role:r,title:n,className:s})=>{let{t:d}=(0,l.u)(),[c,p]=(0,a.useState)(!1);return a.createElement(a.Fragment,null,a.createElement(i.B,{className:`-dzIuHr ${s}`,color:"success",size:"xs",onClick:()=>p(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},a.createElement("span",{className:"text"},a.createElement(O.Z,{isSolid:!0,size:18,color:E.r.colors.green800,className:"icon"}),d("cardReply.verifyBy",{name:`${o||""}`}))),a.createElement(_.c,{open:c,onClose:()=>p(!1),profileModalProps:{zIndex:1e3}},a.createElement(x.a,{authorProps:{userId:e,avatar:t,name:o,role:r,title:n},hideQuestionTab:!0})))},CardReply=({className:e,style:t,comment:o,type:n="comment",level:s=0,replyingId:d,onPostCommentSuccess:p,post:u,onDeleteComment:h,refetchComment:b,hasQuickBookingEnable:E,handleMakeAppointment:f,cardAuthorProps:S,maxChars:C=600,disableShortenContent:k})=>{var N,R,O,M,U,B,A,L,P,$,z,j,H;let{data:{locale:F,userInfo:G,env:{isMarryBaby:Z}}}=(0,a.useContext)(g.T),{t:V}=(0,l.u)(),[W,Y]=(0,a.useState)(o||null),{id:K,countLikes:X,content:q,replies:J=[],images:Q=[],author:ee,liked:et,link:ea,mentionedUser:ei,mentions:en}=W,{text:el,replyingTo:es}=(0,c.k)(q),{authActionWrapper:ed}=(0,m.iV)({_joinCommunityIds:[null===(N=null==u?void 0:u.community)||void 0===N?void 0:N.id],_joinTopicIds:null===(R=null==u?void 0:u.topics)||void 0===R?void 0:R.map(e=>e.id)}),[ec,ep]=(0,a.useState)(4),eu=null!=G&&!!G.id&&(null==J?void 0:J.some(e=>e.author.id===G.id)),addNewReply=e=>{Y(t=>{if(!t.replies.find(t=>t.id===e.id)){t.replies.unshift(e);let o=Object.assign(Object.assign({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return b&&b(o),o}return t})},[em,eg]=(0,a.useState)(!1),ev=(0,a.useMemo)(()=>"comment"===n&&J&&0!=J.length?J.sort((e,t)=>{let o=new Date(e.createdAt).getTime(),r=new Date(t.createdAt).getTime();return o>r?-1:o{var e,t;(null==ee?void 0:ee.hospitalId)&&(e=ee.hospitalId,(0,r.a)(void 0,void 0,void 0,function*(){var t;let o=yield(0,g.c)((0,g.b)(y.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:D.v[F]}),"get");(null===(t=null==o?void 0:o._data)||void 0===t?void 0:t.branch)&&eI(null==o?void 0:o._data.branch)})),(null==ee?void 0:ee.doctorId)&&(t=ee.doctorId,(0,r.a)(void 0,void 0,void 0,function*(){var e;let o=yield(0,g.c)((0,g.b)(y.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:D.v[F]}),"get");(null===(e=null==o?void 0:o._data)||void 0===e?void 0:e.doctor)&&eT(null==o?void 0:o._data.doctor)}))},[ee.hospitalId,ee.doctorId]);let eC=(null==eS?void 0:eS.valid_outpatient)||(null==eS?void 0:eS.valid_telemedicine),ek=((null==ex?void 0:ex.total_available_service)||(null==ex?void 0:ex.total_available_doctor))>0,eN=E&&(eC||ek),eR=(null===(M=null==W?void 0:W.author)||void 0===M?void 0:M.type)==="chatbot";return a.createElement(m.I_,{defaultParams:{_joinCommunityIds:[null===(U=null==u?void 0:u.community)||void 0===U?void 0:U.id],_joinTopicIds:null===(B=null==u?void 0:u.topics)||void 0===B?void 0:B.map(e=>e.id)}},a.createElement(eo,{className:e,style:t,"data-is-reply":!!s,"data-is-marrybaby":Z,"data-has-booking":eN},"reply"===n&&a.createElement(T.D,{className:"top-divider",type:"solid"}),a.createElement("div",{style:{padding:"16px 16px 0"}},a.createElement(_.C,Object.assign({avatar:ey,name:eE,username:ef,timeText:null==u?void 0:u.createdTime,community:null==u?void 0:u.community,className:`post-author ${eb?"with-popover":""}`,type:n,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:eN,handleMakeAppointment:f,isAnonymous:(null==W?void 0:W.isAnonymous)||!!(null==u?void 0:u.isAnonymous)&&(null===(A=null==u?void 0:u.author)||void 0===A?void 0:A.username)===(null==ee?void 0:ee.username),hideBackground:eR,userType:null==ee?void 0:ee.type},S)),!!(null==W?void 0:W.isVerify)&&!(null==W?void 0:W.isOppose)&&a.createElement(VerifiedTag,{title:null===(L=null==W?void 0:W.userVerify)||void 0===L?void 0:L.title,name:null===(P=null==W?void 0:W.userVerify)||void 0===P?void 0:P.name,userId:null===($=null==W?void 0:W.userVerify)||void 0===$?void 0:$.id,role:null===(z=null==W?void 0:W.userVerify)||void 0===z?void 0:z.role,avatar:null===(j=null==W?void 0:W.userVerify)||void 0===j?void 0:j.avatar,className:"verify-tag"})),a.createElement(x.P,{className:"post-content-wrapper",replyingTo:es,mentionedUser:ei,description:el,mentions:e_,maxChars:C,disableShortenContent:k}),a.createElement("span",null),a.createElement("span",null),Q&&Q.length>0?a.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},a.createElement(I.a,{images:Q,authorName:null==ee?void 0:ee.username})):null,(!Q||0===Q.length)&&ea?a.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},a.createElement(w.C,{url:ea})):null,"most-engaging"!==n?a.createElement(a.Fragment,null,eR&&a.createElement(er,{listUrl:null==W?void 0:W.source,categorySlug:null==W?void 0:W.categorySlug}),a.createElement(v.C,{type:v.c.reply,loveCount:X,replyCount:eh,className:"post-reaction",liked:et,isReplied:eu,hideCommentIcon:"reply"===n||eR,hasShare:!1,onCommentClick:()=>ed(()=>eg(e=>!e)),onCommentCountClick:()=>ed(()=>{eg(!0)}),onLikeClick:()=>ed(()=>(0,r.a)(void 0,void 0,void 0,function*(){if(K){let e=yield(0,c.l)({commentId:K,setLike:!et,locale:F});1===e.status&&Y(e=>Object.assign(Object.assign({},e),{liked:!et,countLikes:e.countLikes+(et?-1:1)}))}}))}),em&&a.createElement(c.I,{replyingId:d||W.id,replyToName:eE,isReply:!0,onClose:()=>eg(!1),onPostSuccess:e=>{"reply"===n?p&&p(e):addNewReply(e)},post:u,replyingUser:ee}),"comment"===n&&J&&J.length>0?a.createElement("div",{className:"comment-reply-wrapper"},null===(H=null==ev?void 0:ev.slice(0,ec))||void 0===H?void 0:H.map(e=>a.createElement(CardReply,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:s+1,replyingId:K,onPostCommentSuccess:addNewReply,post:u,onDeleteComment:()=>{Y(t=>Object.assign(Object.assign({},t),{replies:t.replies.filter(t=>t.id!==e.id),countReplies:t.countReplies-1}))},handleMakeAppointment:f,hasQuickBookingEnable:E})),eh>ec&&a.createElement(a.Fragment,null,a.createElement(T.D,{className:"top-divider",type:"solid"}),a.createElement(i.B,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>ep(e=>e+4)},V("comment.seeMoreReplies",{count:eh-ec}),a.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&&a.createElement(CardReplyPopover,{onDeleteComment:h,className:"popover",commentId:W.id})))},getMostEngagingComment=(e,t)=>(0,r.a)(void 0,void 0,void 0,function*(){var o,r,a;let i=yield(0,g.t)((0,g.f)(y.yy.COMMENT.LIST,{postId:e,_locale:t,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(a=null===(r=null===(o=null==i?void 0:i.data)||void 0===o?void 0:o.comments)||void 0===r?void 0:r.map(f.g))||void 0===a?void 0:a[0]}),CardPost=({className:e,style:t,hideViewMoreComment:o,showMostEngaging:s,onCommentClick:p,onCommentCountClick:h,onMostEngagingCommentClick:b,onPostCommentSuccess:E,disableCardLink:f,disableShortenContent:T,onDeletePost:C,onEditPost:k,post:N,mostEngagingComment:R,onDeleteComment:O,showInputComment:M,InlineCommentsComponent:U,hasQuickBookingEnable:B,handleMakeAppointment:A,onSaveUnsaveSuccess:L,cardAuthorProps:D,verticalReactions:P=!1})=>{let[$,z]=(0,a.useState)(N),[F,G]=(0,a.useState)(!1),[Z,V]=(0,a.useState)(R),{community:W,topics:Y,author:K,slug:X,isPin:q,liked:J,photos:Q,mentions:ee,title:et,description:eo,previewUrl:er,likesCount:ea,commentsCount:ei,id:en,commented:el}=$,{data:{locale:es,togetherUserId:ed,userInfo:ec,env:{isMarryBaby:ep,togetherBasePath:eu}},action:{pushNotifications:em}}=(0,a.useContext)(g.T),eg=!!(null==ec?void 0:ec.id),{t:ev}=(0,l.u)(),[eh,eb]=(0,a.useState)(M),eE=`${eu}/${(null==W?void 0:W.slug)||"_"}/${X||""}`,ef=`${(0,g.l)(es)}${eE}`,{authActionWrapper:ey}=(0,m.iV)((null==W?void 0:W.slug)?{_joinCommunityIds:[W.id],_joinTopicIds:null==Y?void 0:Y.map(e=>e.id)}:void 0),[ew,e_]=(0,a.useState)(!1);(0,a.useEffect)(()=>{eb(M)},[M]);let ex=(null==K?void 0:K.name)||(null==K?void 0:K.username)||"",eI=(null==K?void 0:K.username)||(null==K?void 0:K.name)||"",eS=null==K?void 0:K.avatar,eT=(null==$?void 0:$.isAnonymous)?void 0:null==K?void 0:K.role,[eC,ek]=(0,a.useState)(null),[eN,eR]=(0,a.useState)(null);(0,a.useEffect)(()=>{var e,t;(null==K?void 0:K.hospitalId)&&(e=K.hospitalId,(0,r.a)(void 0,void 0,void 0,function*(){var t;let o=yield(0,g.c)((0,g.b)(y.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:g.m[es]}),"get");(null===(t=null==o?void 0:o._data)||void 0===t?void 0:t.branch)&&ek(null==o?void 0:o._data.branch)})),(null==K?void 0:K.doctorId)&&(t=K.doctorId,(0,r.a)(void 0,void 0,void 0,function*(){var e;let o=yield(0,g.c)((0,g.b)(y.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:g.m[es]}),"get");(null===(e=null==o?void 0:o._data)||void 0===e?void 0:e.doctor)&&eR(null==o?void 0:o._data.doctor)}))},[K.hospitalId,K.doctorId]);let eO=(null==eN?void 0:eN.valid_outpatient)||(null==eN?void 0:eN.valid_telemedicine),eM=((null==eC?void 0:eC.total_available_service)||(null==eC?void 0:eC.total_available_doctor))>0;(0,a.useEffect)(()=>{(0,r.a)(void 0,void 0,void 0,function*(){if(en&&ei&&s&&!(null==R?void 0:R.id)){let e=yield getMostEngagingComment(en,es);V(e)}})},[en,es,ei,s,null==R?void 0:R.id]),(0,a.useEffect)(()=>{V(R)},[null==R?void 0:R.id]);let onDeleteComment=e=>(0,r.a)(void 0,void 0,void 0,function*(){if(ei>1&&(null==Z?void 0:Z.id)&&(null==Z?void 0:Z.id)===(null==e?void 0:e.id)){let e=yield getMostEngagingComment(en,es);V(e)}z(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1})),O&&O(e)});return a.createElement(m.I_,{defaultParams:(null==W?void 0:W.slug)?{_joinCommunityIds:[W.id],_joinTopicIds:null==Y?void 0:Y.map(e=>e.id)}:void 0},F&&a.createElement(c.S,{url:ef,avatar:u.a,text:et,onClose:()=>G(!1)}),a.createElement(j,{className:e,style:t,"data-is-marrybaby":ep},q?a.createElement(v.a,{className:"post-pin"}):null,a.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},a.createElement(_.C,Object.assign({avatar:eS,name:ex,username:eI,url:f?void 0:eE,community:W,timeText:null==$?void 0:$.createdTime,className:"post-author",role:eT,userId:null==K?void 0:K.id,expertId:null==K?void 0:K.partnerId,doctorId:null==K?void 0:K.doctorId,hospitalId:null==K?void 0:K.hospitalId,title:null==K?void 0:K.title,hasQuickBooking:B&&(eO||eM),handleMakeAppointment:A,"data-testid":"name",isAnonymous:!!(null==$?void 0:$.isAnonymous),extendEle:a.createElement(CardPostPopoverMore,{authorEmail:String(null==K?void 0:K.email),onDeletePost:C,shareUrl:ef,post:$,className:"popover",onEditPost:k})},D))),a.createElement("a",{href:f?void 0:eE,className:"post-content-link-wrapper"},et&&a.createElement(n.H,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},d()(et)),a.createElement(x.P,{className:"post-content-wrapper",description:eo,disableShortenContent:T,mentions:ee,"data-testid":"Content of the Post"})),a.createElement("span",null),a.createElement("span",null),a.createElement("div",{key:"tag-topic"},Y&&Y.length>0?a.createElement(v.T,{topics:Y,className:"post-topics"}):null),a.createElement("div",{key:"social-preview"},(null==$?void 0:$.introUrl)?a.createElement("div",{className:`social-preview-wrapper ${(null==Q?void 0:Q.length)?"has-image":""}`},a.createElement(S.S,{url:$.introUrl,image:$.bannerImage})):null),a.createElement("div",{key:"image-preview"},(null==Q?void 0:Q.length)?a.createElement("div",{className:"image-preview-wrapper"},a.createElement(I.a,{images:Q,authorName:null==K?void 0:K.name,isSensitive:!!(null==$?void 0:$.isSensitive)})):null),a.createElement("div",{key:"link-preview"},(null==$?void 0:$.introUrl)||(null==Q?void 0:Q.length)||null==er||!er.url?null:a.createElement("div",{className:"link-preview-wrapper"},a.createElement(w.C,{title:er.title,url:er.url,image:er.image}))),a.createElement(v.C,{isMarryBaby:ep,type:v.c.post,loveCount:ea,replyCount:ei,className:`post-reaction ${(null==Q?void 0:Q.length)||(null==er?void 0:er.url)?"hide-top-border":""}`,liked:ew?!J:J,isReplied:el,isSaved:(null==$?void 0:$.bookmarked)||!1,onCommentClick:()=>ey(()=>{p?p():eb(e=>!e)}),onCommentCountClick:()=>{ey(()=>{ep?eb(!0):h?h():f||(window.location.href=eE)})},onShareClick:()=>{G(!0)},onLikeClick:()=>(0,r.a)(void 0,void 0,void 0,function*(){ey(()=>(0,r.a)(void 0,void 0,void 0,function*(){if(en&&!ew){e_(!0);try{let e=yield(0,c.m)({id:en,locale:es});(null==e?void 0:e.status)!==1?em((0,c.g)(ev)):z(e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked}))}catch(e){em((0,c.g)(ev))}e_(!1)}}))}),onSaveClick:()=>{ey(()=>(0,r.a)(void 0,void 0,void 0,function*(){if((null==ec?void 0:ec.id)&&(null==$?void 0:$.id)){if(null==$?void 0:$.bookmarked){let e=yield(0,g.e)((0,g.f)(y.yy.BOOKMARK.DELETE,{_locale:es}),"DELETE",{headers:{"Content-Type":"application/json"},data:{post_id:String($.id)}});(null==e?void 0:e.status)===1?(em({title:"",message:ev("post.remove.success"),type:"success",displayIcon:H}),null==L||L()):em({title:"",message:ev("post.remove.failed"),type:"danger",displayIcon:H})}else{let e=yield(0,g.e)((0,g.f)(y.yy.BOOKMARK.CREATE,{_locale:es}),"POST",{headers:{"Content-Type":"application/json"},data:{user_id:ed||ec.id,post_id:$.id}});(null==e?void 0:e.status)===1?(em({title:"",message:ev("post.save.success"),type:"success",displayIcon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23595959'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 13.333 8 10.37l-4 2.963V3.852c0-.314.12-.616.335-.838.214-.222.505-.347.808-.347h5.714c.303 0 .594.125.808.347s.335.524.335.838z'/%3e%3c/svg%3e"}),null==L||L()):em({title:"",message:ev("post.save.failed"),type:"danger",displayIcon:H})}}}))},onGoToUrl:e=>{let t=e?`${ef}${e}`:ef;eg?window.location.href=t:ey(()=>window.location.href=t)},showingMostEngaging:!!(s&&(null==Z?void 0:Z.id)),isVertical:P}),eh&&a.createElement(c.I,{isMainCmt:!M,onClose:()=>eb(!1),onPostSuccess:e=>{0!==ei||(null==Z?void 0:Z.id)||V(e),z(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0})),E&&E(e)},post:$}),s&&(null==Z?void 0:Z.id)?a.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{b?(e.stopPropagation(),b()):window.location.href=eE}},a.createElement(CardReply,{hasQuickBookingEnable:B,handleMakeAppointment:A,comment:Z,post:$,onDeleteComment:()=>{onDeleteComment&&onDeleteComment(Z)},className:"most-engaging-comment",type:"most-engaging",key:Z.id,cardAuthorProps:D}),ei>1&&!o&&a.createElement(i.B,{className:"see-more-comments",color:"ghost",size:"md"},ev("comment.seeMoreComments",{count:ei-1}))):null,U))}}}]);