"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3434],{CeA4:function(e,t,a){a.d(t,{U:function(){return PregnancyNavigation}});var i=a("BGKE"),n=a("IoIb"),o=a("DEkF"),r=a("dDsW"),l=a("hXNO"),d=a("q1tI"),c=a("R7WV"),s=a("MmHG"),h=a("CJtR"),g=a("P5LW"),u=a("rIrU"),p=a("rBCA"),m=a("uuQu"),f=a("iBNF");let x=(0,p.Z)("div",{target:"ehdleij0"})(m.M.mbDown,"{display:none;}max-width:fit-content;display:flex;flex-direction:column;align-items:flex-start;padding:24px;gap:24px;width:100%;min-width:400px;background:",null===f.r||void 0===f.r?void 0:f.r.colors.neutral50,";border-radius:8px;.category-wrapper{display:flex;flex-direction:column;width:100%;gap:12px;}"),y=(0,p.Z)("a",{target:"ehdleij1"})("width:100%;display:flex;flex-direction:row;align-items:center;padding:8px;gap:16px;min-height:64px;background:#ffffff;border-radius:8px;.category-image{display:flex;align-items:center;justify-content:center;width:40px;height:40px;background:",null===f.r||void 0===f.r?void 0:f.r.colors.neutral50,";border-radius:50%;overflow:hidden;img{object-fit:cover;}}"),b=d.memo(e=>{let{category:t}=e,{locale:a}=(0,g.h)();return(0,i.BX)(y,{href:t.permalink,className:"pointer-event-child-none","data-event-category":"Health Tool","data-event-action":"Category Click","data-event-label":"".concat((0,h.UC)(a)).concat(t.permalink),children:[(0,i.tZ)("div",{className:"category-image",children:(0,i.tZ)(c.I,{src:t.icon||"".concat(u.Nr,"/default-image.jpg"),alt:""})}),(0,i.tZ)(s.T,{size:"p2",style:{textTransform:"capitalize"},children:t.name})]},t.term_id)}),PregnancyNavigationDrawer=e=>{let{categories:t,drawerProps:a}=e,{formatMessage:o}=(0,r.Z)();if(!a)return null;let{open:l,...d}=a;return(0,i.tZ)(n.D,{title:o({id:"pregnancyTool.pregnancyNavigation.title",defaultMessage:"Pregnancy Navigation"}),open:l,placement:"bottom",...d,children:(0,i.tZ)("div",{children:t.map(e=>(0,i.tZ)(b,{category:e},e.term_id))})})},PregnancyNavigation=e=>{let{categories:t,drawerProps:a,...n}=e,{formatMessage:d}=(0,r.Z)(),c=(0,l.d)();return t&&(null==t?void 0:t.length)!==0?c?(0,i.tZ)(PregnancyNavigationDrawer,{categories:t,drawerProps:a}):(0,i.BX)(x,{...n,children:[(0,i.tZ)(o.H,{tag:"h4",fontWeight:"bold",children:d({id:"pregnancyTool.pregnancyNavigation.title",defaultMessage:"Pregnancy Navigation"})}),(0,i.tZ)("div",{className:"category-wrapper",children:t.map(e=>(0,i.tZ)(b,{category:e},e.term_id))})]}):null}},yioo:function(e,t,a){a.r(t),a.d(t,{ProductsWidget:function(){return ProductsWidget}});var i=a("BGKE"),n=a("q1tI"),o=a("DEkF"),r=a("Eso5"),l=a("dDsW"),d=a("09QT"),c=a("GWVq"),s=a("oQBk"),h=a("vODv"),g=a("fKro"),u=a("05Ua"),p=a("o0qI"),m=a("/npG"),f=a("mYVa"),x=(0,m.k)(e=>({root:{display:"flex",flexDirection:"column",gap:(0,f.h)(16),background:e.colors.blue[0],padding:(0,f.h)(16),borderRadius:8,[e.fn.largerThan("sm")]:{padding:(0,f.h)(24)}},heading:{borderLeft:"5px solid ".concat(e.colors.primaryBase),paddingLeft:12},headingText:{},cardRoot:{},cardThumbnail:{}})),y=a("wp0n"),b=a("8wjV"),v=a("fNFL"),w=a("RGvF"),Z=a("RZSM"),B=a("uNuU"),N=a("iv2E"),C=a("P5LW"),T=a("rIrU"),z=a("iAbL"),k=(0,m.k)((e,t)=>{let{layout:a,hasPromotion:i}=t;return{root:{background:"#fff",borderRadius:8,padding:8,display:"flex",flexDirection:"column",justifyContent:"space-between",flex:"1 1 0px",..."horizon"===a?{gap:(0,f.h)(8)}:{gap:(0,f.h)(4)}},thumbnail:{position:"relative",..."horizon"===a&&{width:(0,f.h)(120),flexGrow:0}},info:{display:"flex",flexDirection:"horizon"===a?"row":"column",gap:8},mainInfo:{position:"relative",display:"flex",flexDirection:"column",gap:8,..."horizon"===a&&{justifyContent:"center",gap:4,width:"calc(100% - 128px)"}},name:{..."horizon"===a&&i&&{paddingRight:(0,f.h)(30)}},prices:{display:"flex",gap:(0,f.h)(8)},mainPrice:{color:e.colors.red[8]},originPrice:{textDecoration:"line-through",color:"#737373"},actions:{display:"flex"},cartBtn:{borderTopRightRadius:0,borderBottomRightRadius:0},buyBtn:{width:"calc(100% - 40px)",borderTopLeftRadius:0,borderBottomLeftRadius:0},affBuyBtn:{flexGrow:1},discountTag:{position:"absolute",right:0,top:0}}}),I=a("zPX9"),M=a("q9DY"),P=a("f8uB"),X=(0,m.k)(e=>({root:{".title-container":{display:"flex",alignItems:"center",justifyContent:"space-between"},".image-info-wrapper":{display:"flex",gap:(0,f.h)(16),alignItems:"center",marginBottom:(0,f.h)(12),".product-image":{borderRadius:(0,f.h)(3),width:(0,f.h)(120),height:(0,f.h)(120),objectFit:"contain"}},".title-divider":{borderTop:"1px solid #e4e8ec",margin:"16px 0 12px",[e.fn.smallerThan("sm")]:{marginTop:(0,f.h)(9)}}}})),D=a("iZ8j"),S=a("hXNO"),A=a("rBCA"),E=a("uuQu"),R=a("iBNF");let L=(0,A.Z)("div",{target:"ebdvwdl0"})("display:grid;gap:8px;&[data-more]{transition:max-height 0.6s;max-height:0;overflow:hidden;margin-top:8px;}&[data-show-all='true']{max-height:400px;}&[data-size='auto']{",E.M.mbDown,"{grid-template-columns:repeat(2,1fr);&[data-one='true']{grid-template-columns:1fr;}}&[data-size='sm']{grid-template-columns:repeat(2,1fr);&[data-one='true']{grid-template-columns:1fr;}}&[data-size='lg']{grid-template-columns:repeat(4,1fr);}"),W=(0,A.Z)("a",{target:"ebdvwdl1"})("display:flex;text-decoration:none;padding:6px;align-items:center;gap:8px;border:1px solid ",R.r.colors.blue100,";border-radius:8px;&:hover,&:active,&:focus{background-color:",R.r.colors.blue100,";border-color:",R.r.colors.primaryBase,";}.info-text{display:flex;flex-direction:column;.price-text{display:flex;align-items:center;}svg,img{margin-left:4px;}img{object-fit:cover;border-radius:4px;}svg path{fill:",R.r.colors.red800,";}}"),H=(0,A.Z)(b.B,{target:"ebdvwdl2"})("&[data-show='true']{margin-top:0px;}> span{display:inline-flex;align-items:center;}margin-top:-8px;color:",R.r.colors.primaryBase,";svg[data-show='true']{transform:rotate(-90deg);}svg path{fill:",R.r.colors.primaryBase,";}&[data-display-size='auto']{",E.M.mbUp,"{padding-left:6px;}",E.M.mbDown,"{width:100%;}}&[data-display-size='sm']{width:100%;}&[data-display-size='lg']{padding-left:6px;}"),j={shopee:{name:"Shopee",icon:function(e){return(0,i.tZ)("img",{loading:"lazy",src:"/images/vendors/vendor-shopee.png",style:{width:e,height:e},alt:"Lazada"})}},lazada:{name:"Lazada",icon:function(e){return(0,i.tZ)("img",{loading:"lazy",src:"/images/vendors/vendor-lazada.png",style:{width:e,height:e},alt:"Lazada"})}},tiki:{name:"Tiki",icon:function(e){return(0,i.tZ)("img",{loading:"lazy",src:"/images/vendors/vendor-tiki.png",style:{width:e,height:e},alt:"Tiki"})}},hellobacsi:{name:"Hellobacsi",icon:function(e){return(0,i.tZ)("img",{loading:"lazy",src:"/images/vendors/vendor-hellobacsi.png",style:{width:e,height:e},alt:"affiliate hellobacsi"})}}},BuyNowButtons=e=>{var t,a;let{affiliates:d,size:c="auto",...s}=e,{locale:h}=(0,C.h)(),g=(0,S.d)(),{formatMessage:u}=(0,l.Z)(),p="auto"===c&&g||"sm"===c?4:8,[m,f]=n.useState(!1),x=d.length>p;return(0,i.BX)(r.x,{...s,children:[(0,i.tZ)("div",{style:{marginBottom:8},children:g?(0,i.tZ)(o.H,{tag:"h5",as:"p",children:u({id:"product.affiliate.buyNow",defaultMessage:"Mua ngay"})}):(0,i.tZ)(y.T,{size:"s4",children:u({id:"product.affiliate.buyNow",defaultMessage:"Mua ngay"})})}),(0,i.tZ)(L,{"data-size":c,"data-one":(null==d?void 0:d.length)<=1,children:null==d?void 0:null===(t=d.slice(0,p))||void 0===t?void 0:t.map((e,t)=>{var a,n;return j[e.channelCode]&&(0,i.BX)(W,{href:e.url,target:"_blank","data-event-label":"https://".concat(N.domainLocales[h]).concat(e.url),"data-event-category":"Ecommerce","data-event-action":"Buy Now Click","data-product-channel":e.channelCode.charAt(0).toUpperCase()+e.channelCode.slice(1),children:[(null===(a=j[e.channelCode])||void 0===a?void 0:a.icon(36))||"",(0,i.BX)("div",{className:"info-text",children:[(0,i.tZ)(y.T,{size:"n1",children:null===(n=j[e.channelCode])||void 0===n?void 0:n.name}),(0,i.BX)(y.T,{className:"price-text",size:"s4",sx:e=>({color:e.colors.red[7]}),children:[(0,z.OH)(e.price,h,"VND"),(0,i.tZ)(D.Z,{size:18})]})]})]},e.channelCode+t)})}),x&&(0,i.BX)(i.HY,{children:[(0,i.tZ)(L,{"data-size":c,"data-more":!0,"data-show-all":String(m),children:null==d?void 0:null===(a=d.slice(8))||void 0===a?void 0:a.map((e,t)=>{var a,n;return j[e.channelCode]&&(0,i.BX)(W,{href:e.url,target:"_blank","data-event-category":"Ecommerce","data-event-action":"Shop Click","data-product-channel":e.channelCode.charAt(0).toUpperCase()+e.channelCode.slice(1),children:[(null===(a=j[e.channelCode])||void 0===a?void 0:a.icon(36))||(0,i.tZ)(i.HY,{}),(0,i.BX)("div",{className:"info-text",children:[(0,i.tZ)(y.T,{size:"n1",children:null===(n=j[e.channelCode])||void 0===n?void 0:n.name}),(0,i.BX)(y.T,{className:"price-text",size:"s4",children:[(0,z.OH)(e.price,h,"VND"),(0,i.tZ)(D.Z,{size:16})]})]})]},e.channelCode+t)})}),(0,i.BX)(H,{onClick:()=>f(!m),size:"sm",color:"ghost",children:[m?u({id:"common.seeLess",defaultMessage:"Thu gọn"}):u({id:"product.affiliate.seeMore",defaultMessage:"Xem th\xeam {count} s\xe0n"},{count:123}),(0,i.tZ)(D.Z,{})]})]})]})},ProductCardBuyNowModal=e=>{let{onClose:t,product:a,styles:n,className:o,classNames:d,...c}=e,{formatMessage:s}=(0,l.Z)(),{classes:h,cx:g}=X(void 0,{name:"ProductCardBuyNowModal",classNames:d,styles:n}),{affiliates:u=[],slug:p}=a;return(0,i.BX)(r.x,{className:g(h.root,o),...c,children:[(0,i.BX)("div",{className:"title-container",children:[(0,i.tZ)(y.T,{size:"s3",children:s({id:"productCard.buyNowModal.title",defaultMessage:"Lựa chọn mua h\xe0ng từ c\xe1c nh\xe0 b\xe1n lẻ"})}),(0,i.tZ)(M.Z,{onClick:()=>{null==t||t()},style:{cursor:"pointer"}})]}),(0,i.tZ)("div",{className:"title-divider"}),(0,i.BX)(r.x,{component:"a",href:"/shop/san-pham/".concat(p,"/"),target:"_blank",className:"image-info-wrapper",children:[(0,i.tZ)("img",{loading:"lazy",className:"product-image",src:a.thumbnail,alt:a.name}),(0,i.tZ)(y.T,{size:"p1",children:a.name})]}),u?(0,i.tZ)(BuyNowButtons,{affiliates:u||[],size:"sm"}):(0,i.tZ)(I.L,{}),(0,i.BX)(r.x,{sx:e=>({display:"flex",gap:8,color:e.colors.green[8],marginTop:(0,f.h)(20)}),children:[(0,i.tZ)(P.Z,{size:16,useCurrentColor:!0,style:{marginTop:(0,f.h)(2)}}),(0,i.tZ)(y.T,{size:"p4",sx:e=>({color:e.colors.green[8]}),weight:"regular",children:s({id:"productCard.buyNowModal.info",defaultMessage:"Nh\xe0 b\xe1n lẻ c\xf3 thể sẽ cung cấp th\xeam nhiều thuộc t\xednh sản phẩm kh\xe1c nhau cho bạn lựa chọn"})})]})]})},ProductCard=e=>{let{product:t,onAddToCart:a,onBuyNow:o,styles:d,layout:c="vertical",className:s,classNames:h,cartBtnColor:g,...u}=e,{formatMessage:p}=(0,l.Z)(),{locale:m}=(0,C.h)(),[x,I]=(0,n.useState)(!1),[M,P]=(0,n.useState)(!1),{name:X,price:D,isInStock:S,thumbnail:A,sku:E,slug:R}=t,{classes:L,cx:W}=k({layout:c,hasPromotion:!!D.discountPercent},{name:"ProductCard",styles:d,classNames:h}),[H,j]=(0,n.useState)(!1),O="/shop/san-pham/".concat(R,"/"),discountBadge=()=>D.discountPercent?(0,i.BX)(w.C,{className:L.discountTag,size:"md",color:"red",variant:"filled",sx:{paddingLeft:"5px",paddingRight:"5px",height:"22px"},children:["-",0===Math.round(D.discountPercent)?Math.ceil(D.discountPercent):Math.round(D.discountPercent),"%"]}):null;return(0,i.BX)(i.HY,{children:[(0,i.BX)(r.x,{className:W(L.root,s),"data-layout":c,...u,children:[(0,i.BX)(r.x,{component:"a",href:O,target:"_blank",className:L.info,"data-event-category":"Ecommerce","data-event-action":"Open Product Page","data-event-label":"https://".concat(N.domainLocales[m]).concat(O),children:[(0,i.BX)(r.x,{className:L.thumbnail,children:[(0,i.tZ)(Z.o,{ratio:206/164,sx:{">img":{objectFit:"contain"}},children:(0,i.tZ)("img",{loading:"lazy",src:A,alt:X,onError:e=>e.currentTarget.src="/images/default-image.jpg"})}),"vertical"===c&&discountBadge()]}),(0,i.BX)(r.x,{className:L.mainInfo,children:["horizon"===c&&discountBadge(),(0,i.tZ)(y.T,{size:"p4",className:L.name,children:X}),(0,i.BX)(r.x,{className:L.prices,children:[(0,i.tZ)(y.T,{size:"s4",className:L.mainPrice,children:(0,z.OH)(D.final,m,"VND")}),D.regular&&D.regular!==D.final?(0,i.tZ)(y.T,{size:"s4",className:L.originPrice,children:(0,z.OH)(1e6,m,"VND")}):null]})]})]}),(0,i.BX)(r.x,{className:L.actions,children:[!t.isAffiliateProduct&&(0,i.tZ)(b.B,{variant:"light",color:g,className:L.cartBtn,loading:x,leftIcon:(0,i.tZ)(B.Z,{size:18,color:"currentColor"}),disabled:!S,"data-event-category":"Ecommerce","data-event-action":"Add To Cart Click","data-event-label":"https://".concat(N.domainLocales[m]).concat(O),onClick:async e=>{e.preventDefault(),I(!0),await (null==a?void 0:a(1,E)),I(!1)}}),(0,i.tZ)(b.B,{className:W(t.isAffiliateProduct?L.affBuyBtn:L.buyBtn),disabled:!S,loading:M,"data-event-category":"Ecommerce","data-event-action":"Buy Now Click","data-event-label":"https://".concat(N.domainLocales[m]).concat(O),onClick:async e=>{e.preventDefault(),t.isAffiliateProduct?(t.affiliates||[]).length>0?j(!0):window.open(O):(P(!0),await (null==o?void 0:o(1,E,R)),P(!1))},children:p(S?{id:"productInfo.buyNow",defaultMessage:"Mua ngay"}:{id:"tag.outOfStock",defaultMessage:"Hết h\xe0ng"})})]})]}),(0,i.tZ)(v.M,{target:T.Hh,opened:!!H,onClose:()=>j(!1),size:(0,f.h)(572),children:(0,i.tZ)(ProductCardBuyNowModal,{product:t,onClose:()=>j(!1)})})]})};var O=a("93jb"),G=a("fdQd"),_=a("oTwY"),V=a("yHSA"),F=(0,m.k)(e=>({root:{background:"#fff",borderRadius:(0,f.h)(16),padding:(0,f.h)(8),display:"flex",gap:(0,f.h)(24),[e.fn.smallerThan("sm")]:{padding:(0,f.h)(16),flexDirection:"column",gap:(0,f.h)(16)}},heading:{borderLeft:"5px solid ".concat(e.colors.primaryBase),paddingLeft:12},slider:{[e.fn.largerThan("sm")]:{width:(0,f.h)(230)}},name:{color:"#262626"},info:{display:"flex",flexDirection:"column",justifyContent:"space-between",[e.fn.largerThan("sm")]:{width:"calc(100% - 230px - 24px)"},[e.fn.smallerThan("sm")]:{gap:(0,f.h)(16)}},mainInfo:{display:"flex",flexDirection:"column",gap:(0,f.h)(4),alignItems:"flex-start"},prices:{display:"flex",gap:(0,f.h)(8),alignItems:"flex-end",marginBottom:(0,f.h)(4)},mainPrice:{color:e.colors.red[8]},originPrice:{textDecoration:"line-through",color:"#595959"},actionRows:{display:"table"},actionRow:{display:"table-row"},actionCol:{display:"table-cell",verticalAlign:"middle",padding:"4px 0"},actionLabel:{width:(0,f.h)(110),whiteSpace:"nowrap",paddingRight:(0,f.h)(8)},promotionTags:{display:"flex",flexDirection:"column",gap:(0,f.h)(4)},actions:{display:"flex",gap:(0,f.h)(8)},amountInput:{width:(0,f.h)(40),input:{textAlign:"center"}},amountBtn:{width:(0,f.h)(32),background:e.colors.neutral[0],borderColor:e.colors.neutral[0]},cartBtn:{},buyBtn:{[e.fn.smallerThan("sm")]:{flexGrow:1},[e.fn.largerThan("sm")]:{minWidth:(0,f.h)(182)}},amountControl:{display:"flex",gap:(0,f.h)(8)}})),U=a("qQsD"),Q=a("raAP");let q=(0,A.Z)("div",{target:"e19a00510"})("height:0;width:100%;padding-top:100%;align-items:center;position:relative;&[data-in-popup='true']{margin-bottom:46px;",E.M.mbDown,"{margin-bottom:24px;}}&[data-no-bottom-list='true']{margin-bottom:0;}",E.M.tdOnly,"{padding-top:54%;}"),Y=(0,A.Z)("div",{target:"e19a00511"})("position:absolute;width:100%;height:100%;top:0;left:0;"),K=(0,A.Z)("img",{target:"e19a00512"})("position:absolute;top:0;left:0;width:100%;height:100%;object-fit:contain;user-select:none;user-drag:none;&[data-blur='true']{filter:blur(4px);-webkit-filter:blur(4px);-moz-filter:blur(4px);-o-filter:blur(4px);-ms-filter:blur(4px);}"),J=(0,A.Z)("div",{target:"e19a00513"})("height:0;/* take account of the border */\n padding-top:calc(100% - 2px);position:relative;cursor:pointer;border-radius:6px;background:",R.r.colors.white,";border:1px solid ",R.r.colors.neutral100,";overflow:hidden;&[data-no-border]{border:none;padding-top:100%;",E.M.tdOnly,"{padding-top:54%;}}&[data-selected='true']{border-color:",R.r.colors.primaryBase,";}"),$=(0,A.Z)("div",{target:"e19a00514"})("position:absolute;top:0;left:0;width:100%;height:100%;background:#fff;display:flex;align-items:center;justify-content:center;text-align:center;");R.r.colors.gray800,R.r.colors.white,E.M.mbDown,E.M.mbDown;let ee=(0,A.Z)("div",{target:"e19a005110"})(".grid-layout{grid-gap:8px;grid-template-columns:repeat(var(--carousel-max),1fr) !important;}&[data-in-popup='true']{",E.M.mbDown,"{padding:0 16px;}}"),ProductImageCarousel=e=>{let{images:t,currentImageIndex:a,setCurrentImageIndex:o,openPreviewImageIndex:d,isInPopup:c,hideBottomScrollList:s,productName:h,hideSeemore:g,url:u}=e,p=(0,Q.U)(),{formatMessage:m}=(0,l.Z)(),[x,b]=(0,n.useState)(a||0),v=(0,S.d)(),w=c?v?3:6:4,Z=void 0!==a?a:x,setCurrentImageIndex=e=>{b(e),"function"==typeof o&&o(e)},B=c?t:t.slice(0,w);return(0,i.BX)(r.x,{sx:{"--carousel-max":w,display:"flex",flexDirection:"column",gap:(0,f.h)(8),width:"100%"},children:[(0,i.tZ)(r.x,{component:"a",href:u,target:"_blank",children:(0,i.BX)(q,{"data-in-popup":c,children:[(0,i.tZ)(Y,{children:(0,i.tZ)(U.S,{row:1,column:1,page:Z,isDotsShown:!1,onChangePage:e=>setCurrentImageIndex(e),mode:"snapped",children:t.map((e,t)=>(0,i.tZ)(J,{onClick:()=>{null==d||d(t)},"data-event-category":"Ecommerce","data-event-action":"Product Image Click","data-event-label":p,children:(0,i.tZ)(K,{src:e,alt:h||"product image ".concat(t+1),onError:e=>e.currentTarget.src="/images/default-image.jpg"})},t))},t.length)}),(0,i.tZ)(r.x,{sx:e=>({background:e.colors.neutral100,padding:"2px 8px",position:"absolute",bottom:16,right:16,borderRadius:8}),children:(0,i.tZ)(y.T,{size:"n1",children:"".concat(Z+1,"/").concat(t.length)})})]})}),t.length>1&&!s&&(0,i.tZ)(ee,{"data-in-popup":c,children:(0,i.tZ)(U.S,{row:1,column:w||6,page:Math.floor(Z/w),isDotsShown:!1,mode:"snapped",children:B.map((e,t)=>{let a=t+1===w&&!c&&!g;return(0,i.BX)(J,{"data-selected":t===Z,onClick:()=>a?null==d?void 0:d(t):setCurrentImageIndex(t),"data-event-category":"Ecommerce","data-event-action":"Product Image Click","data-event-label":p,children:[(0,i.tZ)(K,{src:e,onError:e=>e.currentTarget.src="/images/default-image.jpg"}),a&&(0,i.tZ)($,{children:(0,i.tZ)(y.T,{size:"n1",sx:e=>({color:e.fn.primaryColor()}),children:m({id:"productImageCarousel.seeAll",defaultMessage:"Xem tất cả"})})})]},t)})},t.length+"-"+w)})]})},ProductWideCard=e=>{let{product:t,styles:a,className:o,classNames:d,onAddToCart:c,onBuyNow:s,cartBtnColor:h,...g}=e,{locale:u}=(0,C.h)(),[p,m]=(0,n.useState)(!1),[f,x]=(0,n.useState)(!1),{formatMessage:v}=(0,l.Z)(),Z=(0,S.d)(),{name:T,images:k=[],sku:I,slug:M,price:P,isInStock:X}=t,D=k.map(e=>e.medium),{classes:A,cx:E}=F(void 0,{name:"ProductWideCard",styles:a,classNames:d}),[R,L]=(0,n.useState)(1),W="/shop/san-pham/".concat(M,"/"),H="https://".concat(N.domainLocales[u]).concat(W);return(0,i.BX)(r.x,{className:E(A.root,o),...g,children:[(0,i.tZ)(r.x,{className:A.slider,"data-event-category":"Ecommerce","data-event-action":"Open Product Page","data-event-label":H,children:(0,i.tZ)(ProductImageCarousel,{url:W,images:D,hideSeemore:!0,hideBottomScrollList:Z,productName:T})}),(0,i.BX)(r.x,{className:A.info,children:[(0,i.BX)(r.x,{className:A.mainInfo,children:[(0,i.tZ)(r.x,{component:"a",href:W,target:"_blank","data-event-category":"Ecommerce","data-event-action":"Open Product Page","data-event-label":H,children:(0,i.tZ)(y.T,{size:"s3",className:A.name,children:T})}),(0,i.BX)(r.x,{className:A.prices,children:[(0,i.tZ)(y.T,{size:"s1",className:A.mainPrice,children:(0,z.OH)(P.final,u,"VND")}),P.regular&&P.regular!==P.final?(0,i.tZ)(y.T,{size:"s3",className:A.originPrice,children:(0,z.OH)(P.regular,u,"VND")}):null,P.discountPercent?(0,i.BX)(w.C,{size:"md",color:"red",variant:"filled",sx:{paddingLeft:"5px",paddingRight:"5px",height:"22px"},children:["-",0===Math.round(P.discountPercent)?Math.ceil(P.discountPercent):Math.round(P.discountPercent),"%"]}):null]}),!t.isAffiliateProduct&&(0,i.BX)(r.x,{className:A.actionRows,children:[(0,i.BX)(r.x,{className:A.actionRow,children:[(0,i.tZ)(r.x,{className:E(A.actionCol,A.actionLabel),children:(0,i.tZ)(y.T,{size:"p3",children:v({id:"productInfo.amount"})})}),(0,i.tZ)(r.x,{className:A.actionCol,children:X?(0,i.BX)(r.x,{className:A.amountControl,children:[(0,i.tZ)(b.B,{variant:"tertiary",className:A.amountBtn,leftIcon:(0,i.tZ)(V.Z,{color:"#595959",size:18}),onClick:()=>{L(Math.max(R-1,1))},size:"sm",color:"secondary"}),(0,i.tZ)(G.I.Number,{className:A.amountInput,size:"sm",value:R}),(0,i.tZ)(b.B,{variant:"tertiary",className:A.amountBtn,leftIcon:(0,i.tZ)(_.Z,{color:"#595959",size:18}),onClick:()=>{L(Math.min(R+1,999))},size:"sm"})]}):null})]}),t.productPromotions.length>0&&(0,i.BX)(r.x,{className:A.actionRow,children:[(0,i.tZ)(r.x,{className:E(A.actionCol,A.actionLabel),children:(0,i.tZ)(y.T,{size:"p3",className:A.actionLabel,children:v({id:"productInfo.promotion"})})}),(0,i.tZ)(r.x,{className:A.actionCol,children:(0,i.tZ)(r.x,{className:A.promotionTags,children:t.productPromotions.map((e,t)=>(0,i.tZ)(O.T,{type:"red",isLight:!0,isInline:!0,isSquared:!0,style:{color:"red"},children:(0,i.tZ)(y.T,{size:"n1",sx:e=>({color:"".concat(e.colors.red[7],"!important")}),children:e.name})},t))})})]})]})]}),(0,i.tZ)(r.x,{className:A.actions,children:t.isAffiliateProduct?(0,i.tZ)(r.x,{sx:{width:"100%"},children:(0,i.tZ)(BuyNowButtons,{affiliates:t.affiliates||[]})}):(0,i.BX)(i.HY,{children:[(0,i.tZ)(b.B,{variant:"light",color:h,className:A.cartBtn,loading:p,leftIcon:(0,i.tZ)(B.Z,{size:18,color:"currentColor"}),"data-event-category":"Ecommerce","data-event-action":"Add To Cart Click","data-event-label":H,onClick:async()=>{m(!0),await (null==c?void 0:c(R,I)),L(1),m(!1)},disabled:!X}),(0,i.tZ)(b.B,{loading:f,className:A.buyBtn,"data-event-category":"Ecommerce","data-event-action":"Buy Now Click","data-event-label":H,onClick:async()=>{x(!0),await (null==s?void 0:s(R,I,M)),L(1),x(!1)},disabled:!X,children:v(X?{id:"productInfo.buyNow",defaultMessage:"Mua ngay"}:{id:"tag.outOfStock",defaultMessage:"Hết h\xe0ng"})})]})})]})]})};var et=a("0VOb");let ProductsWidget=e=>{let{skuList:t="",products:a=[],styles:m,className:f,classNames:y,heading:b,layout:v,numberItemToSlideDesktop:w=4,numberItemToSlideMobile:Z=3,cartBtnColor:B,...N}=e,{formatMessage:C}=(0,l.Z)(),{state:{userInfo:T,cartNumber:z},dispatch:k}=(0,n.useContext)(p.I),I=z||0,[M,P]=(0,n.useState)([]),{classes:X,cx:D}=x(void 0,{name:"ProductsWidget",styles:m,classNames:y});(0,n.useEffect)(()=>{0===a.length?t.split(",").length>0&&(async()=>{var e;let a=await (0,d.d)(s.y.ECOMMERCE.GET_PRODUCT_DETAIL_BY_LIST_IDS,{params:{skuList:t.replace(/ /g,"")}},"ecommerce");P(((null==a?void 0:null===(e=a.data)||void 0===e?void 0:e.products)||[]).map(c.v.formatProduct))})():P(a)},[t]);let addToCart=async(e,t,a)=>{let i,{amount:n,sku:o}=e;(null==(i=(null==T?void 0:T.id)?await g.M.addToCart(String(o),n):await g.z.addToCart(String(o),n))?void 0:i.status)===1?null==t||t(i):null==a||a(i)},handleAddToCart=async(e,t)=>addToCart({amount:e,sku:t},()=>{(0,et.c)({title:C({id:"productInfo.addedToCart"}),message:"",type:"success"}),k({type:u.H.UPDATE_CART,payload:I+e})},()=>(0,et.c)({message:C({id:"notify.error.message",defaultMessage:"Đ\xe3 xảy ra lỗi, vui l\xf2ng thử lại"}),type:"danger"})),handleBuyNow=async(e,t)=>addToCart({amount:e,sku:t},()=>{(0,et.c)({title:C({id:"productInfo.addedToCart"}),message:"",type:"success"}),k({type:u.H.UPDATE_CART,payload:I+1}),window.open("/shop/gio-hang/")},()=>(0,et.c)({message:C({id:"notify.error.message",defaultMessage:"Đ\xe3 xảy ra lỗi, vui l\xf2ng thử lại"}),type:"danger"})),S=(null==v?void 0:v[M.length-1])||"vertical";return M.length>0?(0,i.BX)(r.x,{className:D(X.root,f),...N,children:[b&&(0,i.tZ)(r.x,{className:X.heading,children:(0,i.tZ)(o.H,{tag:"h4",className:D("title",X.headingText),children:b})}),(0,i.tZ)(h.jx,{showFullSlide:!0,lengthToCarouselDesktop:w,lengthToCarouselMobile:Z,children:(0,i.tZ)(h.jx.Slider,{children:M.map((e,t)=>"wide-horizon"===S?(0,i.tZ)(ProductWideCard,{cartBtnColor:B,classNames:{root:X.cardRoot,thumbnail:X.cardThumbnail},product:e,onAddToCart:handleAddToCart,onBuyNow:handleBuyNow},String(t)):(0,i.tZ)(ProductCard,{className:X.cardRoot,product:e,onAddToCart:handleAddToCart,onBuyNow:handleBuyNow,cartBtnColor:B,layout:S},String(t)))})})]}):null}},q0sa:function(e,t,a){a.d(t,{J:function(){return PWGInputForm}});var i=a("BGKE"),n=a("q1tI"),o=a("iBNF"),r=a("fdQd"),l=a("wp0n"),d=a("dDsW"),c=a("3td9"),s=a("rBCA");let h=(0,s.Z)("div",{target:"e1jzs2bm0"})("width:100%;& >:not(:last-child){margin-bottom:24px;}input{background:white;}"),PWGInputForm=e=>{let{info:t,className:a,style:s,onChange:g,errorMessage:u={}}=e,{formatMessage:p}=(0,d.Z)(),[m,f]=(0,n.useState)({weightBefore:!1,height:!1,weight:!1}),checkValidInputIsANumber=(e,t)=>{""!==e&&(isNaN(e)||isNaN(parseFloat(e)))||t(e)},onWeightBeforeChanged=e=>{checkValidInputIsANumber(e,e=>{f(e=>({...e,weightBefore:!0}));let a={...t,weightBefore:e};g&&g(a)})},onHeightChanged=e=>{checkValidInputIsANumber(e,e=>{f(e=>({...e,height:!0}));let a={...t,height:e};g&&g(a)})},onWeightChanged=e=>{checkValidInputIsANumber(e,e=>{f(e=>({...e,weight:!0}));let a={...t,weight:e};g&&g(a)})};return(0,n.useEffect)(()=>{g&&g({...t})},[]),(0,n.useEffect)(()=>{f({weightBefore:!1,height:!1,weight:!1})},[u]),(0,i.BX)(h,{style:s,className:a,children:[(0,i.tZ)(c.NI,{children:(0,i.tZ)(r.I.Number,{label:(0,i.BX)(l.T,{size:"s4",as:"label",children:[p({id:"pregnancyWeightGain.weightBeforeInput",defaultMessage:"What was your weight before pregnancy?"})," ",(0,i.tZ)(l.T,{size:"s4",color:o.r.colors.gray300,as:"span",children:p({id:"pregnancyWeightGain.weightInput.desc",defaultMessage:" (kg)"})})]}),error:m.weightBefore?"":u.weightBefore,name:"pwg-weightBefore",onChange:e=>onWeightBeforeChanged(String(e)),value:""!==t.weightBefore?Number(t.weightBefore):void 0,precision:1,inputMode:"decimal",min:0})}),(0,i.tZ)(c.NI,{children:(0,i.tZ)(r.I.Number,{label:(0,i.BX)(l.T,{size:"s4",as:"label",children:[p({id:"pregnancyWeightGain.heightInput",defaultMessage:"What is your height?"})," ",(0,i.tZ)(l.T,{size:"s4",color:o.r.colors.gray300,as:"span",children:p({id:"bmi.heightInput.desc",defaultMessage:" (cm)"})})]}),error:m.height?"":u.height,name:"pwg-height",value:""!==t.height?Number(t.height):void 0,onChange:e=>onHeightChanged(String(e)),min:0})}),(0,i.tZ)(c.NI,{children:(0,i.tZ)(r.I.Number,{label:(0,i.BX)(l.T,{size:"s4",as:"label",children:[p({id:"pregnancyWeightGain.weightInput",defaultMessage:"How much do you weigh now?"})," ",(0,i.tZ)(l.T,{size:"s4",color:o.r.colors.gray300,as:"span",children:p({id:"pregnancyWeightGain.weightInput.desc",defaultMessage:" (kg)"})})]}),error:m.weight?"":u.weight,name:"pwg-weight",value:""!==t.weight?Number(t.weight):void 0,onChange:e=>onWeightChanged(String(e)),precision:1,inputMode:"decimal",min:0})})]})}},C2TE:function(e,t,a){a.d(t,{C:function(){return QuotationCard}});var i=a("BGKE"),n=a("OAL+"),o=a("Eso5"),r=a("vaps"),l=(0,a("/npG").k)(e=>({root:{backgroundColor:"#fff",boxShadow:e.shadows.sm,borderRadius:e.radius.lg,padding:16},content:{marginRight:-10},authorBox:{textAlign:"right","& > div":{display:"inline-block",verticalAlign:"middle"}},author:{color:"#8c8c8c"},divider:{display:"inline-block",width:12,height:1,backgroundColor:"#8c8c8c",marginRight:8}})),d=a("wp0n"),c=a("C6zW"),s=a("hXNO");let QuotationCard=e=>{let{message:t,name:a,className:h,classNames:g,styles:u,iconColor:p,...m}=e,{classes:f,cx:x}=l(void 0,{name:"QuotationCard",styles:u,classNames:g}),y=(0,s.d)();return(0,i.BX)(n.K,{spacing:8,className:x(f.root,f.root),...m,children:[(0,i.tZ)(c.Z,{size:40,color:p}),(0,i.tZ)(o.x,{className:f.content,children:(0,i.tZ)(r.x,{h:y?168:144,scrollbarSize:6,offsetScrollbars:!0,styles:{thumb:{backgroundColor:"#d9d9d9"}},children:(0,i.tZ)(d.T,{size:"p1",children:t})})}),(0,i.BX)(o.x,{className:f.authorBox,children:[(0,i.tZ)(o.x,{className:f.divider}),(0,i.tZ)(d.T,{size:"p4",as:"div",className:f.author,children:a})]})]})}}}]);