PageSourceSearch

https://ancarat.com/_next/static/chunks/1269.7abdd1ea69a55758.js

js ancarat.com collected 2026-10-03 22:41:37 UTC 15,400 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1269],{15091:()=>{},61078:(e,t,i)=>{"use strict";i.d(t,{A:()=>h});var n=i(37876),l=i(14232),r=i(54773),o=i(67578),a=i(68327),s=i(49794),d=i(27888),c=i(87109);i(58953),i(15091);var u=i(82829),p=i(46655);let x=(0,r.Ay)(o.A,{shouldForwardProp:e=>"selected"!==e})(e=>{let{theme:t,selected:i}=e;return{borderRadius:0,display:"flex",alignItems:"center",justifyContent:"center",position:"relative",cursor:"pointer",border:"".concat(1,"px solid ").concat(i?t.palette.primary.dark:t.palette.grey[300]),backgroundColor:"#ffffff",fontWeight:i?600:400,transition:"all 0.2s ease",boxShadow:i?"0 1px 2px rgba(0,0,0,0.05)":"none","&:hover":{backgroundColor:i?"#ffffff":t.palette.grey[200]}}}),h=e=>{let{options:t,selectedId:i,onChange:r,tabWrap:h=!1,isSlide:f=!1,isHideBoder:g=!1,isLoading:v=!1,sx:m}=e,A=(0,l.useRef)(null),b=(0,l.useRef)(null);return v?(0,n.jsx)(o.A,{sx:{display:"flex",gap:1,width:"100%"},children:[void 0,void 0,void 0,void 0].map((e,t)=>(0,n.jsx)(a.A,{variant:"rounded",width:90,height:24,sx:{borderRadius:0,flex:"0 0 auto"}},t))}):f?(0,n.jsx)(o.A,{sx:{display:"flex",position:"relative",width:"100%",overflow:"visible",...m},children:(0,n.jsxs)(o.A,{sx:{position:"relative",width:"100%","& .swiper-slide":{width:"auto"},"& .swiper":{width:"100%"}},children:[(0,n.jsx)(u.r,{ref:A,isLeft:!0}),(0,n.jsx)(u.r,{ref:b,isLeft:!1}),(0,n.jsx)(d.RC,{modules:[c.U1,c.Vx],slidesPerView:"auto",slidesPerGroup:4,spaceBetween:8,freeMode:!0,navigation:{prevEl:A.current,nextEl:b.current},onBeforeInit:e=>{e.params.navigation&&"boolean"!=typeof e.params.navigation&&(e.params.navigation.prevEl=A.current,e.params.navigation.nextEl=b.current)},children:t.map((e,t)=>{let l=e.id===i;return(0,n.jsx)(d.qr,{style:{width:h?"auto":""},children:(0,n.jsx)(o.A,{onClick:()=>r(e.id),sx:{position:"relative",overflow:"hidden",borderRadius:0,cursor:"pointer"},children:(0,n.jsx)(x,{selected:l,onClick:()=>r(e.id),sx:{width:h?"auto":null,minWidth:h?"auto":null,overflow:"hidden",padding:p.A.spacing(.5,l?2:1,.5,1),border:g?"none":"".concat(1,"px solid ").concat(l?p.A.palette.primary.dark:"transparent")},children:(0,n.jsx)(s.A,{component:"span",fontSize:"0.75rem",sx:{fontWeight:l?600:500,px:2},children:e.label})})})},e.id+t)})})]})}):(0,n.jsx)(o.A,{sx:{display:"flex",position:"relative",alignItems:"center",gap:1,flexWrap:"wrap",...m},children:t.map((e,t)=>{let l=e.id===i;return(0,n.jsx)(o.A,{onClick:()=>r(e.id),sx:{position:"relative",overflow:"hidden",borderRadius:0,cursor:"pointer"},children:(0,n.jsx)(x,{selected:l,onClick:()=>r(e.id),sx:{width:h?"auto":null,minWidth:h?"auto":null,padding:p.A.spacing(.25,l?2:1.5,.25,1.5)},children:(0,n.jsx)(s.A,{variant:"subtitle1",component:"span",noWrap:!0,fontSize:"0.75rem",sx:{fontWeight:l?600:400},children:e.label})},t)},t)})})}},91269:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>T});var n=i(37876),l=i(71870),r=i(6995),o=i(5596),a=i(14232),s=i(1800),d=i(78975),c=i(70574),u=i(61078),p=i(46655),x=i(82675),h=i(75308),f=i(12362),g=i(3706),v=i(82014),m=i(2799),A=i(49794),b=i(22474),j=i(89037);let _=e=>{var t,i,l,r,o,a,_,w,C;let{compact:I,handleCloseDialog:y,handleOpenDialog:S,product:R,variant:W,handleVariantChange:k,handleBuyNow:D,handleAddToCart:T,quantity:z,setQuantity:M}=e,B=null!=W?W:R.variant;return(0,n.jsxs)(m.A,{sx:{width:"100%",margin:"0 auto",position:"fixed",bottom:0,left:0,right:0,padding:"8px 16px 16px 16px",borderTopLeftRadius:p.A.spacing(1.5),borderTopRightRadius:p.A.spacing(1.5),borderBottomLeftRadius:0,borderBottomRightRadius:0,backgroundColor:p.A.palette.background.paper,boxShadow:p.A.shadows[3],zIndex:h.Mu.MOBILE_QUICK_ACTIONS},children:[(0,n.jsx)(j.A,{sx:{position:"absolute",top:-16,right:16},children:(0,n.jsx)(c.A,{src:I?f.I.IC_UP_CIRCLE:f.I.IC_DOWN_CIRCLE,alt:"up",boxWidth:32,boxHeight:32,onClick:()=>I?S():y()})}),!I&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(j.A,{sx:{display:"flex",alignItems:"center",gap:p.A.spacing(2),marginBottom:p.A.spacing(1.5)},children:[(0,n.jsx)(c.A,{src:null!=(i=R.image)?i:"",alt:null!=(r=null!=(l=R.name)?l:R.show_name)?r:"",boxWidth:96,boxHeight:96,objectFit:"cover",priority:!0,sx:{transition:"all 0.3s ease-in-out"}},R.image),(0,n.jsxs)(j.A,{flex:1,children:[(0,n.jsx)(A.A,{className:"text-line","data-lines":2,sx:{fontSize:16,fontWeight:700,color:p.A.palette.text.primary}
1,children:(0,v.Wy)(R)}),(0,n.jsxs)(A.A,{sx:{color:p.A.palette.primary.main,fontWeight:700,fontSize:18},children:[(0,g.v)(null==B?void 0:B.effective_price)," ",(0,n.jsxs)("span",{style:{fontSize:13},children:["/",null==B?void 0:B.unit]})]}),(null==B?void 0:B.effective_price)&&(null==B?void 0:B.effective_price)!==(null==B?void 0:B.price)&&(0,n.jsx)(A.A,{sx:{color:p.A.palette.text.disabled,fontSize:13,fontWeight:600,textDecoration:"line-through"},children:(0,g.v)(null==B?void 0:B.price)})]})]}),R.variants&&R.variants.length>0&&(0,n.jsxs)(j.A,{sx:{mt:1,mb:3,display:"flex",flexDirection:"column",alignItems:"flex-start",gap:1},children:[R.variants.length>1&&(0,n.jsx)(A.A,{sx:{fontWeight:600,whiteSpace:"nowrap",fontSize:"0.875rem"},children:"Chọn đơn vị:"}),(0,n.jsx)(u.A,{options:(null==(t=R.variants)?void 0:t.map(e=>{var t,i;return{id:null!=(t=e.product_variant_id)?t:"",label:null!=(i=e.name)?i:""}}))||[],selectedId:null!=(o=null==W?void 0:W.product_variant_id)?o:"",onChange:e=>{var t;let i=null==(t=R.variants)?void 0:t.find(t=>t.product_variant_id===e);i&&k&&k(i)},tabWrap:!0})]}),(0,n.jsx)(d.A,{initialValue:z,onChange:M})]}),(null==W?void 0:W.is_sellable)&&(null==W?void 0:W.is_sellable_web)?(0,n.jsxs)(b.A,{direction:"row",spacing:2,mt:2,children:[(0,n.jsx)(s.A,{fullWidth:!0,disabled:!(null!=(_=null!=(a=null==W?void 0:W.effective_price)?a:null==W?void 0:W.price)?_:0),onClick:()=>D(I),children:"Mua ngay"}),(0,n.jsx)(s.A,{fullWidth:!0,disabled:!(null!=(C=null!=(w=null==W?void 0:W.effective_price)?w:null==W?void 0:W.price)?C:0),onClick:()=>T(I),variant:"outlined",startIcon:(0,n.jsx)(c.A,{src:f.I.IC_ADD_TO_CART,alt:"cart",boxWidth:20,boxHeight:20,priority:!0,svgColor:x.l.PRIMARY_MAIN}),children:"Th\xeam v\xe0o giỏ h\xe0ng"})]}):(0,n.jsx)(j.A,{sx:{display:"flex",alignItems:"center",justifyContent:"center",py:1.75,px:2,backgroundColor:"#f5f5f5",border:"1px solid #e0e0e0",borderRadius:1},children:(0,n.jsx)(A.A,{sx:{fontSize:"0.875rem",color:"text.secondary",fontWeight:600},children:"Li\xean hệ"})})]})};var w=i(67578),C=i(54773);let I=(0,C.Ay)(w.A)({display:"flex",gap:5.555,justifyContent:"flex-end",alignItems:"center"}),y=(0,C.Ay)(w.A)({background:"#fff",borderRadius:8,color:"#000",textAlign:"center",width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center"}),S=e=>{let{endAt:t,startAt:i,showText:l=!0,titlePosition:r="top",titleAlign:o="center",titleStyle:s,timeBoxStyle:d,isDivider:c=!0}=e,[u,p]=(0,a.useState)(0),[x,h]=(0,a.useState)(0),f=(0,a.useRef)(),g=(0,a.useRef)(),v=()=>{let e=i?new Date(i).getTime():0,n=t?Math.floor(new Date(t).getTime()/1e3):0;if(t&&(null==t?void 0:t.trim())!=""&&e<=Date.now()){let e=()=>{let t=Math.max(0,n-Math.floor(Date.now()/1e3));p(t),t>0&&(f.current=setTimeout(e,1e3))};f.current&&clearTimeout(f.current),e()}else p(0)},m=()=>{let e=i?Math.floor(new Date(i).getTime()/1e3):0;if(i&&""!=i.trim()&&new Date(i).getTime()>Date.now()){let t=()=>{let i=Math.max(0,e-Math.floor(Date.now()/1e3));h(i),i>0&&(g.current=setTimeout(t,1e3))};g.current&&clearTimeout(g.current),t()}else h(0)};if((0,a.useEffect)(()=>(v(),m(),()=>{f.current&&clearTimeout(f.current),g.current&&clearTimeout(g.current)}),[t,i]),(!t||""===t.trim())&&(!i||""===i.trim())||t&&u<=0&&i&&x<=0)return null;let b=i&&x>0?x:t&&u>0?u:0;return(0,n.jsxs)(w.A,{display:"flex",flexDirection:"top"===r?"column":"row",justifyContent:"space-between",alignItems:o,gap:1,children:[(0,n.jsx)(A.A,{fontSize:"0.75rem",fontWeight:600,sx:s,children:i&&x>0?"Bắt đầu sau:":t&&u>0?"Kết th\xfac sau:":"Đ\xe3 kết th\xfac"}),(0,n.jsx)(I,{children:[{label:"ng\xe0y",value:Math.floor(b/86400),disabled:b<86400},{label:"giờ",value:Math.floor(b/3600%24)},{label:"ph\xfat",value:Math.floor(b%3600/60)},{label:"gi\xe2y",value:Math.floor(b%60)}].map((e,t,i)=>e.disabled?null:(0,n.jsxs)(a.Fragment,{children:[(0,n.jsxs)(y,{sx:d,children:[(0,n.jsx)(A.A,{fontSize:"0.85rem",fontWeight:"bold",children:e.value.toString().padStart(2,"0")}),l&&(0,n.jsx)(A.A,{fontSize:"0.55rem",children:e.label})]}),t<i.length-1&&c&&(0,n.jsx)(A.A,{fontSize:"0.85rem",fontWeight:"bold",children:":"})]},e.label))})]})},R=e=>{var t,i,l,r,o,a,_,w;let{compact:C,handleCloseDialog:I,handleOpenDialog:y,product:R,variant:W,handleVariantChange:k,handleBuyNow:D,handleAddToCart:T,quantity:z,setQuantity:M}=e,B=null!=W?W:R.variant;return(0,n.jsxs)(m.A,{sx:{width:"100%",margin:"0 auto",position:"fixed",bottom:0,left:0,right:0,padding:"16px 12px",borderTopLeftRadius:p.A.spacing(1.5),borderTopRightRadius:p.A.spacing(1.5),borderBottomLeftRadius:0,borderBottomRightRadius:0,backgroundColor:C?"#2238B4":"white",boxShadow:p.A.shadows[3],zIndex:h.Mu.MOBILE_QUICK_ACTIONS,backgroundImage:C?"url(".concat(f.I.IMG_FLASH_SALE_QUICK_ACTION_BG,")"):"none",backgroundSize:"100% 100%",backgroundPosition:"center",backgroundRepeat:"no-repeat",overflow:"visible"},children:[(0,n.jsx)(j.A,{sx:{position:"absolute",top:-16,right:16,zIndex:9999},children:(0,n.jsx)(c.A,{src:C?f.I.IC_UP_CIRCLE:f.I.IC_DOWN_CIRCLE,alt:"up",boxWidth:32,boxHeight:32,onClick:()=>C?y():I()})}),(0,n.jsxs)(b.A,{direction:"row",justifyContent:"space-between",alignItems:"center",px:1,py:1,mt:1,mb:2,sx:{backgroundImage:C?"none":"url(".concat(f.I.IMG_FLASH_SALE_QUICK_ACTION_BG,")"),backgroundSize:"100% 100%",backgroundPosition:"center",backgroundRepeat:"no-repeat"},children:[(0,n.jsxs)(j.A,{sx:{display:"flex",alignItems:"center",gap:p.A.spacing(1)},children:[(0,n.jsx)(c.A,{src:f.I.IC_FLASH_SALE_ROUND,alt:"flashsale",boxWidth:24,boxHeight:24}),(0,n.jsx)(A.A,{color:"#FFF9D9",variant:"h5",sx:{fontSize:"18px",fontWeight:900,whiteSpace:"nowrap"},children:"Flash Sale"})]}),(0,n.jsx)(S,{endAt:null!=(l=null==W||null==(t=W.flash_sale)?void 0:t.end_at)?l:"",showText:!1,titlePosition:"start",isDivider:!1,titleStyle:{fontSize:"12px",color:"#fff"},timeBoxStyle:{width:24,height:24}})]}),!C&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(j.A,{sx:{display:"flex",alignItems:"center",gap:p.A.spacing(2),marginBottom:p.A.spacing(1.5)},children:(0,n.jsxs)(j.A,{flex:1,children:[(0,n.jsx)(A.A,{variant:"h5",className:"text-line","data-lines":2,sx:{color:p.A.palette.text.primary}
1,children:(0,v.Wy)(R)}),(0,n.jsx)(A.A,{variant:"body1",className:"text-line","data-lines":2,sx:{fontWeight:400},children:(0,v.QZ)(R.description)}),(0,n.jsxs)(b.A,{direction:"row",mt:1,gap:0,alignItems:"flex-end",children:[(0,n.jsx)(A.A,{sx:{color:p.A.palette.primary.main,fontWeight:700,fontSize:24,lineHeight:.9},children:(0,g.v)(null==B?void 0:B.effective_price)}),(0,n.jsxs)(A.A,{sx:{color:p.A.palette.primary.main,fontWeight:700,fontSize:14,lineHeight:1},children:["/",null==B?void 0:B.unit]}),(null==B?void 0:B.effective_price)&&(null==B?void 0:B.effective_price)!==(null==B?void 0:B.price)&&(0,n.jsx)(A.A,{fontSize:16,fontWeight:700,lineHeight:1,mx:1,sx:{color:p.A.palette.text.disabled,textDecoration:"line-through"},children:(0,g.v)(null==B?void 0:B.price)}),(0,n.jsx)(j.A,{sx:{display:"inline-flex",alignItems:"center",background:"linear-gradient(90deg, #FA4D40 0%, #D11E10 100%)",borderTopLeftRadius:"1rem",borderBottomRightRadius:"1rem",color:"#fff",fontWeight:600,fontSize:"0.75rem",justifyContent:"center",boxShadow:"0 2px 8px 0 rgba(217,0,0,0.10)",letterSpacing:0,userSelect:"none",px:1,py:.25},children:null==W?void 0:W.discount_text})]})]})}),(0,n.jsx)(A.A,{sx:{fontWeight:600,whiteSpace:"nowrap",fontSize:"0.875rem",mb:1},children:"Số lượng:"}),(0,n.jsx)(d.A,{initialValue:z,onChange:M}),R.variants&&R.variants.length>0&&(0,n.jsxs)(j.A,{sx:{mt:2,mb:2,display:"flex",flexDirection:"column",alignItems:"flex-start",gap:1},children:[R.variants.length>1&&(0,n.jsx)(A.A,{sx:{fontWeight:600,whiteSpace:"nowrap",fontSize:"0.875rem"},children:"Chọn đơn vị:"}),(0,n.jsx)(u.A,{options:(null==(i=R.variants)?void 0:i.map(e=>{var t,i;return{id:null!=(t=e.product_variant_id)?t:"",label:null!=(i=e.name)?i:""}}))||[],selectedId:null!=(r=null==W?void 0:W.product_variant_id)?r:"",onChange:e=>{var t;let i=null==(t=R.variants)?void 0:t.find(t=>t.product_variant_id===e);i&&k&&k(i)},tabWrap:!0})]})]}),(0,n.jsxs)(j.A,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",mt:1,gap:C?4:1,children:[C&&(0,n.jsxs)(j.A,{flex:2,sx:{display:"flex",flexDirection:"column",gap:p.A.spacing(1)},children:[(null==B?void 0:B.effective_price)&&(null==B?void 0:B.effective_price)!==(null==B?void 0:B.price)&&(0,n.jsxs)(b.A,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:p.A.spacing(2)},children:[(0,n.jsx)("span",{style:{color:p.A.palette.text.disabled,fontSize:"0.875rem",fontWeight:700,textDecoration:"line-through",display:"flex",alignItems:"center",gap:p.A.spacing(1)},children:(0,g.v)(null==B?void 0:B.price)}),(0,n.jsx)(A.A,{sx:{fontSize:"0.75rem",fontWeight:700,background:x.l.BG_GRADIENT_DISCOUNT_BADGE,borderTopLeftRadius:"1rem",borderBottomRightRadius:"1rem",color:"white",padding:"2px 12px"},children:null==B?void 0:B.discount_text})]}),(0,n.jsxs)(A.A,{variant:"h4",sx:{color:"#fff",fontWeight:700,whiteSpace:"nowrap"},children:[(0,g.v)(null==B?void 0:B.effective_price)," / ",null==B?void 0:B.unit]})]}),(0,n.jsx)(s.A,{fullWidth:!0,disabled:!(null!=(a=null!=(o=null==B?void 0:B.effective_price)?o:null==B?void 0:B.price)?a:0),sx:{backgroundColor:C?"#fff":x.l.PRIMARY_MAIN,color:C?x.l.PRIMARY_MAIN:"#fff",height:"40px"},onClick:()=>D(C),children:"Mua ngay"}),!C&&(0,n.jsx)(s.A,{fullWidth:!0,disabled:!(null!=(w=null!=(_=null==B?void 0:B.effective_price)?_:null==B?void 0:B.price)?w:0),onClick:()=>T(C),variant:"outlined",startIcon:(0,n.jsx)(c.A,{src:f.I.IC_ADD_TO_CART,alt:"cart",boxWidth:24,boxHeight:24,priority:!0,svgColor:x.l.PRIMARY_MAIN}),children:"Th\xeam v\xe0o giỏ h\xe0ng"})]})]})};var W=i(12950),k=i(55744);let D=(0,a.forwardRef)(function(e,t){return(0,n.jsx)(l.A,{direction:"up",ref:t,...e})});function T(e){let{product:t,variant:i,handleVariantChange:l,loadingVariant:s}=e,d=(0,k.j)(),c=(0,r.A)(e=>e.breakpoints.down("lg")),[u,p]=(0,a.useState)(!1),[x,h]=(0,a.useState)(1);if(!c)return null;let f=e=>{if(e)v();else{if(!(null==i?void 0:i.product_variant_id))return;d((0,W.v8)({product_variant_id:i.product_variant_id,quantity:x}))}},g=e=>{if(e)v();else{if(!(null==i?void 0:i.product_variant_id))return;d((0,W.bE)({product_variant_id:i.product_variant_id,quantity:x}))}},v=()=>{p(!0)},m=()=>{p(!1)},A=e=>{let{compact:r=!1}=e;return(null==i?void 0:i.flash_sale)?(0,n.jsx)(R,{compact:r,handleCloseDialog:m,handleOpenDialog:v,product:t,variant:i,handleVariantChange:l,handleBuyNow:f,handleAddToCart:g,quantity:x,setQuantity:h}):(0,n.jsx)(_,{compact:r,handleCloseDialog:m,handleOpenDialog:v,product:t,variant:i,handleVariantChange:l,handleBuyNow:f,handleAddToCart:g,quantity:x,setQuantity:h})};return(0,n.jsxs)(n.Fragment,{children:[!u&&(0,n.jsx)(A,{compact:!0}),(0,n.jsx)(o.A,{open:u,onClose:m,TransitionComponent:D,PaperProps:{sx:{margin:0,borderRadius:"16px 16px 0 0",position:"fixed",bottom:0,left:0,right:0,width:"100%",maxWidth:"100%",height:"auto",boxShadow:3}},hideBackdrop:!1,fullScreen:!1,maxWidth:!1,children:(0,n.jsx)(A,{compact:!1})})]})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.