import{b as v,j as e}from"./vendor-BKmmeuxg.js";import{C as n}from"./combobox-Byd5-E0j.js";import{I as m}from"./input-error-LaPr_4wd.js";import{L as g}from"./loading-button-BnTVAMJ7.js";import{C as y}from"./card-D9_SJYq6.js";import{L as t}from"./label-HmIcv5Yx.js";import{R as N,a as C}from"./radio-group-C0C2vfl-.js";import{D as L}from"./layout-DkwBWm5d.js";import"./button-BpNwv2aE.js";import"./index-WW_1X1qx.js";import"./utils-DxSsnXxD.js";import"./popover-B4kBsMuI.js";import"./sidebar-BYcYxQeZ.js";import"./separator-_3LZ_wAA.js";import"./sheet-DSvHVmaW.js";import"./tooltip-BsX7Z6vz.js";import"./main-_V386djS.js";import"./index-D9-QKOod.js";import"./appearance-D2z3xcjR.js";import"./dropdown-menu-DO-po5c1.js";import"./app-BytVvUs_.js";/* empty css            */import"./language-BFZ7KItL.js";import"./notification-CYMPYbAP.js";import"./scroll-area-C8HGru-R.js";import"./app-logo-CmnEIwal.js";import"./accordion-CNBvFN43.js";import"./route-B4ZMN77y.js";import"./avatar-j28afJTV.js";import"./use-lang-YfV87_zl.js";const D=o=>{const{users:p,courses:d,prices:c,translate:u}=o,{input:r,button:x}=u,{data:a,setData:l,post:h,errors:i,processing:j}=v({user_id:"",course_id:"",enrollment_type:"free"}),f=s=>{s.preventDefault(),h(route("enrollments.store"))},_=p.map(s=>({label:s.name,value:s.id})),b=d.map(s=>({label:s.title,value:s.id}));return e.jsx(y,{className:"mx-auto max-w-2xl p-6",children:e.jsxs("form",{onSubmit:f,className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx(t,{children:r.select}),e.jsx(n,{data:_,defaultValue:a.user_id,placeholder:r.select,onSelect:s=>l("user_id",s.value)}),e.jsx(m,{message:i.user_id})]}),e.jsxs("div",{children:[e.jsx(t,{children:r.select_course}),e.jsx(n,{data:b,defaultValue:a.course_id,placeholder:r.select_course_placeholder,onSelect:s=>l("course_id",s.value)}),e.jsx(m,{message:i.course_id})]}),e.jsxs("div",{children:[e.jsx(t,{children:r.enrollment_type}),e.jsx(N,{defaultValue:a.enrollment_type,className:"flex items-center space-x-4 pt-2 pb-1",onValueChange:s=>l("enrollment_type",s),children:c.map(s=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(C,{className:"cursor-pointer",id:s,value:s}),e.jsx(t,{htmlFor:s,className:"capitalize",children:s})]},s))}),e.jsx(m,{message:i.enrollment_type})]}),e.jsx("div",{className:"col-span-2 mt-6 text-right",children:e.jsx(g,{loading:j,children:x.submit})})]})})};D.layout=o=>e.jsx(L,{children:o});export{D as default};
