1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[571],{772:(e,r,t)=>{"use strict";t.d(r,{A:()=>l});var a=t(2115),o=t(907);let n=e=>{let r=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,t)=>t?t.toUpperCase():r.toLowerCase());return r.charAt(0).toUpperCase()+r.slice(1)};var s=t(1265);let l=(e,r)=>{let t=(0,a.forwardRef)(({className:t,...l},i)=>(0,a.createElement)(s.default,{ref:i,iconNode:r,className:(0,o.z)(`lucide-${n(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,t),...l}));return t.displayName=n(e),t}},907:(e,r,t)=>{"use strict";t.d(r,{z:()=>a});let a=(...e)=>e.filter((e,r,t)=>!!e&&""!==e.trim()&&t.indexOf(e)===r).join(" ").trim()},1265:(e,r,t)=>{"use strict";t.d(r,{default:()=>l});var a=t(2115),o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},n=t(907);let s=(0,a.createContext)({}),l=(0,a.forwardRef)(({color:e,size:r,strokeWidth:t,absoluteStrokeWidth:l,className:i="",children:c,iconNode:d,...p},h)=>{let{size:u=24,strokeWidth:m=2,absoluteStrokeWidth:f=!1,color:g="currentColor",className:w=""}=(0,a.useContext)(s)??{},y=l??f?24*Number(t??m)/Number(r??u):t??m;return(0,a.createElement)("svg",{ref:h,...o,width:r??u??o.width,height:r??u??o.height,stroke:e??g,strokeWidth:y,className:(0,n.z)("lucide",w,i),...!c&&!(e=>{for(let r in e)if(r.startsWith("aria-")||"role"===r||"title"===r)return!0;return!1})(p)&&{"aria-hidden":"true"},...p},[...d.map(([e,r])=>(0,a.createElement)(e,r)),...Array.isArray(c)?c:[c]])})},2356:(e,r,t)=>{"use strict";t.d(r,{AS:()=>l,SV:()=>o,U0:()=>h,XY:()=>c,ZT:()=>d,ab:()=>i,aw:()=>u,bQ:()=>n,bW:()=>s,bn:()=>m,lV:()=>p});var a=t(5322);function o(e){return e?e.replace(/[\r\n]+/g,"").replace(/&/g,"and").replace(/[^a-zA-Z0-9\s-]/g,"").trim().replace(/\s+/g,"-"):""}function n(e){return e?e.replace(/[^a-zA-Z0-9\s-]/g,"").trim().replace(/\s+/g,"-"):""}async function s(){let e=new URLSearchParams;e.append("Param",JSON.stringify([{CategoryId:0,CategoryName:"",CategoryImage:"",Status:!0}])),e.append("Flag","4");try{let r=await fetch(`${a.J}api/YKLabs/Categories_CRUD`,{method:"POST",body:e,headers:{"Content-Type":"application/x-www-form-urlencoded"},next:{revalidate:60}});if(!r.ok)throw Error(`Failed to fetch categories: ${r.status}`);return await r.json()}catch(e){return console.error("Error fetching categories:",e),[]}}async function l(){let e=new URLSearchParams;e.append("Param",JSON.stringify([{UserID:1,TokenID:"1A7FE1ED-28F2-4E71-9321-D376ADB9D75E"}])),e.append("Param1","");try{let r=await fetch(`${a.J}api/YKLabs/YK_NEW_GetAllCategoryProducts`,{method:"POST",body:e,headers:{"Content-Type":"application/x-www-form-urlencoded"},next:{revalidate:1}});if(!r.ok)throw Error(`Failed to fetch products: ${r.status}`);return await r.json()}catch(e){return console.error("Error fetching products:",e),[]}}async function i(e){return(await l()).filter(r=>r.CategoryId==e)}async function c(e){let r=new URLSearchParams;r.append("Param",JSON.stringify([{ImgID:0,RandDID:0,ImagePaths:"",Description:""}])),r.append("Flag","4");try{let t=await fetch(`${a.J}api/YKLabs/RandDImages_CRUD`,{method:"POST",body:r,headers:{"Content-Type":"application/x-www-form-urlencoded"},next:{revalidate:60}});if(!t.ok)throw Error(`Failed to fetch R&D images for rollId ${e}: ${t.status}`);return(await t.json()).filter(r=>r.RandDID?.toString()===e&&!1!==r.Status)}catch(r){return console.error(`Error fetching R&D images for rollId ${e}:`,r),[]}}async function d(e){let r=new URLSearchParams;r.append("Param",JSON.stringify([{UserID:1,TokenID:"1A7FE1ED-28F2-4E71-9321-D376ADB9D75E"}])),r.append("Flag",e);try{let e=await fetch(`${a.J}api/YKLabs/YK_NEW_Getting_YK_ImageGallery`,{method:"POST",body:r,headers:{"Content-Type":"application/x-www-form-urlencoded"},next:{revalidate:60}});if(!e.ok)throw Error("Failed to fetch crop gallery images");return await e.json()}catch(r){return console.error(`Error fetching gallery images for crop ${e}:`,r),[]}}async function p(e){let r=new URLSearchParams;r.append("FLagID","1"),r.append("CropID",e);try{let e=await fetch(`${a.J}api/YKLabs/YK_NEW_GettingSolution_Schedule_InfoImages`,{method:"POST",body:r,headers:{"Content-Type":"application/x-www-form-urlencoded"},next:{revalidate:60}});if(!e.ok)throw Error("Failed to fetch crop solution schedule info");return await e.json()}catch(r){return console.error(`Error fetching solution/schedule info for crop ${e}:`,r),null}}async function h(e){let r=new URLSearchParams;r.append("Param1",e);try{let e=await fetch(`${a.J}api/YKLabs/Get_BasedONCrop_Youtubevideogallery`,{method:"POST",body:r,headers:{"Content-Type":"application/x-www-form-urlencoded"},next:{revalidate:60}});if(!e.ok)throw Error("Failed to fetch crop youtube videos");return await e.json()}catch(r){return console.error(`Error fetching youtube videos for crop ${e}:`,r),[]}}async function u(e){let r=new URLSearchParams;r.append("Param1",e);try{let e=await fetch(`${a.J}api/YKLabs/Get_QRImages`,{method:"POST",body:r,headers:{"Content-Type":"application/x-www-form-urlencoded"},next:{revalidate:60}});if(!e.ok)throw Error("Failed to fetch crop QR images");return await e.json()}catch(r){return console.error(`Error fetching QR images for crop ${e}:`,r),[]}}async function m(){let e=new URLSearchParams;e.append("Param",JSON.stringify([{}])),e.append("Flag","4");try{let r=await fetch(`${a.J}api/YKLabs/Awards_CRUD`,{method:"POST",body:e,headers:{"Content-Type":"application/x-www-form-urlencoded"},next:{revalidate:60}});if(!r.ok)throw Error("Failed to fetch awards");return await r.json()}catch(e){return console.error("Error fetching awards:",e),[]}}},5137:(e,r,t)=>{Promise.resolve().then(t.bind(t,5331))},5322:(e,r,t)=>{"use strict";t.d(r,{J:()=>a});let a="https://yklaboratories.com/webservices/"},5331:(e,r,t)=>{"use strict";t.d(r,{default:()=>p});var a=t(5155),o=t(2115),n=t(2356),s=t(5322),l=t(8500),i=t.n(l),c=t(7973),d=t(5494);function p({initialCategories:e,initialProducts:r}){let[t,l]=(0,o.useState)(e||[]),[h,u]=(0,o.useState)(r||[]);return(0,o.useEffect)(()=>{!async function(){try{let[e,r]=await Promise.all([(0,n.bW)(),(0,n.AS)()]);e&&e.length>0&&l(e),r&&r.length>0&&u(r)}catch(e){console.error("Error fetching latest products on client:",e)}}()},[]),(0,a.jsx)("div",{className:"flex flex-col gap-16",children:t.map(e=>{let r=h.filter(r=>r.CategoryId===e.CategoryId);return 0===r.length?null:(0,a.jsxs)("section",{className:"scroll-mt-32",id:`category-${e.CategoryId}`,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-border/60 pb-4 mb-8",children:[(0,a.jsx)("h2",{className:"text-2xl md:text-3xl font-display font-bold text-[#B32073] uppercase",children:e.CategoryName}),(0,a.jsx)(i(),{href:`/products/${e.CategoryId}`,className:"text-sm font-semibold text-primary hover:text-accent transition-colors",children:"View Category â"})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-
15 md:gap-6",children:r.map(e=>{let r=e.Image?`${s.J}${e.Image.replace(/^\//,"")}`:void 0;return(0,a.jsxs)("article",{className:"group h-full rounded-2xl bg-card border border-border shadow-md hover:shadow-xl hover:-translate-y-1.5 hover:border-accent transition-all duration-300 overflow-hidden flex flex-col",children:[(0,a.jsx)(i(),{href:`/product-details/${(0,n.SV)(e.productname)}`,className:"relative aspect-[4/3] overflow-hidden block",style:r?{background:"#ffffff"}:{background:"linear-gradient(135deg, var(--leaf) 0%, var(--brand) 100%)"},children:r?(0,a.jsx)("img",{src:r,alt:e.productname,loading:"lazy",className:"absolute inset-0 h-full w-full object-contain group-hover:scale-105 transition-transform duration-500 bg-white"}):(0,a.jsx)("div",{className:"absolute inset-0 grid place-items-center text-white/90",children:(0,a.jsx)(c.A,{className:"h-14 w-14 opacity-40 group-hover:scale-110 transition-transform duration-500"})})}),(0,a.jsxs)("div",{className:"p-4 md:p-5 flex flex-col flex-1 items-center text-center",children:[(0,a.jsx)(i(),{href:`/product-details/${(0,n.SV)(e.productname)}`,className:"w-full",children:(0,a.jsx)("h3",{className:"mt-2 font-display text-lg font-semibold text-primary hover:text-accent transition-colors line-clamp-1 uppercase w-full",children:e.productname})}),(0,a.jsxs)("div",{className:"mt-auto pt-4 grid grid-cols-2 gap-2 w-full",children:[(0,a.jsxs)("a",{href:e.YKMartURL||"https://ykmart.com",target:"_blank",rel:"noopener noreferrer",className:"flex flex-col items-center justify-center gap-1.5 rounded-xl bg-[var(--leaf)]/5 border border-[var(--leaf)]/30 shadow-sm py-2 hover:border-[var(--leaf)] transition-colors group/btn",children:[(0,a.jsx)("img",{src:"/assets/logoYK.webp",alt:"YK Mart",className:"h-4 sm:h-[18px] w-auto object-contain bg-white rounded-full px-1"}),(0,a.jsx)("span",{className:"text-[10px] sm:text-[11px] text-[var(--brand)] font-bold leading-none",children:"Buy"})]}),(0,a.jsxs)("a",{href:`/mailEnquiry?ProdName=${encodeURIComponent(e.productname)}`,className:"flex flex-col items-center justify-center gap-1.5 rounded-xl bg-primary/5 border border-primary/30 shadow-sm py-2 hover:border-primary hover:bg-primary/10 transition-colors group/btn",children:[(0,a.jsx)(d.A,{className:"h-4 sm:h-[18px] text-primary"}),(0,a.jsx)("span",{className:"text-[10px] sm:text-[11px] text-primary font-bold leading-none",children:"Enquiry"})]})]})]})]},e.Productid||e.productname)})})]},e.CategoryId)})})}},5494:(e,r,t)=>{"use strict";t.d(r,{A:()=>a});let a=(0,t(772).A)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]])},7973:(e,r,t)=>{"use strict";t.d(r,{A:()=>a});let a=(0,t(772).A)("leaf",[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]])}},e=>{e.O(0,[500,441,928,358],()=>e(e.s=5137)),_N_E=e.O()}]);
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.