(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6917,7074,5639,9675,9275,9903,4137,5495,6678,7202,4806],{Cov9:function(e,t,n){"use strict";n.d(t,{h:function(){return r},x:function(){return o}});var i=n("NMK5");let r=(0,i.Jj)(e=>{var t,n;return void 0!==e&&e?{province:e.state||"",keyCategory:e.key_category,category:e.category,description:e.description,qualityMin:e.air_quality_min||null,qualityMax:e.air_quality_max||null,currentAqiusValue:(null==e?void 0:null===(t=e.pollution)||void 0===t?void 0:t.aqius)||null,updatedTime:(null==e?void 0:null===(n=e.pollution)||void 0===n?void 0:n.ts)||null}:null}),o=(0,i.Jj)(e=>void 0!==e&&e?{title:e.title||"",description:e.description||"",disclaimer:e.disclaimer||"",featuredImage:e.featured_image||""}:null)},GWVq:function(e,t,n){"use strict";n.d(t,{v:function(){return r}});var i=n("iAbL");let r={formatProductPromotion:e=>e?{id:e.id||0,name:e.name||"",thumbnail:e.thumbnail||"",expirationDate:e.expiration_date||""}:null,formatPriceInfo:e=>e?{final:e.final||0,regular:e.regular||0,discountPercent:e.discount_percent||0}:null,formatCategory:function(e,t,n){var i,o,l;let a=n?n+"/"+e.slug:e.slug,u=(null==e?void 0:null===(o=e.children)||void 0===o?void 0:null===(i=o.map)||void 0===i?void 0:i.call(o,t=>r.formatCategory(t,e.id,a)))||[];return{id:null==e?void 0:e.id,name:(null==e?void 0:e.name)||"",logo:(null==e?void 0:e.logo)||"",slug:(null==e?void 0:e.slug)||"",fullSlug:a||"",children:u,parentId:t||0,products:(null===(l=e.products)||void 0===l?void 0:l.map(this.formatProduct))||[]}},formatProduct:e=>{var t,n,o;return e?{id:e.id||0,price:e.price&&r.formatPriceInfo(e.price)||{final:0,regular:0,discountPercent:0},thumbnail:e.thumbnail||"",name:e.name||"",averageRating:Number((e.average_rating||0).toFixed(2)),reviewsCount:e.reviews_count||0,tag:e.tag||null,sku:e.sku||"",slug:e.slug||"",images:e.images||[],tags:e.tags||[],unit:e.unit||"",brand:e.brand?{name:e.brand.name||"",image:e.brand.image||"",slug:e.brand.slug||"",productsCount:e.brand.products_count||0}:null,description:e.description||"",productPromotions:(null===(n=e.product_promotions)||void 0===n?void 0:null===(t=n.map)||void 0===t?void 0:t.call(n,r.formatProductPromotion).filter(i.$K))||[],isInStock:(null==e?void 0:e.is_in_stock)||!1,isAffiliateProduct:(null==e?void 0:e.is_affiliate_product)||!1,affiliates:(null===(o=e.affiliates)||void 0===o?void 0:o.map(e=>({channelCode:e.channel_code||"",price:e.price,url:e.url})))||[]}:null}}},ejbI:function(e,t,n){"use strict";function myImageLoader(e){let{src:t="",width:n,quality:i}=e;return t.includes("?")?"".concat(t,"&w=").concat(n,"&q=").concat(i||75):"".concat(t,"?w=").concat(n,"&q=").concat(i||75)}n.d(t,{Z:function(){return myImageLoader}})},Fyo5:function(e,t,n){"use strict";n.d(t,{B9:function(){return isValidStatus},le:function(){return checkValidDataApi},rx:function(){return checkValidData}});var i=n("qe1T");function checkValidDataApi(e){var t;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!!e&&"string"==typeof(null==e?void 0:e.state)&&(!!n||""!==e.state)&&"number"==typeof(null==e?void 0:null===(t=e.pollution)||void 0===t?void 0:t.aqius)}function checkValidData(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!!e&&"string"==typeof(null==e?void 0:e.province)&&(!!t||""!==e.province)&&"number"==typeof(null==e?void 0:e.currentAqiusValue)}function isValidStatus(e){return Object.values(i.P).includes(e)}},QW8v:function(e,t,n){"use strict";n.d(t,{W:function(){return c}});var i=n("VNqU"),r=n("09QT"),o=n("Cov9"),l=n("oQBk"),a=n("Tk9B"),u=n("Fyo5");let c=(0,i.Ue)((e,t)=>({loading:!1,error:null,currentData:null,cardInfo:null,listProvinces:null,currentLocation:null,setCurrentLocation(t){e({currentLocation:t})},fetchInitData:async()=>{let{loading:n,listProvinces:i}=t();if(!n&&!i){e({loading:!0,error:null});try{var c,s;let t=await (0,a.k)(!1),n=(null==t?void 0:t.location)||null,[i,d,f,m]=await Promise.all([(0,r.d)(l.y.HEALTH_TOOL.GET_AIR_POPULATION_INFO),n?(0,r.d)(l.y.HEALTH_TOOL.GET_AIR_POPULATION_SPECIFIC_PROVINCE,{params:{type:"geo",lat:n.latitude,lng:n.longitude}}):null,(0,r.d)(l.y.HEALTH_TOOL.GET_AIR_POPULATION_DEFAULT),(0,r.d)(l.y.HEALTH_TOOL.GET_AIR_POPULATION_PROVINCE),(0,a.k)(!1)]),v=null==d?void 0:d.data,p=null==f?void 0:f.data,k=(0,u.le)(v,!0),g=(0,u.le)(p),h=!!(null==i?void 0:i.data)&&!!(null==m?void 0:null===(c=m.data)||void 0===c?void 0:c.provinces)&&(k||g);if(h){let r=n&&k;e({currentLocation:r?t:null,cardInfo:(0,o.x)(null==i?void 0:i.data),currentData:(0,o.h)(r?v:g?p:null),listProvinces:(null==m?void 0:null===(s=m.data)||void 0===s?void 0:s.provinces)||[]})}else e({error:"General error"})}catch(t){e({error:t.message})}finally{e({loading:!1})}}},retryFetchInitData:async()=>{e({error:null}),await t().fetchInitData()}}))},tjQ2:function(e,t,n){"use strict";n.d(t,{Ep:function(){return ArticleStoreProvider},WM:function(){return useArticleStore}});var i=n("BGKE"),r=n("q1tI"),o=n("sEfC"),l=n.n(o),a=n("oWg6"),u=n("VNqU"),c=n("2vNa"),s=n("Bp26");let d=["small","medium","large"],f=(0,r.createContext)(null),createArticleStore=e=>(0,a.M)((t,n)=>({articles:[],bookmarkIds:[],chineseTranslate:s.w.traditional,currentArticle:null,currentProgress:0,fontSize:"small",isBookmarked:!1,isCommentPopupOpen:!1,isLiked:!1,isDisliked:!1,totalComment:0,categories:[],...e||{},addToArticles:e=>{!e||n().articles.find(t=>e.id===t.id)||t({articles:n().articles.concat(e)})},addToBookmark:e=>t({isBookmarked:!0,bookmarkIds:[...n().bookmarkIds,e]}),removeBookmark:e=>{let i=n().bookmarkIds.filter(t=>t!==e);t({isBookmarked:!1,bookmarkIds:i})},setArticles:e=>t(t=>({articles:"function"==typeof e?e(t.articles):e})),setBookmarkIds:e=>{t({bookmarkIds:e})},setChineseTranslate:e=>t({chineseTranslate:e}),setCurrentArticle:l()(e=>t({currentArticle:e}),300),setCurrentProgress:e=>t({currentProgress:e}),cycleFontSize:()=>t({fontSize:(0,c.D)(d,n().fontSize)}),setIsBookmarked:e=>t({isBookmarked:e}),setIsCommentPopupOpen:e=>t({isCommentPopupOpen:e}),setIsLiked:e=>t({isLiked:e}),setIsDisliked:e=>t({isDisliked:e}),setTotalComment:e=>t({totalComment:e}),setCategories:e=>t({categories:e}),setShowDictionaryShortcutBtn:e=>t({showDictionaryShortcutBtn:e}),setInFirstViewPort:e=>t({inFirstViewport:e})})),ArticleStoreProvider=e=>{let{init:t,refreshKey:n,children:o}=e,l=(0,r.useRef)(createArticleStore(t)),a=l.current;return(0,r.useEffect)(()=>{n&&l.current.setState(t)},[n]),(0,i.tZ)(f.Provider,{value:a,children:o})},useArticleStore=(e,t)=>{let n=(0,r.useContext)(f),i=(0,u.oR)(n,e,t);return i}},Bp26:function(e,t,n){"use strict";var i,r;n.d(t,{w:function(){return i}}),(r=i||(i={}))[r.traditional=0]="traditional",r[r.simplified=1]="simplified"},d30B:function(e,t,n){var i=n("q1tI");function Info(e){return i.createElement("svg",e,[i.createElement("path",{d:"M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z",fill:"#2D87F3",key:0}),i.createElement("path",{d:"M8 11V8",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",key:1}),i.createElement("path",{d:"M8 5H8.01",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",key:2})])}Info.defaultProps={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},e.exports=Info,Info.default=Info},hvR8:function(e,t,n){var i=n("q1tI");function Danger(e){return i.createElement("svg",e,[i.createElement("path",{d:"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",fill:"#262626",key:0}),i.createElement("path",{d:"M14.8286 9.17163L9.17176 14.8285",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",key:1}),i.createElement("path",{d:"M9.17139 9.17163L14.8282 14.8285",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",key:2})])}Danger.defaultProps={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},e.exports=Danger,Danger.default=Danger},X1xk:function(e,t,n){var i=n("q1tI");function Success(e){return i.createElement("svg",e,[i.createElement("path",{d:"M10.0001 18.3334C14.6025 18.3334 18.3334 14.6024 18.3334 10C18.3334 5.39765 14.6025 1.66669 10.0001 1.66669C5.39771 1.66669 1.66675 5.39765 1.66675 10C1.66675 14.6024 5.39771 18.3334 10.0001 18.3334Z",fill:"#00B16A",key:0}),i.createElement("path",{d:"M13.8333 7.5L8.33325 12.5L5.83325 10.2273",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",key:1})])}Success.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},e.exports=Success,Success.default=Success},l0B8:function(e,t,n){var i=n("q1tI");function Warning(e){return i.createElement("svg",e,i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 1.66666C5.4 1.66666 1.66667 5.39999 1.66667 9.99999C1.66667 14.6 5.4 18.3333 10 18.3333C14.6 18.3333 18.3333 14.6 18.3333 9.99999C18.3333 5.39999 14.6 1.66666 10 1.66666ZM10 10.8333C9.54167 10.8333 9.16667 10.4583 9.16667 9.99999V6.66666C9.16667 6.20832 9.54167 5.83332 10 5.83332C10.4583 5.83332 10.8333 6.20832 10.8333 6.66666V9.99999C10.8333 10.4583 10.4583 10.8333 10 10.8333ZM9.16667 12.5V14.1667H10.8333V12.5H9.16667Z",fill:"#FE921D"}))}Warning.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},e.exports=Warning,Warning.default=Warning},VYCi:function(){},"A/s0":function(){},YZfw:function(){},uMuU:function(){}}]);