import{B as v,X as U,C as f,j as s,t as u,m as t,k as n,H as C,E as i,F as b,q as V,y as a,x as k}from"./vendor-CoimUlS3.js";import{L}from"./Layout-DhxLvS0V.js";import{T as _}from"./TextInput-UGcC5hIa.js";import{S as A}from"./SelectInput-BeV75IPk.js";import{L as S}from"./LoadingButton-BqD68voa.js";import{_ as z}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./utils-CXPYudwi.js";import"./LogoutButton-BZlSuKxY.js";import"./app-W9XHfen4.js";/* empty css                                                                 */import"./ui-CI37mw-K.js";import"./Logo-DiOikIGZ.js";import"./FlashMessages-D1juQjH6.js";const B={components:{Head:U,Link:v,LoadingButton:S,SelectInput:A,TextInput:_},layout:L,props:{organizations:Array,departments:Array,countries:Array,title:String},remember:"form",data(){return{form:this.$inertia.form({first_name:"",last_name:"",title:"",organization_id:null,department_id:null,email:"",phone:"",address:"",city:"",country:"",status:1})}},methods:{store(){this.form.post(this.route("contacts.store"))}}},H={class:"max-w-full bg-white rounded-md shadow overflow-hidden"},T={class:"flex flex-wrap -mb-8 -mr-6 p-8"},E=["value"],F=["value"],I=["value"],N={class:"flex items-center justify-end px-8 py-4 bg-gray-50 border-t border-gray-100"};function j(o,l,p,D,r,g){const w=f("Head"),m=f("text-input"),d=f("select-input"),y=f("loading-button");return u(),s("div",null,[t(w,{title:o.$t(p.title)},null,8,["title"]),n("div",H,[n("form",{onSubmit:l[11]||(l[11]=C((...e)=>g.store&&g.store(...e),["prevent"]))},[n("div",T,[t(m,{modelValue:r.form.first_name,"onUpdate:modelValue":l[0]||(l[0]=e=>r.form.first_name=e),error:r.form.errors.first_name,class:"pb-8 pr-6 w-full lg:w-1/3",label:o.$t("First name")},null,8,["modelValue","error","label"]),t(m,{modelValue:r.form.last_name,"onUpdate:modelValue":l[1]||(l[1]=e=>r.form.last_name=e),error:r.form.errors.last_name,class:"pb-8 pr-6 w-full lg:w-1/3",label:o.$t("Last name")},null,8,["modelValue","error","label"]),t(m,{modelValue:r.form.title,"onUpdate:modelValue":l[2]||(l[2]=e=>r.form.title=e),error:r.form.errors.title,class:"pb-8 pr-6 w-full lg:w-1/3",label:o.$t("Title")},null,8,["modelValue","error","label"]),t(m,{modelValue:r.form.phone,"onUpdate:modelValue":l[3]||(l[3]=e=>r.form.phone=e),error:r.form.errors.phone,class:"pb-8 pr-6 w-full lg:w-1/3",label:o.$t("Phone")},null,8,["modelValue","error","label"]),t(m,{modelValue:r.form.email,"onUpdate:modelValue":l[4]||(l[4]=e=>r.form.email=e),error:r.form.errors.email,class:"pb-8 pr-6 w-full lg:w-1/3",label:o.$t("Email")},null,8,["modelValue","error","label"]),t(d,{modelValue:r.form.organization_id,"onUpdate:modelValue":l[5]||(l[5]=e=>r.form.organization_id=e),error:r.form.errors.organization_id,class:"pb-8 pr-6 w-full lg:w-1/3",label:o.$t("Organization")},{default:i(()=>[l[12]||(l[12]=n("option",{value:null},null,-1)),(u(!0),s(b,null,V(p.organizations,e=>(u(),s("option",{key:e.id,value:e.id},a(e.name),9,E))),128))]),_:1},8,["modelValue","error","label"]),t(m,{modelValue:r.form.address,"onUpdate:modelValue":l[6]||(l[6]=e=>r.form.address=e),error:r.form.errors.address,class:"pb-8 pr-6 w-full lg:w-1/3",label:o.$t("Address")},null,8,["modelValue","error","label"]),t(m,{modelValue:r.form.city,"onUpdate:modelValue":l[7]||(l[7]=e=>r.form.city=e),error:r.form.errors.city,class:"pb-8 pr-6 w-full lg:w-1/3",label:o.$t("City")},null,8,["modelValue","error","label"]),t(d,{modelValue:r.form.country,"onUpdate:modelValue":l[8]||(l[8]=e=>r.form.country=e),error:r.form.errors.country,class:"pb-8 pr-6 w-full lg:w-1/3",label:o.$t("Country")},{default:i(()=>[l[13]||(l[13]=n("option",{value:null},null,-1)),(u(!0),s(b,null,V(p.countries,e=>(u(),s("option",{key:e.id,value:e.code},a(e.name),9,F))),128))]),_:1},8,["modelValue","error","label"]),t(d,{modelValue:r.form.department_id,"onUpdate:modelValue":l[9]||(l[9]=e=>r.form.department_id=e),error:r.form.errors.department_id,class:"pr-6 pb-8 w-full lg:w-1/3",label:o.$t("Department")},{default:i(()=>[l[14]||(l[14]=n("option",{value:null},null,-1)),(u(!0),s(b,null,V(p.departments,e=>(u(),s("option",{key:e.id,value:e.id},a(e.name),9,I))),128))]),_:1},8,["modelValue","error","label"]),t(d,{modelValue:r.form.status,"onUpdate:modelValue":l[10]||(l[10]=e=>r.form.status=e),error:r.form.errors.status,class:"pb-8 pr-6 w-full lg:w-1/3",label:o.$t("Status")},{default:i(()=>[...l[15]||(l[15]=[n("option",{value:"1"},"Active",-1),n("option",{value:"0"},"InActive",-1)])]),_:1},8,["modelValue","error","label"])]),n("div",N,[t(y,{loading:r.form.processing,class:"btn-indigo",type:"submit"},{default:i(()=>[k(a(o.$t("Create"))+" "+a(o.$t("Contact")),1)]),_:1},8,["loading"])])],32)])])}const Z=z(B,[["render",j]]);export{Z as default};
