"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4291],{"/2rn":function(e,t,a){a.d(t,{D:function(){return DueDateForm},a:function(){return M}});var n,l,i,r,o=a("HJpP"),s=a("q1tI"),c=a("8vDj"),d=a("iuhU"),u=a("DA0W"),p=a("SPK5"),m=a("FQtM"),h=a("Eso5"),g=a("25AQ"),b=a("Ec0D"),C=a("Bw1v"),f=a("cChf"),E=a("ZFu2"),v=a("Wgwc"),y=a.n(v),x=a("StZb"),w=a("RL1p"),S=a("oZWv"),P=a("L+vc"),k=a("1iCw"),I=a("fkrl"),L=a("SlSK"),O=a("NGsg"),D=a("iBNF");(n=i||(i={}))[n.lastPeriod=0]="lastPeriod",n[n.conception=1]="conception",n[n.IVF=2]="IVF",n[n.IUI=3]="IUI",n[n.ultrasound=4]="ultrasound";let T={[String(i.lastPeriod)]:{value:String(i.lastPeriod),icon:b.L,label:"dueDatePage.lastPeriod"},[String(i.IVF)]:{value:String(i.IVF),icon:e=>{var{isMarryBaby:t,size:a=24}=e,n=(0,o._)(e,["isMarryBaby","size"]);let l=Object.assign({width:a,height:a},n);return t?s.createElement("svg",Object.assign({viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l),s.createElement("path",{d:"M15.804 28.278a3.16 3.16 0 0 1-3.18-3.208l.128-20.306 6.405.008-.128 20.307c-.012 1.757-1.452 3.191-3.225 3.2",fill:"#fff"}),s.createElement("path",{d:"m12.72 10.266-.116 14.788c-.011 1.757 1.423 3.197 3.18 3.208 1.774-.008 3.214-1.442 3.225-3.2V10.267",fill:"#FFEAF1"}),s.createElement("circle",{cx:"14.662",cy:"19.027",transform:"rotate(-49.83 14.662 19.027)",fill:"#3E3F58",r:"1.012"}),s.createElement("circle",{cx:"16.326",cy:"13.426",r:"1.012",transform:"rotate(-49.83 16.326 13.426)",fill:"#3E3F58"}),s.createElement("path",{d:"m14.662 19.026.087 1.022a.98.98 0 0 0 .344.667.98.98 0 0 1 .32.98l-.123.51m1.036-8.779.087 1.022a.98.98 0 0 0 .344.666.98.98 0 0 1 .32.98l-.123.511",stroke:"#3E3F58"}),s.createElement("path",{d:"M18.833 27.597a3.94 3.94 0 0 1-3.02 1.408 4 4 0 0 1-2.795-1.148 3.98 3.98 0 0 1-1.14-2.795l.108-20.553c0-.426.344-.756.753-.738.426 0 .757.345.738.754l-.108 20.553c.002.656.248 1.256.697 1.733a2.42 2.42 0 0 0 1.727.706 2.483 2.483 0 0 0 2.47-2.462l.109-20.553c0-.426.344-.757.753-.738.426 0 .757.344.738.754l-.108 20.553a3.85 3.85 0 0 1-.922 2.526",fill:"#202135"}),s.createElement("path",{d:"M20.753 4.975a.75.75 0 0 1-.58.262l-8.714-.027a.727.727 0 0 1-.738-.754c0-.425.344-.756.754-.737l8.713.026c.426 0 .756.344.738.754a.66.66 0 0 1-.173.476",fill:"#202135"})):s.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l),s.createElement("path",{d:"M13.064 5.794a17.8 17.8 0 0 1 3.34-4.638l4.26 2.881a17.8 17.8 0 0 0-3.272 4.507l-1.08 2.12a.65.65 0 0 0 .124.76 7.9 7.9 0 0 1 2.296 4.81c.027.265-1.141 5.997-9.376 5.573-1.587-.082-5.724-1.269-6.12-2.86a8 8 0 0 1-.233-2.161c.124-4.165 3.718-7.648 7.884-7.647h.098a.65.65 0 0 0 .59-.36z",fill:"#BCDEFF"}),s.createElement("path",{d:"M20.75 3.234 16.696.496a.886.886 0 1 0-.992 1.469l4.056 2.738a.886.886 0 0 0 .992-1.469",fill:"#E3F2FF"}),s.createElement("path",{d:"M18.771 17.024a7.87 7.87 0 0 1-2.7 5.944A4.2 4.2 0 0 1 13.301 24H8.473a4.2 4.2 0 0 1-2.769-1.03 7.9 7.9 0 0 1-2.468-4.023c.924.468 2.191.805 3.922.805 1.142 0 2.01-.346 2.775-.834q.323-.21.629-.446c1.973-1.516 3.524-3.668 8.17-2.238q.04.39.04.79",fill:"#2D87F3"}),s.createElement("path",{d:"M11.858 15.5c-1.78.348-3.096-1.608-2.134-3.121a2.06 2.06 0 0 1 1.529-.944q.303-.03.588.025a.27.27 0 0 0 .268-.107c.282-.373.737-.573 1.2-.639.224-.031.374-.24.379-.44.021-.794.657-1.311 1.288-1.234.183.022.223.27.058.35l-.012.006a.9.9 0 0 0-.28.196c-.213.263-.187.407-.153.6.03.167.066.37-.04.715a1.45 1.45 0 0 1-.504.7c-.255.19-.445.23-.592.263-.088.019-.16.034-.223.076a.27.27 0 0 0-.07.379c.184.27.306.587.344.934a2.063 2.063 0 0 1-1.646 2.24",fill:"#fff"}),s.createElement("ellipse",{cx:"10",cy:"20.5",rx:"3",ry:"2.5",fill:"#FF6F4D"}))},label:"dueDatePage.ivf"},[String(i.conception)]:{value:String(i.conception),icon:e=>{var{isMarryBaby:t,size:a=24}=e,n=(0,o._)(e,["isMarryBaby","size"]);let l=Object.assign({width:a,height:a},n);return t?s.createElement("svg",Object.assign({viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l),s.createElement("path",{d:"M16.5 27.133c1.298 0 2.596-.149 3.868-.447a9.15 9.15 0 0 0 6.818-6.818 16.94 16.94 0 0 0 0-7.736 9.15 9.15 0 0 0-6.818-6.818 16.94 16.94 0 0 0-7.736 0 9.15 9.15 0 0 0-6.818 6.818A17 17 0 0 0 5.367 16a.867.867 0 1 1-1.734 0c0-1.43.165-2.862.494-4.264a10.88 10.88 0 0 1 8.109-8.11 18.7 18.7 0 0 1 8.528 0 10.88 10.88 0 0 1 8.11 8.11 18.7 18.7 0 0 1 0 8.528 10.88 10.88 0 0 1-8.11 8.11 18.7 18.7 0 0 1-4.264.493.867.867 0 0 1 0-1.734",fill:"#3E3F58"}),s.createElement("path",{d:"M11.633 16a4.867 4.867 0 1 1 9.734 0 4.867 4.867 0 0 1-9.734 0m4.867-3.133a3.133 3.133 0 1 0 0 6.266 3.133 3.133 0 0 0 0-6.266",fill:"#E85388"}),s.createElement("path",{d:"M9.834 25.333a2.667 2.667 0 1 0-2.298-1.312l-.084.084a3.25 3.25 0 0 0-.952 2.298c0 .726-.41 1.39-1.06 1.715l-1.238.619a.667.667 0 0 0 .596 1.193l1.24-.62a3.25 3.25 0 0 0 1.796-2.907c0-.508.202-.995.561-1.355l.084-.084c.397.235.86.37 1.355.37",fill:"#3E3F58"})):s.createElement("svg",Object.assign({width:a,height:a,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l),s.createElement("circle",{cx:"9",cy:"6.75",fill:"#91CAFF",r:"6.75"}),s.createElement("circle",{cx:"9",cy:"6.75",fill:"#2D87F3",r:"5.4"}),s.createElement("path",{d:"M1.789 12.2a.245.245 0 0 1-.02-.489c.073-.006 1.795-.167 1.761-1.605-.013-.587.15-1.057.485-1.397.524-.53 1.273-.528 1.305-.527a.245.245 0 0 1-.002.49h-.002c-.011 0-.582.004-.955.385-.236.24-.351.59-.34 1.038.018.793-.367 1.41-1.114 1.787a3.3 3.3 0 0 1-1.118.319M.75 17.774a.245.245 0 0 1 .226-.263c.073-.006 1.786-.162 1.749-1.593-.016-.586.146-1.055.48-1.392.521-.528 1.27-.524 1.3-.523a.245.245 0 0 1-.006.49c-.015 0-.58.004-.949.38q-.352.362-.335 1.033c.02.791-.362 1.406-1.106 1.78a3.3 3.3 0 0 1-1.095.313.245.245 0 0 1-.263-.225",fill:"#D2D6DC"}),s.createElement("path",{d:"M8.659 5.035c-.562-.561-1.956-.078-2.699.665-.407.407-.635.91-.665 1.373v.124l1.145 1.16.181.042c.464-.03.966-.258 1.373-.665.743-.743 1.226-2.137.665-2.699",fill:"#E3F2FF"}),s.createElement("path",{d:"m5.295 7.073-.292.75a.55.55 0 0 0 .124.589l.155.155a.55.55 0 0 0 .589.124l.75-.292z",fill:"#91CAFF"}),s.createElement("path",{d:"M8.098 11.358a.87.87 0 0 0-.233-.523c-.562-.562-1.956-.079-2.699.664-.407.408-.635.91-.665 1.373v.125l1.146 1.16.18.042c.464-.03.966-.258 1.374-.666.566-.566.98-1.51.897-2.175",fill:"#E3F2FF"}),s.createElement("path",{d:"m4.5 12.872-.29.75a.55.55 0 0 0 .123.589l.156.155a.55.55 0 0 0 .588.124l.75-.292z",fill:"#91CAFF"}))},label:"dueDatePage.conceptionDate"},[String(i.IUI)]:{value:String(i.IUI),icon:e=>{var{isMarryBaby:t,size:a=24}=e,n=(0,o._)(e,["isMarryBaby","size"]);let l=Object.assign({width:a,height:a},n);return s.createElement("svg",Object.assign({width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l),s.createElement("ellipse",{cx:"10",cy:"7.5",rx:"7.5",ry:"7.5",fill:"#91CAFF"}),s.createElement("ellipse",{cx:"10",cy:"7.5",rx:"6",ry:"6",fill:"#2D87F3"}),s.createElement("path",{d:"M1.98877 13.5566C1.8483 13.5566 1.72914 13.4487 1.71769 13.3062C1.7056 13.1563 1.81732 13.025 1.9672 13.013C2.04819 13.0061 3.96085 12.8267 3.92397 11.2296C3.90887 10.5766 4.09013 10.0544 4.46266 9.6775C5.04496 9.08834 5.87737 9.09055 5.91289 9.09138C6.06324 9.09309 6.18376 9.21636 6.18204 9.36675C6.18033 9.51603 6.05877 9.63593 5.90985 9.63593C5.9091 9.63593 5.90835 9.63593 5.9076 9.63593C5.8958 9.63593 5.26174 9.64041 4.84671 10.0637C4.58418 10.3314 4.4569 10.7194 4.46838 11.2171C4.48874 12.0983 4.06094 12.7846 3.23124 13.202C2.63342 13.5027 2.03606 13.5537 2.01095 13.5558C2.00351 13.5563 1.99611 13.5566 1.98877 13.5566Z",fill:"#D2D6DC"}),s.createElement("path",{d:"M0.834813 19.7487C0.823187 19.5988 0.935297 19.4678 1.08522 19.4562C1.16581 19.4496 3.06971 19.2768 3.02807 17.6868C3.011 17.0352 3.1904 16.5146 3.56121 16.1394C4.14076 15.5531 4.97192 15.5577 5.00687 15.5587C5.15722 15.5608 5.27734 15.6845 5.27516 15.8349C5.27301 15.9849 5.15117 16.106 4.99993 16.1032C4.99989 16.1032 4.99982 16.1032 4.99975 16.1032C4.98315 16.1032 4.35528 16.1074 3.9453 16.5255C3.68491 16.791 3.55946 17.177 3.57245 17.6725C3.59545 18.552 3.17051 19.2358 2.34353 19.6499C1.74807 19.948 1.15233 19.9971 1.12728 19.9991C0.976577 20.0107 0.846367 19.898 0.834813 19.7487Z",fill:"#D2D6DC"}),s.createElement("path",{d:"M9.62226 5.59508C8.99818 4.971 7.44969 5.50769 6.62421 6.33313C6.1713 6.78604 5.91828 7.34408 5.88477 7.85874V7.99721L7.15753 9.28601L7.35857 9.33258C7.87323 9.29906 8.43127 9.04605 8.88418 8.59314C9.70966 7.76766 10.2463 6.21916 9.62226 5.59508Z",fill:"#E3F2FF"}),s.createElement("path",{d:"M5.88516 7.85889L5.5611 8.69259C5.47325 8.91856 5.52723 9.17508 5.69865 9.3465L5.87139 9.51925C5.95823 9.60609 6.06693 9.66256 6.18243 9.68584C6.29486 9.70856 6.4137 9.70005 6.52509 9.65676L7.3588 9.3327L5.88516 7.85889Z",fill:"#91CAFF"}),s.createElement("path",{d:"M8.99894 12.6201C8.97018 12.3889 8.88805 12.1875 8.73945 12.0389C8.11537 11.4149 6.56687 11.9515 5.7414 12.777C5.28849 13.2299 5.03547 13.7879 5.00195 14.3026V14.4411L6.27493 15.7298L6.47597 15.7764C6.99063 15.7429 7.54867 15.4898 8.00158 15.0369C8.63034 14.4081 9.09073 13.3598 8.99894 12.6201Z",fill:"#E3F2FF"}),s.createElement("path",{d:"M5.00235 14.3027L4.67829 15.1364C4.59043 15.3624 4.64441 15.6189 4.81583 15.7904L4.98858 15.9631C5.07542 16.0499 5.18412 16.1064 5.29962 16.1297C5.41205 16.1524 5.53089 16.1439 5.64228 16.1006L6.47598 15.7766L5.00235 14.3027Z",fill:"#91CAFF"}))},label:"dueDatePage.IUI"},[String(i.ultrasound)]:{value:String(i.ultrasound),icon:e=>{var{isMarryBaby:t,size:a=24}=e,n=(0,o._)(e,["isMarryBaby","size"]);let l=Object.assign({width:a,height:a},n);return s.createElement("svg",Object.assign({width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l),s.createElement("g",{clipPath:"url(#clip0_5646_32454)"},s.createElement("path",{d:"M17.278 1.47119H2.7207C2.03035 1.47119 1.4707 2.03084 1.4707 2.72119V17.2785C1.4707 17.9689 2.03035 18.5285 2.7207 18.5285H17.278C17.9684 18.5285 18.528 17.9689 18.528 17.2785V2.72119C18.528 2.03084 17.9684 1.47119 17.278 1.47119Z",fill:"#65B5FF"}),s.createElement("path",{d:"M11.23 9.94794C12.1285 10.4395 11.7085 11.7187 10.9077 11.7734C10.1386 11.8261 9.79346 11.6067 9.12721 11.1589C8.74409 10.9014 8.11299 9.67872 7.93815 9.36872C7.74008 9.01332 7.58143 8.63733 7.46503 8.24747C7.31862 7.75122 7.71315 7.30122 8.03987 7.31731C8.09475 7.32086 8.14794 7.33765 8.19491 7.36625C8.24188 7.39485 8.28122 7.43441 8.30956 7.48153C8.3227 7.49619 8.33867 7.50803 8.3565 7.51636C8.37433 7.52469 8.39367 7.52933 8.41334 7.53C8.43301 7.53067 8.45261 7.52736 8.47097 7.52027C8.48933 7.51317 8.50607 7.50244 8.52018 7.48872C8.55856 7.44827 8.60864 7.42084 8.66339 7.41028C8.71814 7.39972 8.77482 7.40655 8.82549 7.42981C9.03081 7.56731 8.99503 7.80294 9.13081 8.11544C9.34088 8.4938 9.61306 8.83417 9.93596 9.12231C10.3217 9.44809 10.5785 9.59138 11.23 9.94794Z",fill:"#2B62CD"}),s.createElement("path",{d:"M19.5332 1.54781C19.5129 1.54783 19.4928 1.54386 19.4741 1.53611C19.4553 1.52836 19.4383 1.51699 19.424 1.50265C19.4096 1.48832 19.3982 1.47129 19.3904 1.45255C19.3827 1.43381 19.3787 1.41372 19.3787 1.39344V0.932812C19.3784 0.850311 19.3455 0.771271 19.2872 0.712933C19.2288 0.654596 19.1498 0.621695 19.0673 0.621406H18.6066C18.5665 0.62013 18.5285 0.603298 18.5006 0.574472C18.4726 0.545646 18.457 0.507087 18.457 0.466953C18.457 0.42682 18.4726 0.38826 18.5006 0.359434C18.5285 0.330608 18.5665 0.313776 18.6066 0.3125H19.0673C19.2317 0.312707 19.3894 0.378127 19.5057 0.494414C19.622 0.6107 19.6874 0.768359 19.6876 0.932812V1.39344C19.6876 1.43438 19.6713 1.47365 19.6424 1.5026C19.6134 1.53155 19.5742 1.54781 19.5332 1.54781Z",fill:"#2D87F3"}),s.createElement("path",{d:"M0.689531 1.54789C0.648588 1.54789 0.609323 1.53163 0.580372 1.50268C0.551421 1.47372 0.535156 1.43446 0.535156 1.39352V0.932891C0.535363 0.768356 0.600848 0.610626 0.717236 0.494326C0.833623 0.378027 0.991403 0.312661 1.15594 0.312578H1.61641C1.6371 0.31192 1.65772 0.315428 1.67703 0.322893C1.69635 0.330359 1.71397 0.34163 1.72884 0.356038C1.74371 0.370445 1.75554 0.387695 1.76361 0.406762C1.77169 0.425829 1.77585 0.446324 1.77585 0.467031C1.77585 0.487738 1.77169 0.508234 1.76361 0.527301C1.75554 0.546368 1.74371 0.563618 1.72884 0.578025C1.71397 0.592432 1.69635 0.603703 1.67703 0.611169C1.65772 0.618635 1.6371 0.622143 1.61641 0.621484H1.15594C1.07325 0.621484 0.993926 0.654258 0.935352 0.712626C0.876779 0.770995 0.843727 0.8502 0.843437 0.932891V1.39352C0.843438 1.43438 0.827238 1.47357 0.798388 1.50251C0.769538 1.53145 0.730393 1.54777 0.689531 1.54789Z",fill:"#2D87F3"}),s.createElement("path",{d:"M19.0673 19.4648H18.6066C18.5665 19.4636 18.5285 19.4467 18.5006 19.4179C18.4726 19.3891 18.457 19.3505 18.457 19.3104C18.457 19.2702 18.4726 19.2317 18.5006 19.2029C18.5285 19.174 18.5665 19.1572 18.6066 19.1559H19.0673C19.1498 19.1556 19.2288 19.1227 19.2872 19.0644C19.3455 19.0061 19.3784 18.927 19.3787 18.8445V18.3841C19.378 18.3634 19.3815 18.3427 19.389 18.3234C19.3965 18.3041 19.4077 18.2865 19.4221 18.2716C19.4365 18.2567 19.4538 18.2449 19.4729 18.2368C19.4919 18.2288 19.5124 18.2246 19.5331 18.2246C19.5538 18.2246 19.5743 18.2288 19.5934 18.2368C19.6125 18.2449 19.6297 18.2567 19.6441 18.2716C19.6585 18.2865 19.6698 18.3041 19.6773 18.3234C19.6847 18.3427 19.6882 18.3634 19.6876 18.3841V18.8441C19.6875 19.0086 19.6221 19.1664 19.5058 19.2828C19.3895 19.3991 19.2318 19.4646 19.0673 19.4648Z",fill:"#2D87F3"}),s.createElement("path",{d:"M1.40625 19.6875H0.940156C0.773755 19.6873 0.614228 19.6211 0.496565 19.5034C0.378901 19.3858 0.312707 19.2262 0.3125 19.0598V18.5938C0.3125 18.5523 0.328962 18.5126 0.358265 18.4833C0.387567 18.454 0.42731 18.4375 0.46875 18.4375C0.51019 18.4375 0.549933 18.454 0.579235 18.4833C0.608538 18.5126 0.625 18.5523 0.625 18.5938V19.0595C0.624979 19.1009 0.633115 19.1419 0.648942 19.1802C0.664769 19.2185 0.687977 19.2532 0.717242 19.2825C0.746507 19.3118 0.781256 19.3351 0.819503 19.3509C0.857751 19.3668 0.898749 19.375 0.940156 19.375H1.40625C1.44769 19.375 1.48743 19.3915 1.51674 19.4208C1.54604 19.4501 1.5625 19.4898 1.5625 19.5312C1.5625 19.5727 1.54604 19.6124 1.51674 19.6417C1.48743 19.671 1.44769 19.6875 1.40625 19.6875Z",fill:"#2D87F3"}),s.createElement("path",{d:"M3.95953 2.8125H2.65625C2.61481 2.8125 2.57507 2.79604 2.54576 2.76674C2.51646 2.73743 2.5 2.69769 2.5 2.65625C2.5 2.61481 2.51646 2.57507 2.54576 2.54576C2.57507 2.51646 2.61481 2.5 2.65625 2.5H3.95953C4.00097 2.5 4.04071 2.51646 4.07002 2.54576C4.09932 2.57507 4.11578 2.61481 4.11578 2.65625C4.11578 2.69769 4.09932 2.73743 4.07002 2.76674C4.04071 2.79604 4.00097 2.8125 3.95953 2.8125Z",fill:"#2D87F3"}),s.createElement("path",{d:"M17.3443 14.9688H16.7285C16.6871 14.9688 16.6473 14.9523 16.618 14.923C16.5887 14.8937 16.5723 14.8539 16.5723 14.8125C16.5723 14.7711 16.5887 14.7313 16.618 14.702C16.6473 14.6727 16.6871 14.6562 16.7285 14.6562H17.3443C17.3857 14.6562 17.4255 14.6727 17.4548 14.702C17.4841 14.7313 17.5005 14.7711 17.5005 14.8125C17.5005 14.8539 17.4841 14.8937 17.4548 14.923C17.4255 14.9523 17.3857 14.9688 17.3443 14.9688Z",fill:"#2D87F3"}),s.createElement("path",{d:"M17.3443 16.3027H16.7285C16.6871 16.3027 16.6473 16.2863 16.618 16.257C16.5887 16.2277 16.5723 16.1879 16.5723 16.1465C16.5723 16.105 16.5887 16.0653 16.618 16.036C16.6473 16.0067 16.6871 15.9902 16.7285 15.9902H17.3443C17.3857 15.9902 17.4255 16.0067 17.4548 16.036C17.4841 16.0653 17.5005 16.105 17.5005 16.1465C17.5005 16.1879 17.4841 16.2277 17.4548 16.257C17.4255 16.2863 17.3857 16.3027 17.3443 16.3027Z",fill:"#2D87F3"}),s.createElement("path",{d:"M17.3443 13.6499H16.7285C16.6871 13.6499 16.6473 13.6334 16.618 13.6041C16.5887 13.5748 16.5723 13.5351 16.5723 13.4937C16.5723 13.4522 16.5887 13.4125 16.618 13.3832C16.6473 13.3539 16.6871 13.3374 16.7285 13.3374H17.3443C17.3857 13.3374 17.4255 13.3539 17.4548 13.3832C17.4841 13.4125 17.5005 13.4522 17.5005 13.4937C17.5005 13.5351 17.4841 13.5748 17.4548 13.6041C17.4255 13.6334 17.3857 13.6499 17.3443 13.6499Z",fill:"#2D87F3"}),s.createElement("path",{d:"M4.99063 3.84375H2.65625C2.61481 3.84375 2.57507 3.82729 2.54576 3.79799C2.51646 3.76868 2.5 3.72894 2.5 3.6875C2.5 3.64606 2.51646 3.60632 2.54576 3.57701C2.57507 3.54771 2.61481 3.53125 2.65625 3.53125H4.99063C5.03207 3.53125 5.07181 3.54771 5.10111 3.57701C5.13041 3.60632 5.14687 3.64606 5.14687 3.6875C5.14687 3.72894 5.13041 3.76868 5.10111 3.79799C5.07181 3.82729 5.03207 3.84375 4.99063 3.84375Z",fill:"#2D87F3"}),s.createElement("path",{d:"M4.99063 4.875H2.65625C2.61481 4.875 2.57507 4.85854 2.54576 4.82924C2.51646 4.79993 2.5 4.76019 2.5 4.71875C2.5 4.67731 2.51646 4.63757 2.54576 4.60826C2.57507 4.57896 2.61481 4.5625 2.65625 4.5625H4.99063C5.03207 4.5625 5.07181 4.57896 5.10111 4.60826C5.13041 4.63757 5.14687 4.67731 5.14687 4.71875C5.14687 4.76019 5.13041 4.79993 5.10111 4.82924C5.07181 4.85854 5.03207 4.875 4.99063 4.875Z",fill:"#2D87F3"}),s.createElement("path",{d:"M17.3443 12.3843H16.7285C16.6871 12.3843 16.6473 12.3678 16.618 12.3385C16.5887 12.3092 16.5723 12.2695 16.5723 12.228C16.5723 12.1866 16.5887 12.1468 16.618 12.1175C16.6473 12.0882 16.6871 12.0718 16.7285 12.0718H17.3443C17.3857 12.0718 17.4255 12.0882 17.4548 12.1175C17.4841 12.1468 17.5005 12.1866 17.5005 12.228C17.5005 12.2695 17.4841 12.3092 17.4548 12.3385C17.4255 12.3678 17.3857 12.3843 17.3443 12.3843Z",fill:"#2D87F3"}),s.createElement("path",{d:"M17.3443 17.6562H16.7285C16.6871 17.6562 16.6473 17.6398 16.618 17.6105C16.5887 17.5812 16.5723 17.5414 16.5723 17.5C16.5723 17.4586 16.5887 17.4188 16.618 17.3895C16.6473 17.3602 16.6871 17.3438 16.7285 17.3438H17.3443C17.3857 17.3438 17.4255 17.3602 17.4548 17.3895C17.4841 17.4188 17.5005 17.4586 17.5005 17.5C17.5005 17.5414 17.4841 17.5812 17.4548 17.6105C17.4255 17.6398 17.3857 17.6562 17.3443 17.6562Z",fill:"#2D87F3"}),s.createElement("path",{d:"M17.0352 17.6563C16.9937 17.6563 16.954 17.6398 16.9247 17.6105C16.8954 17.5812 16.8789 17.5415 16.8789 17.5001V12.228C16.8789 12.1866 16.8954 12.1468 16.9247 12.1175C16.954 12.0882 16.9937 12.0718 17.0352 12.0718C17.0766 12.0718 17.1163 12.0882 17.1456 12.1175C17.1749 12.1468 17.1914 12.1866 17.1914 12.228V17.5001C17.1914 17.5415 17.1749 17.5812 17.1456 17.6105C17.1163 17.6398 17.0766 17.6563 17.0352 17.6563Z",fill:"#2D87F3"}),s.createElement("path",{d:"M8.60596 12.3197C8.54189 12.4053 8.46174 12.4775 8.37002 12.5324C8.13096 12.6807 7.05018 13.0533 5.9919 12.0152C5.72695 11.7747 5.47994 11.5151 5.25284 11.2385C5.07471 11.0041 4.83877 10.959 4.57627 10.5683C4.34659 10.2262 4.36846 9.61991 4.57627 9.35412C4.84502 9.01194 5.32627 8.84022 5.62627 9.49631C5.76534 9.80256 6.47002 10.476 7.0294 10.6262C7.09603 10.6424 7.16404 10.6523 7.23252 10.6558C7.85752 10.6952 8.57627 11.1307 8.74659 11.6512C8.77467 11.766 8.77661 11.8857 8.75227 12.0014C8.72793 12.1172 8.67794 12.2259 8.60596 12.3197Z",fill:"#2B62CD"}),s.createElement("path",{d:"M17.8215 7.60137C17.3465 10.2436 15.2621 10.3982 14.3965 11.2482C13.9965 11.642 14.0606 11.7092 13.9965 12.7201C13.9231 13.8951 13.2621 16.1139 11.0356 16.7654C8.77777 17.4279 6.96371 16.5029 6.00121 14.6982C5.14339 13.0904 4.21527 13.6154 3.00121 13.1811C2.42152 12.9717 2.00433 12.4811 2.01996 11.9748C2.03871 11.3217 2.40902 10.8404 3.37777 11.3217C4.04964 11.6545 4.69496 11.5936 5.30433 11.5201C5.63507 11.4688 5.96971 11.4468 6.30433 11.4545C6.96796 11.5169 7.60602 11.7417 8.16214 12.1092C8.31527 12.2061 8.42621 12.2889 8.48402 12.3342C8.0626 11.9665 7.71478 11.5222 7.45902 11.0248C7.44183 10.9936 7.2848 10.655 7.25589 10.592C6.96136 9.95137 7.39027 9.35606 7.83714 9.35606C7.87141 9.35549 7.9056 9.3597 7.93871 9.36855C8.05114 9.39698 8.14976 9.46457 8.21683 9.55918C8.23545 9.57848 8.25784 9.59375 8.28261 9.60403C8.30738 9.61431 8.334 9.61939 8.36082 9.61895C8.38763 9.61851 8.41407 9.61256 8.43849 9.60147C8.46291 9.59038 8.48479 9.57439 8.50277 9.55449C8.54371 9.50394 8.60167 9.47004 8.66579 9.45911C8.72992 9.44818 8.79583 9.46098 8.85121 9.49512C9.13871 9.66699 8.98871 10.0232 9.19808 10.4342C9.42152 10.8732 10.109 11.3389 10.634 11.2389C11.0293 11.1623 11.8606 10.6811 10.634 10.167C9.94808 9.88105 9.86683 9.48418 9.93558 9.12168C9.96058 8.99356 10.1621 8.41543 10.1653 8.39356C10.1996 8.1248 9.64652 7.69668 10.1653 7.31699C10.4215 7.12949 10.459 6.88262 10.5075 6.56855C10.7934 4.6998 12.02 3.47168 13.9825 3.47168C16.5262 3.47168 18.1418 5.82793 17.8215 7.60137Z",fill:"#2D87F3"}),s.createElement("path",{d:"M11.0678 7.4316C11.006 7.43496 10.9443 7.42333 10.888 7.3977C10.8317 7.37207 10.7824 7.33321 10.7443 7.28441C10.7305 7.26814 10.7201 7.24921 10.7139 7.22877C10.7076 7.20833 10.7056 7.18683 10.708 7.16559C10.7104 7.14436 10.7171 7.12384 10.7278 7.1053C10.7384 7.08677 10.7527 7.07062 10.7699 7.05784C10.787 7.04507 10.8066 7.03594 10.8274 7.03103C10.8482 7.02613 10.8698 7.02553 10.8908 7.0293C10.9118 7.03306 10.9319 7.0411 10.9497 7.05292C10.9675 7.06474 10.9827 7.08009 10.9943 7.09801C11.0256 7.1391 11.159 7.11504 11.2378 7.0802C11.2756 7.06321 11.3186 7.06193 11.3573 7.07666C11.3961 7.09138 11.4274 7.1209 11.4444 7.15871C11.4614 7.19653 11.4627 7.23954 11.4479 7.27829C11.4332 7.31705 11.4037 7.34836 11.3659 7.36535C11.272 7.40738 11.1706 7.42991 11.0678 7.4316Z",fill:"#2B62CD"}),s.createElement("path",{d:"M11.548 13.1983C11.5518 13.2185 11.5515 13.2392 11.5471 13.2592C11.5428 13.2792 11.5345 13.2981 11.5227 13.3149C11.5109 13.3316 11.4958 13.3458 11.4785 13.3567C11.4611 13.3675 11.4417 13.3748 11.4215 13.378C11.2165 13.4117 11.0089 13.4279 10.8012 13.4265C10.5169 13.4214 10.2349 13.3757 9.96367 13.2905C9.44418 13.1038 8.96486 12.8201 8.55117 12.4546C7.77477 11.8262 7.66367 11.4171 7.45898 11.0249C7.74314 11.4988 8.12768 11.9047 8.58555 12.214C9.03605 12.5485 9.53089 12.8188 10.0559 13.0171C10.4848 13.1224 10.9305 13.141 11.3668 13.0718C11.387 13.0677 11.4079 13.0678 11.4281 13.0721C11.4483 13.0763 11.4675 13.0846 11.4844 13.0964C11.5014 13.1082 11.5157 13.1233 11.5267 13.1409C11.5376 13.1584 11.5449 13.1779 11.548 13.1983Z",fill:"#2B62CD"}),s.createElement("path",{d:"M10.5484 8.85297C10.511 8.86675 10.4712 8.87312 10.4313 8.87172C10.2958 8.86506 10.164 8.82594 10.0469 8.75766C10.0858 8.62969 10.1177 8.54703 10.1419 8.46875C10.2299 8.5323 10.3369 8.56419 10.4453 8.55922C10.464 8.55169 10.4839 8.54798 10.504 8.54833C10.5241 8.54867 10.5439 8.55306 10.5623 8.56122C10.5807 8.56939 10.5972 8.58116 10.6109 8.59585C10.6247 8.61054 10.6353 8.62784 10.6422 8.64672C10.6561 8.68656 10.6541 8.73021 10.6366 8.76862C10.6192 8.80703 10.5876 8.83724 10.5484 8.85297Z",fill:"#2B62CD"})),s.createElement("defs",null,s.createElement("clipPath",{id:"clip0_5646_32454"},s.createElement("rect",{width:"20",height:"20",fill:"white"}))))},label:"dueDatePage.ultrasound"}},B=[String(i.lastPeriod),String(i.IVF),String(i.conception)],M={[C.L.Cambodia]:B,[C.L.Singapore]:B,[C.L.India]:B,[C.L.Indonesia]:[String(i.lastPeriod),String(i.IUI),String(i.IVF),String(i.ultrasound)],[C.L.Malaysia]:B,[C.L.Myanmar]:B,[C.L.PhilippinesEnglish]:B,[C.L.PhilippinesTagalog]:B,[C.L.Taiwan]:B,[C.L.Thailand]:B,[C.L.Vietnam]:[String(i.lastPeriod),String(i.IVF),String(i.IUI),String(i.ultrasound)]},j="yyyy-MM-dd",getDueDateLastPeriod=(e,t)=>({otherInfo:{method:i.lastPeriod+1,first_day:(0,g.Z)(e,j),measurement_date:null,insemination_date:null,cycle_length_days:t,conception_date:null,ivf_transfer_date:null,days_transfer:null}}),getDueDateConception=e=>({otherInfo:{method:i.conception+1,conception_date:(0,g.Z)(e,j),measurement_date:null,insemination_date:null,first_day:null,cycle_length_days:null,ivf_transfer_date:null,days_transfer:null}}),getDueDateIVF=(e,t)=>({otherInfo:{method:i.IVF+1,ivf_transfer_date:(0,g.Z)(e,j),measurement_date:null,insemination_date:null,days_transfer:t,conception_date:null,first_day:null,cycle_length_days:null}}),getDueDateIUI=e=>({otherInfo:{method:i.conception+1,insemination_date:(0,g.Z)(e,j),measurement_date:null,conception_date:null,first_day:null,cycle_length_days:null,ivf_transfer_date:null,days_transfer:null}}),getDueDateUltrasound=(e,t)=>{let[a,n]=t.split("|"),[l,r]=[Number(a),Number(n)];return{otherInfo:{method:i.conception+1,measurement_date:(0,g.Z)(e,j),conception_date:null,insemination_date:null,crl_value:l,msd_value:r,first_day:null,cycle_length_days:null,ivf_transfer_date:null,days_transfer:null}}},F=(0,s.createContext)({}),R=(0,s.createContext)({}),DefaultLayout$4=()=>{let{t:e}=(0,P.u)(),{form:t}=(0,s.useContext)(R);return s.createElement(k.H.FormRow,null,s.createElement(w.D,Object.assign({label:s.createElement(S.T,{size:"p2",weight:"semiBold"},e("dueDatePage.lastPeriod.lastPeriodLabel"))},t.getInputProps("lastPeriodDate"),{popoverProps:{withinPortal:!0},maxDate:new Date})))},InlineLayout$4=()=>{let{t:e}=(0,P.u)(),{form:t}=(0,s.useContext)(R);return s.createElement(k.H.FormRow,null,s.createElement(k.H.BorderInlineControl,{width:300,label:e("dueDatePage.lastPeriod.lastPeriodLabel")},s.createElement(w.D,Object.assign({},t.getInputProps("lastPeriodDate"),{popoverProps:{withinPortal:!0},maxDate:new Date,error:null}))),t.errors.lastPeriodDate&&s.createElement(k.H.Error,null,t.errors.lastPeriodDate))},MbLayout$4=()=>{let{t:e}=(0,P.u)(),{form:t}=(0,s.useContext)(R);return s.createElement(k.H.BorderBoxControl,{label:e("dueDatePage.lastPeriod.lastPeriodLabel"),rightSection:s.createElement(I.Z,null)},s.createElement(w.D,Object.assign({},t.getInputProps("lastPeriodDate"),{popoverProps:{withinPortal:!0},rightSection:null,maxDate:new Date})))},ConceptionForm=({})=>{let{classes:e={}}=(0,s.useContext)(L.C),{formLayout:t,onSubmit:a,currentUrl:n,submitProps:l}=(0,s.useContext)(F),r=(0,c.rZ)(),{t:o}=(0,P.u)(),u=(0,f.c)({initialValues:{lastPeriodDate:new Date}}),p={onSubmit:u.onSubmit(e=>{let{lastPeriodDate:t}=e,n=`${O.Q.type}=${i.conception}&${O.Q.startDate}=${y()(t).format(O.A)}&${O.Q.additional}= `;a(getDueDateConception(t),n)})};return s.createElement(R.Provider,{value:{form:u}},s.createElement(k.H,Object.assign({formLayout:t},p),"inline"===t?s.createElement(InlineLayout$4,null):"mb"===r.other.template?s.createElement(MbLayout$4,null):s.createElement(DefaultLayout$4,null),s.createElement(k.H.FormRow,{className:e.submitWrapper},s.createElement(k.H.Submit,Object.assign({dataEventCategory:"Health Tool",dataEventAction:"Due Date",dataEventLabel:n,className:(0,d.default)("due-date-calculate-button",e.submitBtn),type:"submit"},l),o("dueDatePage.lastPeriod.calculate")))))},_=(0,s.createContext)({}),DefaultLayout$3=()=>{let{t:e}=(0,P.u)(),{form:t}=(0,s.useContext)(_);return s.createElement(k.H.FormRow,null,s.createElement(w.D,Object.assign({label:s.createElement(S.T,{size:"p2",weight:"semiBold"},e("dueDatePage.date_of_IUI_procedure"))},t.getInputProps("dateOfIUIProcedure"),{popoverProps:{withinPortal:!0},maxDate:new Date})))},InlineLayout$3=()=>{let{t:e}=(0,P.u)(),{form:t}=(0,s.useContext)(_);return s.createElement(k.H.FormRow,null,s.createElement(k.H.BorderInlineControl,{width:300,label:e("dueDatePage.date_of_IUI_procedure")},s.createElement(w.D,Object.assign({},t.getInputProps("dateOfIUIProcedure"),{popoverProps:{withinPortal:!0},maxDate:new Date,error:null}))))},MbLayout$3=()=>{let{t:e}=(0,P.u)(),{form:t}=(0,s.useContext)(_);return s.createElement(k.H.BorderBoxControl,{label:e("dueDatePage.date_of_IUI_procedure"),rightSection:s.createElement(I.Z,null)},s.createElement(w.D,Object.assign({},t.getInputProps("dateOfIUIProcedure"),{popoverProps:{withinPortal:!0},rightSection:null,maxDate:new Date})))},IUIForm=({})=>{let{formLayout:e,onSubmit:t,currentUrl:a,submitProps:n}=(0,s.useContext)(F),{classes:l={}}=(0,s.useContext)(L.C),r=(0,c.rZ)(),{t:o}=(0,P.u)(),u=(0,f.c)({initialValues:{dateOfIUIProcedure:new Date}}),p={onSubmit:u.onSubmit(e=>{let{dateOfIUIProcedure:a}=e,n=`${O.Q.type}=${i.IUI}&${O.Q.startDate}=${y()(a).format(O.A)}&${O.Q.additional}= `;t(getDueDateIUI(a),n)})};return s.createElement(_.Provider,{value:{form:u}},s.createElement(k.H,Object.assign({formLayout:e},p),"inline"===e?s.createElement(InlineLayout$3,null):"mb"===r.other.template?s.createElement(MbLayout$3,null):s.createElement(DefaultLayout$3,null),s.createElement(k.H.FormRow,{className:l.submitWrapper},s.createElement(k.H.Submit,Object.assign({dataEventCategory:"Health Tool",dataEventAction:"Due Date",dataEventLabel:a,className:(0,d.default)("due-date-calculate-button",l.submitBtn),type:"submit"},n),o("dueDatePage.lastPeriod.calculate")))))},$=(0,s.createContext)({}),DefaultLayout$2=()=>{let{t:e}=(0,P.u)(),{form:t,transferDateOptions:a}=(0,s.useContext)($);return s.createElement(s.Fragment,null,s.createElement(k.H.FormRow,null,s.createElement(w.D,Object.assign({label:s.createElement(S.T,{size:"p2",weight:"semiBold"},e("dueDatePage.ivf.transferDate"))},t.getInputProps("IVFDate"),{popoverProps:{withinPortal:!0},maxDate:new Date}))),s.createElement(k.H.FormRow,null,s.createElement(x.R.Group,Object.assign({},t.getInputProps("dayTransfer")),s.createElement(u.Z,null,a.map((e,t)=>s.createElement(x.R,{key:t,value:e.value,label:e.label}))))))},InlineLayout$2=()=>{let{t:e}=(0,P.u)(),{form:t,transferDateOptions:a}=(0,s.useContext)($);return s.createElement(s.Fragment,null,s.createElement(k.H.FormRow,null,s.createElement(k.H.BorderInlineControl,{width:300,label:e("dueDatePage.ivf.transferDate")},s.createElement(w.D,Object.assign({},t.getInputProps("IVFDate"),{popoverProps:{withinPortal:!0},maxDate:new Date})))),s.createElement(k.H.FormRow,null,s.createElement(k.H.BorderInlineControl,{width:"none"},s.createElement(x.R.Group,Object.assign({},t.getInputProps("dayTransfer")),s.createElement(u.Z,null,a.map((e,t)=>s.createElement(x.R,{key:t,value:e.value,label:e.label})))))))},MbLayout$2=()=>{let{t:e}=(0,P.u)(),{form:t,transferDateOptions:a}=(0,s.useContext)($);return s.createElement(s.Fragment,null,s.createElement(k.H.BorderBoxControl,{label:e("dueDatePage.ivf.transferDate"),rightSection:s.createElement(I.Z,null)},s.createElement(w.D,Object.assign({},t.getInputProps("IVFDate"),{popoverProps:{withinPortal:!0},maxDate:new Date,rightSection:null}))),s.createElement(x.R.Group,Object.assign({},t.getInputProps("dayTransfer")),s.createElement(u.Z,null,a.map((e,t)=>s.createElement(x.R,{key:t,value:e.value,label:e.label})))))},IVFForm=({})=>{var e;let{classes:t={}}=(0,s.useContext)(L.C),{formLayout:a,onSubmit:n,currentUrl:l,submitProps:r}=(0,s.useContext)(F),{t:o}=(0,P.u)(),u=(0,c.rZ)(),p=[{value:"3",label:o("dueDatePage.ivf.transferDateRadio",{number:3})},{value:"5",label:o("dueDatePage.ivf.transferDateRadio",{number:5})}],m=(0,f.c)({initialValues:{IVFDate:new Date,dayTransfer:null===(e=null==p?void 0:p[0])||void 0===e?void 0:e.value}}),h={onSubmit:m.onSubmit(e=>{let{IVFDate:t}=e,a=Number(e.dayTransfer),l=`${O.Q.type}=${i.IVF}&${O.Q.startDate}=${y()(t).format(O.A)}&${O.Q.additional}=${a}`;n(getDueDateIVF(t,Number(a)),l)})};return s.createElement($.Provider,{value:{form:m,transferDateOptions:p}},s.createElement(k.H,Object.assign({formLayout:a},h),"inline"===a?s.createElement(InlineLayout$2,null):"mb"===u.other.template?s.createElement(MbLayout$2,null):s.createElement(DefaultLayout$2,null),s.createElement(k.H.FormRow,{className:t.submitWrapper},s.createElement(k.H.Submit,Object.assign({dataEventCategory:"Health Tool",dataEventAction:"Due Date",dataEventLabel:l,className:(0,d.default)("due-date-calculate-button",t.submitBtn),type:"submit"},r),o("dueDatePage.lastPeriod.calculate")))))},H=(0,s.createContext)({}),DefaultLayout$1=()=>{let{t:e}=(0,P.u)(),{form:t}=(0,s.useContext)(H),a=(0,s.useMemo)(()=>[...Array(21)].map((t,a)=>({label:e("dueDatePage.daysText",{number:a+20}),value:`${a+20}`})),[]);return s.createElement(s.Fragment,null,s.createElement(k.H.FormRow,null,s.createElement(w.D,Object.assign({label:s.createElement(S.T,{size:"p2",weight:"semiBold"},e("dueDatePage.lastPeriod.lastPeriodLabel"))},t.getInputProps("lastPeriodDate"),{popoverProps:{withinPortal:!0},maxDate:new Date}))),s.createElement(k.H.FormRow,null,s.createElement(x.I.Wrapper,{label:s.createElement(S.T,{size:"p2",weight:"semiBold"},e("dueDatePage.lastPeriod.periodLengthLabel"))},s.createElement(x.S,Object.assign({placeholder:e("tools.inputPlaceholder",{content:e("dueDatePage.daysText",{number:30})}),data:a,withinPortal:!0},t.getInputProps("periodLength"))))))},InlineLayout$1=()=>{let{t:e}=(0,P.u)(),{form:t}=(0,s.useContext)(H),a=(0,s.useMemo)(()=>[...Array(21)].map((t,a)=>({label:e("dueDatePage.daysText",{number:a+20}),value:`${a+20}`})),[]);return s.createElement(s.Fragment,null,s.createElement(k.H.FormRow,null,s.createElement(k.H.BorderInlineControl,{label:e("dueDatePage.lastPeriod.lastPeriodLabel"),width:300},s.createElement(w.D,Object.assign({},t.getInputProps("lastPeriodDate"),{popoverProps:{withinPortal:!0},maxDate:new Date})))),s.createElement(k.H.FormRow,null,s.createElement(k.H.BorderInlineControl,{label:e("dueDatePage.lastPeriod.periodLengthLabel"),width:300},s.createElement(x.S,Object.assign({placeholder:e("tools.inputPlaceholder",{content:e("dueDatePage.daysText",{number:30})}),data:a},t.getInputProps("periodLength"),{error:null,withinPortal:!0})))),t.errors.periodLength&&s.createElement(k.H.FormRow,null,s.createElement(k.H.Error,null,t.errors.periodLength)))},MbLayout$1=()=>{let{t:e}=(0,P.u)(),{form:t}=(0,s.useContext)(H);return s.createElement(s.Fragment,null,s.createElement(k.H.BorderBoxControl,{label:e("dueDatePage.lastPeriod.lastPeriodLabel"),rightSection:s.createElement(I.Z,null)},s.createElement(w.D,Object.assign({rightSection:null},t.getInputProps("lastPeriodDate"),{popoverProps:{withinPortal:!0},maxDate:new Date}))),s.createElement(k.H.BorderBoxControl,{label:e("dueDatePage.lastPeriod.periodLengthLabel"),rightSection:e("ovulationPage.dayUnit")},s.createElement(x.I.Number,Object.assign({min:20,max:40,placeholder:e("tools.inputPlaceholder",{content:"30"})},t.getInputProps("periodLength")))),t.errors.periodLength&&s.createElement(k.H.Error,null,t.errors.periodLength))},LastPeriodForm=({})=>{let{formLayout:e,onSubmit:t,currentUrl:a,submitProps:n}=(0,s.useContext)(F),{classes:l={}}=(0,s.useContext)(L.C),{t:r}=(0,P.u)(),o=(0,c.rZ)(),u="mb"===o.other.template,p=(0,f.c)({initialValues:{lastPeriodDate:new Date},validate:{periodLength:(0,E.U)(r("validation.error.requiredField"))}}),m={onSubmit:p.onSubmit(e=>{let{periodLength:a,lastPeriodDate:n}=e,l=`${O.Q.type}=${i.lastPeriod}&${O.Q.startDate}=${y()(n).format(O.A)}&${O.Q.additional}=${a}`;t(getDueDateLastPeriod(n,a),l)})};return s.createElement(H.Provider,{value:{form:p}},s.createElement(k.H,Object.assign({formLayout:e},m),"inline"===e?s.createElement(InlineLayout$1,null):u?s.createElement(MbLayout$1,null):s.createElement(DefaultLayout$1,null),s.createElement(k.H.FormRow,{className:l.submitWrapper},s.createElement(k.H.Submit,Object.assign({dataEventCategory:"Health Tool",dataEventAction:"Due Date",dataEventLabel:a,className:(0,d.default)("due-date-calculate-button",l.submitBtn),type:"submit"},n),r("dueDatePage.lastPeriod.calculate")))))},N=(0,s.createContext)({}),Info=e=>{var{isMarryBaby:t,size:a=24}=e,n=(0,o._)(e,["isMarryBaby","size"]);let l=Object.assign({width:a,height:a},n);return s.createElement("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l),s.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00065 1.3335C4.32065 1.3335 1.33398 4.32016 1.33398 8.00016C1.33398 11.6802 4.32065 14.6668 8.00065 14.6668C11.6807 14.6668 14.6673 11.6802 14.6673 8.00016C14.6673 4.32016 11.6807 1.3335 8.00065 1.3335ZM8.00065 11.3335C7.63398 11.3335 7.33398 11.0335 7.33398 10.6668V8.00016C7.33398 7.6335 7.63398 7.3335 8.00065 7.3335C8.36732 7.3335 8.66732 7.6335 8.66732 8.00016V10.6668C8.66732 11.0335 8.36732 11.3335 8.00065 11.3335ZM7.33398 6.00016H8.66732V4.66683H7.33398V6.00016Z",fill:"#2D87F3"}))},DefaultLayout=()=>{let{t:e}=(0,P.u)(),{form:t}=(0,s.useContext)(N),a=s.createElement(S.T,{size:"p4",color:D.r.colors.gray400},"mm"),n=t.getInputProps("ultrasoundCRL"),l=t.getInputProps("ultrasoundMSD");return s.createElement(s.Fragment,null,s.createElement(k.H.FormRow,null,s.createElement(w.D,Object.assign({label:s.createElement(S.T,{size:"p2",weight:"semiBold"},e("dueDatePage.date_of_ultrasound"))},t.getInputProps("dateOfUltrasound"),{popoverProps:{withinPortal:!0},maxDate:new Date}))),s.createElement(k.H.FormRow,null,s.createElement(p.k,{align:"center",gap:4,mb:4},s.createElement(S.T,{size:"p2",weight:"semiBold"},e("dueDatePage.validation.one_is_required")),s.createElement(m.u,{withinPortal:!0,withArrow:!0,width:300,multiline:!0,label:e("dueDatePage.ultrasound.tooltip")},s.createElement(p.k,null,s.createElement(Info,{size:16})))),s.createElement(p.k,{gap:8},s.createElement(x.I,Object.assign({placeholder:"CRL",sx:{flex:1},rightSection:a,type:"number",min:0,step:.01},n,{errorProps:{sx:{display:"none"}}})),s.createElement(x.I,Object.assign({placeholder:"MSD",sx:{flex:1},rightSection:a,type:"number",min:0,step:.01},l,{errorProps:{sx:{display:"none"}}}))),(t.errors.ultrasoundCRL||t.errors.ultrasoundMSD)&&s.createElement(S.T,{size:"p4",color:D.r.colors.red500},t.errors.ultrasoundCRL||t.errors.ultrasoundMSD)))},InlineLayout=()=>{let{t:e}=(0,P.u)(),{form:t}=(0,s.useContext)(N),a=s.createElement(S.T,{size:"p4",color:D.r.colors.gray400},"mm"),n=t.getInputProps("ultrasoundCRL"),l=t.getInputProps("ultrasoundMSD");return s.createElement(s.Fragment,null,s.createElement(k.H.FormRow,null,s.createElement(k.H.BorderInlineControl,{width:300,label:e("dueDatePage.date_of_ultrasound")},s.createElement(w.D,Object.assign({},t.getInputProps("dateOfUltrasound"),{popoverProps:{withinPortal:!0},maxDate:new Date,error:null})))),s.createElement(k.H.FormRow,null,s.createElement(k.H.BorderInlineControl,{width:300,label:s.createElement(p.k,{align:"center",gap:4},s.createElement("span",null,e("dueDatePage.validation.one_is_required")),s.createElement(m.u,{withinPortal:!0,withArrow:!0,width:300,multiline:!0,label:e("dueDatePage.ultrasound.tooltip")},s.createElement(p.k,null,s.createElement(Info,{size:16}))))},s.createElement(h.x,null,s.createElement(p.k,{gap:8},s.createElement(x.I,Object.assign({placeholder:"CRL",sx:{flex:1},rightSection:a,type:"number",min:0,step:.01},n,{errorProps:{sx:{display:"none"}}})),s.createElement(x.I,Object.assign({placeholder:"MSD",sx:{flex:1},rightSection:a,type:"number",min:0,step:.01},l,{errorProps:{sx:{display:"none"}}}))))),(t.errors.ultrasoundCRL||t.errors.ultrasoundMSD)&&s.createElement(k.H.Error,null,t.errors.ultrasoundCRL||t.errors.ultrasoundMSD)))},MbLayout=()=>{let{t:e}=(0,P.u)(),{form:t}=(0,s.useContext)(N);return s.createElement(k.H.BorderBoxControl,{label:e("dueDatePage.date_of_ultrasound"),rightSection:s.createElement(I.Z,null)},s.createElement(w.D,Object.assign({},t.getInputProps("dateOfUltrasound"),{popoverProps:{withinPortal:!0},rightSection:null,maxDate:new Date})))},UltrasoundForm=({})=>{let{classes:e={}}=(0,s.useContext)(L.C),{formLayout:t,onSubmit:a,currentUrl:n,submitProps:l}=(0,s.useContext)(F),r=(0,c.rZ)(),{t:o}=(0,P.u)(),u=(0,f.c)({initialValues:{dateOfUltrasound:new Date},validate:e=>{let t=Number(e.ultrasoundCRL),a=Number(e.ultrasoundMSD);if(!t&&!a)return{ultrasoundCRL:o("dueDatePage.validation.record_not_valid")};let n=t>=5&&t<=101,l=a>0&&a<=13;return n||l?{}:t&&!n?{ultrasoundCRL:o("dueDatePage.validation.record_not_valid")}:a&&!l?{ultrasoundMSD:o("dueDatePage.validation.crl")}:void 0}}),p={onSubmit:u.onSubmit(e=>{let{dateOfUltrasound:t,ultrasoundCRL:n,ultrasoundMSD:l}=e,r=`${n}|${l}`,o=`${O.Q.type}=${i.ultrasound}&${O.Q.startDate}=${y()(t).format(O.A)}&${O.Q.additional}=${r}`;a(getDueDateUltrasound(t,r),o)})};return s.createElement(N.Provider,{value:{form:u}},s.createElement(k.H,Object.assign({formLayout:t},p),"inline"===t?s.createElement(InlineLayout,null):"mb"===r.other.template?s.createElement(MbLayout,null):s.createElement(DefaultLayout,null),s.createElement(k.H.FormRow,{className:e.submitWrapper},s.createElement(k.H.Submit,Object.assign({dataEventCategory:"Health Tool",dataEventAction:"Due Date",dataEventLabel:n,className:(0,d.default)("due-date-calculate-button",e.submitBtn),type:"submit"},l),o("dueDatePage.lastPeriod.calculate")))))},FormSwitcher=()=>{let{calculatorType:e}=(0,s.useContext)(F);switch(e){case i.lastPeriod:return s.createElement(LastPeriodForm,null);case i.conception:return s.createElement(ConceptionForm,null);case i.IVF:return s.createElement(IVFForm,null);case i.IUI:return s.createElement(IUIForm,null);case i.ultrasound:return s.createElement(UltrasoundForm,null);default:return null}};(l=r||(r={}))[l.trackPeriod=0]="trackPeriod",l[l.conceive=1]="conceive",l[l.avoidPregnancy=2]="avoidPregnancy";let A=(0,s.forwardRef)((e,t)=>{var{label:a,icon:n}=e,l=(0,o._)(e,["label","icon"]);return s.createElement(h.x,Object.assign({ref:t,sx:{gap:"1rem",display:"flex",padding:"5px 6px",alignItems:"center","&[data-selected]":{backgroundColor:D.r.colors.gray100},"&[data-selected]:hover":{backgroundColor:D.r.colors.gray100},"&[data-hovered]":{backgroundColor:D.r.colors.gray100}},className:""},l),n,s.createElement(S.T,{size:"p4"},a))}),DueDateForm=e=>{var{locale:t,formLayout:a="default",submitProps:n,currentUrl:l,isMobile:r,onSubmit:c}=e,d=(0,o._)(e,["locale","formLayout","submitProps","currentUrl","isMobile","onSubmit"]);let{t:u}=(0,P.u)(),[p,m]=(0,s.useState)(i.lastPeriod),h=(0,s.useMemo)(()=>(null==M?void 0:M[t].map(e=>{let t=T[e],a=t.icon;return Object.assign(Object.assign({},t),{label:u(t.label),icon:s.createElement(a,{size:20})})}))||[],[t,u]),g=(0,s.useMemo)(()=>h.find(e=>e.value===String(p)),[p,h]);return s.createElement(F.Provider,{value:{calculatingMethods:h,submitProps:n,currentUrl:l,isMobile:r,formLayout:a,onSubmit:c,calculatorType:p,setCalculatorType:m}},s.createElement(k.H,Object.assign({component:"div",formLayout:a},d),"default"===a?s.createElement(k.H.FormRow,null,s.createElement(k.H.Control,null,s.createElement(x.S,{label:s.createElement(S.T,{size:"p2",weight:"semiBold"},u("dueDatePage.calculationMethod")),value:String(p),data:h,itemComponent:A,onChange:e=>m(Number(e)),icon:null==g?void 0:g.icon}))):s.createElement(k.H.FormRow,null,s.createElement(k.H.BorderInlineControl,{label:s.createElement(S.T,{size:"p2",weight:"semiBold"},u("dueDatePage.calculationMethod")),width:300},s.createElement(x.S,{value:String(p),data:h,itemComponent:A,onChange:e=>m(Number(e))}))),s.createElement(FormSwitcher,null)))}},HckC:function(e,t,a){a.d(t,{M:function(){return el},S:function(){return SurveyOrPremiumBanner},a:function(){return ei},b:function(){return SideBannerModal}});var n,l,i,r,o,s,c,d=a("q1tI"),u=a("mYVa"),p=a("7Ci/"),m=a("/npG"),h=a("Eso5"),g=a("OAL+"),b=a("SPK5"),C=a("RZSM"),f=a("vaps"),E=a("9n+W"),v=a("DA0W"),y=a("RGvF"),x=a("JZkZ"),w=a("MkcP"),S=a("Y5X8"),P=a("Xfk/"),k=a("NGsg"),I=a("0nVi"),L=a("UIg8"),O=a("HJpP"),D=a("PEH3"),T=a("1N+i"),B=a("XwDk"),M=a("L+vc"),j=a("cChf"),F=a("ZFu2"),R=a("StZb"),_=a("/TW2"),$=a("oZWv"),H=a("XDLp"),N=a("jD9D"),A=a("IQVP"),Z=a("ake8"),z=a("PHlL"),V=a("wDwK"),K=a("xrdX"),W=a("GOBr"),U=a("OWiL"),q=a("vWP/"),G=a("csPO"),Q=a("mis8"),Y=a("JIJ2"),X=a("TYy9"),J=a.n(X),ee=a("qPyV"),et=a.n(ee),ea=a("Bw1v");let en=[{title:"Health News & Current Affairs",description:"Covering the latest happenings in the health field, including medical breakthroughs, policies, and disease outbreaks",icon:S.C.getAssetPath("newsletter-prefer/newsletter-health.svg"),checked:!1,id:1},{title:"Educational Medical Hello Bacsi Content",description:"Covering the latest happenings in the health field, including medical breakthroughs, policies, and disease outbreaks",icon:S.C.getAssetPath("newsletter-prefer/newsletter-education.svg"),checked:!1,id:2},{title:"Hello Health Community Feed",description:"Covering the latest happenings in the health field, including medical breakthroughs, policies, and disease outbreaks",icon:S.C.getAssetPath("newsletter-prefer/newsletter-community.svg"),checked:!1,id:3}];(n=r||(r={})).Pregnant="pregnant",n.Parenting="parenting",(o||(o={})).Option="option",(l=s||(s={})).Button="button",l.Checkbox="checkbox",(i=c||(c={})).ShowTool="showTool",i.ShowPremiumModal="showPremiumModal",i.ShowOptionBanner="showOptionBanner",i.Hide="hide";let el={pregnancy:r.Pregnant,parenting:r.Parenting},ei={[r.Pregnant]:"pregnant",[r.Parenting]:"parent"},FLOW=(e,t)=>({[r.Pregnant]:{action:c.ShowOptionBanner,props:{heading:e("pnBanner.pregnancy.heading"),description:e("pnBanner.pregnancy.desc"),styleType:s.Button,thumbnail:{desktop:S.C.getAssetPath("newsletter/banner-option-pregnancy-desktop.png"),mobile:S.C.getAssetPath("newsletter/banner-option-pregnancy-mobile.png")},buttonProps:{variant:"white",styles:e=>({minWidth:(0,u.h)(80),[e.fn.largerThan("sm")]:{minWidth:(0,u.h)(120)}})},items:[{label:e("switchBtn.yes"),value:"yes",tracking:{dataEventCategory:"Focused Audience",dataEventAction:"Are you navigating the world of pregnancy - Yes Click",dataEventLabel:t}},{label:e("switchBtn.no"),value:"no",tracking:{dataEventCategory:"Focused Audience",dataEventAction:"Are you navigating the world of pregnancy - No Click",dataEventLabel:t}}]},submitHandler:{yes:{action:c.ShowTool,props:{value:I.H.DUE_DATE}},no:{action:c.ShowPremiumModal}}},[r.Parenting]:{action:c.ShowOptionBanner,props:{heading:e("pnBanner.parenting.heading"),description:e("pnBanner.parenting.desc"),thumbnail:{desktop:S.C.getAssetPath("newsletter/banner-option-parenting-desktop.png"),mobile:S.C.getAssetPath("newsletter/banner-option-parenting-mobile.png")},hideDescOnMobile:!0,styleType:s.Checkbox,items:[{label:e("pnBanner.toddlers"),value:"todders"},{label:e("pnBanner.teenager"),value:"teenager"}],submitBtnTracking:{dataEventCategory:"Focused Audience",dataEventAction:"What is the age range of your kids Click",dataEventLabel:t}},submitHandler:{todders:{action:c.ShowTool,props:{value:I.H.BABY_VACCINE}},teenager:{action:c.ShowOptionBanner,props:{styleType:s.Button,heading:e("pnBanner.teenager.heading"),description:e("pnBanner.parenting.desc"),thumbnail:{desktop:S.C.getAssetPath("newsletter/banner-option-parenting-desktop.png"),mobile:S.C.getAssetPath("newsletter/banner-option-parenting-mobile.png")},buttonProps:{variant:"white"},items:[{label:e("childCard.boy"),value:"teenager.boy",tracking:{dataEventCategory:"Focused Audience",dataEventAction:"What is the gender of your kids - Boy Click",dataEventLabel:t}},{label:e("childCard.girl"),value:"teenager.girl",tracking:{dataEventCategory:"Focused Audience",dataEventAction:"What is the gender of your kids - Girl Click",dataEventLabel:t}}]}},"teenager.boy":{action:c.ShowPremiumModal},"teenager.girl":{action:c.ShowTool,activeTool:L.t.HPV,props:{value:L.t.HPV}},"todders|teenager":{action:c.ShowOptionBanner,props:{styleType:s.Button,heading:e("pnBanner.both.heading"),description:e("pnBanner.both.desc"),thumbnail:{desktop:S.C.getAssetPath("newsletter/banner-option-parenting-desktop.png"),mobile:S.C.getAssetPath("newsletter/banner-option-parenting-mobile.png")},hideDescOnMobile:!0,buttonProps:{variant:"secondary"},styles:e=>({wrapper:{[e.fn.smallerThan("sm")]:{flexDirection:"column"}},button:{background:e.colors.blue[0]}}),items:[{label:e("pnBanner.vaccine.btnLabel"),activeTool:I.H.BABY_VACCINE,isLink:!0,tracking:{dataEventCategory:"Focused Audience",dataEventAction:"Experience our tools for parent - Baby Vaccine Click",dataEventLabel:t}},{label:e("pnBanner.pn.btnLabel"),value:"todders|teenager.showPN",isPNBtn:!0,tracking:{dataEventCategory:"Focused Audience",dataEventAction:"Experience our tools for parent - Premium Newsletter Click",dataEventLabel:t}}]}},"todders|teenager.showPN":{action:c.ShowOptionBanner,props:{styleType:s.Button,heading:e("pnBanner.both.heading"),description:e("pnBanner.both.desc"),thumbnail:{desktop:S.C.getAssetPath("newsletter/banner-option-parenting-desktop.png"),mobile:S.C.getAssetPath("newsletter/banner-option-parenting-mobile.png")},hideDescOnMobile:!0,buttonProps:{variant:"secondary"},styles:e=>({wrapper:{[e.fn.smallerThan("sm")]:{flexDirection:"column"}},button:{background:e.colors.blue[0]}}),items:[{label:e("pnBanner.vaccine.btnLabel"),activeTool:I.H.BABY_VACCINE,isLink:!0,tracking:{dataEventCategory:"Focused Audience",dataEventAction:"Experience our tools for parent - Baby Vaccine Click",dataEventLabel:t}}]}}}}}),TOOL_BANNERS_PROPS=e=>({[I.H.DUE_DATE]:{heading:e("pnBanner.dueDateTool.heading"),description:e("pnBanner.dueDateTool.desc"),btnLabel:e("pnBanner.caclNow"),value:I.H.DUE_DATE,dataEventAction:"Try our Due Date Calculator Click"},[I.H.BABY_VACCINE]:{heading:e("pnBanner.vaccination.heading"),description:e("pnBanner.vaccination.desc"),btnLabel:e("pnBanner.caclNow"),value:I.H.BABY_VACCINE,dataEventAction:"Try our Baby Vaccine Scheduler Click"},[I.H.BABY_GROWTH]:{heading:"Baby Growth",description:e("pnBanner.vaccination.desc"),btnLabel:e("pnBanner.caclNow"),value:I.H.BABY_GROWTH},[L.t.HPV]:{heading:e("pnBanner.hpv.heading"),description:e("pnBanner.hpv.desc"),thumbnail:{desktop:S.C.getAssetPath("newsletter/banner-option-hpv-desktop.png"),mobile:S.C.getAssetPath("newsletter/banner-option-hpv-mobile.png")},isRiskScreener:!0,btnLabel:e("pnBanner.checkNow"),value:L.t.HPV,hideDescOnMobile:!0,dataEventAction:"Keep safe from HPV virus Click"}}),er=(0,d.createContext)({}),PnBannerEle=e=>{var t=(0,O._)(e,[]);let{locale:a}=(0,M.u)(),{type:n,isMobile:l,currentUrl:i,isMarketing:r,isLoggedIn:o,setShouldAcquisitionModalOpen:s}=(0,d.useContext)(er),{triggerLogin:c}=(0,D.u)();return d.createElement(p.W,Object.assign({mih:{base:144,md:160},fluid:!0,p:0,sx:{borderRadius:4,cursor:"pointer"},onClick:()=>(0,O.a)(void 0,void 0,void 0,function*(){let e=r?(0,B.g)(a)+"/dang-ky-nhan-tin/":`${window.location.href}?source=acquisition`;o?null==s||s():(0,D.I)(a)?c({returnUrl:r?e:void 0,source:r?void 0:"acquisition"}):window.location.href=`${(0,B.a)(a)}/?returnUrl=${encodeURIComponent(e)}`}),"data-event-category":"Newsletter","data-event-action":"Banner Click","data-event-label":i,className:"pointer-event-child-none"},t),d.createElement(T.I,{src:r?S.C.getAssetPath(`newsletter/${l?"Mobile":"Desktop"}_Marketing.png`):S.C.getAssetPath(`newsletter/${l?"Mobile":"Desktop"}_${n}.png`),style:{maxWidth:"100%"},alt:"newsletter banner"}))},eo={GET_NEWSLETTER_CATEGORIES:"api/v1/categories?site={website_url}",POST_SUBSCRIPTION:"api/v1/subscription?site={website_url}",GET_SUBSCRIPTION_CATEGORIES:"api/v1/categories?site={website_url}"};var es=(0,m.k)(e=>({root:{},wrapper:{[e.fn.smallerThan("sm")]:{width:"70%"}},button:{[e.fn.smallerThan("sm")]:{height:"auto",minHeight:(0,u.h)(32),padding:`${(0,u.h)(6)} ${(0,u.h)(16)}`,textAlign:"center",width:"100%"}},buttonLabel:{whiteSpace:"normal"}}));let BannerLayout=({heading:e,description:t,thumbnail:a={desktop:"",mobile:""},hideDescOnMobile:n,children:l})=>{let{isMobile:i,minHeight:r}=(0,d.useContext)(er);return d.createElement(h.x,{sx:()=>({borderRadius:(0,u.h)(8),background:"linear-gradient(180deg, #FAFDFF 0%, #E3F2FF 100%)"})},d.createElement(h.x,{sx:e=>({minHeight:(0,u.h)(r),borderRadius:"inherit",background:`url(${i?a.mobile:a.desktop})`,backgroundPosition:"center right",backgroundRepeat:"no-repeat",backgroundSize:"contain",padding:`${(0,u.h)(24)} ${(0,u.h)(16)}`,display:"flex",flexDirection:"column",justifyContent:"center",[e.fn.largerThan("sm")]:{padding:`${(0,u.h)(22)} ${(0,u.h)(32)}`}})},d.createElement(g.K,{spacing:(0,u.h)(16)},d.createElement(g.K,{spacing:(0,u.h)(4),sx:e=>({maxWidth:"60%",[e.fn.largerThan("sm")]:{maxWidth:"70%"}})},e&&d.createElement(Z.H,{tag:"h4"},e),!(n&&i)&&t&&d.createElement($.T,{size:"p4"},t)),d.createElement(h.x,null,l))))},BannerWithOptions=e=>{let{styleType:t=s.Button,items:a=[],buttonProps:n,styles:l,submitBtnTracking:i}=e,{classes:r}=es(void 0,{name:"PremiumBannerWithOptions",styles:l}),{t:o,locale:c}=(0,M.u)(),{surveyType:p,articleId:m,handleClickOption:g,hasPremiumBanner:C,source:f,isMobile:E,setShowPNModal:v}=(0,d.useContext)(er),y=(0,d.useMemo)(()=>C?a:a.filter(e=>!e.isPNBtn).filter(Boolean),[a]),{getHealthToolLink:x}=(0,z.u)(c),w=(0,j.c)({initialValues:{bannerOptions:[]}}),saveStep=e=>(0,O.a)(void 0,void 0,void 0,function*(){return yield(0,P.e)((0,P.f)(A.yy.HEALTH_TOOL.CREATE,{_locale:c,type:ei[p]}),"POST",{headers:{"Content-Type":"application/json"},data:{value:e,article:m,source:f}})}),S=(0,d.useCallback)(()=>d.createElement(b.k,{gap:(0,u.h)(8),className:r.wrapper},y.map((e,t)=>d.createElement(h.x,{key:String(t),component:e.isLink?"a":"div",href:e.isRiskScreener?`https://${K.v[c]}/bot/${L.n[c][e.activeTool]}/`:e.isLink?x(e.activeTool):void 0},d.createElement(H.B,Object.assign({className:r.button,classNames:{label:r.buttonLabel},size:"sm"},e.tracking,n,{onClick:()=>{e.isLink||(e.isPNBtn&&v(!0),saveStep(e.value),g(e.value))}}),e.label)))),[y,w]),k=(0,d.useCallback)(()=>d.createElement(b.k,null,d.createElement(b.k,{align:"center",gap:(0,u.h)(24),sx:e=>({background:"white",borderRadius:(0,u.h)(8),padding:(0,u.h)(4),[e.fn.largerThan("sm")]:{paddingLeft:(0,u.h)(16)}})},d.createElement(R.d.Group,Object.assign({},w.getInputProps("bannerOptions",{type:"checkbox"})),d.createElement(b.k,{gap:(0,u.h)(16)},y.map((e,t)=>d.createElement(R.d,{key:String(t),value:e.value,label:e.label,styles:{label:{cursor:"pointer"}}})))),d.createElement(H.B,Object.assign({size:"sm"},i,n,{disabled:0===w.getInputProps("bannerOptions").value.length,leftIcon:E?d.createElement(V.I.ArrowRightTail,{size:18,useCurrentColor:!0}):void 0,onClick:()=>{let e=w.getInputProps("bannerOptions").value;saveStep(e.join("|")),g(e.join("|"))},styles:e=>({root:{[e.fn.smallerThan("sm")]:{width:(0,u.h)(38),minWidth:"auto",padding:0}}})}),!E&&o("pnBanner.submit")))),[y,w]);return d.createElement(BannerLayout,Object.assign({},e),t===s.Button?S():t===s.Checkbox?k():null)},ToolBanner=e=>{var t,a;let{t:n}=(0,M.u)(),{heading:l,description:i,thumbnail:r,btnLabel:o,value:s,isRiskScreener:c,hideDescOnMobile:p,dataEventAction:m}=e,{locale:h}=(0,M.u)(),{isMobile:C}=(0,d.useContext)(er),{getHealthToolLink:f,allTools:E}=(0,z.u)(h),v=(0,d.useMemo)(()=>{let e=c?`https://${W.y?"":"discover."}${K.v[h]}/bot/${L.n[h][s]}`:f(s);return d.createElement("a",{href:e},d.createElement(H.B,{size:"sm","data-event-category":"Focused Audience","data-event-action":m,"data-event-label":e},o||n("pnBanner.caclNow")))},[E]);return"mainBanner"==(c?"mainBanner":"toolBanner")?d.createElement(BannerLayout,Object.assign({},Object.assign(Object.assign({},e),{thumbnail:e.thumbnail})),v):d.createElement(b.k,{gap:(0,u.h)(7),align:"center",justify:"space-between",sx:e=>({borderRadius:(0,u.h)(8),background:e.colors.blue[0],minHeight:(0,u.h)(180),padding:`${(0,u.h)(24)} ${(0,u.h)(16)}`,[e.fn.largerThan("sm")]:{padding:`${(0,u.h)(34)} ${(0,u.h)(32)}`}})},d.createElement(g.K,{spacing:(0,u.h)(12)},d.createElement(g.K,{spacing:(0,u.h)(4)},l&&d.createElement(Z.H,{tag:"h4"},l),!(C&&p)&&i&&d.createElement($.T,{size:"p4"},i)),d.createElement(b.k,{gap:(0,u.h)(8),sx:{button:{minWidth:(0,u.h)(120)}}},v)),d.createElement(b.k,{align:"center",justify:"center",sx:e=>({width:(0,u.h)(96),height:(0,u.h)(96),borderRadius:"50%",background:"white",flexShrink:0,[e.fn.largerThan("sm")]:{width:(0,u.h)(112),height:(0,u.h)(112)},img:{maxWidth:(0,u.h)(64),[e.fn.largerThan("sm")]:{maxWidth:(0,u.h)(73)}}})},d.createElement("img",{alt:"health-tool-icon",src:r||(null===(a=null===(t=E.filter(e=>e.template===s))||void 0===t?void 0:t[0])||void 0===a?void 0:a.icon)||I.a[s]||"",loading:"lazy"})))},HandlerBanner=()=>{var e,t,a;let{t:n}=(0,M.u)(),{state:l,Outside:i}=(0,d.useContext)(er);return(null==l?void 0:l.action)===c.ShowTool?d.createElement(i,null,TOOL_BANNERS_PROPS(n)[null===(e=null==l?void 0:l.props)||void 0===e?void 0:e.value]?d.createElement(ToolBanner,Object.assign({},TOOL_BANNERS_PROPS(n)[null===(t=null==l?void 0:l.props)||void 0===t?void 0:t.value],{value:null===(a=null==l?void 0:l.props)||void 0===a?void 0:a.value})):null):(null==l?void 0:l.action)===c.ShowOptionBanner?d.createElement(i,null,d.createElement(BannerWithOptions,Object.assign({},null==l?void 0:l.props))):null},SideBannerModal=e=>{var{isMobile:t,children:a,desktopBanner:n=S.C.getAssetPath("friso/onboarding-banner.jpg"),mobileBanner:l=S.C.getAssetPath("friso/onboarding-banner-mobile.jpg"),modalRatio:i={width:937,height:536},mobileBannerRatio:r={width:750,height:480},desktopBannerRatio:o={width:420,height:536},closeProps:s}=e,c=(0,O._)(e,["isMobile","children","desktopBanner","mobileBanner","modalRatio","mobileBannerRatio","desktopBannerRatio","closeProps"]);let{width:p,height:m}=(0,N.n)(),g=p*r.height/r.width,[b,f]=(0,d.useState)(!1);return d.createElement(Q.M,Object.assign({styles:e=>({header:{display:"none"},content:{flex:"auto",background:"transparent",[e.fn.smallerThan("sm")]:{maxHeight:"100%",height:"100%",position:"relative",borderRadius:0},[e.fn.largerThan("sm")]:{maxWidth:(0,u.h)(i.width),width:"100%",height:"100%",maxHeight:(0,u.h)(i.height),boxShadow:"none"}},body:{padding:0,width:"100%",height:"100%",[e.fn.largerThan("sm")]:{display:"flex",alignItems:"center"}},inner:{padding:0,[e.fn.smallerThan("sm")]:{display:"flex",alignItems:"flex-end"}}})},c),t?d.createElement(h.x,{sx:{position:"relative",width:"100%",height:"100%"},onTouchStart:()=>f(!0)},d.createElement(h.x,{className:"mobile-template",sx:{position:"absolute",height:`${(b?1:((m<=667?190:265)+g+74)/m)*100}%`,left:0,bottom:0,right:0,transition:"height 0.4s ease"}},d.createElement(h.x,{className:"mobile-template-wrapper",sx:{height:"100%",backgroundColor:"white",borderTopLeftRadius:b?0:(0,u.h)(12),borderTopRightRadius:b?0:(0,u.h)(12)}},d.createElement(h.x,{sx:{height:"100%",background:`url(${l})`,backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"top center",overflowY:"auto",borderRadius:"inherit"}},(0,G.i)(l)&&d.createElement("video",{loop:!0,muted:!0,autoPlay:!0,style:{width:"100%",position:"absolute",top:0,left:0}},d.createElement("source",{src:l})),d.createElement(H.B,Object.assign({variant:"white",leftIcon:d.createElement(U.Z,null),sx:{position:"absolute",right:0,top:0,zIndex:1,padding:(0,u.h)(10)}},s,{onClick:()=>null==c?void 0:c.onClose()})),d.createElement(C.o,{ratio:(null==r?void 0:r.width)/(null==r?void 0:r.height),w:"100%"}),d.createElement(h.x,{className:"inner",sx:{padding:`${(0,u.h)(28)} ${(0,u.h)(16)} ${(0,u.h)(16)}`,background:"white",position:"relative"}},a))))):d.createElement(C.o,{className:"desktop-template",ratio:i.width/i.height,w:"100%",sx:{position:"relative","& > div":{justifyContent:"flex-end"}}},d.createElement(h.x,{sx:{width:"100%",height:"100%",justifyContent:"flex-end",alignItems:"stretch",borderRadius:(0,u.h)(8),background:"white",boxShadow:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 2.25rem 1.75rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 1.0625rem 1.0625rem -0.4375rem"}},(0,G.i)(n)?d.createElement("video",{loop:!0,muted:!0,autoPlay:!0,style:{borderTopLeftRadius:(0,u.h)(8),borderBottomLeftRadius:(0,u.h)(8),height:"100%",display:"block"}},d.createElement("source",{src:n})):d.createElement("img",{alt:"",src:n,loading:"lazy",style:{borderTopLeftRadius:(0,u.h)(8),borderBottomLeftRadius:(0,u.h)(8),height:"100%",display:"block"}}),d.createElement(h.x,{sx:{position:"relative",height:"100%",width:`${(i.width-o.width)/i.width*100}%`}},d.createElement(H.B,Object.assign({variant:"white",leftIcon:d.createElement(U.Z,null)},s,{onClick:()=>null==c?void 0:c.onClose(),sx:{position:"absolute",right:0,top:0,backgroundColor:"transparent"}})),d.createElement(h.x,{className:"side-banner-modal-container",sx:{height:"100%",padding:`${(0,u.h)(40)} ${(0,u.h)(24)} 0`}},a)))))},ec={UPDATE_SUBSCRIPTION:"user/subscription"},ed=(0,d.createContext)({}),_NormalTopic=e=>{var{value:t,name:a}=e,n=(0,O._)(e,["value","name"]);return d.createElement(R.g,Object.assign({value:t,withIcon:!0},n,{buttonProps:{styles:()=>({leftIcon:{marginRight:(0,u.h)(6)},root:{paddingLeft:(0,u.h)(10),paddingRight:(0,u.h)(10)}})}}),a)},TopicSection=({topicsGroup:e,onTopicChange:t,isBlock:a=!1,selectedTopics:n=[],inputProps:l,labelProps:i,maxSelect:r=5,hasScroll:o,readonly:s})=>{let{action:{pushNotifications:c}}=(0,d.useContext)(P.T),u=J()(e.map(e=>e.topics||[])),{t:p}=(0,M.u)(),[m,C]=(0,d.useState)([]);(0,d.useEffect)(()=>{C(n)},[n.length]),(0,d.useEffect)(()=>{null==t||t(m)},[m]);let onValueChange=e=>{if(e.length>5){c({type:"danger",title:p("pnTopicSection.maxSelectError.title",{maxSelect:r}),message:p("pnTopicSection.maxSelectError.desc")});return}s||C(()=>u.filter(t=>e.some(e=>t.catId===e)))};return d.createElement(g.K,{spacing:12},e.map((e,t)=>d.createElement(g.K,{key:String(t),spacing:12},e.label&&d.createElement($.T,Object.assign({size:"s5",color:"gray.4",weight:"semiBold"},i),e.label),o?d.createElement(f.x,{w:"100%",offsetScrollbars:!0,scrollbarSize:4,p:16,m:-16,styles:{viewport:{margin:-16,padding:16}}},d.createElement(h.x,{w:800},d.createElement(E.A.Group,Object.assign({value:m.map(e=>e.catId),multiple:!0},l,{onChange:onValueChange}),d.createElement(b.k,{gap:8,wrap:"wrap"},e.topics.map(t=>d.createElement(_NormalTopic,Object.assign({key:t.catId,value:t.catId,name:t.localName,isBlock:a},e.tracking))))))):d.createElement(E.A.Group,Object.assign({value:m.map(e=>e.catId),multiple:!0},l,{onChange:onValueChange}),d.createElement(b.k,{gap:8,wrap:"wrap"},e.topics.map(t=>t.catId?d.createElement(_NormalTopic,Object.assign({key:t.catId,value:t.catId,name:t.localName,isBlock:a},e.tracking)):d.isValidElement(t.component)?t.component:null))))))},Layout=e=>{var{heading:t,children:a,stickyActions:n}=e,l=(0,O._)(e,["heading","children","stickyActions"]);let{isMobile:i}=(0,d.useContext)(ed),r=d.createElement(g.K,{spacing:(0,u.h)(24),sx:{height:"100%"}},d.createElement(Z.H,{tag:"h4",style:{textAlign:"center"}},t),d.createElement(h.x,null,a));return d.createElement(h.x,{sx:e=>({[e.fn.largerThan("sm")]:{position:"relative",height:"100%"}})},i?r:d.createElement(f.x,Object.assign({className:"layout-body",h:n?"calc(100% - 90px)":"100%"},l),r),n&&d.createElement(b.k,{gap:(0,u.h)(8),sx:e=>({position:"absolute",left:0,right:0,bottom:0,padding:(0,u.h)(16),button:{flexGrow:1},justifyContent:"center",[e.fn.largerThan("sm")]:{padding:`${(0,u.h)(24)} 0`}})},n))},MainForm=()=>{let{t:e,locale:t}=(0,M.u)(),{data:{userInfo:a},action:{pushNotifications:n}}=(0,d.useContext)(P.T),l=null==a?void 0:a.id,{currentUrl:i,isMobile:r,pnSuggestCategory:o=[],nextStep:s,formValues:c,setFormValues:p,onSubmit:m,submitLoading:h,selectCategory:b,setCategoryLibs:C,setSelectCategory:f,maxSelectCategory:E}=(0,d.useContext)(ed),v=o.map(e=>e.catId),y=(0,j.c)({validate:{name:(0,F.U)(e("healthToolPNModal.mainForm.requireName"))},initialValues:Object.assign(Object.assign({},c),{fitnessTopics:v})}),[x,w]=(0,d.useState)([]),[S,k]=(0,d.useState)([]);(0,d.useEffect)(()=>{(0,O.a)(void 0,void 0,void 0,function*(){var e;try{let a=yield(0,P.e)((0,P.h)(eo.GET_SUBSCRIPTION_CATEGORIES,{_locale:t}),"get"),n=((null===(e=null==a?void 0:a.data)||void 0===e?void 0:e.subscription)||[]).filter(e=>!v.includes(e.catId));w(o),k(n),C([...o,...n])}catch(e){console.log(e)}})},[]),(0,d.useEffect)(()=>{l&&y.setFieldValue("name",(null==a?void 0:a.name)||"")},[l]);let onMore=()=>{""!==y.getInputProps("name").value?(p(y.getTransformedValues()),s()):y.validateField("name")},I=(0,d.useMemo)(()=>d.createElement(H.B,{variant:"tertiary",dataEventCategory:"Newsletter",dataEventAction:"More Category Click",dataEventLabel:i,leftIcon:d.createElement(q.Z,{size:16,color:"currentColor"}),onClick:onMore,styles:e=>({root:{borderRadius:(0,u.h)(6),padding:"2px 15px",height:(0,u.h)(40)},label:{fontSize:(0,u.h)(14),fontWeight:400,[e.fn.smallerThan("sm")]:{fontSize:(0,u.h)(12),lineHeight:(0,u.h)(16),height:(0,u.h)(40)}},leftIcon:{marginRight:"5px"}})},d.createElement($.T,{size:r?"p3":"p4"},e("home.seeMore"))),[y]);return(0,d.useEffect)(()=>{y.setFieldValue("fitnessTopics",b.map(e=>e.catId))},[b]),d.createElement("form",{style:{height:"100%"},onSubmit:y.onSubmit(t=>{if(0===b.length)return n({type:"danger",title:e("newsletter.error.minTitle"),message:e("newsletter.error.minCotennt")}),!1;p(t),null==m||m(t.name)})},d.createElement(Layout,{heading:e("healthToolPNModal.heading"),stickyActions:d.createElement(d.Fragment,null,d.createElement(H.B,{fullWidth:!0,type:"submit",dataEventCategory:"Newsletter",dataEventAction:"Register Click",dataEventLabel:i,loading:h,sx:{maxWidth:(0,u.h)(240)}},e("healthToolPNModal.register")))},d.createElement(g.K,{spacing:(0,u.h)(16)},d.createElement(R.I,Object.assign({label:e("newsletter.welcome.description")},y.getInputProps("name"))),d.createElement(TopicSection,{topicsGroup:[...0===o.length&&0===S.length?[{topics:[{component:I}]}]:[],...o.length>0?[{label:e("healthToolPNModal.mainForm.tailorTopicsHeading"),topics:[...o,...0===S.length?[{component:I}]:[]]}]:[],...S.length>0?[{label:e("healthToolPNModal.findMore.chooseFav"),topics:[...S,...S.length>0?[{component:I}]:[]]}]:[]],selectedTopics:[...x],labelProps:{size:r?"p3":"p4",color:"gray.6"},onTopicChange:f,maxSelect:E}))))},eu=(0,d.forwardRef)(function(e,t){var{label:a}=e,n=(0,O._)(e,["label"]);return d.createElement("div",Object.assign({ref:t},n),d.createElement(v.Z,{noWrap:!0},d.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},d.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.72615 14.8099 11.1702 14.2653 12.3086 13.3547L15.2376 16.2837C15.5264 16.5725 15.9946 16.5725 16.2833 16.2837C16.5721 15.9949 16.5721 15.5267 16.2833 15.238L13.3544 12.3091C14.2652 11.1705 14.8099 9.72634 14.8099 8.15493C14.8099 4.47951 11.8303 1.5 8.15493 1.5Z",fill:"#8C8C8C"})),d.createElement($.T,{size:"p3"},a)))}),ep=(0,d.forwardRef)(function(e,t){var{label:a}=e,n=(0,O._)(e,["label"]);return d.createElement("div",Object.assign({ref:t},n),d.createElement($.T,{size:"p3"},a))}),HistorySection=({history:e,onDelete:t})=>d.createElement(b.k,{wrap:"wrap",gap:8},et()(e,"catId").map(e=>d.createElement(y.C,{key:e.catId,rightSection:d.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",onClick:()=>null==t?void 0:t(e)},d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 9C1.5 4.8525 4.8525 1.5 9 1.5C13.1475 1.5 16.5 4.8525 16.5 9C16.5 13.1475 13.1475 16.5 9 16.5C4.8525 16.5 1.5 13.1475 1.5 9ZM11.1677 12.2248C11.4602 12.5173 11.9327 12.5173 12.2252 12.2248C12.5101 11.9323 12.5101 11.4523 12.2252 11.1673L10.0577 8.99979L12.2252 6.83229C12.5177 6.53979 12.5177 6.0673 12.2252 5.7748C11.9327 5.4823 11.4602 5.4823 11.1677 5.7748L9.00015 7.9423L6.83265 5.7748C6.54015 5.4823 6.06765 5.4823 5.77515 5.7748C5.63471 5.91492 5.55579 6.10516 5.55579 6.30354C5.55579 6.50193 5.63471 6.69217 5.77515 6.83229L7.94265 8.99979L5.77515 11.1673C5.63471 11.3074 5.55579 11.4977 5.55579 11.696C5.55579 11.8944 5.63471 12.0847 5.77515 12.2248C6.06765 12.5173 6.54015 12.5173 6.83265 12.2248L9.00015 10.0573L11.1677 12.2248Z",fill:"#8C8C8C"})),styles:{root:{height:32,background:"#ffffff",padding:"5px 12px",border:`1px solid ${_.t.neutral[4]}`,borderRadius:32,textTransform:"unset"},rightSection:{height:18,cursor:"pointer"}}},d.createElement($.T,{size:"p4"},e.localName)))),RecentlyViewedSection=({topics:e,onTopicChange:t,isBlock:a=!1,selectedTopics:n,labelProps:l,maxSelect:i=5})=>{let{action:{pushNotifications:r}}=(0,d.useContext)(P.T),[o,s]=(0,d.useState)([]),{t:c}=(0,M.u)();return((0,d.useEffect)(()=>{s(n)},[n.length]),(0,d.useEffect)(()=>{t(o)},[o]),e&&0!==e.length)?d.createElement(g.K,{spacing:12,px:16,mx:-16},d.createElement($.T,Object.assign({size:"s5",color:"gray.4",weight:"semiBold"},l),c("pnTopicSection.recentView")),d.createElement(E.A.Group,{value:o.map(e=>e.catId),onChange:t=>{if(a&&o.lengthe.filter(e=>t.some(t=>e.catId===t)))},multiple:!0},d.createElement(b.k,{gap:8,wrap:"wrap"},e.map((e,t)=>d.createElement(_NormalTopic,{key:t,value:e.catId,name:e.localName,isBlock:a}))))):null},_TopicSlide=e=>{var{topic:t,active:a,onClick:n}=e,l=(0,O._)(e,["topic","active","onClick"]);return d.createElement(h.x,Object.assign({sx:e=>({position:"relative",cursor:"pointer",padding:2,borderRadius:8,boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.04), 0px 0px 2px rgba(0, 0, 0, 0.06), 0px 0px 1px rgba(0, 0, 0, 0.04)",minHeight:(0,u.h)(130),[e.fn.largerThan("sm")]:{minHeight:(0,u.h)(138)}}),onClick:()=>n(t,a)},l),a&&d.createElement(h.x,{id:"test",sx:{position:"absolute",top:2,right:2,width:20,height:20,zIndex:1}},d.createElement("svg",{id:"test",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.66699 9.99984C1.66699 5.39984 5.40033 1.6665 10.0003 1.6665C14.6003 1.6665 18.3337 5.39984 18.3337 9.99984C18.3337 14.5998 14.6003 18.3332 10.0003 18.3332C5.40033 18.3332 1.66699 14.5998 1.66699 9.99984ZM4.75066 10.5827L7.74232 13.5744C8.06732 13.8994 8.60066 13.8994 8.91732 13.5744L15.2423 7.2494C15.5673 6.9244 15.5673 6.3994 15.2423 6.0744C14.9173 5.7494 14.3923 5.7494 14.0673 6.0744L8.33399 11.8077L5.92566 9.40773C5.60066 9.08273 5.07566 9.08273 4.75066 9.40773C4.59461 9.56342 4.50692 9.7748 4.50692 9.99523C4.50692 10.2157 4.59461 10.427 4.75066 10.5827Z",fill:"#2D87F3"}),d.createElement("path",{d:"M7.74224 13.5772L4.75057 10.5856C4.59453 10.4299 4.50684 10.2185 4.50684 9.99808C4.50684 9.77765 4.59453 9.56627 4.75057 9.41058C5.07557 9.08558 5.60057 9.08558 5.92557 9.41058L8.33391 11.8106L14.0672 6.07725C14.3922 5.75225 14.9172 5.75225 15.2422 6.07725C15.5672 6.40225 15.5672 6.92725 15.2422 7.25225L8.91724 13.5772C8.60057 13.9022 8.06724 13.9022 7.74224 13.5772Z",fill:"white"}))),d.createElement(h.x,{sx:{borderRadius:"8px"}},d.createElement(R.c,{ratio:1.5,mb:10,sx:e=>({background:e.colors.neutral[0]})},d.createElement(h.x,null,d.createElement("img",{src:t.guid||"",alt:"cat",loading:"lazy",style:{maxHeight:"63px"}})))),d.createElement($.T,{size:"p4",ta:"center",px:6,sx:{display:"-webkit-box","-webkit-line-clamp":"2","-webkit-box-orient":"vertical",overflow:"hidden"}},t.localName||""))},TrendingCarousel=({topics:e,selectedTopics:t=[],onTopicChange:a,isBlock:n=!1,labelProps:l,pushNotifications:i,maxSelect:r=5})=>{let{t:o}=(0,M.u)(),[s,c]=(0,d.useState)([]),onSelect=(e,t)=>{if(t)c(t=>t.filter(t=>t.catId!==e.catId));else{if(n){i({type:"danger",title:o("pnTopicSection.maxSelectError.title",{maxSelect:r}),message:o("pnTopicSection.maxSelectError.desc")});return}c(t=>[...t,e])}};(0,d.useEffect)(()=>{c(t)},[t.length]),(0,d.useEffect)(()=>{a(s)},[s]);let[u,p]=(0,d.useState)(!1),[m,C]=(0,d.useState)(0),[E,v]=(0,d.useState)(0),y=(0,d.useRef)(null),handleMouseUp=()=>{p(!1)};return d.createElement(g.K,{spacing:10},d.createElement(b.k,{justify:"space-between",align:"center",w:"100%"},d.createElement($.T,Object.assign({size:"s5",color:"gray.4",weight:"semiBold",span:!0},l),o("pnTopicSection.trending"))),d.createElement(h.x,null,d.createElement(f.x,{type:"always",w:"100%",offsetScrollbars:!0,scrollbarSize:4,px:4,viewportRef:y,viewportProps:{onMouseDown:e=>{e.preventDefault(),y.current&&(p(!0),C(e.pageX-y.current.offsetLeft),v(y.current.scrollLeft))},onMouseUp:handleMouseUp,onMouseLeave:handleMouseUp,onMouseMove:e=>{if(e.preventDefault(),!u||!y.current)return;let t=e.pageX-y.current.offsetLeft;y.current.scrollLeft=E-(t-m)*2}},styles:{viewport:{paddingBottom:16}}},d.createElement(h.x,{w:{base:112*e.length+8*(e.length-1)+10}},d.createElement(b.k,{gap:8},e.map((e,t)=>d.createElement(_TopicSlide,{key:t,topic:e,onClick:onSelect,active:s.some(t=>t.catId===e.catId),w:{base:112}})))))))},PremiumTopicSelect=e=>{var{isLoggedIn:t,maxSelect:a=5,values:n=[],labelProps:l,onChange:i}=e,r=(0,O._)(e,["isLoggedIn","maxSelect","values","labelProps","onChange"]);let{action:{pushNotifications:o}}=(0,d.useContext)(P.T),[s,c]=(0,d.useState)(""),{t:p,locale:m}=(0,M.u)(),b=(0,d.useRef)(null),[C,f]=(0,d.useState)([]),[E,v]=(0,d.useState)([]),[y,w]=(0,d.useState)([]),[S,k]=(0,d.useState)([]),[I,L]=(0,d.useState)(null),[D,T]=(0,d.useState)([]);(0,d.useEffect)(()=>{(0,O.a)(void 0,void 0,void 0,function*(){var e,t;let a=yield(0,P.e)((0,P.h)(eo.GET_NEWSLETTER_CATEGORIES,{_locale:m}),"get"),l=(null===(e=null==a?void 0:a.data)||void 0===e?void 0:e.interested)||[],i=(null===(t=null==a?void 0:a.data)||void 0===t?void 0:t.trending)||[],r=et()([...l,...i],"catId"),o=r.map(e=>Object.assign(Object.assign({},e),{value:e.catId||"",label:e.localName||""}));if(T(o||[]),L((null==a?void 0:a.data)||null),n.length>0){let e=l.filter(e=>n.includes(e.catId)).map(e=>Object.assign(Object.assign({},e),{template:"interested"})),t=i.filter(e=>n.includes(e.catId)).map(e=>Object.assign(Object.assign({},e),{template:"trending"}));k(e),v(t)}})},[t]);let B=(0,d.useMemo)(()=>et()([...C,...E,...S,...y],"catId"),[C,E,S,y]),[j,F]=(0,d.useState)(!1);(0,d.useEffect)(()=>{B.length>=a?F(!0):F(!1),null==i||i(B)},[B]);let onValueChange=e=>(0,O.a)(void 0,void 0,void 0,function*(){var t;let n="default";if(j)o({type:"danger",title:p("pnTopicSection.maxSelectError.title",{maxSelect:a}),message:p("pnTopicSection.maxSelectError.desc")});else{let a=[{key:"trending",array:null==I?void 0:I.trending},{key:"recently",array:null==I?void 0:I.recently},{key:"interested",array:null==I?void 0:I.interested}],l=a.find(t=>{var a;return null===(a=t.array)||void 0===a?void 0:a.some(t=>t.catId===e[0])});({trending:v,recently:w,interested:k,default:f})[n=(null==l?void 0:l.key)||"default"](t=>[...t,...D.filter(t=>e.some(e=>t.catId===e))].map(e=>Object.assign(Object.assign({},e),{template:n}))),null===(t=b.current)||void 0===t||t.blur()}return null});return d.createElement(g.K,Object.assign({spacing:(0,u.h)(16)},r),d.createElement(g.K,{spacing:(0,u.h)(8)},d.createElement($.T,{size:"p3"},p("pnTopicSection.maxSelectError.detail",{max:a,maxTopic:B.length})),d.createElement(x.NU,{ref:b,maxSelectedValues:3,styles:{wrapper:{overflow:"initial !important"},separator:{padding:16},separatorLabel:{fontWeight:600,fontSize:12,lineHeight:"18px",textTransform:"uppercase",color:_.t.gray[4],"&::after":{display:"none"}},searchInput:{fontSize:"inherit"},input:{paddingRight:16}},nothingFound:d.createElement($.T,{size:"s4",color:"gray.6"},p("pnTopicSection.notFound")),itemComponent:""===s?eu:ep,size:"lg",placeholder:p("pnTopicSection.plsEnterFavTopics"),data:D,onSearchChange:c,searchValue:s,icon:d.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.97183 10.8732C3.97183 7.0617 7.0617 3.97183 10.8732 3.97183C14.6848 3.97183 17.7746 7.0617 17.7746 10.8732C17.7746 14.6848 14.6848 17.7746 10.8732 17.7746C7.0617 17.7746 3.97183 14.6848 3.97183 10.8732ZM10.8732 2C5.97268 2 2 5.97268 2 10.8732C2 15.7738 5.97268 19.7465 10.8732 19.7465C12.9682 19.7465 14.8936 19.0205 16.4115 17.8063L20.3168 21.7116C20.7018 22.0966 21.3261 22.0966 21.7111 21.7116C22.0961 21.3266 22.0961 20.7023 21.7111 20.3173L17.8059 16.4121C19.0203 14.894 19.7465 12.9684 19.7465 10.8732C19.7465 5.97268 15.7738 2 10.8732 2Z",fill:"#595959"})),rightSection:d.createElement(d.Fragment,null),zIndex:500,searchable:!0,withinPortal:!0,onChange:e=>onValueChange(e),value:[]}),B&&B.length>0&&d.createElement(HistorySection,{history:B,onDelete:e=>{let t={trending:v,recently:w,interested:k,default:f},a=t[e.template]||t.default;a(t=>{let a=[...t],n=a.findIndex(t=>t.catId===e.catId);return a.splice(n,1),a})}})),d.createElement(h.x,{sx:e=>({position:"relative",height:(0,u.h)(175),[e.fn.largerThan("sm")]:{height:(0,u.h)(190)}})},d.createElement(h.x,{sx:{position:"absolute",top:0,right:0,left:0}},d.createElement(TrendingCarousel,{topics:((null==I?void 0:I.trending)||[]).map(e=>Object.assign(Object.assign({},e),{template:"trending"})),selectedTopics:E,onTopicChange:v,isBlock:j,labelProps:l}))),d.createElement(RecentlyViewedSection,{topics:((null==I?void 0:I.recently)||[]).map(e=>Object.assign(Object.assign({},e),{template:"recently"})),selectedTopics:y,onTopicChange:w,isBlock:j,labelProps:l}),d.createElement(TopicSection,{labelProps:l,topicsGroup:[{label:p("pnTopicSection.ppAlsoInterested"),topics:((null==I?void 0:I.interested)||[]).map(e=>Object.assign(Object.assign({},e),{template:"interested"}))}],selectedTopics:S,onTopicChange:k,isBlock:j}))},MoreTopics=()=>{let{t:e}=(0,M.u)(),{action:{pushNotifications:t}}=(0,d.useContext)(P.T),{prevStep:a,formValues:n,submitLoading:l,onSubmit:i,selectCategory:r,maxSelectCategory:o,setSelectCategory:s,currentUrl:c,isLoggedIn:p}=(0,d.useContext)(ed);return d.createElement(Layout,{heading:e("newsletter.topic.title"),type:"always",styles:{root:{paddingRight:(0,u.h)(25)}},stickyActions:d.createElement(d.Fragment,null,d.createElement(H.B,{fullWidth:!0,variant:"secondary",dataEventCategory:"Newsletter",dataEventAction:"Back Click",dataEventLabel:c,onClick:a},e("healthToolPNModal.back")),d.createElement(H.B,{fullWidth:!0,type:"submit",dataEventCategory:"Newsletter",dataEventAction:"Next Click",dataEventLabel:c,onClick:()=>{if(0===r.length)return t({type:"danger",title:e("newsletter.error.minTitle"),message:e("newsletter.error.minCotennt")}),!1;null==i||i(n.name)},loading:l},e("healthToolPNModal.next")))},d.createElement(PremiumTopicSelect,{isLoggedIn:p,maxSelect:o,values:n.fitnessTopics,onChange:s,labelProps:{size:"s5",sx:{textTransform:"uppercase"}}}))},Result=()=>{let{t:e}=(0,M.u)(),{close:t,selectCategory:a,onRegisterSuccess:n,currentUrl:l,finishLabelOnResult:i,disclaimerText:r}=(0,d.useContext)(ed);return(0,d.useEffect)(()=>()=>{setTimeout(()=>{null==n||n()},400)},[]),d.createElement(Layout,{heading:e("healthToolPNModal.heading"),stickyActions:d.createElement(H.B,{fullWidth:!0,sx:{maxWidth:(0,u.h)(300)},dataEventCategory:"Newsletter",dataEventAction:"Continue Reading Click",dataEventLabel:l,onClick:()=>{t()}},i||e("healthToolPNModal.finish"))},d.createElement(g.K,null,d.createElement(b.k,{gap:(0,u.h)(8),sx:e=>({background:e.colors.green[0],border:`1px solid ${e.colors.green[1]}`,borderRadius:(0,u.h)(8),padding:(0,u.h)(8)})},d.createElement(h.x,null,d.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},d.createElement("path",{d:"M9.99984 18.3334C14.6022 18.3334 18.3332 14.6025 18.3332 10.0001C18.3332 5.39771 14.6022 1.66675 9.99984 1.66675C5.39746 1.66675 1.6665 5.39771 1.6665 10.0001C1.6665 14.6025 5.39746 18.3334 9.99984 18.3334Z",fill:"#00B16A"}),d.createElement("path",{d:"M9.58558 12.6674C9.22944 12.668 8.87668 12.5983 8.54752 12.4623C8.21835 12.3264 7.91925 12.1268 7.66732 11.8751L6.68587 10.8931C6.55607 10.7587 6.48424 10.5787 6.48587 10.3919C6.48749 10.2051 6.56243 10.0263 6.69455 9.89422C6.82667 9.7621 7.00539 9.68716 7.19222 9.68554C7.37906 9.68391 7.55906 9.75574 7.69345 9.88554L8.67491 10.8675C8.79344 10.986 8.93415 11.08 9.08902 11.1442C9.24389 11.2083 9.40987 11.2413 9.5775 11.2413C9.74513 11.2413 9.91111 11.2083 10.066 11.1442C10.2208 11.08 10.3616 10.986 10.4801 10.8675L16.7033 5.24335C16.8443 5.12184 17.0272 5.06032 17.213 5.07195C17.3987 5.08358 17.5726 5.16744 17.6973 5.30558C17.8221 5.44373 17.8878 5.6252 17.8805 5.81118C17.8731 5.99717 17.7933 6.17291 17.6581 6.30081L11.4592 11.8998C11.2128 12.1448 10.9205 12.3387 10.5989 12.4705C10.2774 12.6022 9.93304 12.6692 9.58558 12.6674Z",fill:"white"}))),d.createElement($.T,{size:"p3"},r||e("pnModal.disclaimer"))),d.createElement(Z.H,{tag:"h5"},e("healthToolPNModal.yourPre")),a.length>0&&d.createElement(TopicSection,{topicsGroup:[{label:"",topics:a}],selectedTopics:a,readonly:!0})))},PremiumNewsletterModal=({isMobile:e,isLoggedIn:t,pnSuggestCategory:a=[],acquisitionInfo:n,currentUrl:l,opened:i,close:r,finishLabelOnResult:o,onRegisterSuccess:s,disclaimerText:c})=>{let{t:u,locale:p}=(0,M.u)(),{action:{pushNotifications:m}}=(0,d.useContext)(P.T),h=S.C.getAssetPath("premiumNewsletter/side-banner-desktop.jpg"),g=S.C.getAssetPath("premiumNewsletter/side-banner-mobile.jpg"),[b,C]=(0,d.useState)([]),[f,E]=(0,d.useState)([]),[v,y]=(0,d.useState)(0),[x,I]=(0,d.useState)({name:"",fitnessTopics:[]}),[L,D]=(0,d.useState)(!1),lastStep=()=>y(2),T=(0,d.useCallback)(e=>(0,O.a)(void 0,void 0,void 0,function*(){try{D(!0),yield(0,P.e)((0,P.h)(eo.POST_SUBSCRIPTION,{website_url:(0,P.i)(p)}),"post",{headers:{"Content-Type":"application/json"},method:"POST",data:{ga_client_id:Y.Z.get(k.G),client_ip:window.clientIP||"",user_info:Object.assign(Object.assign({},n.userInfo),{name:e||x.name,type_subscription:1}),domain:K.v[p||ea.L.Vietnam],category:f,perferred:n.preferredTopics.map(({id:e})=>({id:e}))}}),D(!1),yield(0,P.e)((0,P.j)(ec.UPDATE_SUBSCRIPTION),"post",{headers:{"Content-Type":"application/json"},method:"PUT",data:{subscription:1}}),lastStep()}catch(e){console.log({err:e}),D(!1),m({title:u("notification.comment.somethingWrong"),message:"",type:"danger"})}}),[x,f]);return(0,d.useEffect)(()=>{[h,g].forEach(e=>{let t=new Image;t.src=e})},[]),d.createElement(ed.Provider,{value:{currentUrl:l,isMobile:e,isLoggedIn:t,opened:i,close:r,pnSuggestCategory:a,nextStep:()=>y(e=>e<3?e+1:e),prevStep:()=>y(e=>e>0?e-1:e),lastStep,categoryLibs:b,setCategoryLibs:C,selectCategory:f,setSelectCategory:E,formValues:x,setFormValues:I,maxSelectCategory:5,submitLoading:L,onSubmit:T,onRegisterSuccess:s,finishLabelOnResult:o,disclaimerText:c}},d.createElement(SideBannerModal,{isMobile:e,desktopBanner:S.C.getAssetPath("premiumNewsletter/side-banner-desktop.jpg"),mobileBanner:S.C.getAssetPath("premiumNewsletter/side-banner-mobile.jpg"),modalRatio:{width:960,height:588},desktopBannerRatio:{width:384,height:588},opened:i,onClose:r,zIndex:305,closeProps:{dataEventCategory:"Newsletter",dataEventAction:"Close Click",dataEventLabel:l}},d.createElement(w.v,{active:v,onStepClick:y,styles:{root:{height:"100%"},content:{padding:0,height:"100%",width:"100%"},steps:{display:"none"}}},d.createElement(w.v.Step,null,d.createElement(MainForm,null)),d.createElement(w.v.Step,null,d.createElement(MoreTopics,null)),d.createElement(w.v.Step,null,d.createElement(Result,null)))))},SurveyBanner=()=>{let{locale:e}=(0,M.u)(),{isMobile:t,isLoggedIn:a,currentUrl:n,acquisitionInfo:l,categoryIds:i,state:r,setState:o,settings:s,submitHandler:u,subcribeHealthStatus:p,showPNModal:m,setShowPNModal:h,setIsBack:g}=(0,d.useContext)(er),[b,C]=(0,d.useState)([]),[f,E]=(0,d.useState)(m);(0,d.useEffect)(()=>{(0,O.a)(void 0,void 0,void 0,function*(){var t,a;let n=yield(0,P.e)((0,P.h)(eo.GET_NEWSLETTER_CATEGORIES,{_locale:e}),"get"),l=(null===(t=null==n?void 0:n.data)||void 0===t?void 0:t.interested)||[],r=(null===(a=null==n?void 0:n.data)||void 0===a?void 0:a.trending)||[],o=[...l,...r];C(o.filter(e=>i.includes(Number(e.catId))))})},[]);let v=(0,d.useRef)([]);return(0,d.useEffect)(()=>{let e=(null==p?void 0:p.value)||"",t=e.split("|").filter(Boolean),a=e;v.current.push(p),t.length>1&&(null!==v.current[0]&&g(!0),Object.keys(u).map(e=>{let n=e.split("|");if(t.length===n.length){let l=0;t.map(e=>{n.includes(String(e))&&(l+=1)}),l===t.length&&(a=e)}}));let n=t.length>0?u[a]:s;o(n)},[p]),(0,d.useEffect)(()=>{E(m)},[m]),(null==r?void 0:r.action)!==c.Hide?d.createElement(d.Fragment,null,d.createElement(HandlerBanner,Object.assign({},s.props)),d.createElement(PremiumNewsletterModal,{acquisitionInfo:l,isMobile:t,isLoggedIn:a,currentUrl:n,pnSuggestCategory:b,opened:f,close:()=>{var e;E(!1),h(!1),setTimeout(()=>{var e;(null===(e=r.actionParams)||void 0===e?void 0:e.hideBannerWhenClose)&&o({action:c.Hide})},400),(null===(e=r.actionParams)||void 0===e?void 0:e.hideBannerWhenClose)&&o({action:c.Hide})},onRegisterSuccess:()=>E(!1)})):null},SurveyOrPremiumBanner=({type:e,articleId:t=0,categoryIds:a=[],isMarketing:n,isSurveyType:l,hasPremiumBanner:i,currentUrl:r,isMobile:o,subcribeHealthStatus:s,setShouldAcquisitionModalOpen:u,onValueChange:p,source:m="discover",Wrapper:g})=>{let{t:b}=(0,M.u)(),{data:{userInfo:C}}=(0,d.useContext)(P.T),f=!!(null==C?void 0:C.id),[E,v]=(0,d.useState)(null),[y,x]=(0,d.useState)(),[w,S]=(0,d.useState)(""),[k,I]=(0,d.useState)(!1),[L,O]=(0,d.useState)(!1),D=(0,d.useMemo)(()=>el[e],[]),T=FLOW(b,r)[D],B=null==T?void 0:T.submitHandler,getMappingMultiValue=e=>{let t="",a=e.split("|");return 1===a.length?e:(Object.keys(B).map(e=>{let n=e.split("|");if(a.length===n.length){let l=0;a.map(e=>{n.includes(String(e))&&(l+=1)}),l===a.length&&(t=e)}}),t)},j=g||h.x,handleShowPNBannerFlowWhenLogin=()=>i&&(null==C?void 0:C.subscription)!==1?d.createElement(PnBannerEle,null):null;return(0,d.useEffect)(()=>{f&&v({userInfo:C,preferredTopics:en,healthTopics:[]})},[f]),d.createElement(er.Provider,{value:{settings:T,submitHandler:B,type:e,surveyType:D,value:w,setValue:S,isMobile:o,isLoggedIn:f,isMarketing:n,hasPremiumBanner:i,currentUrl:r,acquisitionInfo:E,categoryIds:a,subcribeHealthStatus:s,articleId:t,onValueChange:p,state:y,setState:x,handleClickOption:e=>{let t=getMappingMultiValue(e);if(t){let a=B[t];a.action===c.ShowPremiumModal?i?(I(!0),x(Object.assign(Object.assign({},y),{actionParams:{hideBannerWhenClose:a.action===c.ShowPremiumModal}}))):(x({action:c.Hide}),null==p||p(e)):(x(a),null==p||p(e))}},showPNModal:k,setShowPNModal:I,source:m,Outside:j,isBack:L,setIsBack:O,minHeight:180,setShouldAcquisitionModalOpen:u}},void 0!==s?f?l&&T?(()=>{let e=B[(null==s?void 0:s.value)||""];return(null==e?void 0:e.action)===c.ShowPremiumModal?handleShowPNBannerFlowWhenLogin():d.createElement(SurveyBanner,null)})():handleShowPNBannerFlowWhenLogin():i?d.createElement(PnBannerEle,null):null:null)}},NPrf:function(e,t,a){a.d(t,{B:function(){return BookingSearchBarV3},T:function(){return TextDivider}});var n,l,i,r,o=a("q1tI"),s=a("6mQP"),c=a("0D4Z"),d=a("iuhU"),u=a("Eso5"),p=a("aDCK"),m=a("mYVa"),h=a("vaps"),g=a("8vDj"),b=a("OAL+"),C=a("SPK5"),f=a("TIp3"),E=a("CmzK"),v=a("NEaA"),y=a("rlLN"),x=a("Iblh"),w=a("yb//"),S=a("hpER"),P=a("L+vc"),k=a("sEfC"),I=a.n(k),L=a("Hzfr"),O=a("rBCA"),D=a("iBNF"),T=a("Efqo"),B=a("ovFX"),M=a("oZWv"),j=a("Qcmz"),F=a("HJpP"),R=a("A24R"),_=a("mis8"),$=a("R2iv"),H=a("XDLp");let N=O.Z.div``,A=O.Z.div` background-color: ${D.r.colors.neutral50}; padding-bottom: 1px; ${T.M.mbDown} { padding: 0; } `,Z=(0,O.Z)(B.C)` padding: 0 16px; ${T.M.mbDown} { padding: 0; } `,z=O.Z.div` padding: 24px 56px; border-radius: 16px; background-color: ${D.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); ${T.M.mbDown} { padding: 16px; border-radius: 0; } .flex-search-input { flex-direction: row; ${T.M.mbDown} { flex-direction: column; } } `,V={"en-PH":3,"tl-PH":2,"id-ID":3,"vi-VN":2,"zh-TW":0,"ms-MY":2,"th-TH":2},K={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,n;switch(e.isDebug&&console.log("bookingSearchBarV3",{action:t,state:e}),t.type){case i.NavigateTo:return Object.assign(Object.assign({},e),{navigateTo:t.payload,focused:"none",isMobileModalOpened:!1});case i.ClickOutsideInputLocation:if("location"!==e.focused)return e;return resetSearchLocationKeywords(Object.assign(Object.assign({},e),{focused:"none"}));case i.ClickOutsideInputSpecialty:if("specialty"!==e.focused)return e;return resetSearchLocationKeywords(Object.assign(Object.assign({},e),{focused:"none"}));case i.ClickOutsideInputSearch:if("search"!==e.focused)return e;return Object.assign(Object.assign({},e),{focused:"none"});case i.ClickOutsideInputSearchSpecialty:if("search"!==e.focusedSpecialty)return e;return Object.assign(Object.assign({},e),{focusedSpecialty:"none"});case i.FocusInputLocation:{let t=Object.assign(Object.assign({},e),{focused:"location"});return(null===(a=e.selectedLocation)||void 0===a?void 0:a.id)===L.a&&(t.searchLocationKeywords=""),t}case i.FocusInputSpecialty:{let t=Object.assign(Object.assign({},e),{focused:"specialty"});return(null===(n=e.selectedLocation)||void 0===n?void 0:n.id)===L.a&&(t.searchLocationKeywords=""),t}case i.FocusInputSearch:let l=Object.assign(Object.assign({},e),{focused:"search"});if(e.isMobile)return resetSearchLocationKeywords(l);return l;case i.FocusInputSearchSpecialty:{let t=Object.assign(Object.assign({},e),{focusedSpecialty:"search"});return t}case i.ChangeInputLocation:return Object.assign(Object.assign({},e),{searchLocationKeywords:t.payload});case i.ChangeInputSearch:{let a=t.payload;return Object.assign(Object.assign({},e),{searchKeywords:a,isLoadingSearchResults:a.trim().length>V[e.locale]})}case i.SelectCurrentLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name});case i.ClearInputLocation:return Object.assign(Object.assign({},e),{focused:"location",cities:e.initialCities,searchLocationKeywords:""});case i.ClearInputSearch:return Object.assign(Object.assign({},e),{focused:"search",searchKeywords:""});case i.SelectLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name,searchResults:{}});case i.SelectSpecialty:return Object.assign(Object.assign({},e),{focused:"none",selectedSpecialty:t.payload,searchResults:{}});case i.SelectSearchResult:return Object.assign(Object.assign({},e),{searchKeywords:t.payload.name,isMobileModalOpened:!1,focused:"none",navigateTo:t.payload.url});case i.FetchCitiesStart:return Object.assign(Object.assign({},e),{isLoadingCities:!0});case i.FetchCitiesFinish:return Object.assign(Object.assign({},e),{isLoadingCities:!1});case i.FetchSearchResultsStart:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!0});case i.FetchSearchResultsFinish:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!1});case i.FetchSearchResultsComplete:{let a=Object.assign(Object.assign({},e),{searchResults:Object.assign(Object.assign({},e.searchResults),{[t.payload.key]:t.payload.searches})});return a}case i.FetchCitiesByGeoIpComplete:{let{cities:a}=t.payload,{default:n}=t.payload;a=a.filter(e=>e.id!==n.id),n&&a.unshift(n),e.initialSelectedCity&&!a.find(t=>t.id===e.initialSelectedCity.id)&&a.unshift(e.initialSelectedCity);let l=Object.assign(Object.assign({},e),{defaultCity:n,initialCities:a,cities:a});return"denied"!==e.geoLocationPermission||e.initialSelectedCity||(l.selectedLocation=n,l.searchLocationKeywords=n.name),l}case i.FetchCitiesByKeywordComplete:return Object.assign(Object.assign({},e),{cities:t.payload});case i.DisplayInitialCities:return Object.assign(Object.assign({},e),{cities:e.initialCities});case i.DisplayInitialSearchResults:{let t=e.searchKeywords.trim(),a=V[e.locale],n=t.length>0&&t.length<=a;return Object.assign(Object.assign({},e),{searchResults:n?{}:e.initialSearchResults,isLoadingSearchResults:!1})}case i.UpdateInitialSearchResults:return Object.assign(Object.assign({},e),{initialSearchResults:Object.assign(Object.assign({},e.initialSearchResults),{[t.payload.key]:t.payload.searches})});case i.GrantGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"granted",geoLocationCoordinates:t.payload});case i.DenyGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"denied",geoLocationCoordinates:null});case i.OpenMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!0});case i.CloseMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!1});case i.UpdateInitialSearchValue:return Object.assign(Object.assign({},e),{searchKeywords:t.payload});case i.SetInputSearchPlaceholder:return Object.assign(Object.assign({},e),{inputSearchPlaceholder:t.payload});case i.FetchAllSpecialties:return Object.assign(Object.assign({},e),{allSpecialties:t.payload});case i.FetchPopularKeys:return Object.assign(Object.assign({},e),{popularKeys:t.payload});default:return e}}(n=i||(i={})).NavigateTo="navigate to url",n.ClickOutsideInputLocation="click outside input location",n.ClickOutsideInputSearch="click outside input search",n.ClickOutsideInputSearchSpecialty="click outside input search specialty",n.ClickOutsideInputSpecialty="click outside input specialty",n.SelectCurrentLocation="select current location",n.FocusInputLocation="focus input location",n.FocusInputSearch="focus input search",n.FocusInputSearchSpecialty="focus input search specialty",n.ChangeInputLocation="change input location",n.ChangeInputSearch="change input search",n.ClearInputLocation="clear input location",n.ClearInputSearch="clear input search",n.SelectLocation="select location",n.SelectSpecialty="select specialty",n.FetchCitiesStart="fetch cities start",n.FetchCitiesFinish="fetch cities finish",n.FetchSearchResultsStart="fetch search results start",n.FetchSearchResultsComplete="fetch search results complete",n.FetchSearchResultsFinish="fetch search results finish",n.FetchCitiesByGeoIpComplete="fetch cities by geo IP finish",n.FetchCitiesByKeywordComplete="fetch cities by keyword finish",n.DisplayInitialCities="display initial cities",n.DisplayInitialSearchResults="display initial search results",n.UpdateInitialSearchResults="update initial search results",n.GrantGeoLocationPermission="grant geolocation permission",n.DenyGeoLocationPermission="deny geolocation permission",n.OpenMobileModal="open mobile modal",n.CloseMobileModal="close mobile modal",n.UpdateInitialSearchValue="update initial search value",n.SelectSearchResult="select search result",n.SetInputSearchPlaceholder="set input search placeholder",n.FocusInputSpecialty="focus input specialty",n.FetchAllSpecialties="fetch all specialty",n.FetchPopularKeys="fetch popular key by type";let W=O.Z.div` flex: 1; position: relative; ${T.M.mbDown} { width: 100%; } `,U=O.Z.div` background: #f7f9fc; border-radius: 12px; height: 48px; display: flex; align-items: center; padding: 4px 12px 4px 4px; gap: 16px; ${T.M.mbDown} { height: 48px; width: 100%; } `,q=O.Z.div` display: flex; align-items: center; flex-shrink: 0; color: #8c8c8c; svg { width: 18px; height: 18px; } `,G=O.Z.div` position: absolute; top: calc(100% + 2px); width: 100%; border-radius: 4px; background: ${D.r.colors.white}; box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1); z-index: 10; ${T.M.mbDown} { width: calc(100% + 64px); left: -32px; } `,Q=O.Z.div``;O.Z.div` display: flex; justify-content: space-between; align-item: center; padding: 9px 14px 9px 22px; background: #f7f9fc; .title { color: ${D.r.colors.gray800}; font-size: 14px; font-weight: 600; line-height: 22px; } .btn-see-all { color: ${D.r.colors.blue600}; font-size: 14px; line-height: 22px; cursor: pointer; } `;let Y=O.Z.div` padding: 10px 16px; max-height: 400px; overflow: auto; `,X=O.Z.div` display: flex; gap: 12px; align-items: center; cursor: pointer; ${T.M.mbUp} { &:hover { background-color: ${D.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 ${D.r.colors.neutral100}; .title { color: ${D.r.colors.gray800}; font-size: 16px; font-weight: 600; line-height: 24px; } .description { overflow: hidden; color: ${D.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; } } `;O.Z.div` padding: 0 16px 16px; .search-detail-btn { color: ${D.r.colors.blue600}; font-size: 14px; line-height: 22px; cursor: pointer; } `;let SearchResult=({state:e,type:t,results:a,isLoading:n,typeInformation:l,dispatch:r})=>{let{t:s}=(0,P.u)(),{selectedLocation:u}=e,p=(0,o.useMemo)(()=>l[t].slug,[l,t]),handleOnClick=e=>{let a="";switch(t){case"service":a=`/${u.slug}/${p}/${e.slug}`;break;case"doctor":case"hospital":a=`/${p}/${e.slug}-${e.id}`}a&&r({type:i.NavigateTo,payload:a})};return null===a?null:o.createElement(Q,null,o.createElement(Y,{className:"search-results__body"},n&&o.createElement("div",{className:"skeleton-result"},[,,,].fill(void 0).map((e,a)=>o.createElement(X,{key:t+"loading"+a,className:2===a?"last-item":""},o.createElement("div",{className:"image-item"},o.createElement(c.O,{height:48,circle:!0,mb:"xl",animate:!0})),o.createElement("div",{className:"infor"},o.createElement("div",{className:"title"},o.createElement(c.O,{height:8,mt:10,radius:"xl",animate:!0})),o.createElement("div",{className:"description"},o.createElement("div",{className:"sub-description"},o.createElement(c.O,{height:8,mt:10,radius:"xl",width:"80%",animate:!0}))))))),!n&&a&&a.length>0&&o.createElement(o.Fragment,null,a.map((e,n)=>{var i,r;let s=a.length>4&&3===n||a.length<=4&&n===a.length-1,c="";return("hospital"===t&&(c=(null==e?void 0:e.address)||""),"doctor"===t&&(c=(null===(i=null==e?void 0:e.specialties)||void 0===i?void 0:i.join(", "))||""),"service"===t&&(c=(null===(r=null==e?void 0:e.hospital_branch)||void 0===r?void 0:r.name)||""),n>=4)?o.createElement(o.Fragment,null):o.createElement(X,{key:e.id,className:(0,d.default)(s?"last-item":"","result-item"),onClick:()=>handleOnClick(e)},o.createElement("div",{className:"image-item"},o.createElement("img",{src:e.logo||e.avatar,alt:e.name})),o.createElement("div",{className:"infor"},o.createElement("div",{className:"title"},e.name),o.createElement("div",{className:"description"},l[t].icon,o.createElement("div",{className:"sub-description"},c))))})),!n&&(null==a?void 0:a.length)===0&&o.createElement(M.T,{size:"sm",color:D.r.colors.gray400,className:"noresult-block"},s("booking.searchBar.noResults"))))},SearchResultContent=({state:e,type:t,isLoading:a,clientSlug:n,typeInformation:l,dispatch:i})=>{var r;return"search"!==e.focused?null:o.createElement(SearchResult,{type:t,state:e,results:(null===(r=e.searchResults)||void 0===r?void 0:r[t])||null,location:e.selectedLocation.name,dispatch:i,isLoading:a,typeInformation:l,clientSlug:n})},J=O.Z.div` position: relative; flex-shrink: 0; ${T.M.mbDown} { width: 100%; display: flex; flex-direction: column; gap: 12px; } &.compact { ${T.M.mbDown} { width: auto; display: block; } } `,ee=O.Z.div` position: absolute; top: calc(100% + 4px); left: 0; min-width: 264px; background: white; border-radius: 12px; box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.04), 0px 2px 8px 0px rgba(0, 0, 0, 0.04), 0px 10px 16px 0px rgba(0, 0, 0, 0.04); z-index: 10; overflow: hidden; &.mobile { min-width: 280px; } `,et=O.Z.div` cursor: pointer; padding: 12px 16px; display: flex; align-items: center; gap: 12px; outline: none; .image-item { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex-shrink: 0; img { width: 100%; height: 100%; object-fit: contain; } svg { width: 24px; height: 24px; } } .item-label { font-size: 15px; font-weight: 400; line-height: 24px; letter-spacing: -0.3px; color: ${D.r.colors.gray800}; } &:hover { background-color: ${D.r.colors.neutral50}; } &.selected { background-color: ${D.r.colors.neutral50}; } &:last-child { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; } `,DoctorIcon=()=>o.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},o.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=()=>o.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},o.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=()=>o.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},o.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=()=>o.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16"},o.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,onSpecialtyClick:a,dispatch:n,isCompact:l=!1})=>{let{t:r,locale:c}=(0,P.u)(),d=(0,o.useRef)(null),g=(0,o.useRef)(null),b=(0,o.useMemo)(()=>L.L[c],[c]),[C,f]=(0,o.useState)(""),[E,{close:v,toggle:y}]=(0,x.q)(!1);(0,S.a)(d,()=>{v(),f(""),n({type:i.ClickOutsideInputSpecialty})});let w=(0,o.useMemo)(()=>[{name:r("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:b.SPECIALTIES},...e.allSpecialties],[e.allSpecialties,r,b.SPECIALTIES]),k=(0,o.useMemo)(()=>C.trim()?w.filter(e=>e.name.toLowerCase().includes(C.toLowerCase().trim())):w,[w,C]),I=(0,o.useMemo)(()=>e.selectedSpecialty?e.selectedSpecialty.name:"",[e.selectedSpecialty]),O=(0,o.useCallback)(e=>{a({id:e.id,name:e.name,slug:e.slug,thumbnail:e.thumbnail||"",total_doctor:0}),v(),f("")},[a,v]),T=(0,o.useCallback)(()=>{y(),E&&f("")},[y,E]);return o.createElement(J,{ref:d,className:l?"compact":""},o.createElement(u.x,{onClick:T,className:E?"dropdown-trigger-open":"",sx:{cursor:"pointer",position:"relative",width:l?t?96:160:"100%",flexShrink:0}},o.createElement(p.I,{readOnly:!0,value:I,placeholder:r("booking.searchPopup.specialties"),rightSection:o.createElement(j.C,{style:{width:20,height:20}}),styles:Object.assign({input:{cursor:"pointer",outline:"none","&:focus":{outline:"none"},"&:not(.mantine-Textarea-input)":{height:l?40:t?40:46,fontSize:l?(0,m.h)(14):t?(0,m.h)(14):(0,m.h)(16),paddingLeft:l?12:16,paddingRight:30,background:l?"white":"transparent",border:l?`1px solid ${D.r.colors.gray200}`:"none",borderRadius:8,letterSpacing:"-0.2px",color:D.r.colors.gray800,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}},rightSection:{width:30,pointerEvents:"none"}},!l&&{wrapper:{position:"relative","&:after":{content:'""',width:"1px",height:"20px",backgroundColor:D.r.colors.neutral100,position:"absolute",right:0,top:"50%",transform:"translateY(-50%)"}}})})),E&&o.createElement(ee,{className:t?"mobile":""},o.createElement(u.x,{sx:{padding:"12px 12px 8px"}},o.createElement(p.I,{ref:g,icon:o.createElement(s.Z,{size:18,color:D.r.colors.gray300}),placeholder:r("booking.searchBar.placeholder.specialty"),value:C,onChange:e=>f(e.target.value),size:"md",styles:{input:{height:40,fontSize:(0,m.h)(15),paddingLeft:36,"&::placeholder":{color:D.r.colors.gray400}},icon:{width:36}}})),o.createElement(h.x.Autosize,{mah:300},0===k.length?o.createElement(u.x,{sx:{padding:"12px 16px",color:D.r.colors.gray400,fontSize:14}},r("common.noResult")):k.map(t=>{var a,n;return o.createElement(et,{key:t.id,tabIndex:0,role:"option","aria-selected":(null===(a=e.selectedSpecialty)||void 0===a?void 0:a.id)===t.id,className:(null===(n=e.selectedSpecialty)||void 0===n?void 0:n.id)===t.id?"selected":"",onClick:()=>O(t),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),O(t))}},o.createElement("div",{className:"image-item"},t.thumbnail?o.createElement("img",{src:t.thumbnail,alt:t.name}):o.createElement(SpecialtyIcon,null)),o.createElement("span",{className:"item-label"},t.name))}))))},ea=(0,o.forwardRef)(({state:e,type:t,isMobile:a,isLoading:n,initalSearchValue:l,typeInformation:r,debouncedFetchSearchResults:c,trackingAttributes:d,hideSpecialtySelection:u=!1,clientSlug:h="",onSearch:g,onFocusInput:b,onEnterSearch:C,dispatch:f,onlyShowSearchBox:E,onChangeSpecialty:v},y)=>{let{t:x}=(0,P.u)(),w=(0,o.useRef)(null),k=(0,o.useRef)(null);(0,o.useImperativeHandle)(y,()=>({focus:()=>{var e;null===(e=k.current)||void 0===e||e.focus()}}));let I=(0,o.useMemo)(()=>d?{"data-event-category":d.dataEventCategory,"data-event-action":d.dataEventAction,"data-event-label":d.dataEventLabel}:{},[d]),L=(0,o.useMemo)(()=>"doctor"===t?x("booking.searchBar.placeholder.doctor"):"service"===t?x("booking.searchBar.placeholder.service"):"hospital"===t?x("booking.searchBar.placeholder.hospital"):"specialty"===t?x("booking.searchBar.placeholder.specialty"):"",[t,x]),O="specialty"!==t&&"service"!==t&&!u&&!E,T=(0,o.useMemo)(()=>({input:{border:"none",background:"transparent",height:"100%",fontSize:(0,m.h)(16),color:D.r.colors.gray800,padding:"0","&::placeholder":{color:D.r.colors.gray400},"&:focus":{outline:"none",boxShadow:"none"},[a?"@media (max-width: 767px)":""]:a?{fontSize:(0,m.h)(16)}:{}},wrapper:{flex:1}}),[a]);(0,S.a)(w,()=>{a||f({type:i.ClickOutsideInputSearch})});let B=(0,o.useCallback)(function(a){f({type:i.ChangeInputSearch,payload:a}),"function"!=typeof g&&(a.trim().length>V[e.locale]||l||0===a.trim().length)&&c(a.trim(),e,t,h)},[f,e,t,l,c,h,g]),M=(0,o.useCallback)(function(e){var t;f({type:i.SelectSpecialty,payload:e}),null==v||v(e),a||null===(t=k.current)||void 0===t||t.focus()},[f,v]),j=(0,o.useCallback)(e=>{"Enter"===e.key&&(e.stopPropagation(),e.preventDefault(),C&&C())},[C]);return o.createElement(W,{ref:w},o.createElement(U,null,O&&o.createElement(SearchSpecialty,{state:e,isMobile:a,dispatch:f,debouncedFetchSearchResults:c,onSpecialtyClick:M,isCompact:!0}),o.createElement(q,null,o.createElement(s.Z,null)),o.createElement(p.I,Object.assign({ref:k,variant:"unstyled",size:a?"md":"lg",placeholder:L,styles:T,value:e.searchKeywords,name:"search-results",autoComplete:"off",onFocus:()=>{f({type:i.FocusInputSearch}),null==b||b()},onChange:e=>{B(e.target.value)},onKeyDown:j},I))),!a&&"specialty"!==t&&o.createElement(G,null,o.createElement(SearchResultContent,{type:t,state:e,dispatch:f,isLoading:n,typeInformation:r,clientSlug:h})))});ea.displayName="SearchInputs";let ModalSearchResult=e=>{var{searchInputEle:t,closeModal:a,children:n}=e,l=(0,F._)(e,["searchInputEle","closeModal","children"]);let i=(0,g.rZ)();return o.createElement(_.M,Object.assign({},l,{zIndex:310,fullScreen:!0,styles:{content:{borderRadius:0,height:"100%",".search-results__body":{padding:0},".result-item":{paddingLeft:16,paddingRight:16},".noresult-block":{padding:16},".skeleton-result":{padding:16}},header:{display:"none"}}}),o.createElement(b.K,{spacing:16,sx:{paddingTop:16}},o.createElement(C.k,{align:"center",gap:12},o.createElement(R.Z,{size:28,onClick:a,color:i.fn.primaryColor()}),o.createElement(u.x,{sx:{width:"100%"}},t)),n))},en=O.Z.div` position: relative; width: 240px; flex-shrink: 0; ${T.M.mbDown} { width: 100%; } `;O.Z.div` position: absolute; top: calc(100% + 2px); width: 100%; border-radius: 4px; background: ${D.r.colors.white}; box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1); z-index: 10; ${T.M.mbDown} { width: calc(100% + 64px); left: -32px; } `;let el=O.Z.div` position: relative; cursor: pointer; padding: 12px 18px; display: flex; align-items: center; gap: 14px; overflow: hidden; & + li::before { content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 1px; background-color: ${D.r.colors.neutral100}; } &:not([data-is-denied='true']):hover { background-color: ${D.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; } `,ei=(0,O.Z)(w.P)` width: 12px; height: 18px; flex: 0 0 12px; `,er=(0,o.forwardRef)((e,t)=>{var{label:a,value:n}=e,l=(0,F._)(e,["label","value"]);return o.createElement("div",Object.assign({ref:t},l),o.createElement(el,{key:n,role:"button",tabIndex:0,"aria-label":`Select ${a} as location`,className:"location-item"},o.createElement(ei,{color:D.r.colors.neutral400}),o.createElement(f.x,{size:"md"},a)))}),SearchLocation=({state:e,debouncedFetchCitiesByKeyword:t,selectedLocation:a,trackingAttributes:n,onLocationClick:l,dispatch:r})=>{var s;let{t:c,locale:d}=(0,P.u)(),u=(0,o.useRef)(null),p=(0,o.useMemo)(()=>{var t;return[{name:c("booking.searchBar.allLocations"),id:L.I,slug:null===(t=L.L[d])||void 0===t?void 0:t.ALL},...e.cities]},[e.cities,c,d]),h=(0,o.useMemo)(()=>n?{"data-event-category":n.dataEventCategory,"data-event-action":n.dataEventAction,"data-event-label":n.dataEventLabel}:{},[n]),g=(0,o.useCallback)(function(a){r({type:i.ChangeInputLocation,payload:a}),a.trim().length>V[e.locale]?t(a.trim()):(t.cancel(),r({type:i.DisplayInitialCities}))},[t,r,e.locale]);(0,S.a)(u,()=>{r({type:i.ClickOutsideInputLocation})});let b=null!==(s=null==a?void 0:a.id)&&void 0!==s?s:null,C=null===b?void 0:String(b);return o.createElement(en,{ref:u},o.createElement(E.Ph,Object.assign({key:null!=C?C:"no-selected-location",defaultValue:C,placeholder:c("booking.searchBar.allLocations"),searchable:!0,onSearchChange:e=>{g(e)},onFocus:()=>{r({type:i.DisplayInitialCities})},onDropdownClose:()=>{t.cancel(),r({type:i.DisplayInitialCities})},nothingFound:c("common.noResult"),maxDropdownHeight:340,dropdownPosition:"bottom",icon:o.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("path",{d:"M9.99908 10.8332C11.2264 10.8332 12.2213 9.83764 12.2213 8.61097C12.2213 7.3843 11.2264 6.38875 9.99908 6.38875C8.77174 6.38875 7.77686 7.3843 7.77686 8.61097C7.77686 9.83764 8.77174 10.8332 9.99908 10.8332Z",stroke:"#111111",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{d:"M9.99919 18.0554C11.7584 17.4999 16.6659 13.611 16.6659 8.61097C16.6659 4.93097 13.6811 1.94431 9.99919 1.94431C6.3173 1.94431 3.33252 4.93097 3.33252 8.61097C3.33252 13.611 8.23996 17.4999 9.99919 18.0554Z",stroke:"#111111",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),rightSection:o.createElement(j.C,{style:{width:20,height:20}})},h,{styles:()=>({item:{padding:0,"&[data-selected]":{"&, &:hover":{backgroundColor:"#F7F9FC",color:"inherit"},".location-item":{"&::after":{content:w.i,top:"50%",right:19,position:"absolute",transform:"translateY(-50%)"}}},"&[data-hovered]":{backgroundColor:"transparent"}},root:{width:"100%"},wrapper:{width:"100%"},input:{"&:not(.mantine-Textarea-input)":{height:48,fontSize:(0,m.h)(15),fontWeight:400,letterSpacing:"-0.3px",color:D.r.colors.gray1000,paddingLeft:44,paddingRight:40,background:"white",border:`1px solid ${D.r.colors.gray200}`,borderRadius:12}},icon:{width:44,paddingLeft:12},rightSection:{width:40,paddingRight:12},itemsWrapper:{padding:0},dropdown:{left:"0 !important",border:0,marginTop:4,borderRadius:12,overflow:"hidden",boxShadow:"0px 0px 1px 0px rgba(0, 0, 0, 0.04), 0px 2px 8px 0px rgba(0, 0, 0, 0.04), 0px 10px 16px 0px rgba(0, 0, 0, 0.04)","& ::-webkit-scrollbar":{width:"6px",height:"6px"}}}),itemComponent:er,filter:()=>!0,onChange:e=>{if(null==e)return;let a=p.find(t=>String(t.id)===e);a&&(l(a),t.cancel(),r({type:i.DisplayInitialCities}),setTimeout(()=>{var e,t;null===(t=null===(e=u.current)||void 0===e?void 0:e.querySelector("input"))||void 0===t||t.blur()},0))},data:p.map(e=>({value:String(e.id),label:e.name,city:e}))})))},eo=O.Z.div` display: flex; flex-wrap: wrap; row-gap: 8px; column-gap: 20px; ${T.M.mbDown} { margin-top: 12px; } `,es=O.Z.div` display: flex; align-items: center; border-radius: 8px; border: 1px solid ${D.r.colors.neutral100}; background: ${D.r.colors.white}; padding: 8px 12px 8px 8px; flex: 0 0 calc(33.3% - 13px); gap: 12px; cursor: pointer; &:hover { background: ${D.r.colors.blue50}; } ${T.M.tdDown} { flex: 0 0 calc(50% - 10px); } ${T.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: ${D.r.colors.gray800}; font-size: 14px; font-style: normal; font-weight: 400; line-height: 22px; } .description { color: ${D.r.colors.gray600}; font-size: 12px; font-weight: 400; line-height: 18px; } } `,ec=(0,O.Z)(v.i)` margin: 24px 0 !important; `,ed=O.Z.div` display: flex; justify-content: center; margin-top: 24px; .show-more { border-radius: 4px; border: 1px solid ${D.r.colors.neutral200}; padding: 12px 16px; cursor: pointer; display: inline-block; color: ${D.r.colors.gray800}; font-size: 16px; font-weight: 600; line-height: 24px; ${T.M.mbDown} { width: 100%; text-align: center; } } `,SearchResultSpecialties=({state:e,isMobile:t,specialties:a,isLoading:n,dispatch:l})=>{let{t:r,locale:s}=(0,P.u)(),{selectedLocation:d}=e,u=(0,o.useMemo)(()=>L.L[s],[s]),handleOnClick=e=>{let t="";e===L.S?(t=`/${d.slug}/${u.HOSPITAL}/${L.C.GSK}/`,l({type:i.ClickOutsideInputSearchSpecialty})):t=`/${d.slug}/${u.DOCTOR}/${e}`,l({type:i.NavigateTo,payload:t})},p=(0,o.useMemo)(()=>a.length>=9||e.searchKeywords.trim().length<=V[e.locale],[e.searchKeywords,a]);return o.createElement(o.Fragment,null,!t&&o.createElement(ec,{color:"#E4E8EC"}),o.createElement(eo,null,a.length>0&&!n&&o.createElement(o.Fragment,null,a.map((e,t)=>t>=9?o.createElement(o.Fragment,null):o.createElement(es,{key:e.id,onClick:()=>handleOnClick(e.slug)},o.createElement("div",{className:"image-item"},o.createElement("img",{src:e.thumbnail,alt:e.name})),o.createElement("div",{className:"infor"},o.createElement("div",{className:"title"},e.name))))),0===a.length&&!n&&o.createElement(M.T,{size:"sm",color:D.r.colors.gray400},r("booking.searchBar.noResults")),n&&Array(6).fill(void 0).map((e,t)=>o.createElement(es,{key:"loading"+t},o.createElement("div",{className:"image-item"},o.createElement(c.O,{height:40,animate:!0})),o.createElement("div",{className:"infor"},o.createElement("div",{className:"title"},o.createElement(c.O,{height:20,radius:"sm",animate:!0})))))),p&&o.createElement(ed,null,o.createElement("div",{className:"show-more",onClick:()=>{let e=`/${u.SPECIALTIES}`;l({type:i.NavigateTo,payload:e})}},r("home.seeAll"))))},eu=O.Z.div` display: flex; gap: 5px; margin-top: 16px; flex-wrap: wrap; `,ep=O.Z.div` color: ${D.r.colors.gray600}; font-size: 14px; font-weight: 600; line-height: 22px; padding: 4px 12px; background: ${D.r.colors.white}; border-radius: 32px; cursor: pointer; border: 1px solid ${D.r.colors.white}; margin-bottom: 5px; border-color: ${D.r.colors.neutral100}; background: #f7f9fc; &.view-all { border-radius: 32px; border-color: ${D.r.colors.blue50}; background: ${D.r.colors.blue50}; color: ${D.r.colors.blue600}; &:hover { border-color: ${D.r.colors.blue50}; background: ${D.r.colors.blue50}; color: ${D.r.colors.blue600}; } } &:hover { border-color: ${D.r.colors.neutral100}; background: #f7f9fc; } `,em=O.Z.div` color: ${D.r.colors.gray600}; font-size: 14px; font-weight: 600; line-height: 22px; padding: 4px 0; background: ${D.r.colors.white}; border-radius: 32px; border: 1px solid ${D.r.colors.white}; margin-bottom: 5px; margin-right: 7px; `,SearchTag=({state:e,type:t,typeInformation:a,dispatch:n})=>{let{t:l}=(0,P.u)(),{selectedLocation:r}=e,s=(0,o.useMemo)(()=>a[t].slug,[a,t]),handleClickKeyword=e=>{e.url&&(window.location.href=e.url)};return o.createElement(eu,null,o.createElement(em,null,l("booking.searchBar.popularKey")),e.popularKeys.map(e=>o.createElement(ep,{key:e.id,onClick:()=>handleClickKeyword(e)},e.keyword)),o.createElement(ep,{className:"view-all",onClick:()=>{let e=`/${r.slug}/${s}`;e&&n({type:i.NavigateTo,payload:e})}},l("booking.searchBar.viewAll")))},eh=O.Z.div` background: rgba(255, 255, 255, 0.64); backdrop-filter: blur(12px); border-bottom: 1px solid ${D.r.colors.neutral100}; `,eg=(0,O.Z)(B.C)` padding: 0 16px; `,TabSearch=({currentTab:e,hideTabBookingSearch:t=[],hideSpecialtyTab:a,isMobile:n,setCurrentTab:l})=>{let{t:i}=(0,P.u)(),r=(0,o.useMemo)(()=>({root:{overflowY:n?"hidden":"initial",overflowX:n?"auto":"initial"},tabsList:{background:"rgba(255, 255, 255, 0)",borderBottom:"none",flexWrap:"nowrap",".mantine-Tabs-tab":{"&:last-child":{"&:after":{display:"none"}}}},tab:{padding:n?"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:n?"14px":"16px",fontWeight:600,lineHeight:n?"22px":"24px"}}),[n]),s=(0,o.useMemo)(()=>[{value:"hospital",label:i("booking.searchPopup.hospitals")},{value:"doctor",label:i("booking.searchPopup.doctors")},{value:"service",label:i("booking.searchPopup.services")},...a?[]:[{value:"specialty",label:i("booking.searchPopup.specialties")}]],[a]),c=(0,o.useMemo)(()=>s.filter(e=>!t.includes(e.value))||[],[t,s]);return o.createElement(eh,{className:"booking-search-tab"},o.createElement(eg,null,o.createElement(y.m,{value:e,onTabChange:e=>{l(e)},styles:r},o.createElement(y.m.List,null,c.map(e=>o.createElement(y.m.Tab,{value:e.value,key:e.value},e.label))))))};(l=r||(r={})).doctor="doctor",l.service="hospital_service",l.hospital="hospital_branch";let ignoreCacarSpecialty=e=>e.filter(e=>"string"==typeof e?"cacar-api"!==e:(null==e?void 0:e.id)!==232),BookingSearchBarV3=({isMobile:e,careApiDomain:t,geoLocationPermission:a,geoLocationCoordinates:n,initialSelectedCity:l,initialSearchValue:c="",initTypeSearch:d="hospital",initSpecialty:p,careFrontDomain:m="/care",isDebug:h=!1,gaTrackingSearchBar:g,gaTrackingLocationSearch:b,autoCompleteDisabled:f=!1,inputSearchPlaceholder:E="",hideTabBookingSearch:v=[],hideSpecialtySelection:y=!1,hideSpecialtyTab:k=!1,hidePopularSearchKeys:O=!1,clientSlug:D="",triggerSearchWhenChangeFilter:T,routerPush:B,onGeoLocationPermissionChange:M,onChangeLocation:j})=>{var F;let{locale:R,t:_}=(0,P.u)(),W=(0,o.useRef)(null),U=(0,o.useRef)(null),q=(0,o.useRef)(null),G=(0,o.useRef)(null),[Q,Y]=(0,o.useState)(d),{geoLocationPermission:X,geoLocationCoordinates:J}=(0,w.u)(),[ee,et]=(0,o.useReducer)(reducer,K,t=>Object.assign(Object.assign({},t),{isDebug:h,isMobile:e,geoLocationPermission:a||X||"unset",geoLocationCoordinates:n||J||null,searchKeywords:c,initialSelectedCity:l||null,selectedLocation:l||t.selectedLocation||null,searchLocationKeywords:(null==l?void 0:l.name)||t.searchLocationKeywords,autoCompleteDisabled:f,inputSearchPlaceholder:E,locale:R})),{navigateTo:en,focusedSpecialty:el,searchKeywords:ei,geoLocationPermission:er,selectedLocation:eo,initialSelectedCity:es,searchResults:ec,isLoadingSearchResults:ed}=ee,{fetchCitiesByLocation:eu,fetchCitiesByKeyword:ep,fetchSearchResults:em,fetchAllSpecialties:eh,fetchPopularKeys:eg}=function({dispatch:e,careApiDomain:t,locale:a="vi-VN",client:n=""}){let l=(0,o.useCallback)(function(n,l={}){let r=`${t}${n}`;return e({type:i.FetchCitiesStart}),fetch((0,w.h)(r,l,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:i.FetchCitiesFinish}))},[a]),s=(0,o.useCallback)(function({coordinates:t}){let r={},o={};t&&(r={lat:t.lat,lng:t.lng}),"ms-MY"===a&&(o.noPaging=1);let s=[l($.P.GET_CITY_BY_IP,Object.assign(Object.assign(Object.assign({},r),o),{hospitalActive:1,client:L.C.MSD===n?"":n}))];return"zh-TW"===a?s.push(l($.P.GET_CITIES_LIST,{noPaging:1,hospitalActive:1,client:L.C.MSD===n?"":n})):s.push(l($.P.GET_CITIES_LIST,{noPaging:1,hospitalActive:1})),Promise.all(s).then(([t,a])=>{let n=Object.assign({},t);if(a){let e=n.cities.map(e=>e.id);n.cities=n.cities.concat(a.cities.filter(t=>!e.includes(t.id)))}e({type:i.FetchCitiesByGeoIpComplete,payload:n})}).catch(e=>console.error("error loading cities by location",e))},[a,t,e]),c=(0,o.useCallback)(function(t){return l($.P.GET_CITIES_LIST,{keyword:t,client:n}).then(t=>{e({type:i.FetchCitiesByKeywordComplete,payload:t.cities})}).catch(e=>console.error("error loading cities by keyword",e))},[a,t,e]),d=(0,o.useCallback)(function(l,r,o,s,c){let d="specialty"===o?`${t}${$.P.GET_SEARCH_SPECIALTY}`:`${t}${$.P.GET_SEARCH_V2}`;e({type:i.FetchSearchResultsStart});let{selectedLocation:u,geoLocationCoordinates:p,selectedSpecialty:m}=r,h="";if(!u){e({type:i.FetchSearchResultsFinish});return}h=u.id===L.I?"":u.id;let g=(null==p?void 0:p.lat)||"",b=(null==p?void 0:p.lng)||"",C=(null==m?void 0:m.id)>0?null==m?void 0:m.id:"",f=l.trim().length>V[a]?l.trim():"";return fetch((0,w.h)(d,Object.assign({domain:t,searchType:o||"global",keyword:f,city:h===L.a?"":h,lat:g,lng:b,specialty_id:C,client_slug:L.C.MSD===s?"":s,msd:L.C.MSD===n?1:""},"doctor"===o&&{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"!==o&&(a="doctor"===o?t.searches.map(e=>Object.assign(Object.assign({},e),{specialties:ignoreCacarSpecialty((null==e?void 0:e.specialties)||[])})):t.searches),"specialty"===o&&(a=f?ignoreCacarSpecialty((null==t?void 0:t.specialties)||[]):ignoreCacarSpecialty((null==t?void 0:t.default)||[])),e({type:i.FetchSearchResultsComplete,payload:{key:o,searches:a||[]}}),c&&e({type:i.UpdateInitialSearchResults,payload:{key:o,searches:a||[]}})}).catch(e=>{console.log("error loading search results",{url:d,error:e})}).finally(()=>e({type:i.FetchSearchResultsFinish}))},[a,t,e]),u=(0,o.useCallback)(function(){let l=`${t}${$.P.GET_SEARCH_SPECIALTY}`;return fetch((0,w.h)(l,{domain:t,searchType:"",msd:L.C.MSD===n?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:i.FetchAllSpecialties,payload:ignoreCacarSpecialty(t.specialties||[])})}).catch(e=>{console.log("error loading search results",{url:l,error:e})})},[a,t,e]),p=(0,o.useCallback)(function(n){let l=`${t}${$.P.GET_SEARCH_POPULAR_KEY}`;return fetch((0,w.h)(l,{domain:t,searchType:r[n],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:i.FetchPopularKeys,payload:t.popular_searches||[]})}).catch(e=>{console.log("error loading search results",{url:l,error:e})})},[a,t,e]);return{fetchCitiesByLocation:s,fetchCitiesByKeyword:c,fetchSearchResults:d,fetchAllSpecialties:u,fetchPopularKeys:p}}({dispatch:et,locale:R,careApiDomain:t,client:D}),eb=(0,o.useMemo)(()=>L.L[R],[R]),[eC,{close:ef,open:eE}]=(0,x.q)(!1),ev=(0,o.useMemo)(()=>Object.assign({doctor:{name:_("booking.searchPopup.doctors"),icon:o.createElement(DoctorIcon,null),slug:eb.DOCTOR},service:{name:_("booking.searchPopup.services"),icon:o.createElement(ServiceIcon,null),slug:eb.SERVICE},hospital:{name:_("booking.searchPopup.hospitals"),icon:o.createElement(HospitalIcon,null),slug:eb.HOSPITAL}},!k&&{specialty:{name:_("booking.searchPopup.specialties"),icon:o.createElement(SpecialtyIcon,null),slug:eb.SPECIALTIES}}),[Q]),ey=(0,o.useMemo)(()=>I()(ep,400),[ep]),ex=(0,o.useMemo)(()=>I()(em,400),[em]),ew=(0,o.useCallback)(function({locationSlug:e,specialtyId:t}={}){var a;ef();let n="",{slug:l}=ev[Q],r="",o=L.M[R][D],s=t||(null===(a=ee.selectedSpecialty)||void 0===a?void 0:a.id)||-1,c=e||(null==eo?void 0:eo.slug)||"";("doctor"===Q||"hospital"===Q)&&s>0&&(r=`&specialtyId=${s}`),n="specialty"===Q?`/${l}`:`/${c}/${l}`,o&&(n+=`/${o}`),(n+=`?q=${ei}${r}`)&&et({type:i.NavigateTo,payload:n})},[D,ef,Q,et,R,ei,null==eo?void 0:eo.slug,null===(F=ee.selectedSpecialty)||void 0===F?void 0:F.id,ev]),eS=(0,o.useCallback)(function(e){T&&ew({locationSlug:e.slug}),et({type:i.SelectLocation,payload:e}),j&&j(e)},[et,e,j,ew,T]);(0,S.a)(G,()=>{e||et({type:i.ClickOutsideInputSearchSpecialty})}),(0,o.useEffect)(()=>{var t;"denied"===er||es||et({type:i.SelectLocation,payload:{name:_("booking.searchBar.allLocations"),id:L.I,slug:null===(t=L.L[R])||void 0===t?void 0:t.ALL}}),M&&M(er,ee.geoLocationCoordinates),e&&"granted"===er&&eo&&et({type:i.FocusInputSearch}),eu({coordinates:ee.geoLocationCoordinates})},[er]),(0,o.useEffect)(()=>{var e;let t=p||{name:_("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:eb.SPECIALTIES};if(p){(null===(e=ee.selectedSpecialty)||void 0===e?void 0:e.id)!==p.id&&et({type:i.SelectSpecialty,payload:p});return}ee.selectedSpecialty&&ee.selectedSpecialty.id===t.id||et({type:i.SelectSpecialty,payload:t})},[p,eb.SPECIALTIES,_]),(0,o.useEffect)(()=>{eh()},[]),(0,o.useEffect)(()=>{eg(Q)},[Q]),(0,o.useEffect)(()=>{en&&(B?B(en):window.location.href=`${m}${en}`)},[en]),(0,o.useEffect)(()=>{em(ee.searchKeywords,ee,Q,D,!0)},[Q]),(0,o.useEffect)(()=>{if(eC&&e){let e=setTimeout(()=>{var e;null===(e=q.current)||void 0===e||e.focus()},150);return()=>clearTimeout(e)}},[eC,e]);let eP={type:Q,isMobile:e,state:ee,dispatch:et,debouncedFetchSearchResults:ex,initalSearchValue:c,onEnterSearch:ew,typeInformation:ev,trackingAttributes:g,isLoading:ed,hideSpecialtySelection:y||k,clientSlug:D,triggerSearchWhenChangeFilter:T,onChangeSpecialty:e=>T&&ew({specialtyId:e.id})};return o.createElement(o.Fragment,null,o.createElement(N,{ref:W},o.createElement(TabSearch,{currentTab:Q,setCurrentTab:Y,isMobile:e,hideTabBookingSearch:v,hideSpecialtyTab:k}),o.createElement(A,{className:"booking-search-container"},o.createElement(Z,null,o.createElement(z,{className:"booking-search-content"},o.createElement("div",{ref:G},o.createElement(C.k,{gap:"12px",align:"center",className:"flex-search-input"},o.createElement(ea,Object.assign({},eP,{ref:U,onFocusInput:()=>e&&eE()})),"specialty"!==Q&&o.createElement(SearchLocation,{state:ee,isMobile:e,dispatch:et,debouncedFetchCitiesByKeyword:ey,selectedLocation:eo,onLocationClick:eS,trackingAttributes:b}),!e&&o.createElement(H.B,{size:"lg",variant:"primary",onClick:()=>ew(),styles:{root:{height:"48px",minWidth:"120px",borderRadius:"12px"}}},_("booking.searchBar.searchButton"))),!O&&"specialty"!==Q&&ee.popularKeys.length>0&&o.createElement(SearchTag,{type:Q,state:ee,typeInformation:ev,dispatch:et}),"specialty"===Q&&"search"===el&&o.createElement(SearchResultSpecialties,{state:ee,isMobile:e,dispatch:et,specialties:(null==ec?void 0:ec.specialty)||[],isLoading:ed})))))),e&&o.createElement(ModalSearchResult,{keepMounted:!0,opened:eC,onClose:ef,closeModal:ef,searchInputEle:o.createElement(C.k,{align:"center",gap:8},o.createElement(ea,Object.assign({},eP,{onlyShowSearchBox:!0,ref:q})),o.createElement(H.B,{variant:"primary",leftIcon:o.createElement(s.Z,{size:20,color:"#fff"}),onClick:()=>ew(),styles:{root:{borderRadius:"12px"}}}))},o.createElement(u.x,{sx:{marginLeft:-16,marginRight:-16}},o.createElement(SearchResultContent,{type:Q,state:ee,dispatch:et,isLoading:ed,typeInformation:ev,clientSlug:D}))))},eb=O.Z.div` background-color: var(--neutral50); padding: 12px 0; box-shadow: inset 0px 1px 0px #e4e8ec; > * { display: grid; grid-template-columns: 32px 1fr; align-content: center; p { font-weight: 600; } } .icon-wrapper { display: flex; align-items: center; } `,TextDivider=({children:e,icon:t,className:a,style:n})=>o.createElement(eb,{style:n,className:a},o.createElement(B.C,null,o.createElement("div",{className:"icon-wrapper"},t),o.createElement(M.T,{size:"c1",color:"var(--neutral800)"},e)))}}]);