"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[7707],{40509:(V,i,t)=>{t.r(i),t.d(i,{UserInvitePage:()=>v,default:()=>y});var e=t(66111),m=t(8412),c=t(77582),u=t(72196),E=t(26418),g=t(37932),h=t(94270),f=t(13393),l=t(24799),s=t(46967),I=t(63619),S=t(2594),F=t(8944),d=t(31403),U=t(47694),a=t(27876),O=t(90336);const R=[{label:"Viewer",value:a.OrgRole.Viewer},{label:"Editor",value:a.OrgRole.Editor},{label:"Admin",value:a.OrgRole.Admin}],C={name:"",email:"",role:a.OrgRole.Editor,sendEmail:!0},x=()=>{const o=(0,a.useDispatch)(),B=async n=>{await o((0,O.MA)(n)).unwrap(),g.E1.push("/admin/users/")};return e.createElement(h.l,{defaultValues:C,onSubmit:B},({register:n,control:N,errors:r})=>e.createElement(e.Fragment,null,e.createElement(f.C,null,e.createElement(l.g,{invalid:!!r.loginOrEmail,error:r.loginOrEmail?"Email or username is required":void 0,label:"Email or username"},e.createElement(s.I,{...n("loginOrEmail",{required:!0}),placeholder:"email@example.com"})),e.createElement(l.g,{invalid:!!r.name,label:"Name"},e.createElement(s.I,{...n("name"),placeholder:"(optional)"})),e.createElement(l.g,{invalid:!!r.role,label:"Role"},e.createElement(I.g,{render:({field:{ref:A,...P}})=>e.createElement(S.S,{...P,options:R}),control:N,name:"role"})),e.createElement(l.g,{label:"Send invite email"},e.createElement(F.r,{id:"send-email-switch",...n("sendEmail")}))),e.createElement(E.Stack,null,e.createElement(d.zx,{type:"submit"},"Submit"),e.createElement(d.Qj,{href:u.u.assureBaseUrl((0,U.iE)().appSubUrl+"/admin/users"),variant:"secondary"},"Back"))))};function v(){const o=e.createElement(e.Fragment,null,"Send invitation or add existing Grafana user to the organization.",e.createElement("span",{className:"highlight-word"}," ",c.Vt.user.orgName));return e.createElement(m.T,{navId:"global-users",pageNav:{text:"Invite user"},subTitle:o},e.createElement(m.T.Contents,null,e.createElement(x,null)))}const y=v}}]);

//# sourceMappingURL=UserInvitePage.86d96c32e62c9c96eba5.js.map