File manager - Edit - /home/webapp69.cm.in.th/u69319090023/Shop23/_next/static/chunks/32rxicrk11h_x.js
Back
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,12336,e=>{"use strict";var t=e.i(43476),a=e.i(71645),s=e.i(18566),r=e.i(56420);let l=(0,r.default)("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);var i=e.i(89664),n=e.i(12092),o=e.i(23482),c=e.i(46932),d=e.i(88653),x=e.i(42129),m=e.i(55906),p=e.i(57688),g=e.i(63676),h=e.i(77071),u=e.i(35829),b=e.i(99738),f=e.i(59544);let v=({product:e,isOpen:s,onClose:r,onConfirm:l})=>{let[i,n]=(0,a.useState)(""),[o,x]=(0,a.useState)(1);if((0,a.useEffect)(()=>{e&&(n(e.sizes.length>0?e.sizes[0]:""),x(1))},[e,s]),!e)return null;let m=e=>{let t=o+e;t>=1&&x(t)},v=e.price*o;return(0,t.jsx)(d.AnimatePresence,{children:s&&(0,t.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,t.jsx)(c.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:r,className:"absolute inset-0 bg-black/60"}),(0,t.jsxs)(c.motion.div,{initial:{scale:.95,y:15,opacity:0},animate:{scale:1,y:0,opacity:1},exit:{scale:.95,y:15,opacity:0},transition:{type:"spring",damping:25,stiffness:350},className:"relative bg-white w-full max-w-md rounded-premium shadow-luxury border border-gray-100/50 overflow-hidden flex flex-col z-10",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100",children:[(0,t.jsx)("h2",{className:"text-lg font-bold text-gray-900",children:"เลือกตัวเลือกสินค้า"}),(0,t.jsx)("button",{onClick:r,className:"p-1.5 rounded-full hover:bg-gray-100 text-gray-400 hover:text-gray-600 transition-colors","aria-label":"Close modal",children:(0,t.jsx)(g.X,{className:"w-5 h-5"})})]}),(0,t.jsxs)("div",{className:"p-6 space-y-6 overflow-y-auto max-h-[60vh] text-left",children:[(0,t.jsxs)("div",{className:"flex space-x-4",children:[(0,t.jsx)("div",{className:"relative w-20 h-20 bg-gray-50 rounded-xl overflow-hidden flex-shrink-0 border border-gray-100",children:(0,t.jsx)(p.default,{src:e.images[0],alt:e.name,fill:!0,className:"object-contain p-2"})}),(0,t.jsxs)("div",{className:"flex flex-col justify-center space-y-1",children:[(0,t.jsx)("h3",{className:"font-semibold text-gray-800 text-sm line-clamp-2 leading-snug",children:e.name}),(0,t.jsxs)("div",{className:"flex items-baseline space-x-2",children:[(0,t.jsxs)("span",{className:"text-base font-bold text-accent",children:["฿",e.price.toLocaleString()]}),e.compareAtPrice&&e.compareAtPrice>e.price&&(0,t.jsxs)("span",{className:"text-xs text-gray-400 line-through",children:["฿",e.compareAtPrice.toLocaleString()]})]})]})]}),e.sizes.length>0&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("label",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider",children:"ขนาด / ไซส์ที่เลือก"}),i&&(0,t.jsxs)("span",{className:"text-xs font-semibold text-accent bg-accent/10 px-2.5 py-0.5 rounded-full",children:["ไซส์ ",i]})]}),(0,t.jsx)("div",{className:"grid grid-cols-4 gap-2",children:e.sizes.map(e=>(0,t.jsx)("button",{onClick:()=>n(e),className:`text-xs font-bold py-2.5 border rounded-xl text-center transition-all duration-200 active:scale-95 ${i===e?"bg-accent text-white border-accent shadow-luxury-glow ring-2 ring-accent/30":"border-gray-200 text-gray-600 hover:bg-gray-50 hover:border-gray-300"}`,children:e},e))})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center pt-2",children:[(0,t.jsx)("span",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider",children:"จำนวน"}),(0,t.jsxs)("div",{className:"flex items-center space-x-4 bg-gray-50 border border-gray-100 rounded-full px-3 py-1.5",children:[(0,t.jsx)("button",{onClick:()=>m(-1),disabled:o<=1,className:"p-1 rounded-full text-gray-500 hover:text-gray-800 disabled:opacity-30 disabled:pointer-events-none transition-colors",children:(0,t.jsx)(u.Minus,{className:"w-4 h-4"})}),(0,t.jsx)("span",{className:"w-6 text-center font-bold text-gray-800 text-sm select-none",children:o}),(0,t.jsx)("button",{onClick:()=>m(1),className:"p-1 rounded-full text-gray-500 hover:text-gray-800 transition-colors",children:(0,t.jsx)(h.Plus,{className:"w-4 h-4"})})]})]})]}),(0,t.jsxs)("div",{className:"px-6 py-4 bg-gray-50 border-t border-gray-100 flex flex-col space-y-3",children:[(0,t.jsxs)("div",{className:"flex justify-between items-baseline",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-gray-500",children:"ราคารวมทั้งสิ้น:"}),(0,t.jsxs)("span",{className:"text-xl font-black text-accent",children:["฿",v.toLocaleString()]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsx)(f.default,{variant:"secondary",onClick:r,className:"py-2.5 text-sm",children:"ยกเลิก"}),(0,t.jsxs)(f.default,{variant:"primary",onClick:()=>{i&&l(i,o)},disabled:!i,className:"py-2.5 text-sm flex items-center justify-center space-x-2",children:[(0,t.jsx)(b.ShoppingCart,{className:"w-4 h-4 text-text-primary"}),(0,t.jsx)("span",{children:"เพิ่มลงตะกร้า"})]})]})]})]})]})})};var y=e.i(23067),w=e.i(29926),j=e.i(88442),N=e.i(93123),C=e.i(72328),F=e.i(28623),_=e.i(49882);let k=(0,r.default)("award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);var S=e.i(63448),D=e.i(51757),A=e.i(16327);let T={silver:{accentGlow:"rgba(192, 192, 192, 0.4)",progressGradient:"from-[#C7CBD1] via-[#FFFFFF] to-[#858B94]",glowClass:"drop-shadow-[0_25px_45px_rgba(255,255,255,0.25)]",badgeClass:"bg-[#C7CBD1]/10 border-[#C7CBD1]/30 text-[#FFFFFF] hover:border-[#C7CBD1]/50",priceAccentClass:"text-[#C7CBD1]",buttonClass:"bg-gradient-to-r from-[#C7CBD1] via-[#FFFFFF] to-[#C7CBD1] text-gray-950 hover:shadow-[0_0_20px_rgba(199,203,209,0.3)] border-[#C7CBD1]/40",activePillClass:"bg-gradient-to-r from-[#C7CBD1] via-[#FFFFFF] to-[#858B94] border border-white/30 shadow-inner",activeTextClass:"text-slate-950 shadow-[0_0_12px_rgba(255,255,255,0.2)]",textGradientClass:"from-[#FFFFFF] via-[#C7CBD1] to-[#858B94]",primaryTextColor:"#FFFFFF",secondaryTextColor:"#D8D8D8",accentColor:"#C7CBD1",ambientRays:"rgba(199, 203, 209, 0.04)",primaryTextGradientClass:"from-[#FFFFFF] to-[#E2E8F0]"},copper:{accentGlow:"rgba(184, 115, 51, 0.45)",progressGradient:"from-[#B87355] via-[#FFF5F0] to-[#7A4635]",glowClass:"drop-shadow-[0_25px_45px_rgba(184,115,85,0.35)]",badgeClass:"bg-[#B87355]/10 border-[#B87355]/30 text-[#F4EDE5] hover:border-[#B87355]/50",priceAccentClass:"text-[#B87355]",buttonClass:"bg-gradient-to-r from-[#B87355] via-[#F4EDE5] to-[#B87355] text-gray-950 hover:shadow-[0_0_20px_rgba(184,115,85,0.3)] border-[#B87355]/40",activePillClass:"bg-gradient-to-r from-[#B87355] via-[#FFE4E5] to-[#7A4635] border border-orange-400/30 shadow-inner",activeTextClass:"text-white shadow-[0_0_12px_rgba(184,115,85,0.25)]",textGradientClass:"from-[#FFF5F0] via-[#B87355] to-[#7A4635]",primaryTextColor:"#F4EDE5",secondaryTextColor:"#D6CBC2",accentColor:"#B87355",ambientRays:"rgba(184, 115, 85, 0.04)",primaryTextGradientClass:"from-[#FFFFFF] to-[#EAE2D8]"},brass:{accentGlow:"rgba(212, 175, 55, 0.4)",progressGradient:"from-[#C9A85C] via-[#FFFDF5] to-[#8F6B2F]",glowClass:"drop-shadow-[0_25px_45px_rgba(201,168,92,0.35)]",badgeClass:"bg-[#C9A85C]/10 border-[#C9A85C]/35 text-[#F5F0E6] hover:border-[#C9A85C]/50",priceAccentClass:"text-[#C9A85C]",buttonClass:"bg-gradient-to-r from-[#C9A85C] via-[#F5F0E6] to-[#C9A85C] text-gray-950 hover:shadow-[0_0_20px_rgba(201,168,92,0.3)] border-[#C9A85C]/40",activePillClass:"bg-gradient-to-r from-[#C9A85C] via-[#FFFDF5] to-[#8F6B2F] border border-[#F3C25D]/20 shadow-inner",activeTextClass:"text-slate-950 shadow-[0_0_12px_rgba(201,168,92,0.25)]",textGradientClass:"from-[#FFFDF5] via-[#C9A85C] to-[#8F6B2F]",primaryTextColor:"#F5F0E6",secondaryTextColor:"#D8D0C2",accentColor:"#C9A85C",ambientRays:"rgba(201, 168, 92, 0.04)",primaryTextGradientClass:"from-[#FFFFFF] to-[#F5F0E6]"}},B={type:"spring",stiffness:60,damping:15},E={duration:.35,ease:[.16,1,.3,1]},P={initial:{},animate:{transition:{staggerChildren:.08}}},z={initial:{opacity:0,y:15,filter:"blur(4px)"},animate:{opacity:1,y:0,filter:"blur(0px)",transition:{duration:.8,ease:[.16,1,.3,1]}}},L=({value:e})=>{let[s,r]=(0,a.useState)(e),l=(0,a.useRef)(e);return(0,a.useEffect)(()=>{let t,a=l.current;if(a===e)return;let s=performance.now(),i=n=>{let o=Math.min((n-s)/600,1);r(Math.round(a+o*(2-o)*(e-a))),o<1?t=requestAnimationFrame(i):l.current=e};return t=requestAnimationFrame(i),()=>cancelAnimationFrame(t)},[e]),(0,t.jsx)(t.Fragment,{children:s.toLocaleString()})},I=({label:e,value:a,icon:s})=>(0,t.jsxs)("div",{className:"bg-white/[0.02] backdrop-blur-md border border-white/[0.08] shadow-premium-glass p-4 rounded-2xl flex items-center space-x-3.5 transition-all duration-300 hover:-translate-y-1 hover:shadow-white/[0.02] hover:border-white/20 hover:bg-white/[0.04]",children:[(0,t.jsx)("div",{className:"w-10 h-10 rounded-xl bg-white/[0.04] border border-white/[0.08] flex items-center justify-center flex-shrink-0",children:s}),(0,t.jsxs)("div",{className:"flex flex-col text-left",children:[(0,t.jsx)("span",{className:"text-[10px] text-gray-400 font-light uppercase tracking-wider",children:e}),(0,t.jsx)("span",{className:"text-sm font-bold text-gray-100",children:a})]})]}),G=({limit:e,lang:a,accentColor:s})=>{let r="en"===a;return(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 py-2 w-full max-w-lg",children:[(0,t.jsx)(I,{label:r?"Pre-order Deadline":"เปิดจองถึง",value:r?"August 31, 2024":"31 สิงหาคม 2567",icon:(0,t.jsx)(_.Calendar,{className:"w-5 h-5",style:{color:s}})}),(0,t.jsx)(I,{label:r?"Edition Limit":"จำนวนผลิต",value:r?`${e.toLocaleString()} Medals`:`${e.toLocaleString()} เหรียญ`,icon:(0,t.jsx)(k,{className:"w-5 h-5",style:{color:s}})})]})},$=({limit:e,reserved:a,theme:s,lang:r})=>{let l=Math.round(a/e*100),i=e-a,n="en"===r;return(0,t.jsxs)("div",{className:"w-full max-w-lg space-y-3.5",children:[(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("div",{className:"w-full h-3 bg-black/40 border border-white/[0.05] rounded-full overflow-hidden relative",children:(0,t.jsxs)(c.motion.div,{className:`h-full bg-gradient-to-r ${T[s].progressGradient} relative`,initial:{width:0},whileInView:{width:`${l}%`},viewport:{once:!0},transition:B,children:[(0,t.jsx)("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-3.5 h-3.5 rounded-full bg-white flex-shrink-0",style:{boxShadow:"0 0 12px var(--accent-glow)"}}),(0,t.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/25 to-transparent -skew-x-12 animate-shimmer-sweep w-1/2"})]})})}),(0,t.jsxs)("div",{className:"flex justify-between items-center text-xs text-gray-400 font-light px-0.5",children:[(0,t.jsxs)("div",{className:"flex items-baseline space-x-1",children:[(0,t.jsx)("span",{children:n?"Reserved:":"จองแล้ว:"}),(0,t.jsx)("span",{className:"font-bold text-gray-200",children:(0,t.jsx)(L,{value:a})}),(0,t.jsxs)("span",{className:"text-[10px] text-gray-500",children:["/ ",e.toLocaleString()]})]}),(0,t.jsxs)("div",{className:"flex items-baseline space-x-1",children:[(0,t.jsx)("span",{children:n?"Remaining:":"คงเหลือ:"}),(0,t.jsx)("span",{className:"font-bold text-amber-300",children:(0,t.jsx)(L,{value:i})})]}),(0,t.jsx)("div",{className:"text-right",children:(0,t.jsxs)("span",{className:"text-lg font-black text-white leading-none",children:[(0,t.jsx)(L,{value:l}),"%"]})})]})]})},R=({image:e,name:s,theme:r,reducedMotion:l})=>{let[i,n]=(0,a.useState)(!1),o={"--accent-glow":T[r].accentGlow};return(0,t.jsx)("div",{className:"relative w-64 h-64 sm:w-80 sm:h-80 lg:w-96 lg:h-96 flex items-center justify-center mx-auto",style:o,children:(0,t.jsxs)(c.motion.div,{animate:l?{}:{y:[0,-10,0]},transition:l?{}:{duration:5,repeat:1/0,ease:"easeInOut"},className:"relative w-full h-full flex items-center justify-center",children:[(0,t.jsx)("div",{className:"absolute w-[80%] h-[80%] rounded-full blur-[64px] opacity-75 pointer-events-none mix-blend-screen transition-all duration-700",style:{background:`radial-gradient(circle, ${"silver"===r?"rgba(255, 255, 255, 0.45)":"copper"===r?"rgba(217, 119, 6, 0.45)":"rgba(245, 158, 11, 0.45)"} 0%, transparent 70%)`}}),(0,t.jsx)(p.default,{src:i?"/u69319090023/Shop23/images/products/placeholder.jpg":e,alt:`${s} Medal`,fill:!0,priority:!0,unoptimized:!0,className:`object-contain relative z-10 transition-all duration-500 ${T[r].glowClass}`,onError:()=>n(!0)})]})})},M=({price:e,theme:a,onClick:s})=>(0,t.jsx)(c.motion.button,{type:"button",onClick:s,initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},transition:B,whileHover:{scale:1.05},whileTap:{scale:.97},className:`px-10 py-3.5 rounded-full text-sm font-extrabold shadow-lg transition-all cursor-pointer text-center border ${T[a].buttonClass}`,children:(0,t.jsxs)("span",{children:["฿",e.toLocaleString()]})}),V=({lang:e})=>{let s=(0,C.useReducedMotion)(),[r,l]=(0,a.useState)(0),[i,n]=(0,a.useState)(!1),o=[{large:"/u69319090023/Shop23/images/collection/ceremony_gallery_1_v5.webp",largeAlt:"en"===e?"Senior monks chanting blessings inside the main temple hall":"ภาพพระเถรานุเถระและพระเกจิอาจารย์ร่วมเจริญพระพุทธมนต์สวดชัยมงคลคาถาในวิหาร",top:"/u69319090023/Shop23/images/collection/ceremony_gallery_2_v4.webp",topAlt:"en"===e?"Northern senior monks performing meditative prayers with sacred thread":"ภาพพระเกจิอาจารย์เถราจารย์นั่งปรกอธิษฐานจิตและสายสิญจน์มงคล",bottom:"/u69319090023/Shop23/images/collection/ceremony_gallery_3_v3.webp",bottomAlt:"en"===e?"Venerable monks lighting sacred candles inside the chapel":"ภาพพระคณาจารย์กำลังประกอบพิธีจุดเทียนมงคลในพระวิหาร"},{large:"/u69319090023/Shop23/images/collection/ceremony_gallery_4.webp",largeAlt:"en"===e?"Devout laywomen dressed in white lighting blessing candles":"สุภาพสตรีในชุดขาวร่วมจุดเทียนมงคล",top:"/u69319090023/Shop23/images/collection/ceremony_gallery_5.webp",topAlt:"en"===e?"Laywomen carrying holy candle offerings inside the sacred chapel":"สุภาพสตรีร่วมถือเทียนชัยในโบสถ์ศักดิ์สิทธิ์",bottom:"/u69319090023/Shop23/images/collection/ceremony_gallery_6_v2.webp",bottomAlt:"en"===e?"A consecration ritual involving candle holders in front of the temple":"ภาพพิธีกรรมการถือพานเทียนบูชาและเทียนมงคลหน้าพระวิหาร"},{large:"/u69319090023/Shop23/images/collection/ceremony_gallery_7.webp",largeAlt:"en"===e?"Luang Pho Dap Phai sacred medal souvenir showcased in a premium velvet box":"ภาพของที่ระลึกเหรียญหลวงพ่อดับภัยในกล่องบุกำมะหยี่หรูหรา",top:"/u69319090023/Shop23/images/collection/ceremony_gallery_1_v4.webp",topAlt:"en"===e?"Holy metal materials prepared for melting and casting the amulets":"ภาพมวลสารโลหะทองชนวนศักดิ์สิทธิ์ที่เตรียมใช้หลอมเหรียญ",bottom:"/u69319090023/Shop23/images/collection/ceremony_gallery_2_v3.webp",bottomAlt:"en"===e?"Monks sprinkling holy water on the amulets and ritual participants":"พระสงฆ์ประพรมน้ำพระพุทธมนต์แก่วัตถุมงคลและผู้ร่วมพิธี"}];(0,a.useEffect)(()=>{if(i)return;let e=setInterval(()=>{l(e=>(e+1)%o.length)},6e3);return()=>clearInterval(e)},[i,o.length]);let x={th:{ceremonyBadge:"พิธีพุทธาภิเษก",title:"ประกอบพิธีอย่างถูกต้อง\nตามหลักพระพุทธศาสนา",desc:"วัตถุมงคลเหรียญหลวงพ่อดับภัยทุกรุ่น จัดสร้างและประกอบพิธีศักดิ์สิทธิ์อย่างถูกต้องสมบูรณ์ในทุกขั้นตอน เพื่อสืบสานศรัทธาบารมีขององค์หลวงพ่อดับภัย และส่งเสริมการศึกษาแก่นักเรียนนักศึกษาทางวิทยาลัยเทคนิคเชียงใหม่ รับประกันความเพียบพร้อมทั้งในทางธรรมและเจตนาบริสุทธิ์",quote:"ทุกเหรียญผ่านพิธีพุทธาภิเษก เพื่อความเป็นสิริมงคลแก่ผู้ครอบครอง",author:"— คณะสงฆ์ผู้ประกอบพิธี",step1Date:"ขั้นตอนที่ 1",step1Title:"พิธีบวงสรวง",step1Desc:"ประกอบพิธีอัญเชิญสิ่งศักดิ์สิทธิ์และเทวราช เพื่อความเป็นสิริมงคลก่อนเริ่มงานจัดสร้าง",step2Date:"ขั้นตอนที่ 2",step2Title:"พิธีพุทธาภิเษก",step2Desc:"พิธีใหญ่เจริญพระพุทธมนต์ ณ พระวิหารหลวงปู่ดับภัย โดยพระคณาจารย์ผู้ทรงสมณศักดิ์",step3Date:"ขั้นตอนที่ 3",step3Title:"อธิษฐานจิต",step3Desc:"พระเกจิอาจารย์สายเหนือเมตตาอธิษฐานจิตปลุกเสกเดี่ยว บรรจุพลังมงคลและพุทธคุณหนุนนำ",step4Date:"ขั้นตอนที่ 4",step4Title:"เปิดให้สั่งจอง",step4Desc:"เริ่มเปิดจองวัตถุมงคลล่วงหน้าเป็นทางการ เพื่อสมทบทุนการศึกษาวิทยาลัยเทคนิคเชียงใหม่"},en:{ceremonyBadge:"Consecration Ceremony",title:"Authenticated Ceremony\nAccording to Buddhist Tradition",desc:"Every edition of the Luang Pho Dap Phai sacred medal is created and blessed in full ritual compliance. Designed to pass on blessings and support education funds at Chiang Mai Technical College, ensuring holy and pure intentions.",quote:"Every single medal undergoes full consecration to bring prosperity and protection to its owner.",author:"— The Officiating Clergy",step1Date:"Step 1",step1Title:"Blessing Ritual",step1Desc:"Inviting divine energies and protective deities for blessing before starting the creation process.",step2Date:"Step 2",step2Title:"Consecration Ceremony",step2Desc:"Grand chanting ceremony held at Luang Phu Dap Phai temple hall by senior venerable monks.",step3Date:"Step 3",step3Title:"Solitary Blessing",step3Desc:"Senior northern monks perform private blessings to charge the amulets with spiritual power.",step4Date:"Step 4",step4Title:"Open for Reservation",step4Desc:"Pre-order phase begins officially to raise charity funds for Chiang Mai Tech college student support."}}[e]||{ceremonyBadge:"พิธีพุทธาภิเษก",title:"ประกอบพิธีอย่างถูกต้อง\nตามหลักพระพุทธศาสนา",desc:"วัตถุมงคลเหรียญหลวงพ่อดับภัยทุกรุ่น จัดสร้างและประกอบพิธีศักดิ์สิทธิ์อย่างถูกต้องสมบูรณ์ในทุกขั้นตอน เพื่อสืบสานศรัทธาบารมีขององค์หลวงพ่อดับภัย และส่งเสริมการศึกษาแก่นักเรียนนักศึกษาทางวิทยาลัยเทคนิคเชียงใหม่ รับประกันความเพียบพร้อมทั้งในทางธรรมและเจตนาบริสุทธิ์",quote:"ทุกเหรียญผ่านพิธีพุทธาภิเษก เพื่อความเป็นสิริมงคลแก่ผู้ครอบครอง",author:"— คณะสงฆ์ผู้ประกอบพิธี",step1Date:"ขั้นตอนที่ 1",step1Title:"พิธีบวงสรวง",step1Desc:"ประกอบพิธีอัญเชิญสิ่งศักดิ์สิทธิ์และเทวราช เพื่อความเป็นสิริมงคลก่อนเริ่มงานจัดสร้าง",step2Date:"ขั้นตอนที่ 2",step2Title:"พิธีพุทธาภิเษก",step2Desc:"พิธีใหญ่เจริญพระพุทธมนต์ ณ พระวิหารหลวงปู่ดับภัย โดยพระคณาจารย์ผู้ทรงสมณศักดิ์",step3Date:"ขั้นตอนที่ 3",step3Title:"อธิษฐานจิต",step3Desc:"พระเกจิอาจารย์สายเหนือเมตตาอธิษฐานจิตปลุกเสกเดี่ยว บรรจุพลังมงคลและพุทธคุณหนุนนำ",step4Date:"ขั้นตอนที่ 4",step4Title:"เปิดให้สั่งจอง",step4Desc:"เริ่มเปิดจองวัตถุมงคลล่วงหน้าเป็นทางการ เพื่อสมทบทุนการศึกษาวิทยาลัยเทคนิคเชียงใหม่"},m=[{date:x.step1Date,title:x.step1Title,desc:x.step1Desc},{date:x.step2Date,title:x.step2Title,desc:x.step2Desc},{date:x.step3Date,title:x.step3Title,desc:x.step3Desc},{date:x.step4Date,title:x.step4Title,desc:x.step4Desc}],g=35*!s;return(0,t.jsxs)("section",{className:"relative w-screen left-1/2 -translate-x-1/2 bg-[#080808] text-white py-24 sm:py-32 px-4 sm:px-6 lg:px-8 flex flex-col items-center overflow-hidden border-t border-white/[0.03]",children:[(0,t.jsx)("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] sm:w-[800px] h-[600px] sm:h-[800px] bg-amber-500/[0.015] rounded-full blur-[120px] pointer-events-none z-0"}),(0,t.jsxs)(c.motion.div,{initial:{opacity:0,y:g},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-100px"},transition:{duration:.7,ease:[.16,1,.3,1]},className:"max-w-6xl w-full relative z-10 flex flex-col items-center text-center mb-16",children:[(0,t.jsx)("span",{className:"inline-flex items-center px-4 py-1.5 rounded-full border border-amber-500/25 bg-amber-500/5 text-amber-400 text-xs font-semibold uppercase tracking-widest mb-6",children:x.ceremonyBadge}),(0,t.jsx)("h2",{className:"text-3xl sm:text-4xl md:text-5xl font-extrabold text-white tracking-tight font-prompt max-w-3xl leading-[1.15] mb-6 whitespace-pre-line",children:x.title}),(0,t.jsx)("p",{className:"text-neutral-400 text-sm sm:text-base font-light max-w-2xl leading-relaxed",children:x.desc})]}),(0,t.jsxs)(c.motion.div,{initial:{opacity:0,scale:s?1:.98},whileInView:{opacity:1,scale:1},viewport:{once:!0,margin:"-80px"},transition:{duration:.8,ease:[.16,1,.3,1]},className:"max-w-6xl w-full aspect-[16/8] rounded-[24px] sm:rounded-[32px] overflow-hidden border border-white/10 relative shadow-2xl group mb-20 z-10",children:[(0,t.jsx)(p.default,{src:"/u69319090023/Shop23/images/collection/ceremony_featured.webp",alt:"Buddhist Consecration Ceremony",fill:!0,loading:"lazy",className:"object-cover transition-transform duration-700 ease-out group-hover:scale-[1.015]"}),(0,t.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/20 to-transparent pointer-events-none"})]}),(0,t.jsx)(c.motion.div,{initial:{opacity:0},whileInView:{opacity:1},viewport:{once:!0},transition:{duration:.6},className:"w-full relative z-10 mb-24",children:(0,t.jsxs)("div",{className:"relative max-w-4xl w-full mx-auto px-6",children:[(0,t.jsx)("div",{className:"absolute left-[33px] top-6 bottom-6 w-[1px] md:left-6 md:right-6 md:top-[9px] md:bottom-auto md:w-auto md:h-[1px] bg-amber-500/15 z-0"}),(0,t.jsx)("div",{className:"relative z-10 flex flex-col md:flex-row justify-between items-start gap-8 md:gap-4",children:m.map((e,a)=>(0,t.jsxs)(c.motion.div,{initial:{opacity:0,y:15*!s},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5,delay:.1*a,ease:[.16,1,.3,1]},className:"flex flex-row md:flex-col items-start md:items-center gap-4 md:gap-3 flex-1 text-left md:text-center w-full group",children:[(0,t.jsx)("div",{className:"w-[18px] h-[18px] rounded-full bg-amber-500/10 border border-amber-500/40 flex items-center justify-center transition-all duration-300 group-hover:scale-125 group-hover:border-amber-400 group-hover:shadow-[0_0_12px_rgba(245,158,11,0.6)] z-10 bg-[#080808] mt-1 md:mt-0",children:(0,t.jsx)("div",{className:"w-2 h-2 rounded-full bg-amber-500 shadow-[0_0_6px_rgba(245,158,11,0.8)]"})}),(0,t.jsxs)("div",{className:"flex flex-col md:items-center",children:[(0,t.jsx)("span",{className:"text-[10px] font-bold text-amber-500/80 uppercase tracking-widest",children:e.date}),(0,t.jsx)("span",{className:"text-sm font-bold text-white mt-0.5",children:e.title}),(0,t.jsx)("span",{className:"text-xs text-neutral-400 font-light mt-1 max-w-[190px] leading-relaxed",children:e.desc})]})]},a))})]})}),(0,t.jsxs)("div",{className:"relative w-full max-w-5xl flex flex-col items-center z-10",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:[(0,t.jsx)(d.AnimatePresence,{mode:"wait",children:(0,t.jsxs)(c.motion.div,{initial:{opacity:0,y:g},animate:{opacity:1,y:0},exit:{opacity:0,y:-g},transition:{duration:.45,ease:[.16,1,.3,1]},className:"grid grid-cols-1 md:grid-cols-2 gap-6 lg:gap-8 w-full",children:[(0,t.jsx)("div",{className:"flex flex-col justify-center",children:(0,t.jsxs)("div",{className:"relative overflow-hidden rounded-[20px] aspect-[4/5] border border-white/10 shadow-lg group",children:[(0,t.jsx)(p.default,{src:o[r].large,alt:o[r].largeAlt,fill:!0,loading:"lazy",className:"object-cover transition-all duration-700 ease-out group-hover:scale-105 group-hover:brightness-110"}),(0,t.jsx)("div",{className:"absolute inset-0 border border-transparent group-hover:border-amber-500/40 rounded-[20px] transition-all duration-500 pointer-events-none"})]})}),(0,t.jsxs)("div",{className:"flex flex-col gap-6 lg:gap-8 justify-between",children:[(0,t.jsxs)("div",{className:"relative overflow-hidden rounded-[20px] aspect-[3/2] border border-white/10 shadow-lg group",children:[(0,t.jsx)(p.default,{src:o[r].top,alt:o[r].topAlt,fill:!0,loading:"lazy",className:"object-cover transition-all duration-700 ease-out group-hover:scale-105 group-hover:brightness-110"}),(0,t.jsx)("div",{className:"absolute inset-0 border border-transparent group-hover:border-amber-500/40 rounded-[20px] transition-all duration-500 pointer-events-none"})]}),(0,t.jsxs)("div",{className:"relative overflow-hidden rounded-[20px] aspect-[3/2] border border-white/10 shadow-lg group",children:[(0,t.jsx)(p.default,{src:o[r].bottom,alt:o[r].bottomAlt,fill:!0,loading:"lazy",className:"object-cover transition-all duration-700 ease-out group-hover:scale-105 group-hover:brightness-110"}),(0,t.jsx)("div",{className:"absolute inset-0 border border-transparent group-hover:border-amber-500/40 rounded-[20px] transition-all duration-500 pointer-events-none"})]})]})]},r)}),(0,t.jsx)("div",{className:"flex justify-center items-center space-x-3 mt-8 mb-20",children:o.map((e,a)=>(0,t.jsx)("button",{onClick:()=>l(a),className:`h-2.5 rounded-full transition-all duration-300 cursor-pointer ${r===a?"bg-amber-400 w-8 shadow-[0_0_8px_rgba(245,158,11,0.6)]":"bg-white/20 hover:bg-white/45 w-2.5"}`,"aria-label":`Go to page ${a+1}`},a))})]}),(0,t.jsxs)(c.motion.div,{initial:{opacity:0},whileInView:{opacity:1},viewport:{once:!0},transition:{duration:.8,ease:[.16,1,.3,1]},className:"max-w-3xl w-full text-center relative z-10 pt-8",children:[(0,t.jsxs)("p",{className:"text-xl sm:text-2xl md:text-3xl font-bold font-prompt text-amber-200/90 leading-relaxed italic",children:["“",x.quote,"”"]}),(0,t.jsx)("span",{className:"inline-block mt-4 text-xs font-semibold tracking-widest text-neutral-400 uppercase",children:x.author})]})]})},O=({products:e})=>{let{addItem:r}=(0,N.useCart)();(0,s.useRouter)();let[l,i]=(0,a.useState)(!1),[n,o]=(0,a.useState)(null),x=(0,a.useRef)(null);(0,a.useRef)(null);let[m,g]=(0,a.useState)("th");(0,a.useEffect)(()=>{g(localStorage.getItem("preferred_language")||"th");let e=()=>{g(localStorage.getItem("preferred_language")||"th")};return window.addEventListener("languageChange",e),window.addEventListener("storage",e),()=>{window.removeEventListener("languageChange",e),window.removeEventListener("storage",e)}},[]);let h=[{id:"prod_amulet_silver",name:"เนื้อเงินบริสุทธิ์",subName:"Silver Edition",bgImage:"/u69319090023/Shop23/images/collection/silver/background.webp",medalImage:"/u69319090023/Shop23/images/collection/silver/medal_v2.png",theme:"silver",price:1529,limit:200,reserved:144,scarcityStatus:"warning"},{id:"prod_amulet_copper",name:"เนื้อทองแดง",subName:"Copper Edition",bgImage:"/u69319090023/Shop23/images/collection/copper/background.webp",medalImage:"/u69319090023/Shop23/images/collection/copper/medal_v2.png",theme:"copper",price:119,limit:1e3,reserved:680,scarcityStatus:"warning"},{id:"prod_amulet_gold",name:"เนื้อทองคำเหลือง",subName:"Brass Edition",bgImage:"/u69319090023/Shop23/images/collection/brass/background.webp",medalImage:"/u69319090023/Shop23/images/collection/brass/medal_v2.png",theme:"brass",price:119,limit:500,reserved:395,scarcityStatus:"danger"}],[u,b]=(0,a.useState)(h[0]);(0,a.useEffect)(()=>{i(!0)},[]);let f=(t,a)=>{t.preventDefault(),t.stopPropagation();let s=e.find(e=>e.id===a);if(!s){let e=h.find(e=>e.id===a);e&&(s={id:a,name:"en"===m?`Luang Pho Dap Phai Medal - College Anniversary (${e.subName})`:`เหรียญหลวงพ่อดับภัย รุ่นที่ระลึกครบรอบวิทยาลัย (${e.name})`,slug:"prod_amulet_silver"===a?"amulet-silver":"prod_amulet_copper"===a?"amulet-copper":"amulet-gold",description:"en"===m?"Venerable Luang Pho Dap Phai sacred medal, special seasonal pre-order edition, Chiang Mai Technical College. Consecrated with holy materials.":'เหรียญพระมงคลวัตถุ "หลวงพ่อดับภัย" รุ่นสั่งจองพิเศษประจำฤดูกาล วิทยาลัยเทคนิคเชียงใหม่ พิธีพุทธาภิเษกเข้มขลัง มวลสารชนวนมงคลศักดิ์สิทธิ์',price:e.price,images:[e.medalImage],categoryId:"cat_amulets",rating:5,reviewsCount:15,sizes:["en"===m?"Standard Large Edition":"ขนาดบูชามาตรฐาน (พิมพ์ใหญ่)"],inStock:!0,stockCount:50})}if(s){let e=s.sizes&&s.sizes.length>0?s.sizes[0]:"en"===m?"Standard Large Edition":"ขนาดบูชามาตรฐาน (พิมพ์ใหญ่)";r(s,1,e),o(s.name),setTimeout(()=>o(null),3e3)}},v=(0,C.useReducedMotion)()??!1,y=T[u.theme],w={"--accent-glow":y.accentGlow};return(0,t.jsxs)("div",{className:"w-full min-h-screen bg-[#FAF7F2] text-gray-900 font-prompt overflow-x-hidden selection:bg-amber-900 selection:text-white",children:[(0,t.jsx)(d.AnimatePresence,{children:n&&(0,t.jsxs)(c.motion.div,{initial:{opacity:0,y:50,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},className:"fixed bottom-6 right-6 z-[100] bg-gray-900 text-white px-5 py-3.5 rounded-2xl shadow-2xl border border-white/10 flex items-center space-x-3",children:[(0,t.jsx)(D.CheckCircle2,{className:"w-5 h-5 text-emerald-400 flex-shrink-0"}),(0,t.jsx)("span",{className:"text-xs sm:text-sm font-semibold truncate max-w-xs",children:"en"===m?(0,t.jsxs)(t.Fragment,{children:['Added "',n,'" to pre-orders.']}):(0,t.jsxs)(t.Fragment,{children:['เพิ่ม "',n,'" ลงในรายการสั่งจองเรียบร้อย']})})]})}),(0,t.jsxs)("section",{style:w,className:"relative w-screen left-1/2 -translate-x-1/2 min-h-[95vh] text-white pt-28 pb-20 px-4 sm:px-6 lg:px-12 flex items-center justify-center overflow-hidden bg-gradient-to-b from-[#120303] via-[#0A0202] to-[#120303]",children:[(0,t.jsxs)("div",{className:"absolute inset-0 w-full h-full z-0",style:{position:"absolute",top:0,left:0,right:0,bottom:0,width:"100vw",height:"100%"},children:[(0,t.jsx)(p.default,{src:u.bgImage,alt:"Background Layer",fill:!0,priority:!0,className:"object-cover opacity-35 transition-opacity duration-700 ease-in-out",style:{objectFit:"cover"}},u.id),(0,t.jsx)("div",{className:"absolute inset-0 w-full h-full bg-gradient-to-b from-black/90 via-black/20 to-black/95 pointer-events-none",style:{position:"absolute",top:0,left:0,right:0,bottom:0,width:"100vw",height:"100%"}})]}),(0,t.jsx)("div",{className:"absolute inset-0 z-0 pointer-events-none",style:{background:`radial-gradient(circle at 50% 120%, ${y.ambientRays}, transparent 50%)`}}),(0,t.jsxs)("div",{className:"mx-auto w-full max-w-7xl relative z-30 grid grid-cols-1 lg:grid-cols-12 gap-12 lg:gap-16 items-center text-left",children:[(0,t.jsxs)(c.motion.div,{variants:P,initial:"initial",animate:"animate",className:"lg:col-span-7 flex flex-col space-y-6 lg:pr-4",children:[(0,t.jsx)(c.motion.div,{variants:z,children:(0,t.jsxs)("span",{className:`inline-flex items-center space-x-2 px-4 py-1.5 rounded-full border text-[10px] font-bold tracking-[0.2em] uppercase transition-all duration-300 shadow-md ${y.badgeClass} cursor-default`,children:[(0,t.jsx)(F.Sparkles,{className:"w-3.5 h-3.5 animate-pulse",style:{color:y.accentColor}}),(0,t.jsx)("span",{children:"LIMITED PRE-ORDER"})]})}),(0,t.jsxs)(c.motion.div,{variants:z,className:"space-y-3.5",children:[(0,t.jsx)("h1",{className:"text-4xl sm:text-6xl lg:text-7xl font-bold tracking-tight leading-[1.08] font-prompt",children:"en"===m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:`bg-gradient-to-b ${y.primaryTextGradientClass} bg-clip-text text-transparent box-decoration-clone`,children:"Luang Pho Dap Phai"}),(0,t.jsx)("br",{}),(0,t.jsx)("span",{className:`bg-gradient-to-r ${y.textGradientClass} bg-clip-text text-transparent drop-shadow-[0_2px_10px_rgba(0,0,0,0.55)] box-decoration-clone`,children:"Sacred Amulet"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:`bg-gradient-to-b ${y.primaryTextGradientClass} bg-clip-text text-transparent box-decoration-clone`,children:"คอลเลกชันสั่งจอง"}),(0,t.jsx)("br",{}),(0,t.jsx)("span",{className:`bg-gradient-to-b ${y.primaryTextGradientClass} bg-clip-text text-transparent box-decoration-clone`,children:"เหรียญ"}),(0,t.jsx)("span",{className:`bg-gradient-to-r ${y.textGradientClass} bg-clip-text text-transparent drop-shadow-[0_2px_10px_rgba(0,0,0,0.55)] box-decoration-clone`,children:"หลวงพ่อดับภัย"})]})}),(0,t.jsx)("p",{style:{color:y.accentColor},className:"text-sm sm:text-base font-semibold tracking-wide uppercase mt-1",children:"en"===m?u.subName:`${u.name} (${u.subName})`})]}),(0,t.jsx)(c.motion.div,{variants:z,children:(0,t.jsx)("p",{style:{color:y.secondaryTextColor},className:"text-sm sm:text-base font-light leading-relaxed max-w-xl opacity-90",children:"en"===m?"Venerable and highly valued sacred amulets of 'Luang Pho Dap Phai', crafted using holy metal alloys. Blessed in a grand consecration ceremony to bring prosperity, protection, and safety from all harms. All proceeds go toward educational charity funds for students at Chiang Mai Technical College.":"เหรียญพระมงคลวัตถุทรงคุณค่า มวลสารชนวนมงคลศักดิ์สิทธิ์ พิธีพุทธาภิเษกเข้มขลัง ร่วมน้อมจัดสร้างเพื่อสิริมงคล เมตตามหานิยม ปกป้องคุ้มครองดับภัยอันตราย สมทบทุนเพื่อการกุศลและการศึกษาวิทยาลัยเทคนิคเชียงใหม่"})}),(0,t.jsx)(c.motion.div,{variants:z,className:"w-full",children:(0,t.jsx)(G,{limit:u.limit,lang:m,accentColor:y.accentColor})}),(0,t.jsx)(c.motion.div,{variants:z,className:"w-full pt-1",children:(0,t.jsx)(d.AnimatePresence,{mode:"wait",children:(0,t.jsx)(c.motion.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:E,children:(0,t.jsx)($,{limit:u.limit,reserved:u.reserved,theme:u.theme,lang:m})},u.id)})}),(0,t.jsxs)(c.motion.div,{variants:z,className:"flex flex-wrap items-center gap-4 pt-3",children:[(0,t.jsxs)("button",{type:"button",onClick:e=>f(e,u.id),className:`px-8 py-4 rounded-full bg-gradient-to-r font-extrabold text-sm sm:text-base transition-all duration-300 hover:scale-[1.03] active:scale-[0.97] cursor-pointer flex items-center space-x-2 border ${y.buttonClass}`,children:[(0,t.jsx)(S.ShoppingBag,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"en"===m?"Pre-order Now":"สั่งจองบูชาทันที"})]}),(0,t.jsxs)("button",{type:"button",onClick:()=>{x.current?.scrollIntoView({behavior:"smooth"})},className:"px-6 py-4 rounded-full bg-white/[0.03] hover:bg-white/[0.08] border border-white/10 text-white font-semibold text-xs sm:text-sm hover:border-white/20 transition-all duration-300 hover:scale-[1.02] active:scale-[0.98] cursor-pointer flex items-center space-x-2 backdrop-blur-sm",children:[(0,t.jsx)("span",{children:"en"===m?"Read Details":"อ่านรายละเอียด"}),(0,t.jsx)(A.ChevronDown,{className:"w-4 h-4 text-gray-400"})]})]})]}),(0,t.jsx)("div",{className:"lg:col-span-5 flex flex-col items-center justify-center relative",children:(0,t.jsx)(d.AnimatePresence,{mode:"wait",children:(0,t.jsxs)(c.motion.div,{initial:{opacity:0,scale:.94},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.94},transition:E,className:"flex flex-col items-center justify-center w-full cursor-grab active:cursor-grabbing select-none",drag:"x",dragConstraints:{left:0,right:0},dragElastic:.6,onDragEnd:(e,t)=>{let a=h.findIndex(e=>e.id===u.id);if(t.offset.x<-70){let e=(a+1)%h.length;b(h[e])}else if(t.offset.x>70){let e=(a-1+h.length)%h.length;b(h[e])}},children:[(0,t.jsx)(R,{image:u.medalImage,name:u.name,theme:u.theme,reducedMotion:v}),(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsx)(M,{price:u.price,theme:u.theme,onClick:e=>f(e,u.id)})}),(0,t.jsx)("div",{className:"flex items-center justify-center space-x-4 h-6 mt-8",children:h.map(e=>{let a=u.id===e.id,s="silver"===e.theme?{background:"linear-gradient(to right, #FFFFFF, #C7CBD1)",boxShadow:"0 0 16px rgba(255, 255, 255, 0.45), inset 0 0 4px rgba(255, 255, 255, 0.2)"}:"copper"===e.theme?{background:"linear-gradient(to right, #B87355, #7A4635)",boxShadow:"0 0 16px rgba(184, 115, 85, 0.45), inset 0 0 4px rgba(255, 255, 255, 0.2)"}:{background:"linear-gradient(to right, #C9A85C, #8F6B2F)",boxShadow:"0 0 16px rgba(201, 168, 92, 0.45), inset 0 0 4px rgba(255, 255, 255, 0.2)"};return(0,t.jsx)("button",{type:"button",onClick:t=>{t.stopPropagation(),b(e)},className:"relative focus:outline-none transition-all duration-300 cursor-pointer flex items-center justify-center pointer-events-auto","aria-label":`Select ${e.name}`,children:a?(0,t.jsx)(c.motion.div,{layoutId:"activeVariantDotPill",className:"w-11 h-3.5 rounded-full",style:s,transition:{type:"spring",stiffness:350,damping:25}}):(0,t.jsx)("div",{className:"w-3.5 h-3.5 rounded-full bg-neutral-700/80 hover:bg-neutral-600 transition-colors duration-200"})},e.id)})})]},u.id)})})]})]}),(0,t.jsx)("div",{ref:x,children:(0,t.jsx)(V,{lang:m})})]})};var q=e.i(50924),H=e.i(21993);let K=()=>{let e=(0,s.useRouter)(),r=(0,s.useSearchParams)(),p=r.get("category")||"",g=r.get("search")||"",h=r.get("collection")||"",u=r.get("department")||"",{selectedDepartmentSlug:b,selectedDepartment:f,openModal:C,selectDepartment:F}=(0,q.useDepartment)(),{addItem:_}=(0,N.useCart)(),[k,S]=(0,a.useState)([]),[D,A]=(0,a.useState)([]),[T,B]=(0,a.useState)([]),[E,P]=(0,a.useState)(!0),[z,L]=(0,a.useState)("latest"),[I,G]=(0,a.useState)(null),[$,R]=(0,a.useState)(null);(0,a.useEffect)(()=>{if($){let e=setTimeout(()=>R(null),3e3);return()=>clearTimeout(e)}},[$]),(0,a.useEffect)(()=>{Promise.all([y.default.getProducts(),w.default.getCategories()]).then(([e,t])=>{S(e),A(t),P(!1)})},[]),(0,a.useEffect)(()=>{let e=[...k];if(u&&(e=e.filter(e=>e.departmentSlugs?.includes(u))),g){let t=g.toLowerCase().trim();e=e.filter(e=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t))}else if(p){let t=D.find(e=>e.slug===p);t&&(e=e.filter(e=>e.categoryId===t.id))}if("popular"!==h||g||(e=e.filter(e=>e.isPreOrder||"cat_amulets"===e.categoryId)),"price-low"===z)e.sort((e,t)=>e.price-t.price);else if("price-high"===z)e.sort((e,t)=>t.price-e.price);else if("rating"===z)e.sort((e,t)=>t.rating-e.rating);else if("name-asc"===z)e.sort((e,t)=>e.name.localeCompare(t.name,"th",{numeric:!0,sensitivity:"base"}));else if("latest"===z){let t=(e,t)=>e.isNew&&!t.isNew?-1:!e.isNew&&t.isNew?1:0;!b||g||p||u?e.sort(t):e.sort((e,a)=>{let s=e.departmentSlugs?.includes(b)||!1,r=a.departmentSlugs?.includes(b)||!1,l=!e.departmentSlugs||0===e.departmentSlugs.length,i=!a.departmentSlugs||0===a.departmentSlugs.length,n=s?1:l?2:3,o=r?1:i?2:3;return n!==o?n-o:t(e,a)})}B(e)},[k,D,p,g,z,h,u,b]);let M=[];if(g){let e=k.filter(e=>{let t=g.toLowerCase().trim();return e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)}),t={};e.forEach(e=>{t[e.categoryId]=(t[e.categoryId]||0)+1}),M=Object.keys(t).map(e=>({category:D.find(t=>t.id===e),count:t[e]})).filter(e=>void 0!==e.category).sort((e,t)=>t.count-e.count)}let V=H.mockDepartments.find(e=>e.slug===u);k.filter(e=>e.departmentSlugs?.includes(b||"")).length;let K=!!g||!!p,U="popular"===h||"amulets"===p,X=D.find(e=>e.slug===p),Z=X?X.name:"สินค้าทั้งหมด";return U?(0,t.jsx)(O,{products:T}):(0,t.jsxs)("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 pt-28 pb-8",children:[(0,t.jsx)("div",{className:"border-b border-gray-200 pb-5 mb-8",children:u?(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2 text-accent text-xs font-bold mb-2",children:[(0,t.jsx)(o.GraduationCap,{className:"w-4 h-4 text-accent"}),(0,t.jsx)("span",{children:"โหมดดูสินค้าเฉพาะแผนกวิชา"})]}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h1",{className:"text-3xl font-extrabold text-gray-900 tracking-tight font-prompt",children:["สินค้าสำหรับแผนก",V?V.name:u]}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-gray-500 font-light leading-relaxed",children:["แสดงรายการเสื้อช็อปและสินค้าปฏิบัติงานประจำสาขาวิชา ",V?V.name:u," วิทยาลัยเทคนิคเชียงใหม่"]})]}),(0,t.jsx)("button",{type:"button",onClick:()=>e.push("/products"),className:"inline-flex items-center space-x-1.5 px-4 py-2 border border-gray-200 hover:bg-gray-50 text-gray-700 rounded-xl text-xs font-bold cursor-pointer transition-colors flex-shrink-0 self-start sm:self-center font-prompt",children:(0,t.jsx)("span",{children:"← ดูสินค้าทั้งหมด"})})]})]}):U?(0,t.jsxs)("div",{className:"bg-gradient-to-r from-[rgba(40,6,6,0.95)] via-[rgba(65,10,10,0.95)] to-[rgba(30,4,4,0.95)] rounded-3xl p-6 sm:p-8 text-white shadow-luxury border border-amber-500/20 text-left relative overflow-hidden",children:[(0,t.jsx)("div",{className:"absolute right-0 top-0 w-64 h-64 bg-amber-500/10 rounded-full blur-3xl pointer-events-none"}),(0,t.jsx)("span",{className:"inline-flex items-center space-x-1.5 px-3 py-1 bg-amber-500/20 border border-amber-500/40 text-amber-300 text-xs font-bold rounded-full mb-3",children:(0,t.jsx)("span",{children:"✦ วัตถุมงคลประจำฤดูกาล (Seasonal Limited Pre-Order)"})}),(0,t.jsx)("h1",{className:"text-2xl sm:text-4xl font-black text-amber-100 tracking-tight font-prompt",children:"คอลเลกชันสั่งจอง: เหรียญหลวงพ่อดับภัย"}),(0,t.jsx)("p",{className:"mt-2 text-xs sm:text-sm text-amber-200/80 font-light max-w-2xl leading-relaxed",children:'สิริมงคลต้อนรับฤดูกาลใหม่ เหรียญมงคลทรงคุณค่า "หลวงพ่อดับภัย" รุ่นที่ระลึกวิทยาลัยเทคนิคเชียงใหม่ เปิดให้สั่งจองล่วงหน้า (Pre-Order) จำนวนจำกัดเท่านั้น'})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("h1",{className:"text-3xl font-extrabold text-gray-900 tracking-tight",children:Z}),(0,t.jsx)("p",{className:"mt-2 text-sm text-gray-500 font-light",children:"ค้นหาเสื้อยืด เสื้อโปโล เสื้อช็อปกิจกรรม วัตถุมงคล และอุปกรณ์เสริมประจำวิทยาลัยเทคนิคเชียงใหม่"})]})}),(0,t.jsxs)("div",{className:"flex justify-between items-center bg-white border border-gray-100 px-5 py-3.5 rounded-premium shadow-card-soft mb-6 gap-4",children:[(0,t.jsxs)("span",{className:"text-sm text-gray-500 font-light text-left",children:["พบสินค้า ",(0,t.jsx)("span",{className:"font-bold text-accent",children:T.length})," ชิ้น"]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 relative",children:[(0,t.jsx)(l,{className:"absolute left-3.5 w-4 h-4 text-gray-400 pointer-events-none"}),(0,t.jsxs)("select",{value:z,onChange:e=>L(e.target.value),className:"bg-gray-50 border border-gray-200 rounded-xl pl-9 pr-4 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent text-gray-700 w-full sm:w-auto cursor-pointer h-10 appearance-none font-semibold",children:[(0,t.jsx)("option",{value:"latest",children:"สินค้าใหม่"}),(0,t.jsx)("option",{value:"price-low",children:"ราคา: ต่ำ → สูง"}),(0,t.jsx)("option",{value:"price-high",children:"ราคา: สูง → ต่ำ"}),(0,t.jsx)("option",{value:"name-asc",children:"ชื่อสินค้า: A → Z"})]})]})]}),g&&M.length>0&&(0,t.jsxs)("div",{className:"mb-6 text-left animate-fadeIn",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-gray-500 mr-2",children:"หมวดหมู่ที่พบ:"}),(0,t.jsx)("div",{className:"inline-flex flex-wrap gap-2 mt-1 sm:mt-0 items-center",children:M.map(({category:a,count:s})=>(0,t.jsxs)("button",{onClick:()=>{var t;return t=a.slug,void e.replace(`/products?category=${t}`,{scroll:!1})},className:"text-xs bg-accent/5 text-accent border border-accent/20 hover:bg-accent hover:text-white px-3 py-1.5 rounded-full transition-all cursor-pointer font-medium",children:[a.name," (",s,")"]},a.id))})]}),(0,t.jsx)("main",{className:"w-full",children:E?(0,t.jsx)(j.SkeletonProductGrid,{count:8}):T.length>0?(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3 sm:gap-6",children:[!K&&(0,t.jsx)(m.default,{}),T.map(e=>(0,t.jsx)(x.default,{product:e,onAddToCartClick:e=>G(e)},e.id))]}):(0,t.jsxs)("div",{className:"bg-white border border-gray-100 p-16 rounded-premium text-center shadow-card-soft",children:[(0,t.jsx)(n.SlidersHorizontal,{className:"w-12 h-12 text-gray-300 mx-auto mb-4"}),(0,t.jsx)("h3",{className:"text-lg font-bold text-gray-800 mb-1",children:"ไม่พบสินค้าตามที่ค้นหา"}),(0,t.jsx)("p",{className:"text-sm text-gray-500 font-light",children:"กรุณาปรับปรุงคำค้นหาของคุณใหม่อีกครั้ง"})]})}),(0,t.jsx)(v,{product:I,isOpen:!!I,onClose:()=>G(null),onConfirm:(e,t)=>{I&&(_(I,t,e),R({name:I.name,size:e,qty:t}),G(null))}}),(0,t.jsx)(d.AnimatePresence,{children:$&&(0,t.jsxs)(c.motion.div,{initial:{opacity:0,y:50,scale:.9},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},className:"fixed bottom-6 right-6 z-50 bg-gray-900/95 backdrop-blur-md text-white px-5 py-4 rounded-premium shadow-luxury border border-white/10 flex items-center space-x-3.5 max-w-sm",children:[(0,t.jsx)("div",{className:"bg-emerald-500 text-white p-2 rounded-full flex-shrink-0",children:(0,t.jsx)(i.Check,{className:"w-5 h-5"})}),(0,t.jsxs)("div",{className:"flex flex-col text-left",children:[(0,t.jsx)("span",{className:"text-xs font-bold text-emerald-400",children:"เพิ่มสินค้าลงตะกร้าแล้ว!"}),(0,t.jsx)("span",{className:"text-xs text-white/90 font-semibold line-clamp-1 mt-0.5",children:$.name}),(0,t.jsxs)("span",{className:"text-[10px] text-white/60 mt-0.5 font-medium",children:["ไซส์: ",$.size," | จำนวน: ",$.qty," ชิ้น"]})]})]})})]})};e.s(["default",0,function(){return(0,t.jsx)(a.Suspense,{fallback:(0,t.jsx)("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 pt-28 pb-8",children:(0,t.jsx)(j.SkeletonProductGrid,{count:8})}),children:(0,t.jsx)(K,{})})}],12336)}]);
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.25 |
proxy
|
phpinfo
|
Settings