import{d as v,u as _,o as a,a as i,b as n,e as s,h,w as u,f as e,s as w,v as l,q as m,x as b,t as d,j as x,F as c,n as C,y as k,l as T,i as V}from"./app-D9-EssCM.js";import{_ as N}from"./AppLayout.vue_vue_type_script_setup_true_lang-C-UlPCqH.js";import"./index-CcjNLu6f.js";import"./index-CMWG4mbA.js";import"./useForwardExpose-MNmriUeS.js";import"./VisuallyHidden-DG35s1YI.js";import"./RovingFocusGroup-Diffidi3.js";import"./useArrowNavigation-C6Y-ieo6.js";import"./x-DwmBYYXD.js";import"./_plugin-vue_export-helper-DmjF0He4.js";const j={class:"p-4"},D={class:"bg-white rounded-lg border p-6"},M={class:"space-y-4"},U={key:0,class:"text-red-500 text-sm mt-1"},B={key:0,class:"text-red-500 text-sm mt-1"},F={class:"bg-white rounded-lg border p-6"},S={key:0,class:"text-sm text-gray-500"},q={key:1,class:"space-y-2 max-h-64 overflow-y-auto"},A=["value"],z={class:"inline-flex h-8 w-8 items-center justify-center rounded-full bg-primary/10 text-sm font-medium text-primary"},E={class:"text-sm font-medium text-gray-900"},L={class:"flex items-center justify-end gap-3"},$=["disabled"],Y=v({__name:"Create",props:{users:{}},setup(f){const p=f,r=_({name:"",description:"",user_ids:[]}),y=()=>{r.post("/administration/teams")};return(G,t)=>(a(),i(c,null,[n(s(h),{title:"Create Team"}),n(N,{breadcrumbs:[{title:"Administration",href:"/administration"},{title:"Teams",href:"/administration/teams"},{title:"Create",href:"#"}]},{default:u(()=>[e("div",j,[t[9]||(t[9]=e("div",{class:"flex items-center justify-between gap-3 mb-6"},[e("h1",{class:"text-2xl font-bold text-gray-900"},"Create Team")],-1)),e("form",{onSubmit:w(y,["prevent"]),class:"max-w-2xl space-y-6"},[e("div",D,[t[5]||(t[5]=e("h2",{class:"text-lg font-semibold text-gray-900 mb-4"},"Team Details",-1)),e("div",M,[e("div",null,[t[3]||(t[3]=e("label",{class:"block text-sm font-medium text-gray-700 mb-1"},"Name *",-1)),l(e("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>s(r).name=o),type:"text",class:m(["w-full rounded border px-3 py-2",{"border-red-500":s(r).errors.name}]),required:""},null,2),[[b,s(r).name]]),s(r).errors.name?(a(),i("div",U,d(s(r).errors.name),1)):x("",!0)]),e("div",null,[t[4]||(t[4]=e("label",{class:"block text-sm font-medium text-gray-700 mb-1"},"Description",-1)),l(e("textarea",{"onUpdate:modelValue":t[1]||(t[1]=o=>s(r).description=o),rows:"3",class:m(["w-full rounded border px-3 py-2",{"border-red-500":s(r).errors.description}])},null,2),[[b,s(r).description]]),s(r).errors.description?(a(),i("div",B,d(s(r).errors.description),1)):x("",!0)])])]),e("div",F,[t[6]||(t[6]=e("h2",{class:"text-lg font-semibold text-gray-900 mb-4"},"Team Members",-1)),t[7]||(t[7]=e("p",{class:"text-sm text-gray-500 mb-4"},"Select users to add to this team.",-1)),p.users.length===0?(a(),i("div",S,"No users available.")):(a(),i("div",q,[(a(!0),i(c,null,C(p.users,o=>(a(),i("label",{key:o.id,class:m(["flex items-center gap-3 rounded-lg border px-4 py-3 cursor-pointer hover:bg-gray-50 transition-colors",{"border-blue-300 bg-blue-50":s(r).user_ids.includes(o.id)}])},[l(e("input",{type:"checkbox",value:o.id,"onUpdate:modelValue":t[2]||(t[2]=g=>s(r).user_ids=g),class:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"},null,8,A),[[k,s(r).user_ids]]),e("span",z,d(o.name.charAt(0).toUpperCase()),1),e("span",E,d(o.name),1)],2))),128))]))]),e("div",L,[n(s(T),{href:"/administration/teams",class:"rounded bg-gray-500 px-4 py-2 text-white hover:bg-gray-600"},{default:u(()=>[...t[8]||(t[8]=[V(" Cancel ",-1)])]),_:1}),e("button",{type:"submit",disabled:s(r).processing,class:"rounded bg-primary px-4 py-2 text-sm font-medium text-white hover:bg-primary/90 disabled:opacity-50"},d(s(r).processing?"Creating...":"Create Team"),9,$)])],32)])]),_:1})],64))}});export{Y as default};
