"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9393],{83895:function(e,t,s){s.d(t,{R:function(){return l}});var r=s(57437),i=s(11444),a=s(70003);let l=e=>{var t;let{isCOD:s,isStorePickup:l=!1}=e,{cartData:n,dynamicPrice:d}=(0,i.v9)(e=>e.cart),{codCharge:o}=(0,i.v9)(e=>e.common);return n?(0,r.jsxs)("div",{className:"",children:[(0,r.jsxs)("div",{className:"mb-3 flex justify-between",children:[(0,r.jsx)("p",{className:"text-md text-gray-700",children:"Sub Total"}),(0,r.jsx)("p",{className:"text-md font-medium text-default-700",children:(0,r.jsx)(a.Z,{string:"AED ".concat(null===(t=d.totalProductPrice)||void 0===t?void 0:t.toFixed(2))})})]}),d.totalDiscountAmount?(0,r.jsxs)("div",{className:"mb-3 flex justify-between",children:[(0,r.jsx)("p",{className:"text-md text-gray-700",children:"Cart Discount"}),(0,r.jsx)("p",{className:"text-md font-medium text-green-600",children:(0,r.jsx)(a.Z,{string:"AED ".concat(d.totalDiscountAmount.toFixed(2))})})]}):null,d.totalCouponAmount?(0,r.jsxs)("div",{className:"mb-3 flex justify-between",children:[(0,r.jsx)("p",{className:"text-md text-gray-700",children:"Coupon Discount"}),(0,r.jsx)("p",{className:"text-md font-medium text-green-600",children:(0,r.jsx)(a.Z,{string:"AED ".concat(d.totalCouponAmount.toFixed(2))})})]}):null,n.paymentMethodCharge?(0,r.jsxs)("div",{className:"mb-3 flex justify-between",children:[(0,r.jsx)("p",{className:"text-md text-gray-700",children:"Payment Method Charges"}),(0,r.jsx)("p",{className:"text-md font-medium text-default-700",children:(0,r.jsx)(a.Z,{string:"AED ".concat(n.paymentMethodCharge.toFixed(2))})})]}):null,n.totalGiftWrapAmount?(0,r.jsxs)("div",{className:"mb-3 flex justify-between",children:[(0,r.jsx)("p",{className:"text-md text-gray-700",children:"Gift Wrap Charges"}),(0,r.jsx)("p",{className:"text-md font-medium text-default-700",children:(0,r.jsx)(a.Z,{string:"  AED ".concat(n.totalGiftWrapAmount.toFixed(2))})})]}):null,l?null:(0,r.jsxs)("div",{className:"mb-3 flex justify-between",children:[(0,r.jsx)("p",{className:"text-md text-gray-700",children:"Delivery Charges"}),(0,r.jsx)("p",{className:"text-md font-medium text-default-700",children:(null==n?void 0:n.totalShippingAmount)?(0,r.jsx)(a.Z,{string:"AED  ".concat(n.totalShippingAmount.toFixed(2))||0}):(0,r.jsx)("span",{className:"text-green-600",children:(0,r.jsx)(a.Z,{string:"Free"})})})]}),s?(0,r.jsxs)("div",{className:"mb-3 flex justify-between",children:[(0,r.jsx)("p",{className:"text-md text-gray-700",children:"COD Charges"}),(0,r.jsx)("p",{className:"text-md font-medium text-default-700",children:o&&o.length?(0,r.jsx)(a.Z,{string:"AED  ".concat(Number(o).toFixed(2))||0}):(0,r.jsx)("span",{className:"text-green-600",children:(0,r.jsx)(a.Z,{string:"Free"})})})]}):null,(0,r.jsx)("div",{className:"my-4 border-b border-default-200"}),(0,r.jsxs)("div",{className:"mb-0 flex justify-between",children:[(0,r.jsxs)("p",{className:"text-base text-grey-900",children:["Total"," ",(0,r.jsx)("span",{className:"text-[9px] text-gray-500",children:"(Inclusive of vat)"})]}),(0,r.jsx)("p",{className:"text-base font-bold text-default-700",children:(0,r.jsx)(a.Z,{string:"AED ".concat(s?(Number(o)+d.totalAmount).toFixed(2):d.totalAmount.toFixed(2))})})]})]}):null};t.Z=()=>{let{cartData:e,cartItemCount:t,dynamicPrice:s}=(0,i.v9)(e=>e.cart);return t?(0,r.jsx)("div",{className:"w-full flex-grow max-h-full bg-gray-100",children:(0,r.jsxs)("div",{className:" border border-default-200 p-5",children:[(0,r.jsx)("h4",{className:"mb-5 text-lg font-semibold text-default-800",children:"Cart Total"}),(0,r.jsx)(l,{})]})}):null}},32968:function(e,t,s){s.d(t,{Z:function(){return y}});var r=s(57437),i=s(20392),a=s(2265),l=s(11444),n=s(95956),d=s(40328),o=s(99065);let c=async(e,t,s,r,i,a)=>{r((0,d.Xq)({quantity:e,slug:t,quantityChange:s})).then(e=>{"fulfilled"===e.meta.requestStatus?i&&i(e.payload.message):a&&a(e.payload.message)})},u=(0,o.Et)(c,500);var m=e=>{let{orderQuantity:t,slug:s,maxQuantity:i=0,minQuantity:d=1,stock:o=0}=e,[c,m]=(0,a.useState)(t),x=(0,l.I0)(),h=()=>{m(e=>{let t=Math.min(Math.max(e-1,d),o);return t!==e&&u(t,s,!0,x,e=>n.Am.success(e),t=>{m(e),n.Am.error(t)}),t})},g=async()=>{m(e=>{let t=e+1;return t!==e&&u(t,s,!0,x,e=>n.Am.success(e),t=>{m(e),n.Am.error(t)}),t})};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>h(),children:(0,r.jsx)("span",{className:"text-dark text-base",children:(0,r.jsx)("svg",{stroke:"currentColor",fill:"none",strokeWidth:2,viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("line",{x1:5,y1:12,x2:19,y2:12})})})}),(0,r.jsx)("p",{className:"text-sm font-semibold text-dark px-1",children:c}),(0,r.jsx)("button",{onClick:()=>g(),children:(0,r.jsx)("span",{className:"text-dark text-base",children:(0,r.jsxs)("svg",{stroke:"currentColor",fill:"none",strokeWidth:2,viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("line",{x1:12,y1:5,x2:12,y2:19}),(0,r.jsx)("line",{x1:5,y1:12,x2:19,y2:12})]})})})]})},x=s(44774),h=s(47342),g=s(16463),p=s(81595),v=s(10518),f=e=>{let{slug:t,variantSku:s}=e,i=(0,l.I0)(),{isAuthenticated:d}=(0,l.v9)(e=>e.auth),{wishlistListData:o}=(0,l.v9)(e=>e.wishlist),[c,u]=(0,a.useState)(!1),m=(0,g.useRouter)(),x=()=>!!(0,v.kj)(t,s,o);(0,a.useEffect)(()=>{o&&o.length&&x()?u(!0):u(!1)},[t,s,o,d]);let h=()=>{if(d){let e=x();i((0,p.Mp)({slug:t,sku:s})).then(t=>{"fulfilled"===t.meta.requestStatus?(n.Am.success(e?"Removed from wishlist":"Added to wishlist"),i((0,p.bH)())):n.Am.error(t.payload.message)})}else m.push("/login")};return(0,r.jsxs)("button",{className:"flex items-center justify-center gap-1 group px-2 py-1 text-sm font-bold text-center text-gray-500 transition-all duration-200 hover:text-[#0d4c92]  hover:bg-[#ef9bc2] ",onClick:()=>{h()},children:[(0,r.jsx)("svg",{className:"w-[18px]  group-hover:fill-[#0d4c92] ".concat(c?"fill-[#0d4c92]":"fill-gray-500"),id:"fi_13369080",enableBackground:"new 0 0 100 100",viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{id:"Add_to_Favorite",d:"m50 91c-2.733 0-5.306-1.065-7.242-2.999v-.001l-33.129-33.129c-4.919-4.919-7.629-11.459-7.629-18.417v-.407c0-6.958 2.71-13.499 7.629-18.417s11.461-7.63 18.416-7.63h.41c6.955 0 13.497 2.71 18.416 7.629l3.129 3.129 3.129-3.129c4.919-4.919 11.461-7.629 18.416-7.629h.41c6.955 0 13.497 2.71 18.416 7.629s7.629 11.459 7.629 18.417v.407c0 6.958-2.71 13.499-7.629 18.417l-33.129 33.13c-1.936 1.935-4.509 3-7.242 3zm-3-7.242c1.608 1.605 4.395 1.601 6-.001l33.129-33.127c3.785-3.788 5.871-8.821 5.871-14.176v-.407c0-5.355-2.086-10.389-5.871-14.175s-8.821-5.872-14.174-5.872h-.41c-5.353 0-10.389 2.084-14.174 5.871l-5.25 5.25c-1.172 1.172-3.07 1.172-4.242 0l-5.25-5.25c-3.785-3.787-8.821-5.871-14.174-5.871h-.41c-5.353 0-10.389 2.084-14.174 5.871s-5.871 8.82-5.871 14.175v.407c0 5.355 2.086 10.389 5.871 14.175z"})}),(0,r.jsx)("span",{className:"text-[10px]",children:c?"Remove from Wishlist":"Add to Wishlist"})]})},j=s(70003),y=e=>{let{isCheckout:t,isCartPage:s,onClickProductItem:a}=e,o=(0,l.I0)(),{products:c,cartItemCount:u}=(0,l.v9)(e=>e.cart),p=(0,g.useRouter)(),v=e=>e&&e.length?e.map(e=>{var t;return"".concat(null==e?void 0:e.attributeTitle,": ").concat(null==e?void 0:null===(t=e.attributeDetail)||void 0===t?void 0:t.itemName)}):[],y=e=>{let t=v(e);return t&&t.length?t.join(" | "):""};return u?(0,r.jsx)("div",{className:"bg-white ",children:c.map(e=>s?(0,r.jsxs)("div",{className:"gap-4 border-b mb-6 pb-3",children:[(0,r.jsxs)("div",{className:"flex gap-2 items-start",children:[e.imageUrl?(0,r.jsx)(i.Z,{src:e.imageUrl,className:"max-h-20 max-w-20 w-ful rounded-lg ",alt:"",placeHolderImg:"/images/product-placeholder.jpg"}):(0,r.jsx)(x.Z,{variant:"rectangular",className:"max-h-20 max-w-20 w-ful rounded-lg "}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("div",{className:"cursor-pointer",onClick:()=>{e&&(null==e?void 0:e.slug)&&(null==e?void 0:e.variantSku)&&(p.push("/product-details/".concat(null==e?void 0:e.slug,"/").concat(encodeURIComponent(null==e?void 0:e.variantSku))),a&&a())},children:(0,r.jsx)("h3",{className:"text-xs lg:text-xs font-semibold text-gray-900",children:e.title})}),(0,r.jsx)("span",{className:"text-xs text-gray-400 mb-1",children:(0,r.jsx)(j.Z,{string:y(null==e?void 0:e.variantAttributes)})}),(0,r.jsx)("div",{className:"h-8 w-22 mt-2 md:w-24 lg:w-24 flex flex-wrap items-center justify-evenly p-1 border border-gray-100 bg-white text-gray-600 rounded-md",children:(0,r.jsx)(m,{orderQuantity:null==e?void 0:e.quantity,slug:null==e?void 0:e.slug,maxQuantity:e.maxQuantity,minQuantity:e.minQuantity,stock:e.stock})})]}),(0,r.jsx)("div",{className:"flex items-center",children:(0,r.jsx)("div",{className:"w-full flex items-end justify-between lg:justify-between lg:pt-0 lg:max-w-md space-x-2",children:e.discountAmount?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("span",{className:"text-red-600 font-semibold roboto-medium",children:["AED ",(e.listPrice*e.quantity).toFixed(2)]}),(0,r.jsxs)("span",{className:"text-gray-600 line-through font-semibold roboto-medium ml-1",children:["AED ",(e.price*e.quantity).toFixed(2)]})]}):(0,r.jsxs)("span",{className:"text-red-600 font-semibold roboto-medium",children:["AED ",(e.listPrice*e.quantity).toFixed(2)]})})})]}),(0,r.jsxs)("div",{className:"flex space-x-2 itemms-center lg:justify-end justify-between pt-3",children:[(0,r.jsx)(f,{slug:e.slug,variantSku:e.variantSku}),(0,r.jsxs)("button",{className:"flex items-center justify-center gap-1 group px-2 py-1 text-sm font-bold text-center text-gray-500 transition-all duration-200 hover:text-[#0d4c92]  hover:bg-[#ef9bc2] ",onClick:async()=>{e.slug?o((0,d.Xq)({quantity:0,slug:e.slug})).then(e=>{if("fulfilled"===e.meta.requestStatus)n.Am.success(e.payload.message);else{var t;n.Am.error(null!==(t=e.payload.message)&&void 0!==t?t:h.tU.SOMETHING_WENT_WRONG)}}):n.Am.error(h.tU.SOMETHING_WENT_WRONG)},children:[(0,r.jsx)("svg",{className:"w-[18px] fill-gray-500 group-hover:fill-[#0d4c92]",id:"fi_3096673",enableBackground:"new 0 0 512 512",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsxs)("g",{children:[(0,r.jsx)("path",{d:"m424 64h-88v-16c0-26.467-21.533-48-48-48h-64c-26.467 0-48 21.533-48 48v16h-88c-22.056 0-40 17.944-40 40v56c0 8.836 7.164 16 16 16h8.744l13.823 290.283c1.221 25.636 22.281 45.717 47.945 45.717h242.976c25.665 0 46.725-20.081 47.945-45.717l13.823-290.283h8.744c8.836 0 16-7.164 16-16v-56c0-22.056-17.944-40-40-40zm-216-16c0-8.822 7.178-16 16-16h64c8.822 0 16 7.178 16 16v16h-96zm-128 56c0-4.411 3.589-8 8-8h336c4.411 0 8 3.589 8 8v40c-4.931 0-331.567 0-352 0zm313.469 360.761c-.407 8.545-7.427 15.239-15.981 15.239h-242.976c-8.555 0-15.575-6.694-15.981-15.239l-13.751-288.761h302.44z"}),(0,r.jsx)("path",{d:"m256 448c8.836 0 16-7.164 16-16v-208c0-8.836-7.164-16-16-16s-16 7.164-16 16v208c0 8.836 7.163 16 16 16z"}),(0,r.jsx)("path",{d:"m336 448c8.836 0 16-7.164 16-16v-208c0-8.836-7.164-16-16-16s-16 7.164-16 16v208c0 8.836 7.163 16 16 16z"}),(0,r.jsx)("path",{d:"m176 448c8.836 0 16-7.164 16-16v-208c0-8.836-7.164-16-16-16s-16 7.164-16 16v208c0 8.836 7.163 16 16 16z"})]})}),(0,r.jsx)("span",{className:"text-[10px]",children:" Remove"})]})]})]},null==e?void 0:e._id):(0,r.jsxs)("div",{className:"group w-full h-auto flex justify-start items-center py-3 px-4 border-b transition-all\n             relative last:border-b-0 ".concat(0===e.stock?"bg-red-100 border border-red-400 border-dashed hover:bg-red-200 text-red-600":"bg-white border-gray-100 hover:bg-gray-200"),children:[(0,r.jsx)("div",{className:"relative flex border border-gray-100 shadow-sm overflow-hidden flex-shrink-0 mr-3",children:e.imageUrl?(0,r.jsx)(i.Z,{src:e.imageUrl,width:40,height:50,alt:"",placeHolderImg:"/images/product-placeholder.jpg"}):(0,r.jsx)(x.Z,{variant:"rectangular",width:40,height:50})}),(0,r.jsxs)("div",{className:"flex flex-col w-full overflow-hidden",children:[(0,r.jsx)("div",{className:"mukta-regular text-sm font-medium text-gray-700 text-heading cursor-pointer",onClick:()=>{e&&(null==e?void 0:e.slug)&&(null==e?void 0:e.variantSku)&&(p.push("/product-details/".concat(null==e?void 0:e.slug,"/").concat(encodeURIComponent(null==e?void 0:e.variantSku))),a&&a())},children:e.title}),(0,r.jsx)("span",{className:"text-xs text-gray-400 mb-1",children:(0,r.jsx)(j.Z,{string:y(null==e?void 0:e.variantAttributes)})}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("p",{className:"text-sm font-semibold text-dark",children:["Qty: ",e.quantity]}),(0,r.jsx)("div",{className:"font-bold text-sm text-heading leading-5 ",children:e.discountAmount?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("span",{className:"text-[#0d4c92] roboto-medium",children:["AED ",(e.listPrice*e.quantity).toFixed(2)]}),(0,r.jsxs)("span",{className:"text-gray-400 line-through text-tiny roboto-medium ml-1",children:["AED ",(e.price*e.quantity).toFixed(2)]})]}):(0,r.jsxs)("span",{className:"text-[#0d4c92] roboto-medium",children:["AED ",(e.listPrice*e.quantity).toFixed(2)]})}),t?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"h-8 w-22 md:w-24 lg:w-24 flex flex-wrap items-center justify-evenly p-1 border border-gray-100 bg-white text-gray-600 rounded-md",children:(0,r.jsx)(m,{orderQuantity:null==e?void 0:e.quantity,slug:null==e?void 0:e.slug,maxQuantity:e.maxQuantity,minQuantity:e.minQuantity,stock:e.stock})}),(0,r.jsx)("button",{className:"hover:text-red-600 text-red-400 text-lg cursor-pointer",onClick:()=>{e.slug?o((0,d.Xq)({quantity:0,slug:e.slug})).then(e=>{if("fulfilled"===e.meta.requestStatus)n.Am.success(e.payload.message);else{var t;n.Am.error(null!==(t=e.payload.message)&&void 0!==t?t:h.tU.SOMETHING_WENT_WRONG)}}):n.Am.error(h.tU.SOMETHING_WENT_WRONG)},children:(0,r.jsxs)("svg",{stroke:"currentColor",fill:"none",strokeWidth:2,viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,r.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,r.jsx)("line",{x1:10,y1:11,x2:10,y2:17}),(0,r.jsx)("line",{x1:14,y1:11,x2:14,y2:17})]})})]})]})]})]},e._id))}):(0,r.jsx)("div",{className:"text-center pt-3",children:"Your cart is empty!"})}},72514:function(e,t,s){s.d(t,{B0:function(){return u},E$:function(){return n},Nh:function(){return o},S3:function(){return a},Wb:function(){return x},c7:function(){return m},ht:function(){return h},ml:function(){return c},vL:function(){return l},yr:function(){return d}});var r=s(14245);let i=/^971\d{9}$|^0\d{9}$/,a=r.Ry().shape({name:r.Z_().required("Name is Required"),email:r.Z_().email("Invalid email").required("Email is Required"),phone:r.Z_().matches(i,"Phone number must be 12 digits with country code or else 10 digits").required("Phone number is Required"),password:r.Z_().required("Password is Required"),rePassword:r.Z_().oneOf([r.iH("password")],"Passwords must match").required("Re-Enter Password is Required"),isAgree:r.O7().oneOf([!0],"You must agree to the terms and conditions").required("You must agree to the terms and conditions")}),l=r.Ry().shape({email:r.Z_().email("Invalid email").required("Email is Required"),password:r.Z_().required("Password is Required")}),n=r.Ry().shape({email:r.Z_().email("Invalid email").required("Email is Required"),password:r.Z_().required("Password is Required"),rePassword:r.Z_().oneOf([r.iH("password")],"Passwords must match").required("Re-Enter Password is Required"),otp:r.Z_().required("OTP is Required").min(4,"OTP must be exactly 4 characters").max(4,"OTP must be exactly 4 characters")}),d=r.Ry().shape({otp:r.Z_().required("OTP is Required").min(4,"OTP must be exactly 4 characters").max(4,"OTP must be exactly 4 characters")}),o=r.Ry().shape({couponCode:r.Z_().required("Coupon Code is Required")}),c=r.Ry().shape({fullName:r.Z_().required("Full Name is Required"),phone:r.Z_().matches(i,"Phone number must be 12 digits with country code or else 10 digits").required("Phone number is Required"),apartment:r.Z_().required("Address is Required"),street:r.Z_().required("Street is Required"),country:r.Z_().required("Country is Required"),stateId:r.Z_().required("State is Required"),state:r.Z_().required("State is Required"),cityId:r.Z_().required("City is required"),city:r.Z_().required("City is required")}),u=r.Ry().shape({name:r.Z_().required("Name is Required"),email:r.Z_().email("Invalid email").required("Email is Required"),phone:r.Z_().matches(/^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9]*$/,"Phone number is not valid").required("Phone number is Required")}),m=r.Ry().shape({oldPassword:r.Z_().required("Old Password is Required"),newPassword:r.Z_().required("New Password is Required"),confirmNewPassword:r.Z_().oneOf([r.iH("newPassword")],"Passwords must match").required("Confirm New Password is Required")}),x=r.Ry().shape({email:r.Z_().email("Invalid email").required("Email is Required"),phoneNumber:r.Z_().matches(i,"Phone number must be 12 digits with country code or else 10 digits").required("Phone number is Required")}),h=r.Ry().shape({code1:r.Z_().required("OTP is Required"),code2:r.Z_().required("OTP is Required"),code3:r.Z_().required("OTP is Required"),code4:r.Z_().required("OTP is Required")})},99065:function(e,t,s){s.d(t,{Et:function(){return r}});let r=(e,t)=>{let s=null;return function(){for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];s&&clearTimeout(s),s=setTimeout(()=>{e(...i)},t)}}}}]);