1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2676],{72676:function(e,s,t){t.r(s),t.d(s,{default:function(){return d}});var l=t(85893),r=t(43327),n=t(3524),a=t(11163),i=t(51298),o=t(67294);function c({callBack:e,handleApply:s}){let[t,r]=(0,o.useState)("");return(0,l.jsx)("form",{onSubmit:l=>{l.preventDefault(),s(t),e&&e()},className:"w-full px-4 pb-6",children:(0,l.jsxs)("div",{className:"relative flex items-center w-full rounded-[10px] transition-colors",children:[(0,l.jsx)("input",{type:"text",placeholder:"Enter Coupon Code",value:t,onChange:e=>r(e.target.value),className:"w-full px-4 min-w-56 h-[56px] bg-transparent border-[#D7DBDC] border-2 outline-none rounded-[10px] placeholder:text-[#A5A4A5] text-[15px]"}),(0,l.jsx)("button",{type:"submit",className:"absolute right-4 font-medium text-[14px] text-[#626262]",children:"APPLY"})]})})}var d=function({callback:e,couponCode:s,cartValue:t,allCoupons:o}){let d=(0,r.T)(),u=(0,a.useRouter)(),x=(0,r.C)(e=>e.auth?.mobile),m=async e=>{if(!x){u.push("/login");return}await d((0,n.zL)(e))};return(0,l.jsxs)("div",{className:"flex flex-col w-full p-4",children:[(0,l.jsx)(c,{callBack:e,handleApply:m}),(0,l.jsx)("div",{className:"flex flex-col gap-3 w-full px-4 overflow-scroll max-h-[70vh] lg:max-w-[440px] pb-28",children:o?.map((r,n)=>l.jsx(i.Z,{coupon:r,couponCode:s,onClick:m,cartValue:t,callBack:e},n))})]})}},51298:function(e,s,t){var l=t(85893),r=t(43327),n=t(3524),a=t(67294),i=t(75985),o=t(43536);let c=e=>{let s=e.value;switch(e.type){case"FLAT_OFF":s=`â¹${Math.round(Number(e.value))} OFF `+(Math.round(Number(e.min_cart_value))?`ON MINIMUM CART VALUE: â¹${Math.round(Number(e.min_cart_value))}`:"");break;case"PERCENT_OFF":s=`${e.value}% OFF `+(Math.round(Number(e.min_cart_value))?`ON MINIMUM CART VALUE: â¹${Math.round(Number(e.min_cart_value))}`:"");break;case"BXGY":s=""}return s};s.Z=function({coupon:e,onClick:s,callBack:t,couponCode:d,cartValue:u}){let x=(0,a.useMemo)(()=>Math.round(Number(e?.min_cart_value||0)-Number(u||0)),[e,u]),[m,p]=(0,a.useState)(!1),h=e?.coupon_series?.extra_attributes?.terms_and_conditions||"",f=(0,r.T)();return(0,l.jsxs)("div",{className:"border divide-x divide-dashed w-full rounded-xl",children:[(0,l.jsxs)("div",{className:"flex flex-row justify-between ",children:[(0,l.jsxs)("div",{className:"w-full flex flex-col py-4 px-2 space-y-2",children:[(0,l.jsxs)("div",{className:"flex flex-row space-x-2 items-center",children:[e?.image?(0,l.jsx)("img",{src:e?.image,className:"w-12 h-10 rounded-xl"}):(0,l.jsx)("img",{src:"/media/svg/offer.svg",className:"w-12 h-10 rounded-xl"}),e?.code&&(0,l.jsx)("span",{className:"p-1 uppercase font-semibold text-[14px] tracking-wider border border-secondaryGreyBorderColor border-dashed",children:e?.code})]}),(0,l.jsxs)("div",{className:"text-sm pr-2",children:[(0,l.jsx)("p",{className:"font-semibold",children:c(e)}),(0,l.jsx)(o.ZP.div,{children:(0,l.jsx)("div",{dangerouslySetInnerHTML:{__html:e?.description||""},style:{padding:"1em",all:"unset",color:"#626262",fontSize:12}})}),x>0&&(0,l.jsxs)("p",{className:"text-lightRed",children:["Add â¹",x," more to apply"]})]})]}),(0,l.jsxs)("div",{className:"w-[200px] h-full flex flex-col justify-center py-4",children:[e?.discount&&(0,l.jsxs)("span",{className:"mb-4 px-2 font-semibold text-green-600 text-center text-sm ",children:["Save â¹",e?.discount," on this order!"]}),Math.round(Number(e?.discount??0))>0&&(0,l.jsxs)("span",{className:"mb-4 px-2 font-semibold text-green-600 text-center text-sm ",children:["Save â¹",Math.round(Number(e?.discount??0))," on this order!"]}),e.code==d?(0,l.jsx)("button",{className:"mx-4 rounded-lg font-semibold text-primaryWhite uppercase p-1 bg-lightRed",onClick:()=>{e.code&&f((0,n.SS)(e.code)),t&&t()},children:"Remove"}):(0,l.jsx)("button",{className:"mx-4 rounded-lg font-semibold text-primaryWhite uppercase p-1 bg-lightRed",onClick:()=>{e?.code&&s(e.code),t&&t()},children:"Apply"})]})]}),h&&(0,l.jsxs)("div",{className:"pb-2 px-4 min-w-0 max-w-full",children:[(0,l.jsx)(o.ZP.div,{children:(0,l.jsx)("span",{className:"font-normal leading-5 tracking-wide ",dangerouslySetInnerHTML:{__html:m?h.replace(/\n/g,"<br />"):""},style:{padding:"1em",all:"unset",fontWeight:500,color:"#626262",fontSize:12}})}),(0,l.jsx)("div",{className:"flex w-full justify-center border-t-2 mt-2",children:(0,l.jsxs)("button",{className:"mt-2 text-primaryBlack transition-colors duration-200 flex items-center justify-center text-xs font-[500]",onClick:()=>p(e=>!e),children:["Terms & Conditions",m?(0,l.jsx)(i.UMe,{size:22}):(0,l.jsx)(i.jX5,{size:22})]})})]})]})}}}]);
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.