PageSourceSearch

https://mnjewelpark.com/_next/static/chunks/7392-c641b8f39e98d24f.js

js mnjewelpark.com collected 2026-10-04 06:52:36 UTC 8,761 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7392],{13569:(e,t,s)=>{s.d(t,{K:()=>i});var a=s(81529),r=s(75928),l=s(79435);let i=async e=>{var t,s,i,o,n,d;let{backend:c="PS",method:u,url:h,data:m,params:p,headers:g}=e;try{let e=(e=>{switch(e){case"PS":return a.A;case"MG":return r.A;default:throw Error("Invalid backend type")}})(c),l=await e({method:u,url:h,data:m,params:p,headers:g});if(200===l.status||201===l.status){let e=null!=(s=null==(t=l.data)?void 0:t.data)?s:l.data;return null!=e?e:[]}throw Error("Unexpected status code: ".concat(l.status))}catch(t){if((null==t||null==(i=t.response)?void 0:i.status)===401){console.error("[API ERROR] 401 Unauthorized - Logging out user"),(0,l.q0)(),window.location.href="/";let e=Error("Unauthorized - Please login again");throw e.status=401,e}console.error("[API ERROR]",(null==t||null==(o=t.response)?void 0:o.data)||(null==t?void 0:t.message)||t);let e=(null==t||null==(n=t.response)?void 0:n.data)||t;throw"object"==typeof e&&null!==e&&(null==t||null==(d=t.response)?void 0:d.status)&&(e.status=t.response.status),e}}},14979:(e,t,s)=>{s.d(t,{U4:()=>c,Ay:()=>h,Ej:()=>d,Qg:()=>u});var a=s(59267);let r={getWishlist:"/wishlist",addToWishlist:"/wishlist/add",removeFromWishlist:"/wishlist"};var l=s(13569);let i={getWishlist:()=>(0,l.K)({backend:"MG",method:"GET",url:r.getWishlist}),addToWishlist:e=>(0,l.K)({backend:"MG",method:"POST",url:r.addToWishlist,data:{productId:e}}),removeFromWishlist:e=>(0,l.K)({backend:"MG",method:"DELETE",url:"".concat(r.removeFromWishlist,"/").concat(e)})};var o=s(77329),n=s(79435);let d=(0,a.zD)("wishlist/fetchWishlist",async(e,t)=>{let{dispatch:s,rejectWithValue:a}=t;if(!(0,n.gf)())return a("User not logged in");try{return await i.getWishlist()}catch(e){return a((null==e?void 0:e.message)||"Failed to fetch wishlist")}}),c=(0,a.zD)("wishlist/addToWishlist",async(e,t)=>{let{dispatch:s,rejectWithValue:a}=t;try{return await i.addToWishlist(e)}catch(e){return"Network Error"===e.message&&s((0,o.xN)("/")),a((null==e?void 0:e.message)||"Failed to add to wishlist")}}),u=(0,a.zD)("wishlist/removeFromWishlist",async(e,t)=>{let{dispatch:s,rejectWithValue:a}=t;try{return await i.removeFromWishlist(e),e}catch(e){return"Network Error"===e.message&&s((0,o.xN)("/")),a((null==e?void 0:e.message)||"Failed to remove from wishlist")}}),h=(0,a.Z0)({name:"wishlist",initialState:{items:{products:[]},loading:!1,error:null},reducers:{},extraReducers:e=>{e.addCase(d.pending,e=>{e.loading=!0,e.error=null}).addCase(d.fulfilled,(e,t)=>{e.loading=!1,e.items=t.payload}).addCase(d.rejected,(e,t)=>{e.loading=!1,e.error=t.payload}).addCase(c.pending,e=>{e.loading=!0}).addCase(c.fulfilled,(e,t)=>{e.loading=!1,e.items&&e.items.products&&e.items.products.push(t.payload)}).addCase(c.rejected,(e,t)=>{e.loading=!1,e.error=t.payload}).addCase(u.pending,e=>{e.loading=!0}).addCase(u.fulfilled,(e,t)=>{e.loading=!1,e.items&&e.items.products&&(e.items.products=e.items.products.filter(e=>e._id!==t.payload&&e.productId!==t.payload))}).addCase(u.rejected,(e,t)=>{e.loading=!1,e.error=t.payload})}}).reducer},21067:(e,t,s)=>{s.d(t,{q:()=>r});var a=s(79435);let r=e=>{e.interceptors.request.use(e=>{let t=(0,a.gf)();if(t){var s;e.headers=null!=(s=e.headers)?s:{},e.headers.Authorization="Bearer ".concat(t)}return e},e=>Promise.reject(e)),e.interceptors.response.use(e=>e,async t=>{var s;let a=t.config;return(null==(s=t.response)?void 0:s.status)!==401||a._retry?Promise.reject(t):(a._retry=!0,e(a))})}},21185:(e,t,s)=>{s.d(t,{A:()=>o});var a=s(95155),r=s(12115),l=s(35299),i=s(86189);let o=e=>{let{src:t,alt:s,className:o="",containerClassName:n="",onLoad:d,onError:c}=e,[u,h]=(0,r.useState)(!0),[m,p]=(0,r.useState)(!1),g=(0,r.useMemo)(()=>{let e=o.match(/rounded[-\w]*/g);return e?e.join(" "):""},[o]);return(0,a.jsxs)("div",{className:"relative ".concat(n),children:[u&&(0,a.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-100 ".concat(g),children:(0,a.jsx)(i.A,{})}),(0,a.jsx)("img",{src:t,alt:s,className:"".concat(o," ").concat(u?"opacity-0":"opacity-100"," transition-opacity duration-300"),onLoad:()=>{h(!1),null==d||d()},onError:()=>{h(!1),p(!0),null==c||c()}}),m&&!u&&(0,a.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-100 ".concat(g),children:(0,a.jsxs)("div",{className:"text-center text-gray-400",children:[(0,a.jsx)(l.A,{className:"w-8 h-8 mx-auto mb-2"}),(0,a.jsx)("p",{className:"text-xs",children:"Failed to load"})]})})]})}},37392:(e,t,s)=>{s.d(t,{A:()=>d});var a=s(95155),r=s(20063);s(12115);var l=s(83457),i=s(1213),o=s(14979),n=s(21185);let d=e=>{var t,s,d,c;let{product:u,onWishlistToggle:h,showHeart:m=!0}=e,p=(0,r.useRouter)(),g=(0,i.wA)(),x=null==(t=(0,i.d4)(e=>e.wishlist.items).products)?void 0:t.some(e=>
1e.productId===u._id||e._id===u._id),v=async e=>{e.stopPropagation();try{x?await g((0,o.Qg)(u._id)).unwrap():await g((0,o.U4)(u._id)).unwrap(),await g((0,o.Ej)()),h&&h()}catch(e){console.error("Failed to toggle wishlist:",e)}},f=null!=(d=null==u?void 0:u.grandTotal)?d:0,w=null!=(c=null==u?void 0:u.strikedPrice)?c:0,y=(null==u||null==(s=u.images)?void 0:s[0])||"/placeholder.jpg";return(0,a.jsxs)("div",{className:"w-full h-full rounded-lg overflow-hidden font-serif text-[#7e013f] cursor-pointer group relative",onClick:()=>{p.push("/product/".concat(u.slug))},children:[(0,a.jsxs)("div",{className:"relative bg-[#FDF8F2] border-2 border-amberCustom rounded-2xl overflow-hidden",children:[(0,a.jsx)(n.A,{src:y,alt:u.name,className:"w-full object-cover rounded-md transition-transform duration-300 group-hover:scale-125",containerClassName:"w-full"}),(0,a.jsxs)("div",{className:"absolute top-3 left-3 z-10 flex flex-col gap-1.5 items-start",children:[u.highlightTag&&(0,a.jsx)("div",{className:"text-[9px] sm:text-[10px] font-bold px-2 py-0.5 rounded shadow-md uppercase tracking-wider text-white ".concat("New Arrival"===u.highlightTag?"bg-purple-600":"Best Seller"===u.highlightTag?"bg-amber-600":"Trending"===u.highlightTag?"bg-orange-500":"bg-blue-600"),children:u.highlightTag}),(()=>{let e=Number(null==u?void 0:u.discountPercentage),t=w>f&&w>0?Math.round((w-f)/w*100):0,s=e>0?e:t;return s>0?(0,a.jsxs)("div",{className:"bg-[#7e013f] text-white text-[9px] sm:text-[10px] font-bold px-2 py-0.5 rounded shadow-sm",children:[s,"% OFF"]}):null})()]}),m&&(0,a.jsx)("button",{onClick:v,className:"absolute top-3 cursor-pointer right-3 p-2 bg-white/80 rounded-full hover:bg-white transition-colors duration-200 z-10",children:(0,a.jsx)(l.A,{size:20,className:"".concat(x?"fill-secondary text-secondary-500":"text-gray-600")})})]}),(0,a.jsxs)("div",{className:"py-4 px-2 rounded-xl transition-shadow duration-300",children:[(0,a.jsx)("h4",{className:"text-md sm:text-lg font-semibold text-gray-800 mb-3 truncate font-barlow",title:u.name,children:u.name}),(0,a.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,a.jsxs)("p",{className:"text-base sm:text-xl font-bold text-[#7B0046]",children:["₹",f,"/-"]}),u.itemGrossWeight&&(0,a.jsxs)("span",{className:"text-sm sm:text-sm text-gray-500 font-medium font-barlow",children:["(",u.itemGrossWeight," g)"]})]}),w>f&&(0,a.jsxs)("p",{className:"text-xs sm:text-sm font-medium text-gray-400 line-through mt-1",children:["₹",w,"/-"]})]})]})}},75928:(e,t,s)=>{s.d(t,{A:()=>i});var a=s(95125),r=s(21067);let l=a.A.create({baseURL:"".concat("https://api.mnjewelpark.com/mg-api","/api"),timeout:3e4});(0,r.q)(l);let i=l},77329:(e,t,s)=>{s.d(t,{Ay:()=>i,rv:()=>l,xN:()=>r});let a=(0,s(59267).Z0)({name:"ui",initialState:{isAuthPopupOpen:!1,redirectPath:null},reducers:{openAuthPopup:(e,t)=>{e.isAuthPopupOpen=!0,e.redirectPath=t.payload||null},closeAuthPopup:e=>{e.isAuthPopupOpen=!1,e.redirectPath=null}}}),{openAuthPopup:r,closeAuthPopup:l}=a.actions,i=a.reducer},79435:(e,t,s)=>{s.d(t,{WG:()=>l,gf:()=>r,q0:()=>i});let a="mn_token",r=()=>localStorage.getItem(a),l=e=>{localStorage.setItem(a,e)},i=()=>{localStorage.removeItem(a),localStorage.removeItem("refresh_token")}},81529:(e,t,s)=>{s.d(t,{A:()=>i});var a=s(95125),r=s(21067);let l=a.A.create({baseURL:"".concat("https://api.mnjewelpark.com/pg-api","/api"),timeout:3e4});(0,r.q)(l);let i=l},86189:(e,t,s)=>{s.d(t,{A:()=>l});var a=s(95155),r=s(15239);s(12115);let l=e=>{let{message:t="Loading...",minHeightClass:s="min-h-[400px]"}=e;return(0,a.jsx)("div",{className:"w-full ".concat(s," flex items-center justify-center"),children:(0,a.jsxs)("div",{className:"flex flex-col items-center gap-4 text-secondary",style:{perspective:"1000px"},children:[(0,a.jsx)(r.default,{src:"/logopink.svg",alt:"MN Jewel Park",width:96,height:96,className:"logo-flip",priority:!0}),(0,a.jsx)("p",{className:"text-sm tracking-wide uppercase text-gray-500",children:t})]})})}}}]);

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.