import{g as o,b as a,t as n,d as _,a as g,f as x,e as p,l as y,F as b,r as w,i as l,o as r}from"./app-BJF24m-a.js";const v={class:"min-h-screen bg-gray-50"},D={class:"bg-white shadow"},k={class:"max-w-7xl mx-auto py-4 sm:py-6 px-4 sm:px-6 lg:px-8 flex justify-between items-center"},N={class:"text-lg sm:text-2xl font-bold text-gray-900 truncate"},C={class:"flex items-center gap-3 sm:gap-4 flex-shrink-0"},S=["action"],T={class:"max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8"},V={class:"bg-white shadow rounded-lg p-4 sm:p-6"},j={class:"relative"},B={class:"bg-gray-50 rounded-lg p-4"},F={class:"flex justify-between items-start mb-2"},L={class:"font-medium text-gray-900"},M={class:"text-sm text-gray-500"},$={key:0,class:"text-sm text-gray-600 mb-2"},A={key:1,class:"text-sm text-gray-700"},E={key:2,class:"text-xs text-gray-500 mt-2"},O={key:0,class:"pl-16 py-4 text-gray-500"},q={__name:"Timeline",props:{title:String,caso:Object},setup(i){const d=t=>t?new Date(t).toLocaleDateString("es-EC",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"N/A",h=t=>{if(!t)return"N/A";const s=Math.floor(t/60),e=t%60;return s>0?`${s}h ${e}m`:`${e}m`},u=t=>t?typeof t=="string"?new Date(t.replace(" ","T")):new Date(t):new Date,f=t=>{let s=t.duracion_minutas;if(!s){const e=t.fecha_ingreso||t.created_at;if(e){const c=u(e),m=(t.fecha_salida?u(t.fecha_salida):new Date)-c;m>0&&(s=Math.floor(m/6e4))}}return h(s)};return(t,s)=>(r(),o("div",v,[a("header",D,[a("div",k,[a("h1",N,"Línea de Tiempo - Caso "+n(i.caso.numero_reclamo),1),a("div",C,[_(p(y),{href:t.route("portal.casos.ver",i.caso.id),class:"text-sm sm:text-base text-blue-600 hover:underline whitespace-nowrap"},{default:g(()=>[...s[0]||(s[0]=[x("← Volver al Caso",-1)])]),_:1},8,["href"]),a("form",{method:"POST",action:t.route("portal.logout")},[...s[1]||(s[1]=[a("button",{type:"submit",class:"text-sm sm:text-base text-gray-600 hover:text-gray-900 whitespace-nowrap"},"Cerrar Sesión",-1)])],8,S)])])]),a("main",T,[a("div",V,[a("div",j,[s[3]||(s[3]=a("div",{class:"absolute left-8 top-0 bottom-0 w-0.5 bg-gray-200"},null,-1)),(r(!0),o(b,null,w(i.caso.estados_historicos,(e,c)=>(r(),o("div",{key:c,class:"relative pl-16 pb-8"},[s[2]||(s[2]=a("div",{class:"absolute left-6 w-5 h-5 rounded-full bg-green-500 border-4 border-white"},null,-1)),a("div",B,[a("div",F,[a("h3",L,n(e.estado),1),a("span",M,n(d(e.fecha_ingreso)),1)]),e.duracion_minutas||!e.fecha_salida&&(e.fecha_ingreso||e.created_at)?(r(),o("div",$," Duración: "+n(f(e)),1)):l("",!0),e.nota?(r(),o("p",A,n(e.nota),1)):l("",!0),e.fecha_salida?(r(),o("div",E," Finalizado: "+n(d(e.fecha_salida)),1)):l("",!0)])]))),128)),i.caso.estados_historicos?.length?l("",!0):(r(),o("div",O," No hay historial de estados disponible. "))])])])]))}};export{q as default};
