(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1599],{73067:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var a=r(65531);/**
 * @license lucide-react v0.446.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,a.Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},68291:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var a=r(65531);/**
 * @license lucide-react v0.446.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,a.Z)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},62442:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var a=r(65531);/**
 * @license lucide-react v0.446.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,a.Z)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},17158:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var a=r(65531);/**
 * @license lucide-react v0.446.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,a.Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},63715:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var a=r(65531);/**
 * @license lucide-react v0.446.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,a.Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},55340:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var a=r(65531);/**
 * @license lucide-react v0.446.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,a.Z)("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]])},11961:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var a=r(65531);/**
 * @license lucide-react v0.446.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,a.Z)("Truck",[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]])},31541:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var a=r(65531);/**
 * @license lucide-react v0.446.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,a.Z)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]])},38794:function(e,t,r){Promise.resolve().then(r.bind(r,81517)),Promise.resolve().then(r.bind(r,46339)),Promise.resolve().then(r.bind(r,78828)),Promise.resolve().then(r.bind(r,60914)),Promise.resolve().then(r.bind(r,48135)),Promise.resolve().then(r.bind(r,13233)),Promise.resolve().then(r.bind(r,54852)),Promise.resolve().then(r.t.bind(r,63388,23))},78828:function(e,t,r){"use strict";r.r(t),r.d(t,{ProductReviews:function(){return L}});var a=r(57437),s=r(2265),i=r(16691),n=r.n(i),l=r(55340),o=r(8866),d=r(93023),c=r(12609),u=r(51908),m=r(55771),x=r(66672),h=r(71424),p=r(63715),g=r(31541);function f(e){let{isOpen:t,onClose:r,productId:i,productName:l,productImage:f,onReviewSubmitted:y}=e,[v,j]=(0,s.useState)("EMAIL"),[b,N]=(0,s.useState)(""),[w,k]=(0,s.useState)(""),[S,E]=(0,s.useState)(0),[C,D]=(0,s.useState)(""),[R,T]=(0,s.useState)(""),[_,A]=(0,s.useState)(null),[O,I]=(0,s.useState)(!1),[P,Z]=(0,s.useState)(!1),M=()=>{j("EMAIL"),N(""),k(""),E(0),D(""),T(""),A(null),I(!1)},F=()=>{r()},z=async e=>{if(e.preventDefault(),!b){h.Am.error("Please enter your email");return}I(!0);try{let e=await fetch("/api/reviews/send-otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:b,productId:i})}),t=await e.json();if(!e.ok)throw Error(t.error||"Failed to send OTP");h.Am.success("OTP sent to your email!"),j("OTP")}catch(e){h.Am.error(e.message)}finally{I(!1)}},L=async e=>{if(e.preventDefault(),!w){h.Am.error("Please enter the OTP");return}j("REVIEW")},V=async e=>{var t;let r=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!r)return;Z(!0);let a=new FormData;a.append("file",r);try{let e=await fetch("/api/upload",{method:"POST",body:a});if(!e.ok)throw Error("Upload failed");let t=await e.json();A(t.url),h.Am.success("Image uploaded")}catch(e){h.Am.error("Failed to upload image")}finally{Z(!1)}},q=async e=>{if(e.preventDefault(),0===S){h.Am.error("Please select a star rating");return}if(!R){h.Am.error("Please write a review");return}I(!0);try{let e=await fetch("/api/reviews",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:b,otp:w,productId:i,rating:S,title:C,content:R,image:_})}),t=await e.json();if(!e.ok)throw Error(t.error||"Failed to submit review");h.Am.success("Review submitted! It will be visible after approval."),y(),F(),M()}catch(e){h.Am.error(e.message)}finally{I(!1)}};return(0,a.jsx)(c.Vq,{open:t,onOpenChange:F,children:(0,a.jsxs)(c.cZ,{className:"sm:max-w-[500px]",children:[(0,a.jsxs)(c.fK,{children:[(0,a.jsx)(c.$N,{children:"Write a Review"}),(0,a.jsxs)(c.Be,{children:["Share your experience with ",(0,a.jsx)("strong",{children:l})]})]}),(0,a.jsxs)("div",{className:"flex gap-4 mb-4 p-4 bg-muted/30 rounded-lg items-center",children:[(0,a.jsx)("div",{className:"relative w-16 h-16 shrink-0 bg-white rounded-md border overflow-hidden",children:(0,a.jsx)(n(),{src:f,alt:l,fill:!0,className:"object-cover"})}),(0,a.jsx)("div",{children:(0,a.jsx)("h4",{className:"font-semibold text-sm",children:l})})]}),"EMAIL"===v&&(0,a.jsxs)("form",{onSubmit:z,className:"space-y-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(x._,{htmlFor:"email",children:"Email Address"}),(0,a.jsx)(u.I,{id:"email",type:"email",placeholder:"Enter the email used for purchase",value:b,onChange:e=>N(e.target.value),required:!0}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"We'll send a one-time password to verify your purchase."})]}),(0,a.jsx)(d.z,{type:"submit",className:"w-full",disabled:O,children:O?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.Z,{className:"mr-2 h-4 w-4 animate-spin"})," Sending OTP..."]}):"Continue"})]}),"OTP"===v&&(0,a.jsxs)("form",{onSubmit:L,className:"space-y-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(x._,{htmlFor:"otp",children:"Verification Code"}),(0,a.jsx)(u.I,{id:"otp",type:"text",placeholder:"Enter 6-digit code",value:w,onChange:e=>k(e.target.value),required:!0,maxLength:6,className:"text-center text-lg tracking-widest"}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground text-center",children:["Sent to ",b]})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.z,{variant:"outline",type:"button",onClick:()=>j("EMAIL"),className:"flex-1",children:"Back"}),(0,a.jsx)(d.z,{type:"submit",className:"flex-1",children:"Verify"})]})]}),"REVIEW"===v&&(0,a.jsxs)("form",{onSubmit:q,className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2 mb-4",children:[(0,a.jsx)(x._,{children:"Rating"}),(0,a.jsx)(o.Z,{rating:S,setRating:E,size:32})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(x._,{htmlFor:"title",children:"Review Title (Optional)"}),(0,a.jsx)(u.I,{id:"title",placeholder:"Summary of your experience",value:C,onChange:e=>D(e.target.value)})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(x._,{htmlFor:"content",children:"Review"}),(0,a.jsx)(m.g,{id:"content",placeholder:"Tell us what you liked or disliked...",rows:4,value:R,onChange:e=>T(e.target.value),required:!0})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(x._,{children:"Add Photo (Optional)"}),(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsxs)(d.z,{type:"button",variant:"outline",size:"sm",className:"w-full",onClick:()=>{var e;return null===(e=document.getElementById("review-image"))||void 0===e?void 0:e.click()},disabled:P,children:[P?(0,a.jsx)(p.Z,{className:"h-4 w-4 animate-spin mr-2"}):(0,a.jsx)(g.Z,{className:"h-4 w-4 mr-2"}),"Upload Photo"]}),(0,a.jsx)("input",{id:"review-image",type:"file",className:"hidden",accept:"image/*",onChange:V})]}),_&&(0,a.jsxs)("div",{className:"relative w-full h-32 mt-2 bg-muted rounded-md overflow-hidden",children:[(0,a.jsx)(n(),{src:_,alt:"Review upload",fill:!0,className:"object-contain"}),(0,a.jsxs)("button",{type:"button",className:"absolute top-1 right-1 bg-black/50 text-white rounded-full p-1",onClick:()=>A(null),children:[(0,a.jsx)("span",{className:"sr-only",children:"Remove"}),"✕"]})]})]}),(0,a.jsx)(d.z,{type:"submit",className:"w-full",disabled:O,children:O?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.Z,{className:"mr-2 h-4 w-4 animate-spin"})," Submitting..."]}):"Submit Review"})]})]})})}var y=globalThis?.document?s.useLayoutEffect:()=>{};r(54887);var v=r(83474),j=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=(0,v.Z8)(`Primitive.${t}`),i=s.forwardRef((e,s)=>{let{asChild:i,...n}=e,l=i?r:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,a.jsx)(l,{...n,ref:s})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),b=r(26272);function N(){return()=>{}}var w="Avatar",[k,S]=function(e,t=[]){let r=[],i=()=>{let t=r.map(e=>s.createContext(e));return function(r){let a=r?.[e]||t;return s.useMemo(()=>({[`__scope${e}`]:{...r,[e]:a}}),[r,a])}};return i.scopeName=e,[function(t,i){let n=s.createContext(i);n.displayName=t+"Context";let l=r.length;r=[...r,i];let o=t=>{let{scope:r,children:i,...o}=t,d=r?.[e]?.[l]||n,c=s.useMemo(()=>o,Object.values(o));return(0,a.jsx)(d.Provider,{value:c,children:i})};return o.displayName=t+"Provider",[o,function(r,a){let o=a?.[e]?.[l]||n,d=s.useContext(o);if(d)return d;if(void 0!==i)return i;throw Error(`\`${r}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let a=r.reduce((t,{useScope:r,scopeName:a})=>{let s=r(e),i=s[`__scope${a}`];return{...t,...i}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}(i,...t)]}(w),[E,C]=k(w),D=s.forwardRef((e,t)=>{let{__scopeAvatar:r,...i}=e,[n,l]=s.useState("idle");return(0,a.jsx)(E,{scope:r,imageLoadingStatus:n,onImageLoadingStatusChange:l,children:(0,a.jsx)(j.span,{...i,ref:t})})});D.displayName=w;var R="AvatarImage",T=s.forwardRef((e,t)=>{let{__scopeAvatar:r,src:i,onLoadingStatusChange:n=()=>{},...l}=e,o=C(R,r),d=function(e,{referrerPolicy:t,crossOrigin:r}){let a=(0,b.useSyncExternalStore)(N,()=>!0,()=>!1),i=s.useRef(null),n=a?(i.current||(i.current=new window.Image),i.current):null,[l,o]=s.useState(()=>O(n,e));return y(()=>{o(O(n,e))},[n,e]),y(()=>{let e=e=>()=>{o(e)};if(!n)return;let a=e("loaded"),s=e("error");return n.addEventListener("load",a),n.addEventListener("error",s),t&&(n.referrerPolicy=t),"string"==typeof r&&(n.crossOrigin=r),()=>{n.removeEventListener("load",a),n.removeEventListener("error",s)}},[n,r,t]),l}(i,l),c=function(e){let t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...e)=>t.current?.(...e),[])}(e=>{n(e),o.onImageLoadingStatusChange(e)});return y(()=>{"idle"!==d&&c(d)},[d,c]),"loaded"===d?(0,a.jsx)(j.img,{...l,ref:t,src:i}):null});T.displayName=R;var _="AvatarFallback",A=s.forwardRef((e,t)=>{let{__scopeAvatar:r,delayMs:i,...n}=e,l=C(_,r),[o,d]=s.useState(void 0===i);return s.useEffect(()=>{if(void 0!==i){let e=window.setTimeout(()=>d(!0),i);return()=>window.clearTimeout(e)}},[i]),o&&"loaded"!==l.imageLoadingStatus?(0,a.jsx)(j.span,{...n,ref:t}):null});function O(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}A.displayName=_;var I=r(39311);let P=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(D,{ref:t,className:(0,I.cn)("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",r),...s})});P.displayName=D.displayName;let Z=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(T,{ref:t,className:(0,I.cn)("aspect-square h-full w-full",r),...s})});Z.displayName=T.displayName;let M=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(A,{ref:t,className:(0,I.cn)("flex h-full w-full items-center justify-center rounded-full bg-muted",r),...s})});M.displayName=A.displayName;let F=s.forwardRef((e,t)=>{let{className:r,value:s,...i}=e;return(0,a.jsx)("div",{ref:t,className:(0,I.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",r),role:"progressbar","aria-valuenow":s||0,"aria-valuemin":0,"aria-valuemax":100,...i,children:(0,a.jsx)("div",{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:"translateX(-".concat(100-(s||0),"%)")}})})});F.displayName="Progress";var z=r(29155);function L(e){let{productId:t,productName:r,productImage:i}=e,[c,u]=(0,s.useState)([]),[m,x]=(0,s.useState)(!0),[h,p]=(0,s.useState)(!1),g=async()=>{try{let e=await fetch("/api/reviews?productId=".concat(t));if(e.ok){let t=await e.json();u(t)}}catch(e){console.error("Failed to fetch reviews",e)}finally{x(!1)}};(0,s.useEffect)(()=>{g()},[t]);let y=c.length?(c.reduce((e,t)=>e+t.rating,0)/c.length).toFixed(1):0,v=c.length,j=[5,4,3,2,1].map(e=>({stars:e,count:c.filter(t=>t.rating===e).length,percentage:v?c.filter(t=>t.rating===e).length/v*100:0})),b={"@context":"https://schema.org/","@type":"Product",name:r,image:i,aggregateRating:v>0?{"@type":"AggregateRating",ratingValue:y,reviewCount:v}:void 0,review:c.map(e=>({"@type":"Review",reviewRating:{"@type":"Rating",ratingValue:e.rating},author:{"@type":"Person",name:e.reviewerName},reviewBody:e.content}))};return(0,a.jsxs)("section",{className:"py-12",id:"reviews",children:[(0,a.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(b)}}),(0,a.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,a.jsx)("h2",{className:"text-2xl font-bold mb-8",children:"Customer Reviews"}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-10",children:[(0,a.jsx)("div",{className:"lg:col-span-4 space-y-6",children:(0,a.jsxs)("div",{className:"bg-white p-6 rounded-xl border shadow-sm",children:[(0,a.jsxs)("div",{className:"text-center mb-6",children:[(0,a.jsx)("div",{className:"text-5xl font-bold text-gray-900 mb-2",children:y}),(0,a.jsx)("div",{className:"flex justify-center mb-2",children:(0,a.jsx)(o.Z,{rating:Number(y),readOnly:!0,size:24})}),(0,a.jsxs)("p",{className:"text-muted-foreground",children:[v," Reviews"]})]}),(0,a.jsx)("div",{className:"space-y-3",children:j.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-3 text-sm",children:[(0,a.jsx)("span",{className:"w-3 font-medium",children:e.stars}),(0,a.jsx)(l.Z,{className:"w-4 h-4 text-gray-300"}),(0,a.jsx)(F,{value:e.percentage,className:"h-2"}),(0,a.jsx)("span",{className:"w-8 text-right text-muted-foreground",children:e.count})]},e.stars))}),(0,a.jsxs)("div",{className:"mt-8 pt-6 border-t",children:[(0,a.jsx)("h4",{className:"font-semibold mb-2",children:"Review this product"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Share your thoughts with other customers."}),(0,a.jsx)(d.z,{onClick:()=>p(!0),className:"w-full",children:"Write a Review"})]})]})}),(0,a.jsx)("div",{className:"lg:col-span-8",children:m?(0,a.jsx)("div",{className:"space-y-4",children:[1,2,3].map(e=>(0,a.jsx)("div",{className:"h-32 bg-gray-100 animate-pulse rounded-lg"},e))}):0===c.length?(0,a.jsxs)("div",{className:"text-center py-12 border rounded-xl border-dashed bg-gray-50/50",children:[(0,a.jsx)(l.Z,{className:"w-12 h-12 text-gray-200 mx-auto mb-3"}),(0,a.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:"No reviews yet"}),(0,a.jsx)("p",{className:"text-gray-500 mb-6",children:"Be the first to share your experience!"}),(0,a.jsx)(d.z,{variant:"outline",onClick:()=>p(!0),children:"Write a Review"})]}):(0,a.jsx)("div",{className:"space-y-6",children:c.map(e=>(0,a.jsxs)("div",{className:"bg-white p-6 rounded-xl border",children:[(0,a.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(P,{className:"h-10 w-10",children:(0,a.jsx)(M,{className:"bg-primary/10 text-primary",children:e.reviewerName.substring(0,2).toUpperCase()})}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,a.jsx)("span",{className:"font-semibold text-sm",children:e.reviewerName}),e.verified&&(0,a.jsx)(z.C,{variant:"secondary",className:"text-[10px] h-5 px-2 bg-green-100 text-green-800 hover:bg-green-100",children:"Verified Purchase"})]})]}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:new Date(e.createdAt).toLocaleDateString()})]}),e.title&&(0,a.jsx)("h5",{className:"font-bold mb-2",children:e.title}),(0,a.jsx)("div",{className:"prose prose-sm text-gray-700 mb-4",children:(0,a.jsx)("p",{children:e.content})}),e.image&&(0,a.jsx)("div",{className:"relative h-24 w-24 rounded-md overflow-hidden border",children:(0,a.jsx)(n(),{src:e.image,alt:"Review",fill:!0,className:"object-cover"})})]},e.id))})})]}),(0,a.jsx)(f,{isOpen:h,onClose:()=>p(!1),productId:t,productName:r,productImage:i,onReviewSubmitted:g})]})]})}},60914:function(e,t,r){"use strict";r.r(t),r.d(t,{RecentlyViewed:function(){return u}});var a=r(57437),s=r(2265),i=r(61396),n=r.n(i),l=r(16691),o=r.n(l),d=r(68329),c=r(12284);function u(){let[e,t]=(0,s.useState)([]),{language:r,t:i}=(0,c.Z)();return((0,s.useEffect)(()=>{try{let e=localStorage.getItem("musafoods_recently_viewed");e&&t(JSON.parse(e))}catch(e){console.error("Failed to load recently viewed products",e)}},[]),0===e.length)?null:(0,a.jsx)("section",{className:"py-12 border-t border-gray-100 dark:border-gray-800",children:(0,a.jsxs)("div",{className:"container mx-auto px-4",children:[(0,a.jsx)("h2",{className:"text-2xl font-bold mb-6 text-gray-900 dark:text-white",children:"en"===r?"Recently Viewed":"Consult\xe9s r\xe9cemment"}),(0,a.jsx)("div",{className:"flex gap-4 overflow-x-auto pb-4 scrollbar-hide snap-x",children:e.map((e,t)=>(0,a.jsx)(d.E.div,{className:"flex-shrink-0 w-[200px] snap-start",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.05*t},children:(0,a.jsxs)(n(),{href:"/product/".concat(e.slug),className:"group block bg-white dark:bg-gray-800 rounded-lg overflow-hidden border border-gray-100 dark:border-gray-700 hover:shadow-md transition-shadow",children:[(0,a.jsx)("div",{className:"relative aspect-square bg-gray-50 dark:bg-gray-900",children:(0,a.jsx)(o(),{src:e.image,alt:"en"===r?e.nameEn:e.nameFr,fill:!0,className:"object-cover group-hover:scale-105 transition-transform duration-300",sizes:"200px"})}),(0,a.jsxs)("div",{className:"p-3",children:[(0,a.jsx)("h3",{className:"text-sm font-medium text-gray-900 dark:text-white line-clamp-2 min-h-[2.5em]",children:"en"===r?e.nameEn:e.nameFr}),e.price>0&&(0,a.jsxs)("div",{className:"mt-2 text-sm font-bold text-primary",children:["$",e.price.toFixed(2)]})]})]})},"".concat(e.id,"-").concat(t)))})]})})}},13233:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return p}});var a=r(57437),s=r(12284),i=r(2265),n=r(83474),l=r(17158);(0,r(65531).Z)("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);var o=r(39311);let d=i.forwardRef((e,t)=>{let{...r}=e;return(0,a.jsx)("nav",{ref:t,"aria-label":"breadcrumb",...r})});d.displayName="Breadcrumb";let c=i.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("ol",{ref:t,className:(0,o.cn)("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",r),...s})});c.displayName="BreadcrumbList";let u=i.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("li",{ref:t,className:(0,o.cn)("inline-flex items-center gap-1.5",r),...s})});u.displayName="BreadcrumbItem";let m=i.forwardRef((e,t)=>{let{asChild:r,className:s,...i}=e,l=r?n.g7:"a";return(0,a.jsx)(l,{ref:t,className:(0,o.cn)("transition-colors hover:text-foreground",s),...i})});m.displayName="BreadcrumbLink";let x=i.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("span",{ref:t,role:"link","aria-disabled":"true","aria-current":"page",className:(0,o.cn)("font-normal text-foreground",r),...s})});x.displayName="BreadcrumbPage";let h=e=>{let{children:t,className:r,...s}=e;return(0,a.jsx)("li",{role:"presentation","aria-hidden":"true",className:(0,o.cn)("[&>svg]:size-3.5",r),...s,children:null!=t?t:(0,a.jsx)(l.Z,{})})};function p(e){let{productNameEn:t,productNameFr:r,category:i}=e,{language:n,t:l}=(0,s.Z)(),o=i?"en"===n?i.nameEn:i.nameFr||i.nameEn:null;return(0,a.jsx)(d,{className:"mb-6",children:(0,a.jsxs)(c,{children:[(0,a.jsx)(u,{children:(0,a.jsx)(m,{href:"/",children:l.productDetail.breadcrumb.home})}),(0,a.jsx)(h,{}),(0,a.jsx)(u,{children:(0,a.jsx)(m,{href:"/products",children:l.productDetail.breadcrumb.products})}),(0,a.jsx)(h,{}),i&&o&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u,{children:(0,a.jsx)(m,{href:"/products?category=".concat(i.slug),children:o})}),(0,a.jsx)(h,{})]}),(0,a.jsx)(u,{children:(0,a.jsx)(x,{children:"en"===n?t:r||t})})]})})}h.displayName="BreadcrumbSeparator"},54852:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return p}});var a=r(57437),s=r(68329),i=r(2265),n=r(39311),l=r(16691),o=r.n(l),d=r(61396),c=r.n(d);let u=i.forwardRef((e,t)=>{let{className:r,slug:i,imageUrl:l,name:d,tagline:u,price:m,unit:x,origin:h,...p}=e;return(0,a.jsx)(c(),{href:"/product/".concat(i),className:"block h-full",children:(0,a.jsxs)(s.E.div,{ref:t,className:(0,n.cn)("group relative flex h-full w-full flex-col items-center justify-start overflow-hidden rounded-xl border bg-card p-6 text-center text-card-foreground shadow-sm transition-all duration-300 ease-in-out hover:shadow-lg",r),whileHover:{y:-5},transition:{type:"spring",stiffness:300},...p,children:[(0,a.jsx)("div",{className:"relative mb-4 flex h-44 w-full items-center justify-center overflow-hidden rounded-lg bg-gray-50 dark:bg-gray-800",children:(0,a.jsx)(o(),{src:l,alt:d,fill:!0,className:"object-contain p-2 transition-transform duration-300 group-hover:scale-105",sizes:"(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 25vw"})}),(0,a.jsxs)("div",{className:"flex flex-grow flex-col items-center gap-1.5",children:[(0,a.jsx)("h3",{className:"font-semibold text-gray-900 dark:text-white line-clamp-2 leading-snug",children:d}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2",children:u})]}),(0,a.jsxs)("div",{className:"mt-4 flex flex-col items-center gap-2 w-full",children:[m&&m>0?(0,a.jsxs)("span",{className:"text-xl font-bold text-gray-900 dark:text-white",children:["$",m.toFixed(2),x&&(0,a.jsxs)("span",{className:"text-sm font-normal text-muted-foreground ml-1",children:["/ ",x]})]}):null,h&&(0,a.jsx)("div",{className:"flex items-center gap-1.5 rounded-full bg-primary/10 px-3 py-1 text-xs",children:(0,a.jsx)("span",{className:"font-medium text-primary",children:h})})]})]})})});u.displayName="ProductCard2";var m=r(12284);let x={hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1}}},h={hidden:{y:20,opacity:0},visible:{y:0,opacity:1,transition:{type:"spring",stiffness:100,damping:10}}};function p(e){let{sameCategory:t,otherProducts:r,categoryNameEn:i,categoryNameFr:n}=e,{language:l}=(0,m.Z)(),o=e=>{let t="en"===l?e.descriptionEn:e.descriptionFr,r=(null==t?void 0:t.replace(/<[^>]*>/g,""))||"";return r.length>80?r.substring(0,80).replace(/\s+\S*$/,"")+"…":r};return(0,a.jsxs)("div",{className:"space-y-16",children:[t.length>0&&(0,a.jsxs)("section",{children:[(0,a.jsx)("div",{className:"mb-8 text-center",children:(0,a.jsx)("h2",{className:"text-3xl font-bold tracking-tight text-primary",children:"en"===l?"More from ".concat(i||"This Category"):"Plus de ".concat(n||i||"cette cat\xe9gorie")})}),(0,a.jsx)(s.E.div,{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-4",variants:x,initial:"hidden",whileInView:"visible",viewport:{once:!0,margin:"-50px"},children:t.map(e=>(0,a.jsx)(s.E.div,{variants:h,children:(0,a.jsx)(u,{slug:e.slug,imageUrl:e.image,name:"en"===l?e.nameEn:e.nameFr,tagline:o(e),price:e.price,unit:e.unit,origin:e.origin})},e.id))})]}),r.length>0&&(0,a.jsxs)("section",{children:[(0,a.jsx)("div",{className:"mb-8 text-center",children:(0,a.jsx)("h2",{className:"text-3xl font-bold tracking-tight text-primary",children:"en"===l?"You May Also Like":"Vous Aimerez Aussi"})}),(0,a.jsx)(s.E.div,{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-4",variants:x,initial:"hidden",whileInView:"visible",viewport:{once:!0,margin:"-50px"},children:r.map(e=>(0,a.jsx)(s.E.div,{variants:h,children:(0,a.jsx)(u,{slug:e.slug,imageUrl:e.image,name:"en"===l?e.nameEn:e.nameFr,tagline:o(e),price:e.price,unit:e.unit,origin:e.origin})},e.id))})]})]})}},8866:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var a=r(57437),s=r(2265),i=r(55340),n=r(39311),l=r(68329);function o(e){let{rating:t,setRating:r,readOnly:o=!1,size:d=20}=e,[c,u]=(0,s.useState)(0),m=c||t;return(0,a.jsx)("div",{className:"flex gap-1",children:[1,2,3,4,5].map(e=>(0,a.jsx)(l.E.button,{type:"button",whileHover:{scale:o?1:1.2},whileTap:{scale:o?1:.9},onClick:()=>!o&&r&&r(e),onMouseEnter:()=>!o&&u(e),onMouseLeave:()=>!o&&u(0),className:(0,n.cn)("focus:outline-none transition-colors duration-200",o?"cursor-default":"cursor-pointer"),disabled:o,children:(0,a.jsx)(i.Z,{size:d,className:(0,n.cn)("transition-all",e<=m?"fill-[#D4AF37] text-[#D4AF37]":"fill-transparent text-gray-300")})},e))})}},12609:function(e,t,r){"use strict";r.d(t,{$N:function(){return h},Be:function(){return p},Vq:function(){return o},cZ:function(){return m},fK:function(){return x},hg:function(){return d}});var a=r(57437),s=r(2265),i=r(79515),n=r(82549),l=r(39311);let o=i.fC,d=i.xz,c=i.h_;i.x8;let u=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(i.aV,{ref:t,className:(0,l.cn)("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...s})});u.displayName=i.aV.displayName;let m=s.forwardRef((e,t)=>{let{className:r,children:s,...o}=e;return(0,a.jsxs)(c,{children:[(0,a.jsx)(u,{}),(0,a.jsxs)(i.VY,{ref:t,className:(0,l.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...o,children:[s,(0,a.jsxs)(i.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});m.displayName=i.VY.displayName;let x=e=>{let{className:t,...r}=e;return(0,a.jsx)("div",{className:(0,l.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...r})};x.displayName="DialogHeader";let h=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(i.Dx,{ref:t,className:(0,l.cn)("text-lg font-semibold leading-none tracking-tight",r),...s})});h.displayName=i.Dx.displayName;let p=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(i.dk,{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",r),...s})});p.displayName=i.dk.displayName},48135:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return j}});var a=r(57437),s=r(2265),i=r(16691),n=r.n(i),l=r(55340),o=r(73067),d=r(68291),c=r(62442),u=r(11961),m=r(65531);/**
 * @license lucide-react v0.446.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let x=(0,m.Z)("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var h=r(86712),p=r(93023),g=r(39311),f=r(95599),y=r(62621),v=r(12284);function j(e){let{product:t}=e,{addItem:r}=(0,f.j)(),{toast:i}=(0,y.pm)(),{language:m,t:j}=(0,v.Z)(),[b,N]=(0,s.useState)(0),[w,k]=(0,s.useState)(t.variants&&t.variants.length>0?t.variants[0]:null),[S,E]=(0,s.useState)(1),[C,D]=(0,s.useState)("details"),R=[t.image,...t.gallery||[]].filter(Boolean),T=t.price||0,_=t.rating||0,A=t.reviewCount||0,O="en"===m?t.nameEn:t.nameFr,I="en"===m?t.descriptionEn:t.descriptionFr,P=t.highlights&&t.highlights.length>0?t.highlights:"en"===m?["High quality ingredients","Authentic taste","Premium packaging"]:["Ingr\xe9dients de haute qualit\xe9","Go\xfbt authentique","Emballage premium"],Z={details:j.productDetail.tabs.details,shipping:j.productDetail.tabs.shipping},M=(e=>{let t="undefined"!=typeof document?document.createElement("div"):null;return t?(t.innerHTML=e,t.textContent||t.innerText||""):e.replace(/<[^>]*>/g,"")})(I),F=M.length>250?M.substring(0,250).replace(/\s+\S*$/,"")+"…":M;return(0,s.useEffect)(()=>{try{let e=localStorage.getItem("musafoods_recently_viewed"),r=e?JSON.parse(e):[];r=r.filter(e=>e.id!==t.id);let a={id:t.id,slug:t.slug,nameEn:t.nameEn,nameFr:t.nameFr,image:t.image,price:t.price||0,category:t.category};r.unshift(a),r.length>10&&(r=r.slice(0,10)),localStorage.setItem("musafoods_recently_viewed",JSON.stringify(r))}catch(e){console.error("Error saving recently viewed",e)}},[t]),(0,a.jsx)("div",{className:"bg-white dark:bg-gray-900 font-sans",children:(0,a.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-x-12 gap-y-8",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("div",{className:"relative aspect-square overflow-hidden rounded-2xl bg-gray-100 dark:bg-gray-800 mb-4",children:[R.length>0?(0,a.jsx)(n(),{src:R[b],alt:"".concat(O," - View ").concat(b+1),fill:!0,className:"object-cover w-full h-full",priority:!0}):(0,a.jsx)("div",{className:"flex items-center justify-center h-full text-gray-400",children:"No Image"}),R.length>1&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{onClick:()=>{N(e=>0===e?R.length-1:e-1)},className:"absolute top-1/2 left-4 -translate-y-1/2 bg-white dark:bg-gray-800 rounded-full p-2 shadow-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary","aria-label":"Previous image",children:(0,a.jsx)(o.Z,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"})}),(0,a.jsx)("button",{onClick:()=>{N(e=>e===R.length-1?0:e+1)},className:"absolute top-1/2 right-4 -translate-y-1/2 bg-white dark:bg-gray-800 rounded-full p-2 shadow-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary","aria-label":"Next image",children:(0,a.jsx)(d.Z,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"})})]})]}),R.length>1&&(0,a.jsx)("div",{className:"grid grid-cols-4 gap-4",children:R.map((e,t)=>(0,a.jsx)("button",{onClick:()=>N(t),className:(0,g.cn)("aspect-square rounded-lg overflow-hidden border-2",b===t?"border-primary dark:border-primary":"border-transparent"),children:(0,a.jsx)("div",{className:"relative w-full h-full",children:(0,a.jsx)(n(),{src:e,alt:"Thumbnail ".concat(t+1),fill:!0,className:"object-cover",sizes:"(max-width: 640px) 25vw, 120px"})})},t))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"mb-2 flex justify-between items-start",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl sm:text-3xl font-bold text-gray-900 dark:text-white mb-1",children:O}),(0,a.jsx)("div",{className:"flex items-center gap-2",children:A>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex items-center space-x-1",children:(e=>{let t=[];for(let r=1;r<=5;r++){let s=r<=Math.round(e);t.push((0,a.jsx)(l.Z,{className:(0,g.cn)("w-4 h-4",s?"fill-amber-400 text-amber-400":"text-gray-300")},r))}return t})(_)}),(0,a.jsxs)("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:[_.toFixed(1)," (",A," ",j.productDetail.reviews,")"]})]}):(0,a.jsx)("span",{className:"text-sm text-gray-500 italic",children:"No reviews yet"})})]})}),(0,a.jsxs)("div",{className:"mt-4 mb-6",children:[T>0&&(0,a.jsxs)("span",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:["$",T.toFixed(2)]}),t.stockStatus&&(0,a.jsx)("span",{className:(0,g.cn)("ml-2 text-sm font-medium","In Stock"===t.stockStatus?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"),children:"In Stock"===t.stockStatus?j.productDetail.inStock:j.productDetail.outOfStock})]}),(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)("p",{className:"text-gray-700 dark:text-gray-300 leading-relaxed",children:F}),M.length>250&&(0,a.jsxs)("a",{href:"#full-description",className:"inline-flex items-center mt-2 text-primary hover:text-primary/80 font-medium text-sm transition-colors",onClick:e=>{var t;e.preventDefault(),null===(t=document.getElementById("full-description"))||void 0===t||t.scrollIntoView({behavior:"smooth"})},children:[j.productDetail.readMore," →"]}),P.length>0&&(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:j.productDetail.highlights}),(0,a.jsx)("ul",{className:"space-y-2",children:P.map((e,t)=>(0,a.jsxs)("li",{className:"flex items-center",children:[(0,a.jsx)(c.Z,{className:"w-5 h-5 text-green-500 dark:text-green-400 mr-2 flex-shrink-0"}),(0,a.jsx)("span",{className:"text-gray-700 dark:text-gray-300",children:e})]},t))})]})]}),(0,a.jsx)("div",{className:"mb-6 border-b border-gray-200 dark:border-gray-700",children:(0,a.jsx)("nav",{className:"flex space-x-8","aria-label":"Product information tabs",children:["details","shipping"].map(e=>(0,a.jsx)("button",{onClick:()=>D(e),className:(0,g.cn)("py-4 px-1 border-b-2 font-medium text-sm transition-colors",C===e?"border-primary text-primary dark:border-primary dark:text-primary":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300 dark:hover:border-gray-600"),children:Z[e]},e))})}),(0,a.jsxs)("div",{className:"mb-8 min-h-[80px]",children:["details"===C&&(0,a.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300 text-gray-700 dark:text-gray-300 space-y-4",children:(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"font-semibold block text-gray-900 dark:text-gray-100",children:j.productDetail.labels.sku}),(0,a.jsx)("span",{children:(null==w?void 0:w.sku)||t.sku||t.id})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"font-semibold block text-gray-900 dark:text-gray-100",children:j.productDetail.labels.origin}),(0,a.jsx)("span",{children:t.origin||"N/A"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"font-semibold block text-gray-900 dark:text-gray-100",children:j.productDetail.labels.minOrder}),(0,a.jsx)("span",{children:t.minOrder||"N/A"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"font-semibold block text-gray-900 dark:text-gray-100",children:j.productDetail.labels.category}),(0,a.jsx)("span",{className:"capitalize",children:t.category||"N/A"})]})]})}),"shipping"===C&&(0,a.jsxs)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300 space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(u.Z,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 mr-3"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-medium text-gray-900 dark:text-white",children:j.productDetail.shipping.fastDelivery}),(0,a.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:j.productDetail.shipping.fastDeliveryDesc})]})]}),(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(x,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 mr-3"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-medium text-gray-900 dark:text-white",children:j.productDetail.shipping.qualityGuarantee}),(0,a.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:j.productDetail.shipping.qualityGuaranteeDesc})]})]})]})]}),t.variants&&t.variants.length>0&&(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)("h3",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:j.productDetail.sizeVariant}),(0,a.jsx)("div",{className:"flex flex-wrap gap-3",children:t.variants.map(e=>(0,a.jsx)("button",{onClick:()=>k(e),className:(0,g.cn)("border rounded-md py-2 px-4 flex items-center justify-center text-sm font-medium transition-all",(null==w?void 0:w.id)===e.id?"bg-primary border-primary text-primary-foreground dark:bg-primary dark:border-primary ring-2 ring-primary/20 dark:ring-primary/20":"border-gray-200 text-gray-900 dark:border-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800"),children:e.size},e.id))})]}),(0,a.jsx)("div",{className:"mt-8 pt-6 border-t border-gray-100 dark:border-gray-800 sticky bottom-0 z-20 bg-white dark:bg-gray-900 pb-4 lg:static lg:bg-transparent lg:pb-0",children:(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center border border-gray-300 dark:border-gray-600 rounded-md w-max",children:[(0,a.jsxs)("button",{onClick:()=>{S>1&&E(S-1)},className:"p-3 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors",disabled:S<=1,children:[(0,a.jsx)("span",{className:"sr-only",children:"Decrease quantity"}),(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M20 12H4"})})]}),(0,a.jsx)("input",{type:"text",value:S,readOnly:!0,className:"w-12 text-center border-0 focus:ring-0 bg-transparent text-gray-900 dark:text-white font-medium"}),(0,a.jsxs)("button",{onClick:()=>{E(S+1)},className:"p-3 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors",children:[(0,a.jsx)("span",{className:"sr-only",children:"Increase quantity"}),(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 4v16m8-8H4"})})]})]}),(0,a.jsxs)(p.z,{onClick:()=>{r(t,w||void 0,S),i({title:j.productDetail.addedToQuote,description:"".concat(S,"x ").concat(O," ").concat(j.productDetail.addedToQuoteDesc)})},className:"flex-1 bg-primary hover:bg-primary/90 text-primary-foreground py-6 text-lg shadow-lg shadow-primary/20 dark:shadow-none",children:[(0,a.jsx)(h.Z,{className:"w-5 h-5 mr-2"}),j.productDetail.addToQuote]})]})})]})]}),M.length>250&&(0,a.jsxs)("div",{id:"full-description",className:"mt-12 pt-8 border-t border-gray-200 dark:border-gray-700",children:[(0,a.jsx)("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white mb-6",children:j.productDetail.fullDescription}),(0,a.jsx)("div",{className:"prose prose-lg dark:prose-invert max-w-none text-gray-700 dark:text-gray-300",dangerouslySetInnerHTML:{__html:I}})]})]})})}},66672:function(e,t,r){"use strict";r.d(t,{_:function(){return d}});var a=r(57437),s=r(2265),i=r(36743),n=r(96061),l=r(39311);let o=(0,n.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(i.f,{ref:t,className:(0,l.cn)(o(),r),...s})});d.displayName=i.f.displayName},55771:function(e,t,r){"use strict";r.d(t,{g:function(){return n}});var a=r(57437),s=r(2265),i=r(39311);let n=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("textarea",{className:(0,i.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...s})});n.displayName="Textarea"},62621:function(e,t,r){"use strict";r.d(t,{pm:function(){return m}});var a=r(2265);let s=0,i=new Map,n=e=>{if(i.has(e))return;let t=setTimeout(()=>{i.delete(e),c({type:"REMOVE_TOAST",toastId:e})},1e6);i.set(e,t)},l=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:r}=t;return r?n(r):e.toasts.forEach(e=>{n(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===r||void 0===r?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},o=[],d={toasts:[]};function c(e){d=l(d,e),o.forEach(e=>{e(d)})}function u(e){let{...t}=e,r=(s=(s+1)%Number.MAX_SAFE_INTEGER).toString(),a=()=>c({type:"DISMISS_TOAST",toastId:r});return c({type:"ADD_TOAST",toast:{...t,id:r,open:!0,onOpenChange:e=>{e||a()}}}),{id:r,dismiss:a,update:e=>c({type:"UPDATE_TOAST",toast:{...e,id:r}})}}function m(){let[e,t]=a.useState(d);return a.useEffect(()=>(o.push(t),()=>{let e=o.indexOf(t);e>-1&&o.splice(e,1)}),[e]),{...e,toast:u,dismiss:e=>c({type:"DISMISS_TOAST",toastId:e})}}},63388:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{suspense:function(){return s},NoSSR:function(){return i}}),r(21024),r(2265);let a=r(54922);function s(){let e=Error(a.NEXT_DYNAMIC_NO_SSR_CODE);throw e.digest=a.NEXT_DYNAMIC_NO_SSR_CODE,e}function i(e){let{children:t}=e;return t}},99808:function(e,t,r){"use strict";/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var a=r(2265),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=a.useState,n=a.useEffect,l=a.useLayoutEffect,o=a.useDebugValue;function d(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!s(e,r)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),a=i({inst:{value:r,getSnapshot:t}}),s=a[0].inst,c=a[1];return l(function(){s.value=r,s.getSnapshot=t,d(s)&&c({inst:s})},[e,r,t]),n(function(){return d(s)&&c({inst:s}),e(function(){d(s)&&c({inst:s})})},[e]),o(r),r};t.useSyncExternalStore=void 0!==a.useSyncExternalStore?a.useSyncExternalStore:c},26272:function(e,t,r){"use strict";e.exports=r(99808)},36743:function(e,t,r){"use strict";r.d(t,{f:function(){return l}});var a=r(2265),s=r(31033),i=r(57437),n=a.forwardRef((e,t)=>(0,i.jsx)(s.WV.label,{...e,ref:t,onMouseDown:t=>{let r=t.target;r.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));n.displayName="Label";var l=n}},function(e){e.O(0,[6207,415,9906,1396,389,2774,9213,4636,1424,2587,6053,2971,7864,1744],function(){return e(e.s=38794)}),_N_E=e.O()}]);