import{o as v,i as w,w as a,a as t,u as o,D as k,x as B,s as h,A as $,c as j,F as D,Z as M,b as _,d as e,l as y,af as T,V as N,$ as V,t as O,v as S,a0 as Y}from"./app-I4K73wff.js";import{_ as q}from"./AuthenticatedLayout-if5JcM-v.js";import{_ as C}from"./Pagination-UHCegBO1.js";import{s as E}from"./index-p2ZZJjeR.js";import{s as F}from"./index-9SbmYGxV.js";import{s as K,a as d}from"./index-r3XoyT3j.js";import{d as p}from"./dayjs.min-M03ty_iR.js";import"./es-pK0GXmxm.js";import"./index-dsvEKYml.js";import"./index--wbxBylr.js";import"./primeicons-LH9OCmKu.js";import"./_plugin-vue_export-helper-x3n3nnut.js";import"./index-i1OlaMiw.js";import"./index-hqM-OosT.js";import"./index-zzPOQKrQ.js";import"./index-Ikz2WuEn.js";import"./index-QRC5oqEG.js";import"./index-aCUeqmx3.js";import"./index-Gr1lOYEt.js";import"./index-uLcKW5Zg.js";const A={__name:"OutlineButton",props:{href:String,label:{type:String,required:!0}},setup(i){return(n,f)=>(v(),w(o(k),{href:i.href},{default:a(()=>[t(o(F),{label:i.label,severity:"help",outlined:""},null,8,["label"])]),_:1},8,["href"]))}},I={class:"min-w-full overflow-hidden mb-3 grid md:grid-cols-3 gap-4"},Z={class:"..."},G=e("label",{for:"default-search",class:"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"},"Search",-1),H={class:"relative"},R=e("div",{class:"absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none"},[e("svg",{class:"w-4 h-4 text-gray-500 dark:text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20"},[e("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"})])],-1),U={class:"flex flex-col overflow-x-auto"},z={class:"inline-block rounded-lg shadow"},J={class:"inline-block min-w-full"},L=e("div",{class:"flex flex-col items-center justify-center text-gray-500 py-5"},[e("i",{class:"pi pi-inbox text-4xl mb-3"}),e("p",null,"No hay registros disponibles")],-1),Q={class:"flex flex-col items-center border-t bg-white px-2 py-2 xs:flex-row xs:justify-between"},be={__name:"Index",props:{solicitudes:{type:Object,default:()=>({})},filters:{type:Object,default:()=>({})}},setup(i){p.locale("es");const n=i;console.log(n.solicitudes),B(()=>{f.value=n.solicitudes.data}),h([]);const f=h(),g=r=>p(r).format("dddd, D [de] MMMM [de] YYYY"),x=r=>{if(!r)return{texto:"Desconocido",color:"secondary"};const u=p(),s=p(r),l=u.diff(s,"days");u.diff(s,"hours")%24;let m="secondary";return l>=1&&l<=3?m="success":l>=4&&l<=6?m="warn":l>=7&&(m="danger"),{texto:`${l} días`,color:m}};let c=h(n.filters.search);const b=()=>{Y.get("/solicitudes-conductores",{search:c.value},{preserveState:!0,replace:!0})};return $(()=>n.solicitudes,r=>{f.value=(r==null?void 0:r.data)||[]},{deep:!0,immediate:!0}),(r,u)=>(v(),j(D,null,[t(o(M),{title:"solicitudes"}),t(q,null,{header:a(()=>[_(" Solicitudes pendientes ")]),default:a(()=>[e("div",I,[e("div",Z,[G,e("div",H,[R,y(e("input",{type:"search",onKeydown:N(b,["enter"]),"onUpdate:modelValue":u[0]||(u[0]=s=>V(c)?c.value=s:c=s),id:"default-search",class:"block w-full p-4 ps-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-white focus:ring-0 focus:border-transparent",placeholder:"Busqueda de solicitudes",required:""},null,544),[[T,o(c)]]),e("button",{type:"submit",onClick:b,class:"text-white absolute end-2.5 bottom-2.5 bg-purple-700 hover:bg-purple-900 focus:ring-4 focus:outline-none focus:ring-purple-300 font-medium rounded-lg text-sm px-4 py-2"},"Buscar")])])]),e("div",U,[e("div",z,[e("div",J,[t(o(K),{class:"mt-2",value:f.value,scrollable:"",scrollHeight:"300px",tableStyle:"max-width: 100%"},{empty:a(()=>[L]),default:a(()=>[t(o(d),{field:"identificacion",header:"Identificación"}),t(o(d),{field:"nombre",header:"Nombre"}),t(o(d),{field:"telefono",header:"Telefono"}),t(o(d),{header:"Fecha de creación"},{body:a(s=>[_(O(g(s.data.modelo)),1)]),_:1}),t(o(d),{header:"Tiempo de espera"},{body:a(s=>[t(o(E),{severity:x(s.data.created_at).color,value:x(s.data.created_at).texto},null,8,["severity","value"])]),_:1}),t(o(d),{exportable:!1,header:"Acciones",style:{"min-width":"5rem"}},{body:a(s=>[t(A,{label:"Gestionar",href:r.route("solicitudes-conductores.edit",s.data.id)},null,8,["href"])]),_:1})]),_:1},8,["value"])])])]),y(e("div",Q,[t(C,{links:i.solicitudes.links},null,8,["links"])],512),[[S,i.solicitudes.links.length>3]])]),_:1})],64))}};export{be as default};
