"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1538],{"3YDj":function(e,t,n){n.d(t,{Z:function(){return ey}});var r=n("BGKE"),a=n("q1tI"),o=n("Eso5"),i=n("kfjY"),l=n("dDsW"),c=n("a5vB"),d=n("QW8v"),s=n("/npG"),u=(0,s.k)((e,t)=>{let{backgroundColor:n}=t;return{root:{},inner:{position:"relative",minHeight:260,".error-screen":{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",backgroundColor:n},".chart-screen":{position:"relative",zIndex:0}},icon:{flexShrink:0},errorScreenRoot:{[e.fn.smallerThan("sm")]:{justifyContent:"space-evenly"}}}});let h=(0,a.createContext)({});var m=n("nGnw"),g=n("wp0n"),p=n("8wjV"),f=n("OAL+"),x=(0,s.k)(e=>({root:{},info:{[e.fn.largerThan("sm")]:{alignItems:"flex-start"}},colLeft:{[e.fn.smallerThan("sm")]:{order:2,textAlign:"center"},[e.fn.largerThan("sm")]:{display:"flex",alignItems:"center"}},colRight:{display:"flex",justifyContent:"center",alignItems:"center"}})),v=n("Kh6r"),y=n("ysjU"),b=n("TD78"),C=n("m+Kt"),Z=n("NBFx"),w=n("qe1T");let I={[w.P.GOOD]:{color:"green",valueColorIndex:7,statusColorIndex:6,borderStartColorIndex:2,borderEndColorIndex:8,informationIcon:v.Z},[w.P.MODERATE]:{color:"yellow",valueColorIndex:6,statusColorIndex:5,borderStartColorIndex:2,borderEndColorIndex:6,informationIcon:y.Z},[w.P.UNHEALTHY_FOR_SENSITIVE]:{color:"yellow",valueColorIndex:9,statusColorIndex:9,borderStartColorIndex:5,borderEndColorIndex:9,informationIcon:b.Z},[w.P.UNHEALTHY]:{color:"red",valueColorIndex:7,statusColorIndex:6,borderStartColorIndex:3,borderEndColorIndex:6,informationIcon:b.Z},[w.P.VERY_UNHEALTHY]:{color:"violet",valueColorIndex:8,statusColorIndex:7,borderStartColorIndex:4,borderEndColorIndex:8,informationIcon:C.Z},[w.P.HAZARDOUS]:{color:"redViolet",valueColorIndex:9,statusColorIndex:8,borderStartColorIndex:5,borderEndColorIndex:9,informationIcon:Z.Z}},k="currentLocation",N="airPopulation.getLocation",A={md:240,sm:200};var B=(0,s.k)((e,t)=>{let{size:n,backgroundColor:r}=t;return{root:{display:"flex",gap:24,backgroundColor:r,'button[data-variant="secondary"]':{borderColor:e.colors.gray[2]},[e.fn.smallerThan("sm")]:{gap:16,flexDirection:"column"}},colLeft:{[e.fn.largerThan("sm")]:{order:2}},colRight:{[e.fn.largerThan("sm")]:{width:A[n],flexShrink:0,order:1}},locator:{display:"flex",flexDirection:"column",gap:2}}});let Layout=e=>{let{colLeft:t,colRight:n,styles:i,classNames:l,className:c,...d}=e,{size:s,backgroundColor:u}=(0,a.useContext)(h),{classes:m,cx:g}=B({size:s,backgroundColor:u},{name:"AirPopulation__Layout",styles:i,classNames:l});return(0,r.BX)(o.x,{...d,className:g(c,m.root),children:[(0,r.tZ)(o.x,{className:m.colLeft,children:t}),(0,r.tZ)(o.x,{className:m.colRight,children:n})]})},ErrorScreenGeneral=e=>{let{styles:t,classNames:n,...a}=e,{retryFetchInitData:o}=(0,d.W)(e=>({retryFetchInitData:e.retryFetchInitData}),c.X),{formatMessage:i}=(0,l.Z)(),{classes:s}=x(void 0,{name:"AirPopulation__ErrorScreenGeneral",styles:t,classNames:n});return(0,r.tZ)(Layout,{...a,classNames:{root:s.root,colLeft:s.colLeft,colRight:s.colRight},colLeft:(0,r.BX)(f.K,{spacing:16,className:s.info,children:[(0,r.tZ)(g.T,{size:"h3",children:i({id:"airPopulation.notFound.title",defaultMessage:"Opps!"})}),(0,r.tZ)(g.T,{size:"p2",variant:"secondary",children:i({id:"airPopulation.notFound.description",defaultMessage:"We couldn’t load the Air Pollution Tool right now. Please try again later or refresh the page."})}),(0,r.tZ)(p.B,{size:"lg",variant:"secondary",onClick:o,"data-event-category":"AQI","data-event-action":"retry AQI display","data-event-label":"click to retry",children:i({id:"airPopulation.retryButton.label"})})]}),colRight:(0,r.tZ)("img",{loading:"lazy",alt:"Result not found",width:120,height:120,src:m.C.getAssetPath("airPopulation/not-found.svg")})})};var S=(0,s.k)(e=>({root:{},info:{[e.fn.largerThan("sm")]:{alignItems:"flex-start"}},selector:{[e.fn.smallerThan("sm")]:{alignItems:"center"}},desc:{[e.fn.smallerThan("sm")]:{textAlign:"center"}},colLeft:{[e.fn.largerThan("sm")]:{display:"flex",alignItems:"center"}},colRight:{display:"flex",justifyContent:"center",alignItems:"center"}})),F=n("zPX9"),T=n("1Hbx"),R=n("IEKS"),L=n("0D4Z"),z=n("t/pd"),E=n("ChHM"),P=n("hXNO"),_=(0,s.k)(e=>({root:{position:"relative"},locator:{},locatorValue:{position:"relative",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:4,".loading-icon":{padding:8,svg:{width:16,height:16}}},selectTarget:{position:"absolute",left:0,bottom:0,right:0,[e.fn.smallerThan("sm")]:{left:"50%",right:"auto"}}})),X=n("fdQd"),M=n("VZtU"),H=n("fEsb"),D=n("vaps"),V=n("SPK5"),j=n("Dmus"),W=n("mYVa"),O=(0,s.k)(e=>({root:{display:"flex",flexDirection:"column",gap:8,background:"#fff",border:"1px solid ".concat(e.colors.gray[1]),padding:4,borderRadius:12,width:254,boxShadow:"0px 0px 1px 0px #0000000A, 0px 2px 8px 0px #0000000A, 0px 10px 16px 0px #0000000A",[e.fn.smallerThan("sm")]:{transform:"translateX(-50%)"}},input:{input:{paddingLeft:40}},inputWrapper:{position:"relative"},searchIcon:{position:"absolute",top:10,left:16},item:{padding:"".concat((0,W.h)(8)," ").concat((0,W.h)(12)),transition:"background .2s ease",cursor:"pointer",'&[data-is-current-loc="true"]':{position:"relative",marginBottom:16,"&:before":{position:"absolute",top:"calc(100% + 8px)",left:0,right:0,content:'""',borderBottom:"1px solid ".concat(e.colors.neutral[1])}},'&[data-selected="true"]':{cursor:"default"},'&[data-selected="true"],&:hover':{backgroundColor:e.colors.gray[1],borderRadius:8}}}));let Select=e=>{let{selectedItem:t,data:n=[],onClickItem:i,styles:c,classNames:d}=e,{formatMessage:s}=(0,l.Z)(),{classes:u,theme:h}=O(void 0,{name:"AirPopulation__Select",styles:c,classNames:d}),[m,p]=(0,a.useState)(""),f=(0,a.useMemo)(()=>{let e=(0,j.bG)(m),t=n.filter(t=>t.value===k||(0,j.bG)(t.label).includes((0,j.bG)(e)));return t.length>0?t:n},[m]);return(0,r.BX)(o.x,{className:u.root,children:[(0,r.BX)(o.x,{className:u.inputWrapper,children:[(0,r.tZ)(X.I,{className:u.input,value:m,onChange:p,placeholder:s({id:"airPopulation.locationSelector.placeholder",defaultMessage:"Search for city"}),"data-event-category":"AQI","data-event-action":"search AQI location","data-event-label":m}),(0,r.tZ)(M.Z,{size:20,color:h.colors.gray[3],className:u.searchIcon})]}),(0,r.tZ)(D.x.Autosize,{mah:320,type:"auto",scrollbarSize:6,children:f.map((e,n)=>{let a=t===e.label;return(0,r.BX)(V.k,{"data-is-current-loc":e.isUseCurrentLocation,"data-selected":a,className:u.item,align:"center",gap:8,onClick:()=>!a&&i(e.value),"data-event-category":"AQI","data-event-action":"choose AQI location","data-event-label":e.label,children:[e.isUseCurrentLocation?(0,r.tZ)(R.Z,{}):(0,r.tZ)(H.Z,{}),(0,r.tZ)(g.T,{size:"p2",children:e.label})]},String(n))})})]})},LocationSelector=e=>{let{styles:t,classNames:n}=e,{formatMessage:s}=(0,l.Z)(),{data:u,selectedValue:m,setSelectedValue:p,loading:f,firstLoading:x,selectorZIndex:v,onChangeValue:y}=(0,a.useContext)(h),{listProvinces:b}=(0,d.W)(e=>({listProvinces:e.listProvinces||[]}),c.X),C=(0,a.useMemo)(()=>[{label:s({id:N}),value:k,isUseCurrentLocation:!0,icon:R.Z},...(b||[]).map(e=>({label:e,value:e}))],[b]),[Z,w]=(0,a.useState)(!1),[I,A]=(0,a.useState)(),B=(0,E.O)(()=>w(!1)),{classes:S}=_(void 0,{name:"AirPopulation__LocationSelector",styles:t,classNames:n}),X=(0,a.useRef)(null),M=(0,P.d)();return(0,a.useEffect)(()=>{if(X.current){let e=X.current.getBoundingClientRect();A({top:e.bottom+window.scrollY,left:e.left+window.scrollX,width:e.width})}},[x]),(0,a.useEffect)(()=>{if(u&&X.current){let e=X.current.getBoundingClientRect();A({top:e.bottom+window.scrollY,left:e.left+window.scrollX,width:e.width})}},[u]),(0,a.useEffect)(()=>{w(!1)},[M]),(0,r.tZ)(o.x,{className:S.root,children:x?(0,r.tZ)(L.O,{height:24,radius:4,width:140}):(0,r.BX)(o.x,{className:S.locator,children:[(0,r.BX)(o.x,{className:S.locatorValue,onClick:()=>{if(!f){if(X.current){let e=X.current.getBoundingClientRect();A({top:e.bottom+window.scrollY,left:e.left+window.scrollX,width:e.width})}w(!0)}},children:[(0,r.tZ)(g.T,{size:"h3",variant:"secondary",children:m===k?s({id:N}):m}),f?(0,r.tZ)(F.L,{hideText:!0,className:"loading-icon"}):(0,r.tZ)(T.Z,{size:22,color:"#111111",style:{transform:"rotate(".concat(Z?"180deg":0,")")}})]}),(0,r.tZ)(o.x,{"data-target":!0,className:S.selectTarget,ref:X}),(0,r.tZ)(z.h,{children:(0,r.tZ)(i.u,{mounted:!!(Z&&I),transition:"fade",children:e=>(0,r.tZ)(o.x,{ref:B,sx:{position:"absolute",top:null==I?void 0:I.top,left:null==I?void 0:I.left,width:null==I?void 0:I.width,borderRadius:8,zIndex:v,...e},children:(0,r.tZ)(Select,{selectedItem:m||"",data:C,onClickItem:e=>{var t,n;p(null===(n=C.filter(t=>t.value===e))||void 0===n?void 0:null===(t=n[0])||void 0===t?void 0:t.label),w(!1),null==y||y(e)}})})})})]})})},ErrorScreenNotFoundResult=e=>{let{styles:t,classNames:n,message:a,...o}=e,{formatMessage:i}=(0,l.Z)(),{classes:c}=S(void 0,{name:"AirPopulation__ErrorScreenNotFoundResult",styles:t,classNames:n});return(0,r.tZ)(Layout,{...o,classNames:{root:c.root,colLeft:c.colLeft,colRight:c.colRight},colLeft:(0,r.BX)(f.K,{spacing:16,className:c.info,children:[(0,r.BX)(f.K,{spacing:2,className:c.selector,children:[(0,r.tZ)(LocationSelector,{}),(0,r.tZ)(g.T,{size:"p3",variant:"error",children:i({id:"airPopulation.notFoundResult.error",defaultMessage:"Please reselect location"})})]}),(0,r.tZ)(g.T,{size:"p2",variant:"secondary",className:c.desc,children:a||i({id:"airPopulation.notFoundResult.description",defaultMessage:"Looks like there was an issue with your selected location. Try selecting it again!"})})]}),colRight:(0,r.tZ)("img",{loading:"lazy",alt:"Result not found",width:120,height:120,src:m.C.getAssetPath("airPopulation/result-not-found.svg")})})};var U=(0,s.k)(e=>({info:{display:"flex",flexDirection:"column",gap:16,[e.fn.largerThan("sm")]:{position:"absolute",top:"20%",left:0,bottom:0}},locator:{display:"flex",flexDirection:"column",gap:2,[e.fn.smallerThan("sm")]:{alignItems:"stretch",textAlign:"center"}},colLeft:{position:"relative",[e.fn.smallerThan("sm")]:{zIndex:2},[e.fn.largerThan("sm")]:{width:"100%"}},colRight:{paddingBottom:20,[e.fn.largerThan("sm")]:{}},infoColLeft:{[e.fn.smallerThan("sm")]:{display:"none"}},infoColRight:{[e.fn.largerThan("sm")]:{display:"none"}},chart:{display:"flex",flexDirection:"column",gap:24,[e.fn.smallerThan("sm")]:{alignItems:"center",gap:32}}})),Y=n("ZLal"),K=n("AeFk");let q=(0,K.F4)({from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}});var G=(0,s.k)((e,t)=>{var n,r,a,o,i;let{color:l,borderStartColorIndex:c,borderEndColorIndex:d,statusColorIndex:s,valueColorIndex:u,endCircleAngle:h,gapAngleLeft:m,circleAngle:g,firstLoading:p,size:f,borderOutsideColor:x,backgroundChartColor:v}=t,y=null===(n=e.colors[l])||void 0===n?void 0:n[c],b=null===(r=e.colors[l])||void 0===r?void 0:r[d],C=null===(a=e.colors[l])||void 0===a?void 0:a[s],Z=null===(o=e.colors[l])||void 0===o?void 0:o[u],w={display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"50%"},I=A[f];return{root:{position:"relative",borderRadius:"50%",width:I,height:I,backgroundColor:x,...p&&{overflow:"hidden"}},border:{...w,width:I,height:"".concat(I,"px"),position:"relative",background:"conic-gradient(\n from 180deg,\n ".concat(v," 0deg ").concat(m,"deg,\n ").concat(x," ").concat(m,"deg,\n ").concat(x," ").concat(h,"deg,\n ").concat(v," ").concat(h,"deg ").concat(g,"deg\n )"),"&:before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,inset:0,borderRadius:"inherit",background:"conic-gradient(\n from 180deg,\n transparent 0deg ".concat(m,"deg,\n ").concat(y," ").concat(m,"deg,\n ").concat(b," var(--deg),\n transparent var(--deg) ").concat(h,"deg,\n transparent ").concat(h,"deg ").concat(g,"deg\n )"),...p&&{animation:"".concat(q," 2s linear infinite"),opacity:.5}}},borderWhite:{...w,width:I-6,height:I-6,backgroundColor:"#fff",zIndex:1},background:{...w,width:"100%",height:"100%",position:"relative","&:before":{content:'""',position:"absolute",top:6,left:6,width:I-18,height:I-18,background:p?e.colors.neutral[0]:null===(i=e.colors[l])||void 0===i?void 0:i[0],opacity:.5,borderRadius:"inherit"}},mainCircle:{...w,position:"relative",flexDirection:"column",width:I-68,height:I-68,backgroundColor:"#fff",boxShadow:"5px 7px 20px ".concat(Z,"1F,\n 21px 30px 37px ").concat(Z,"1A,\n 48px 67px 50px ").concat(Z,"0F"),transition:"all .3s ease",...p&&{boxShadow:"5px 6px 8px ".concat(e.colors.gray[7],"1F,\n 8px 9px 10px ").concat(e.colors.gray[7],"1A,\n 10px 12px 14px ").concat(e.colors.gray[7],"0F")}},label:{},value:{fontSize:(0,W.h)("sm"===f?56:64),lineHeight:(0,W.h)(64),fontWeight:"sm"===f?Y.F.halfBold:Y.F.semiBold,color:Z,marginTop:-10},status:{lineHeight:"".concat((0,W.h)(20)," !important"),color:"#fff"},tagArea:{position:"absolute",top:"calc(100% - 26px)",left:0,right:0,zIndex:1,display:"flex",justifyContent:"center",textAlign:"center"},tag:{backgroundColor:C,borderRadius:20,padding:"".concat((0,W.h)("sm"===f?3:4)," ").concat((0,W.h)(16)," ").concat((0,W.h)("sm"===f?5:4)),minHeight:"sm"===f?28:32,display:"flex",alignItems:"center",justifyContent:"center",transition:"all .3s ease",opacity:p?0:1}}});n("Vg41");let Q=(0,a.memo)(e=>{let{data:t}=(0,a.useContext)(h),{currentAqiusValue:i=0}=t||{},l=(0,a.useRef)(null),c=(0,a.useRef)(null),[d,s]=(0,a.useState)(null),u=(0,a.useRef)(0);return(0,a.useEffect)(()=>{Promise.all([n.e(2138),n.e(9467),n.e(4467),n.e(6966),n.e(5243),n.e(8132),n.e(1375),n.e(4561),n.e(1448),n.e(5465),n.e(1217),n.e(5480),n.e(731),n.e(2050),n.e(2008),n.e(8469),n.e(8214),n.e(1482),n.e(6817),n.e(467),n.e(5951),n.e(9357),n.e(747),n.e(5675),n.e(6753),n.e(4802),n.e(3046),n.e(5745),n.e(3437),n.e(252),n.e(6839),n.e(9424),n.e(5702),n.e(8922),n.e(6399),n.e(553),n.e(2902),n.e(4969),n.e(3257),n.e(6611),n.e(7538),n.e(6894),n.e(5341)]).then(n.t.bind(n,"qTOg",23)).then(e=>{let{default:t}=e;s(()=>t)})},[]),(0,a.useEffect)(()=>{if(!d||!l.current)return;l.current.innerHTML="";let e=document.createElement("span");e.textContent=String(Math.round(Number(i))||0),l.current.appendChild(e);let t=new d({el:e,value:Math.round(Number(i))||0,theme:"default",format:"(,ddd)"});c.current=t,u.current=Math.round(Number(i))||0,setTimeout(()=>t.update(u.current),100)},[d]),(0,a.useEffect)(()=>{if(!c.current)return;let e=Math.round(Number(i))||0,t=u.current;if(u.current=e,e===t)return;let n=Math.abs(e-t),r=Math.max(200,Math.min(30*n,300)),a=document.querySelectorAll(".odometer-ribbon-inner");a.forEach(e=>{e.setAttribute("style","transition-duration: ".concat(r,"ms !important; transition-timing-function: cubic-bezier(0.4,0,0.2,1) !important;"))}),c.current.update(e)},[i]),(0,r.tZ)(o.x,{...e,ref:l,sx:{overflow:"hidden"}})}),J=(0,a.memo)(e=>{let{styles:t,classNames:n}=e,{data:i,firstLoading:l,size:c,borderOutsideColor:d,backgroundChartColor:s}=(0,a.useContext)(h),{color:u="gray",valueColorIndex:m=7,statusColorIndex:p=6,borderEndColorIndex:f=7,borderStartColorIndex:x=3,category:v,currentAqiusValue:y=0}=i||{},b=(0,a.useMemo)(()=>{let e=Math.min((y||0)/500*270,270),t=l?120:e+45;return{gapAngleLeft:45,selectedDeg:t,endCircleAngle:315,circleAngle:360}},[y,l]),{classes:C,cx:Z}=G({color:l?"neutral":u,borderEndColorIndex:f,borderStartColorIndex:x,statusColorIndex:p,valueColorIndex:m,firstLoading:l,size:c,borderOutsideColor:d,backgroundChartColor:s,...b},{name:"AirPopulation__Chart",styles:t,classNames:n}),[w,I]=(0,a.useState)(b.selectedDeg),k=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=b.selectedDeg,t=e-w,n=performance.now(),animate=e=>{let r=Math.min((e-n)/200,1);I(w+t*(1-Math.pow(1-r,3))),r<1&&(k.current=requestAnimationFrame(animate))};return cancelAnimationFrame(k.current),k.current=requestAnimationFrame(animate),()=>cancelAnimationFrame(k.current)},[b.selectedDeg]),(0,r.BX)(o.x,{className:Z(C.root,"chart-root"),style:{"--deg":"".concat(w,"deg")},children:[(0,r.tZ)(o.x,{className:Z(C.border,"chart-border"),children:(0,r.tZ)(o.x,{className:Z(C.borderWhite,"chart-border-white"),children:(0,r.tZ)(o.x,{className:Z(C.background,"chart-background"),children:(0,r.tZ)(o.x,{className:C.mainCircle,children:!l&&(0,r.BX)(r.HY,{children:[(0,r.tZ)(g.T,{size:"title2",variant:"tertiary",className:Z(C.label,"chart-label"),children:"AQI"}),(0,r.tZ)(Q,{className:C.value},"main-value")]})})})})}),(0,r.tZ)("div",{className:C.tagArea,children:(0,r.tZ)("div",{className:C.tag,children:(0,r.tZ)(g.T,{size:"sm"===c?"p3":"title2",className:C.status,weight:"semiBold",color:"#fff",children:v})})})]})});var $=n("8vDj");let Information=e=>{var t;let n=(0,$.rZ)(),{firstLoading:i,data:l}=(0,a.useContext)(h),{color:c="gray",description:d,informationIcon:s,valueColorIndex:u=7}=l||{},m="function"==typeof s?s:null;return i?(0,r.BX)(f.K,{spacing:8,...e,children:[(0,r.tZ)(L.O,{height:16,radius:4,width:200}),(0,r.tZ)(L.O,{height:16,radius:4,width:200}),(0,r.tZ)(L.O,{height:16,radius:4,width:130})]}):d?(0,r.BX)(o.x,{sx:{position:"relative",".info-label":{"&:before":{content:'""',display:"inline-block",width:20}},".info-icon":{position:"absolute",top:2,left:0}},...e,children:[m&&(0,r.tZ)(m,{size:16,color:null===(t=n.colors[c])||void 0===t?void 0:t[u],className:"info-icon"}),(0,r.tZ)(g.T,{size:"p3",className:"info-label",children:d})]}):null};var ee=n("Wgwc"),et=n.n(ee);let TimeStatus=()=>{let{firstLoading:e,data:t}=(0,a.useContext)(h),{updatedTime:n}=t||{},{formatMessage:o}=(0,l.Z)();return e?(0,r.tZ)(L.O,{sx:{marginTop:6},height:12,radius:4,width:120}):(0,r.tZ)(g.T,{size:"p3",variant:"tertiary",children:o({id:"airPopulation.timeUpdate",defaultMessage:"{time} Update every {from} - {to}h"},{time:et()(n).format("HH:mm"),from:1,to:2})})},Form=e=>{let{styles:t,classNames:n,className:a,...i}=e,{classes:l}=U(void 0,{name:"AirPopulation__Form",styles:t,classNames:n});return(0,r.tZ)(Layout,{...i,classNames:{colLeft:l.colLeft,colRight:l.colRight},colLeft:(0,r.BX)(o.x,{className:l.info,children:[(0,r.BX)(o.x,{className:l.locator,children:[(0,r.tZ)(LocationSelector,{}),(0,r.tZ)(TimeStatus,{})]}),(0,r.tZ)(o.x,{className:l.infoColLeft,children:(0,r.tZ)(Information,{})})]}),colRight:(0,r.BX)(o.x,{className:l.chart,children:[(0,r.tZ)(J,{}),(0,r.tZ)(o.x,{className:l.infoColRight,children:(0,r.tZ)(Information,{})})]})})},en={in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(30%)"},transitionProperty:"transform, opacity"},Body=e=>{let{className:t,styles:n,classNames:s,...m}=e,{notShareLocationErr:g,notLoadResultError:p,backgroundColor:f,size:x}=(0,a.useContext)(h),{formatMessage:v}=(0,l.Z)(),{classes:y,cx:b}=u({size:x,backgroundColor:f},{name:"AirPopulation__Body",styles:n,classNames:s}),{errorInitLoad:C}=(0,d.W)(e=>({errorInitLoad:e.error}),c.X),Z="string"==typeof C,w="string"==typeof p;return(0,r.tZ)(o.x,{...m,className:b(y.root,t,"air-population-body"),children:(0,r.BX)(o.x,{className:y.inner,children:[(0,r.tZ)(i.u,{keepMounted:!0,mounted:!Z&&!w,transition:en,children:e=>(0,r.tZ)(o.x,{className:"chart-screen",style:e,children:(0,r.tZ)(Form,{})})}),(0,r.tZ)(i.u,{mounted:Z,keepMounted:!0,transition:en,children:e=>(0,r.tZ)(o.x,{style:e,className:"error-screen",children:(0,r.tZ)(ErrorScreenGeneral,{classNames:{root:y.errorScreenRoot}})})}),(0,r.tZ)(i.u,{mounted:w||g,transition:en,children:e=>(0,r.tZ)(o.x,{style:e,className:"error-screen",children:(0,r.tZ)(ErrorScreenNotFoundResult,{classNames:{root:y.errorScreenRoot},message:g?v({id:"airPopulation.notShareLocation.error",defaultMessage:"Cannot find your location. Please try again."}):""})})})]})})};var er=n("09QT"),ea=n("Cov9"),eo=n("oQBk"),ei=n("Fyo5"),el=n("Tk9B"),ec=(0,s.k)(e=>({root:{backgroundColor:e.colors.neutral[0],padding:12},icon:{flexShrink:0}})),ed=n("QJsO"),es=n("15qF"),eu=(0,s.k)(()=>({root:{position:"relative",cursor:"pointer",height:40,width:40},item:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",position:"absolute",top:0,left:0,right:0,bottom:0}})),eh=n("fNFL"),em=(0,s.k)(e=>({root:{},body:{padding:16,[e.fn.largerThan("sm")]:{padding:"".concat((0,W.h)(24)," ").concat((0,W.h)(24)," ").concat((0,W.h)(24)," ").concat((0,W.h)(48))}},modalBody:{padding:0},disclaimer:{justifyContent:"center"}}));let ModalDetail=e=>{let{className:t,...n}=e,{classes:a}=em(void 0,{name:"AirPopulation__ModalDetail"});return(0,r.tZ)(ey,{selectorZIndex:500,children:e=>{var t;return(0,r.BX)(eh.M,{...n,title:null==e?void 0:null===(t=e.cardInfo)||void 0===t?void 0:t.title,size:600,classNames:{body:a.modalBody},zIndex:500,children:[(0,r.tZ)(Body,{className:a.body}),(0,r.tZ)(ey.Disclaimer,{className:a.disclaimer})]})}})};var eg=n("P60J");let ep=(0,K.F4)({from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}});var ef=(0,s.k)((e,t)=>{var n,r,a,o;let{color:i,borderStartColorIndex:l,borderEndColorIndex:c,valueColorIndex:d,endCircleAngle:s,gapAngleLeft:u,circleAngle:h,firstLoading:m,selectedDeg:g,size:p}=t,f=null===(n=e.colors[i])||void 0===n?void 0:n[l],x=null===(r=e.colors[i])||void 0===r?void 0:r[c],v=null===(a=e.colors[i])||void 0===a?void 0:a[d],y={display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"50%"},b="md"===p?40:32,C="md"===p?40:32;return{root:{position:"relative",borderRadius:"50%",width:b,height:C,".warning-icon":{position:"absolute",top:0,left:"95%",zIndex:1}},border:{...y,width:b,height:b,position:"relative",background:null===(o=e.colors[i])||void 0===o?void 0:o[0],"&:before":{transform:"rotate(135deg)",content:'""',position:"absolute",inset:0,borderRadius:"inherit",background:"conic-gradient(\n from 180deg,\n transparent 0deg ".concat(u,"deg,\n ").concat(f," ").concat(u,"deg,\n ").concat(x," ").concat(g,"deg,\n transparent ").concat(g,"deg ").concat(s,"deg,\n transparent ").concat(s,"deg ").concat(h,"deg\n )"),...m&&{animation:"".concat(ep," 2s linear infinite"),opacity:.5}}},borderWhite:{...y,flexDirection:"column",justifyContent:"center",width:b-4,height:b-4,backgroundColor:e.colors.neutral[0],zIndex:1},label:{fontSize:(0,W.h)("md"===p?8:6),lineHeight:(0,W.h)("md"===p?12:10)},value:{fontSize:(0,W.h)("md"===p?15:13),lineHeight:(0,W.h)("md"===p?15:13),fontWeight:"md"===p?Y.F.semiBold:Y.F.halfBold,color:v}}});let ex=(0,a.memo)(e=>{let{size:t,styles:n,classNames:i}=e,{data:l,firstLoading:c,size:d}=(0,a.useContext)(h),{color:s="gray",valueColorIndex:u=7,borderEndColorIndex:m=7,borderStartColorIndex:p=3,currentAqiusValue:f=0,keyCategory:x}=l||{},v=(0,a.useMemo)(()=>{let e=Math.min((f||0)/500*270,270),t=c?120:e+45;return{gapAngleLeft:45,selectedDeg:t,endCircleAngle:315,circleAngle:360}},[f,c]),{classes:y,cx:b}=ef({color:c?"neutral":s,borderEndColorIndex:m,borderStartColorIndex:p,valueColorIndex:u,firstLoading:c,size:t||d,...v,selectedDeg:v.selectedDeg},{name:"AirPopulation__SimpleChart",styles:n,classNames:i});return(0,r.BX)(o.x,{className:y.root,children:[(0,r.tZ)(o.x,{className:y.border,children:(0,r.tZ)(o.x,{className:y.borderWhite,children:!c&&(0,r.BX)(r.HY,{children:[(0,r.tZ)(g.T,{size:"title2",variant:"secondary",className:b(y.label,"chart-label"),children:"AQI"}),(0,r.tZ)(o.x,{className:y.value,children:f})]})})}),x===w.P.HAZARDOUS&&(0,r.tZ)(eg.Z,{className:"warning-icon",color:"red",size:12})]})}),ev={in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(50%)"},transitionProperty:"transform, opacity"};var ey=Object.assign(e=>{let{children:t,size:n="md",borderOutsideColor:o,backgroundChartColor:i,backgroundColor:s="#fff",selectorZIndex:u}=e,{formatMessage:g}=(0,l.Z)(),{cardInfo:p,currentLocation:f,setCurrentLocation:x,listProvinces:v,currentData:y,fetchInitData:b}=(0,d.W)(e=>({cardInfo:e.cardInfo,listProvinces:e.listProvinces,currentData:e.currentData,currentLocation:e.currentLocation,fetchInitData:e.fetchInitData,setCurrentLocation:e.setCurrentLocation}),c.X),[C,Z]=(0,a.useState)(null),[w,A]=(0,a.useState)(null),[B,S]=(0,a.useState)(!0),[F,T]=(0,a.useState)(!1),[R,L]=(0,a.useState)(null),[z,E]=(0,a.useState)(!1),P=(0,$.rZ)(),_=(0,a.useCallback)(async()=>{try{if(T(!0),null==f?void 0:f.location)handleFetchResult({type:"geo",lat:String(f.location.latitude),lng:String(f.location.longitude)});else{let e=await (0,el.k)();(null==e?void 0:e.location)?(handleFetchResult({type:"geo",lat:String(e.location.latitude),lng:String(e.location.longitude)}),x(e)):(x(e),E(!0))}}catch(e){}finally{T(!1)}},[]),handleFetchResult=async e=>{try{T(!0);let t=await (0,er.d)(eo.y.HEALTH_TOOL.GET_AIR_POPULATION_SPECIFIC_PROVINCE,{params:e}),n=(0,ea.h)(null==t?void 0:t.data),r=(0,ei.rx)(n,"geo"===e.type);if(r&&(null==n?void 0:n.keyCategory)&&(0,ei.B9)(n.keyCategory)){let e=I[null==n?void 0:n.keyCategory];A({...e,...n}),L(null)}else L("")}catch(e){L("")}finally{T(!1),E(!1)}};return(0,a.useEffect)(()=>{b()},[b]),(0,a.useEffect)(()=>{(null==v?void 0:v.length)&&"number"==typeof(null==y?void 0:y.currentAqiusValue)&&S(!1)},[v,y]),(0,a.useEffect)(()=>{if(!y)return;let e=I[null==y?void 0:y.keyCategory];A({...e,...y}),Z(f?g({id:N}):null==y?void 0:y.province)},[y]),(0,r.tZ)(Y.T,{variant:Y.C.LEADGEN,children:(0,r.tZ)(h.Provider,{value:{notShareLocationErr:z,notLoadResultError:R,data:w,setData:A,loading:F,firstLoading:B,heading:"Air polulation",disclaimer:"Information is for reference only and not a substitute for medical advice.",avatar:m.C.getAssetPath("tiki/maskcot.png"),size:n,borderOutsideColor:o||P.colors.neutral[0],backgroundChartColor:i||"#fff",backgroundColor:s,selectorZIndex:u,selectedValue:C,setSelectedValue:Z,onChangeValue:e=>{e===k?_():handleFetchResult({type:"state",name:e})},handleClickCurrentLocation:_},children:"function"==typeof t?t({cardInfo:p,result:w}):t||(0,r.tZ)(Body,{})})})},{Disclaimer:e=>{let{className:t,...n}=e,{classes:a,theme:o,cx:i}=ec(void 0,{name:"AirPopulation__Disclaimer"}),{disclaimer:l}=(0,d.W)(e=>{var t;return{disclaimer:null===(t=e.cardInfo)||void 0===t?void 0:t.disclaimer}},c.X);return l?(0,r.BX)(V.k,{gap:4,...n,className:i(t,a.root),children:[(0,r.tZ)(b.Z,{size:16,color:o.colors.yellow[8],className:a.icon}),(0,r.tZ)(g.T,{size:"c1",children:l})]}):null},Heading:()=>{let{heading:e}=(0,a.useContext)(h);return e?(0,r.tZ)(g.T,{size:"h3",children:e}):null},Body:Body,Chart:J,IconChart:e=>{let{dataTracking:t,className:n,...l}=e,{firstLoading:c,size:d}=(0,a.useContext)(h),[s,u]=(0,a.useState)(!1),[m,g]=(0,a.useState)(!1),[p,f]=(0,a.useState)(!1),{classes:x,cx:v}=eu(void 0,{name:"AirPopulation__IconChart"});return(0,a.useEffect)(()=>{c||(g(e=>!e),u(!0))},[c]),(0,a.useEffect)(()=>{if(!s)return;let e=setInterval(()=>{g(e=>!e)},4e3);return()=>clearInterval(e)},[s]),(0,r.BX)(r.HY,{children:[(0,r.BX)(o.x,{...l,className:v(x.root,n),onClick:()=>f(!0),"data-event-category":null==t?void 0:t.dataEventCategory,"data-event-action":null==t?void 0:t.dataEventAction,"data-event-label":null==t?void 0:t.dataEventLabel,children:[(0,r.tZ)(o.x,{className:x.item,children:(0,r.tZ)(i.u,{mounted:!m,transition:ev,duration:400,timingFunction:"ease",children:e=>(0,r.tZ)(o.x,{style:e,children:(0,r.tZ)(ed.z,{inline:!0,processing:!0,color:"green",size:8,sx:{marginTop:3},children:(0,r.tZ)(es.Z,{size:"md"===d?32:24})})})})}),(0,r.tZ)(o.x,{className:x.item,children:(0,r.tZ)(i.u,{mounted:m,transition:ev,duration:400,timingFunction:"ease",children:e=>(0,r.tZ)(o.x,{style:e,children:(0,r.tZ)(ex,{size:d})})})})]}),(0,r.tZ)(ModalDetail,{opened:p,onClose:()=>f(!1)})]})}})},"HPD/":function(e,t,n){n.d(t,{q:function(){return AirPopulationEmbedCard}});var r=n("BGKE"),a=n("TjND"),o=n("3YDj");let AirPopulationEmbedCard=e=>{let{formProps:t,cardProps:n}=e;return(0,r.tZ)(o.Z,{...t,children:e=>{let{cardInfo:t}=e;return(0,r.BX)(a.H,{...n,children:[(0,r.tZ)(a.H.Banner,{isRevamp:!0,icon:(0,r.tZ)("img",{alt:"health-tool-icon",src:null==t?void 0:t.featuredImage,loading:"lazy"}),medicalReview:void 0,heading:(null==t?void 0:t.title)||"",disclaimer:(null==t?void 0:t.disclaimer)||""}),(0,r.tZ)(a.H.Body,{sx:e=>({padding:"24px 16px",[e.fn.largerThan("sm")]:{padding:"40px 48px"}}),children:(0,r.tZ)(o.Z.Body,{})})]})}})}},"YL+3":function(e,t,n){n.d(t,{A:function(){return CustomSelect}});var r=n("BGKE"),a=n("q1tI"),o=n("wp0n"),i=n("1Hbx"),l=n("Eso5"),c=n("SPK5"),d=n("kfjY"),s=n("vaps"),u=n("ChHM"),h=n("hXNO"),m=n("/npG"),g=n("mYVa"),p=(0,m.k)(e=>({root:{position:"relative"},selectedLabel:{padding:"".concat((0,g.h)(4)," 0"),cursor:"pointer",userSelect:"none",maxWidth:200},item:{userSelect:"none",whiteSpace:"nowrap",padding:"".concat((0,g.h)(8)," ").concat((0,g.h)(12)),transition:"background .2s ease",cursor:"pointer",'&[data-is-current-loc="true"]':{position:"relative",marginBottom:16,"&:before":{position:"absolute",top:"calc(100% + 8px)",left:0,right:0,content:'""',borderBottom:"1px solid ".concat(e.colors.neutral[1])}},'&[data-selected="true"]':{cursor:"default",backgroundColor:e.colors.blue[0]},"&:hover":{backgroundColor:e.colors.gray[1]}},dropdownList:{minWidth:120,maxWidth:200,background:"#fff",position:"absolute",top:"100%",right:0,borderRadius:8,boxShadow:"0px 0px 1px 0px #0000000A, 0px 2px 8px 0px #0000000A, 0px 10px 16px 0px #0000000A"}}));let CustomSelect=e=>{var t;let{value:n,data:m=[],onSelectItem:g,styles:f,classNames:x,className:v,...y}=e,{classes:b,cx:C}=p(void 0,{name:"CustomSelect__Select",styles:f,classNames:x}),Z=(0,h.d)(),[w,I]=(0,a.useState)(!1),k=(0,u.O)(()=>I(!1)),[N,A]=(0,a.useState)("string"==typeof n&&(null===(t=m.filter(e=>e.value===n))||void 0===t?void 0:t[0])||null);return(0,r.BX)(l.x,{...y,className:C(b.root,v),ref:k,children:[(0,r.BX)(c.k,{justify:"space-between",align:"center",gap:8,onClick:()=>I(e=>!e),className:b.selectedLabel,children:[(0,r.tZ)(o.T,{size:Z?"p3":"p4",lineClamp:1,children:null==N?void 0:N.label}),(0,r.tZ)(i.Z,{size:20})]}),(0,r.tZ)(d.u,{mounted:w,transition:"fade",children:e=>(0,r.tZ)(l.x,{style:e,children:(0,r.tZ)(s.x.Autosize,{mah:320,type:"auto",scrollbarSize:6,className:b.dropdownList,children:m.map((e,t)=>{let n=(null==N?void 0:N.value)===e.value;return(0,r.tZ)(c.k,{"data-selected":n,className:b.item,align:"center",gap:8,onClick:()=>{n||(I(!1),g(e),A(e))},children:(0,r.tZ)(o.T,{size:Z?"p3":"p4",weight:n?"halfBold":"regular",lineClamp:1,children:e.label})},String(t))})})})})]})}},lMcb:function(e,t,n){n.d(t,{Z:function(){return N}});var r=n("BGKE"),a=n("Eso5"),o=n("C/sX"),i=n("q1tI");let l=(0,i.createContext)({});var c=n("iuhU");let FeatureCardContent=e=>{let{children:t,className:n,...o}=e;return(0,r.tZ)(a.x,{...o,className:(0,c.default)(n,"card-content"),children:t})};FeatureCardContent.displayName="FeatureCardContent";var d=n("wp0n"),s=n("hXNO");let FeatureCardHeading=e=>{let{children:t,...n}=e,a=(0,s.d)();return(0,r.tZ)(d.T,{size:a?"h4":"h2",as:"h2",variant:"primary",weight:"halfBold",...n,children:t})};FeatureCardHeading.displayName="FeatureCardHeading";var u=n("SPK5");let FeatureCardIcon=e=>{let{src:t}=e;return t?(0,r.tZ)(u.k,{align:"center",justify:"center",sx:e=>({img:{width:16,height:16},[e.fn.largerThan("sm")]:{boxShadow:"0px 0px 1px 0px #0000000A,\n0px 2px 8px 0px #0000000A,\n0px 10px 16px 0px #0000000A\n",width:80,height:80,borderRadius:"50%",img:{width:40,height:40}}}),children:(0,r.tZ)("img",{loading:"lazy",src:t,alt:""})}):null};FeatureCardIcon.displayName="FeatureCardIcon";var h=n("/npG"),m=(0,h.k)(e=>({root:{[e.fn.largerThan("sm")]:{paddingLeft:48,paddingRight:48}}}));let FeatureCardInner=e=>{let{children:t,styles:n,classNames:o,className:i,...l}=e,{classes:c,cx:d}=m(void 0,{name:"FeatureCard__Inner",styles:n,classNames:o});return(0,r.tZ)(a.x,{className:d("inner-section",i,c.root),...l,children:t})};FeatureCardInner.displayName="FeatureCardInner";let FeatureCardLeftContent=e=>{let{children:t}=e;return(0,r.tZ)(a.x,{children:t})};FeatureCardLeftContent.displayName="FeatureCardLeftContent";let FeatureCardRightContent=e=>{let{children:t}=e;return(0,r.tZ)(a.x,{children:t})};FeatureCardRightContent.displayName="FeatureCardRightContent";var g=(0,h.k)(e=>({root:{},icon:{display:"inline-block",verticalAlign:"middle",img:{display:"block"}},label:{display:"inline-block",verticalAlign:"middle",marginLeft:8,color:e.colors.gray[6],textTransform:"uppercase"}}));let FeatureCardSectionName=e=>{let{icon:t="",children:n,styles:o,classNames:c,className:s,...u}=e,{url:h}=(0,i.useContext)(l),{classes:m,cx:p}=g(void 0,{name:"FeatureCard__SectionName",styles:o,classNames:c});return(0,r.BX)(a.x,{...u,className:p(m.root,s),component:h?"a":"div",href:h,children:[t&&(0,r.tZ)(a.x,{className:m.icon,children:"string"==typeof t?(0,r.tZ)("img",{loading:"lazy",width:20,height:20,src:t,alt:""}):t}),(0,r.tZ)(d.T,{size:"title2",weight:"semiBold",as:"span",className:m.label,children:n})]})};FeatureCardSectionName.displayName="FeatureCardSectionName";var p=n("8wjV"),f=n("le9Y"),x=(0,h.k)(e=>({root:{borderRadius:44,[e.fn.smallerThan("sm")]:{width:"100%"}}}));let FeatureCardViewAll=e=>{let{children:t,href:n,styles:a,classNames:o,className:c,...s}=e,{classes:u,cx:h}=x(void 0,{name:"FeatureCard__VerticalCenterLayout",styles:a,classNames:o}),{color:m,url:g}=(0,i.useContext)(l),v=n||g;return v?(0,r.tZ)(p.B,{className:h(u.root,c),component:"a",variant:"secondary",size:"lg",rightIcon:(0,r.tZ)(f.Z,{color:"currentColor",size:20}),color:"gray"===m?"yellow":m||"green",withColorHover:!0,href:v,...s,children:(0,r.tZ)(d.T,{size:"p1",color:"inherit",weight:"semiBold",children:t})}):null};FeatureCardViewAll.displayName="FeatureCardViewAll";var v=(0,h.k)((e,t)=>{var n,r;let{color:a}=t;return{root:{...a&&{backgroundColor:null===(r=e.colors)||void 0===r?void 0:null===(n=r[a])||void 0===n?void 0:n[0]},[e.fn.largerThan("sm")]:{borderRadius:24}},inner:{},header:{}}}),y=n("mYVa"),b=n("OAL+"),C=n("frWj");let HorizontalLayout=()=>{let{sectionName:e,heading:t,content:n,viewAll:o}=(0,i.useContext)(l);return(0,r.BX)(u.k,{sx:e=>({[e.fn.smallerThan("sm")]:{gap:24,flexDirection:"column",alignItems:"stretch",padding:"".concat((0,y.h)(40)," ").concat((0,y.h)(16))},[e.fn.largerThan("sm")]:{alignItems:"center",gap:64,padding:48}}),children:[(0,r.tZ)(a.x,{sx:e=>({[e.fn.largerThan("sm")]:{width:345,flexShrink:0}}),children:(0,r.BX)(b.K,{spacing:24,children:[(0,r.BX)(b.K,{sx:e=>({gap:12,[e.fn.largerThan("sm")]:{gap:16}}),children:[e,t]}),(0,r.tZ)(C.z,{smallerThan:"sm",styles:{display:"none "},children:(0,r.tZ)(a.x,{children:o})})]})}),(0,r.tZ)(a.x,{sx:e=>({[e.fn.largerThan("sm")]:{width:"calc(100% - 345px - 64px)"}}),children:n}),(0,r.tZ)(C.z,{largerThan:"sm",styles:{display:"none "},children:(0,r.tZ)(a.x,{children:o})})]})};var Z=(0,h.k)(e=>({root:{gap:24,padding:"".concat((0,y.h)(40)," ").concat((0,y.h)(16)),[e.fn.largerThan("sm")]:{padding:48}},body:{},header:{gap:12,[e.fn.largerThan("sm")]:{gap:24}}}));let VerticalLayout=e=>{let{styles:t,className:n,classNames:o}=e,{sectionName:c,heading:d,content:s}=(0,i.useContext)(l),{classes:u,cx:h}=Z(void 0,{name:"FeatureCard__VerticalLayout",styles:t,classNames:o});return(0,r.BX)(b.K,{className:h(n,u.root),children:[(0,r.BX)(b.K,{className:u.header,children:[c,d]}),(0,r.tZ)(a.x,{className:u.body,children:s})]})};var w=(0,h.k)(e=>({inner:{},header:{gap:12,[e.fn.smallerThan("sm")]:{padding:"".concat((0,y.h)(24)," ").concat((0,y.h)(24)," 0")},[e.fn.largerThan("sm")]:{alignItems:"center",gap:16,padding:40}}}));let VerticalCenterLayout=e=>{let{styles:t,classNames:n,...o}=e,{sectionName:c,icon:d,heading:s,content:u,viewAll:h}=(0,i.useContext)(l),{classes:m}=w(void 0,{name:"FeatureCard__VerticalCenterLayout",styles:t,classNames:n});return(0,r.BX)(b.K,{className:m.inner,...o,children:[(0,r.BX)(b.K,{className:m.header,children:[c,d,s,h&&(0,r.tZ)(C.z,{smallerThan:"sm",styles:{display:"none"},children:(0,r.tZ)(a.x,{children:h})})]}),u,h&&(0,r.tZ)(C.z,{largerThan:"sm",styles:{display:"none"},children:(0,r.tZ)(a.x,{className:"viewall-bottom",sx:{padding:"0 ".concat((0,y.h)(16)," ").concat((0,y.h)(16)," ").concat((0,y.h)(16))},children:h})})]})};var I=(0,h.k)(e=>({inner:{gap:24,[e.fn.largerThan("sm")]:{gap:32}},header:{gap:8,alignItems:"center",textAlign:"center",[e.fn.largerThan("sm")]:{alignItems:"flex-start"}}}));let VerticalCenterLayoutV2=e=>{let{styles:t,classNames:n,...o}=e,{sectionName:c,icon:d,heading:s,content:u,viewAll:h}=(0,i.useContext)(l),{classes:m}=I(void 0,{name:"FeatureCard__VerticalCenterLayoutV2",styles:t,classNames:n});return(0,r.BX)(b.K,{className:m.inner,...o,children:[(0,r.BX)(b.K,{className:m.header,children:[c,d,s,h&&(0,r.tZ)(C.z,{largerThan:"sm",styles:{display:"none"},children:(0,r.tZ)(a.x,{children:h})})]}),u]})};var k=n("ENdw");let FeatureCard=e=>{let{layout:t="vertical",color:n,children:i,styles:c,className:d,classNames:s,url:u,...h}=e,{classes:m,cx:g}=v({color:n},{name:"FeatureCard",styles:c,classNames:s}),p={sectionName:null,icon:null,heading:null,viewAll:null,content:null,left:null,right:null,inner:null},f=Array.isArray(i)?i:[i];return f.forEach(e=>{if(!(null==e?void 0:e.type))return;let t=e.type.displayName;switch(t){case"FeatureCardSectionName":p.sectionName=e;break;case"FeatureCardHeading":p.heading=e;break;case"FeatureCardIcon":p.icon=e;break;case"FeatureCardViewAll":p.viewAll=e;break;case"FeatureCardContent":p.content=e;break;case"FeatureCardLeftContent":p.left=e;break;case"FeatureCardRightContent":p.right=e;break;case"FeatureCardInner":p.inner=e}}),(0,r.tZ)(l.Provider,{value:{color:n,url:u,...p},children:(0,r.tZ)(a.x,{className:g(m.root,d),...h,children:"two-columns"===t?(0,r.tZ)(o.r,{children:i}):t===k.N.Horizontal?(0,r.tZ)(HorizontalLayout,{}):t===k.N.Vertical?(0,r.tZ)(VerticalLayout,{}):t===k.N.VerticalCenter?(0,r.tZ)(VerticalCenterLayout,{classNames:{inner:m.inner,header:m.header}}):t===k.N.VerticalCenterV2?(0,r.tZ)(VerticalCenterLayoutV2,{}):i})})};FeatureCard.SectionName=FeatureCardSectionName,FeatureCard.Heading=FeatureCardHeading,FeatureCard.Icon=FeatureCardIcon,FeatureCard.ViewAll=FeatureCardViewAll,FeatureCard.Content=FeatureCardContent,FeatureCard.LeftContent=FeatureCardLeftContent,FeatureCard.RightContent=FeatureCardRightContent,FeatureCard.Inner=FeatureCardInner;var N=FeatureCard},ENdw:function(e,t,n){var r,a;n.d(t,{N:function(){return r}}),(a=r||(r={})).Vertical="vertical",a.VerticalCenter="verticalCenter",a.Horizontal="horizontal",a.TwoColumns="two-columns",a.VerticalCenterV2="vertical-center-v2"},CBW8:function(e,t,n){n.d(t,{o:function(){return AdBlockContainer}});var r=n("BGKE"),a=n("P5LW"),o=n("N2Lg");let AdBlockContainer=e=>{let{children:t}=e,{locale:n}=(0,a.h)(),i=null===o.Zr||void 0===o.Zr?void 0:o.Zr.includes(n);return i?null:(0,r.tZ)(r.HY,{children:t})}},LplW:function(e,t,n){n.d(t,{E:function(){return FixedBottomAdBlock}});var r=n("BGKE"),a=n("q1tI"),o=n("Vvt1"),i=n.n(o);let l=i()(()=>Promise.all([n.e(4846),n.e(2233),n.e(1058),n.e(3295),n.e(1538),n.e(7152),n.e(5684),n.e(2574),n.e(9884),n.e(7644),n.e(6962),n.e(8767),n.e(6638),n.e(7741),n.e(3434),n.e(2433),n.e(5385),n.e(3564),n.e(7082),n.e(3158),n.e(5641),n.e(7454),n.e(7004),n.e(4758),n.e(6219),n.e(17),n.e(8990),n.e(4067),n.e(9487),n.e(9083),n.e(1520),n.e(270),n.e(7596),n.e(8217),n.e(7543),n.e(2835),n.e(2507),n.e(6885),n.e(7859),n.e(690),n.e(2730),n.e(6287),n.e(7682),n.e(1551),n.e(4870),n.e(9922),n.e(3133),n.e(612),n.e(2002),n.e(1880),n.e(7471),n.e(7165),n.e(5451),n.e(8612)]).then(n.bind(n,"lXMY")).then(e=>e.FixedBottomAdBlock),{loadableGenerated:{webpack:()=>["lXMY"]},ssr:!1}),FixedBottomAdBlock=e=>{let[t,n]=(0,a.useState)(!1);return((0,a.useEffect)(()=>{setTimeout(()=>{n(!0)},500)},[]),t)?(0,r.tZ)(l,{...e}):null}},lXMY:function(e,t,n){n.r(t),n.d(t,{FixedBottomAdBlock:function(){return FixedBottomAdBlock}});var r=n("BGKE"),a=n("q1tI"),o=n("eosF"),i=n("Q6jF"),l=n("P5LW"),c=n("1LUM"),d=n("xJ6s");let FixedBottomAdBlock=e=>{let{className:t="",adUnitPath:n,divId:s,isMobile:u,contentId:h,ignoreRefreshAd:m=!1,customTargetings:g,...p}=e,{locale:f}=(0,l.h)(),[x,v]=(0,a.useState)(!0),[y,b]=(0,a.useState)(!1),[C,Z]=(0,a.useState)(!0),w=(0,a.useRef)(null),I=(0,a.useRef)((0,i.Z)()),k=(0,a.useRef)(null),N=(0,a.useRef)(),A=(0,a.useRef)();return((0,a.useEffect)(()=>{let checkAdShowing=()=>{A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{if(document.getElementById("subot--container"))v(!0);else{var e;v(!1),(null===(e=w.current)||void 0===e?void 0:e.clientHeight)?Z(!1):Z(!0)}checkAdShowing()},4e3)};return checkAdShowing(),()=>{N.current&&clearTimeout(N.current),A.current&&clearTimeout(A.current)}},[]),x||y)?null:(0,r.tZ)(d.nE,{ref:k,className:"".concat(t," sticky-bottom-ad"),"data-visible":!C,...p,children:n&&(0,r.tZ)(c.AdBlock,{wrapperProps:{m:0},ref:w,adUnitPath:n,size:u?[[320,50],[320,100]]:[728,90],divId:(s||"div-gpt-ad-sticky")+(u?"-mobile":"")+h+String(I.current),pos:["Sticky"],contentId:h,hideIfHasSubot:u,customTargetings:g,adDefaultSize:u?[320,50]:[728,90],showCloseBtn:!0,onCloseAd:()=>b(!0),refreshInterval:f===o.L.Vietnam?30:60,ignoreRefreshAd:m})},u?"mobile":"desktop")}},xJ6s:function(e,t,n){n.d(t,{On:function(){return c},R7:function(){return d},nE:function(){return l},o$:function(){return s}});var r=n("rBCA"),a=n("uuQu"),o=n("iBNF"),i=n("rIrU");let l=(0,r.Z)("div",{target:"e1q29jt0"})("position:fixed;z-index:",i.kg.adBlock,";bottom:0;left:0;right:0;max-width:100%;background:none;transition:transform 0.3s ease-in-out;",a.M.mbUp,"{left:50%;width:fit-content;transform:translateX(-50%);}.close-sticky-button{position:absolute;display:flex;width:16px;height:16px;align-items:center;justify-content:center;background:#bfbfbf;border-radius:50%;color:white;cursor:pointer;font-size:12px;line-height:12px;transform:translate(50%,-50%);top:0;right:0;}opacity:0;pointer-events:none;&[data-visible='true']{opacity:1;pointer-events:auto;}"),c=(0,r.Z)("div",{target:"e1q29jt1"})("display:flex;justify-content:center;align-items:center;flex-direction:column;max-width:100%;",a.M.mbUp,"{width:fit-content;height:fit-content;}margin-inline:auto;/* margin:1rem auto;*/\n &[data-no-wrapper='false']{border:1px solid ",o.r.colors.neutral50,";background:",o.r.colors.neutral50,";}&[data-no-wrapper='true']{line-height:0;}&[data-header-bottom='true']{flex-direction:column-reverse;background:none;border:none;}",a.M.mbDown,"{[data-video='true'] [data-gc-instream-floating='true']{height:100px !important;div[class^='InstreamDom_player']{&[data-arb-resize-mode='compute-height']:not(#_):not(#_):not(#_):not(#_):not(#_):not(#_):not(#_):not(#_):not(#_):not(#_){height:100px !important;}div:last-child{width:180px !important;}}div[class^='InstreamDom_videoTitle']{position:absolute !important;left:180px !important;top:50%;transform:translate(0,-50%);z-index:999 !important;color:white !important;display:block !important;white-space:normal !important;text-align:left !important;font-size:14px !important;line-height:22px !important;font-weight:normal !important;padding:0 16px !important;width:auto !important;height:auto !important;max-height:66px !important;}div[class^='CloseButton']{top:23px !important;color:white !important;border-color:transparent !important;}}}"),d=(0,r.Z)("div",{target:"e1q29jt2"})("/* background:",o.r.colors.neutral50,";*/\n width:100%;padding:0 5px 1.5px;display:flex;align-items:center;justify-content:center;gap:5px;text-transform:capitalize;img{height:12px;width:12px;max-width:12px;max-height:12px;}&[data-header-bottom='true']{background:",o.r.colors.neutral50,";}span{font-size:10px;line-height:12px;color:",o.r.colors.gray400,";font-weight:400;}"),s=(0,r.Z)("div",{target:"e1q29jt3"})("background-color:white;background-image:url('/images/close-blue.svg');background-repeat:no-repeat;background-size:contain;background-position:center;width:14px;height:14px;position:absolute;top:0;right:0;z-index:1;cursor:pointer;")},"1LUM":function(e,t,n){n.r(t),n.d(t,{AdBlock:function(){return v}});var r=n("BGKE"),a=n("q1tI"),o=n("eosF"),i=n("Eso5"),l=n("O/o9"),c=n("dDsW"),d=n("P5LW"),s=n("N2Lg"),u=n("VIdu");window.pbjs=window.pbjs||{que:[]},window.googletag=window.googletag||{cmd:[]};var h=n("xJ6s");let m={},g=["TopBanner","MidBanner1","MidBanner2","masthead","Sticky"],_getForceRefreshConfig=(e,t)=>{if(e===o.L.Vietnam&&g.some(e=>t.includes(e)))return!0},displayAd=e=>{let{contentId:t,adUnitPath:n,size:r,divId:a,pos:o,sizeMapping:i,hideIfHasSubot:l,customTargetings:c,onSuccess:d}=e;if(!a||!document.getElementById(a))return console.error("divId is required");destroyAdSlot(a),window.googletag=window.googletag||{cmd:[]};let{googletag:s}=window;s.cmd.push(function(){let e=document.querySelector('meta[name="content_id"]'),h="string"==typeof t?t:null==e?void 0:e.content,g=s.defineSlot(n,r,a);if(document.querySelector("script[src*='https://micro.rubiconproject.com/prebid/dynamic']")&&function(e){var t;let n;let r=(t=e=>{window.googletag.pubads().refresh(e)},n=!1,r=>{n||(n=!0,t(r||e))});window.pbjs.que.push(function(){window.pbjs.rp.requestBids({callback:r,gptSlotObjects:e})}),setTimeout(r,3500)}([g]),g){try{c&&Object.keys(c).forEach(e=>{e&&(null==g||g.setTargeting(e,c[e]))})}catch(e){console.error(e)}m[a]=g,(0,u.Tm)(g),g.setTargeting("Pos",o),g.addService(s.pubads()),h&&g.setTargeting("Content_ID",h),i&&g.defineSizeMapping(i),l&&document.getElementById("subot--container")&&g.setTargeting("chatbot",!0),s.display(a),s.pubads().isInitialLoadDisabled()&&s.pubads().refresh([g]),null==d||d()}})},destroyAdSlot=e=>{if(m[e]){window.googletag=window.googletag||{cmd:[]};let{googletag:t}=window;t.cmd.push(function(){t.destroySlots([m[e]]),delete m[e]})}},p=["Sticky"],f=(0,a.forwardRef)(function(e,t){let{asPath:n,locale:a}=(0,d.h)();return(s.Rk[a]||[]).find(e=>n.startsWith(e))||n.startsWith("/health-tools/")&&!(s.rd[a]||[]).find(e=>encodeURIComponent(decodeURIComponent(n)).startsWith(encodeURIComponent(e)))||n.startsWith("/bot/")&&!(s.Iu[a]||[]).find(e=>encodeURIComponent(decodeURIComponent(n)).startsWith(encodeURIComponent(e)))?(0,r.tZ)("div",{ref:t}):(0,r.tZ)(x,{...e,ref:t})}),x=(0,a.forwardRef)(function(e,t){let{className:n,adUnitPath:s,size:u,divId:g,pos:f,sizeMapping:x,contentId:v,isHidden:y,hideIfHasSubot:b,isSticky:C,refreshInterval:Z,customTargetings:w,style:I,adDefaultSize:k,noWrapper:N,showCloseBtn:A,onCloseAd:B,headerBottom:S,wrapperProps:F,onlyRefreshInview:T,ignoreRefreshAd:R=!1,adWrapperStyle:L,adStyle:z,isVideo:E}=e,{locale:P}=(0,d.h)(),_=Z||(P===o.L.Vietnam&&f.some(e=>p.includes(e))?30:void 0),{formatMessage:X}=(0,c.Z)(),{ref:M,inView:H}=(0,l.YD)(),D=(0,a.useRef)(null),V=(0,a.useRef)(_);V.current=_getForceRefreshConfig(P,f)?15:_;let j=_getForceRefreshConfig(P,f)||T,[W,O]=(0,a.useState)(!1),setupRefreshAd=e=>{null!==D.current&&clearInterval(D.current),D.current=window.setInterval(()=>{window.googletag=window.googletag||{cmd:[]};let{googletag:e}=window;e.cmd.push(function(){m[g]&&e.pubads().refresh([m[g]])})},1e3*e)};if((0,a.useEffect)(()=>{H&&j&&V.current&&!R?setupRefreshAd(V.current):!H&&j&&null!==D.current&&clearInterval(D.current)},[H,j,R]),(0,a.useEffect)(()=>()=>{destroyAdSlot(g),D.current&&clearInterval(D.current)},[]),(0,a.useEffect)(()=>{y||displayAd({contentId:v,adUnitPath:s,size:u,divId:g,pos:f,sizeMapping:x,hideIfHasSubot:b,customTargetings:w,onSuccess:()=>{!V.current||j||R||setupRefreshAd(V.current);let e=document.getElementById(g);e&&E&&e.setAttribute("data-video",String(!!E))}})},[y]),W)return null;let U=(0,r.tZ)("div",{style:{position:"relative",width:"fit-content",height:"fit-content",overflow:"hidden",maxWidth:"100%",display:"flex",alignItems:"center",justifyContent:"center",...L},children:(0,r.tZ)("div",{ref:t,id:g,style:z})});if(C)return U;let Y=k?k[0]:u?Array.isArray(u[0])?u[0][0]:u[0]:void 0,K=k?k[1]:u?Array.isArray(u[0])?u[0][1]:u[1]:void 0;return(0,r.BX)(i.x,{...F,className:n,children:[A&&(0,r.tZ)(h.o$,{onClick:()=>{null==B||B(),O(!0)}}),(0,r.tZ)(h.On,{ref:M,className:n,style:I,"data-no-wrapper":!!N,"data-header-bottom":!!S,children:N?(0,r.BX)(r.HY,{children:[A&&(0,r.tZ)(h.o$,{onClick:()=>{null==B||B(),O(!0)}}),U]}):(0,r.BX)(r.HY,{children:[(0,r.BX)(h.R7,{"data-header-bottom":!!S,children:[(0,r.tZ)("img",{loading:"lazy",src:"/svg/adsIcon.svg",alt:"ad icon"}),(0,r.tZ)("span",{"data-ads-type":!0,children:X({id:"adBanner.title",defaultMessage:"Advertisement"})}),A&&(0,r.tZ)(h.o$,{onClick:()=>{null==B||B(),O(!0)}})]}),(0,r.tZ)("div",{style:{minWidth:Y||"100%",minHeight:K||"100%",position:"relative"},children:U})]})})]})}),v=(0,a.memo)(f,(e,t)=>e.adUnitPath===t.adUnitPath&&e.divId===t.divId&&e.className===t.className&&e.isHidden===t.isHidden)}}]);