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

//# sourceMappingURL=UserInvitePage.d74564b6b9efef2ed932.js.map