1import{r as o,j as e,x as m}from"./app-Mnt2IEGe.js";import{G as c}from"./GuestLayout-BYnLiqFZ.js";import{T as p}from"./trending-up-BJpWTmYS.js";import{P as a}from"./package-CT4joqbC.js";import{C as h}from"./calendar-BUCjVDoJ.js";import{U as g}from"./user-ad0RTXxq.js";import{M as b}from"./map-pin-BuVEKMGp.js";import"./ApplicationLogo-JvKRx6b1.js";import"./x-B1Pn9Kmg.js";import"./message-circle-D4MbkUVn.js";import"./phone-DSAsYLtt.js";import"./chevron-down-BlAiga6f.js";import"./truck-CpGakV_6.js";import"./shopping-cart-DokKNEt4.js";import"./search-BeXkNHdv.js";import"./clock-Dnho5FNh.js";import"./shield-Da3uiB5y.js";import"./mail-Ce-sk81h.js";const y=s=>`â¹${Number(s||0).toFixed(2)}`;function P({orders:s=[],wallet_balance:x="0.00",wallet_transactions:r=[],referral_code:n}){const[t,i]=o.useState(!1);return e.jsxs(c,{children:[e.jsxs("section",{className:"relative overflow-hidden bg-gradient-to-br from-primary to-primary py-12 sm:py-16 lg:py-24",children:[e.jsx("div",{className:"absolute inset-0 bg-[url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHZpZXdCb3g9IjAgMCA2MCA2MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxnIGZpbGw9IiNmZmZmZmYiIGZpbGwtb3BhY2l0eT0iMC4wNSI+PHBhdGggZD0iTTM2IDE2YzAtMi4yMDkgMS43OTEtNCA0LTRzNCAxLjc5MSA0IDQtMS43OTEgNC00IDQtNC0xLjc5MS00LTR6bS0yMCAwYzAtMi4yMDkgMS43OTEtNCA0LTRzNCAxLjc5MSA0IDQtMS43OTEgNC00IDQtNC0xLjc5MS00LTR6Ii8+PC9nPjwvZz48L3N2Zz4=')] opacity-20"}),e.jsx("div",{className:"relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"inline-block mb-3 px-3 py-1.5 bg-white/10 backdrop-blur-sm rounded-full",children:e.jsx("span",{className:"text-primary-light text-xs sm:text-sm font-medium",children:"Welcome back!"})}),e.jsx("h1",{className:"text-2xl sm:text-3xl lg:text-5xl font-extrabold text-white tracking-tight mb-3 px-4",children:"Order History"}),e.jsx("p",{className:"text-sm sm:text-base lg:text-lg text-primary-light max-w-3xl mx-auto font-light leading-relaxed px-4",children:"View all your past orders and their details"})]})})]}),e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6 sm:py-8 lg:py-10",children:e.jsxs("div",{className:"bg-white border-2 border-gray-200 rounded-2xl sm:rounded-3xl shadow-xl overflow-hidden",children:[e.jsx("div",{className:"bg-gradient-to-r from-primary-light via-blue-50 to-primary-light px-4 sm:px-5 lg:px-6 py-4 sm:py-5 border-b-2 border-gray-200",children:e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5 sm:gap-3",children:[e.jsx("div",{className:"p-2 sm:p-2.5 bg-indigo-100 rounded-xl shadow-md flex-shrink-0",children:e.jsx(p,{className:"w-5 h-5 sm:w-6 sm:h-6 text-primary"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg sm:text-xl lg:text-2xl font-bold text-gray-900",children:"Recent Orders"}),e.jsx("p",{className:"text-xs sm:text-sm text-gray-600 mt-0.5",children:"View and manage your order history"})]})]}),s.length>0&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 sm:gap-2 px-3 sm:px-4 py-1.5 sm:py-2 bg-white rounded-full text-xs sm:text-sm font-semibold text-gray-700 shadow-md border border-indigo-200",children:[e.jsx(a,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"}),e.jsx("span",{children:s.length}),e.jsx("span",{className:"hidden sm:inline",children:s.length===1?"Order":"Orders"})]})]})}),e.jsx("div",{className:"p-4 sm:p-5 lg:p-6",children:s.length===0?e.jsxs("div",{className:"text-center py-10 sm:py-14 lg:py-16",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 sm:w-20 sm:h-20 bg-gradient-to-br from-primary-light to-primary-light rounded-2xl mb-5 shadow-lg",children:e.jsx(a,{className:"w-8 h-8 sm:w-10 sm:h-10 text-blue-400"})}),e.jsx("h3",{className:"text-lg sm:text-xl font-bold text-gray-900 mb-2 px-4",children:"No orders yet"}),e.jsx("p",{className:"text-sm sm:text-base text-gray-600 mb-5 px-4 max-w-md mx-auto",children:"Start shopping to see your orders here"}),e.jsxs(m,{href:"/shop",className:"inline-flex items-center gap-2 px-5 sm:px-6 py-2.5 bg-gradient-to-r from-primary to-primary hover:from-primary hover:to-primary text-white text-sm sm:text-base font-semibold rounded-xl transition-all shadow-lg hover:shadow-xl",children:[e.jsx(a,{className:"w-4 h-4 sm:w-5 sm:h-5"}),"Start Shopping"]})]}):e.jsx("div",{className:"space-y-3 sm:space-y-4",children:s.map((l,d)=>e.jsx(f,{order:l,index:d},l.order_number))})})]})})]})}function f({order:s,index:x}){const r={completed:"bg-green-100 text-green-700 border-green-300",pen
1ding:"bg-yellow-100 text-yellow-700 border-yellow-300",cancelled:"bg-red-100 text-red-700 border-red-300",processing:"bg-blue-100 text-blue-700 border-blue-300"};return e.jsx("div",{className:"group bg-gradient-to-br from-white to-gray-50 border-2 border-gray-200 rounded-xl sm:rounded-2xl p-4 sm:p-5 hover:shadow-2xl hover:border-indigo-300 transition-all duration-300",children:e.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2.5 sm:gap-3 pb-3 sm:pb-4 border-b border-gray-200",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 px-2.5 sm:px-3 py-1.5 bg-gradient-to-r from-primary-light to-primary-light rounded-lg border border-blue-200 shadow-sm",children:[e.jsx(a,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-primary flex-shrink-0"}),e.jsx("span",{className:"font-mono text-xs sm:text-sm font-bold text-blue-700 break-all",children:s.order_number})]}),e.jsxs("div",{className:"flex items-center gap-1 sm:gap-1.5 text-xs text-gray-500",children:[e.jsx(h,{className:"w-3 h-3 sm:w-3.5 sm:h-3.5 flex-shrink-0"}),e.jsx("span",{className:"whitespace-nowrap",children:s.created_at?new Date(s.created_at).toLocaleDateString("en-IN",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"â"})]})]}),e.jsx("span",{className:`inline-flex items-center justify-center px-2.5 sm:px-3 py-1 sm:py-1.5 rounded-lg text-xs font-bold uppercase tracking-wide border ${r[s.status]||"bg-gray-100 text-gray-700 border-gray-300"} self-start sm:self-auto`,children:s.status})]}),(s.customer_name||s.customer_email)&&e.jsxs("div",{className:"flex items-start gap-2 text-xs sm:text-sm",children:[e.jsx(g,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-gray-400 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[s.customer_name&&e.jsx("div",{className:"font-semibold text-gray-900 break-words",children:s.customer_name}),s.customer_email&&e.jsx("div",{className:"text-gray-600 break-all mt-0.5",children:s.customer_email})]})]}),(s.shipping_address||s.shipping)&&e.jsxs("div",{className:"flex items-start gap-2 text-xs sm:text-sm",children:[e.jsx(b,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-gray-400 mt-0.5 flex-shrink-0"}),e.jsx("div",{className:"text-gray-700 leading-relaxed break-words flex-1 min-w-0",children:s.shipping_address||s.shipping&&(s.shipping.address||s.shipping.line_1)})]}),s.items&&s.items.length>0&&e.jsxs("div",{className:"space-y-2 sm:space-y-2.5 pl-3 sm:pl-4 border-l-2 border-indigo-200",children:[e.jsx("h4",{className:"text-xs sm:text-sm font-bold text-gray-700 uppercase tracking-wide",children:"Order Items"}),s.items.map((t,i)=>e.jsxs("div",{className:"flex items-start justify-between gap-3 py-1.5 sm:py-2 border-b border-gray-100 last:border-0",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-gray-900 text-xs sm:text-sm break-words",children:t.name||t.title||t.product_name}),(t.variant_name||t.variant||t.variant_title)&&e.jsx("div",{className:"text-xs text-gray-500 mt-0.5 break-words",children:t.variant_name||t.variant||t.variant_title}),t.quantity&&e.jsxs("div",{className:"text-xs text-gray-500 mt-0.5",children:["Qty: ",t.quantity]})]}),(t.price||t.total)&&e.jsxs("div",{className:"text-xs sm:text-sm font-semibold text-gray-900 whitespace-nowrap flex-shrink-0",children:["â¹",Number(t.price||t.total).toFixed(2)]})]},i))]}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3 pt-3 sm:pt-4 border-t border-gray-200",children:[e.jsxs("div",{className:"flex items-center justify-between sm:block",children:[e.jsx("div",{className:"text-xs text-gray-500 mb-0 sm:mb-1 uppercase tracking-wide font-medium",children:"Total Amount"}),e.jsx("div",{className:"text-xl sm:text-2xl font-bold text-gray-900",children:y(s.total)})]}),e.jsx(m,{href:`/order/${s.order_number}`,className:"w-full sm:w-auto px-4 sm:px-5 py-2 sm:py-2.5 bg-gradient-to-r from-primary to-primary hover:from-primary hover:to-primary text-white font-semibold rounded-xl transition-all shadow-md hover:shadow-lg text-center text-xs sm:text-sm whitespace-nowrap",children:"View Details â"})]})]})})}export{P as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.