import{u as f,c as b,a as m,b as o,j as p,h as i,e as t,v as d,d as l,k as g,x as c,l as x,f as v,o as w}from"./app-BJF24m-a.js";import{A as y}from"./AppLayout-CigKsnGV.js";import{_ as a}from"./InputError-96UgAvVt.js";import"./useChatToggle-0F_jMJSF.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const k={class:"py-12"},_={class:"max-w-7xl mx-auto sm:px-6 lg:px-8"},C={class:"bg-white overflow-hidden shadow-xl sm:rounded-lg"},U={class:"p-6 bg-white border-b border-gray-200"},V={class:"mb-4"},h={class:"mb-4"},j={class:"mb-4"},q={class:"mb-6 flex flex-items-center"},N={class:"mb-4"},A={class:"mb-6"},M={class:"flex items-center justify-end gap-x-4"},B=["disabled"],L={__name:"Create",setup(E){const e=f({name:"",email:"",password:"",password_confirmation:"",rol:"ejecutivo",activo:!0}),n=()=>{e.post(route("usuarios.store"))};return(u,s)=>(w(),b(y,{title:"Crear Usuario"},{header:m(()=>[...s[6]||(s[6]=[o("h2",{class:"font-semibold text-xl text-slate-800 leading-tight"}," Crear Nuevo Usuario ",-1)])]),default:m(()=>[o("div",k,[o("div",_,[o("div",C,[o("div",U,[o("form",{onSubmit:p(n,["prevent"]),class:"max-w-2xl mx-auto"},[o("div",V,[s[7]||(s[7]=o("label",{for:"name",class:"block text-sm font-medium text-gray-700"},"Nombre Completo",-1)),i(o("input",{type:"text",id:"name","onUpdate:modelValue":s[0]||(s[0]=r=>t(e).name=r),required:"",class:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"},null,512),[[d,t(e).name]]),l(a,{message:t(e).errors.name,class:"mt-2"},null,8,["message"])]),o("div",h,[s[8]||(s[8]=o("label",{for:"email",class:"block text-sm font-medium text-gray-700"},"Correo Electrónico",-1)),i(o("input",{type:"email",id:"email","onUpdate:modelValue":s[1]||(s[1]=r=>t(e).email=r),required:"",class:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"},null,512),[[d,t(e).email]]),l(a,{message:t(e).errors.email,class:"mt-2"},null,8,["message"])]),o("div",j,[s[10]||(s[10]=o("label",{for:"rol",class:"block text-sm font-medium text-gray-700"},"Rol del Usuario",-1)),i(o("select",{id:"rol","onUpdate:modelValue":s[2]||(s[2]=r=>t(e).rol=r),required:"",class:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"},[...s[9]||(s[9]=[o("option",{value:"admin"},"Administrador",-1),o("option",{value:"ejecutivo"},"Ejecutivo",-1)])],512),[[g,t(e).rol]]),l(a,{message:t(e).errors.rol,class:"mt-2"},null,8,["message"])]),o("div",q,[i(o("input",{type:"checkbox",id:"activo","onUpdate:modelValue":s[3]||(s[3]=r=>t(e).activo=r),class:"h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"},null,512),[[c,t(e).activo]]),s[11]||(s[11]=o("label",{for:"activo",class:"ml-2 block text-sm text-gray-900"},"Usuario Activo",-1)),l(a,{message:t(e).errors.activo,class:"mt-2"},null,8,["message"])]),o("div",N,[s[12]||(s[12]=o("label",{for:"password",class:"block text-sm font-medium text-gray-700"},"Contraseña",-1)),i(o("input",{type:"password",id:"password","onUpdate:modelValue":s[4]||(s[4]=r=>t(e).password=r),required:"",class:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"},null,512),[[d,t(e).password]]),l(a,{message:t(e).errors.password,class:"mt-2"},null,8,["message"])]),o("div",A,[s[13]||(s[13]=o("label",{for:"password_confirmation",class:"block text-sm font-medium text-gray-700"},"Confirmar Contraseña",-1)),i(o("input",{type:"password",id:"password_confirmation","onUpdate:modelValue":s[5]||(s[5]=r=>t(e).password_confirmation=r),required:"",class:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"},null,512),[[d,t(e).password_confirmation]])]),o("div",M,[l(t(x),{href:u.route("usuarios.index"),class:"text-sm font-semibold leading-6 text-gray-900"},{default:m(()=>[...s[14]||(s[14]=[v("Cancelar",-1)])]),_:1},8,["href"]),o("button",{type:"submit",disabled:t(e).processing,class:"rounded-md bg-blue-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-blue-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-600 disabled:opacity-50"}," Guardar Usuario ",8,B)])],32)])])])])]),_:1}))}};export{L as default};
