1import{j as e}from"./vendor-ui-CHrmpeEa.js";import{d as O,a as N,b as j,u as H,t as u,G as w,m as D,B as p,F as C}from"./index-DDXAxf3_.js";import{u as S}from"./useFormatters-WSBqNs92.js";import{C as r,d as i}from"./card-ZrSkWK4s.js";import{B as F}from"./badge-DfKVZkmM.js";import{C as I}from"./circle-x-z3Lnnvvv.js";import{C as L}from"./circle-check-K_2IP-3Q.js";import{P}from"./package-CDHddC8X.js";import{C as g}from"./clock-9Q6P_5BP.js";import{F as k}from"./file-text-Dq50C19M.js";import{D as B}from"./download-Be5AdEmV.js";import"./vendor-react-COd4auuD.js";import"./vendor-trpc-BBLHDmMG.js";import"./vendor-charts-DLOf8RNh.js";/** 2 * @license lucide-react v0.453.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const A=O("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]),x={en:{title:"Order History",subtitle:"View your orders and invoices",back:"Back to Dashboard",noOrders:"No orders yet",noOrdersDesc:"Your orders will appear here after your first purchase.",browseServices:"Browse Services",order:"Order",date:"Date",status:"Status",total:"Total",items:"Items",invoice:"Invoice",downloadInvoice:"Download Invoice",viewDetails:"View Details",statusLabels:{pending:"Pending",paid:"Paid",processing:"Processing",completed:"Completed",cancelled:"Cancelled"},invoiceSection:"Invoices",invoiceNumber:"Invoice #",issueDate:"Issue Date",loading:"Loading..."},pt:{title:"Histórico de Pedidos",subtitle:"Veja seus pedidos e notas fiscais",back:"Voltar ao Painel",noOrders:"Nenhum pedido ainda",noOrdersDesc:"Seus pedidos aparecerão aqui após sua primeira compra.",browseServices:"Ver Serviços",order:"Pedido",date:"Data",status:"Status",total:"Total",items:"Itens",invoice:"Nota Fiscal",downloadInvoice:"Baixar Nota Fiscal",viewDetails:"Ver Detalhes",statusLabels:{pending:"Pendente",paid:"Pago",processing:"Processando",completed:"ConcluÃdo",cancelled:"Cancelado"},invoiceSection:"Notas Fiscais",invoiceNumber:"NF #",issueDate:"Data de Emissão",loading:"Carregando..."},fr:{title:"Historique des Commandes",subtitle:"Consultez vos commandes et factures",back:"Retour au Tableau de Bord",noOrders:"Aucune commande",noOrdersDesc:"Vos commandes apparaîtront ici après votre premier achat.",browseServices:"Parcourir les Services",order:"Commande",date:"Date",status:"Statut",total:"Total",items:"Articles",invoice:"Facture",downloadInvoice:"Télécharger la Facture",viewDetails:"Voir les Détails",statusLabels:{pending:"En attente",paid:"Payé",processing:"En cours",completed:"Terminé",cancelled:"Annulé"},invoiceSection:"Factures",invoiceNumber:"Facture #",issueDate:"Date d'Ãmission",loading:"Chargement..."},de:{title:"Bestellverlauf",subtitle:"Sehen Sie Ihre Bestellungen und Rechnungen",back:"Zurück zum Dashboard",noOrders:"Noch keine Bestellungen",noOrdersDesc:"Ihre Bestellungen erscheinen hier nach Ihrem ersten Kauf.",browseServices:"Dienste Durchsuchen",order:"Bestellung",date:"Datum",status:"Status",total:"Gesamt",items:"Artikel",invoice:"Rechnung",downloadInvoice:"Rechnung Herunterladen",viewDetails:"Details Anzeigen",statusLabels:{pending:"Ausstehend",paid:"Bezahlt",processing:"In Bearbeitung",completed:"Abgeschlossen",cancelled:"Storniert"},invoiceSection:"Rechnungen",invoiceNumber:"Rechnung #",issueDate:"Ausstellungsdatum",loading:"Laden..."},es:{title:"Historial de Pedidos",subtitle:"Consulta tus pedidos y facturas",back:"Volver al Panel",noOrders:"Sin pedidos aún",noOrdersDesc:"Tus pedidos aparecerán aquà después de tu primera compra.",browseServices:"Ver Servicios",order:"Pedido",date:"Fecha",status:"Estado",total:"Total",items:"ArtÃculos",invoice:"Factura",downloadInvoice:"Descargar Factura",viewDetails:"Ver Detalles",statusLabels:{pending:"Pendiente",paid:"Pagado",processing:"Procesando",completed:"Completado",cancelled:"Cancelado"},invoiceSection:"Facturas",invoiceNumber:"Factura #",issueDate:"Fecha de Emisión",loading:"Cargando..."}},V={pending:"bg-amber-50 text-amber-700",paid:"bg-emerald-50 text-emerald-700",processing:"bg-[#003b60]/5 text-[#003b60]",completed:"bg-emerald-50 text-emerald-700",cancelled:"bg-red-50 text-red-700"},T={pending:g,paid:A,processing:P,completed:L,cancelled:I};function W(){const{user:a,loading:h}=N(),{currentLanguage:b}=j(),{formatDate:c,formatCurrency:o}=S(),t=x[b]||x.en,[,n]=H(),d=u.orders.list.useQuery(void 0,{enabled:!!a}),y=u.invoices.list.useQuery(void 0,{enabled:!!a});if(h)return e.jsx("div",{"data-loc":"client/src/pages/OrderHistory.tsx:148",className:"min-h-screen flex items-center justify-center bg-[#f8fafc]",children:e.jsx("div",{"data-loc":"client/src/pages/OrderHistory.tsx:148",className:"animate-pulse text-gray-400",children:t.loading})});if(!a)return n("/login"),null;const l=d.data||[],m=y.data||[];return e.jsxs("div",{"data-loc":"client/src/pages/OrderHistory.tsx:160",className:"min-h-screen bg-[#f8fafc]",children:[e.jsx(w,{"data-loc":"client/src/pages/OrderHistory.tsx:161",bgClass:"bg-[#003b60]",textClass:"text-white",invertLogo:!0,backHref:"/dashboard",subtitle:t.title,hideLang:!0}),e.jsxs("div",{"data-loc":"client/src/pages/OrderHistory.tsx:170",className:"max-w-5xl mx-auto px-6 py-8",children:[d.isLoading?e.jsx("div",{"data-loc":"client/src/pages/OrderHistory.tsx:173",className:"text-center py-12",children:e.jsx("div",{"data-loc":"client/src/pages/OrderHistory.tsx:173",className:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#003b60] mx-auto"})}):l.length===0?e.jsx(r,{"data-loc":"client/src/pages/OrderHistory.tsx:175",className:"text-center py-16",children:e.jsxs(i,{"data-loc":"client/src/pages/OrderHistory.tsx:176",children:[e.jsx(D,{"data-loc":"client/src/pages/OrderHistory.tsx:177",className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),e.jsx("h3",{"data-loc":"client/src/pages/OrderHistory.tsx:178",className:"text-lg font-medium text-[#003b60] mb-2",children:t.noOrders}),e.jsx("p",{"data-loc":"client/src/pages/OrderHistory.tsx:179",className:"text-gray-500 mb-6",children:t.noOrdersDesc}),e.jsx(p,{"data-loc":"client/src/pages/OrderHistory.tsx:180",onClick:()=>
6n("/bhave"),className:"bg-[#003b60] hover:bg-[#004d7a] text-white font-light",children:t.browseServices})]})}):e.jsx("div",{"data-loc":"client/src/pages/OrderHistory.tsx:186",className:"space-y-4 mb-8",children:l.map(s=>{const v=T[s.status||"pending"]||g,f=t.statusLabels[s.status]||s.status;return e.jsx(r,{"data-loc":"client/src/pages/OrderHistory.tsx:191",className:"hover:shadow-md transition-shadow",children:e.jsx(i,{"data-loc":"client/src/pages/OrderHistory.tsx:192",className:"pt-6",children:e.jsxs("div",{"data-loc":"client/src/pages/OrderHistory.tsx:193",className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[e.jsxs("div",{"data-loc":"client/src/pages/OrderHistory.tsx:194",className:"flex items-start gap-4",children:[e.jsx("div",{"data-loc":"client/src/pages/OrderHistory.tsx:195",className:"w-10 h-10 bg-[#003b60]/5 rounded-lg flex items-center justify-center flex-shrink-0",children:e.jsx(v,{"data-loc":"client/src/pages/OrderHistory.tsx:196",className:"w-5 h-5 text-[#003b60]"})}),e.jsxs("div",{"data-loc":"client/src/pages/OrderHistory.tsx:198",children:[e.jsxs("h3",{"data-loc":"client/src/pages/OrderHistory.tsx:199",className:"font-medium text-[#003b60]",children:[t.order," #",s.orderNumber||s.id]}),e.jsxs("p",{"data-loc":"client/src/pages/OrderHistory.tsx:200",className:"text-sm text-gray-500",children:[t.date,": ",c(s.createdAt)]})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/OrderHistory.tsx:203",className:"flex items-center gap-4",children:[e.jsx(F,{"data-loc":"client/src/pages/OrderHistory.tsx:204",className:V[s.status||"pending"],children:f}),e.jsx("span",{"data-loc":"client/src/pages/OrderHistory.tsx:205",className:"font-medium text-[#003b60] text-lg",children:o(s.total,s.currency||void 0)})]})]})})},s.id)})}),m.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("h2",{"data-loc":"client/src/pages/OrderHistory.tsx:218",className:"text-base font-medium text-[#003b60] mb-4 flex items-center gap-2",children:[e.jsx(k,{"data-loc":"client/src/pages/OrderHistory.tsx:219",className:"w-5 h-5 text-[#003b60]"}),t.invoiceSection]}),e.jsx("div",{"data-loc":"client/src/pages/OrderHistory.tsx:222",className:"space-y-3",children:m.map(s=>e.jsx(r,{"data-loc":"client/src/pages/OrderHistory.tsx:224",className:"hover:shadow-md transition-shadow",children:e.jsx(i,{"data-loc":"client/src/pages/OrderHistory.tsx:225",className:"pt-4 pb-4",children:e.jsxs("div",{"data-loc":"client/src/pages/OrderHistory.tsx:226",className:"flex flex-col md:flex-row md:items-center md:justify-between gap-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/OrderHistory.tsx:227",children:[e.jsxs("h4",{"data-loc":"client/src/pages/OrderHistory.tsx:228",className:"font-medium text-[#003b60]",children:[t.invoiceNumber,s.invoiceNumber||s.id]}),e.jsxs("p",{"data-loc":"client/src/pages/OrderHistory.tsx:229",className:"text-sm text-gray-500",children:[t.issueDate,": ",s.issueDate?c(s.issueDate):"â"]})]}),e.jsxs("div",{"data-loc":"client/src/pages/OrderHistory.tsx:231",className:"flex items-center gap-3",children:[e.jsx("span",{"data-loc":"client/src/pages/OrderHistory.tsx:232",className:"font-medium text-[#003b60]",children:o(s.total)}),s.pdfUrl&&e.jsx("a",{"data-loc":"client/src/pages/OrderHistory.tsx:234",href:s.pdfUrl,target:"_blank",rel:"noopener noreferrer",children:e.jsxs(p,{"data-loc":"client/src/pages/OrderHistory.tsx:235",variant:"outline",size:"sm",className:"gap-1",children:[e.jsx(B,{"data-loc":"client/src/pages/OrderHistory.tsx:236",className:"w-4 h-4"}),t.downloadInvoice]})})]})]})})},s.id))})]})]}),e.jsx(C,{"data-loc":"client/src/pages/OrderHistory.tsx:250"})]})}export{W 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.