1import{D as E,b as _,j as e,F as i,C as c,a as o,L as g,B as S,P as $,y as F,s as M}from"./index-RxDZGo8S.js";import{B as P}from"./badge-Kwp9j7fd.js";import{S as p}from"./sparkles-DAvCEfZn.js";import{C as N}from"./circle-x-BzR8rTt0.js";import{A as u}from"./arrow-left-0370NIGe.js";import{M as b}from"./map-pin-SZp2PROJ.js";import{U as D}from"./user-Bt8OpLg1.js";import{C as L}from"./calendar-DWLwoYri.js";import{P as T}from"./phone-BqXZyssE.js";import{C as q}from"./clock-B-vpET2t.js";import{C as I}from"./circle-check-big-ubcqJ6vK.js";import{f as j}from"./format-DuJJlbci.js";import{e as f}from"./es-DhgJzuV8.js";const a={pending:{label:"Pendiente",description:"Tu pedido está siendo preparado con mucho cariño ð",icon:q,gradient:"from-amber-400 to-orange-500",iconBg:"bg-amber-100",textColor:"text-amber-700"},assigned:{label:"Asignado",description:"Un repartidor está listo para llevar tu pedido",icon:$,gradient:"from-blue-400 to-indigo-500",iconBg:"bg-blue-100",textColor:"text-blue-700"},in_transit:{label:"En Camino",description:"¡Tu pedido está en camino! ð",icon:F,gradient:"from-emerald-400 to-teal-500",iconBg:"bg-emerald-100",textColor:"text-emerald-700"},delivered:{label:"Entregado",description:"¡Tu pedido ha sido entregado! Disfrútalo ð¸",icon:I,gradient:"from-green-400 to-emerald-500",iconBg:"bg-green-100",textColor:"text-green-700"},cancelled:{label:"Cancelado",description:"Este envÃo ha sido cancelado",icon:N,gradient:"from-red-400 to-rose-500",iconBg:"bg-red-100",textColor:"text-red-700"}},m=["pending","assigned","in_transit","delivered"];function Y(){const{trackingCode:n}=E(),{data:t,isLoading:v,error:w}=_({queryKey:["public-shipment-tracking",n],queryFn:async()=>{const{data:l,error:r}=await M.from("shipments").select("*").eq("tracking_code",n).maybeSingle();if(r)throw r;return l},enabled:!!n});if(v)return e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-emerald-50 via-white to-rose-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-20 h-20 bg-emerald-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(i,{className:"h-10 w-10 text-emerald-600 animate-pulse"})}),e.jsx(p,{className:"absolute -top-2 -right-2 h-6 w-6 text-amber-400 animate-bounce"})]}),e.jsx("p",{className:"text-gray-500 font-medium",children:"Buscando tu envÃo..."})]})});if(w||!t)return e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-emerald-50 via-white to-rose-50 flex items-center justify-center p-4",children:e.jsxs(c,{className:"max-w-md w-full shadow-2xl border-0 overflow-hidden",children:[e.jsx("div",{className:"bg-gradient-to-r from-red-400 to-rose-500 h-2"}),e.jsxs(o,{className:"pt-8 pb-8 text-center",children:[e.jsx("div",{className:"w-20 h-20 bg-red-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(N,{className:"h-10 w-10 text-red-500"})}),e.jsx("h2",{className:"text-2xl font-bold text-gray-800 mb-2",children:"EnvÃo no encontrado"}),e.jsx("p",{className:"text-gray-500 mb-4",children:"No pudimos encontrar un envÃo con el código"}),e.jsx("code",{className:"bg-gray-100 px-4 py-2 rounded-lg font-mono text-lg text-gray-700 block mb-6",children:n}),e.jsx(g,{to:"/tracking",children:e.jsxs(S,{className:"bg-emerald-600 hover:bg-emerald-700",children:[e.jsx(u,{className:"h-4 w-4 mr-2"}),"Buscar otro código"]})})]})]})});const s=t.status,y=a[s].icon,d=m.indexOf(s),C=s==="cancelled";return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-emerald-50 via-white to-rose-50",children:[e.jsxs("div",{className:`bg-gradient-to-r ${a[s].gradient} text-white py-8 px-4 relative overflow-hidden`,children:[e.jsxs("div",{className:"absolute inset-0 opacity-10",children:[e.jsx("div",{className:"absolute top-4 left-4",children:e.jsx(i,{className:"h-24 w-24"})}),e.jsx("div",{className:"absolute bottom-4 right-4",children:e.jsx(i,{className:"h-32 w-32"})})]}),e.jsxs("div",{className:"max-w-lg mx-auto text-center relative z-10",children:[e.jsxs(g,{to:"/tracking",className:"inline-flex items-center text-white/80 hover:text-white mb-4 text-sm",children:[e.jsx(u,{className:"h-4 w-4 mr-1"}),"Buscar otro envÃo"]}),e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[e.jsx(i,{className:"h-8 w-8"}),e.jsx("span",{className:"text-2xl font-bold",children:"FloraFlor"})]}),e.jsx("p",{className:"text-white/80 text-sm",children:"Seguimiento de EnvÃo"})]})]}),e.jsxs("div",{className:"max-w-lg mx-auto p-4 -mt-6 space-y-4",children:[e.jsx(c,{className:"shadow-2xl border-0 overflow-hidden",children:e.jsxs("div",{className:`bg-gradient-to-r ${a[s].gradient} text-white p-5 text-center`,children:[e.jsx("p",{className:"text-sm opacity-80 mb-1",children:"Código de Seguimiento"}),e.jsx("p",{className:"text-3xl font-bold font-mono tracking-widest",children:t.tracking_code})]})}),e.jsx(c,{className:"shadow-xl border-0 overflow-hidden",children:e.jsxs(o,{className:"p-0",children:[e.jsxs("div",{className:`${a[s].iconBg} p-8 text-center`,children:[e.jsxs("div",{className:"relative inline-block",children:[e.jsx("div",{className:"w-24 h-24 bg-white rounded-full flex items-center justify-center shadow-lg",children:e.jsx(y,{className:`h-12 w-12 ${a[s].textColor}`})}),s==="delivered"&&e.jsx(p,{className:"absolute -top-2 -right-2 h-8 w-8 text-amber-400 animate-bounce"})]}),e.jsx("h2",{className:`text-3xl font-bold ${a[s].textColor} mt-4 mb-2`,children:a[s].label}),e.jsx("p",{className:`${a[s].textColor} opacity-80 text-lg`,children:a[s].description})]}),!C&&e.jsx("div",{className:"p-6 bg-white",children:e.jsx("div",{className:"relative",children:m.map((l,r)=>{const k=a[l].icon,x=r<=d,h=r===d,B=r===m.length-1;return e.jsxs("div",{className:"relative flex items-center gap-4 pb-6",children:[!B&&e.jsx("div",{className:`absolute left-6 top-14 w-0.5 h-full -ml-px ${r<d?"bg-emerald-500":"bg-gray-200"}`}),e.jsx("div",{className:` 2 relative z-10 w-12 h-12 rounded-full flex items-center justify-center transition-all border-2 3 ${x?"bg-emerald-500 border-emerald-500 text-white shadow-lg shadow-emerald-500/30":"bg-white border-gray-200 text-gray-400"} 4 ${h?"ring-4 ring-emerald-500/20 scale-110":""} 5 `,children:e.jsx(k,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:`font-semibold ${x?"text-gray-800":"text-gray-400"}`,children:a[l].label}),h&&e.jsx(P,{className:"mt-1 bg-emerald-100 text-emerald-700 border-0",children:"Estado actual"})]})]},l)})})})]})}),e.jsx(c,{className:"shadow-xl border-0",children:e.jsxs(o,{className:"p-6",children:[e.jsxs("h3",{className:"font-bold text-lg mb-4 flex items-center gap-2 text-gray-800",children:[e.jsx("div",{className:"w-8 h-8 bg-emerald-100 rounded-full flex items-center justify-center",children:e.jsx(b,{className:"h-4 w-4 text-emerald-600"})}),"Información de Entrega"]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-3 p-4 bg-gray-50 rounded-xl",children:[e.jsx(D,{className:"h-5 w-5 text-gray-400 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 uppercase tracking-wide",children:"Destinatario"}),e.jsx("p",{className:"font-semibold text-gray-800",children:t.customer_name})]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-4 bg-gray-50 rounded-xl",children:[e.jsx(b,{className:"h-5 w-5 text-gray-400 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 uppercase tracking-wide",children:"Dirección"}),e.jsx("p",{className:"font-semibold text-gray-800",children:t.destination_address})]})]}),t.delivery_date&&e.jsxs("div",{className:"flex items-start gap-3 p-4 bg-emerald-50 rounded-xl",children:[e.jsx(L,{className:"h-5 w-5 text-emerald-500 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-emerald-600 uppercase tracking-wide",children:"Fecha estimada"}),e.jsx("p",{className:"font-semibold text-emerald-700",children:j(new Date(t.delivery_date),"EEEE dd 'de' MMMM",{locale:f})})]})]}),t.customer_phone&&e.jsxs("a",{href:`tel:${t.customer_phone}`,className:"flex items-start gap-3 p-4 bg-blue-50 rounded-xl hover:bg-blue-100 transition-colors",children:[e.jsx(T,{className:"h-5 w-5 text-blue-500 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-blue-600 uppercase tracking-wide",children:"Contacto"}),e.jsx("p",{className:"font-semibold text-blue-700",children:t.customer_phone})]})]})]})]})}),e.jsxs("div",{className:"text-center py-8",children:[e.jsx("p",{className:"text-xs text-gray-400 uppercase tracking-wide mb-1",children:"Ãltima actualización"}),e.jsx("p",{className:"text-sm font-medium text-gray-600",children:j(new Date(t.updated_at),"dd MMM yyyy 'a las' HH:mm",{locale:f})}),e.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2",children:[e.jsx("div",{className:"bg-emerald-100 p-2 rounded-full",children:e.jsx(i,{className:"h-6 w-6 text-emerald-600"})}),e.jsx("span",{className:"font-bold text-emerald-600 text-lg",children:"FloraFlor"})]}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Flores que enamoran ð"})]})]})]})}export{Y 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.