1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5271],{14762:function(t,e,a){var o=a(85893),s=a(67294),r=a(43495),i=a(8193);let n=t=>{let{isOpen:e,type:a,title:n,subText:l,onConfirm:u,onClose:d,autoClose:c,confirmLabel:m="Confirm",cancelLabel:p="Cancel",showConfirmButton:v=!0,showCancelButton:h=!0,showCloseIcon:y=!0}=t,x=(0,s.useRef)(),[_,f]=(0,s.useState)(!0);(0,s.useEffect)(()=>{let t;return e&&c&&(t=setTimeout(d,1e3*c)),()=>clearTimeout(t)},[e,c,d]),(0,s.useEffect)(()=>{let t=t=>{x.current&&!x.current.contains(t.target)&&d()};return e?document.addEventListener("mousedown",t):document.removeEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[e,d]),(0,s.useEffect)(()=>{e&&f(!0)},[e]);let C=async()=>{await u(),f(!1)};return e?(0,o.jsxs)("div",{className:"fixed inset-0 flex items-center justify-center z-[9999] px-4 py-6 sm:px-0 ",children:[(0,o.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity"}),(0,o.jsxs)(r.E.div,{ref:x,className:"bg-white p-6 rounded-xl font-primary shadow-2xl relative z-10 w-full max-w-md ",initial:{opacity:0,y:-50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.5,ease:"easeInOut"},children:[(0,o.jsx)(r.E.div,{className:"absolute inset-x-0 -top-8 flex justify-center",initial:{y:-20,opacity:0},animate:{y:0,opacity:1},transition:{duration:.7,ease:"easeInOut"},children:(0,o.jsx)("div",{className:"bg-white w-20 h-20 rounded-full flex items-center justify-center",children:(()=>{switch(a){case"success":return(0,o.jsx)(i.KP3,{className:"text-green-600 h-10 w-10"});case"error":return(0,o.jsx)(i.SV5,{className:"text-red-600 h-10 w-10"});case"warning":return(0,o.jsx)(i.SR5,{className:"text-yellow-600 h-10 w-10"});case"info":return(0,o.jsx)(i.ocf,{className:"text-blue-600 h-10 w-10"});default:return null}})()})}),y&&(0,o.jsx)("button",{onClick:d,className:"absolute top-3 right-3 text-gray-500 hover:text-gray-700",children:(0,o.jsx)(i.SV5,{className:"h-6 w-6"})}),(0,o.jsxs)("div",{className:"text-center mt-10",children:[(0,o.jsx)("h2",{className:"text-xl md:text-2xl font-semibold",children:n}),(0,o.jsx)("p",{className:"text-gray-600 mt-2",children:l})]}),_&&(h||v)&&(0,o.jsxs)("div",{className:"flex justify-center space-x-4 mt-6",children:[h&&(0,o.jsx)("button",{className:"bg-gray-500 hover:bg-gray-600 text-white px-4 py-2 rounded-full transition-all duration-200 ease-in-out",onClick:d,children:p}),v&&(0,o.jsx)("button",{className:"bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-full transition-all duration-200 ease-in-out",onClick:C,children:m})]}),c&&(0,o.jsx)("div",{className:"mt-6 h-1 w-full bg-gray-100 rounded overflow-hidden relative",children:(0,o.jsx)(r.E.div,{className:"h-full bg-primary absolute left-0 top-0",initial:{width:"0%"},animate:{width:"100%"},transition:{ease:"linear",duration:c}})})]})]}):null};e.Z=n},15268:function(t,e,a){var o=a(87066),s=a(43812);let r=s.BUILDER_URL,i=t=>{let{job_id:e,endpoint:a,payload:i,responseData:n,errorMsg:l}=t,u=JSON.stringify(i),d=JSON.stringify(l),c={responseData:JSON.stringify({job_id:e,endpoint:a,payLoad:u,responseData:n,error:d})};(0,s.isDevelopment)()||o.Z.post("".concat(r,"/error-log"),c).then(t=>{200===t.status&&console.log("Success response",t.data)}).catch(t=>{})};e.Z=i},35271:function(t,e,a){a.r(e),a.d(e,{CartContext:function(){return v},CartProvider:function(){return h}});var o=a(85893),s=a(67294),r=a(82940),i=a(37351),n=a(60017),l=a(85574),u=a(68015),d=a(15268),c=a(14762),m=a(11163),p=a(55678);let v=(0,s.createContext)(),h=t=>{let{children:e}=t,a=(0,m.useRouter)(),[h,y]=(0,s.useState)([]),[x,_]=(0,s.useState)(""),f=(0,s.useContext)(i.ThemeContext),[C,g]=(0,s.useState)(0),[b,S]=(0,s.useState)({}),[w,j]=(0,s.useState)(""),[N,I]=(0,s.useState)(""),[k,E]=(0,s.useState)(2),[L,P]=(0,s.useState)(2),[T,q]=(0,s.useState)(""),[D,Z]=(0,s.use
1State)(4),[O,B]=(0,s.useState)(),[M,J]=(0,s.useState)(""),[R,F]=(0,s.useState)(""),[z,A]=(0,s.useState)(""),[U,V]=(0,s.useState)(),[W,Y]=(0,s.useState)(),[K,Q]=(0,s.useState)(!0),[G,H]=(0,s.useState)(!0),[X,$]=(0,s.useState)(!1),tt=(0,r.b)(),{userId:te,token:ta,websiteStatus:to,userDetails:ts,setMobEnb:tr}=(0,s.useContext)(l.UserContext),{currentCurrency:ti}=(0,s.useContext)(n.CurrencyContext),[tn,tl]=(0,s.useState)(!1),[tu,td]=(0,s.useState)(""),{jboId:tc}=(0,u.useJobId)(),[tm,tp]=(0,s.useState)(""),[tv,th]=(0,s.useState)(""),[ty,tx]=(0,s.useState)(null),[t_,tf]=(0,s.useState)(null),[tC,tg]=(0,s.useState)(null),[tb,tS]=(0,s.useState)(!1),[tw,tj]=(0,s.useState)(!1),[tN,tI]=(0,s.useState)({}),tk=t=>{tI(t),tj(!0)},tE=()=>{tj(!1)},tL=async()=>{var t,e,a,o,s=sessionStorage.getItem("promoStatusCheck"),r=sessionStorage.getItem("prev_status_check"),i=1==s?sessionStorage.getItem("promocode"):"",n=1==r?sessionStorage.getItem("previlageCardvalue"):"";try{let l=3==to&&(null==ts?void 0:ts.user_type)==1?"product/siteCartProduct":"product/getCartProduct",u=await tt.post(l,{user_id:te,token:ta,checkout:0,promo_code:1==s?i:1==r?n:"",privilege_card_status:r?1:2});if(200===u.status){H(!1),y(u.data.product),S(u.data.total),localStorage.setItem("cart",JSON.stringify(u.data.product)),E(u.data.privilege_card_status),sessionStorage.setItem("previlageCardvalue",u.data.privilege_card),J(u.data.taxable_amount),F(u.data.total_quantity),_(null===(t=u.data)||void 0===t?void 0:t.total_u_saved),V(u.data.total_discount),Y(null==u?void 0:null===(e=u.data)||void 0===e?void 0:e.special_discount_price),A(u.data.tax_amount),j(u.data.total_price),tp(u.data.pay_over_counter_enable),tx(u.data.multipayment_enable),tg(u.data.og_value_enable),tS(1==u.data.bnpl_enable),tf(u.data.pickup_enable),th(u.data.is_click_and_collect);let c=(null==u?void 0:null===(a=u.data)||void 0===a?void 0:a.mobile_no_verified)==1;tr(c),u.data.product.map(t=>t.product_id)}$(!1)}catch(v){$(!0);let m=3==to&&(null==ts?void 0:ts.user_type)==1?"product/siteCartProduct":"product/getCartProduct",p=(null==v?void 0:null===(o=v.response)||void 0===o?void 0:o.data)?v.response.data:"";(0,d.Z)({job_id:tc,endpoint:m,payload:{user_id:te,token:ta},responseData:p,errorMsg:v}),H(!1)}},tP=async()=>{try{let t=await tt.post("user/userCartCount",{user_id:te});t.data&&t.data.count?(g(t.data.count),localStorage.setItem("cartCount",t.data.count.toString())):g(0)}catch(o){var e;let a=(null==o?void 0:null===(e=o.response)||void 0===e?void 0:e.data)?o.response.data:"";(0,d.Z)({job_id:tc,endpoint:"user/userCartCount",payload:{user_id:te},responseData:a,errorMsg:o})}};(0,s.useEffect)(()=>{if(te&&"null"!==te&&ta&&1===f.siteStatus){let t=a.pathname;if(tP(),"/Cart"===t||"/checkout/Checkout"===t)tL();else{let e=localStorage.getItem("cart"),o=localStorage.getItem("cartCount");e&&o?(y(JSON.parse(e)),g(Number(o))):tL()}}else y([]),S({}),localStorage.removeItem("cart"),localStorage.removeItem("cartCount")},[te,ta,a.pathname]);let tT=async t=>{let e={user_id:te,token:ta,product_id:t.product_id?t.product_id:t.id,quantity:1};try{let a=await tt.post("user/setaddtocart",e);tl(!0),td(a.data.message),1==a.data.status&&(tL(),tP(),Q(!K))}catch(i){var o;let s={user_id:te,token:ta,product_id:t.product_id?t.product_id:t.id,quantity:1},r=(null==i?void 0:null===(o=i.response)||void 0===o?void 0:o.data)?i.response.data:"";(0,d.Z)({job_id:tc,endpoint:"user/setaddtocart",payload:s,responseData:r,errorMsg:i})}},tq=async t=>{let e={mProductId:null==t?void 0:t.product_id1,product_id:null==t?void 0:t.product_id1,quantity:1};try{var a,o,s;let r=await tt.post("user/setaddtocartQuantity",e);if((null===(a=r.data)||void 0===a?void 0:a.status)===1)tP();else{let i=(null===(o=r.data)||void 0===o?void 0:o.message)||"something went wrong",n="We apologize, but the quantity you've requested has reached its maximum limit for this product"===i,l=n?"Maximum Limit - ".concat(null==r?void 0:null===(s=r.data)||void 0===s?void 0:s.qty," qty: ").concat(i):i;n?p.Am.info(l):p.Am.error(l)}tL()}catch(u){console.error(u)}},tD=(t,e)=>{y(h.map(a=>a.id===t.id?{...a,quantity:e}:a))},tZ=async t=>{let e={user_id:te,product_id:(null==t?void 0:t.mProductId)?null==t?void 0:t.mProductId:t.product_id1||t.id||t.product_id};tk({type:"warning",title:"Are you sure?",subText:"You want to delete this item from your cart?",confirmLabel:"Yes, remove",cancelLabel:"No, keep it",showCloseIcon:!1,onConfirm:async()=>{try{let a=await tt.post("user/removeCart",e);if(1==a.data.status)tL(),tP(),tk({type:"success",title:"Deleted!",subText:"The item has been removed from your cart.",onClose:tE,autoClose:2});else throw Error("Failed to remove from Cart")}catch(i){var o;tL(),tP();let s={user_id:te,product_id:t.id},r=(null==i?void 0:null===(o=i.response)||void 0===o?void 0:o.data)?i.response.data:"";(0,d.Z)({job_id:tc,endpoint:"user/removeCart",payload:s,responseData:r,errorMsg:i}),tk({type:"error",title:"Error!",subText:"Failed to remove the item from your cart.",onClose:tE,autoClose:3})}},onClose:tE})},tO=async t=>{let e={user_id:te,product_id:(null==t?void 0:t.mProductId)?null==t?void 0:t.mProductId:t.product_id1||t.id||t.product_id};try{let a=await tt.post("user/removeCart",e);if(1==a.data.status)tL(),tP(),tk({type:"success",title:"Move to Wishlist!",subText:"The item has been moved to your wishlist.",onClose:tE,autoClose:2,showConfirmButton:!1,showCancelButton:!1});else throw Error("Failed to remove from Cart")}catch(i){var o;tL(),tP();let s={user_id:te,product_id:t.id},r=(null==i?void 0:null===(o=i.response)||void 0===o?void 0:o.data)?i.response.data:"";(0,d.Z)({job_id:tc,endpoint:"user/removeCart",payload:s,responseData:r,errorMsg:i}),tk({type:"error",title:"Error!",subText:"Failed to remove the item from your cart.",onClose:tE,autoClose:3})}};return(0,o.jsxs)(v.Provider,{value:{promoMessageData:N,specialPriceDiscount:W,setTarangDiscountData:_,TarangDiscountData:x,setSpecialPriceDiscount:Y,setLoading:H,setTotalDiscount:V,previlegeCardStatus:k,setPrevilegeCardData:P,previlegeCardData:L,previlegeCardValue:T,promoStatus:D,setPromoStatus:Z,promoStatusData:O,Totaldiscount:U,TotalQuantity:R,loading:G,TaxAmount:z,TotalAmount:M,cartCount:C,cart:h,cartTotal:b,TotalPrice:w,fetchCartCount:tP,cartResponse:tu,fetchCart:tL,addToCart:tT,updateQuantity:tD,removeFromCart:tZ,isSnackbarVisible:tn,errorstate:X,isShowPayOverCounter:tm,isShowPartialPayment:ty,isShowOldGold:tC,isShowPickup:t_,isClickAndCollect:tv,setIsClickAndCollect:th,bookNowPayLaterEnable:tb,removeFromCartDrawer:tO,handleQuantityUpdate:tq},children:[e,(0,o.jsx)(c.Z,{isOpen:tw,type:tN.type,title:tN.title,subText:tN.subText,onConfirm:tN.onConfirm,onClose:tN.onClose,autoClose:tN.autoClose,confirmLabel:tN.confirmLabel,cancelLabel:tN.cancelLabel,showCloseIcon:tN.showCloseIcon,showConfirmButton:tN.showConfirmButton,showCancelButton:tN.showCancelButton})]})}}}]);
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.