"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9226],{"U/K0":function(e,t,a){a.d(t,{a:function(){return ageGenerate}});var i=a("Wgwc"),o=a.n(i);let ageGenerate=(e,t=new Date)=>{let a=Math.ceil(o()(t).diff(e,"week",!0)),i=o()(t).diff(e,"month");return{year:Math.floor(i/12),month:i%12,week:a}}},wwwW:function(e,t,a){a.d(t,{a:function(){return r},b:function(){return n},c:function(){return l},d:function(){return u},e:function(){return s},f:function(){return c},g:function(){return d},h:function(){return p},s:function(){return o}});var i=a("AeFk");let o=i.F4` from { transform: translate3d(0, 100%, 0); visibility: visible; } to { transform: translate3d(0, 0, 0); } `,r=i.F4` from { transform: translate3d(0, -100%, 0); visibility: visible; } to { transform: translate3d(0, 0, 0); } `,n=i.F4` from { transform: translate3d(-100%, 0, 0); visibility: visible; } to { transform: translate3d(0, 0, 0); } `,l=i.F4` from { transform: translate3d(100%, 0, 0); visibility: visible; } to { transform: translate3d(0, 0, 0); } `,s=i.F4` from { transform: translate3d(0, 0, 0); } to { visibility: hidden; transform: translate3d(0, 100%, 0); } `,c=i.F4` from { transform: translate3d(0, 0, 0); } to { visibility: hidden; transform: translate3d(-100%, 0, 0); } `,d=i.F4` from { transform: translate3d(0, 0, 0); } to { visibility: hidden; transform: translate3d(100%, 0, 0); } `,u=i.F4` from { transform: translate3d(0, 0, 0); } to { visibility: hidden; transform: translate3d(0, -100%, 0); } `,p=i.F4` from { opacity: 0; } to { opacity: 1; } `},pkib:function(e,t,a){a.d(t,{Hm:function(){return BabyGrowthLegend},dW:function(){return BabyGrowthChooseProfileDrawer},fB:function(){return transformDataToChart},fL:function(){return ChildCard},nX:function(){return generateGrowthChart},yn:function(){return BabyGrowthChart}});var i,o,r=a("q1tI"),n=a("+DyL"),l=a("LOL7"),s=a("vFls"),c=a("XUjW"),d=a("ah6c"),u=a("5IIq"),p=a("tX9N"),h=a("Zge2"),m=a("R3fp"),g=a("ybaB"),b=a("4kHQ"),y=a("3E2d"),f=a("Ag88"),C=a("iBNF"),E=a("rBCA"),v=a("SPEo"),x=a("wTIr"),S=a("rqZo"),w=a("xtxu");a("Wgwc");var k=a("69aA"),L=a("oYLa"),I=a("ySIk"),M=a("4MMi"),O=a("2JFq"),T=a("yzAz"),R=a("OAeI"),P=a("OrYH"),j=a("ps87"),B=a("4cdY"),A=a("y9N3"),F=a("hNiv"),$=a("J+eN"),N=a("b+jq"),Z=a("i8Hr"),D=a("wwo5"),z=a("G+gm"),_=a("kcif"),H=a.n(_);a("xXM3"),a("sEfC"),a("i8i4"),a("yVya"),E.Z.div` & > :not(:last-child) { margin-bottom: 8px; } .gender-selector { & > :not(:last-child) { margin-right: 16px; } & > div { width: calc(50% - 8px); ${v.M.mbUp} { justify-self: left; } } } `,(0,E.Z)(x.R)` & > div > div { display: flex; flex-direction: row; justify-content: center; align-content: center; gap: 8px; padding-block: 5px; } .radio-group-item-heading { margin-top: 0; } `;let V=E.Z.div` display: flex; justify-content: center; gap: 16px; `,G=E.Z.div` display: flex; justify-content: center; align-items: center; gap: 6px; .dot { width: 8px; height: 8px; border-radius: 50%; } `,BabyGrowthLegend=({legends:e,locale:t})=>r.createElement(V,null,e.map((e,a)=>r.createElement(G,{key:a},r.createElement("span",{className:"dot",style:{backgroundColor:e.color}}),r.createElement(f.T,{size:"n1",color:C.r.colors.gray800},t===S.L.Indonesia?e["z-score"]:e.text))));E.Z.div` display: flex; justify-content: center; .switch { border: 1px solid ${C.r.colors.neutral200}; padding: 6px 12px; font-weight: 600; font-size: 11px; &:nth-child(2n + 1) { border-radius: ${C.r.borderRadius} 0px 0px 6px; border-right: none; } &:nth-child(2n) { border-radius: 0px 6px 6px 0px; border-left: none; } } `,(i=o||(o={}))[i.WHO=0]="WHO",i[i.CDC=1]="CDC";let K=E.Z.div` /* position: absolute; */ display: flex; align-items: stretch; justify-content: space-around; padding: 8px; gap: 14px; min-width: 145px; max-width: 220px; min-height: 50px; border-radius: 4px; background: rgba(255, 255, 255, 0.2); box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); border: 1px solid rgba(255, 255, 255, 0.3); .risk { display: flex; align-items: center; padding: 4px 8px; background: ${C.r.colors.yellow600}; border-radius: 3px; } .tooltip { text-align: left; } `,W=[{name:["3rd","-3SD","97th","3SD"],color:C.r.colors.red600},{name:["15rd","-2SD","85th","2SD"],color:C.r.colors.yellow600},{name:["50th","0Median"],color:C.r.colors.green600}],Y={"3rd":"-3SD","15th":"-2SD","50th":"Median","85th":"2SD","97th":"3SD"},BabyGrowthTooltip=e=>{var t;let{payload:a,locale:i,active:o}=e,n=null===(t=null==a?void 0:a[0])||void 0===t?void 0:t.payload;if(!n||!n.history||!n.name||!n.risk||!n.toolTipLabel||!o)return null;let l=(0,r.useMemo)(()=>{var e;return null===(e=W.find(e=>e.name.includes(n.risk||"")))||void 0===e?void 0:e.color},[n.risk]),s=(0,r.useMemo)(()=>i===S.L.Indonesia?n.risk?Y[n.risk]:"":n.risk,[i,n.risk]);return r.createElement(K,null,r.createElement("div",{className:"risk",style:{backgroundColor:l}},r.createElement(f.T,{size:"s3",color:C.r.colors.white,weight:"semiBold"},s)),r.createElement("div",{className:"tooltip"},(n.toolTipLabel||[]).map((e,t)=>r.createElement(f.T,{key:t,size:"n1",color:C.r.colors.gray600},e))))},q="300ms",U=E.Z.div` background: ${C.r.colors.gray50}; border-radius: ${C.r.borderRadius}; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } &[data-is-mb='true'] { background: #ffffff; border: 1px solid #e0e9fb; border-radius: 16px; } &[data-isActive='true'] { border: 1px solid #2661ad; } .baby { display: flex; align-items: center; gap: 8px; svg { min-width: 24px; } } &[data-is-mb='false'] .radio { cursor: pointer; position: relative; min-width: 22px; width: 22px; height: 22px; background: #ffffff; border: 2px solid ${C.r.colors.gray600}; border-radius: 50%; transition: all ${q} ease-in-out; &.active { border-color: ${C.r.colors.primaryBase}; &::before { content: ''; position: absolute; inset: 0; width: 100%; height: 100%; background-color: ${C.r.colors.primaryBase}; background-clip: content-box; padding: 5px; border-radius: 50%; animation: fadeIn ${q} ease-in-out forwards; } } } &[data-is-mb='true'] .radio { cursor: pointer; position: relative; min-width: 22px; width: 22px; height: 22px; background: #ffffff; border: 1.3px solid #9495a0; border-radius: 10px; transition: all ${q} ease-in-out; &.active { border: none; &::before { content: ''; position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border-radius: 10px; animation: fadeIn ${q} ease-in-out forwards; } } } `,BabyGrowthProfileRadio=({profile:e,onChange:t,isActive:a,siteType:i})=>{let o="marryBaby"===i;return r.createElement(U,{onClick:()=>t(String(e.id)),"data-is-mb":o,"data-isActive":o&&a},o?r.createElement(r.Fragment,null,r.createElement("div",{className:"baby"},r.createElement(y.M,{type:"bodytext-1",color:C.r.colors.gray800},e.name)),r.createElement("div",{className:a?"radio active":"radio"},a&&r.createElement(s.Z,{size:26}))):r.createElement(r.Fragment,null,r.createElement("div",{className:"baby"},"male"===e.gender?r.createElement(n.Z,{size:24}):r.createElement(l.Z,{size:24}),r.createElement(f.T,{size:"p2",color:C.r.colors.gray800},e.name)),r.createElement("div",{className:a?"radio active":"radio"})))};E.Z.div` cursor: pointer; position: relative; padding: 20px 2px; border-bottom: 1px solid ${C.r.colors.gray100}; .time { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; } .edit-button { margin-left: auto; justify-self: end; } .record { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr; grid-column-gap: 30px; grid-row-gap: 0px; } .record-item { display: flex; align-items: center; gap: 8px; } `;let Q=E.Z.div` min-width: 212px; width: ${e=>e.width+"px"}; background-color: #ffffff; border-radius: ${C.r.borderRadius}; overflow: hidden; filter: drop-shadow(0px 10px 16px rgba(0, 0, 0, 0.04)) drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.04)) drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.04)); ul { list-style: none; } `,X=E.Z.li` background-color: inherit; display: flex; align-items: center; justify-content: left; gap: 10px; padding: 10px 16px; cursor: pointer; transition: background-color 200ms ease-in-out; &:hover { background-color: ${C.r.colors.neutral50}; } .icon { width: 16px; height: 16px; } `,Menu=e=>{var{children:t,width:a=300}=e,i=(0,I._)(e,["children","width"]);return r.createElement(Q,Object.assign({},i,{width:a}),r.createElement("ul",null,t))};Menu.Item=e=>{var{icon:t,children:a}=e,i=(0,I._)(e,["icon","children"]);return r.createElement(X,Object.assign({},i),t&&r.createElement("div",{className:"icon"},t),a)};let J=E.Z.div` /* Auto layout */ position: relative; display: flex; align-items: flex-start; padding: 16px; gap: 16px; background: ${C.r.colors.white}; border: 1px solid ${C.r.colors.gray100}; border-radius: ${C.r.borderRadius}; &[data-theme='marryBaby'] { border: 1px solid #f3f3f3; border-radius: 16px; padding: 19px 16px; } &[data-theme='marryBaby'] .information { gap: 4px; } .information { display: flex; flex-direction: column; gap: 8px; h5:first-letter { text-transform: uppercase; } .detail { display: flex; gap: 16px; div { display: flex; align-items: center; gap: 6px; } } } `,ee=E.Z.div` position: absolute; top: 18px; right: 16px; cursor: pointer; `,et=(0,E.Z)(Menu)` position: absolute; right: 0; z-index: 1; &[data-site='marryBaby'] { border-radius: 12px; box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.1); li { display: flex; gap: 16px; align-items: center; :hover { background-color: ${C.r.mbColors.tonePink}; } } } `,ChildCardMenu=({name:e,onClose:t,onEdit:a,onSwitch:i,onAdd:o,onRemove:n,siteType:l})=>{let{t:s}=(0,g.u)(),c=(0,r.useRef)();return(0,M.a)(c,t),r.createElement("div",{ref:c},"marryBaby"===l?r.createElement(et,{width:250,"data-site":l},r.createElement(Menu.Item,{onClick:a,icon:r.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.1512 4.29354C13.7553 3.68946 14.5746 3.3501 15.4289 3.3501C17.2078 3.3501 18.65 4.79223 18.65 6.5712C18.65 7.42549 18.3106 8.24479 17.7065 8.84886L16.9689 9.58652C16.9626 9.59307 16.9562 9.5995 16.9496 9.6058L13.7897 12.7657C12.0036 14.5518 9.76564 15.8189 7.31513 16.4315L6.55809 16.6208C5.84616 16.7988 5.20129 16.1539 5.37927 15.442L5.56853 14.6849C6.18116 12.2344 7.44827 9.99647 9.23437 8.21036L12.3943 5.0504C12.4006 5.04388 12.407 5.0375 12.4135 5.03127L13.1512 4.29354ZM12.2667 7.01649L10.1536 9.1296C8.53411 10.7491 7.3852 12.7783 6.82972 15.0002L6.77301 15.227L6.99983 15.1703C9.22177 14.6149 11.251 13.4659 12.8705 11.8464L14.9836 9.73334C14.3478 9.52953 13.7639 9.13743 13.3133 8.68678C12.8626 8.23613 12.4705 7.65226 12.2667 7.01649ZM16.1622 8.55469C15.5984 8.66895 14.8552 8.39025 14.2325 7.76754C13.6098 7.14483 13.3311 6.40165 13.4454 5.83784L14.0704 5.21278C14.4307 4.8525 14.9193 4.6501 15.4289 4.6501C16.4899 4.6501 17.35 5.5102 17.35 6.5712C17.35 7.08071 17.1476 7.56935 16.7873 7.92962L16.1622 8.55469Z",fill:"#3E3F58"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.34998 20.0001C4.34998 19.6411 4.64099 19.3501 4.99998 19.3501H19C19.359 19.3501 19.65 19.6411 19.65 20.0001C19.65 20.3591 19.359 20.6501 19 20.6501H4.99998C4.64099 20.6501 4.34998 20.3591 4.34998 20.0001Z",fill:"#3E3F58"}))},r.createElement(y.M,{type:"bodytext-2",color:C.r.mbColors.gray},s("childCard.menu.edit",{name:e}))),r.createElement(Menu.Item,{onClick:i,icon:r.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.5951 4.50716C12.8673 4.19494 13.3411 4.16249 13.6533 4.43468L19.4929 9.52559C19.7286 9.73108 19.812 10.0613 19.7023 10.3541C19.5926 10.6469 19.3127 10.8409 19 10.8409H5C4.58579 10.8409 4.25 10.5051 4.25 10.0909C4.25 9.67671 4.58579 9.34092 5 9.34092H16.9984L12.6676 5.56534C12.3554 5.29315 12.3229 4.81938 12.5951 4.50716Z",fill:"#3E3F58"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.4049 19.4928C11.1327 19.8051 10.6589 19.8375 10.3467 19.5653L4.50715 14.4744C4.27144 14.2689 4.18796 13.9387 4.29768 13.6459C4.40741 13.3531 4.68729 13.1591 5 13.1591L19 13.1591C19.4142 13.1591 19.75 13.4949 19.75 13.9091C19.75 14.3233 19.4142 14.6591 19 14.6591L7.00161 14.6591L11.3324 18.4347C11.6446 18.7069 11.6771 19.1806 11.4049 19.4928Z",fill:"#3E3F58"}))},r.createElement(y.M,{type:"bodytext-2",color:C.r.mbColors.gray},s("childCard.menu.switch"))),r.createElement(Menu.Item,{onClick:o,icon:r.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},r.createElement("path",{d:"M11.8123 22.1251C8.24982 22.1251 5.15607 19.837 4.10577 16.4444C4.01202 16.1441 4.18048 15.8248 4.48077 15.731C4.78107 15.6373 5.1004 15.8057 5.19415 16.106C6.09357 19.0313 8.75665 20.981 11.8123 20.981C14.868 20.981 17.5311 19.0123 18.4305 16.106C18.5242 15.8057 18.8436 15.6373 19.1439 15.731C19.4442 15.8248 19.6126 16.1441 19.5189 16.4444C18.4686 19.837 15.3748 22.1251 11.8123 22.1251Z",fill:"#3E3F58"}),r.createElement("path",{d:"M4.3125 16.875C2.75684 16.875 1.5 15.6182 1.5 14.0625C1.5 12.5244 2.73779 11.2881 4.25684 11.25C4.96875 9.33691 6.41309 7.72559 8.26904 6.82471C8.55029 6.69434 8.88721 6.80566 9.01904 7.08691C9.14941 7.36816 9.03809 7.70654 8.75684 7.83691C7.05029 8.66309 5.73779 10.1997 5.19434 12C5.11816 12.2622 4.85596 12.4307 4.57471 12.394C4.46191 12.375 4.38721 12.375 4.3125 12.375C3.375 12.375 2.625 13.125 2.625 14.0625C2.625 15 3.375 15.75 4.3125 15.75C4.38721 15.75 4.46191 15.75 4.55566 15.731C4.85596 15.6943 5.15625 15.8994 5.19434 16.1997C5.23096 16.5 5.02441 16.8003 4.72559 16.8369C4.57471 16.856 4.44434 16.875 4.3125 16.875ZM19.3125 16.875C19.1807 16.875 19.0503 16.856 18.8994 16.8369C18.6006 16.8003 18.375 16.5 18.4307 16.1997C18.4688 15.8994 18.769 15.6753 19.0693 15.731C19.1631 15.75 19.2378 15.75 19.3125 15.75C20.25 15.75 21 15 21 14.0625C21 13.125 20.25 12.375 19.3125 12.375C19.2378 12.375 19.1631 12.375 19.0693 12.394C18.7881 12.4307 18.5244 12.2622 18.4497 12C17.5503 9.07471 14.8872 7.125 11.8315 7.125C10.856 7.125 9.39404 6.46875 9.39404 4.6875C9.39404 4.36816 9.63721 4.125 9.95654 4.125C10.2744 4.125 10.519 4.36816 10.519 4.6875C10.519 5.96191 11.6997 6 11.8315 6C15.2432 6 18.2256 8.10059 19.3872 11.25C20.9062 11.2881 22.144 12.5244 22.144 14.0625C22.125 15.6182 20.8682 16.875 19.3125 16.875Z",fill:"#3E3F58"}),r.createElement("circle",{cx:"11.8125",cy:"17.8125",r:"0.9375",fill:"#3E3F58"}),r.createElement("path",{d:"M16.0938 13.1694C15.897 13.0702 15.6596 13.1484 15.5592 13.343C15.5561 13.3488 15.2533 13.9219 14.7187 13.9219C14.1841 13.9219 13.8814 13.3488 13.8799 13.3453C13.781 13.148 13.5421 13.069 13.3452 13.1671C13.1483 13.2655 13.0689 13.5048 13.167 13.7017C13.188 13.7434 13.6876 14.7188 14.7187 14.7188C15.7499 14.7188 16.2495 13.7433 16.2705 13.7017C16.3685 13.5056 16.2892 13.2686 16.0938 13.1694Z",fill:"#3E3F58"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.1344 13.0892L16.1346 13.0893C16.3737 13.2108 16.4714 13.5014 16.351 13.7421L16.3509 13.7425C16.3382 13.7675 16.2027 14.0317 15.9361 14.2906C15.6691 14.55 15.2651 14.809 14.7188 14.809C14.1725 14.809 13.7685 14.55 13.5014 14.2906C13.2349 14.0317 13.0994 13.7675 13.0867 13.7424L13.0865 13.742L13.0865 13.742C12.9664 13.5009 13.0635 13.2075 13.305 13.0867L13.3051 13.0867C13.5463 12.9666 13.8392 13.0633 13.9604 13.3051L13.9625 13.3094L13.9625 13.3094C13.9628 13.31 13.9635 13.3112 13.9646 13.313C13.9776 13.3355 14.0457 13.4532 14.1633 13.5717C14.2976 13.707 14.4853 13.8321 14.7188 13.8321C14.9522 13.8321 15.1399 13.707 15.2744 13.5714C15.3411 13.5042 15.3925 13.4366 15.4274 13.3854C15.4448 13.3598 15.458 13.3386 15.4667 13.3238C15.4711 13.3164 15.4744 13.3106 15.4766 13.3068L15.4797 13.3011C15.6028 13.0634 15.8935 12.9678 16.1344 13.0892ZM13.8799 13.3455C13.8814 13.349 14.1841 13.9221 14.7188 13.9221C15.2517 13.9221 15.5543 13.3525 15.5592 13.3432L15.5592 13.3431C15.6597 13.1486 15.897 13.0704 16.0939 13.1696C16.2892 13.2688 16.3686 13.5058 16.2705 13.7019C16.2495 13.7435 15.7499 14.719 14.7188 14.719C13.6877 14.719 13.1881 13.7435 13.167 13.7019C13.069 13.505 13.1484 13.2657 13.3453 13.1672C13.5422 13.0692 13.7811 13.1482 13.8799 13.3455Z",fill:"#3E3F58"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5094 13.0893L10.5091 13.0892C10.2682 12.9678 9.97759 13.0634 9.85442 13.3011L9.85131 13.3068C9.84916 13.3106 9.84588 13.3164 9.8415 13.3238C9.83273 13.3386 9.81958 13.3598 9.80218 13.3854C9.76727 13.4366 9.71585 13.5042 9.6492 13.5714C9.51469 13.707 9.327 13.8321 9.09355 13.8321C8.86008 13.8321 8.67238 13.707 8.53807 13.5717C8.47152 13.5047 8.42025 13.4372 8.38558 13.3864C8.35996 13.3488 8.34478 13.3223 8.33921 13.3126L8.33682 13.3085L8.33512 13.3051C8.21396 13.0633 7.92186 12.9667 7.68003 13.0866L7.67978 13.0867C7.43828 13.2075 7.34115 13.5009 7.46124 13.742L7.46147 13.7424C7.47414 13.7675 7.60963 14.0317 7.87619 14.2906C8.14326 14.55 8.54722 14.809 9.09355 14.809C9.63987 14.809 10.0438 14.55 10.3109 14.2906C10.5775 14.0317 10.713 13.7675 10.7256 13.7425L10.7258 13.7421C10.8462 13.5014 10.7484 13.2108 10.5094 13.0893ZM9.93396 13.3432L9.934 13.3431C10.0062 13.2033 10.1491 13.1235 10.297 13.1266C10.1492 13.1236 10.0064 13.2033 9.93422 13.3431L9.93419 13.3432C9.92921 13.3526 9.62669 13.9221 9.09377 13.9221C9.08851 13.9221 9.08327 13.9221 9.07806 13.922C9.0832 13.9221 9.08836 13.9221 9.09355 13.9221C9.62649 13.9221 9.92901 13.3525 9.93396 13.3432ZM9.06061 14.7186C8.0518 14.6982 7.56261 13.7431 7.5418 13.7019C7.44375 13.505 7.52313 13.2657 7.72002 13.1672C7.7803 13.1373 7.84434 13.1239 7.90705 13.1253C7.84441 13.1239 7.78045 13.1374 7.72024 13.1672C7.52335 13.2657 7.44397 13.505 7.54203 13.7019C7.56283 13.7431 8.05195 14.6981 9.06061 14.7186Z",fill:"#3E3F58"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.8 2.3999C19.9144 2.3999 20.0071 2.49262 20.0071 2.60698V3.99282H21.3929C21.5073 3.99282 21.6 4.08554 21.6 4.1999C21.6 4.31427 21.5073 4.40698 21.3929 4.40698H20.0071V5.79282C20.0071 5.90719 19.9144 5.9999 19.8 5.9999C19.6856 5.9999 19.5929 5.90719 19.5929 5.79282V4.40698H18.2071C18.0927 4.40698 18 4.31427 18 4.1999C18 4.08554 18.0927 3.99282 18.2071 3.99282H19.5929V2.60698C19.5929 2.49262 19.6856 2.3999 19.8 2.3999Z",fill:"#3E3F58"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.2929 2.60718C19.2929 2.32712 19.5199 2.1001 19.8 2.1001C20.08 2.1001 20.307 2.32712 20.307 2.60718V3.69302H21.3929C21.6729 3.69302 21.9 3.92005 21.9 4.2001C21.9 4.48015 21.6729 4.70718 21.3929 4.70718H20.307V5.79302C20.307 6.07307 20.08 6.3001 19.8 6.3001C19.5199 6.3001 19.2929 6.07307 19.2929 5.79302V4.70718H18.207C17.927 4.70718 17.7 4.48015 17.7 4.2001C17.7 3.92005 17.927 3.69302 18.207 3.69302H19.2929V2.60718Z",fill:"#3E3F58"}))},r.createElement(y.M,{type:"bodytext-2",color:C.r.mbColors.gray},s("childCard.menu.add"))),r.createElement(Menu.Item,{onClick:n,icon:r.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6094 2.61873C11.0508 2.44123 11.5233 2.3501 12 2.3501C12.4767 2.3501 12.9491 2.44123 13.3905 2.61873C13.832 2.79625 14.2343 3.05692 14.5741 3.38678C14.9139 3.71668 15.1845 4.10937 15.3695 4.54295C15.4685 4.77508 15.5419 5.01633 15.5887 5.2626H16.9895C18.4406 5.2626 19.65 6.40947 19.65 7.86442V8.01078C19.65 8.89985 19.1605 9.68128 18.4237 10.1037C18.884 10.8243 19.2029 11.64 19.3437 12.5139L19.3813 12.7472C19.5681 13.9067 19.4973 15.0915 19.1738 16.2218L19.0562 16.6329C18.3288 19.1745 16.1665 21.0699 13.5141 21.522C12.5123 21.6928 11.4876 21.6928 10.4858 21.522C7.83339 21.0699 5.67109 19.1745 4.94377 16.6329L4.82611 16.2218C4.50265 15.0915 4.43185 13.9067 4.61867 12.7472L4.65627 12.5139C4.79707 11.64 5.11599 10.8243 5.57625 10.1037C4.83944 9.68128 4.34998 8.89985 4.34998 8.01078V7.86442C4.34998 6.40947 5.55937 5.2626 7.01043 5.2626H8.41124C8.45805 5.01633 8.53144 4.77508 8.63048 4.54295C8.81547 4.10937 9.08608 3.71668 9.42589 3.38678C9.76565 3.05692 10.168 2.79625 10.6094 2.61873ZM9.74907 5.2626L14.2509 5.2626C14.2288 5.19175 14.2031 5.12183 14.1738 5.05312C14.0572 4.77998 13.8859 4.53053 13.6685 4.31952C13.4511 4.10848 13.192 3.94008 12.9055 3.82486C12.619 3.70963 12.3112 3.6501 12 3.6501C11.6887 3.6501 11.381 3.70963 11.0944 3.82486C10.8079 3.94008 10.5488 4.10848 10.3314 4.31952C10.1141 4.53053 9.94273 4.77998 9.8262 5.05311C9.79688 5.12183 9.77115 5.19175 9.74907 5.2626ZM7.01043 6.5626C6.2408 6.5626 5.64998 7.16345 5.64998 7.86442V8.01078C5.64998 8.53694 6.03782 9.01141 6.60612 9.11574C6.65027 9.12384 6.69443 9.13185 6.73861 9.13975C6.73934 9.13988 6.74007 9.14001 6.7408 9.14014C6.9188 9.17198 7.09704 9.20218 7.27549 9.23076C10.5824 9.76029 13.9603 9.73008 17.2592 9.14014C17.2597 9.14004 17.2603 9.13994 17.2608 9.13984C17.3052 9.13191 17.3495 9.12388 17.3938 9.11574C17.9621 9.01141 18.35 8.53694 18.35 8.01078V7.86442C18.35 7.16345 17.7591 6.5626 16.9895 6.5626H7.01043ZM6.89224 10.4854C6.40537 11.1346 6.07257 11.8962 5.93971 12.7207L5.90212 12.954C5.74569 13.9249 5.80489 14.917 6.07594 15.8642L6.19359 16.2753C6.77869 18.3198 8.5277 19.8695 10.7042 20.2405C11.5615 20.3866 12.4385 20.3866 13.2957 20.2405C15.4722 19.8695 17.2212 18.3198 17.8063 16.2753L17.924 15.8642C18.1951 14.917 18.2543 13.9249 18.0978 12.954L18.0602 12.7207C17.9274 11.8962 17.5946 11.1346 17.1077 10.4854C17.0485 10.4953 16.9893 10.5049 16.93 10.5144C13.6061 11.0467 10.2137 11.037 6.89224 10.4854ZM9.34998 16.5918V12.7084C9.34998 12.3495 9.64099 12.0584 9.99998 12.0584C10.359 12.0584 10.65 12.3495 10.65 12.7084V16.5918C10.65 16.9508 10.359 17.2418 9.99998 17.2418C9.64099 17.2418 9.34998 16.9508 9.34998 16.5918ZM14 12.0584C14.359 12.0584 14.65 12.3495 14.65 12.7084V16.5918C14.65 16.9508 14.359 17.2418 14 17.2418C13.641 17.2418 13.35 16.9508 13.35 16.5918V12.7084C13.35 12.3495 13.641 12.0584 14 12.0584Z",fill:"#3E3F58"}))},r.createElement(y.M,{type:"bodytext-2",color:C.r.mbColors.red},s("childCard.menu.remove",{name:e})))):r.createElement(et,{width:250},r.createElement(Menu.Item,{onClick:a,icon:r.createElement("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none"},r.createElement("path",{d:"M12.7812 1.83301C12.2987 1.83301 11.8162 2.01676 11.4479 2.38509L10.6667 3.16634L13.3333 5.83301L14.1146 5.05176C14.8506 4.31576 14.8506 3.12176 14.1146 2.38509C13.7463 2.01676 13.2638 1.83301 12.7812 1.83301ZM9.66667 4.16634L2 11.833V14.4997H4.66667L12.3333 6.83301L9.66667 4.16634Z",fill:"#595959"}))},r.createElement(O.T,{size:"p2",color:C.r.colors.gray800},s("childCard.menu.edit",{name:e}))),r.createElement(Menu.Item,{onClick:i,icon:r.createElement("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none"},r.createElement("path",{d:"M8 2.5C4.9478 2.5 2.4204 4.79359 2.05078 7.7513C2.03763 7.83928 2.04222 7.929 2.06428 8.01518C2.08634 8.10136 2.12542 8.18226 2.17922 8.2531C2.23303 8.32394 2.30046 8.3833 2.37756 8.42768C2.45465 8.47206 2.53985 8.50057 2.62813 8.51152C2.71642 8.52247 2.806 8.51564 2.8916 8.49143C2.9772 8.46723 3.05709 8.42614 3.12657 8.37059C3.19605 8.31503 3.2537 8.24613 3.29615 8.16795C3.33859 8.08978 3.36496 8.00389 3.3737 7.91536C3.66141 5.61307 5.61354 3.83333 8 3.83333C9.34288 3.83333 10.5434 4.39987 11.3919 5.30339L10.0977 6.59766C9.96766 6.72766 9.96766 6.93901 10.0977 7.06901C10.1623 7.13434 10.248 7.16667 10.3333 7.16667H13.3333C13.5101 7.16667 13.6797 7.09643 13.8047 6.9714C13.9298 6.84638 14 6.67681 14 6.5V3.5C14 3.41467 13.967 3.32966 13.9023 3.26432C13.7723 3.13432 13.561 3.13432 13.431 3.26432L12.3359 4.35938C11.2437 3.21415 9.7037 2.5 8 2.5ZM13.2943 8.49089C13.1292 8.48959 12.9695 8.54959 12.8461 8.65928C12.7227 8.76896 12.6444 8.92053 12.6263 9.08464C12.3386 11.3869 10.3865 13.1667 8 13.1667C6.65713 13.1667 5.45884 12.5994 4.60938 11.6953L5.90234 10.4023C6.03234 10.2723 6.03234 10.061 5.90234 9.93099C5.83768 9.86566 5.752 9.83333 5.66667 9.83333H2.66667C2.48986 9.83333 2.32029 9.90357 2.19526 10.0286C2.07024 10.1536 2 10.3232 2 10.5V13.5C2 13.5853 2.03299 13.6703 2.09766 13.7357C2.22766 13.8657 2.43901 13.8657 2.56901 13.7357L3.66536 12.6393C4.75711 13.7836 6.29696 14.5 8 14.5C11.0522 14.5 13.5796 12.2064 13.9492 9.2487C13.9622 9.1548 13.955 9.05922 13.928 8.96833C13.9011 8.87745 13.8552 8.79334 13.7932 8.72163C13.7312 8.64991 13.6546 8.59224 13.5686 8.55245C13.4826 8.51266 13.3891 8.49167 13.2943 8.49089Z",fill:"#595959"}))},r.createElement(O.T,{size:"p2",color:C.r.colors.gray800},s("childCard.menu.switch"))),r.createElement(Menu.Item,{onClick:o,icon:r.createElement("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none"},r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9564 8.56545C15.7745 7.46727 14.9673 6.57273 13.9127 6.26C13.5273 5.44545 12.9818 4.73273 12.32 4.14364C11.1709 3.11818 9.65818 2.5 8 2.5C6.34182 2.5 4.82909 3.11818 3.68 4.14364C3.01091 4.73273 2.46545 5.45273 2.08727 6.26C1.03273 6.57273 0.225455 7.46 0.0436364 8.56545C0.0145455 8.71818 0 8.87818 0 9.04545C0 9.21273 0.0145455 9.37273 0.0436364 9.52545C0.225455 10.6236 1.03273 11.5182 2.08727 11.8309C2.46545 12.6382 3.01091 13.3509 3.66545 13.9327C4.81455 14.9655 6.33455 15.5909 8 15.5909C9.66545 15.5909 11.1855 14.9655 12.3418 13.9327C12.9964 13.3509 13.5418 12.6309 13.92 11.8309C14.9673 11.5182 15.7745 10.6309 15.9564 9.52545C15.9855 9.37273 16 9.21273 16 9.04545C16 8.87818 15.9855 8.71818 15.9564 8.56545ZM6.18182 7.04545C5.67974 7.04545 5.27273 7.45247 5.27273 7.95455C5.27273 8.45662 5.67974 8.86364 6.18182 8.86364C6.6839 8.86364 7.09091 8.45662 7.09091 7.95455C7.09091 7.45247 6.6839 7.04545 6.18182 7.04545ZM9.81818 7.04545C9.3161 7.04545 8.90909 7.45247 8.90909 7.95455C8.90909 8.45662 9.3161 8.86364 9.81818 8.86364C10.3203 8.86364 10.7273 8.45662 10.7273 7.95455C10.7273 7.45247 10.3203 7.04545 9.81818 7.04545ZM5.01821 10.5H10.9818C11.1128 10.5 11.2073 10.6455 11.1491 10.7691C10.5455 11.9109 9.36002 12.6818 8.00002 12.6818C6.64002 12.6818 5.45457 11.9109 4.85093 10.7691C4.78548 10.6455 4.88002 10.5 5.01821 10.5ZM12.9538 10.4875C12.9991 10.4938 13.0435 10.5 13.0909 10.5C13.8909 10.5 14.5455 9.84545 14.5455 9.04545C14.5455 8.24545 13.8909 7.59091 13.0909 7.59091C13.0435 7.59091 12.9991 7.5971 12.9538 7.60343C12.9297 7.60679 12.9053 7.6102 12.88 7.61273C12.7345 7.12545 12.5236 6.67455 12.2545 6.26C11.3455 4.87091 9.78182 3.95455 8 3.95455C6.21818 3.95455 4.65455 4.87091 3.74545 6.26C3.47636 6.67455 3.26545 7.12545 3.12 7.61273C3.09473 7.6102 3.07033 7.60679 3.0462 7.60343C3.0009 7.5971 2.95654 7.59091 2.90909 7.59091C2.10909 7.59091 1.45455 8.24545 1.45455 9.04545C1.45455 9.84545 2.10909 10.5 2.90909 10.5C2.95654 10.5 3.0009 10.4938 3.0462 10.4875C3.07033 10.4841 3.09473 10.4807 3.12 10.4782C3.26545 10.9655 3.47636 11.4164 3.74545 11.8309C4.65455 13.22 6.21818 14.1364 8 14.1364C9.78182 14.1364 11.3455 13.22 12.2545 11.8309C12.5236 11.4164 12.7345 10.9655 12.88 10.4782C12.9053 10.4807 12.9297 10.4841 12.9538 10.4875Z",fill:"#595959"}),r.createElement("path",{d:"M2.5 2V1C2.5 0.725 2.275 0.5 2 0.5C1.725 0.5 1.5 0.725 1.5 1V2H0.5C0.225 2 0 2.225 0 2.5C0 2.775 0.225 3 0.5 3H1.5V4C1.5 4.275 1.725 4.5 2 4.5C2.275 4.5 2.5 4.275 2.5 4V3H3.5C3.775 3 4 2.775 4 2.5C4 2.225 3.775 2 3.5 2H2.5Z",fill:"#595959"}))},r.createElement(O.T,{size:"p2",color:C.r.colors.gray800},s("childCard.menu.add"))),r.createElement(Menu.Item,{onClick:n,icon:r.createElement("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none"},r.createElement("path",{d:"M6.66699 1.83301L6.00033 2.49967H3.33366C2.93366 2.49967 2.66699 2.76634 2.66699 3.16634C2.66699 3.56634 2.93366 3.83301 3.33366 3.83301H4.66699H11.3337H12.667C13.067 3.83301 13.3337 3.56634 13.3337 3.16634C13.3337 2.76634 13.067 2.49967 12.667 2.49967H10.0003L9.33366 1.83301H6.66699ZM3.33366 5.16634V13.833C3.33366 14.5663 3.93366 15.1663 4.66699 15.1663H11.3337C12.067 15.1663 12.667 14.5663 12.667 13.833V5.16634H3.33366ZM6.00033 6.49967C6.40033 6.49967 6.66699 6.76634 6.66699 7.16634V13.1663C6.66699 13.5663 6.40033 13.833 6.00033 13.833C5.60033 13.833 5.33366 13.5663 5.33366 13.1663V7.16634C5.33366 6.76634 5.60033 6.49967 6.00033 6.49967ZM10.0003 6.49967C10.4003 6.49967 10.667 6.76634 10.667 7.16634V13.1663C10.667 13.5663 10.4003 13.833 10.0003 13.833C9.60033 13.833 9.33366 13.5663 9.33366 13.1663V7.16634C9.33366 6.76634 9.60033 6.49967 10.0003 6.49967Z",fill:"#F44D2C"}))},r.createElement(O.T,{size:"p2",color:C.r.colors.red600},s("childCard.menu.remove",{name:e})))))},renderChildAge=(e,t)=>{if(e){if(e.year<1){if(0===e.month)switch(e.week){case 0:case 1:return t("childCard.age.oneWeek");default:return t("childCard.age.week",{weeks:e.week})}if(1===e.month)return t("childCard.age.oneMonth");if(e.month>1)return t("childCard.age.months",{month:e.month})}else{if(1===e.year)return t("childCard.age.months",{month:12*e.year+e.month});if(0===e.month)return t("childCard.age.yearNoMonth",{year:e.year});if(e.month>0)return t("childCard.age.yearMonth",{year:e.year,month:e.month})}}},ChildCard=({name:e,gender:t,age:a,isLoggedIn:i=!1,showMenu:o=!1,onEdit:s,onSwitch:E,onAdd:x,onRemove:S,className:w,siteType:I})=>{let{t:M}=(0,g.u)(),[O,T]=(0,r.useState)(!1);return r.createElement(J,{className:w,"data-theme":I},"marryBaby"===I?r.createElement(r.Fragment,null,r.createElement("div",{"data-testid":"gender"},t===b.G.Boy?r.createElement(c.Z,{"data-testid":"boy",id:"boy",size:48}):r.createElement(d.Z,{"data-testid":"girl",id:"girl",size:48})),r.createElement("div",{className:"information"},r.createElement(y.M,{type:"subtitle-1",color:C.r.mbColors.dark},(0,v.s)(e)||M("childCard.noName")),r.createElement("div",{className:"detail"},r.createElement("div",null,t===b.G.Boy?r.createElement(u.Z,{size:14}):r.createElement(p.Z,{size:14}),r.createElement(y.M,{type:"bodytext-2",color:C.r.mbColors.gray},M(t===b.G.Girl?"childCard.girl":"childCard.boy"))),r.createElement("div",null,r.createElement(h.Z,{size:20}),a&&r.createElement(y.M,{type:"bodytext-2",color:C.r.mbColors.gray},renderChildAge(a,M)))))):r.createElement(r.Fragment,null,r.createElement("div",{"data-testid":"gender"},t===b.G.Boy?r.createElement(n.Z,{"data-testid":"boy",id:"boy"}):r.createElement(l.Z,{"data-testid":"girl",id:"girl"})),r.createElement("div",{className:"information"},r.createElement(L.H,{tag:"h5",fontWeight:"bold",color:C.r.colors.gray800},(0,v.s)(e)||M("childCard.noName")),r.createElement("div",{className:"detail"},r.createElement("div",null,t===b.G.Boy?r.createElement(u.Z,null):r.createElement(p.Z,null),r.createElement(f.T,{size:"p3",color:C.r.colors.gray800,style:{textTransform:"capitalize"}},M(t===b.G.Girl?"childCard.girl":"childCard.boy"))),r.createElement("div",null,r.createElement(m.Z,{size:16}),a&&r.createElement(f.T,{size:"p3",color:C.r.colors.gray800},renderChildAge(a,M)))))),o&&i&&r.createElement(ee,null,r.createElement(k.Z,{onClick:()=>T(e=>!e)}),O&&r.createElement(ChildCardMenu,{siteType:I,name:e,onClose:()=>T(!1),onEdit:()=>{T(!1),s()},onSwitch:()=>{T(!1),E()},onAdd:()=>{T(!1),x()},onRemove:()=>{T(!1),S()}})))},ea=(0,E.Z)(T.D)` .add-profile-container { display: flex; flex-direction: column; gap: 24px; } .profile-container { display: flex; flex-direction: column; gap: 8px; } .button-group { display: flex; flex-direction: column; gap: 8px; button { width: 100%; } } `,ei=(0,E.Z)(R.M)` .hhg-modal { min-width: 570px; } .title { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid ${C.r.colors.neutral100}; } .close-button { margin-left: auto; } .profile-container { padding-block: 16px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid ${C.r.colors.neutral100}; max-height: 300px; overflow-y: auto; } .button-group { display: flex; justify-content: center; width: 100%; gap: 16px; margin-block: 16px; button { width: 100%; } } `,eo="300ms",er=E.Z.div` background: ${C.r.colors.gray50}; border-radius: ${C.r.borderRadius}; padding: 16px 20px; @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } .title { display: flex; justify-content: space-between; align-items: center; padding: 0; padding-bottom: 16px; border-bottom: none; } &[data-is-mb='true'] { background: #ffffff; border: 1px solid #e0e9fb; border-radius: 16px; input { border-radius: 16px; } } &[data-isActive='true'] { border: 1px solid #2661ad; } &[data-is-mb='false'] .radio { cursor: pointer; position: relative; min-width: 22px; width: 22px; height: 22px; background: #ffffff; border: 2px solid ${C.r.colors.gray600}; border-radius: 50%; transition: all ${eo} ease-in-out; &.active { border-color: ${C.r.colors.primaryBase}; &::before { content: ''; position: absolute; inset: 0; width: 100%; height: 100%; background-color: ${C.r.colors.primaryBase}; background-clip: content-box; padding: 5px; border-radius: 50%; animation: fadeIn ${eo} ease-in-out forwards; } } } &[data-is-mb='true'] .radio { cursor: pointer; position: relative; min-width: 22px; width: 22px; height: 22px; background: #ffffff; border: 1.3px solid #9495a0; border-radius: 10px; transition: all ${eo} ease-in-out; &.active { border: none; &::before { content: ''; position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border-radius: 10px; animation: fadeIn ${eo} ease-in-out forwards; } } } `,NewBabyProfileRadio=({isActive:e,onChange:t,value:a="",onInputChange:i,siteType:o})=>{let{t:n}=(0,g.u)(),l="marryBaby"===o;return r.createElement(er,{onClick:()=>t("new"),"data-is-mb":l,"data-isActive":l&&e},"marryBaby"===o?r.createElement("div",{className:"title"},r.createElement(y.M,{type:"bodytext-1",color:C.r.colors.gray800},n("chooseBaby.new")),r.createElement("div",{className:e?"radio active":"radio"},e&&r.createElement(s.Z,{size:26}))):r.createElement("div",{className:"title"},r.createElement(f.T,{size:"p2",color:C.r.colors.gray800},n("chooseBaby.new")),r.createElement("div",{className:e?"radio active":"radio"})),r.createElement(P.I,{name:"name",value:a,size:"md",placeholder:n("chooseBaby.placeholder"),type:"text",onChange:i}))},BabyGrowthChooseProfileDrawer=e=>{var t,a,{babyProfiles:i,currentProfileId:o,onClose:n,onCreate:l,onAddMeasurement:s,onSwitchProfile:c,open:d,isMobile:u,isMyProfile:p=!1,buttonGroup:h,newBabyValue:m,onNewBabyValueChange:b,siteType:f,buttonText:E,headerText:v}=e,x=(0,I._)(e,["babyProfiles","currentProfileId","onClose","onCreate","onAddMeasurement","onSwitchProfile","open","isMobile","isMyProfile","buttonGroup","newBabyValue","onNewBabyValueChange","siteType","buttonText","headerText"]);let renderButton=e=>p?r.createElement(r.Fragment,null,r.createElement(w.B,{theme:f,onClick:()=>{null==l||l(),n()},size:"lg",color:"secondary",icon:r.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},r.createElement("path",{d:"M13.5 9.75H9.75V13.5C9.75 13.9125 9.4125 14.25 9 14.25C8.5875 14.25 8.25 13.9125 8.25 13.5V9.75H4.5C4.0875 9.75 3.75 9.4125 3.75 9C3.75 8.5875 4.0875 8.25 4.5 8.25H8.25V4.5C8.25 4.0875 8.5875 3.75 9 3.75C9.4125 3.75 9.75 4.0875 9.75 4.5V8.25H13.5C13.9125 8.25 14.25 8.5875 14.25 9C14.25 9.4125 13.9125 9.75 13.5 9.75Z",fill:"#2D87F3"}))},L("babyGrowth.drawer.createBaby")),r.createElement(w.B,{theme:f,size:"lg",color:"primary",onClick:()=>{null==e||e(),p?null==c||c(S):null==s||s(S),n()}},p?L("babyGrowth.drawer.switchProfile"):L("babyGrowth.drawer.addMeasurement"))):r.createElement(w.B,{theme:f,size:"lg",color:"primary",onClick:()=>{null==s||s(S),null==e||e(),n()}},E||L("chooseBaby.button")),[S,k]=(0,r.useState)(String(o)||String(null===(t=i[0])||void 0===t?void 0:t.id)),{t:L}=(0,g.u)();return u?r.createElement(ea,Object.assign({title:v||"Baby profiles",onClose:n,open:d,placement:"bottom"},x),({internalClose:e})=>{var t;return r.createElement("div",{className:"add-profile-container"},r.createElement("div",{className:"profile-container"},null===(t=i||[])||void 0===t?void 0:t.map(e=>r.createElement(BabyGrowthProfileRadio,{siteType:f,key:e.id,profile:e,isActive:S===String(e.id),onChange:k})),!p&&r.createElement(NewBabyProfileRadio,{siteType:f,value:m,onInputChange:b,isActive:"new"===S,onChange:k})),r.createElement("div",{className:"button-group"},h||renderButton(e)))}):r.createElement(ei,{type:"confirm",isOpen:d,onClose:n,siteType:f},r.createElement("div",{className:"header"},r.createElement("div",{className:"title"},"marryBaby"===f?r.createElement(y.M,{type:"subtitle-1",color:C.r.mbColors.dark},L("chooseBaby.title")):r.createElement(O.T,{size:"s2",type:"semiBold"},v||L("chooseBaby.title")),r.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"close-button",onClick:n},r.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"})))),r.createElement("div",{className:"profile-container"},null===(a=i||[])||void 0===a?void 0:a.map(e=>r.createElement(BabyGrowthProfileRadio,{key:e.id,profile:e,isActive:S===String(e.id),onChange:k,siteType:f})),!p&&r.createElement(NewBabyProfileRadio,{value:m,onInputChange:b,isActive:"new"===S,onChange:k,siteType:f})),r.createElement("div",{className:"button-group"},h||renderButton()))},en={[b.G.Boy]:{[b.B.Height]:{[b.a.Weekly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"kQ64")),[b.a.Monthly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"T9QC")),[b.a.Yearly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"nyT8"))},[b.B.Weight]:{[b.a.Weekly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"UZ9M")),[b.a.Monthly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"Y3CY")),[b.a.Yearly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"9iJj"))},[b.B.Head]:{[b.a.Weekly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"vy2T")),[b.a.Monthly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"r2dd")),[b.a.Yearly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"MffN"))},[b.B.BMI]:{[b.a.Weekly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"Mb1H")),[b.a.Monthly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"vf2b")),[b.a.Yearly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"sE+4"))}},[b.G.Girl]:{[b.B.Height]:{[b.a.Weekly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"6AOt")),[b.a.Monthly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"7ycK")),[b.a.Yearly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"ZjYC"))},[b.B.Weight]:{[b.a.Weekly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"4h6r")),[b.a.Monthly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"a/cb")),[b.a.Yearly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"fsfn"))},[b.B.Head]:{[b.a.Weekly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"Tk6k")),[b.a.Monthly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"unBd")),[b.a.Yearly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"o/SI"))},[b.B.BMI]:{[b.a.Weekly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"bb1o")),[b.a.Monthly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"R1+n")),[b.a.Yearly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"M/3b"))}}},el={[b.G.Boy]:{[b.B.Height]:{[b.a.Weekly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"2kjy")),[b.a.Monthly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"CGm0")),[b.a.Yearly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"eeWn"))},[b.B.Weight]:{[b.a.Weekly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"HRtN")),[b.a.Monthly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"AQbf")),[b.a.Yearly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"cr01"))},[b.B.Head]:{[b.a.Weekly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"SALE")),[b.a.Monthly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"SOih")),[b.a.Yearly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"NV3Y"))},[b.B.BMI]:{[b.a.Weekly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"GfLz")),[b.a.Monthly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"0A/C")),[b.a.Yearly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"qZwT"))}},[b.G.Girl]:{[b.B.Height]:{[b.a.Weekly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"UwaQ")),[b.a.Monthly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"TCa0")),[b.a.Yearly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"iSIZ"))},[b.B.Weight]:{[b.a.Weekly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"NVIe")),[b.a.Monthly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"Tgc4")),[b.a.Yearly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"itzo"))},[b.B.Head]:{[b.a.Weekly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"KYzx")),[b.a.Monthly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"P6oy")),[b.a.Yearly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"8iKa"))},[b.B.BMI]:{[b.a.Weekly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"suNT")),[b.a.Monthly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"b+TJ")),[b.a.Yearly]:()=>Promise.all([a.e(5231),a.e(5329),a.e(9226),a.e(5481),a.e(141),a.e(2391),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(3097),a.e(6088),a.e(4584),a.e(8674),a.e(9353),a.e(7730),a.e(3929),a.e(7884),a.e(137),a.e(4414),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413)]).then(a.bind(a,"ffzP"))}}},generateGrowthChart=(e,t,a,i)=>i===S.L.Indonesia?el[e][t][a]():en[e][t][a](),divideChartData=(e,t)=>{let[a,i]=H()(t,Math.ceil(t.length/2)),o=a.map(e=>e.name),r=i.map(e=>e.name);return o.includes(e)?{data:a,status:"first-half"}:r.includes(e)?{data:i,status:"second-half"}:{data:t,status:"full"}},refineDataWithLine=(e,t)=>[...e,...t.map(e=>({name:e.name,history:e.history,risk:e.risk,toolTipLabel:e.toolTipLabel}))].sort((e,t)=>e.name-t.name),refineDataWithDot=(e,t,a,i,o)=>[...e,{name:i,history:o,risk:t,toolTipLabel:a}].sort((e,t)=>e.name-t.name),transformDataToChart=(e,t=0)=>{let a=[];for(let i in e){let o=e[i];o.forEach((e,o)=>{a[o]?a[o][i]=e:a[o]={name:o+t,[i]:e}})}return a},generateXAxisTicks=(e,t=0)=>Array.from({length:e-t+1},(e,a)=>a+t),es=E.Z.div` position: relative; .custom-chart-label { display: flex; width: 100%; justify-content: space-between; align-items: center; margin-top: 8px; } `,ec=[{name:"-3SD",label:"-3",color:C.r.colors.red600},{name:"-2SD",label:"-2",color:C.r.colors.yellow600},{name:"0Median",label:"0",color:C.r.colors.green600},{name:"2SD",label:"2",color:C.r.colors.yellow600},{name:"3SD",label:"3",color:C.r.colors.red600},{name:"history",color:C.r.colors.primaryBase}],ed=[{name:"3rd",color:C.r.colors.red600},{name:"15th",color:C.r.colors.yellow600},{name:"50th",color:C.r.colors.green600},{name:"85th",color:C.r.colors.yellow600},{name:"97th",color:C.r.colors.red600},{name:"history",color:C.r.colors.primaryBase}],CustomLineLabel=e=>{let{x:t,y:a,last:i,index:o,name:n}=e;return i===o?r.createElement("text",{x:t,y:a,dx:16,fill:C.r.colors.gray500,fontSize:12,textAnchor:"middle"},n):null},BabyGrowthChart=({gender:e,type:t,duration:a,xLabel:i,x:o,y:n,toolTipLabel:l=[],isDivide:s=!0,onIsPrevious:c,locale:d,riskLevel:u,withLine:p=!1,lineData:h=[]})=>{let[m,y]=(0,r.useState)([]),E=(0,r.useRef)([]),{t:v}=(0,g.u)();(0,r.useEffect)(()=>{(0,I.a)(void 0,void 0,void 0,function*(){let i=(yield generateGrowthChart(e,t,a,d)).default,r=a===b.a.Weekly?0:1,n=transformDataToChart(i,r);if(Array.isArray(n)&&0===n.length){null==c||c();return}let l={data:n.map((e,t)=>Object.assign(Object.assign({},e),{name:t})),status:"full"};try{l=s?divideChartData(o||r,n):{data:n,status:"full"}}catch(e){}if(s)switch(l.status){case"first-half":E.current=generateXAxisTicks(l.data.length-1+r,r);break;case"second-half":E.current=generateXAxisTicks(i.length,l.data.length);break;default:E.current=generateXAxisTicks(n.length-1+r,r)}else E.current=generateXAxisTicks(n.length-1+r,r);y(l.data)})},[e,t,a,d,c]);let[x,w]=(0,r.useState)(!1),k=(0,r.useMemo)(()=>p&&Array.isArray(m)&&m.length>0?refineDataWithLine(m,h):refineDataWithDot(m,u,l,o,n),[p,h,m]),L=(0,r.useRef)(null);return(0,M.a)(L,()=>w(!1)),r.createElement(es,null,r.createElement("div",{className:"custom-chart-label"},r.createElement(f.T,{size:"n1",color:C.r.colors.gray500},(()=>{switch(t){case b.B.Weight:return v("babyGrowth.weight");case b.B.Height:return v("babyGrowth.height");case b.B.Head:return v("babyGrowth.headCircumference");case b.B.BMI:return"BMI";default:return""}})()),r.createElement(f.T,{size:"n1",color:C.r.colors.gray500},d===S.L.Indonesia?"Z-Score":v("babyGrowth.percentiles"))),Array.isArray(k)&&k.length>0&&r.createElement(j.h,{height:388,className:"chart"},r.createElement(B.w,{data:k,margin:{top:16,right:28,bottom:8,left:0}},r.createElement(A.q,{stroke:C.r.colors.neutral100}),r.createElement(F.u,{trigger:"click",content:e=>r.createElement(BabyGrowthTooltip,Object.assign({active:!p&&x&&void 0!==o&&void 0!==n,locale:d},e))}),r.createElement($.K,{type:"number",scale:"linear",ticks:E.current,dataKey:"name",tickLine:!1,tickMargin:12,tick:{fontFamily:"Inter",fontWeight:400,fontSize:12,color:C.r.colors.gray800},domain:["dataMin","dataMax"],interval:"preserveStartEnd",tickCount:1,tickFormatter:e=>String(Math.round((e+Number.EPSILON)*100)/100),allowDecimals:!0}),r.createElement(N.B,{domain:[e=>Math.min(e,n||e),e=>Math.max(e,n||e)],tickLine:!1,tickMargin:7,width:45,tickCount:10,allowDecimals:!0,tickFormatter:e=>String(Math.round((e+Number.EPSILON)*100)/100),tick:{fontFamily:"Inter",fontWeight:400,fontSize:12,color:C.r.colors.gray800}}),(d===S.L.Indonesia?ec:ed).map((e,t)=>r.createElement(r.Fragment,null,"history"===e.name?r.createElement(Z.x,{key:t,connectNulls:!0,type:"linear",dataKey:"history",stroke:e.color,strokeWidth:2,dot:{stroke:e.color,fill:e.color,strokeWidth:1,r:4,strokeDasharray:""},activeDot:!0,color:e.color}):r.createElement(Z.x,{key:e.name,type:"linear",dataKey:e.name,stroke:e.color,dot:!1,activeDot:!1,connectNulls:!0,label:r.createElement(CustomLineLabel,{last:(null==k?void 0:k.length)?k.length-1:0,name:(null==e?void 0:e.label)||e.name}),tooltipType:"none"}))),void 0!==o&&void 0!==n&&r.createElement(D.q,{onClick:()=>w(!0),x:0===o?1:o,y:n,r:4,shape:r.createElement(z.C,{ref:L,r:4}),fill:C.r.colors.primaryBase,stroke:C.r.colors.primaryBase}))),r.createElement("div",{className:"custom-chart-label"},r.createElement("i",null),r.createElement(f.T,{size:"n1",color:C.r.colors.gray500},i)))}},"0Tio":function(e,t,a){a.d(t,{J:function(){return BookingSearchBar}});var i,o,r=a("ySIk"),n=a("q1tI"),l=a("AeFk"),s=a("3M3N"),c=a("ybaB"),d=a("sEfC"),u=a.n(d),p=a("hQ98"),h=a("rBCA"),m=a("OrYH"),g=a("Ag88"),b=a("iBNF"),y=a("9WAK"),f=a.n(y),C=a("4MMi"),E=a("SPEo"),v=a("ECoa"),x=a("q1uw");a("gY0P");let S=h.Z.div``,w=h.Z.div` --searchbar-z-index: 305; &[data-is-modal='true'] { position: fixed; left: 0; right: 0; top: 0; height: var(--mobile-care-searchbar-height, 100%); overflow-y: auto; -webkit-overflow-scrolling: touch; background-color: white; z-index: var(--searchbar-z-index); } `,k=h.Z.section``,L=h.Z.input` position: fixed; left: -100%; top: -100%; `,I=(0,h.Z)(m.I)` #booking-search-bar & { input { font-size: 16px; } } `,LocationResults=({cities:e,isLoading:t,onLocationClick:a,selectedLocation:i})=>{let{t:o,locale:r}=(0,c.u)();return n.createElement(s.S,{"data-testid":"location-search-results"},n.createElement(s.a,null,t?n.createElement(s.b,{count:5}):!e||e.length<1?n.createElement(n.Fragment,null,n.createElement(s.c,{"data-is-denied":"true"},n.createElement(g.T,{size:"sm",color:"#ccc"},o("booking.searchBar.noResults")))):n.createElement(n.Fragment,null,n.createElement(s.c,{key:"all-location",role:"button",tabIndex:0,onClick:()=>{var e;a&&a({name:o("booking.searchBar.allLocations"),id:p.I,slug:null===(e=p.L[r])||void 0===e?void 0:e.ALL})}},n.createElement(s.d,{color:b.r.colors.neutral400}),n.createElement(g.T,{size:"md"},o("booking.searchBar.allLocations"))),e.map(e=>n.createElement(s.c,{key:e.id,onClick:t=>{t.nativeEvent.stopImmediatePropagation(),a&&a(e)},role:"button",tabIndex:0,"aria-label":`Select ${e.name} as location`,isSelected:(null==i?void 0:i.id)===e.id},n.createElement(s.d,{color:b.r.colors.neutral400}),n.createElement(g.T,{size:"md"},e.name))))))},M={TYPE_CHARACTER:"TYPE_CHARACTER",REMOVE_CHARACTER:"REMOVE_CHARACTER",REMOVE_ALL:"REMOVE_ALL",REMOVE_LAST_VISIBLE_NODE:"REMOVE_LAST_VISIBLE_NODE",PAUSE_FOR:"PAUSE_FOR",CHANGE_DELETE_SPEED:"CHANGE_DELETE_SPEED",CHANGE_DELAY:"CHANGE_DELAY",PASTE_STRING:"PASTE_STRING"},getRandomInteger=(e,t)=>Math.floor(Math.random()*(t-e+1))+e,O={TEXT_NODE:"TEXT_NODE"};let Typewriter=class Typewriter{constructor(e){this.state={lastFrameTime:null,pauseUntil:null,eventQueue:[],eventLoop:null,eventLoopPaused:!1,reverseCalledEvents:[],calledEvents:[],visibleNodes:[],initialOptions:null},this.options={strings:null,delay:"natural",pauseFor:1500,deleteSpeed:"natural",loop:!1,autoStart:!1,stringSplitter:null,onCreateTextNode:null,onRemoveNode:null},this.start=()=>(this.state.eventLoopPaused=!1,this.runEventLoop(),this),this.pause=()=>(this.state.eventLoopPaused=!0,this),this.stop=()=>(this.state.eventLoop&&(window.cancelAnimationFrame(this.state.eventLoop),this.state.eventLoop=null),this),this.pauseFor=e=>(this.addEventToQueue(M.PAUSE_FOR,{ms:e}),this),this.typeOutAllStrings=()=>("string"==typeof this.options.strings?this.typeString(this.options.strings).pauseFor(this.options.pauseFor):this.options.strings.forEach(e=>{this.typeString(e).pauseFor(this.options.pauseFor).deleteAll(this.options.deleteSpeed)}),this),this.typeString=(e,t=null)=>{if(e){let{stringSplitter:a}=this.options||{},i="function"==typeof a?a(e):e.split("");this.typeCharacters(i,t)}return this},this.pasteString=(e,t=null)=>(e&&this.addEventToQueue(M.PASTE_STRING,{character:e,node:t}),this),this.deleteAll=(e="natural")=>(this.addEventToQueue(M.REMOVE_ALL,{speed:e}),this),this.changeDeleteSpeed=e=>{if(!e)throw Error("Must provide new delete speed");return this.addEventToQueue(M.CHANGE_DELETE_SPEED,{speed:e}),this},this.changeDelay=e=>{if(!e)throw Error("Must provide new delay");return this.addEventToQueue(M.CHANGE_DELAY,{delay:e}),this},this.deleteChars=e=>{if(!e)throw Error("Must provide amount of characters to delete");for(let t=0;t{if(!e||!Array.isArray(e))throw Error("Characters must be an array");return e.forEach(e=>{this.addEventToQueue(M.TYPE_CHARACTER,{character:e,node:t})}),this},this.removeCharacters=e=>{if(!e||!Array.isArray(e))throw Error("Characters must be an array");return e.forEach(()=>{this.addEventToQueue(M.REMOVE_CHARACTER)}),this},this.addEventToQueue=(e,t,a=!1)=>this.addEventToStateProperty(e,t,a,"eventQueue"),this.addReverseCalledEvent=(e,t,a=!1)=>{let{loop:i}=this.options;return i?this.addEventToStateProperty(e,t,a,"reverseCalledEvents"):this},this.addEventToStateProperty=(e,t,a=!1,i)=>{let o={eventName:e,eventArgs:t||{}};return a?this.state[i]=[o,...this.state[i]]:this.state[i]=[...this.state[i],o],this},this.runEventLoop=()=>{this.state.lastFrameTime||(this.state.lastFrameTime=Date.now());let e=Date.now(),t=e-this.state.lastFrameTime;if(!this.state.eventQueue.length){if(!this.options.loop)return;this.state.eventQueue=[...this.state.calledEvents],this.state.calledEvents=[],this.options=Object.assign({},this.state.initialOptions)}if(this.state.eventLoop=window.requestAnimationFrame(this.runEventLoop),this.state.eventLoopPaused)return;if(this.state.pauseUntil){if(e{if(a)return[];let e=["booking.searchBar.placeholder.hospital","booking.searchBar.placeholder.doctor"];return"zh-TW"!==o&&e.push("booking.searchBar.placeholder.specialty","booking.searchBar.placeholder.service"),f()(e).map(e=>i(e))},[i,o]);function customNodeCreator(e){let t=getInput();return t&&(t.placeholder=t.placeholder+e),null}function onRemoveNode(){let e=getInput();e&&(e.placeholder=e.placeholder.slice(0,-1))}function getInput(){return e&&e.current?e.current:t&&t.current&&t.current.querySelector("input")||null}(0,n.useEffect)(()=>{if(a)return;let e=getInput();e&&(e.placeholder="",new Typewriter({strings:r,autoStart:!0,loop:!0,delay:32,deleteSpeed:32,pauseFor:1500,onCreateTextNode:customNodeCreator,onRemoveNode:onRemoveNode}))},[e,t])}let T=h.Z.div` user-select: none; input { pointer-events: none; background-color: white; } `;function MobileFakeInput({focused:e,value:t="",onClick:a,trackingAttributes:i,inputSearchPlaceholder:o}){let{t:r}=(0,c.u)(),l=(0,n.useRef)(null);useAnimatedPlaceholder({wrapperRef:l,disabled:!!o});let d=(0,n.useMemo)(()=>i?{"data-event-category":i.dataEventCategory,"data-event-action":i.dataEventAction,"data-event-label":i.dataEventLabel}:{},[i]);return n.createElement(T,Object.assign({onClick:()=>a&&a(),ref:l},d),n.createElement(I,{inputClassName:"location"===e?"focused":void 0,name:"booking-search-placeholder",displayIcon:n.createElement(s.M,{color:b.r.colors.gray400}),placeholder:r("booking.searchBar.searchInput.placeholder"),value:t,size:"md"}))}let R=h.Z.header` display: flex; height: 64px; align-items: center; justify-content: space-between; margin: 0 auto; position: sticky; z-index: 99; background-color: white; top: 0; left: 0; `,P=h.Z.div` display: inline-flex; flex: 1; justify-content: flex-end; cursor: pointer; text-decoration: underline; `,j=h.Z.div` display: flex; align-items: center; margin-left: 16px; cursor: pointer; `,B=h.Z.div` width: 100%; margin-left: 24px; `,A=(0,h.Z)(g.T)` color: ${b.r.colors.secondaryDark}; text-align: start; `,MobileTopBar=({className:e,onLeftClick:t,headingText:a,onRightClick:i,iconLeft:o,textRight:r})=>n.createElement(R,{className:e},n.createElement(j,{onClick:t},o||n.createElement(s.C,{color:b.r.colors.gray800})),n.createElement(B,null,n.createElement(A,{size:"md",weight:"bold"},a)),n.createElement(P,{onClick:i},r&&n.createElement("p",null,r))),F={"en-PH":3,"tl-PH":2,"id-ID":3,"vi-VN":2,"zh-TW":0,"ms-MY":2,"th-TH":2},$={isMobile:!1,isDebug:!1,navigateTo:null,geoLocationPermission:"unset",geoLocationCoordinates:null,focused:"none",searchLocationKeywords:"",searchKeywords:"",selectedLocation:null,defaultCity:null,initialCities:[],cities:[],searchResults:[],initialSearchResults:[],isLoadingCities:!1,isLoadingSearchResults:!1,isMobileModalOpened:!1,initialSelectedCity:null,autoCompleteDisabled:!1,inputSearchPlaceholder:"",locale:"vi-VN"};function resetSearchLocationKeywords(e){let{selectedLocation:t,searchLocationKeywords:a}=e;return t&&a!==t.name?Object.assign(Object.assign({},e),{searchLocationKeywords:t.name}):e}function reducer(e,t){var a;switch(e.isDebug&&console.log("bookingSearchBar",{action:t,state:e}),t.type){case o.NavigateTo:return Object.assign(Object.assign({},e),{navigateTo:t.payload,focused:"none",isMobileModalOpened:!1});case o.ClickOutsideInputLocation:if(e.isMobile||"location"!==e.focused)return e;return resetSearchLocationKeywords(Object.assign(Object.assign({},e),{focused:"none"}));case o.ClickOutsideInputSearch:if(e.isMobile||"search"!==e.focused)return e;return Object.assign(Object.assign({},e),{focused:"none"});case o.FocusInputLocation:{let t=Object.assign(Object.assign({},e),{focused:"location"});return(null===(a=e.selectedLocation)||void 0===a?void 0:a.id)===p.a&&(t.searchLocationKeywords=""),t}case o.FocusInputSearch:let i=Object.assign(Object.assign({},e),{focused:"search"});if(e.isMobile)return resetSearchLocationKeywords(i);return i;case o.ChangeInputLocation:return Object.assign(Object.assign({},e),{searchLocationKeywords:t.payload});case o.ChangeInputSearch:{let a=t.payload;return Object.assign(Object.assign({},e),{searchKeywords:a,isLoadingSearchResults:a.trim().length>F[e.locale]})}case o.SelectCurrentLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name});case o.ClearInputLocation:return Object.assign(Object.assign({},e),{focused:"location",cities:e.initialCities,searchLocationKeywords:""});case o.ClearInputSearch:return Object.assign(Object.assign({},e),{focused:"search",searchKeywords:""});case o.SelectLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name});case o.SelectSearchResult:return Object.assign(Object.assign({},e),{searchKeywords:t.payload.name,isMobileModalOpened:!1,focused:"none",navigateTo:t.payload.url});case o.FetchCitiesStart:return Object.assign(Object.assign({},e),{isLoadingCities:!0});case o.FetchCitiesFinish:return Object.assign(Object.assign({},e),{isLoadingCities:!1});case o.FetchSearchResultsStart:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!0});case o.FetchSearchResultsFinish:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!1});case o.FetchSearchResultsComplete:{let a=Object.assign(Object.assign({},e),{searchResults:t.payload});return 0===e.initialSearchResults.length&&(a.initialSearchResults=t.payload),a}case o.FetchCitiesByGeoIpComplete:{let{cities:a}=t.payload,{default:i}=t.payload;(a=a.filter(e=>e.id!==i.id)).unshift(i),e.initialSelectedCity&&!a.find(t=>t.id===e.initialSelectedCity.id)&&a.unshift(e.initialSelectedCity);let o=Object.assign(Object.assign({},e),{defaultCity:i,initialCities:a,cities:a});return"denied"!==e.geoLocationPermission||e.initialSelectedCity||(o.selectedLocation=i,o.searchLocationKeywords=i.name),o}case o.FetchCitiesByKeywordComplete:return Object.assign(Object.assign({},e),{cities:t.payload});case o.DisplayInitialCities:return Object.assign(Object.assign({},e),{cities:e.initialCities});case o.DisplayInitialSearchResults:return Object.assign(Object.assign({},e),{searchResults:e.initialSearchResults,isLoadingSearchResults:!1});case o.GrantGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"granted",geoLocationCoordinates:t.payload});case o.DenyGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"denied",geoLocationCoordinates:null});case o.OpenMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!0});case o.CloseMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!1});case o.UpdateInitialSearchValue:return Object.assign(Object.assign({},e),{searchKeywords:t.payload});case o.SetInputSearchPlaceholder:return Object.assign(Object.assign({},e),{inputSearchPlaceholder:t.payload});default:return e}}(i=o||(o={})).NavigateTo="navigate to url",i.ClickOutsideInputLocation="click outside input location",i.ClickOutsideInputSearch="click outside input search",i.SelectCurrentLocation="select current location",i.FocusInputLocation="focus input location",i.FocusInputSearch="focus input search",i.ChangeInputLocation="change input location",i.ChangeInputSearch="change input search",i.ClearInputLocation="clear input location",i.ClearInputSearch="clear input search",i.SelectLocation="select location",i.FetchCitiesStart="fetch cities start",i.FetchCitiesFinish="fetch cities finish",i.FetchSearchResultsStart="fetch search results start",i.FetchSearchResultsComplete="fetch search results complete",i.FetchSearchResultsFinish="fetch search results finish",i.FetchCitiesByGeoIpComplete="fetch cities by geo IP finish",i.FetchCitiesByKeywordComplete="fetch cities by keyword finish",i.DisplayInitialCities="display initial cities",i.DisplayInitialSearchResults="display initial search results",i.GrantGeoLocationPermission="grant geolocation permission",i.DenyGeoLocationPermission="deny geolocation permission",i.OpenMobileModal="open mobile modal",i.CloseMobileModal="close mobile modal",i.UpdateInitialSearchValue="update initial search value",i.SelectSearchResult="select search result",i.SetInputSearchPlaceholder="set input search placeholder";let N=h.Z.div` display: flex; gap: 16px; ${E.M.mbDown} { flex-direction: column; padding: 14px; background-color: ${b.r.colors.primary50}; input { filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.04)) drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.06)) drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.04)); } } input { background-color: white; } `,Z=h.Z.div` position: relative; `,D=(0,h.Z)(Z)` flex: 1; `,z=(0,h.Z)(Z)` flex: 2; `,_=(0,h.Z)(s.e)` display: none; &.shown { display: block; } `,SearchIcon=()=>n.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18"},n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.97887 8.15493C2.97887 5.29627 5.29627 2.97887 8.15493 2.97887C11.0136 2.97887 13.331 5.29627 13.331 8.15493C13.331 11.0136 11.0136 13.331 8.15493 13.331C5.29627 13.331 2.97887 11.0136 2.97887 8.15493ZM8.15493 1.5C4.47951 1.5 1.5 4.47951 1.5 8.15493C1.5 11.8303 4.47951 14.8099 8.15493 14.8099C9.72624 14.8099 11.1704 14.2653 12.3089 13.3546L15.2377 16.2834C15.5265 16.5722 15.9947 16.5722 16.2834 16.2834C16.5722 15.9947 16.5722 15.5265 16.2834 15.2377L13.3546 12.3089C14.2653 11.1704 14.8099 9.72624 14.8099 8.15493C14.8099 4.47951 11.8303 1.5 8.15493 1.5Z",fill:"white"})),H=h.Z.button` min-height: 100%; border-radius: 6px; background-color: ${b.r.colors.primaryBase}; display: flex; justify-content: center; align-items: center; gap: 11px; cursor: pointer; flex: 0.3; ${E.M.mbDown} { --margin: 16px; min-height: 44px; margin: var(--margin); width: calc(100% - var(--margin) * 2); position: absolute; bottom: 0; } &:hover { background-color: ${b.r.colors.primaryHover}; } &:active { background-color: ${b.r.colors.primaryActive}; } &:focus-visible { outline: 1px solid black; } `,V=(0,h.Z)(g.T)` font-weight: ${b.r.sizes.fwSemiBold}; `,SearchButton=({onClick:e})=>{let{t}=(0,c.u)(),a=t("booking.searchBar.searchButton");return n.createElement(H,{onClick:e,title:a},n.createElement(SearchIcon,null),n.createElement(V,{size:"s3",color:"white"},a))};function SearchInputs({isMobile:e,state:t,dispatch:a,debouncedFetchCitiesByKeyword:i,debouncedFetchSearchResults:r,focusLocationInput:l,focusSearchInput:d,renderLocationResults:u,renderSearchResults:h,locationTrackingAttributes:m,trackingAttributes:g,onSearch:y,initalSearchValue:f}){let E=(0,n.useRef)(null),v=(0,n.useRef)(null),{focused:x,searchLocationKeywords:S,geoLocationPermission:w,selectedLocation:k,searchKeywords:L,inputSearchPlaceholder:M}=t,{t:O}=(0,c.u)();useAnimatedPlaceholder({wrapperRef:v,disabled:!!M}),(0,C.a)(E,()=>{e||a({type:o.ClickOutsideInputLocation})}),(0,C.a)(v,()=>{e||a({type:o.ClickOutsideInputSearch})});let T=(0,n.useMemo)(()=>"granted"===w&&(null==k?void 0:k.id)===p.a?b.r.colors.primaryBase:b.r.colors.gray400,[w,k]),R=(0,n.useCallback)(function(e){a({type:o.ChangeInputSearch,payload:e}),"function"!=typeof y&&(e.trim().length>F[t.locale]||f?r(e.trim(),t):(r.cancel(),a({type:o.DisplayInitialSearchResults})))},[a,t]),P=(0,n.useCallback)(function(e){a({type:o.ChangeInputLocation,payload:e}),e.trim().length>F[t.locale]?i(e.trim()):(i.cancel(),a({type:o.DisplayInitialCities}))},[i,a]);return n.createElement(N,null,n.createElement(D,{ref:E},n.createElement(I,{inputClassName:"location"===x?"focused":void 0,placeholder:O("booking.searchBar.locationPlaceholder"),autoComplete:"off",name:"search-location",displayIcon:n.createElement(s.P,{className:"location-pin-icon",color:T}),actionIcon:n.createElement(_,{color:b.r.colors.gray300,className:""!==S?"shown":""}),onActionClick:function(){a({type:o.ClearInputLocation}),i.cancel(),l()},value:S,onChange:P,onFocus:()=>a({type:o.FocusInputLocation}),size:"md",trackingAttributes:m}),!e&&u()),n.createElement(z,{ref:v},n.createElement(I,{placeholder:M||O("booking.searchBar.searchInput.placeholder"),autoComplete:"off",name:"search-results",actionIcon:n.createElement(_,{color:b.r.colors.gray300,className:""!==L?"shown":""}),onActionClick:function(){a({type:o.ClearInputSearch}),r.cancel(),r("",t),d()},value:L,onChange:R,onFocus:()=>a({type:o.FocusInputSearch}),inputClassName:"search"===x?"focused":void 0,size:"md",trackingAttributes:g,onKeyPress:e=>{t.autoCompleteDisabled&&"Enter"===e.key&&y&&y({cityId:t.selectedLocation.id,keyword:L})},enterKeyHint:t.autoCompleteDisabled?"search":void 0}),!e&&h()),t.autoCompleteDisabled&&!t.isMobile&&n.createElement(SearchButton,{onClick:()=>{y({cityId:t.selectedLocation.id,keyword:L})}}))}let DoctorIcon=()=>n.createElement("svg",{width:"14",height:"18",viewBox:"0 0 14 18"},n.createElement("path",{d:"M7 .667c-1.702 0-3.36.146-4.48.365a1.67 1.67 0 0 0-1.353 1.64v2.162c0 .459.374.833.833.833h10a.835.835 0 0 0 .833-.833V2.698c0-.804-.566-1.487-1.354-1.64C10.356.84 8.693.667 7 .667m-.833.833h1.666v.834h.834V4h-.834v.834H6.167V4h-.834V2.334h.834zm-4.74 5a8 8 0 0 0-.234 1.276c-.046.404-.137 1.478-.13 1.589a1.94 1.94 0 0 0-.73 1.536c0 .935.645 1.735 1.51 1.928.902 2.19 2.71 4.505 5.157 4.505s4.255-2.338 5.156-4.532a1.935 1.935 0 0 0 1.51-1.9 1.94 1.94 0 0 0-.729-1.537c.007-.11-.08-1.205-.13-1.615a8.4 8.4 0 0 0-.234-1.25H5.359c1.169 1.706 3.916.687 5.678 1.12.537 1.172.13 2.813.13 2.813l.65.208c.095.03.183.114.183.26 0 .157-.114.293-.312.287l-.678-.104-.234.65C9.966 14.05 8.413 15.668 7 15.668s-2.965-1.618-3.776-3.932l-.26-.651-.704.104c-.143 0-.26-.13-.26-.287a.26.26 0 0 1 .182-.26l.651-.208c-.1.12-.423-1.729 0-2.396.759-.524 1.394-.16 2.292-1.537zm3.75 2.552c-.605 0-1.094.502-1.094 1.12s.489 1.12 1.094 1.12 1.094-.501 1.094-1.12c0-.618-.488-1.12-1.094-1.12m3.646 0c-.606 0-1.094.502-1.094 1.12s.488 1.12 1.094 1.12c.605 0 1.094-.501 1.094-1.12 0-.618-.489-1.12-1.094-1.12",fill:"#9AA2AC"})),ServiceIcon=()=>n.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18"},n.createElement("path",{d:"M9 .667A8.33 8.33 0 0 0 2.333 4H4.6A6.7 6.7 0 0 1 9 2.334c1.637 0 3.2.612 4.401 1.666h2.266A8.33 8.33 0 0 0 9 .667M1.786 4.834c-.71 2.207-1.12 4.765-1.12 7.5 0 1.751.16 3.434.47 5h15.729c.309-1.566.468-3.249.468-5 0-2.735-.41-5.293-1.12-7.5zM9 7.334a4.166 4.166 0 1 1 0 8.332 4.166 4.166 0 0 1 0-8.332M8.167 9v1.667H6.5v1.667h1.667V14h1.666v-1.666H11.5v-1.667H9.833V9z",fill:"#9AA2AC"})),HospitalIcon=()=>n.createElement("svg",{width:"16",height:"17",viewBox:"0 0 16 17"},n.createElement("path",{d:"M8 .667.5 5.635v9.199c0 .92.746 1.666 1.667 1.666h11.666c.921 0 1.667-.745 1.667-1.666V5.635zm3.333 10h-2.5v2.5H7.167v-2.5h-2.5V9h2.5V6.5h1.666V9h2.5z",fill:"#9AA2AC"})),SpecialtyIcon=()=>n.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16"},n.createElement("path",{d:"M3.833.5a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667M10.5.5c-.92 0-1.667.746-1.667 1.667V5.5c0 .92.746 1.667 1.667 1.667h3.333c.921 0 1.667-.746 1.667-1.667V2.167C15.5 1.246 14.754.5 13.833.5zM3.833 8.833a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667m8.334 0a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667",fill:"#9AA2AC"})),G=h.Z.header` display: flex; justify-content: space-between; padding: 12px 24px; background-color: ${b.r.colors.neutral50}; box-shadow: inset 0px 1px 0px #e4e8ec; `,K=h.Z.div` display: grid; flex: 2; align-items: center; gap: 16px; grid-template-columns: 16px 1fr; `,W=h.Z.p` color: ${b.r.colors.neutral800}; font-size: 14px; font-weight: ${b.r.sizes.fwSemiBold}; letter-spacing: -0.2px; line-height: 22px; `,Y=h.Z.button` flex: 1; cursor: pointer; text-align: end; `,q=h.Z.section` padding: 12px 16px; --rowGap: 16px; --graphicSize: 32px; ${E.M.tdUp} { --rowGap: 8px; } `,U=h.Z.ul` --gap: 16px; ${E.M.tdUp} { --gap: 8px; } display: grid; overflow: hidden; gap: var(--gap); transition: max-height 0.8s ease-out; ${({isMore:e})=>e&&` height: auto; max-height: 0; margin-top: var(--gap); `} ${({isShown:e})=>e&&` max-height: 600px; `} @media (prefers-reduced-motion) { transition: none; } ${E.M.tdUp} { grid-template-columns: 1fr 1fr; } `,Q=(0,h.Z)(g.T)` margin-top: 12px; margin-bottom: 8px; cursor: pointer; text-align: start; text-transform: capitalize; `,X=h.Z.li` display: flex; align-items: center; gap: var(--rowGap); cursor: pointer; &.not-nav { cursor: default; } `,J=h.Z.div` --wrapper-size: var(--graphicSize); border-radius: calc(var(--wrapper-size) / 2); background-color: var(--neutral50); width: var(--wrapper-size); height: var(--wrapper-size); aspect-ratio: 1/1; overflow: hidden; ${({type:e})=>e&&"doctors"===e&&` border-radius: calc(var(--graphicSize) / 2); `} img { width: var(--graphicSize); height: var(--graphicSize); ${({type:e})=>e&&"doctors"===e?` object-fit: cover; `:` object-fit: contain; `} } &:focus-visible { outline: 1px solid ${b.r.colors.gray600}; } `,ee=(0,h.Z)(g.T)` line-height: 22px; letter-spacing: -0.2px; ${E.M.tdUp} { &[data-size='p3'] { font-size: 14px; } } `,et=h.Z.figure` max-width: var(--graphicSize); min-width: var(--graphicSize); `,ea=h.Z.svg` margin: 0 auto; display: block; `,ei=h.Z.div` display: grid; place-items: center; `,eo={doctors:s.f,services:s.g},ResultSectionItem=({type:e,item:t,imageUrl:a,className:i,onClickItem:o})=>{let r=(0,n.useMemo)(()=>{let t=eo[e]||s.D;return n.createElement(t,{width:32,height:"services"===e?32:24})},[e]);return n.createElement(X,{onClick:()=>o&&o(t),onKeyDown:e=>{("Enter"===e.key||"Space"===e.key)&&o&&o(t)},tabIndex:0,role:"button",className:i},n.createElement(et,null,"hospitals"===e?n.createElement(ea,{width:"12",height:"16",viewBox:"0 0 12 16"},n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 5.94873C0.75 3.04623 3.0975 0.69873 6 0.69873C8.9025 0.69873 11.25 3.04623 11.25 5.94873C11.25 9.07623 7.935 13.3887 6.5775 15.0312C6.2775 15.3912 5.73 15.3912 5.43 15.0312C4.065 13.3887 0.75 9.07623 0.75 5.94873ZM4.125 5.94873C4.125 6.98373 4.965 7.82373 6 7.82373C7.035 7.82373 7.875 6.98373 7.875 5.94873C7.875 4.91373 7.035 4.07373 6 4.07373C4.965 4.07373 4.125 4.91373 4.125 5.94873Z",fill:"#9AA2AC"})):n.createElement(J,{type:e},a?n.createElement("img",{src:a,width:32,height:"services"===e?32:24,loading:"lazy"}):r)),n.createElement(ee,{color:b.r.colors.gray800,size:"p3"},t.name))},ResultSection=({type:e,data:t,state:a,dispatch:i,itemsToShow:r,itemsToShowDesktop:l,isMobile:s,isLoading:d,keyword:u,isNavResultItem:h})=>{let[m,y]=(0,n.useState)(!1),{t:f,locale:C}=(0,c.u)(),{selectedLocation:E,searchKeywords:x}=a,S=(0,n.useMemo)(()=>p.L[C],[C]),w="ms-MY"===C,k=(0,n.useMemo)(()=>({doctors:{name:f("booking.searchPopup.doctors"),icon:n.createElement(DoctorIcon,null),slug:S.DOCTOR},services:{name:f("booking.searchPopup.services"),icon:n.createElement(ServiceIcon,null),slug:S.SERVICE},hospitals:{name:f("booking.searchPopup.hospitals"),icon:n.createElement(HospitalIcon,null),slug:S.HOSPITAL},specialties:{name:f("booking.searchPopup.specialties"),icon:n.createElement(SpecialtyIcon,null),slug:S.SPECIALTIES}}),[e,S]),L=(0,n.useMemo)(()=>k[e].slug,[k]),I=s?r:l;function onClickItem(t){let a="";switch(e){case"specialties":a=`/${E.slug}/${k.doctors.slug}/${t.slug}`;break;case"services":a=`/${E.slug}/${L}/${t.slug}`;break;case"doctors":case"hospitals":a=`/${L}/${t.slug}-${t.id}`}a&&i({type:o.SelectSearchResult,payload:{name:t.name,url:a}})}function renderItem(t){return n.createElement(ResultSectionItem,{key:t.id,item:t,type:e,imageUrl:t.logo||t.avatar||t.thumbnail,className:h?"":"not-nav",onClickItem:h&&onClickItem})}return n.createElement("section",null,n.createElement(G,null,n.createElement(K,null,k[e].icon,n.createElement(W,null,k[e].name)),(u.trim().length<=F[C]||w)&&n.createElement(Y,{onClick:function(){let t="";switch(e){case"specialties":t=`/${L}`;break;case"services":case"doctors":case"hospitals":t=`/${E.slug}/${L}`}t&&i({type:o.NavigateTo,payload:t})}},n.createElement(g.T,{size:"p3",color:b.r.colors.primaryBase},f("booking.searchPopup.seeAll")))),(d||t&&t.length>0)&&n.createElement(q,null,n.createElement(U,null,d&&[,,].fill(void 0).map((t,a)=>n.createElement(X,{key:e+"loading"+a},n.createElement(et,null,n.createElement(ei,null,n.createElement(v.Z,{height:14,width:"hospitals"===e?12:32,style:{maxWidth:"var(--graphicSize)",minHeight:"var(--graphicSize)"}}))),n.createElement(v.Z,{width:120,height:24}))),!d&&t&&t.length>0&&t.slice(0,I).map(renderItem)),n.createElement(U,{isShown:m,isMore:!0},t.slice(I,-1).map(renderItem)),"specialties"===e&&Iy(!m)},n.createElement(Q,{size:"p3",color:b.r.colors.primaryBase},m?f("booking.searchPopup.seeLessSpecialties"):f("booking.searchPopup.seeMoreSpecialties"))),"specialties"!==e&&(IF[C]&&n.createElement("button",{onClick:function(){let{slug:t}=k[e],a=`/${E.slug}/${t}?q=${x}`;i({type:o.NavigateTo,payload:a})}},n.createElement(Q,{size:"p3",color:b.r.colors.primaryBase},f(`booking.searchPopup.searchIn.${e}`,{name:u})))),!d&&(null==t?void 0:t.length)===0&&n.createElement(q,null,n.createElement(g.T,{size:"sm",color:b.r.colors.gray400},f("booking.searchBar.noResults"))))},er=h.Z.section` background-color: white; border-radius: 4px; position: absolute; width: 100%; z-index: 30; ${E.M.tdUp} { box-shadow: 0px 24px 32px rgba(0, 0, 0, 0.04), 0px 16px 24px rgba(0, 0, 0, 0.04), 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 0px 1px rgba(0, 0, 0, 0.04); } `,SearchResults=({data:e,state:t,dispatch:a,isMobile:i,isLoading:o,keyword:r,hideResults:l,isNavResultItem:s})=>n.createElement(er,null,e&&e.map(e=>l&&l.includes(e.type)?n.createElement(n.Fragment,null):n.createElement(ResultSection,{type:e.type,state:t,dispatch:a,itemsToShow:2,itemsToShowDesktop:4,key:e.type,data:e.results,isMobile:i,isLoading:o,keyword:r,isNavResultItem:s}))),BookingSearchBar=({isMobile:e,careApiDomain:t,geoLocationPermission:a,geoLocationCoordinates:i,initialSelectedCity:d,initialSearchValue:h="",careFrontDomain:m="/care",isDebug:g=!1,askForGeolocationPermission:b=!1,gaTrackingSearchBar:y,gaTrackingLocationSearch:f,autoCompleteDisabled:C=!1,inputSearchPlaceholder:E="",isOptionAllLocation:v=!1,hideResults:I=[],isNavResultItem:M=!0,routerPush:O,onGeoLocationPermissionChange:T,onSearch:R,onChangeLocation:P})=>{let{t:j,locale:B}=(0,c.u)(),A=(0,n.useRef)(null),N=(0,n.useRef)(null),[Z,D]=(0,n.useState)(void 0),[z,_]=(0,n.useState)(!1),{geoLocationPermission:H,geoLocationCoordinates:V,requestGeoLocation:G}=(0,s.u)(),[K,W]=(0,n.useReducer)(reducer,$,t=>Object.assign(Object.assign({},t),{isDebug:g,isMobile:e,geoLocationPermission:a||H||"unset",geoLocationCoordinates:i||V||null,searchKeywords:h,initialSelectedCity:d||null,selectedLocation:d||t.selectedLocation||null,searchLocationKeywords:(null==d?void 0:d.name)||t.searchLocationKeywords,autoCompleteDisabled:C,inputSearchPlaceholder:E,locale:B})),{navigateTo:Y,focused:q,isLoadingCities:U,cities:Q,searchKeywords:X,geoLocationPermission:J,selectedLocation:ee,initialSelectedCity:et,defaultCity:ea,searchResults:ei,isLoadingSearchResults:eo,isMobileModalOpened:er,inputSearchPlaceholder:en}=K,{fetchCitiesByLocation:el,fetchCitiesByKeyword:es,fetchSearchResults:ec}=function({dispatch:e,careApiDomain:t,locale:a="vi-VN"}){let i=(0,n.useCallback)(function(i,r={}){let n=`${t}${i}`;return e({type:o.FetchCitiesStart}),fetch((0,s.h)(n,r,a),{method:"GET"}).then(e=>e.json()).then(e=>1===e._status&&e._data?null==e?void 0:e._data:(console.log("error loading cities",e),Promise.reject(e))).finally(()=>e({type:o.FetchCitiesFinish}))},[a]),r=(0,n.useCallback)(function({coordinates:t}){let r={},n={};t&&(r={lat:t.lat,lng:t.lng}),"ms-MY"===a&&(n.noPaging=1);let l=[i(x.P.GET_CITY_BY_IP,Object.assign(Object.assign({},r),n))];return"zh-TW"===a&&l.push(i(x.P.GET_CITIES_LIST,{noPaging:1})),Promise.all(l).then(([t,a])=>{let i=Object.assign({},t);if(a){let e=i.cities.map(e=>e.id);i.cities=i.cities.concat(a.cities.filter(t=>!e.includes(t.id)))}e({type:o.FetchCitiesByGeoIpComplete,payload:i})}).catch(e=>console.error("error loading cities by location",e))},[a,t,e]),l=(0,n.useCallback)(function(t){return i(x.P.GET_CITIES_LIST,{keyword:t}).then(t=>{e({type:o.FetchCitiesByKeywordComplete,payload:t.cities})}).catch(e=>console.error("error loading cities by keyword",e))},[a,t,e]),c=(0,n.useCallback)(function(i,r){let n=`${t}${x.P.GET_SEARCH_V2}`;e({type:o.FetchSearchResultsStart});let{defaultCity:l,selectedLocation:c,geoLocationCoordinates:d}=r,u="";if(!c||!l){e({type:o.FetchSearchResultsFinish});return}let h=c.id===p.a;h?d||(u=l.id):u=c.id===p.I?"":c.id;let m=(null==d?void 0:d.lat)||"",g=(null==d?void 0:d.lng)||"";return fetch((0,s.h)(n,{domain:t,searchType:"global",keyword:i.trim().length>F[a]?i.trim():"",city:u===p.a?"":u,lat:m,lng:g},a),{method:"GET",headers:{accept:"version=2.0.0.0"}}).then(e=>e.json()).then(e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e)).then(t=>e({type:o.FetchSearchResultsComplete,payload:t})).catch(e=>{console.log("error loading search results",{url:n,error:e})}).finally(()=>e({type:o.FetchSearchResultsFinish}))},[a,t,e]);return{fetchCitiesByLocation:r,fetchCitiesByKeyword:l,fetchSearchResults:c}}({dispatch:W,locale:B,careApiDomain:t}),ed=(0,n.useMemo)(()=>{var e;return{id:p.a,name:j("booking.searchBar.currentLocation"),slug:null===(e=p.L[B])||void 0===e?void 0:e.CURRENT}},[j,B]),eu=(0,n.useMemo)(()=>u()(es,400),[es]),ep=(0,n.useMemo)(()=>u()(ec,400),[ec]);(0,n.useEffect)(()=>{""!==h&&h!==K.searchKeywords&&W({type:o.UpdateInitialSearchValue,payload:h})},[h]),(0,n.useEffect)(()=>{b&&(null==ee?void 0:ee.id)===p.a&&"unset"===J&&G()},[b,ee,J]),(0,n.useEffect)(()=>{a||J===H||("granted"===H&&V?W({type:o.GrantGeoLocationPermission,payload:V}):"denied"===H&&W({type:o.DenyGeoLocationPermission}))},[J,H,V,a]),(0,n.useEffect)(()=>{Y&&(O?O(Y):window.location.href=`${m}${Y}`)},[Y]);let eh=(0,n.useCallback)(function(){W({type:o.SelectCurrentLocation,payload:ed})},[j,W]);(0,n.useEffect)(()=>{var t;"denied"===J||et||W({type:o.SelectLocation,payload:{name:j("booking.searchBar.allLocations"),id:p.I,slug:null===(t=p.L[B])||void 0===t?void 0:t.ALL}}),T&&T(J,K.geoLocationCoordinates),e&&"granted"===J&&ee&&W({type:o.FocusInputSearch}),el({coordinates:K.geoLocationCoordinates})},[J]),(0,n.useEffect)(()=>{ee&&ea&&ec(K.searchKeywords,K)},[ee,ea]),(0,n.useEffect)(()=>{E!==en&&W({type:o.SetInputSearchPlaceholder,payload:E})},[E,en]),(0,n.useEffect)(()=>{er?document.body.classList.add("care-popup-open"):document.body.classList.remove("care-popup-open")},[er]);let em=(0,n.useCallback)(function(e){"ms-MY"===B&&_(!0),W({type:o.SelectLocation,payload:e}),"ms-MY"!==B&&focusSearchInput(),P&&P(e)},[j,W]);function handleCurrentLocationClick(){"ms-MY"===B&&_(!0),e&&"granted"!==K.geoLocationPermission?G():(eh(),"ms-MY"!==B&&focusSearchInput())}function focusLocationInput(){var e;A.current&&(null===(e=A.current.querySelector('input[name="search-location"]'))||void 0===e||e.focus())}function focusSearchInput(){var e;A.current&&(null===(e=A.current.querySelector('input[name="search-results"]'))||void 0===e||e.focus())}function handleMobileTopBarClose(){W({type:o.CloseMobileModal})}function renderLocationResults(){return"location"!==q?null:n.createElement(LocationResults,{isLoading:U,cities:Q,onLocationClick:em,onCurrentLocationClick:handleCurrentLocationClick,isLocationLoading:U,geoLocationPermission:J,selectedLocation:ee,isOptionAllLocation:v})}function renderSearchResults(){return"search"!==q?null:K.autoCompleteDisabled?e?n.createElement(SearchButton,{onClick:()=>{R({cityId:K.selectedLocation.id,keyword:X}),handleMobileTopBarClose()}}):null:n.createElement(SearchResults,{data:ei,state:K,dispatch:W,isMobile:!1,keyword:X,isLoading:eo,hideResults:I,isNavResultItem:M})}function renderSearchInputs(){return n.createElement(SearchInputs,{isMobile:e,state:K,dispatch:W,debouncedFetchCitiesByKeyword:eu,debouncedFetchSearchResults:ep,focusLocationInput:focusLocationInput,focusSearchInput:focusSearchInput,renderLocationResults:renderLocationResults,renderSearchResults:renderSearchResults,trackingAttributes:y,locationTrackingAttributes:f,onSearch:R,initalSearchValue:h})}return((0,n.useEffect)(()=>{if(window.visualViewport){let resizeHandler=e=>{let t=e.target;D(null==t?void 0:t.height)};return window.visualViewport.addEventListener("resize",resizeHandler,{passive:!0}),()=>{window.visualViewport.removeEventListener("resize",resizeHandler)}}},[D]),(0,n.useEffect)(()=>{if(ee&&z&&"ms-MY"===B){let e=`/${ee.slug}/hospital`;W({type:o.NavigateTo,payload:e}),_(!1)}},[z,B,ee]),e)?n.createElement(n.Fragment,null,n.createElement(l.xB,{styles:l.iv` .care-popup-open { overflow: hidden; position: fixed; &::before { content: ''; inset: 0; position: absolute; background-color: white; min-height: 100vh; min-width: 100vw; z-index: 2; } } `}),n.createElement(L,{ref:N}),n.createElement(w,{id:"booking-search-bar",ref:A,"data-is-modal":e&&er,style:{"--mobile-care-searchbar-height":er&&Z?`${Z}px`:"100%"}},er?n.createElement(n.Fragment,null,n.createElement(k,null,n.createElement(MobileTopBar,{headingText:j("booking.searchBar.searchButton"),onLeftClick:handleMobileTopBarClose}),renderSearchInputs()),renderLocationResults(),renderSearchResults()):n.createElement(MobileFakeInput,{onClick:function(){var e;return(0,r.a)(this,void 0,void 0,function*(){N.current&&N.current.focus(),W({type:o.OpenMobileModal}),yield Promise.resolve(),A.current&&(null===(e=A.current.querySelector('input[name="search-location"]'))||void 0===e||e.focus())})},focused:q,value:X,trackingAttributes:y,inputSearchPlaceholder:E}))):n.createElement(S,{id:"booking-search-bar",ref:A},renderSearchInputs())}},UMsb:function(e,t,a){a.d(t,{u:function(){return BookingSearchBarV2}});var i,o,r,n,l=a("q1tI"),s=a("0D4Z"),c=a("aDCK"),d=a("vaps"),u=a("NEaA"),p=a("rlLN"),h=a("SPK5"),m=a("mAfZ"),g=a("3M3N"),b=a("4MMi"),y=a("ybaB"),f=a("sEfC"),C=a.n(f),E=a("hQ98"),v=a("rBCA"),x=a("iBNF"),S=a("SPEo"),w=a("TXjF"),k=a("VZtU"),L=a("Ag88"),I=a("1Kw5"),M=a("q1uw");a("gY0P");let O=v.Z.div``,T=v.Z.div` background-color: ${x.r.colors.neutral50}; padding-bottom: 1px; ${S.M.mbDown} { padding: 0 16px 10px; } `,R=(0,v.Z)(w.C)` padding: 0 16px; ${S.M.mbDown} { padding: 0; } `,P=v.Z.div` padding: 24px 56px; border-radius: 16px; background-color: ${x.r.colors.white}; box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.04), 0px 0px 2px 0px rgba(0, 0, 0, 0.06), 0px 4px 8px 0px rgba(0, 0, 0, 0.04); ${S.M.mbDown} { padding: 16px 16px; border-radius: 0px 0px 12px 12px; } .flex-search-input { flex-direction: row; ${S.M.mbDown} { flex-direction: column; } } `,j={"en-PH":3,"tl-PH":2,"id-ID":3,"vi-VN":2,"zh-TW":0,"ms-MY":2,"th-TH":2},B={isMobile:!1,isDebug:!1,navigateTo:null,geoLocationPermission:"unset",geoLocationCoordinates:null,focused:"none",focusedSpecialty:"none",searchLocationKeywords:"",searchSpecialtyKeywords:"",searchKeywords:"",selectedLocation:null,selectedSpecialty:null,defaultCity:null,initialCities:[],cities:[],searchResults:{},initialSearchResults:{},isLoadingCities:!1,isLoadingSearchResults:!1,isMobileModalOpened:!1,initialSelectedCity:null,autoCompleteDisabled:!1,inputSearchPlaceholder:"",locale:"vi-VN",allSpecialties:[],popularKeys:[]};function resetSearchLocationKeywords(e){let{selectedLocation:t,searchLocationKeywords:a}=e;return t&&a!==t.name?Object.assign(Object.assign({},e),{searchLocationKeywords:t.name}):e}function reducer(e,t){var a,i;switch(e.isDebug&&console.log("bookingSearchBar",{action:t,state:e}),t.type){case r.NavigateTo:return Object.assign(Object.assign({},e),{navigateTo:t.payload,focused:"none",isMobileModalOpened:!1});case r.ClickOutsideInputLocation:if("location"!==e.focused)return e;return resetSearchLocationKeywords(Object.assign(Object.assign({},e),{focused:"none"}));case r.ClickOutsideInputSpecialty:if("specialty"!==e.focused)return e;return resetSearchLocationKeywords(Object.assign(Object.assign({},e),{focused:"none"}));case r.ClickOutsideInputSearch:if("search"!==e.focused)return e;return Object.assign(Object.assign({},e),{focused:"none"});case r.ClickOutsideInputSearchSpecialty:if("search"!==e.focusedSpecialty)return e;return Object.assign(Object.assign({},e),{focusedSpecialty:"none"});case r.FocusInputLocation:{let t=Object.assign(Object.assign({},e),{focused:"location"});return(null===(a=e.selectedLocation)||void 0===a?void 0:a.id)===E.a&&(t.searchLocationKeywords=""),t}case r.FocusInputSpecialty:{let t=Object.assign(Object.assign({},e),{focused:"specialty"});return(null===(i=e.selectedLocation)||void 0===i?void 0:i.id)===E.a&&(t.searchLocationKeywords=""),t}case r.FocusInputSearch:let o=Object.assign(Object.assign({},e),{focused:"search"});if(e.isMobile)return resetSearchLocationKeywords(o);return o;case r.FocusInputSearchSpecialty:{let t=Object.assign(Object.assign({},e),{focusedSpecialty:"search"});return t}case r.ChangeInputLocation:return Object.assign(Object.assign({},e),{searchLocationKeywords:t.payload});case r.ChangeInputSearch:{let a=t.payload;return Object.assign(Object.assign({},e),{searchKeywords:a,isLoadingSearchResults:a.trim().length>j[e.locale]})}case r.SelectCurrentLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name});case r.ClearInputLocation:return Object.assign(Object.assign({},e),{focused:"location",cities:e.initialCities,searchLocationKeywords:""});case r.ClearInputSearch:return Object.assign(Object.assign({},e),{focused:"search",searchKeywords:""});case r.SelectLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name});case r.SelectSpecialty:return Object.assign(Object.assign({},e),{focused:"none",selectedSpecialty:t.payload});case r.SelectSearchResult:return Object.assign(Object.assign({},e),{searchKeywords:t.payload.name,isMobileModalOpened:!1,focused:"none",navigateTo:t.payload.url});case r.FetchCitiesStart:return Object.assign(Object.assign({},e),{isLoadingCities:!0});case r.FetchCitiesFinish:return Object.assign(Object.assign({},e),{isLoadingCities:!1});case r.FetchSearchResultsStart:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!0});case r.FetchSearchResultsFinish:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!1});case r.FetchSearchResultsComplete:{let a=Object.assign(Object.assign({},e),{searchResults:Object.assign(Object.assign({},e.searchResults),{[t.payload.key]:t.payload.searches})});return a}case r.FetchCitiesByGeoIpComplete:{let{cities:a}=t.payload,{default:i}=t.payload;a=a.filter(e=>e.id!==i.id),i&&a.unshift(i),e.initialSelectedCity&&!a.find(t=>t.id===e.initialSelectedCity.id)&&a.unshift(e.initialSelectedCity);let o=Object.assign(Object.assign({},e),{defaultCity:i,initialCities:a,cities:a});return"denied"!==e.geoLocationPermission||e.initialSelectedCity||(o.selectedLocation=i,o.searchLocationKeywords=i.name),o}case r.FetchCitiesByKeywordComplete:return Object.assign(Object.assign({},e),{cities:t.payload});case r.DisplayInitialCities:return Object.assign(Object.assign({},e),{cities:e.initialCities});case r.DisplayInitialSearchResults:return Object.assign(Object.assign({},e),{searchResults:e.initialSearchResults,isLoadingSearchResults:!1});case r.UpdateInitialSearchResults:return Object.assign(Object.assign({},e),{initialSearchResults:Object.assign(Object.assign({},e.initialSearchResults),{[t.payload.key]:t.payload.searches})});case r.GrantGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"granted",geoLocationCoordinates:t.payload});case r.DenyGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"denied",geoLocationCoordinates:null});case r.OpenMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!0});case r.CloseMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!1});case r.UpdateInitialSearchValue:return Object.assign(Object.assign({},e),{searchKeywords:t.payload});case r.SetInputSearchPlaceholder:return Object.assign(Object.assign({},e),{inputSearchPlaceholder:t.payload});case r.FetchAllSpecialties:return Object.assign(Object.assign({},e),{allSpecialties:t.payload});case r.FetchPopularKeys:return Object.assign(Object.assign({},e),{popularKeys:t.payload});default:return e}}(i=r||(r={})).NavigateTo="navigate to url",i.ClickOutsideInputLocation="click outside input location",i.ClickOutsideInputSearch="click outside input search",i.ClickOutsideInputSearchSpecialty="click outside input search specialty",i.ClickOutsideInputSpecialty="click outside input specialty",i.SelectCurrentLocation="select current location",i.FocusInputLocation="focus input location",i.FocusInputSearch="focus input search",i.FocusInputSearchSpecialty="focus input search specialty",i.ChangeInputLocation="change input location",i.ChangeInputSearch="change input search",i.ClearInputLocation="clear input location",i.ClearInputSearch="clear input search",i.SelectLocation="select location",i.SelectSpecialty="select specialty",i.FetchCitiesStart="fetch cities start",i.FetchCitiesFinish="fetch cities finish",i.FetchSearchResultsStart="fetch search results start",i.FetchSearchResultsComplete="fetch search results complete",i.FetchSearchResultsFinish="fetch search results finish",i.FetchCitiesByGeoIpComplete="fetch cities by geo IP finish",i.FetchCitiesByKeywordComplete="fetch cities by keyword finish",i.DisplayInitialCities="display initial cities",i.DisplayInitialSearchResults="display initial search results",i.UpdateInitialSearchResults="update initial search results",i.GrantGeoLocationPermission="grant geolocation permission",i.DenyGeoLocationPermission="deny geolocation permission",i.OpenMobileModal="open mobile modal",i.CloseMobileModal="close mobile modal",i.UpdateInitialSearchValue="update initial search value",i.SelectSearchResult="select search result",i.SetInputSearchPlaceholder="set input search placeholder",i.FocusInputSpecialty="focus input specialty",i.FetchAllSpecialties="fetch all specialty",i.FetchPopularKeys="fetch popular key by type";let A=v.Z.div` flex: 1; position: relative; ${S.M.mbDown} { width: 100%; display: flex; flex-direction: column; gap: 12px; } `,F=v.Z.div` position: absolute; top: calc(100% + 2px); width: 100%; border-radius: 4px; background: ${x.r.colors.white}; box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1); z-index: 10; ${S.M.mbDown} { width: calc(100% + 64px); left: -32px; } `,$=v.Z.div``,N=v.Z.div` display: flex; justify-content: space-between; align-item: center; padding: 9px 14px 9px 22px; background: #f7f9fc; .title { color: ${x.r.colors.gray800}; font-size: 14px; font-weight: 600; line-height: 22px; } .btn-see-all { color: ${x.r.colors.blue600}; font-size: 14px; line-height: 22px; cursor: pointer; } `,Z=v.Z.div` padding: 10px 16px; max-height: 400px; overflow: auto; `,D=v.Z.div` display: flex; gap: 12px; align-items: center; cursor: pointer; &:hover { background-color: ${x.r.colors.blue50}; } .image-item { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; img { object-fit: contain; width: 100%; height: 100%; border-radius: 50%; } } .infor { overflow: hidden; padding: 12px 0; flex: 1; border-bottom: 1px solid ${x.r.colors.neutral100}; .title { color: ${x.r.colors.gray800}; font-size: 16px; font-weight: 600; line-height: 24px; } .description { overflow: hidden; color: ${x.r.colors.gray600}; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 18px; display: flex; gap: 8px; align-items: center; margin-top: 5px; svg { flex: 0 0 16px; } .sub-description { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: 1; } } } &.last-item { .infor { border-bottom: none; } } `;v.Z.div` padding: 0 16px 16px; .search-detail-btn { color: ${x.r.colors.blue600}; font-size: 14px; line-height: 22px; cursor: pointer; } `;let SearchResult=({state:e,type:t,results:a,location:i,isLoading:o,typeInformation:n,clientSlug:c="",dispatch:d})=>{let{locale:u,t:p}=(0,y.u)(),{selectedLocation:h}=e,m=(0,l.useMemo)(()=>n[t].slug,[n,t]),handleOnClick=e=>{let a="";switch(t){case"service":a=`/${h.slug}/${m}/${e.slug}`;break;case"doctor":case"hospital":a=`/${m}/${e.slug}-${e.id}`}a&&d({type:r.NavigateTo,payload:a})};return l.createElement($,null,l.createElement(N,null,l.createElement("div",{className:"title"},p("booking.searchResult.description",{search_type:n[t].name,search_location:i})),a.length>0&&l.createElement("div",{className:"btn-see-all",onClick:()=>{let a=`/${h.slug}/${m}`,i=E.M[u][c];i&&(a+=`/${i}`),("doctor"===t||"hospital"===t)&&e.selectedSpecialty.id>0&&(a+=`?specialtyId=${e.selectedSpecialty.id}`),a&&d({type:r.NavigateTo,payload:a})}},p("home.seeAll"))),l.createElement(Z,null,o&&[,,,].fill(void 0).map((e,a)=>l.createElement(D,{key:t+"loading"+a,className:2===a?"last-item":""},l.createElement("div",{className:"image-item"},l.createElement(s.O,{height:48,circle:!0,mb:"xl",animate:!0})),l.createElement("div",{className:"infor"},l.createElement("div",{className:"title"},l.createElement(s.O,{height:8,mt:10,radius:"xl",animate:!0})),l.createElement("div",{className:"description"},l.createElement("div",{className:"sub-description"},l.createElement(s.O,{height:8,mt:10,radius:"xl",width:"80%",animate:!0})))))),!o&&a&&a.length>0&&l.createElement(l.Fragment,null,a.map((e,i)=>{var o,r;let s=a.length>4&&3===i||a.length<=4&&i===a.length-1,c="";return("hospital"===t&&(c=(null==e?void 0:e.address)||""),"doctor"===t&&(c=(null===(o=null==e?void 0:e.specialties)||void 0===o?void 0:o.join(", "))||""),"service"===t&&(c=(null===(r=null==e?void 0:e.hospital_branch)||void 0===r?void 0:r.name)||""),i>=4)?l.createElement(l.Fragment,null):l.createElement(D,{key:e.id,className:s?"last-item":"",onClick:()=>handleOnClick(e)},l.createElement("div",{className:"image-item"},l.createElement("img",{src:e.logo||e.avatar,alt:e.name})),l.createElement("div",{className:"infor"},l.createElement("div",{className:"title"},e.name),l.createElement("div",{className:"description"},n[t].icon,l.createElement("div",{className:"sub-description"},c))))})),!o&&(null==a?void 0:a.length)===0&&l.createElement(L.T,{size:"sm",color:x.r.colors.gray400},p("booking.searchBar.noResults"))))},z=v.Z.div` position: relative; ${S.M.mbDown} { width: 100%; display: flex; flex-direction: column; gap: 12px; } `,_=v.Z.div` position: absolute; top: calc(100% + 2px); width: calc(100% + 100px); border-radius: 4px; background: ${x.r.colors.white}; box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1); z-index: 10; max-height: 300px; overflow: auto; ${S.M.mbDown} { width: calc(100% + 64px); left: -32px; } `,H=v.Z.li` position: relative; cursor: pointer; padding: 12px 18px; display: flex; align-items: center; gap: 14px; overflow: hidden; .image-item { display: flex; align-items: center; width: 40px; height: 40px; img { width: 100%; object-fit: cover; } svg { width: 40px; } } ${({isSelected:e})=>e&&` &::after { content: ${g.i}; top: 50%; right: 18px; position: absolute; transform: translateY(-50%); } `} & + li::before { content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 1px; background-color: ${x.r.colors.neutral100}; } &:not([data-is-denied='true']):hover { background-color: ${x.r.colors.neutral50}; } &:last-child:hover { border-bottom-right-radius: 6px; border-bottom-left-radius: 6px; } &:first-child:hover { border-top-right-radius: 6px; border-top-left-radius: 6px; } &[data-is-denied='true'] { cursor: not-allowed; } `,DoctorIcon=()=>l.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},l.createElement("path",{d:"M8.983 14.333q-1.666 0-2.833-1.166Q4.983 12 4.983 10.333v-.366a3.48 3.48 0 0 1-2.258-1.2 3.57 3.57 0 0 1-.909-2.434V3.1a.58.58 0 0 1 .175-.425.58.58 0 0 1 .425-.175h1.4v-.167a.486.486 0 0 1 .5-.5q.217 0 .36.142a.5.5 0 0 1 .14.358v1.334a.485.485 0 0 1-.5.5.484.484 0 0 1-.5-.5V3.5h-1v2.833q0 1.1.784 1.884Q4.383 9 5.483 9t1.883-.783.784-1.884V3.5h-1v.167a.485.485 0 0 1-.5.5.484.484 0 0 1-.5-.5V2.333a.486.486 0 0 1 .5-.5q.217 0 .358.142a.5.5 0 0 1 .142.358V2.5h1.4a.58.58 0 0 1 .425.175.58.58 0 0 1 .175.425v3.233q0 1.4-.908 2.434a3.5 3.5 0 0 1-2.259 1.2v.366q0 1.25.875 2.126a2.9 2.9 0 0 0 2.125.874q1.25 0 2.125-.874a2.9 2.9 0 0 0 .875-2.126V9.25a1.74 1.74 0 0 1-.858-.609 1.6 1.6 0 0 1-.342-1.008q0-.716.5-1.216t1.2-.5q.716 0 1.217.5.5.5.5 1.216 0 .567-.342 1.008t-.875.609v1.083q0 1.667-1.167 2.834-1.166 1.166-2.833 1.166m3.5-6q.3 0 .509-.208a.67.67 0 0 0 .208-.492q0-.3-.208-.508a.7.7 0 0 0-.509-.208q-.3 0-.5.208a.7.7 0 0 0-.2.508q0 .284.2.492t.5.208",fill:"#595959"})),ServiceIcon=()=>l.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},l.createElement("path",{d:"M6.868 9.265v.974q0 .405.284.69.284.283.69.283t.69-.284.284-.69v-.973h.973q.405 0 .69-.284a.94.94 0 0 0 .284-.689.94.94 0 0 0-.284-.69.94.94 0 0 0-.69-.284h-.973v-.974a.94.94 0 0 0-.284-.69.94.94 0 0 0-.69-.284.94.94 0 0 0-.689.284.94.94 0 0 0-.285.69v.974h-.973a.94.94 0 0 0-.69.283.94.94 0 0 0-.284.69q0 .405.284.69.285.284.69.284zm-3.46 4.868q-.581 0-.994-.413A1.36 1.36 0 0 1 2 12.725v-6.65a1.4 1.4 0 0 1 .563-1.127l4.434-3.333q.369-.282.844-.282.474 0 .846.282l4.434 3.333q.264.193.413.493.15.3.15.633v6.651q0 .58-.414.995a1.36 1.36 0 0 1-.994.413zm0-1.168h8.868q.105 0 .172-.068a.23.23 0 0 0 .068-.172v-6.65a.2.2 0 0 0-.027-.11.3.3 0 0 0-.07-.085L7.983 2.554a.2.2 0 0 0-.142-.052.2.2 0 0 0-.142.052L3.266 5.88a.3.3 0 0 0-.071.086.2.2 0 0 0-.027.108v6.651q0 .105.068.172a.23.23 0 0 0 .172.068",fill:"#595959"})),HospitalIcon=()=>l.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},l.createElement("path",{d:"M8 8q.55 0 .941-.392.393-.391.392-.941 0-.55-.392-.942A1.28 1.28 0 0 0 8 5.333q-.55 0-.942.392a1.28 1.28 0 0 0-.391.942q0 .55.391.941Q7.45 8 8 8m0 4.9q2.032-1.866 3.017-3.392Q12 7.983 12 6.8q0-1.817-1.158-2.975Q9.682 2.667 8 2.667T5.158 3.825Q4 4.983 4 6.8q0 1.184.983 2.708Q5.966 11.034 8 12.9m0 1.517a.8.8 0 0 1-.5-.183q-2.433-2.151-3.633-3.992T2.667 6.8q0-2.5 1.608-3.983Q5.883 1.332 8 1.333q2.116 0 3.725 1.484T13.333 6.8q0 1.6-1.2 3.442-1.2 1.841-3.633 3.991a.8.8 0 0 1-.5.184",fill:"#8C8C8C"})),SpecialtyIcon=()=>l.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16"},l.createElement("path",{d:"M3.833.5a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667M10.5.5c-.92 0-1.667.746-1.667 1.667V5.5c0 .92.746 1.667 1.667 1.667h3.333c.921 0 1.667-.746 1.667-1.667V2.167C15.5 1.246 14.754.5 13.833.5zM3.833 8.833a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667m8.334 0a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667",fill:"#9AA2AC"})),SearchSpecialty=({state:e,isMobile:t,debouncedFetchSearchResults:a,selectedLocation:i,onSpecialtyClick:o,dispatch:n})=>{var s;let{t:d,locale:u}=(0,y.u)(),p=(0,l.useRef)(null),h=(0,l.useMemo)(()=>E.L[u],[u]),m=(0,l.useMemo)(()=>({wrapper:{"&:after":{content:'""',width:"1px",height:"20px",backgroundColor:"#E4E8EC",position:"absolute",right:0,top:"13px"}},input:{border:t?"border: 1px solid #d9d9d9":"none",height:t?"40px":"46px !important",paddingRight:"30px","&:focus":{boxShadow:t?"box-shadow: 0px 0px 0px 2px #91caff":"none"}},rightSection:{width:"30px",svg:{fontSize:"20px"}}}),[t]),g=(0,l.useCallback)(function(e){console.log(e)},[a,n]);return(0,b.a)(p,()=>{n({type:r.ClickOutsideInputSpecialty})}),l.createElement(z,{ref:p},l.createElement(c.I.Wrapper,null,l.createElement(c.I,{size:t?"md":"lg",placeholder:d("booking.searchPopup.specialties"),value:(null===(s=null==e?void 0:e.selectedSpecialty)||void 0===s?void 0:s.name)||"",rightSection:l.createElement(I.C,null),styles:m,onFocus:()=>n({type:r.FocusInputSpecialty}),onChange:e=>{g(e.target.value)}})),"specialty"===e.focused&&l.createElement(_,null,l.createElement(H,{key:"all-location",role:"button",tabIndex:0,onClick:()=>{o&&o({name:d("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:h.SPECIALTIES})}},l.createElement("div",{className:"image-item"},l.createElement(SpecialtyIcon,null)),l.createElement(L.T,{size:"md"},d("booking.searchBar.allSpecialties"))),e.allSpecialties.map(e=>l.createElement(H,{key:e.id,onClick:t=>{t.nativeEvent.stopImmediatePropagation(),o&&o(Object.assign(Object.assign({},e),{total_doctor:0}))},role:"button",tabIndex:0,"aria-label":`Select ${e.name} as location`,isSelected:(null==i?void 0:i.id)===e.id},l.createElement("div",{className:"image-item"},l.createElement("img",{src:e.thumbnail,alt:e.name})),l.createElement(L.T,{size:"md"},e.name)))))},SearchInputs=({state:e,type:t,isMobile:a,isLoading:i,initalSearchValue:o,typeInformation:n,debouncedFetchSearchResults:s,trackingAttributes:d,hideSpecialtySelection:u=!1,clientSlug:p="",focusSearchInput:h,onSearch:m,onEnterSearch:g,dispatch:f})=>{var C;let{t:E}=(0,y.u)(),v=(0,l.useRef)(null),x=(0,l.useMemo)(()=>d?{"data-event-category":d.dataEventCategory,"data-event-action":d.dataEventAction,"data-event-label":d.dataEventLabel}:{},[d]),S=(0,l.useMemo)(()=>"doctor"===t?E("booking.searchBar.placeholder.doctor"):"service"===t?E("booking.searchBar.placeholder.service"):"hospital"===t?E("booking.searchBar.placeholder.hospital"):"specialty"===t?E("booking.searchBar.placeholder.specialty"):"",[t]),w=(0,l.useMemo)(()=>({root:{flex:1,"&.hide-specialty-selection":{".mantine-Input-rightSection":{display:"none"},input:{paddingLeft:"48px"},".mantine-Input-icon":{left:"0"}}}}),[]),L=(0,l.useMemo)(()=>({icon:{left:"165px"},input:{color:"#262626",'&[data-with-icon="true"]':{paddingLeft:"205px",paddingRight:"16px"}},rightSection:{left:0,width:"165px",padding:"1px"}}),[]),I=(0,l.useMemo)(()=>({input:{color:"#262626"}}),[]);(0,b.a)(v,()=>{f({type:r.ClickOutsideInputSearch})});let M=(0,l.useCallback)(function(a){f({type:r.ChangeInputSearch,payload:a}),"function"!=typeof m&&(a.trim().length>j[e.locale]||o||0===a.trim().length?s(a.trim(),e,t,p):(s.cancel(),f({type:r.DisplayInitialSearchResults})))},[f,e,t]),O=(0,l.useCallback)(function(e){f({type:r.SelectSpecialty,payload:e}),h()},[f]),T=(0,l.useCallback)(e=>{13===e.keyCode&&(e.stopPropagation(),e.preventDefault(),g&&g())},[g]);return l.createElement(A,{ref:v},"specialty"===t?l.createElement(c.I.Wrapper,{styles:w},l.createElement(c.I,{icon:l.createElement(k.Z,null),size:a?"md":"lg",placeholder:S,styles:I,value:e.searchKeywords,onFocus:()=>f({type:r.FocusInputSearchSpecialty}),onChange:e=>{M(e.target.value)},onKeyDown:T})):l.createElement(l.Fragment,null,"service"===t?l.createElement(c.I.Wrapper,{styles:w},l.createElement(c.I,{icon:l.createElement(k.Z,null),size:a?"md":"lg",name:"search-results",placeholder:S,onFocus:()=>f({type:r.FocusInputSearch}),value:e.searchKeywords,onChange:e=>{M(e.target.value)},onKeyDown:T})):l.createElement(l.Fragment,null,a&&!u?l.createElement(l.Fragment,null,l.createElement(SearchSpecialty,{state:e,isMobile:a,dispatch:f,debouncedFetchSearchResults:s,onSpecialtyClick:O}),l.createElement(c.I.Wrapper,{styles:w},l.createElement(c.I,{icon:l.createElement(k.Z,null),size:"md",placeholder:S,value:e.searchKeywords,name:"search-results",onFocus:()=>f({type:r.FocusInputSearch}),onChange:e=>{M(e.target.value)},onKeyDown:T}))):l.createElement(c.I.Wrapper,{styles:w,className:u?"hide-specialty-selection":""},l.createElement(c.I,Object.assign({icon:l.createElement(k.Z,null),size:"lg",placeholder:S,styles:L,name:"search-results",autoComplete:"off",value:e.searchKeywords,onChange:e=>{M(e.target.value)},onFocus:()=>f({type:r.FocusInputSearch}),onKeyDown:T},x,{rightSection:u?l.createElement(l.Fragment,null):l.createElement(SearchSpecialty,{state:e,isMobile:a,dispatch:f,debouncedFetchSearchResults:s,onSpecialtyClick:O})})))),"search"===e.focused&&l.createElement(F,null,l.createElement(SearchResult,{type:t,state:e,results:(null===(C=e.searchResults)||void 0===C?void 0:C[t])||[],location:e.selectedLocation.name,dispatch:f,isLoading:i,typeInformation:n,clientSlug:p}))))},V=v.Z.div` position: relative; ${S.M.mbDown} { width: 100%; display: flex; flex-direction: column; gap: 12px; } `,G=v.Z.div` position: absolute; top: calc(100% + 2px); width: 100%; border-radius: 4px; background: ${x.r.colors.white}; box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1); z-index: 10; ${S.M.mbDown} { width: calc(100% + 64px); left: -32px; } `,K=v.Z.div` position: relative; cursor: pointer; padding: 12px 18px; display: flex; align-items: center; gap: 14px; overflow: hidden; ${({isSelected:e})=>e&&` &::after { content: ${g.i}; top: 50%; right: 18px; position: absolute; transform: translateY(-50%); } `} & + li::before { content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 1px; background-color: ${x.r.colors.neutral100}; } &:not([data-is-denied='true']):hover { background-color: ${x.r.colors.neutral50}; } &:last-child:hover { border-bottom-right-radius: 6px; border-bottom-left-radius: 6px; } &:first-child:hover { border-top-right-radius: 6px; border-top-left-radius: 6px; } &[data-is-denied='true'] { cursor: not-allowed; } `,W=(0,v.Z)(g.P)` width: 12px; height: 18px; flex: 0 0 12px; `,SearchLocation=({state:e,isMobile:t,debouncedFetchCitiesByKeyword:a,selectedLocation:i,trackingAttributes:o,onLocationClick:n,dispatch:s})=>{let{t:u,locale:p}=(0,y.u)(),h=(0,l.useRef)(null),m=(0,l.useMemo)(()=>o?{"data-event-category":o.dataEventCategory,"data-event-action":o.dataEventAction,"data-event-label":o.dataEventLabel}:{},[o]),g=(0,l.useCallback)(function(t){s({type:r.ChangeInputLocation,payload:t}),t.trim().length>j[e.locale]?a(t.trim()):(a.cancel(),s({type:r.DisplayInitialCities}))},[a,s]);return(0,b.a)(h,()=>{s({type:r.ClickOutsideInputLocation})}),l.createElement(V,{ref:h},l.createElement(c.I.Wrapper,null,l.createElement(c.I,Object.assign({size:t?"md":"lg",placeholder:"Search location",value:e.searchLocationKeywords,onFocus:()=>s({type:r.FocusInputLocation}),onChange:e=>{g(e.target.value)}},m))),"location"===e.focused&&l.createElement(G,null,l.createElement(d.x,{scrollbarSize:6,styles:{viewport:{maxHeight:400}}},l.createElement(K,{key:"all-location",role:"button",tabIndex:0,onClick:()=>{var e;n&&n({name:u("booking.searchBar.allLocations"),id:E.I,slug:null===(e=E.L[p])||void 0===e?void 0:e.ALL})}},l.createElement(W,{color:x.r.colors.neutral400}),l.createElement(L.T,{size:"md"},u("booking.searchBar.allLocations"))),e.cities.map(e=>l.createElement(K,{key:e.id,onClick:t=>{t.nativeEvent.stopImmediatePropagation(),n&&n(e)},role:"button",tabIndex:0,"aria-label":`Select ${e.name} as location`,isSelected:(null==i?void 0:i.id)===e.id},l.createElement(W,{color:x.r.colors.neutral400}),l.createElement(L.T,{size:"md"},e.name))))))},Y=v.Z.div` display: flex; flex-wrap: wrap; row-gap: 8px; column-gap: 20px; ${S.M.mbDown} { margin-top: 12px; } `,q=v.Z.div` display: flex; align-items: center; border-radius: 8px; border: 1px solid ${x.r.colors.neutral100}; background: ${x.r.colors.white}; padding: 8px 12px 8px 8px; flex: 0 0 calc(33.3% - 13px); gap: 12px; cursor: pointer; &:hover { background: ${x.r.colors.blue50}; } ${S.M.tdDown} { flex: 0 0 calc(50% - 10px); } ${S.M.mbDown} { flex: 0 0 100%; border: none; } .image-item { display: flex; align-items: center; width: 40px; height: 40px; img { width: 100%; object-fit: cover; } } .infor { flex: 1; .title { color: ${x.r.colors.gray800}; font-size: 14px; font-style: normal; font-weight: 400; line-height: 22px; } .description { color: ${x.r.colors.gray600}; font-size: 12px; font-weight: 400; line-height: 18px; } } `,U=(0,v.Z)(u.i)` margin: 24px 0 !important; `,Q=v.Z.div` display: flex; justify-content: center; margin-top: 24px; .show-more { border-radius: 4px; border: 1px solid ${x.r.colors.neutral200}; padding: 12px 16px; cursor: pointer; display: inline-block; color: ${x.r.colors.gray800}; font-size: 16px; font-weight: 600; line-height: 24px; ${S.M.mbDown} { width: 100%; text-align: center; } } `,SearchResultSpecialties=({state:e,isMobile:t,specialties:a,isLoading:i,dispatch:o})=>{let{t:n,locale:c}=(0,y.u)(),{selectedLocation:d}=e,u=(0,l.useMemo)(()=>E.L[c],[c]),handleOnClick=e=>{let t="";e===E.S?(t=`/${d.slug}/${u.HOSPITAL}/${E.C.GSK}/`,o({type:r.ClickOutsideInputSearchSpecialty})):t=`/${d.slug}/${u.DOCTOR}/${e}`,o({type:r.NavigateTo,payload:t})},p=(0,l.useMemo)(()=>a.length>=9||e.searchKeywords.trim().length<=j[e.locale],[e.searchKeywords,a]);return l.createElement(l.Fragment,null,!t&&l.createElement(U,{color:"#E4E8EC"}),l.createElement(Y,null,a.length>0&&!i&&l.createElement(l.Fragment,null,a.map((e,t)=>t>=9?l.createElement(l.Fragment,null):l.createElement(q,{key:e.id,onClick:()=>handleOnClick(e.slug)},l.createElement("div",{className:"image-item"},l.createElement("img",{src:e.thumbnail,alt:e.name})),l.createElement("div",{className:"infor"},l.createElement("div",{className:"title"},e.name))))),0===a.length&&!i&&l.createElement(L.T,{size:"sm",color:x.r.colors.gray400},n("booking.searchBar.noResults")),i&&Array(6).fill(void 0).map((e,t)=>l.createElement(q,{key:"loading"+t},l.createElement("div",{className:"image-item"},l.createElement(s.O,{height:40,animate:!0})),l.createElement("div",{className:"infor"},l.createElement("div",{className:"title"},l.createElement(s.O,{height:20,radius:"sm",animate:!0})))))),p&&l.createElement(Q,null,l.createElement("div",{className:"show-more",onClick:()=>{let e=`/${u.SPECIALTIES}`;o({type:r.NavigateTo,payload:e})}},n("home.seeAll"))))},X=v.Z.div` display: flex; gap: 5px; margin-top: 16px; flex-wrap: wrap; `,J=v.Z.div` color: ${x.r.colors.gray600}; font-size: 14px; font-weight: 600; line-height: 22px; padding: 4px 12px; background: ${x.r.colors.white}; border-radius: 32px; cursor: pointer; border: 1px solid ${x.r.colors.white}; margin-bottom: 5px; border-color: ${x.r.colors.neutral100}; background: #f7f9fc; &.view-all { border-radius: 32px; border-color: ${x.r.colors.blue50}; background: ${x.r.colors.blue50}; color: ${x.r.colors.blue600}; &:hover { border-color: ${x.r.colors.blue50}; background: ${x.r.colors.blue50}; color: ${x.r.colors.blue600}; } } &:hover { border-color: ${x.r.colors.neutral100}; background: #f7f9fc; } `,ee=v.Z.div` color: ${x.r.colors.gray600}; font-size: 14px; font-weight: 600; line-height: 22px; padding: 4px 0; background: ${x.r.colors.white}; border-radius: 32px; border: 1px solid ${x.r.colors.white}; margin-bottom: 5px; margin-right: 7px; `,SearchTag=({state:e,type:t,typeInformation:a,dispatch:i})=>{let{t:o}=(0,y.u)(),{selectedLocation:n}=e,s=(0,l.useMemo)(()=>a[t].slug,[a,t]),handleClickKeyword=e=>{e.url&&(window.location.href=e.url)};return l.createElement(X,null,l.createElement(ee,null,o("booking.searchBar.popularKey")),e.popularKeys.map(e=>l.createElement(J,{key:e.id,onClick:()=>handleClickKeyword(e)},e.keyword)),l.createElement(J,{className:"view-all",onClick:()=>{let e=`/${n.slug}/${s}`;e&&i({type:r.NavigateTo,payload:e})}},o("booking.searchBar.viewAll")))},et=v.Z.div` background: rgba(255, 255, 255, 0.64); backdrop-filter: blur(12px); border-bottom: 1px solid ${x.r.colors.neutral100}; `,ea=(0,v.Z)(w.C)` padding: 0 16px; `,TabSearch=({currentTab:e,hideTabBookingSearch:t=[],hideSpecialtyTab:a,isMobile:i,setCurrentTab:o})=>{let{t:r}=(0,y.u)(),n=(0,l.useMemo)(()=>({root:{overflowY:i?"hidden":"initial",overflowX:i?"auto":"initial"},tabsList:{background:"rgba(255, 255, 255, 0)",borderBottom:"none",flexWrap:"nowrap",".mantine-Tabs-tab":{"&:last-child":{"&:after":{display:"none"}}}},tab:{padding:i?"12px 16px 12px 16px":"15px 40px 15px 40px",borderTop:"2px solid transparent",borderBottom:"none",margin:0,borderRadius:0,position:"relative",width:"auto",'&[data-active="true"]':{borderColor:"#2d87f3",backgroundColor:"#ffffff","&:after":{display:"none"},"&:before":{content:'""',width:"100%",height:"1px",position:"absolute",backgroundColor:"#ffffff",bottom:"-1px"}},"&:hover":{borderColor:"#2d87f3",backgroundColor:"#ffffff","&:before":{content:'""',width:"100%",height:"1px",position:"absolute",backgroundColor:"#ffffff",bottom:"-1px"}},"&:after":{content:'""',width:"1px",height:"24px",backgroundColor:"#E4E8EC",position:"absolute",right:"-1px"}},tabLabel:{color:"#595959",fontSize:i?"14px":"16px",fontWeight:600,lineHeight:i?"22px":"24px"}}),[i]),s=(0,l.useMemo)(()=>[{value:"hospital",label:r("booking.searchPopup.hospitals")},{value:"doctor",label:r("booking.searchPopup.doctors")},{value:"service",label:r("booking.searchPopup.services")},...a?[]:[{value:"specialty",label:r("booking.searchPopup.specialties")}]],[a]),c=(0,l.useMemo)(()=>s.filter(e=>!t.includes(e.value))||[],[t,s]);return l.createElement(et,{className:"booking-search-tab"},l.createElement(ea,null,l.createElement(p.m,{value:e,onTabChange:e=>{o(e)},styles:n},l.createElement(p.m.List,null,c.map(e=>l.createElement(p.m.Tab,{value:e.value,key:e.value},e.label))))))};(o=n||(n={})).doctor="doctor",o.service="hospital_service",o.hospital="hospital_branch";let ignoreCacarSpecialty=e=>e.filter(e=>"string"==typeof e?"cacar-api"!==e:(null==e?void 0:e.id)!==232),BookingSearchBarV2=({isMobile:e,careApiDomain:t,geoLocationPermission:a,geoLocationCoordinates:i,initialSelectedCity:o,initialSearchValue:s="",initTypeSearch:c="hospital",initSpecialty:d,careFrontDomain:u="/care",isDebug:p=!1,gaTrackingSearchBar:f,gaTrackingLocationSearch:v,autoCompleteDisabled:x=!1,inputSearchPlaceholder:S="",hideTabBookingSearch:w=[],hideSpecialtySelection:k=!1,hideSpecialtyTab:L=!1,hidePopularSearchKeys:I=!1,clientSlug:A="",routerPush:F,onGeoLocationPermissionChange:$,onChangeLocation:N})=>{let{locale:Z,t:D}=(0,y.u)(),z=(0,l.useRef)(null),_=(0,l.useRef)(null),[H,V]=(0,l.useState)(c),{geoLocationPermission:G,geoLocationCoordinates:K}=(0,g.u)(),[W,Y]=(0,l.useReducer)(reducer,B,t=>Object.assign(Object.assign({},t),{isDebug:p,isMobile:e,geoLocationPermission:a||G||"unset",geoLocationCoordinates:i||K||null,searchKeywords:s,initialSelectedCity:o||null,selectedLocation:o||t.selectedLocation||null,searchLocationKeywords:(null==o?void 0:o.name)||t.searchLocationKeywords,autoCompleteDisabled:x,inputSearchPlaceholder:S,locale:Z})),{navigateTo:q,focusedSpecialty:U,searchKeywords:Q,geoLocationPermission:X,selectedLocation:J,selectedSpecialty:ee,initialSelectedCity:et,searchResults:ea,isLoadingSearchResults:ei}=W,{fetchCitiesByLocation:eo,fetchCitiesByKeyword:er,fetchSearchResults:en,fetchAllSpecialties:el,fetchPopularKeys:es}=function({dispatch:e,careApiDomain:t,locale:a="vi-VN",client:i=""}){let o=(0,l.useCallback)(function(i,o={}){let n=`${t}${i}`;return e({type:r.FetchCitiesStart}),fetch((0,g.h)(n,o,a),{method:"GET"}).then(e=>e.json()).then(e=>1===e._status&&e._data?null==e?void 0:e._data:(console.log("error loading cities",e),Promise.reject(e))).finally(()=>e({type:r.FetchCitiesFinish}))},[a]),s=(0,l.useCallback)(function({coordinates:t}){let n={},l={};t&&(n={lat:t.lat,lng:t.lng}),"ms-MY"===a&&(l.noPaging=1);let s=[o(M.P.GET_CITY_BY_IP,Object.assign(Object.assign(Object.assign({},n),l),{client:E.C.MSD===i?"":i}))];return"zh-TW"===a?s.push(o(M.P.GET_CITIES_LIST,{noPaging:1,client:E.C.MSD===i?"":i})):s.push(o(M.P.GET_CITIES_LIST)),Promise.all(s).then(([t,a])=>{let i=Object.assign({},t);if(a){let e=i.cities.map(e=>e.id);i.cities=i.cities.concat(a.cities.filter(t=>!e.includes(t.id)))}e({type:r.FetchCitiesByGeoIpComplete,payload:i})}).catch(e=>console.error("error loading cities by location",e))},[a,t,e]),c=(0,l.useCallback)(function(t){return o(M.P.GET_CITIES_LIST,{keyword:t,client:i}).then(t=>{e({type:r.FetchCitiesByKeywordComplete,payload:t.cities})}).catch(e=>console.error("error loading cities by keyword",e))},[a,t,e]),d=(0,l.useCallback)(function(o,n,l,s,c){let d="specialty"===l?`${t}${M.P.GET_SEARCH_SPECIALTY}`:`${t}${M.P.GET_SEARCH_V2}`;e({type:r.FetchSearchResultsStart});let{selectedLocation:u,geoLocationCoordinates:p,selectedSpecialty:h}=n,m="";if(!u){e({type:r.FetchSearchResultsFinish});return}m=u.id===E.I?"":u.id;let b=(null==p?void 0:p.lat)||"",y=(null==p?void 0:p.lng)||"",f=(null==h?void 0:h.id)>0?null==h?void 0:h.id:"",C=o.trim().length>j[a]?o.trim():"";return fetch((0,g.h)(d,Object.assign({domain:t,searchType:l||"global",keyword:C,city:m===E.a?"":m,lat:b,lng:y,specialty_id:f,client_slug:E.C.MSD===s?"":s,msd:E.C.MSD===i?1:""},"doctor"===l&&{skipBooking:1}),a),{method:"GET",headers:{accept:"version=2.0.0.0"}}).then(e=>e.json()).then(e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e)).then(t=>{let a=[];"specialty"!==l&&(a="doctor"===l?t.searches.map(e=>Object.assign(Object.assign({},e),{specialties:ignoreCacarSpecialty((null==e?void 0:e.specialties)||[])})):t.searches),"specialty"===l&&(a=C?ignoreCacarSpecialty((null==t?void 0:t.specialties)||[]):ignoreCacarSpecialty((null==t?void 0:t.default)||[])),e({type:r.FetchSearchResultsComplete,payload:{key:l,searches:a||[]}}),c&&e({type:r.UpdateInitialSearchResults,payload:{key:l,searches:a||[]}})}).catch(e=>{console.log("error loading search results",{url:d,error:e})}).finally(()=>e({type:r.FetchSearchResultsFinish}))},[a,t,e]),u=(0,l.useCallback)(function(){let o=`${t}${M.P.GET_SEARCH_SPECIALTY}`;return fetch((0,g.h)(o,{domain:t,searchType:"",msd:E.C.MSD===i?1:""},a),{method:"GET",headers:{accept:"version=2.0.0.0"}}).then(e=>e.json()).then(e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e)).then(t=>{e({type:r.FetchAllSpecialties,payload:ignoreCacarSpecialty(t.specialties||[])})}).catch(e=>{console.log("error loading search results",{url:o,error:e})})},[a,t,e]),p=(0,l.useCallback)(function(i){let o=`${t}${M.P.GET_SEARCH_POPULAR_KEY}`;return fetch((0,g.h)(o,{domain:t,searchType:n[i],sort_by:"display_order",sort_order:"asc"},a)).then(e=>e.json()).then(e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e)).then(t=>{e({type:r.FetchPopularKeys,payload:t.popular_searches||[]})}).catch(e=>{console.log("error loading search results",{url:o,error:e})})},[a,t,e]);return{fetchCitiesByLocation:s,fetchCitiesByKeyword:c,fetchSearchResults:d,fetchAllSpecialties:u,fetchPopularKeys:p}}({dispatch:Y,locale:Z,careApiDomain:t,client:A}),ec=(0,l.useMemo)(()=>E.L[Z],[Z]),ed=(0,l.useMemo)(()=>Object.assign({doctor:{name:D("booking.searchPopup.doctors"),icon:l.createElement(DoctorIcon,null),slug:ec.DOCTOR},service:{name:D("booking.searchPopup.services"),icon:l.createElement(ServiceIcon,null),slug:ec.SERVICE},hospital:{name:D("booking.searchPopup.hospitals"),icon:l.createElement(HospitalIcon,null),slug:ec.HOSPITAL}},!L&&{specialty:{name:D("booking.searchPopup.specialties"),icon:l.createElement(SpecialtyIcon,null),slug:ec.SPECIALTIES}}),[H]),eu=(0,l.useMemo)(()=>C()(er,400),[er]),ep=(0,l.useMemo)(()=>C()(en,400),[en]),eh=(0,l.useCallback)(function(e){Y({type:r.SelectLocation,payload:e}),focusSearchInput(),N&&N(e)},[D,Y]);function focusSearchInput(){var e;z.current&&(null===(e=z.current.querySelector('input[name="search-results"]'))||void 0===e||e.focus())}function onClickSearchByKeyword(){let e="",{slug:t}=ed[H],a="",i=E.M[Z][A];("doctor"===H||"hospital"===H)&&W.selectedSpecialty.id>0&&(a=`&specialtyId=${W.selectedSpecialty.id}`),e="specialty"===H?`/${t}`:`/${J.slug}/${t}`,i&&(e+=`/${i}`),(e+=`?q=${Q}${a}`)&&Y({type:r.NavigateTo,payload:e})}return(0,b.a)(_,()=>{Y({type:r.ClickOutsideInputSearchSpecialty})}),(0,l.useEffect)(()=>{var t;"denied"===X||et||Y({type:r.SelectLocation,payload:{name:D("booking.searchBar.allLocations"),id:E.I,slug:null===(t=E.L[Z])||void 0===t?void 0:t.ALL}}),$&&$(X,W.geoLocationCoordinates),e&&"granted"===X&&J&&Y({type:r.FocusInputSearch}),eo({coordinates:W.geoLocationCoordinates})},[X]),(0,l.useEffect)(()=>{let e=d||{name:D("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:ec.SPECIALTIES};W.selectedSpecialty||Y({type:r.SelectSpecialty,payload:e})},[d,W.selectedSpecialty]),(0,l.useEffect)(()=>{el()},[]),(0,l.useEffect)(()=>{es(H)},[H]),(0,l.useEffect)(()=>{q&&(F?F(q):window.location.href=`${u}${q}`)},[q]),(0,l.useEffect)(()=>{en(W.searchKeywords,W,H,A,!0)},[J,ee,H]),l.createElement(O,{ref:z},l.createElement(TabSearch,{currentTab:H,setCurrentTab:V,isMobile:e,hideTabBookingSearch:w,hideSpecialtyTab:L}),l.createElement(T,{className:"booking-search-container"},l.createElement(R,null,l.createElement(P,{className:"booking-search-content"},l.createElement("div",{ref:_},l.createElement(h.k,{gap:"12px",justify:"space-between",align:"center",direction:e?"column":"row",className:"flex-search-input"},"specialty"!==H&&l.createElement(SearchLocation,{state:W,isMobile:e,dispatch:Y,debouncedFetchCitiesByKeyword:eu,selectedLocation:J,onLocationClick:eh,trackingAttributes:v}),l.createElement(SearchInputs,{type:H,isMobile:e,state:W,dispatch:Y,debouncedFetchSearchResults:ep,initalSearchValue:s,focusSearchInput:focusSearchInput,onEnterSearch:onClickSearchByKeyword,typeInformation:ed,trackingAttributes:f,isLoading:ei,hideSpecialtySelection:k||L,clientSlug:A}),l.createElement(m.z,{size:e?"md":"lg",color:"#2D87F3",fullWidth:e,variant:"filled",onClick:onClickSearchByKeyword,styles:{root:{height:e?"40px":"48px"}}},D("booking.searchBar.searchButton"))),!I&&"specialty"!==H&&W.popularKeys.length>0&&l.createElement(SearchTag,{type:H,state:W,typeInformation:ed,dispatch:Y}),"specialty"===H&&"search"===U&&l.createElement(SearchResultSpecialties,{state:W,isMobile:e,dispatch:Y,specialties:(null==ea?void 0:ea.specialty)||[],isLoading:ei}))))))}}}]);