import{z as p,G as c,ai as l,b as d,I as x,J as f,ab as g,bw as j,Z as y,M as C,ag as h,j as e,T as a}from"./main-D6SjkSWq.js";import{B as b,a as i}from"./breadcrumb-Pvuej4Ko.js";import{C as R}from"./crupdate-resource-layout-IY4TseVy.js";import{Component as v}from"./crupdate-role-settings-panel-BIHm_Dcn.js";import"./useEffectEvent-Bb2YhEEQ.js";import"./ChevronRight-BN6UJOeQ.js";import"./MoreHoriz-Bms6kOtf.js";import"./datatable-page-with-header-layout-BuTOEIJh.js";import"./dashboard-layout-context-C1ErlVWg.js";import"./permission-selector-WCxzDfc6.js";import"./accordion-ClGroL7V.js";import"./switch-CvotT3pn.js";import"./list--2y4kqxI.js";import"./uc-first-pSl3nM3z.js";import"./section-helper-C-cn6F19.js";import"./select-BkmhiFLy.js";import"./combobox-end-adornment-Btuckat_.js";import"./chevron-down-BqXy_cI5.js";function S(t){const{trans:o}=p();return c({mutationFn:s=>d.post("roles",s).then(r=>r.data),onSuccess:()=>{x(o(f("Created new role"))),g.invalidateQueries({queryKey:j.roles.invalidateKey})},onError:s=>l(s,t)})}function V(){const[t]=y(),o=t.get("type")??"users",s=C({defaultValues:{type:o}}),r=S(s),n=h();return e.jsx(R,{form:s,onSubmit:m=>{r.mutate(m,{onSuccess:u=>{n(`/admin/roles/${u.role.id}/edit`)}})},title:e.jsxs(b,{size:"xl",children:[e.jsx(i,{to:"/admin/roles",children:e.jsx(a,{message:"Roles"})}),e.jsx(i,{children:e.jsx(a,{message:"New"})})]}),isLoading:r.isPending,children:e.jsx(v,{})})}export{V as Component};
