import{u as E,j as N,c as s,i as m,m as w,e as v,t as b,f as D}from"./main-B-KzsHRi.js";import{c as k}from"./service-DriRc7_Z.js";var A=b('<div class=freno-project-form><div class=freno-page-header><h1>New Project</h1><button class="freno-btn freno-btn-secondary">Cancel</button></div><form class=freno-form><div class=freno-form-group><label class=freno-label for=project-name>Project Name</label><input class=freno-input id=project-name type=text placeholder="My Screenplay"autofocus></div><div class=freno-form-group><label class=freno-label for=project-desc>Description</label><textarea class=freno-textarea id=project-desc placeholder="A brief description of your project..."rows=4></textarea></div><div class=freno-form-actions><button type=submit class="freno-btn freno-btn-primary">Create Project'),F=b('<div class="freno-alert freno-alert-error">');const M=()=>{const $=E(),n=N(),j=k(),[a,g]=s(""),[i,_]=s(""),[c,l]=s(""),h=async r=>{if(r.preventDefault(),!a().trim()){l("Project name is required");return}try{const e=await j.createProject(a().trim(),i().trim(),$().user.id);n(`/projects/${e.id}`)}catch(e){l(e instanceof Error?e.message:"Failed to create project")}};return(()=>{var r=A(),e=r.firstChild,x=e.firstChild,S=x.nextSibling,o=e.nextSibling,f=o.firstChild,y=f.firstChild,p=y.nextSibling,C=f.nextSibling,P=C.firstChild,d=P.nextSibling;return S.$$click=()=>n("/projects"),m(r,(()=>{var t=w(()=>!!c());return()=>t()&&(()=>{var u=F();return m(u,c),u})()})(),o),o.addEventListener("submit",h),p.$$input=t=>g(t.target.value),d.$$input=t=>_(t.target.value),v(()=>p.value=a()),v(()=>d.value=i()),r})()};D(["click","input"]);export{M as ProjectForm};
//# sourceMappingURL=ProjectForm-BQgT8bX9.js.map
