File manager - Edit - /home/webapp69.cm.in.th/u69319090023/Shop23/_next/static/chunks/3tb6lu1ypqhd5.js
Back
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,36548,e=>{"use strict";var t=e.i(43476),s=e.i(71645),r=e.i(18566),l=e.i(23067),a=e.i(57688),i=e.i(22016),c=e.i(86563),n=e.i(63448),o=e.i(11241),d=e.i(77071),x=e.i(35829),m=e.i(84026),h=e.i(76248),p=e.i(24071),u=e.i(67927),f=e.i(70387),g=e.i(75183);let b=(0,e.i(56420).default)("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"}]]);var j=e.i(79258),w=e.i(82625),y=e.i(63676),v=e.i(46932),N=e.i(88653),k=e.i(93123);let S=({product:e,relatedProducts:l})=>{let S,C="en"===localStorage.getItem("lang"),[A,F]=(0,s.useState)(!1),{addItem:P,cartItemsCount:L}=(0,k.useCart)(),z=(0,r.useRouter)(),[I,E]=(0,s.useState)(e.sizes.length>0?e.sizes[0]:"Free Size"),[M,O]=(0,s.useState)(1),[D,_]=(0,s.useState)(0),[T,B]=(0,s.useState)(!1),[W,$]=(0,s.useState)(null),[U,H]=(0,s.useState)(!1),[R,q]=(0,s.useState)(!1),[G,J]=(0,s.useState)(null),[X,V]=(0,s.useState)(e.reviews||[]),[K,Y]=(0,s.useState)(e.rating),[Q,Z]=(0,s.useState)(e.reviewsCount),[ee,et]=(0,s.useState)(""),[es,er]=(0,s.useState)(5),[el,ea]=(0,s.useState)("");(0,s.useEffect)(()=>{V(e.reviews||[]),Y(e.rating),Z(e.reviewsCount)},[e]),(0,s.useEffect)(()=>{q(JSON.parse(localStorage.getItem("wishlist")||"[]").includes(e.id))},[e.id]);let ei=e=>{J(e),setTimeout(()=>{J(null)},2500)};(0,s.useEffect)(()=>{e.videoUrl&&e.videoUrl.startsWith("db_video_")&&(async()=>{try{let t=indexedDB.open("ctc_video_db",1);t.onsuccess=()=>{let s=t.result;if(s.objectStoreNames.contains("videos")){let t=s.transaction("videos","readonly").objectStore("videos").get(e.videoUrl);t.onsuccess=()=>{if(t.result&&t.result.file){let e=URL.createObjectURL(t.result.file);$(e)}}}}}catch(e){console.error(e)}})()},[e.videoUrl]);let ec=(()=>{let t=e.merchantEmail;if(t){let e=localStorage.getItem("ctc_products"),s=(e?JSON.parse(e):[]).filter(e=>e.merchantEmail&&e.merchantEmail.toLowerCase()===t.toLowerCase()).length,r=localStorage.getItem("store_settings_"+t);if(r){let e=JSON.parse(r);return{name:e.storeName||"ร้านค้าสมาชิกแผนกวิชา",logo:e.storeLogo||"🏬",type:"ร้านค้าสมาชิกที่ลงทะเบียน",description:e.storeDescription||"ข้อมูลร้านค้าสาขาวิชาเพื่อบริการนักศึกษาอย่างครบวงจร",productsCount:s||1,rating:4.8,email:t}}let l=localStorage.getItem("ctc_accounts");if(l)try{let e=JSON.parse(l).find(e=>e.email.toLowerCase()===t.toLowerCase());if(e)return{name:e.fullName,logo:e.logo||"🏬",type:e.storeType||"ร้านค้าแผนก",description:e.description||"ข้อมูลร้านค้าสาขาวิชาเพื่อบริการนักศึกษาอย่างครบวงจร",productsCount:s||1,rating:4.9,email:t}}catch(e){console.error(e)}}return e.departmentSlugs?.includes("automotive")||e.departmentSlugs?.includes("mechanical")?{name:"ร้านปฏิบัติงานแผนกช่างยนต์",logo:"🔧",type:"แผนกวิชาช่างยนต์",description:"ศูนย์ฝึกงานและจำหน่ายเสื้อช็อป อุปกรณ์นิรภัย และเครื่องมือประจำสาขา",productsCount:4,rating:4.8,email:"automotive@cmtc.ac.th"}:e.departmentSlugs?.includes("electrical-power")||e.departmentSlugs?.includes("electronics")?{name:"ร้านค้าช่างไฟฟ้าและอิเล็กทรอนิกส์",logo:"⚡",type:"แผนกวิชาช่างไฟฟ้า",description:"จัดจำหน่ายอุปกรณ์อิเล็กทรอนิกส์ เสื้อช็อปปฏิบัติงาน และชุดเครื่องมือมาตรฐาน",productsCount:3,rating:4.7,email:"electric@cmtc.ac.th"}:"cat_tshirt"===e.categoryId||"cat_accessories"===e.categoryId?{name:"ร้านช็อปชมรมเสื้อยืด",logo:"👕",type:"กิจกรรมและชมรมวิทยาลัย",description:"เสื้อยืดพิมพ์ลายของแท้ หมวกแก๊ป และของที่ระลึกสำหรับนักศึกษาทุกระดับชั้น",productsCount:6,rating:5,email:"tshirt_club@cmtc.ac.th"}:{name:"ร้านสหกรณ์วิทยาลัยเทคนิคเชียงใหม่",logo:"🎓",type:"สหกรณ์วิทยาลัย",description:"สินค้าลิขสิทธิ์ทางการ ปลอกคอ เข็มขัด และคูปองฝึกงานส่วนกลาง",productsCount:5,rating:4.9,email:"crest_shop@cmtc.ac.th"}})(),en=(()=>{let t=localStorage.getItem("ctc_products"),s=t?JSON.parse(t):[];if(e.merchantEmail){let t=s.filter(t=>t.id!==e.id&&t.merchantEmail&&t.merchantEmail.toLowerCase()===e.merchantEmail?.toLowerCase());if(t.length>0)return t.slice(0,4)}return s.filter(t=>t.id!==e.id&&(t.categoryId===e.categoryId||t.departmentSlugs&&t.departmentSlugs.some(t=>e.departmentSlugs?.includes(t)))).slice(0,4)})(),[eo,ed]=(0,s.useState)(null),[ex,em]=(0,s.useState)(null),eh=()=>{_(t=>t===e.images.length-1?0:t+1)},ep=()=>{_(t=>0===t?e.images.length-1:t-1)},eu=e.compareAtPrice&&e.compareAtPrice>e.price,ef=e=>{let t=M+e;t>=1&&O(t)};return(0,t.jsxs)("div",{className:"bg-[#F8F9FA] min-h-screen",children:[(0,t.jsxs)("header",{className:"md:hidden fixed top-0 left-0 right-0 h-14 bg-white border-b border-gray-100/85 flex items-center justify-between px-4 z-40",children:[(0,t.jsx)(i.default,{href:"/products",className:"p-1.5 hover:bg-gray-50 rounded-full transition-colors text-gray-600 flex items-center justify-center",children:(0,t.jsx)(p.ChevronLeft,{className:"w-5 h-5 stroke-[2.5]"})}),(0,t.jsxs)("div",{className:"flex items-center space-x-1.5",children:[(0,t.jsx)("div",{className:"relative w-6 h-6",children:(0,t.jsx)(a.default,{src:"/u69319090023/Shop23/logo_crest.png",alt:"CMTC SHOP Logo",fill:!0,className:"object-contain"})}),(0,t.jsx)("span",{className:"text-[11px] font-black text-gray-800 uppercase tracking-widest font-prompt",children:"CMTC SHOP"})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-1.5",children:[(0,t.jsx)(i.default,{href:"/products",className:"p-2 text-gray-600 hover:text-gray-900 transition-colors flex items-center justify-center",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",className:"w-5 h-5",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.637 10.637z"})})}),(0,t.jsxs)(i.default,{href:"/cart",className:"p-2 text-gray-600 hover:text-gray-900 transition-colors relative flex items-center justify-center",children:[(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",className:"w-5 h-5",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 10.5V6a3.75 3.75 0 10-7.5 0v4.5m11.356-1.993l1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 01-1.12-1.243l1.264-12A1.125 1.125 0 015.513 7.5h12.974c.576 0 1.059.435 1.119 1.007zM8.625 10.5h6.75"})}),L>0&&(0,t.jsx)("span",{className:"absolute top-1 right-1 w-3.5 h-3.5 bg-[#800A0A] text-white text-[8px] font-bold rounded-full flex items-center justify-center shadow-[0_0_6px_rgba(128,10,10,0.4)]",children:L})]})]})]}),(0,t.jsxs)("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 pt-20 md:pt-28 pb-8 font-prompt",children:[(0,t.jsx)("div",{className:"hidden md:flex mb-6 justify-start",children:(0,t.jsxs)(i.default,{href:"/products",className:"flex items-center text-xs font-bold text-gray-400 hover:text-[#800A0A] transition-colors uppercase tracking-wider",children:[(0,t.jsx)(o.ArrowLeft,{className:"w-4 h-4 mr-1.5"}),(0,t.jsx)("span",{children:"ย้อนกลับไปหน้ารวมสินค้า"})]})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-8 lg:gap-12 md:bg-white md:border md:border-gray-100 p-0 md:p-8 md:rounded-2xl md:shadow-sm mb-12",children:[(0,t.jsxs)("div",{className:"md:col-span-7 md:sticky md:top-20 h-fit space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-col-reverse md:flex-row gap-4",children:[e.images.length>1&&(0,t.jsx)("div",{className:"flex md:flex-col gap-3 overflow-x-auto md:overflow-y-auto scrollbar-none w-full md:w-16 flex-shrink-0 max-h-[500px] py-1 select-none",children:e.images.map((s,r)=>(0,t.jsx)("button",{type:"button",onClick:()=>_(r),className:`relative w-16 h-16 rounded-xl bg-[#F8F9FA] p-1 border-2 transition-all cursor-pointer aspect-square flex-shrink-0 ${D===r?"border-[#800A0A] opacity-100 scale-100":"border-transparent opacity-60 hover:opacity-100"}`,children:(0,t.jsx)(a.default,{src:s,alt:`${e.name} thumbnail`,fill:!0,className:"object-contain p-0.5"})},r))}),(0,t.jsx)("div",{className:"flex-1 min-w-0",children:(0,t.jsxs)("div",{onTouchStart:e=>{ed(e.targetTouches[0].clientX)},onTouchMove:e=>{em(e.targetTouches[0].clientX)},onTouchEnd:()=>{if(!eo||!ex)return;let e=eo-ex;e>50?eh():e<-50&&ep(),ed(null),em(null)},className:"group/carousel relative aspect-square w-full rounded-2xl overflow-hidden bg-[#F8F9FA] flex items-center justify-center select-none",children:[(0,t.jsx)("div",{className:"relative w-full h-full p-4 sm:p-8 mix-blend-multiply",children:(0,t.jsx)(a.default,{src:e.images[D],alt:e.name,fill:!0,priority:!0,className:"object-contain transition-all duration-300"})}),e.images.length>1&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:ep,className:"absolute left-4 top-1/2 -translate-y-1/2 bg-white/70 hover:bg-white text-gray-800 rounded-full p-2 shadow-md transition-all opacity-0 group-hover/carousel:opacity-100 flex items-center justify-center cursor-pointer z-10 hover:scale-105","aria-label":"Previous image",children:(0,t.jsx)(p.ChevronLeft,{className:"w-5 h-5"})}),(0,t.jsx)("button",{type:"button",onClick:eh,className:"absolute right-4 top-1/2 -translate-y-1/2 bg-white/70 hover:bg-white text-gray-800 rounded-full p-2 shadow-md transition-all opacity-0 group-hover/carousel:opacity-100 flex items-center justify-center cursor-pointer z-10 hover:scale-105","aria-label":"Next image",children:(0,t.jsx)(u.ChevronRight,{className:"w-5 h-5"})})]}),e.images.length>1&&(0,t.jsx)("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex space-x-1.5 z-10 bg-white/60 backdrop-blur-xs px-2.5 py-1.5 rounded-full",children:e.images.map((e,s)=>(0,t.jsx)("span",{className:`w-1.5 h-1.5 rounded-full transition-all duration-200 ${D===s?"bg-[#800A0A] w-3":"bg-gray-400/60"}`},s))}),(0,t.jsxs)("div",{className:"absolute top-4 right-4 z-20 flex flex-col gap-2.5",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{"u">typeof navigator&&navigator.share?navigator.share({title:e.name,url:window.location.href}):alert("คัดลอกลิงก์สินค้าเรียบร้อยแล้ว!")},className:"w-10 h-10 rounded-full bg-white/80 backdrop-blur-md shadow-sm hover:bg-white hover:scale-105 active:scale-95 transition-all flex items-center justify-center text-gray-700 border-none cursor-pointer","aria-label":"Share product",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",className:"w-5 h-5",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.217 10.907a2.25 2.25 0 100 2.186m0-2.186l5.57 3.285m-5.57-3.285a2.25 2.25 0 110-2.186m0 2.186l5.57-3.286M18 19.5a2.25 2.25 0 100-4.5 2.25 2.25 0 000 4.5zM18 9a2.25 2.25 0 100-4.5 2.25 2.25 0 000 4.5z"})})}),(0,t.jsx)("button",{type:"button",onClick:()=>{let t,s=JSON.parse(localStorage.getItem("wishlist")||"[]");s.includes(e.id)?(t=s.filter(t=>t!==e.id),q(!1),ei("นำออกจากสินค้าโปรดแล้ว")):(t=[...s,e.id],q(!0),ei("เพิ่มในสินค้าโปรดแล้ว!")),localStorage.setItem("wishlist",JSON.stringify(t)),window.dispatchEvent(new Event("storage"))},className:"w-10 h-10 rounded-full bg-white/80 backdrop-blur-md shadow-sm hover:bg-white hover:scale-105 active:scale-95 transition-all flex items-center justify-center text-red-500 border-none cursor-pointer","aria-label":"Like product",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:R?"currentColor":"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",className:"w-5 h-5",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12z"})})})]})]})})]}),e.videoUrl&&(0,t.jsxs)("button",{onClick:()=>H(!0),className:"mt-4 w-full bg-red-50 hover:bg-red-100 text-[#800A0A] border border-red-200/50 py-3 px-4 rounded-xl flex items-center justify-center space-x-2 font-bold text-xs transition-all active:scale-95 cursor-pointer shadow-xs font-prompt",children:[(0,t.jsx)("span",{className:"text-sm",children:"📹"}),(0,t.jsx)("span",{children:"ดูวิดีโอรีวิวแนะนำสินค้า"})]})]}),(0,t.jsxs)("div",{className:"md:col-span-5 flex flex-col text-left space-y-6 px-4 md:px-0 font-prompt",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 bg-[#FAF5FF] text-[#7C3AED] text-[9px] font-bold rounded-full border border-[#E9D5FF]/40 uppercase tracking-wider select-none",children:"🏆 Bestseller"}),eu&&e.compareAtPrice&&(0,t.jsxs)("span",{className:"inline-flex items-center px-2.5 py-0.5 bg-[#FAF5FF] text-[#7C3AED] text-[9px] font-bold rounded-full border border-[#E9D5FF]/40 uppercase tracking-wider select-none",children:["🏷️ ",Math.round((e.compareAtPrice-e.price)/e.compareAtPrice*100),"% OFF"]}),e.isPreOrder&&(0,t.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 bg-[#FEF3C7] text-[#D97706] text-[9px] font-bold rounded-full border border-[#FDE68A]/40 uppercase tracking-wider select-none",children:"✦ Pre-Order"})]}),(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsx)("h1",{className:"text-xl sm:text-2xl font-black text-gray-900 leading-tight tracking-tight",children:e.name})}),(0,t.jsxs)("div",{className:"flex flex-col space-y-0.5 mt-2",children:[(0,t.jsx)("span",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-wider",children:"ราคาเสนอขาย (Price)"}),(0,t.jsxs)("div",{className:"flex items-baseline space-x-2",children:[(0,t.jsxs)("span",{className:"text-2xl sm:text-3xl font-black text-[#800A0A]",children:["฿",e.price.toLocaleString()]}),eu&&e.compareAtPrice&&(0,t.jsxs)("span",{className:"text-xs sm:text-sm font-normal text-gray-400 line-through",children:["฿",e.compareAtPrice.toLocaleString()]})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3.5 gap-y-2 text-[10px] sm:text-[11px] font-bold text-gray-400 pt-1 mt-2",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,t.jsx)("div",{className:"flex items-center space-x-0.5",children:Array.from({length:5}).map((e,s)=>(0,t.jsx)(c.Star,{className:`w-3.5 h-3.5 ${s<Math.floor(K)?"fill-amber-400 stroke-amber-400":"fill-gray-150 stroke-gray-250"}`},s))}),(0,t.jsx)("span",{className:"text-gray-700 font-bold ml-1",children:K.toFixed(1)}),(0,t.jsxs)("span",{className:"text-gray-450 font-normal",children:["(",Q," รีวิว)"]})]}),(0,t.jsx)("span",{className:"w-1 h-1 bg-gray-200 rounded-full"}),(0,t.jsxs)("div",{className:"flex items-center space-x-1.5",children:[(0,t.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${e.inStock?"bg-emerald-500":"bg-red-500"}`}),(0,t.jsx)("span",{className:e.inStock?"text-emerald-600 font-bold":"text-red-600 font-bold",children:e.inStock?"มีสินค้าในคลัง":"สินค้าหมดคลัง"})]})]})]}),e.sizes.length>0&&"Free Size"!==e.sizes[0]&&(0,t.jsxs)("div",{className:"space-y-2 mt-4 pt-3 border-t border-gray-100",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center text-xs font-bold text-gray-800 tracking-wide uppercase",children:[(0,t.jsx)("span",{children:"เลือกขนาด (Size Select)"}),(0,t.jsx)("button",{type:"button",className:"text-[10px] text-gray-400 underline hover:text-gray-900 cursor-pointer bg-transparent border-none",children:"ตารางขนาด (Select Guide)"})]}),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-2",children:e.sizes.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>E(e),className:`py-3 rounded-lg border text-xs font-bold transition-all duration-200 cursor-pointer flex items-center justify-center ${I===e?"bg-black border-black text-white shadow-sm":"border-gray-200 text-gray-500 hover:text-gray-850 hover:border-gray-300 bg-white"}`,children:e},e))})]}),(0,t.jsxs)("div",{className:"space-y-2 mt-4 pt-4 border-t border-gray-100",children:[(0,t.jsx)("span",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-wider block",children:"รายละเอียดสินค้า"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 font-normal leading-relaxed text-justify break-all",children:e.description})]}),(0,t.jsx)("div",{className:"space-y-4 pt-4 border-t border-gray-100",children:e.inStock?(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-wider",children:"เลือกจำนวน"}),(0,t.jsxs)("div",{className:"flex items-center bg-[#F1F3F5] rounded-full px-2.5 py-1 space-x-3.5 border border-gray-200/30",children:[(0,t.jsx)("button",{type:"button",onClick:()=>ef(-1),className:"text-gray-450 hover:text-gray-800 transition-colors cursor-pointer p-0.5 flex items-center justify-center","aria-label":"Decrease quantity",children:(0,t.jsx)(x.Minus,{className:"w-3 h-3 stroke-[2.5]"})}),(0,t.jsx)("span",{className:"w-5 text-center text-xs font-bold text-gray-700 select-none",children:M}),(0,t.jsx)("button",{type:"button",onClick:()=>ef(1),className:"text-gray-450 hover:text-gray-800 transition-colors cursor-pointer p-0.5 flex items-center justify-center","aria-label":"Increase quantity",children:(0,t.jsx)(d.Plus,{className:"w-3 h-3 stroke-[2.5]"})})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3.5 w-full mt-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{P(e,M,I),B(!0),setTimeout(()=>B(!1),2e3)},className:`w-full py-4 px-6 rounded-full flex items-center justify-center space-x-2 font-bold text-xs transition-all border cursor-pointer select-none active:scale-95 duration-200 ${T?"bg-emerald-600 border-emerald-600 text-white":e.isPreOrder?"bg-amber-600 border-amber-600 text-white hover:bg-amber-700":"bg-black border-black text-white hover:bg-gray-900"}`,children:[(0,t.jsx)(n.ShoppingBag,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:T?"เพิ่มลงในตะกร้าแล้ว!":e.isPreOrder?"เพิ่มลงรายการจอง":"เพิ่มลงในตะกร้า (Add to Cart)"})]}),(0,t.jsxs)("button",{type:"button",onClick:()=>{P(e,M,I),z.push("/checkout")},className:"w-full py-4 px-6 rounded-full flex items-center justify-center space-x-2 font-bold text-xs text-black bg-white border border-gray-300 hover:border-black active:scale-95 transition-all cursor-pointer transition-all duration-200 select-none",children:[(0,t.jsx)(f.CreditCard,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"ซื้อตอนนี้เลย (Buy Now)"})]})]})]}):(0,t.jsx)("div",{className:"bg-gray-100 p-4 rounded-xl text-center font-bold text-gray-500 text-xs",children:"สินค้าหมดชั่วคราว"})}),(0,t.jsxs)("div",{className:"flex items-center space-x-4 pt-2 text-[10px] text-gray-400 font-bold uppercase tracking-wider",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-1.5",children:[(0,t.jsx)(m.ShieldCheck,{className:"w-4 h-4 text-emerald-500"}),(0,t.jsx)("span",{children:"รับประกันของแท้ 100%"})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-1.5",children:[(0,t.jsx)(h.HelpCircle,{className:"w-4 h-4 text-[#800A0A]"}),(0,t.jsx)("span",{children:"เปลี่ยนสินค้าได้ใน 7 วัน"})]})]})]})]}),(0,t.jsxs)("div",{className:"bg-white border border-gray-100 p-5 rounded-2xl shadow-sm mb-12 text-left font-prompt",children:[(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 pb-4 border-b border-gray-100",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3.5",children:[(0,t.jsx)("div",{className:"w-12 h-12 bg-[#800A0A]/5 border border-[#800A0A]/10 rounded-xl flex items-center justify-center shadow-xs flex-shrink-0 relative overflow-hidden",children:ec.logo&&(ec.logo.startsWith("data:image")||ec.logo.startsWith("http"))?(0,t.jsx)(a.default,{src:ec.logo,alt:ec.name,fill:!0,className:"object-cover"}):(0,t.jsx)("span",{className:"text-2xl",children:ec.logo||"🏬"})}),(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-1.5",children:[(0,t.jsx)("h3",{className:"font-extrabold text-gray-900 text-xs sm:text-sm",children:ec.name}),(0,t.jsx)("span",{className:"bg-emerald-50 text-emerald-700 text-[8px] font-bold px-1.5 py-0.5 rounded border border-emerald-100 whitespace-nowrap",children:"แนะนำ"})]}),(0,t.jsx)("p",{className:"text-[9px] text-gray-400 font-bold uppercase tracking-wider",children:ec.type})]})]}),(0,t.jsxs)("div",{className:"flex space-x-2 flex-shrink-0 self-end sm:self-center",children:[(0,t.jsxs)("button",{onClick:()=>alert(`ส่งข้อความหาผู้ขายเรียบร้อยที่ ${ec.email}`),className:"bg-white border border-gray-200 hover:bg-gray-50 text-gray-600 hover:text-gray-900 px-3 py-1.5 rounded-lg text-[10px] font-bold transition-all flex items-center gap-1 cursor-pointer shadow-xs",children:[(0,t.jsx)(b,{className:"w-3.5 h-3.5 text-gray-400"}),"แชทเลย"]}),(0,t.jsxs)("button",{type:"button",onClick:()=>F(!0),className:"bg-white border border-gray-200 hover:bg-gray-50 text-gray-600 hover:text-gray-900 px-3 py-1.5 rounded-lg text-[10px] font-bold transition-all flex items-center gap-1 cursor-pointer block shadow-xs",children:[(0,t.jsx)(g.Store,{className:"w-3.5 h-3.5 text-gray-400"}),"ดูร้านค้า"]})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-4 text-center py-4 border-b border-gray-100",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("span",{className:"text-[9px] text-gray-400 font-bold uppercase block",children:"คะแนนร้านค้า"}),(0,t.jsxs)("span",{className:"text-xs font-black text-[#800A0A] flex items-center justify-center gap-1",children:[(0,t.jsx)(c.Star,{className:"w-3 h-3 fill-current"}),ec.rating]})]}),(0,t.jsxs)("div",{className:"space-y-0.5 border-x border-gray-100",children:[(0,t.jsx)("span",{className:"text-[9px] text-gray-400 font-bold uppercase block",children:"รายการสินค้า"}),(0,t.jsxs)("span",{className:"text-xs font-black text-gray-800 flex items-center justify-center gap-1",children:[(0,t.jsx)(j.Package,{className:"w-3 h-3 text-gray-400"}),ec.productsCount]})]}),(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("span",{className:"text-[9px] text-gray-400 font-bold uppercase block",children:"การตอบกลับ"}),(0,t.jsx)("span",{className:"text-xs font-black text-emerald-600",children:"98% (เร็วมาก)"})]})]}),(0,t.jsxs)("p",{className:"text-[10px] text-gray-450 font-light mt-3 italic text-center sm:text-left",children:['"',ec.description,'"']})]}),en.length>0&&(0,t.jsxs)("div",{className:"text-left space-y-5 mb-12 font-prompt",children:[(0,t.jsxs)("div",{className:"border-b border-gray-150 pb-2 flex justify-between items-center",children:[(0,t.jsx)("h2",{className:"text-lg font-black text-gray-900",children:"สินค้าอื่นๆ จากผู้ขายรายนี้ (More from this seller)"}),(0,t.jsx)(i.default,{href:"/products",className:"text-xs font-bold text-[#800A0A] hover:underline",children:"ดูทั้งหมด"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6",children:en.map(e=>(0,t.jsx)("div",{className:"h-full",children:(0,t.jsxs)(i.default,{href:`/products/${e.id}`,className:"block h-full border border-gray-100 rounded-premium bg-white p-4 hover:-translate-y-1 hover:shadow-lg transition-all duration-300",children:[(0,t.jsx)("div",{className:"relative aspect-square w-full rounded-xl overflow-hidden bg-gray-50 mb-3 select-none",children:(0,t.jsx)(a.default,{src:e.images[0],alt:e.name,fill:!0,className:"object-contain p-4"})}),(0,t.jsx)("h3",{className:"text-xs font-semibold text-gray-800 line-clamp-2 min-h-[32px]",children:e.name}),(0,t.jsxs)("span",{className:"text-sm font-bold text-[#800A0A] block mt-1",children:["฿",e.price.toLocaleString()]})]})},e.id))})]}),e.reviews&&e.reviews.length>0&&(0,t.jsxs)("div",{className:"bg-white border border-gray-100 p-6 md:p-8 rounded-premium shadow-card-soft mb-12 text-left",children:[(0,t.jsxs)("h2",{className:"text-lg font-bold text-gray-900 mb-6",children:["รีวิวและข้อเสนอแนะจากผู้ใช้ (",e.reviews.length,")"]}),(0,t.jsx)("div",{className:"divide-y divide-gray-100",children:e.reviews.map(e=>{let s=e.userName.substring(0,2);return(0,t.jsxs)("div",{className:"py-6 first:pt-0 last:pb-0 flex flex-col sm:flex-row gap-4",children:[(0,t.jsx)("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-primary to-accent flex items-center justify-center text-white font-bold text-xs flex-shrink-0",children:s}),(0,t.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"font-semibold text-sm text-gray-800",children:e.userName}),(0,t.jsx)("span",{className:"text-xs text-gray-400 font-light",children:new Date(e.createdAt).toLocaleDateString("th-TH",{year:"numeric",month:"long",day:"numeric"})})]}),(0,t.jsx)("div",{className:"flex items-center space-x-0.5",children:Array.from({length:5}).map((s,r)=>(0,t.jsx)(c.Star,{className:`w-3.5 h-3.5 ${r<e.rating?"fill-amber-400 stroke-amber-400":"fill-gray-100 stroke-gray-300"}`},r))}),(0,t.jsxs)("p",{className:"text-sm text-gray-600 font-light leading-relaxed",children:['"',e.comment,'"']})]})]},e.id)})})]}),l.length>0&&(0,t.jsxs)("div",{className:"text-left space-y-6",children:[(0,t.jsx)("h2",{className:"text-xl font-bold text-gray-900 flex items-center gap-2",children:e.relatedProductIds&&e.relatedProductIds.length>0?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.Gift,{className:"w-5.5 h-5.5 text-emerald-600 animate-bounce"}),(0,t.jsx)("span",{children:C?"Special Free Gifts Included":"ของแถมฟรีพิเศษสำหรับสินค้านี้"})]}):(0,t.jsx)("span",{children:C?"Recommended Products":"สินค้าแนะนำอื่นๆ"})}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6",children:l.map(s=>(0,t.jsx)("div",{className:"h-full",children:(0,t.jsxs)("div",{className:"block h-full border border-emerald-100 bg-white p-4 rounded-premium relative group overflow-hidden shadow-xs",children:[e.relatedProductIds&&e.relatedProductIds.length>0&&(0,t.jsx)("div",{className:"absolute top-2 left-2 z-10 bg-emerald-500 text-white font-bold text-[9px] px-2 py-0.5 rounded-full select-none uppercase tracking-wide",children:C?"Free Gift":"ของแถมฟรี"}),(0,t.jsx)("div",{className:"relative aspect-square w-full rounded-xl overflow-hidden bg-gray-50 mb-3 select-none",children:(0,t.jsx)(a.default,{src:s.images[0]||"/u69319090023/Shop23/images/products/placeholder.jpg",alt:s.name,fill:!0,className:"object-contain p-4"})}),(0,t.jsx)("h3",{className:"text-xs font-semibold text-gray-800 line-clamp-2 min-h-[32px]",children:s.name}),(0,t.jsx)("div",{className:"mt-1 flex items-center gap-1.5 font-prompt",children:e.relatedProductIds&&e.relatedProductIds.length>0?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"text-sm font-black text-emerald-600",children:["฿0 (",C?"Free":"ฟรี",")"]}),(0,t.jsxs)("span",{className:"text-[10px] text-gray-400 line-through font-medium",children:["฿",s.price.toLocaleString()]})]}):(0,t.jsxs)(i.default,{href:`/products/${s.id}`,className:"text-sm font-bold text-[#800A0A] hover:underline block mt-1",children:["฿",s.price]})})]})},s.id))})]}),(0,t.jsx)(N.AnimatePresence,{children:A&&(0,t.jsx)(v.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[150] flex items-center justify-center p-4 bg-black/80 backdrop-blur-md overflow-y-auto",onClick:()=>F(!1),children:(0,t.jsxs)(v.motion.div,{initial:{scale:.95,y:30,opacity:0},animate:{scale:1,y:0,opacity:1},exit:{scale:.95,y:30,opacity:0},className:"bg-[#0D0E12] text-white w-full max-w-5xl rounded-[32px] overflow-hidden shadow-2xl border border-white/10 p-6 md:p-8 space-y-6 relative font-prompt",onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("button",{onClick:()=>F(!1),className:"absolute top-6 right-6 p-2 rounded-full bg-white/5 hover:bg-white/10 text-gray-400 hover:text-white transition-all cursor-pointer border-none",children:(0,t.jsx)(y.X,{className:"w-5 h-5"})}),(0,t.jsxs)("div",{className:"bg-gradient-to-r from-[#17181F] to-[#121319] border border-white/5 rounded-3xl p-6 flex flex-col md:flex-row justify-between items-stretch gap-6 relative overflow-hidden text-left",children:[(0,t.jsxs)("div",{className:"flex-1 flex flex-col justify-between space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsx)("div",{className:"w-12 h-12 rounded-full overflow-hidden border-2 border-accent bg-white flex-shrink-0 flex items-center justify-center relative",children:ec.logo&&(ec.logo.startsWith("data:image")||ec.logo.startsWith("http")||ec.logo.startsWith("/"))?(0,t.jsx)(a.default,{src:ec.logo,alt:ec.name,fill:!0,className:"object-contain p-1"}):(0,t.jsx)("span",{className:"text-2xl",children:ec.logo||"🏬"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-[9px] text-gray-400 block font-bold tracking-wide uppercase",children:"Hi, Welcome to"}),(0,t.jsx)("h2",{className:"text-base md:text-lg font-extrabold text-white leading-tight",children:ec.name})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-3",children:[(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-2xl p-3",children:[(0,t.jsx)("span",{className:"text-[9px] text-gray-500 font-bold block uppercase tracking-wider",children:"Current"}),(0,t.jsx)("span",{className:"text-lg font-extrabold text-white block mt-1",children:"01"})]}),(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-2xl p-3",children:[(0,t.jsx)("span",{className:"text-[9px] text-gray-500 font-bold block uppercase tracking-wider",children:"Delivered"}),(0,t.jsx)("span",{className:"text-lg font-extrabold text-white block mt-1",children:"05"})]}),(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-2xl p-3",children:[(0,t.jsx)("span",{className:"text-[9px] text-gray-500 font-bold block uppercase tracking-wider",children:"Canceled"}),(0,t.jsx)("span",{className:"text-lg font-extrabold text-white block mt-1",children:"02"})]}),(0,t.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-2xl p-3",children:[(0,t.jsx)("span",{className:"text-[9px] text-gray-500 font-bold block uppercase tracking-wider",children:"Returned"}),(0,t.jsx)("span",{className:"text-lg font-extrabold text-white block mt-1",children:"00"})]})]})]}),(0,t.jsxs)("div",{className:"w-full md:w-80 bg-gradient-to-br from-[#800A0A]/20 to-[#991B1B]/5 border border-[#800A0A]/20 rounded-2xl p-5 flex flex-col justify-between relative overflow-hidden",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-[#800A0A] font-bold block",children:"Welcome to"}),(0,t.jsx)("h3",{className:"text-sm font-black text-white mt-1 truncate",children:ec.name}),(0,t.jsx)("p",{className:"text-[10px] text-gray-400 font-light mt-1",children:"Make your first purchase today"})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center mt-6",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-accent animate-ping"}),(0,t.jsx)("button",{onClick:()=>F(!1),className:"w-8 h-8 rounded-full bg-white text-black hover:bg-accent hover:text-white flex items-center justify-center transition-all cursor-pointer border-none font-bold",children:"→"})]})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-6",children:[(0,t.jsxs)("div",{className:"md:col-span-4 bg-[#14151C] border border-white/5 rounded-3xl p-5 flex flex-col space-y-4 text-left",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("h3",{className:"font-extrabold text-white text-xs uppercase tracking-wider",children:"Favorites"}),(0,t.jsx)("button",{onClick:()=>F(!1),className:"text-[10px] text-gray-400 hover:text-white underline cursor-pointer bg-transparent border-none",children:"View all"})]}),(0,t.jsx)("div",{className:"grid grid-cols-12 gap-2 h-56",children:(()=>{let s=[...en].slice(0,5);for(;s.length<5;)s.push(e);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"col-span-5 row-span-1 relative rounded-xl overflow-hidden bg-white/5 border border-white/5 p-1 flex items-center justify-center",children:(0,t.jsx)(a.default,{src:s[0]?.images?.[0]||"/u69319090023/Shop23/images/products/placeholder.jpg",alt:"",fill:!0,className:"object-contain p-1"})}),(0,t.jsx)("div",{className:"col-span-7 row-span-2 relative rounded-xl overflow-hidden bg-white/5 border border-white/5 p-1 flex items-center justify-center",children:(0,t.jsx)(a.default,{src:s[1]?.images?.[0]||"/u69319090023/Shop23/images/products/placeholder.jpg",alt:"",fill:!0,className:"object-contain p-1"})}),(0,t.jsx)("div",{className:"col-span-5 row-span-2 relative rounded-xl overflow-hidden bg-white/5 border border-white/5 p-1 flex items-center justify-center",children:(0,t.jsx)(a.default,{src:s[2]?.images?.[0]||"/u69319090023/Shop23/images/products/placeholder.jpg",alt:"",fill:!0,className:"object-contain p-1"})}),(0,t.jsx)("div",{className:"col-span-4 row-span-1 relative rounded-xl overflow-hidden bg-white/5 border border-white/5 p-1 flex items-center justify-center",children:(0,t.jsx)(a.default,{src:s[3]?.images?.[0]||"/u69319090023/Shop23/images/products/placeholder.jpg",alt:"",fill:!0,className:"object-contain p-1"})}),(0,t.jsx)("div",{className:"col-span-3 row-span-1 relative rounded-xl overflow-hidden bg-white/5 border border-white/5 p-1 flex items-center justify-center",children:(0,t.jsx)(a.default,{src:s[4]?.images?.[0]||"/u69319090023/Shop23/images/products/placeholder.jpg",alt:"",fill:!0,className:"object-contain p-1"})})]})})()})]}),(0,t.jsxs)("div",{className:"md:col-span-4 bg-[#14151C] border border-white/5 rounded-3xl p-5 flex flex-col justify-between items-center text-center space-y-4",children:[(0,t.jsxs)("div",{className:"relative w-28 h-28 flex items-center justify-center mt-2 select-none",children:[(0,t.jsxs)("svg",{className:"absolute w-full h-full transform -rotate-90",viewBox:"0 0 100 100",children:[(0,t.jsx)("circle",{cx:"50",cy:"50",r:"40",stroke:"rgba(255,255,255,0.03)",strokeWidth:"6",fill:"transparent"}),(0,t.jsx)("circle",{cx:"50",cy:"50",r:"40",stroke:"url(#xpGrad)",strokeWidth:"7",fill:"transparent",strokeDasharray:"251.2",strokeDashoffset:"80",strokeLinecap:"round"}),(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:"xpGrad",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"#800A0A"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"#D97706"})]})})]}),(0,t.jsxs)("div",{className:"flex flex-col items-center",children:[(0,t.jsx)("span",{className:"text-xl font-black text-white leading-none",children:"1000"}),(0,t.jsx)("span",{className:"text-[9px] text-gray-400 font-bold tracking-wider mt-1",children:"XP"})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-xs font-bold text-white block",children:"500 xp till your next reward"}),(0,t.jsx)("p",{className:"text-[10px] text-gray-400 font-light leading-relaxed",children:"Here you can accumulate shopping points for campus rewards"})]}),(0,t.jsx)("button",{type:"button",onClick:()=>alert("ฟังก์ชันแต้มสะสมพร้อมใช้งานในการสั่งซื้อครั้งถัดไป"),className:"w-full py-2.5 bg-white hover:bg-gray-100 text-black font-bold text-xs rounded-xl transition-all cursor-pointer border-none",children:"Earn more"})]}),(0,t.jsxs)("div",{className:"md:col-span-4 flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 bg-[#14151C] border border-white/5 rounded-3xl p-4 flex items-stretch space-x-3.5 relative overflow-hidden text-left",children:[(0,t.jsxs)("div",{className:"flex-1 flex flex-col justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-[9px] text-[#D97706] font-bold block uppercase tracking-wide",children:"Latest Price"}),(0,t.jsx)("h4",{className:"text-xs font-bold text-white mt-1 line-clamp-2",children:e.name})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2 mt-4",children:[(0,t.jsxs)("span",{className:"text-sm font-black text-white",children:["฿",e.price]}),(0,t.jsx)("button",{type:"button",onClick:()=>F(!1),className:"w-6 h-6 rounded-full bg-white/5 hover:bg-white/10 text-white flex items-center justify-center transition-all cursor-pointer border-none",children:"→"})]})]}),(0,t.jsx)("div",{className:"w-20 bg-white/5 rounded-2xl overflow-hidden border border-white/5 relative p-2 flex items-center justify-center flex-shrink-0 select-none",children:(0,t.jsx)(a.default,{src:e.images[0],alt:e.name,fill:!0,className:"object-contain p-1"})})]}),(0,t.jsxs)("div",{className:"bg-[#14151C] border border-white/5 rounded-3xl p-5 flex justify-between items-center overflow-hidden relative text-left",children:[(0,t.jsxs)("div",{className:"space-y-3 z-10",children:[(0,t.jsx)("span",{className:"text-[10px] text-gray-500 font-bold block uppercase tracking-wide",children:"Δ You Need Help?"}),(0,t.jsx)("h4",{className:"text-xs font-extrabold text-white leading-snug",children:"ต้องการความช่วยเหลือ?"}),(0,t.jsx)("button",{type:"button",onClick:()=>alert("ติดต่ออาจารย์แผนกได้ที่: "+ec.email),className:"px-4 py-2 bg-white hover:bg-gray-100 text-black font-bold text-[9px] rounded-xl transition-all cursor-pointer border-none uppercase",children:"Purchase Advice"})]}),(0,t.jsx)("div",{className:"w-16 h-16 opacity-30 flex-shrink-0 flex items-center justify-center relative",children:(0,t.jsx)("svg",{className:"w-12 h-12 text-white",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"})})})]})]})]})]})})}),U&&(0,t.jsx)("div",{className:"fixed inset-0 bg-black/85 backdrop-blur-md flex items-center justify-center z-50 p-4 animate-in fade-in duration-200",children:(0,t.jsxs)("div",{className:"relative w-full max-w-3xl bg-gray-900 rounded-2xl overflow-hidden shadow-2xl border border-gray-800",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center px-4 py-3 bg-gray-950 text-white font-prompt",children:[(0,t.jsxs)("span",{className:"text-xs font-bold",children:["📹 วิดีโอแนะนำสินค้า: ",e.name]}),(0,t.jsx)("button",{onClick:()=>H(!1),className:"text-gray-400 hover:text-white text-xs font-bold bg-transparent border-none cursor-pointer",children:"ปิดหน้าต่าง"})]}),(0,t.jsx)("div",{className:"aspect-video w-full bg-black flex items-center justify-center",children:e.videoUrl?.includes("youtube.com")||e.videoUrl?.includes("youtu.be")?(0,t.jsx)("iframe",{src:((S=e.videoUrl.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/))&&11===S[2].length?`https://www.youtube.com/embed/${S[2]}`:null)||"",className:"w-full h-full border-0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):(0,t.jsx)("video",{src:W||e.videoUrl||"",controls:!0,autoPlay:!0,className:"w-full h-full object-contain"})})]})}),G&&(0,t.jsxs)("div",{className:"fixed bottom-6 left-1/2 -translate-x-1/2 bg-black/90 backdrop-blur-md text-white text-xs font-bold px-5 py-3 rounded-full shadow-xl border border-white/10 z-[100] animate-in fade-in slide-in-from-bottom-4 duration-300 flex items-center space-x-2",children:[(0,t.jsx)("span",{children:"❤️"}),(0,t.jsx)("span",{children:G})]})]})]})};e.s(["default",0,function({id:e}){let[a,i]=(0,s.useState)(""),[c,n]=(0,s.useState)(null),[o,d]=(0,s.useState)([]),[x,m]=(0,s.useState)(!0);return((0,s.useEffect)(()=>{let t=e;{let e=window.location.pathname.match(/\/products\/([^/]+)/);e&&e[1]&&(t=e[1].replace(/\/$/,""))}i(t)},[e]),(0,s.useEffect)(()=>{a&&(m(!0),l.default.getProductById(a).then(e=>{e?(n(e),document.title=`${e.name} | CMTC SHOP`,l.default.getProducts().then(t=>{let s=e.relatedProductIds;s&&s.length>0?d(t.filter(e=>s.includes(e.id))):d(t.filter(t=>t.id!==e.id&&t.categoryId===e.categoryId).slice(0,4)),m(!1)})):m(!1)}))},[a]),x)?(0,t.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center font-prompt",children:(0,t.jsxs)("div",{className:"flex flex-col items-center space-y-4",children:[(0,t.jsx)("div",{className:"w-10 h-10 border-4 border-[#800A0A] border-t-transparent rounded-full animate-spin"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 font-bold",children:"กำลังโหลดข้อมูลสินค้า..."})]})}):(c||(0,r.notFound)(),(0,t.jsx)(S,{product:c,relatedProducts:o}))}],36548)}]);
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.25 |
proxy
|
phpinfo
|
Settings