"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[137],{Bzx3:function(e,t,r){r.d(t,{A:function(){return AddressInput}});var a=r("fbRC"),l=r("q1tI"),o=r("OAL+"),n=r("aDCK"),i=r("6HDN"),s=r("v7JE"),c=r("thIk"),d=r("4h+C"),u=r("/hDE"),p=r("yNk5");let generateGetAddressDetail=e=>`${s.g}/cities-data-${d.M[e]}.json`,h={provinceByName:{},provinces:[],districts:[],wards:[],selectedProvince:"",selectedDistrict:"",selectedWard:""},reducer=(e,t)=>{switch(t.type){case"SET_DATA":return Object.assign(Object.assign({},e),t.payload);case"SET_DISTRICTS":return Object.assign(Object.assign({},e),{districts:t.payload});case"SET_WARDS":return Object.assign(Object.assign({},e),{wards:t.payload});case"SELECT_PROVINCE":return Object.assign(Object.assign({},e),{selectedProvince:t.payload,selectedDistrict:"",selectedWard:""});case"SELECT_DISTRICT":return Object.assign(Object.assign({},e),{selectedDistrict:t.payload,selectedWard:""});case"SELECT_WARD":return Object.assign(Object.assign({},e),{selectedWard:t.payload});default:return e}},mappingProvinceId=(e,t)=>{let r={};for(let[,e]of Object.entries(t)){let{id:t}=e;t&&(r[t]=e)}let a={};return e.map(e=>{a[e.name]=r[e.id]}),a},useAddress=({provinces:e})=>{let[t,r]=(0,l.useReducer)(reducer,h),{provinceByName:o,provinces:n,districts:i,wards:s,selectedProvince:c,selectedDistrict:d,selectedWard:m}=t,[g,b]=(0,l.useState)();return(0,l.useEffect)(()=>{(0,a.a)(void 0,void 0,void 0,function*(){var t,a,l;try{let o=yield fetch(generateGetAddressDetail(p.env.UNIFY_LOCALE||u.L.Vietnam)).then(e=>e.json());b(o);let{list:n}=o,i=e?mappingProvinceId(e,n):n,s=Object.keys(i),c=Object.keys((null===(t=n[s[0]])||void 0===t?void 0:t.list)||{}),d=Object.keys((null===(l=null===(a=n[s[0]])||void 0===a?void 0:a[c[0]])||void 0===l?void 0:l.list)||{});r({type:"SET_DATA",payload:{provinceByName:i,provinces:s,districts:c,wards:d}})}catch(e){console.error("Error fetching address data:",e)}})},[p.env.UNIFY_LOCALE]),{provinces:n,districts:i,wards:s,selectedProvince:c,selectedDistrict:d,selectedWard:m,handleProvinceChange:e=>{var t;let a=Object.keys((null===(t=o[e])||void 0===t?void 0:t.list)||{});r({type:"SET_DISTRICTS",payload:a}),r({type:"SET_WARDS",payload:[]}),r({type:"SELECT_PROVINCE",payload:e})},handleDistrictChange:e=>{var t,a;let l=Object.keys((null===(a=null===(t=o[c])||void 0===t?void 0:t.list[e])||void 0===a?void 0:a.list)||{});r({type:"SET_WARDS",payload:l}),r({type:"SELECT_DISTRICT",payload:e})},handleWardChange:e=>{r({type:"SELECT_WARD",payload:e})}}},AddressInput=e=>{var{error:t,provinces:r,placeholder:s}=e,d=(0,a._)(e,["error","provinces","placeholder"]);let{t:u}=(0,c.u)(),{provinces:p,districts:h,wards:m,selectedProvince:g,selectedDistrict:b,selectedWard:v,handleProvinceChange:f,handleDistrictChange:y,handleWardChange:x}=useAddress({provinces:r}),[w,E]=(0,l.useState)("");return(0,l.useEffect)(()=>{g&&b&&v&&w?d.onChange({selectedProvince:g,selectedDistrict:b,selectedWard:v,extraInfo:w}):d.onChange(null)},[g,b,v,w]),l.createElement(i.I.Wrapper,Object.assign({withAsterisk:!0},d),l.createElement(o.K,null,l.createElement(i.S,{placeholder:(null==s?void 0:s.province)||u("onboarding.similac.input.city"),data:r?p:p.sort(),searchable:!0,onChange:f,value:g}),l.createElement(i.S,{placeholder:(null==s?void 0:s.district)||u("onboarding.similac.input.district"),data:h.sort(),searchable:!0,onChange:y,value:b,disabled:!g}),l.createElement(i.S,{placeholder:(null==s?void 0:s.ward)||u("onboarding.similac.input.ward"),searchable:!0,data:m.sort(),value:v,onChange:x,disabled:!g||!b}),l.createElement(i.I,{placeholder:(null==s?void 0:s.address)||u("onboarding.similac.input.no"),disabled:!g||!b||!v,value:w,onChange:E,style:{marginBottom:0}})),l.createElement(n.I.Error,{size:"md"},t))}},aGFS:function(e,t,r){r.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 G},e:function(){return J},f:function(){return o},g:function(){return n}});var a,l,o,n,i=r("q1tI"),s=r("F/Hd"),c=r("rBCA"),d=r("iBNF"),u=r("oKqh"),p=r("4JiQ"),h=r("mYVa"),m=r("iuhU"),g=r("Iblh"),b=r("I9kg"),v=r("6HDN"),f=r("fbRC"),y=r("izct"),x=r("gEnE"),w=r("yVya"),E=r("iHoF"),C=r("Hi7e"),k=r("thIk"),I=r("Zdfy");let Upload=e=>i.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 18 18",fill:"none"},e),i.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:r,type:a,contentIcon:l,closeIcon:o,className:n,description:c})=>i.createElement("div",{className:`CHw-fZZ ${n||""}`,style:e,"data-alert-type":a},i.createElement("div",{className:"_03U6VRS"},i.createElement("div",{className:"icon-title"},l,i.createElement(s.T,{weight:"bold",size:"label1"},r)),i.createElement(s.T,{weight:"regular",size:"p3"},c)),i.createElement("div",{className:"EO828Vv",onClick:t},o)),renderNotificationStyles=(e,t,r,a)=>{let l,o="";if("numeric"===e)switch(t){case"medium":o=` height: 16px; font-size: 11px; padding: 1px 6px; `;case"large":o=` height: 24px; font-size: 13px; padding: 1px 10px; `}let n="";r&&(n=` position: absolute; top: 0; left: 75%; `),r&&(l=` left: 70%; ${"large"===t?` top: -7px; `:"medium"===t?` top: -2px; width: 16px; height: 16px; `:""} `);let i="";switch(a){case"primary":i=` background: ${d.r.colors.primary50}; color: ${d.r.colors.primary600}; `;break;case"error":i=` background: ${d.r.colors.error}; color: white; `}switch(e){case"dot":return` ${n} width: 8px; height: 8px; font-size: 0px; border-radius: 50%; ${i} `;case"numeric":return` ${n} width: max-content; border-radius: 32px; ${o} ${l} ${i} `}},$=c.Z.div` position: relative; > div { width: max-content; position: relative; } span { font-weight: ${d.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:r="medium",color:a="primary",icon:l,className:o})=>i.createElement($,{"data-notification-type":t,"data-notification-size":r,"data-notification-color":a,"data-has-icon":!!l||void 0,notificationType:t,notificationSize:r,notificationColor:a,hasIcon:!!l,className:o},i.createElement("div",null,e&&i.createElement("span",null,e)," ",l&&i.createElement("div",null,l))),D=c.Z.h4` position: relative; line-height: 18px; &:after { position: absolute; top: 1px; left: 0; width: 4px; height: 18px; background-color: ${d.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: ${d.r.sizes.fwBold}; } &[data-type='semiBold'] { font-weight: ${d.r.sizes.fwSemiBold}; } &[data-uppercase] { text-transform: uppercase; } ${u.M.mbDown} { &[data-size='lg'] { font-size: 16px; } } `,BorderHeading=({style:e,children:t,className:r,size:a="lg",type:l="bold",upperCase:o,as:n="h4",color:s})=>i.createElement(D,{style:Object.assign({color:s},e),className:r,"data-size":a,"data-type":l,"data-uppercase":o,as:n},t),S=(0,c.Z)(b.S)` flex-shrink: 0; color: ${d.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=c.Z.div` background-color: white; .icon { width: 20px; height: 20px; flex-shrink: 0; color: ${d.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:r,defaultOpened:a=!0,haveCollapse:l=!0,id:o,className:n,as:c="h2"}){let[d,{toggle:u}]=(0,g.q)(a);return i.createElement(N,{id:o,className:n},i.createElement("div",{className:"box-collapse",onClick:()=>{l&&u()}},l&&r,i.createElement(s.T,{as:c,className:"title-collapse"},t),l&&i.createElement(S,{"data-is-collapsed":d})),i.createElement(p.U,{in:!l||d,transitionDuration:200,transitionTimingFunction:"ease"},e))}let P=c.Z.div` position: relative; box-sizing: border-box; border: 1px solid ${d.r.colors.gray200}; background: url('../../../public/bgSvg/arrow-down.svg') no-repeat; background-position: right 16px center; border-radius: ${d.r.borderRadius}; &[data-has-icons='true'] { border: none; background: ${d.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 ${d.r.colors.primary200}; } `,F=c.Z.div` padding: 12px 18px 12px 16px; cursor: pointer; &[data-dropdown-open] { padding: 11px 15px 11px 15px; border: 1px solid ${d.r.colors.primaryBase}; border-radius: ${d.r.borderRadius}; box-shadow: 0 0 2px 2px ${d.r.colors.primary200}; } & > svg { height: 16px; width: 16px; } `,O=c.Z.ul` position: absolute; top: 100%; right: 0; left: 0; display: block; margin-top: 4px; background: ${d.r.colors.white}; border-radius: ${d.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 ${d.r.colors.gray200}; filter: drop-shadow(0px 10px 16px rgba(0, 0, 0, 0.04)); } `,B=c.Z.li` margin: 8px; padding: 12px 18px 12px 16px; border-radius: ${d.r.borderRadius}; display: flex; &:hover, :active { background: ${d.r.colors.gray100}; } `,H=c.Z.div` display: flex; align-items: center; margin-right: 8px; & > svg { height: 16px; width: 16px; } `,ShareIconPathStyle=()=>i.createElement("style",null,".file-dropdown-path{fill:none;stroke:#595959;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5px}"),DefaultFileIcon=()=>i.createElement("svg",{id:"prefix__Layer_1","data-name":"Layer 1",viewBox:"0 0 12.17 14.83"},i.createElement("defs",null,i.createElement("clipPath",{id:"prefix__clip-path",transform:"translate(-1.92 -1.54)"},i.createElement("path",{fill:"none",d:"M0 .96h16v16H0z"}))),i.createElement("title",null,"File"),i.createElement("g",{clipPath:"url(#prefix__clip-path)"},i.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)"}),i.createElement("path",{className:"file-dropdown-path",d:"M8.67 2.29V7h4.66",transform:"translate(-1.92 -1.54)"}))),DownloadIcon=()=>i.createElement("svg",{id:"prefix__Layer_1","data-name":"Layer 1",viewBox:"0 0 13.5 13.5"},i.createElement("title",null,"download"),i.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=()=>i.createElement("svg",{id:"prefix__Layer_1","data-name":"Layer 1",viewBox:"0 0 13.5 13.5"},i.createElement("title",null,"upload"),i.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:r,onUploadSelected:a,id:l,placeholderIcon:o,placeholder:n,style:s})=>{let[c,d]=(0,i.useState)(!1),showDropdown=()=>d(!c),u=(0,i.useRef)(r.map(e=>"upload"===e.type&&i.createElement("input",{id:"uploader-dropdown-input-"+l+"-"+e.value,key:"uploader-dropdown-input-"+l+"-"+e.value,accept:e.fileAcceptedType,multiple:e.multiple,type:"file",style:{display:"none"},onChange:e=>{console.log("change"),a(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 i.createElement(P,{className:e,"data-dropdown-open":!!c,id:l,"data-has-icons":!0,style:s,onBlur:()=>d(!1),tabIndex:0},i.createElement(ShareIconPathStyle,null),i.createElement(F,{onClick:showDropdown},o||i.createElement(DefaultFileIcon,null)," ",i.createElement("span",null,t&&t.value?t.label:n)),c&&i.createElement(O,{onClick:showDropdown,"data-has-icons":!0},r.map(e=>i.createElement(B,{key:`${l}-${e.value}`,"data-selected":t&&t.value===e.value||void 0,onClick:()=>"upload"===e.type?onUpload("#uploader-dropdown-input-"+l+"-"+e.value):onDownload(e.url)},i.createElement(H,null,e.icon||"download"===e.type?i.createElement(DownloadIcon,null):i.createElement(UploadIcon,null)),e.label))),i.createElement(i.Fragment,null,u.current))},j=c.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); ${u.M.tdUp} { grid-template-columns: var(--columns-desktop); } > * { justify-self: var(--justify-children); } `,Grid=({className:e,columns:t,columnsDesktop:r,gridTemplateColumns:a,gridTemplateColumnsDesktop:l,gap:o,children:n,justifyChildren:s,style:c,alignItems:d})=>i.createElement(j,{className:e,style:Object.assign({"--columns-count":t,"--columns-count-desktop":r,"--grid-template-columns":a,"--grid-template-columns-desktop":l,"--justify-children":s,"--grid-gap":o,"--align-items":d},c)},n),Radio=({size:e="small",label:t,name:r,checked:a,value:l,className:o,isDisabled:n=!1,onChange:s,dataEventCategory:c,dataEventAction:d,dataEventLabel:u})=>{let p=!!d&&!!c&&!!u,h=p?{"data-event-category":c,"data-event-action":d,"data-event-label":u}:{};return i.createElement(v.R,Object.assign({size:"small"===e?"md":"lg",label:t,name:r,checked:a,value:l,className:o,disabled:n,onChange:e=>null==s?void 0:s(e.target.value)},h))},M=c.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=>i.createElement("svg",Object.assign({},e,{viewBox:"0 0 24 24",fill:"none"}),i.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"}),i.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,r=(0,f._)(e,["isFull"]);return i.createElement("svg",Object.assign({},r,{viewBox:"0 0 32 32",fill:"none"}),i.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:r,totalStars:a=5,onSelect:l,hideEmptyStars:o,style:n,className:s})=>{let c=Math.floor(r),d=r-c>=.5?1:0,[u,p]=(0,i.useState)(null),h=u||c,m=u?0:d;return i.createElement(M,{"data-selectable":!!l,style:Object.assign({"--gap":e,"--star-size":t},n),className:s},Array.from({length:o?c+d:a}).map((e,t)=>{let onMouseOver=()=>!!l&&p(t+1),onMouseLeave=()=>!!l&&p(null);return t+1<=h?i.createElement(StarIcon,{key:t,onClick:()=>null==l?void 0:l(t+1),onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,isFull:!0}):t+1===h+m?i.createElement(StarHalfIcon,{key:t,onClick:()=>null==l?void 0:l(t+1),onMouseOver:onMouseOver,onMouseLeave:onMouseLeave}):i.createElement(StarIcon,{key:t,onClick:()=>null==l?void 0:l(t+1),onMouseOver:onMouseOver,onMouseLeave:onMouseLeave})}))},getTag=(e,t)=>{switch(e){case"yellow":{let e=t?d.r.colors.yellow50:d.r.colors.yellow600;return` background: ${e}; p { color: var( --text-props-color, ${d.r.colors.gray800} ); } `}case"standard":return` background: ${d.r.colors.white}; border: 1px solid ${d.r.colors.gray200}; p { color: var( --text-props-color, ${d.r.colors.gray800} ); } &:hover { background: ${d.r.colors.gray100}; } `;case"red":{let e=t?d.r.colors.red50:d.r.colors.red500;return` background: ${e}; `}case"green":{let e=t?d.r.colors.green50:d.r.colors.green500;return` background: ${e}; `}case"blue":{let e=t?d.r.colors.primary50:d.r.colors.primaryBase;return` background: ${e}; `}case"teal":{let e=t?d.r.colors.teal100:d.r.colors.teal600;return` background: ${e}; `}case"pink":{let e=t?d.r.colors.pink200:d.r.colors.pink800;return` background: ${e}; `}case"violet":{let e=t?d.r.colors.violet100:d.r.colors.violet500;return` background: ${e}; `}case"grey":{let e=t?d.r.colors.gray100:d.r.colors.gray600;return` background: ${e}; `}}},z=c.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 ${d.r.colors.accentLight}; padding: 0; margin-left: calc(var(--offset-size) * -1); p { font-weight: ${d.r.sizes.fwBold}; color: var( --text-props-color, ${d.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: ${d.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, ${d.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: ${d.r.colors.primary50}; } `,Tag=({type:e,children:t,style:r,isInline:a,isSquared:l=!1,className:o,isLight:n,hasMorePadding:s,isLink:c,isSelected:d,textProps:u={size:"sm"}})=>{let p=u.color?{"--text-props-color":u.color}:{};return i.createElement(z,{"data-is-squared":l||void 0,"data-tag-type":e,"data-is-light":n||void 0,"data-has-more-padding":s||void 0,"data-is-inline":a||void 0,style:Object.assign(Object.assign({},r),p),className:o,"data-is-selected":d||void 0,"data-is-link":c||void 0,tagType:e,isInline:a,tagHasMorePadding:s,tagIsLight:n,tagIsSquared:l,tagIsALink:c},i.createElement(y.T,Object.assign({},u),t))},L="24px",T=(0,x.Z)(c.Z.span` position: relative; display: block; width: 40px; height: ${L}; 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"),V=c.Z.span` padding-left: 15px; `,A=c.Z.div` height: ${L}; input[type='checkbox'] { width: 0; height: 0; visibility: hidden; } label { cursor: pointer; display: inline-flex; color: ${d.r.colors.gray600}; } input:checked + label ${T.classSelector} { background: ${d.r.colors.primaryBase}; &:after { left: calc(100% - 2px); transform: translateX(-100%); } } `,Toggle=({className:e,id:t,onChange:r,checked:a,style:l,label:o})=>i.createElement(A,{className:e,style:l},i.createElement("input",{type:"checkbox",id:t,onChange:r,checked:a}),i.createElement("label",{htmlFor:t},i.createElement(T,null),o&&i.createElement(V,null,o))),G=(0,i.createContext)({currentStep:0,setCurrentStep:()=>!1,setMaxStep:()=>!1,nextStep:()=>!1,prevStep:()=>!1}),StepRenderer=({children:e,onStepChange:t})=>{let[r,a]=(0,i.useState)(0),[l,o]=(0,i.useState)(0),n=i.Children.count(e);return(0,i.useEffect)(()=>{o(n-1)},[n]),(0,i.useEffect)(()=>{null==t||t(r)},[r]),i.createElement(G.Provider,{value:{currentStep:r,setCurrentStep:a,setMaxStep:o,nextStep:()=>r+1<=l&&a(r+1),prevStep:()=>r-1>=0&&a(r-1)}},(0,w.Z)(e).map((e,t)=>{let a=t===r;return i.createElement(i.Fragment,{key:t},i.isValidElement(e)?e.props.alwaysRender||a?i.cloneElement(e,{isActive:t===r,stepIndex:t}):null:a?e:null)}))},R=c.Z.div` display: flex; align-items: center; gap: 8px; `,_=(0,c.Z)(E.H)` font-weight: var(--fwBold); `,IconHeading=({icon:e,title:t,className:r,style:a})=>i.createElement(R,{className:r,style:a},e,i.createElement(_,{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 r=sanitizeHtml(e);return i.createElement("div",{className:t,dangerouslySetInnerHTML:{__html:r}})};(a=o||(o={})).ONE_TO_ONE="1:1",a.THREE_TO_ONE="3:1",(l=n||(n={})).PNG=".png",l.JPG=".jpg",l.JPEG=".jpeg";let getBase64=e=>new Promise((t,r)=>{let a=new FileReader;a.onload=()=>t(a.result),a.onerror=r,a.readAsDataURL(e)}),handleMultipleImageFiles=e=>(0,f.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=c.Z.div` display: flex; flex-direction: column; .image-upload-input-error { margin-top: ${(0,h.h)(12)}; display: flex; flex-direction: column; gap: ${(0,h.h)(4)}; } `,U=c.Z.div` display: flex; flex-direction: column; gap: ${(0,h.h)(4)}; margin-top: ${(0,h.h)(4)}; span { color: ${d.r.colors.neutral500}; } `,q=c.Z.div` position: relative; width: fit-content; padding: ${(0,h.h)(8)} ${(0,h.h)(12)}; border-radius: ${(0,h.h)(12)}; border: ${(0,h.h)(1)} solid ${d.r.colors.neutral200}; cursor: pointer; display: flex; align-items: center; gap: ${(0,h.h)(8)}; margin-top: ${(0,h.h)(18)}; &.image-upload-dragover { border-color: ${d.r.colors.primaryBase}; } &.image-upload-error { border-color: ${d.r.colors.error}; } &.image-upload-disabled { cursor: not-allowed; background-color: ${d.r.colors.gray100}; color: ${d.r.colors.gray400}; border-color: ${d.r.colors.gray200}; } svg { width: ${(0,h.h)(18)}; height: ${(0,h.h)(18)}; } input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: -1; } `,W=c.Z.div` position: relative; width: ${(0,h.h)(90)}; height: ${(0,h.h)(90)}; border-radius: ${(0,h.h)(12)}; overflow: hidden; background-color: ${d.r.colors.gray100}; display: flex; align-items: center; justify-content: center; img { width: 100%; height: 100%; object-fit: contain; } svg { width: ${(0,h.h)(14)}; height: ${(0,h.h)(14)}; color: ${d.r.colors.white}; } .image-upload-remove-button { cursor: pointer; position: absolute; top: ${(0,h.h)(6)}; right: ${(0,h.h)(6)}; background: ${d.r.colors.black}; border-radius: ${(0,h.h)(12)}; padding: ${(0,h.h)(2)}; display: flex; &:hover { opacity: 0.8; } } `,Y=c.Z.div` display: flex; gap: ${(0,h.h)(8)}; margin-top: ${(0,h.h)(18)}; `,J=(0,i.forwardRef)(({label:e,name:t,error:r,acceptedTypes:a=[n.PNG,n.JPG,n.JPEG],maxSize:l=1,acceptedRatios:o,multiple:c=!1,disabled:u=!1,id:p,className:g,onChange:b,value:v,showValidationRules:y=!1,description:x,useBase64:w=!1,placeholder:E},I)=>{let{t:$}=(0,k.u)(),[D,S]=(0,i.useState)(!1),[N,P]=(0,i.useState)([]),F=(0,i.useRef)(null),O=!!r||N.length>0,B=(0,i.useMemo)(()=>v?Array.isArray(v)?v:[v]:[],[v]),H=(0,i.useCallback)(e=>{var t;let r=[],o="."+(null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase());a.includes(o)||r.push(`Unsupported file format. Please upload a ${a.join(", ")} file.`);let n=e.size/1048576;return n>l&&r.push(`File too large. Please upload an image smaller than ${l}MB.`),{file:e,isValid:0===r.length,errors:r}},[a,l]),j=(0,i.useCallback)(e=>new Promise(t=>{if(!o||!o.length||!e.type.startsWith("image/")){t([]);return}let r=new Image;r.onload=()=>{let e=r.width/r.height,a=`${e.toFixed(1)}:1`,l=o.some(t=>{let[r,a]=t.split(":"),l=parseInt(r)/parseInt(a);return .1>Math.abs(e-l)});t(l?[]:[`Image ratio ${a} is not accepted.`])},r.onerror=()=>t(["Invalid image file"]),r.src=URL.createObjectURL(e)}),[o]),M=(0,i.useMemo)(()=>B.map(e=>"string"==typeof e?e:e instanceof File?URL.createObjectURL(e):"").filter(Boolean),[B]),z=(0,i.useCallback)(e=>(0,f.a)(void 0,void 0,void 0,function*(){let r=Array.from(e),a=[],l=[];for(let e of r){let t=H(e),r=yield j(e),o=[...t.errors,...r];0===o.length?l.push(e):a.push(...o)}if(P(a),0===l.length)return;let o=w?yield handleMultipleImageFiles(l):l;b({target:{name:t,value:c?[...B,...o]:o.slice(0,1)}})}),[H,j,c,b,t,B]),removeFile=e=>{let r=B.filter((t,r)=>r!==e);P([]),b({target:{name:t,value:c?r:""}})},L=(0,i.useCallback)(e=>{F.current=e,"function"==typeof I?I(e):I&&(I.current=e)},[I]),T=(0,i.useCallback)(()=>{!u&&F.current&&F.current.click()},[u]),V=(0,i.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),S(!0)},[]),A=(0,i.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),S(!1)},[]),G=(0,i.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),R=(0,i.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),S(!1);let t=e.dataTransfer.files;t.length>0&&z(t)},[z]);return i.createElement(Z,{className:g},i.createElement("label",{htmlFor:p||t},"string"==typeof e?i.createElement(s.T,{size:"title2"},e):e,x&&i.createElement(s.T,{size:"p3",mt:(0,h.h)(4),color:d.r.colors.gray700},x)),y&&i.createElement(U,null,i.createElement(s.T,{size:"p3"},"Formats: ",a.join("/")),o&&i.createElement(s.T,{size:"p3"},"Max size: ",l,"MB - Accepted ratios:"," ",o.join("/"))),(c||0===B.length)&&i.createElement(q,{className:(0,m.default)(D&&"image-upload-dragover",O&&"image-upload-error",u&&"image-upload-disabled"),onDragEnter:V,onDragLeave:A,onDragOver:G,onDrop:R,onClick:T},i.createElement("input",{ref:L,type:"file",id:p||t,name:t,accept:a.join(","),multiple:c,onChange:e=>{let t=e.target.files;t&&t.length>0&&z(t)},disabled:u}),i.createElement(Upload,null),i.createElement(s.T,{size:"p3",fw:500},E||$("common.btn.uploadPhoto"))),B.length>0&&i.createElement(Y,null,M.map((e,t)=>i.createElement(W,{key:t},i.createElement("img",{src:e,alt:`Uploaded file ${t+1}`,className:"image-upload-preview-image"}),i.createElement("button",{onClick:e=>{e.stopPropagation(),removeFile(t)},className:"image-upload-remove-button"},i.createElement(C.C,null))))),O&&i.createElement("div",{className:"image-upload-input-error"},[...N,r].map(e=>i.createElement(s.T,{key:e,className:"error-text",size:"c1",color:d.r.colors.red600},e))))}),K=(0,c.Z)(I.l)` & .mantine-Carousel-control { width: auto; } `,DragFreeCarousel=e=>{var{children:t,gapItem:r=8,slideSize:a="auto",withControls:l=!1,withIndicators:o=!1,dragFree:n=!0,align:s="start"}=e,c=(0,f._)(e,["children","gapItem","slideSize","withControls","withIndicators","dragFree","align"]);return i.createElement(K,Object.assign({slideSize:a,slideGap:r,withControls:l,withIndicators:o,dragFree:n,align:s,containScroll:"trimSnaps"},c),i.Children.map(t,(e,t)=>i.createElement(I.l.Slide,{key:t},e)))}},iLqx:function(e,t,r){r.d(t,{B:function(){return BabyGrowthForm}});var a=r("fbRC"),l=r("q1tI"),o=r("/npG"),n=r("mYVa"),i=r("8vDj"),s=r("iuhU"),c=r("cChf"),d=r("ZFu2"),u=r("6HDN"),p=r("qZBo"),h=r("F/Hd"),m=r("iBNF"),g=r("thIk"),b=r("g73v"),v=r("l5E9"),f=r("Ni80"),y=r("oF1Y"),x=r("/hDE"),w=r("Zge2");let E=(0,l.createContext)({}),DefaultForm=e=>{let{t,locale:r}=(0,g.u)(),{classes:a={}}=(0,l.useContext)(b.C),{form:o,currentUrl:n,submitProps:i}=(0,l.useContext)(E),s={placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0}};return l.createElement(f.H,Object.assign({formLayout:"default"},e),l.createElement(f.H.FormRow,null,l.createElement(f.H.Control,null,l.createElement(y.G,Object.assign({isBaby:!0,genderValue:{male:"boy",female:"girl"}},o.getInputProps("gender"),{error:null}))),o.errors.gender&&l.createElement(f.H.Error,null,o.errors.gender)),l.createElement(f.H.FormRow,null,l.createElement(u.I.Wrapper,{label:l.createElement(h.T,{size:"p2",weight:"semiBold"},t("babyGrowth.input.birthday"))},l.createElement(p.D,Object.assign({},s,{maxDate:new Date},o.getInputProps("birthday"),{error:null,onChange:e=>{e&&o.validateField("measurementDate"),o.getInputProps("birthday").onChange(e)}}))),o.errors.birthday&&l.createElement(f.H.Error,null,o.errors.birthday)),l.createElement(f.H.FormRow,null,l.createElement(u.I.Number,Object.assign({label:l.createElement(h.T,{size:"p2",weight:"semiBold"},t("babyGrowth.height"),l.createElement(h.T,{size:"p2",weight:"semiBold",color:m.r.colors.gray300,as:"span"},` (${t("babyGrowth.cm")})`))},o.getInputProps("height"),{placeholder:t("babyGrowth.height"),min:v.I.height.min,max:v.I.height.max,onChange:e=>{o.setFieldValue("height",e),o.setFieldValue("checkMesureVal",!o.values.checkMesureVal)}}))),l.createElement(f.H.FormRow,null,l.createElement(u.I.Number,Object.assign({label:l.createElement(h.T,{size:"p2",weight:"semiBold"},t("babyGrowth.weight"),l.createElement(h.T,{size:"p2",weight:"semiBold",color:m.r.colors.gray300,as:"span"},` (${t("babyGrowth.kg")})`))},o.getInputProps("weight"),{placeholder:t("babyGrowth.weight"),min:v.I.weight.min,max:v.I.weight.max,onChange:e=>{o.setFieldValue("weight",e),o.setFieldValue("checkMesureVal",!o.values.checkMesureVal)}}))),r!==x.L.Vietnam&&l.createElement(f.H.FormRow,null,l.createElement(u.I.Number,Object.assign({label:l.createElement(h.T,{size:"p2",weight:"semiBold"},t("babyGrowth.head"),l.createElement(h.T,{size:"p2",weight:"semiBold",color:m.r.colors.gray300,as:"span"},` (${t("babyGrowth.cm")})`))},o.getInputProps("head"),{placeholder:t("babyGrowth.head"),onChange:e=>{o.setFieldValue("head",e),o.setFieldValue("checkMesureVal",!o.values.checkMesureVal)}}))),o.errors.checkMesureVal&&l.createElement(f.H.Error,null,o.errors.checkMesureVal),l.createElement(f.H.FormRow,null,l.createElement(u.I.Wrapper,{label:l.createElement(h.T,{size:"p2",weight:"semiBold"},t("babyGrowth.input.measurementDate"))},l.createElement(p.D,Object.assign({},s,{defaultValue:new Date},o.getInputProps("measurementDate"),{maxDate:new Date,error:null}))),o.errors.measurementDate&&l.createElement(f.H.Error,null,o.errors.measurementDate)),l.createElement(f.H.FormRow,{className:a.submitWrapper},l.createElement(f.H.Submit,Object.assign({className:a.submitBtn,type:"submit","data-event-category":"Health Tool","data-event-action":"Baby Growth","data-event-label":n},i),t("babyGrowth.input.submit"))))};var C=(0,o.k)(e=>({root:{display:"flex",flexDirection:"column",gap:(0,n.h)(8)},bmiVal:{display:"inline-block"},unitText:{color:e.colors.gray[6]},submitBtn:{}}));let localizeNumberFormat=(e,t=2)=>Intl.NumberFormat(void 0,{maximumFractionDigits:t}).format(e),bmiCalculate=(e=0,t=0)=>{try{if(e&&t){let r=Number(t)/Math.pow(Number(e)/100,2);if(isNaN(r))return 0;return Number(localizeNumberFormat(r))}}catch(e){}return 0},InlineForm=e=>{var{styles:t,classNames:r}=e,o=(0,a._)(e,["styles","classNames"]);let{t:n,locale:c}=(0,g.u)(),{form:d,currentUrl:m,submitProps:w}=(0,l.useContext)(E),{classes:k={}}=(0,l.useContext)(b.C),I=(0,i.rZ)(),{classes:$}=C(void 0,{name:"BabyGrowthForm__InlineForm",styles:t,classNames:r}),D={placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0}};return l.createElement(f.H,Object.assign({formLayout:"inline"},o),l.createElement(f.H.FormRow,null,l.createElement(f.H.BorderInlineControl,{label:n("tools.selectBabyGender")},l.createElement(y.G,Object.assign({type:"radio",hideLabel:!0,isBaby:!0,genderValue:{male:"boy",female:"girl"}},d.getInputProps("gender")))),d.errors.gender&&l.createElement(f.H.Error,null,d.errors.gender)),l.createElement(f.H.FormRow,null,l.createElement(f.H.BorderInlineControl,{label:n("babyGrowth.input.birthday")},l.createElement(p.D,Object.assign({},D,{maxDate:new Date},d.getInputProps("birthday"),{error:null,onChange:e=>{e&&d.validateField("measurementDate"),d.getInputProps("birthday").onChange(e)}}))),d.errors.birthday&&l.createElement(f.H.Error,null,d.errors.birthday)),l.createElement(f.H.FormRow,null,l.createElement(f.H.BorderInlineControl,{label:"BMI",styles:{control:{"&:first-child":{width:"auto"}}}},l.createElement(h.T,{size:"p3"},l.createElement("span",{className:$.bmiVal},d.getInputProps("height").value&&d.getInputProps("weight").value&&bmiCalculate(Number(d.getInputProps("height").value),Number(d.getInputProps("weight").value))),"(",n("babyGrowth.kg.m2"),")"),l.createElement(u.I.Number,Object.assign({},d.getInputProps("height"),{placeholder:n("babyGrowth.height"),min:v.I.height.min,max:v.I.height.max,onChange:e=>{d.setFieldValue("height",e),d.setFieldValue("checkMesureVal",!d.values.checkMesureVal)},rightSection:l.createElement(f.H.Unit,null,n("babyGrowth.cm"))})),l.createElement(u.I.Number,Object.assign({},d.getInputProps("weight"),{placeholder:n("babyGrowth.weight"),min:v.I.weight.min,max:v.I.weight.max,onChange:e=>{d.setFieldValue("weight",e),d.setFieldValue("checkMesureVal",!d.values.checkMesureVal)},rightSection:l.createElement(f.H.Unit,null,n("babyGrowth.kg"))}))),("mb"===I.other.template||c!==x.L.Vietnam)&&l.createElement(f.H.BorderInlineControl,{label:n("babyGrowth.head")},l.createElement(u.I.Number,Object.assign({},d.getInputProps("head"),{placeholder:n("babyGrowth.head"),onChange:e=>{d.setFieldValue("head",e),d.setFieldValue("checkMesureVal",!d.values.checkMesureVal)},rightSection:l.createElement(f.H.Unit,null,n("babyGrowth.cm"))}))),d.errors.checkMesureVal&&l.createElement(f.H.Error,null,d.errors.checkMesureVal)),l.createElement(f.H.FormRow,null,l.createElement(f.H.BorderInlineControl,{label:n("babyGrowth.input.measurementDate")},l.createElement(p.D,Object.assign({},D,{maxDate:new Date},d.getInputProps("measurementDate"),{error:null}))),d.errors.measurementDate&&l.createElement(f.H.Error,null,d.errors.measurementDate)),l.createElement(f.H.FormRow,{className:k.submitWrapper},l.createElement(f.H.Submit,Object.assign({type:"submit","data-event-category":"Health Tool","data-event-action":"Baby Growth","data-event-label":m,className:(0,s.default)($.submitBtn,k.submitBtn)},w),n("babyGrowth.input.submit"))))},MbLayout=e=>{var t=(0,a._)(e,[]);let{t:r}=(0,g.u)(),{form:o,currentUrl:n,submitProps:i}=(0,l.useContext)(E),s={placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0}};return l.createElement(f.H,Object.assign({formLayout:"default"},t),l.createElement(f.H.FormRow,null,l.createElement(f.H.Control,null,l.createElement(y.G,Object.assign({isBaby:!0,genderValue:{male:"boy",female:"girl"}},o.getInputProps("gender"),{error:null}))),o.errors.gender&&l.createElement(f.H.Error,null,o.errors.gender)),l.createElement(f.H.BorderBoxControl,{label:r("babyGrowth.input.birthday"),rightSection:l.createElement(w.Z,null)},l.createElement(p.D,Object.assign({},s,{maxDate:new Date},o.getInputProps("birthday"),{error:null,rightSection:null,onChange:e=>{e&&o.validateField("measurementDate"),o.getInputProps("birthday").onChange(e)}}))),o.errors.birthday&&l.createElement(f.H.Error,null,o.errors.birthday),l.createElement(f.H.BorderBoxControl,{label:r("babyGrowth.height"),rightSection:r("babyGrowth.cm")},l.createElement(u.I.Number,Object.assign({},o.getInputProps("height"),{placeholder:r("tools.inputPlaceholder",{content:"160"}),min:v.I.height.min,max:v.I.height.max,onChange:e=>{o.setFieldValue("height",e),o.setFieldValue("checkMesureVal",!o.values.checkMesureVal)}}))),o.errors.height&&l.createElement(f.H.Error,null,o.errors.height),l.createElement(f.H.BorderBoxControl,{label:r("babyGrowth.weight"),rightSection:r("babyGrowth.kg")},l.createElement(u.I.Number,Object.assign({},o.getInputProps("weight"),{placeholder:r("tools.inputPlaceholder",{content:"50"}),min:v.I.weight.min,max:v.I.weight.max,onChange:e=>{o.setFieldValue("weight",e),o.setFieldValue("checkMesureVal",!o.values.checkMesureVal)}}))),o.errors.weight&&l.createElement(f.H.Error,null,o.errors.weight),l.createElement(f.H.BorderBoxControl,{label:r("babyGrowth.head"),rightSection:r("babyGrowth.cm")},l.createElement(u.I.Number,Object.assign({},o.getInputProps("head"),{placeholder:r("tools.inputPlaceholder",{content:"50"}),onChange:e=>{o.setFieldValue("head",e),o.setFieldValue("checkMesureVal",!o.values.checkMesureVal)}}))),o.errors.checkMesureVal&&l.createElement(f.H.Error,null,o.errors.checkMesureVal),l.createElement(f.H.BorderBoxControl,{label:r("babyGrowth.input.measurementDate"),rightSection:l.createElement(w.Z,null)},l.createElement(u.I.Wrapper,null,l.createElement(p.D,Object.assign({},s,{defaultValue:new Date},o.getInputProps("measurementDate"),{maxDate:new Date,rightSection:null,error:null})))),o.errors.measurementDate&&l.createElement(f.H.Error,null,o.errors.measurementDate),l.createElement(f.H.Submit,Object.assign({type:"submit","data-event-category":"Health Tool","data-event-action":"Baby Growth","data-event-label":n},i),r("babyGrowth.input.submit")))},BabyGrowthForm=e=>{var{onSubmit:t,formLayout:r="default",submitProps:o,currentUrl:n}=e,s=(0,a._)(e,["onSubmit","formLayout","submitProps","currentUrl"]);let{t:u}=(0,g.u)(),p=(0,i.rZ)(),h=(0,c.c)({initialValues:{measurementDate:new Date},validate:{gender:(0,d.U)(u("validation.error.requiredField")),birthday:(0,d.U)(u("validation.error.requiredField")),measurementDate:(e,t)=>t.birthday?t.birthday instanceof Date&&e instanceof Date&&t.birthday.getTime()<=e.getTime()?null:u("babyGrowth.error.measurementDateLowerThanBirthday",{name:""}):null,checkMesureVal:(e,t)=>void 0===t.head&&void 0===t.height&&void 0===t.weight||t.head||t.height||t.weight?null:u("babyGrowth.error.atLeastOneOf")},validateInputOnChange:["checkMesureVal"]}),m=Object.assign({onSubmit:h.onSubmit(e=>null==t?void 0:t(Object.assign(Object.assign({},e),{bmi:bmiCalculate(Number(h.getInputProps("height").value),Number(h.getInputProps("weight").value)).toString()})))},s);return l.createElement(E.Provider,{value:{submitProps:o,currentUrl:n,form:h}},"default"===r?"mb"===p.other.template?l.createElement(MbLayout,Object.assign({formLayout:r},m)):l.createElement(DefaultForm,Object.assign({},m)):l.createElement(InlineForm,Object.assign({},m)))}},nDSk:function(e,t,r){r.d(t,{B:function(){return BabyPoopForm}});var a=r("fbRC"),l=r("q1tI"),o=r("/npG"),n=r("mYVa"),i=r("Eso5"),s=r("iuhU"),c=r("F/Hd"),d=r("G5av"),u=r("thIk"),p=r("g73v"),h=r("Ni80"),m=(0,o.k)((e,{hasOnClickFn:t})=>({root:{position:"relative",display:"flex",flexDirection:"column",gap:(0,n.h)(16)},sponsorBox:{display:"flex",gap:(0,n.h)(12),alignItems:"center",backgroundColor:e.colors.neutral[0],border:`1px solid ${e.colors.neutral[1]}`,borderRadius:(0,n.h)(4),padding:"4px 12px",alignSelf:"flex-start"},sponsorLogo:{maxHeight:(0,n.h)(32)},btn:{minWidth:(0,n.h)(180),[e.fn.largerThan("sm")]:{alignSelf:"flex-end"},visibility:t?"visible":"hidden"}}));let BabyPoopForm=e=>{var{babyPoopPage:t,onClickFindOut:r,currentUrl:o,sponsorLogo:n,btnProps:g,styles:b,classNames:v}=e,f=(0,a._)(e,["babyPoopPage","onClickFindOut","currentUrl","sponsorLogo","btnProps","styles","classNames"]);let{t:y}=(0,u.u)(),{classes:x}=m({hasOnClickFn:!!r},{name:"BabyPoopForm",styles:b,classNames:v}),{classes:w={}}=(0,l.useContext)(p.C);return l.createElement(h.H.FormRow,null,l.createElement(i.x,Object.assign({className:x.root},f),n&&l.createElement(i.x,{className:x.sponsorBox},l.createElement(c.T,{size:"p4"},y("common.sponsoredBy")),l.createElement("img",{loading:"lazy",src:n,alt:"sponsor",className:x.sponsorLogo})),l.createElement(c.T,{size:"p3",as:"div",className:"description",dangerouslySetInnerHTML:{__html:t.description}}),l.createElement(d.B,Object.assign({className:(0,s.default)(x.btn,w.submitBtn),onClick:r,dataEventCategory:"Health Tool",dataEventAction:"Baby Stool Inquiry",dataEventLabel:o},g),y("babyPoop.findOut"))))}},adbs:function(e,t,r){r.d(t,{S:function(){return Spoiler}});var a=r("fbRC"),l=r("q1tI"),o=r("uCoU"),n=r("F/Hd"),i=r("thIk"),s=r("iBNF");let Spoiler=e=>{var{children:t,line:r,lineHeight:c,trackingAttributes:d,maxHeight:u,customExpandFn:p}=e,h=(0,a._)(e,["children","line","lineHeight","trackingAttributes","maxHeight","customExpandFn"]);let{t:m}=(0,i.u)(),g=(0,l.useMemo)(()=>u||(r&&c?r*c:(console.error("[HHG-Comp]:[Spoiler] Please provide maxHeight, or line with lineHeight"),0)),[]);t||console.error("[HHG-Comp]:[Spoiler] Please provide children");let b=(0,l.useMemo)(()=>d?{"data-event-category":d.dataEventCategory,"data-event-action":d.dataEventAction,"data-event-label":d.dataEventLabel}:{},[d]);return l.createElement(o.o,Object.assign({showLabel:l.createElement(n.T,Object.assign({size:"p3",color:s.r.colors.primaryBase},b,{onClick:p}),m("articlePage.readMore")),hideLabel:l.createElement(n.T,Object.assign({size:"p3",color:s.r.colors.primaryBase},b),m("articlePage.showLess"))},h,{maxHeight:g}),t)}},"ZE+N":function(e,t,r){r.d(t,{D:function(){return Drawer}});var a=r("q1tI"),l=r("t/pd"),o=r("oKqh"),n=r("AeFk"),i=r("rBCA"),s=r("iBNF"),c=r("pesA"),d=r("F/Hd");let u="600ms",generateStyleBasedOnPlacement=(e,t)=>{switch(e){case"top":return n.iv` top: 0; width: 100%; border-radius: 0px 0px 6px 6px; ${t?n.iv` animation: ${c.a} ${u} ease-in-out forwards; `:null} &.slideOut { animation: ${c.d} ${u} ease-in-out forwards; } `;case"right":return n.iv` right: 0; height: 100%; min-width: 300px; border-radius: 6px 0px 0px 6px; ${t?n.iv` animation: ${c.c} ${u} ease-in-out forwards; `:null} &.slideOut { animation: ${c.g} ${u} ease-in-out forwards; } `;case"bottom":return n.iv` bottom: 0; width: 100%; border-radius: 6px 6px 0px 0px; ${t?n.iv` animation: ${c.s} ${u} ease-in-out forwards; `:null} &.slideOut { animation: ${c.e} ${u} ease-in-out forwards; } `;case"left":return n.iv` left: 0; height: 100%; min-width: 300px; border-radius: 0px 6px 6px 0px; ${t?n.iv` animation: ${c.b} ${u} ease-in-out forwards; `:null} &.slideOut { animation: ${c.f} ${u} ease-in-out forwards; } `;default:return n.iv` left: 0; height: 100%; min-width: 300px; border-radius: 0px 6px 6px 0px; ${t?n.iv` animation: ${c.s} ${u} ease-in-out forwards; `:null} &.slideOut { animation: ${c.e} ${u} ease-in-out forwards; } `}},p=i.Z.div` position: fixed; inset: 0; z-index: ${s.r.zIndexes.drawer}; pointer-events: ${e=>e.open?"auto":"none"}; `,h=i.Z.div` position: fixed; z-index: 300; background: #ffffff; visibility: ${e=>e.open?"visible":"hidden"}; max-height: calc(100vh - 100px); display: flex; flex-direction: column; .title { display: flex; align-items: center; justify-content: space-between; padding: 16px; ${e=>e.hasTitle?n.iv` border-bottom: 1px solid ${s.r.colors.neutral100}; `:null} } .close-button { margin-left: auto; } ${e=>generateStyleBasedOnPlacement(e.placement,e.open)} `,m=i.Z.div` min-height: 200px; padding: 16px; overflow-y: auto; `,g=i.Z.div` position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; overflow-x: hidden; overflow-y: auto; outline: 0; background-color: rgba(38, 38, 38, 0.3); z-index: 1; &[data-open='false'] { visibility: hidden; pointer-events: none; } &[data-open='true'] { visibility: visible; pointer-events: auto; } `,Backdrop=({open:e=!1,onClickOutside:t})=>a.createElement(g,{"data-open":e,onClick:t}),Drawer=({children:e,title:t,onClose:r,open:n=!1,placement:i="left",destroyOnClose:s=!1,isPropagationEvent:c=!0,className:u})=>{let g=(0,a.useRef)();(0,a.useEffect)(()=>((0,o.t)(n),()=>(0,o.t)(!1)),[n]);let onCloseDrawer=()=>{g.current.classList.add("slideOut"),setTimeout(()=>{r()},800)};return!n&&s?null:a.createElement(l.h,null,a.createElement(p,{className:u,open:n},a.createElement(Backdrop,{open:n,onClickOutside:onCloseDrawer}),a.createElement(h,{open:n,placement:i,ref:g,hasTitle:!!t},a.createElement("div",{className:"title"},t&&a.createElement(d.T,{size:"s2",weight:"semiBold"},t),a.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"close-button",onClick:onCloseDrawer},a.createElement("path",{d:"M5.99007 4.99067C5.79114 4.99072 5.59674 5.0501 5.43173 5.16121C5.26672 5.27233 5.1386 5.43013 5.06374 5.61444C4.98889 5.79875 4.9707 6.0012 5.0115 6.1959C5.05231 6.39061 5.15025 6.56872 5.29281 6.70747L10.5858 12.0004L5.29281 17.2934C5.19684 17.3855 5.12021 17.4959 5.06743 17.618C5.01464 17.7402 4.98676 17.8716 4.9854 18.0046C4.98405 18.1377 5.00926 18.2697 5.05954 18.3928C5.10983 18.516 5.1842 18.6279 5.27827 18.722C5.37235 18.8161 5.48426 18.8904 5.60743 18.9407C5.73061 18.991 5.86259 19.0162 5.99563 19.0149C6.12867 19.0135 6.2601 18.9856 6.38223 18.9328C6.50436 18.8801 6.61473 18.8034 6.70687 18.7075L11.9998 13.4145L17.2928 18.7075C17.385 18.8034 17.4953 18.8801 17.6175 18.9328C17.7396 18.9856 17.871 19.0135 18.0041 19.0149C18.1371 19.0162 18.2691 18.991 18.3922 18.9407C18.5154 18.8904 18.6273 18.8161 18.7214 18.722C18.8155 18.6279 18.8899 18.516 18.9401 18.3928C18.9904 18.2697 19.0156 18.1377 19.0143 18.0047C19.0129 17.8716 18.985 17.7402 18.9323 17.618C18.8795 17.4959 18.8028 17.3855 18.7069 17.2934L13.4139 12.0004L18.7069 6.70747C18.8514 6.567 18.9501 6.38616 18.99 6.18864C19.03 5.99112 19.0093 5.78614 18.9308 5.60055C18.8523 5.41497 18.7195 5.25744 18.5499 5.14861C18.3803 5.03978 18.1817 4.98473 17.9803 4.99067C17.7205 4.99841 17.4739 5.10699 17.2928 5.2934L11.9998 10.5864L6.70687 5.2934C6.61368 5.19761 6.50224 5.12146 6.37912 5.06947C6.25601 5.01747 6.12372 4.99068 5.99007 4.99067Z",fill:"#595959"}))),a.createElement(m,{onClick:e=>{c&&e.stopPropagation()}},e&&(a.isValidElement(e)?e:"function"==typeof e?e({internalClose:onCloseDrawer}):null)))))}},gC6A:function(e,t,r){r.d(t,{C:function(){return i}});var a=r("xrdX"),l=r("GOBr"),o=r("yNk5");let isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),n="hellosehat.com",i=new class{constructor(){this.baseDomain="",this.subPath="",this.getAssetPath=(e,t,r)=>{let a="https://hhg-common."+[t||this.getBaseDomain(),r||this.subPath,e].join("/");return l.y||o.env.JEST_WORKER_ID?a:a+"?v="+Math.floor(new Date().getTime()/1e3/60/3)}}getBaseDomain(){if(this.baseDomain)return this.baseDomain;if("undefined"!=typeof window){let{host:e}=window.location,t=e.split("."),r=a.v[Object.keys(a.v).find(t=>e.includes(a.v[t]))];return t.includes("localhost")||t.includes("hellohealthgroup")||t.every(e=>isNumeric(e))||!r?n:r}return n}};i.subPath="common",i.baseDomain=a.v["vi-VN"]},UUOW:function(e,t,r){r.d(t,{u:function(){return a}});var a=(0,r("/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"}}}))},Ascx:function(e,t,r){r.d(t,{L:function(){return LabelSorting}});var a,l,o=r("q1tI"),n=r("F/Hd"),i=r("cMvO"),s=r("KERF");(a=l||(l={})).latest="latest",a.oldest="oldest",a.popular="popular";let LabelSorting=({onChange:e,className:t,style:r,leftLabel:a,rightLabel:l,color:c,value:d,choices:u})=>{let{data:{env:{isMarryBaby:p}}}=(0,o.useContext)(i.T);return o.createElement(s.L,{label:a,rightLabel:o.createElement(s.b,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:u.map(t=>({label:t.label,onClick:()=>e&&e(String(t.value)),selected:t.value===d,className:"bold-item"}))},toggleButtonContent:o.createElement("div",{style:{display:"flex"}},o.createElement(n.T,{style:{display:"flex",alignItems:"center",fontWeight:"normal",marginRight:12},size:"p4"},l),o.createElement("img",{src:p?"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:r})}},"7zYg":function(e,t,r){r.d(t,{c:function(){return convertLocalizedStringToNumber},f:function(){return formatPhoneNumber},l:function(){return localizeNumberFormat}});var a=r("A9bs");let localizeNumberFormat=(e,t,r=2)=>Intl.NumberFormat(void 0,{maximumFractionDigits:r}).format(e),convertLocalizedStringToNumber=e=>Number(e.replace(/,/gi,".")),formatPhoneNumber=e=>{try{let t=(0,a.parsePhoneNumber)(e,"VN");if(!(null==t?void 0:t.number))throw Error("Invalid number");return(0,a.formatPhoneNumber)(t.number)}catch(t){return console.log("\uD83D\uDE80 ~ formatPhoneNumber ~ error:",t),e}}},"6wKP":function(e,t,r){r.d(t,{L:function(){return n}});var a=r("q1tI"),l=r("gC6A"),o=r("Aeci");let n=(0,a.memo)(({type:e,width:t,height:r,isLight:n})=>{let i=(0,a.useMemo)(()=>{switch(e){case"hellobacsi":return{width:t||"107px",height:r||"24px",src:l.C.getAssetPath("logo/hellobacsi.png"),srcLight:l.C.getAssetPath("logo/hellobacsi-light.png")};case"hellodoktor":return{width:t||"127px",height:r||"24px",src:l.C.getAssetPath("logo/hellodoktor.png")};case"hellosehat":return{width:t||"121px",height:r||"27px",src:l.C.getAssetPath("logo/hellosehat.png")};case"hellojiankang":return{width:t||"87px",height:r||"24px",src:l.C.getAssetPath("logo/hellojiankang.png")};case"hellohealth":return{width:t||"123px",height:r||"24px",src:l.C.getAssetPath("logo/hellohealth.png")};case"hellotogether":return{width:t||"150px",height:r||"24px",src:l.C.getAssetPath("logo/hellotogether.png")};case"hellocare":return{width:t||"99px",height:r||"24px",src:l.C.getAssetPath("logo/hellocare.png")};case"hellodoctor":return{width:t||"127px",height:r||"24px",src:l.C.getAssetPath("logo/hellodoctor.png")};case"hellokrupet":return{width:t||"101px",height:r||"24px",src:l.C.getAssetPath("logo/hellokrupet.png")};case"hellosayarwon":return{width:t||"111px",height:r||"24px",src:l.C.getAssetPath("logo/hellosayarwon.png")};case"helloyishi":return{width:t||"89px",height:r||"24px",src:l.C.getAssetPath("logo/helloyishi.png")};case"hellokhunmor":return{width:t||"123px",height:r||"24px",src:l.C.getAssetPath("logo/hellokhunmor.png")};case"helloswasthya":return{width:t||"105px",height:r||"24px",src:l.C.getAssetPath("logo/helloswasthya.png")};case"logomark":return{width:t||"60px",height:r||"57px",src:l.C.getAssetPath("logo/logomark.png")};case"marryBaby":return{width:t||"145px",height:r||"28px",src:l.C.getAssetPath("logo/marrybaby.png")};default:return null}},[e,t,r]),{src:s,width:c,height:d,srcLight:u}=i||{};return a.createElement(o.I,{alt:`${e} logo`,className:"main-logo-icon",src:n&&u||s,style:{width:c,height:d}})})}}]);