????
Current Path : C:/inetpub/vhost/dbadm.gdtsolutions.vn/web/js/ |
Current File : C:/inetpub/vhost/dbadm.gdtsolutions.vn/web/js/plugin-user-profile-a6a4534fc1d9879f9141.js |
/*! For license information please see ../license.txt */ "use strict";(self.webpackChunk_cloudbeaver_product_default=self.webpackChunk_cloudbeaver_product_default||[]).push([[89538],{47448:(e,t,s)=>{s.r(t),s.d(t,{LocaleService:()=>n});var r=s(1118),i=s(82103),a=s(5576),o=s(34227);let n=class LocaleService extends i.j{constructor(e){super(),this.localizationService=e}register(){this.localizationService.addProvider(this.provider.bind(this))}load(){}async provider(e){switch(e){case"ru":return(await Promise.all([s.e(92436),s.e(42003)]).then(s.bind(s,67772))).default;case"it":return(await Promise.all([s.e(32756),s.e(30098)]).then(s.bind(s,63196))).default;case"zh":return(await Promise.all([s.e(52041),s.e(7717)]).then(s.bind(s,82615))).default;case"fr":return(await Promise.all([s.e(29671),s.e(74860)]).then(s.bind(s,71293))).default;default:return(await Promise.all([s.e(41114),s.e(52479)]).then(s.bind(s,88082))).default}}};n=(0,r.Cg)([(0,a._)(),(0,r.Sn)("design:paramtypes",[o.LocalizationService])],n)},88030:(e,t,s)=>{s.r(t),s.d(t,{PluginBootstrap:()=>c});var r=s(1118),i=s(50420),a=s(82103),o=s(5576),n=s(11677);const l=(0,i.j)((()=>Promise.all([s.e(11502),s.e(7542),s.e(97493),s.e(67557),s.e(70639),s.e(89538),s.e(62570),s.e(95860),s.e(64384)]).then(s.bind(s,72922)).then((e=>e.UserMenu))));let c=class PluginBootstrap extends a.j{constructor(e){super(),this.topNavService=e}register(){this.topNavService.placeholder.add(l,4)}};c=(0,r.Cg)([(0,o._)(),(0,r.Sn)("design:paramtypes",[n.TopNavService])],c)},63747:(e,t,s)=>{s.d(t,{C:()=>r});const r=(0,s(85240).E)("user-menu","User Menu")},72922:(e,t,s)=>{s.r(t),s.d(t,{UserMenu:()=>U});var r=s(41773),i=s(7838),a=s(90781),o=s(31946),n=s(64928),l=s(69519),c=s(7167),d=s(84237),u=s(90398),h=s(18699),p=s(23439),m=s(12483),f=s(17675),P=s(75693),_=s(39755);const v={user:"user___WiagI",iconOrImage:"iconOrImage___o42ro",userName:"userName___tkai3"};var g=s(97706);const S=(0,i.PA)((function UserInfo({info:e}){const t=(0,f.W)(),s=(0,h.h)(g.UserProfileOptionsPanelService),i=(0,n.d)(v);return(0,r.jsxs)(P.D,{as:"div",className:(0,c.s)(i,{user:!0}),title:t("plugin_user_profile_menu"),onClick:()=>s.open(),children:[(0,r.jsx)(_.O,{className:(0,c.s)(i,{iconOrImage:!0}),icon:"/icons/plugin_user_profile_m.svg"}),(0,r.jsx)("div",{className:(0,c.s)(i,{userName:!0}),children:e.displayName||e.userId})]})}));var x=s(63747);const I={contextMenu:"contextMenu___KaJ_c",icon:"icon___oT4Iq"},U=(0,i.PA)((function UserMenu(){const e=(0,n.d)(I),t=(0,h.h)(a.AuthInfoService),s=(0,m.b)({menu:x.C}),i=t.userInfo;return(0,u.Z)(s.context,((e,t)=>{e.set(o.N,i,t)})),i?(0,r.jsxs)(l.a,{suspense:!0,inline:!0,children:[(0,r.jsx)(S,{info:i}),(0,r.jsx)(p.t,{className:(0,c.s)(e,{contextMenu:!0}),menu:s,modal:!0,children:(0,r.jsx)(d.I,{className:(0,c.s)(e,{icon:!0}),name:"angle",viewBox:"0 0 15 8"})})]}):null}))},1510:(e,t,s)=>{s.d(t,{B:()=>r});const r=(0,s(50420).j)((()=>Promise.all([s.e(11502),s.e(7542),s.e(97493),s.e(67557),s.e(70639),s.e(89538),s.e(62570),s.e(95860),s.e(64384)]).then(s.bind(s,72922)).then((e=>e.UserMenu))))},7335:(e,t,s)=>{s.r(t),s.d(t,{AuthenticationPanel:()=>g});var r=s(41773),i=s(7838),a=s(15280),o=s(71120),n=s(76652),l=s(26909),c=s(60300),d=s(17675),u=s(10583),h=s(44832),p=s(84972),m=s(16101),f=s(13821),P=s(39865),_=s(42891);const v=(0,i.PA)((function ChangePassword({state:e,disabled:t}){const s=(0,d.W)(),i=(0,u.G)(),a=(0,h.S)((t=>(0,_.V)(t,e.password,null)?null:s("authentication_user_passwords_not_match")));return(0,r.jsx)(p.l,{children:(0,r.jsxs)(m.Y,{form:!0,gap:!0,children:[(0,r.jsx)(f.U,{children:s("plugin_user_profile_authentication_change_password")}),(0,r.jsx)(P.F,{type:"password",name:"oldPassword",state:e,disabled:t,mapValue:e=>e?.trim()??"",small:!0,required:!0,children:s("plugin_user_profile_authentication_change_password_current_password")}),(0,r.jsx)(P.F,{ref:i,type:"password",name:"password",autoComplete:"new-password",state:e,disabled:t,mapValue:e=>e?.trim()??"",small:!0,required:!0,children:s("plugin_user_profile_authentication_change_password_new_password")}),(0,r.jsx)(P.F,{ref:a,type:"password",name:"repeatedPassword",state:e,disabled:t,mapValue:e=>e?.trim()??"",small:!0,required:!0,children:s("plugin_user_profile_authentication_change_password_repeat_password")})]})})})),g=(0,i.PA)((function AuthenticationPanel({tabId:e}){const t=(0,l.V)(e),s=(0,c.i)();(0,a.X)(AuthenticationPanel,s,t.selected);const i=s.isLoading();return(0,r.jsx)(o.U,{wrap:!0,overflow:!0,gap:!0,children:(0,r.jsx)(n.m,{medium:!0,gap:!0,children:(0,r.jsx)(v,{state:s.state,disabled:i})})})}))},64577:(e,t,s)=>{s.r(t),s.d(t,{UserProfileFormAuthenticationPartBootstrap:()=>S});var r=s(1118),i=s(50420),a=s(82103),o=s(5576),n=s(29487),l=s(11130),c=s(92870),d=s(44745),u=s(35282),h=s(15414),p=s(33845),m=s(42891),f=s(51449),P=s(3065);const _=P.Ik({oldPassword:P.Yj(),password:P.Yj().trim(),repeatedPassword:P.Yj()}).required();class UserProfileFormAuthenticationPart extends h.o{constructor(e,t,s){super(e,{oldPassword:"",password:"",repeatedPassword:""}),this.userInfoResource=t,this.passwordPolicyService=s,this.baseIncludes=["includeMetaParameters"]}format(e,t){const s=_.safeParse(this.state);this.state=s.success?s.data:this.initialState}isOutdated(){return this.userInfoResource.isOutdated(void 0,this.baseIncludes)}isLoaded(){return this.loaded&&this.userInfoResource.isLoaded(void 0,this.baseIncludes)}isChanged(){return!!this.loaded&&(!(0,m.V)(this.state.oldPassword,this.initialState.oldPassword,null)||!(0,m.V)(this.state.password,this.initialState.password,null)||!(0,m.V)(this.state.repeatedPassword,this.initialState.repeatedPassword,null))}validate(e,t){const s=_.safeParse(this.state),r=t.getContext(p.V);if(!s.success)return void r.error((0,f.yu)(s.error,{prefix:null}).toString());const i=this.passwordPolicyService.validatePassword(this.state.password);i.isValid||r.error(i.errorMessage)}async saveChanges(){await this.userInfoResource.updateLocalPassword(this.state.oldPassword,this.state.password)}async loader(){this.setInitialState({oldPassword:"",password:"",repeatedPassword:""})}}const v=(0,d.M)("User Profile Form Info Part");const g=(0,i.j)((()=>Promise.all([s.e(11502),s.e(7542),s.e(97493),s.e(67557),s.e(89538),s.e(62570),s.e(95860),s.e(54812)]).then(s.bind(s,7335)).then((e=>e.AuthenticationPanel))));let S=class UserProfileFormAuthenticationPartBootstrap extends a.j{constructor(e){super(),this.userProfileFormService=e}register(){this.userProfileFormService.parts.add({key:"authentication",name:"ui_authentication",order:2,panel:()=>g,stateGetter:e=>()=>function getUserProfileFormAuthenticationPart(e){return e.getPart(v,(t=>{const s=t.get(u.j),r=s.getServiceByClass(l.UserInfoResource),i=s.getServiceByClass(c.PasswordPolicyService);return new UserProfileFormAuthenticationPart(e,r,i)}))}(e.formState)})}};S=(0,r.Cg)([(0,o._)(),(0,r.Sn)("design:paramtypes",[n.UserProfileFormService])],S)},11585:(e,t,s)=>{s.r(t),s.d(t,{UserProfileFormAuthenticationPartService:()=>o});var r=s(1118),i=s(46210),a=s(5576);let o=class UserProfileFormAuthenticationPartService{constructor(){this.placeholderContainer=new i.B}};o=(0,r.Cg)([(0,a._)(),(0,r.Sn)("design:paramtypes",[])],o)},50840:(e,t,s)=>{s.r(t),s.d(t,{UserProfileFormInfo:()=>N});var r=s(41773),i=s(7838),a=s(17675),o=s(15280),n=s(71120),l=s(76652),c=s(16101),d=s(13821),u=s(39865),h=s(69519),p=s(26909),m=s(60300),f=s(11130),P=s(6332),_=s(84383),v=s(64928),g=s(7167),S=s(27863),x=s(90748),I=s(39755),U=s(89232),b=s(18699),w=s(40813),j=s(76643);const y={container:"container___gxzpX",list:"list___fN6lu",cell:"cell___Vpg4Y theme-border-color-secondary",iconOrImage:"iconOrImage___SPQsG",time:"time___QimWy theme-typography--caption"},F=(0,i.PA)((function UserActiveAuthMethods({className:e}){const t=(0,_.q)(UserActiveAuthMethods,f.UserInfoResource,void 0),s=(0,_.q)(UserActiveAuthMethods,P.AuthProvidersResource,w.fZ),i=(0,b.h)(j.AuthenticationService),o=(0,v.d)(y),n=(0,a.W)();return t.data?(0,r.jsx)(l.m,{className:e,children:(0,r.jsx)("div",{className:(0,g.s)(o,{list:!0}),children:t.data?.authTokens.map((e=>{const t=s.resource.get(e.authProvider);if(!t)return null;let a,l=t.label,c=e.message||t.description,d=t.icon;e.authConfiguration&&(a=t.configurations?.find((t=>t.id===e.authConfiguration)),a&&(l=a.displayName,c=a.description,a.iconURL&&(d=a.iconURL)));const u=new Date(e.loginTime),h=`${l}\n${c||""}`;return(0,r.jsx)(S.N,{title:h,wrapper:!0,children:(0,r.jsx)(x.f,{className:(0,g.s)(o,{cell:!0}),before:d?(0,r.jsx)(I.O,{className:(0,g.s)(o,{iconOrImage:!0}),icon:d}):void 0,after:(0,r.jsx)(U.$,{mod:["outlined"],onClick:()=>i.logout(t.id,a?.id),children:n("authentication_logout")}),description:(0,r.jsxs)(r.Fragment,{children:[c,(0,r.jsx)("br",{}),e.userId&&(0,r.jsxs)(r.Fragment,{children:[e.userId,(0,r.jsx)("br",{})]}),u?(0,r.jsx)("time",{className:(0,g.s)(o,{time:!0}),dateTime:u.toLocaleString(),children:u.toLocaleString()}):void 0]}),children:l})},t.id+"_"+e.authConfiguration)}))})}):null}));var C=s(16956),O=s(13359);const A=(0,i.PA)((function UserProfileFormInfoMetaParameters({tabState:e,tabSelected:t,disabled:s}){const i=(0,_.q)(UserProfileFormInfoMetaParameters,C.UserMetaParametersResource,void 0,{active:t});return 0===i.data.length?null:(0,r.jsx)(l.m,{wrap:!0,gap:!0,children:(0,r.jsx)(O.d,{state:e.state.metaParameters,properties:i.data,disabled:s,readOnly:!0,fill:!0,tiny:!0})})})),N=(0,i.PA)((function UserProfileFormInfo({tabId:e}){const t=(0,a.W)(),s=(0,p.V)(e),i=(0,m.i)();(0,o.X)(UserProfileFormInfo,i,s.selected);const f=i.isLoading();return(0,r.jsx)(n.U,{wrap:!0,overflow:!0,gap:!0,children:(0,r.jsxs)(l.m,{medium:!0,gap:!0,children:[(0,r.jsxs)(c.Y,{form:!0,gap:!0,children:[(0,r.jsx)(d.U,{children:t("plugin_user_profile_info")}),(0,r.jsxs)(l.m,{wrap:!0,gap:!0,children:[(0,r.jsx)(u.F,{type:"text",name:"userId",minLength:1,state:i.state,disabled:f,readOnly:!0,required:!0,tiny:!0,fill:!0,children:t("plugin_user_profile_info_id")}),(0,r.jsx)(u.F,{type:"text",name:"displayName",minLength:1,state:i.state,disabled:f,readOnly:!0,required:!0,tiny:!0,fill:!0,children:t("plugin_user_profile_info_displayName")}),(0,r.jsx)(u.F,{type:"text",name:"authRole",state:i.state,disabled:f,autoHide:!0,readOnly:!0,tiny:!0,fill:!0,children:t("authentication_user_role")})]}),(0,r.jsx)(h.a,{suspense:!0,inline:!0,children:(0,r.jsx)(A,{tabState:i,tabSelected:s.selected,disabled:f})})]}),(0,r.jsxs)(c.Y,{box:!0,medium:!0,overflow:!0,children:[(0,r.jsx)(d.U,{children:t("plugin_user_profile_auth_tokens")}),(0,r.jsx)(F,{})]})]})})}))},18663:(e,t,s)=>{s.r(t),s.d(t,{UserProfileFormInfoPartBootstrap:()=>g});var r=s(1118),i=s(50420),a=s(82103),o=s(5576),n=s(29487),l=s(11130),c=s(44745),d=s(35282),u=s(94866),h=s(15414),p=s(42891),m=s(17057),f=s(3065);const P=f.Ik({userId:f.Yj(),displayName:f.Yj().trim(),authRole:f.Yj().optional(),metaParameters:f.g1(f.KC([f.Yj().trim(),f.bz()])).optional()}).required();class UserProfileFormInfoPart extends h.o{constructor(e,t){super(e,{userId:t.data?.userId||"",displayName:t.data?.displayName||"",authRole:t.data?.authRole||"",metaParameters:(0,u.HO)(t.data?.metaParameters||{})}),this.userInfoResource=t,this.baseIncludes=["includeMetaParameters"]}format(e,t){this.state=P.parse(this.state)}isOutdated(){return this.userInfoResource.isOutdated(void 0,this.baseIncludes)}isLoaded(){return this.loaded&&this.userInfoResource.isLoaded(void 0,this.baseIncludes)}isChanged(){return!!this.loaded&&!((0,p.V)(this.state.userId,this.initialState.userId,null)&&(0,p.V)(this.state.displayName,this.initialState.displayName,null)&&(0,m.X)(this.state.metaParameters,this.initialState.metaParameters)&&(0,p.V)(this.state.authRole,this.initialState.authRole,""))}saveChanges(){return Promise.resolve()}async loader(){const e=await this.userInfoResource.load(void 0,this.baseIncludes);this.setInitialState({userId:e?.userId||"",displayName:e?.displayName||"",authRole:e?.authRole??"",metaParameters:(0,u.HO)(e?.metaParameters||{})})}}const _=(0,c.M)("User Profile Form Info Part");const v=(0,i.j)((()=>Promise.all([s.e(11502),s.e(7542),s.e(97493),s.e(67557),s.e(70639),s.e(64435),s.e(88273),s.e(23741),s.e(89538),s.e(46355),s.e(62570),s.e(95860),s.e(32431)]).then(s.bind(s,50840)).then((e=>e.UserProfileFormInfo))));let g=class UserProfileFormInfoPartBootstrap extends a.j{constructor(e){super(),this.userProfileFormService=e}register(){this.userProfileFormService.parts.add({key:"info",name:"plugin_user_profile_info",order:1,panel:()=>v,stateGetter:e=>()=>function getUserProfileFormInfoPart(e){return e.getPart(_,(t=>{const s=t.get(d.j).getServiceByClass(l.UserInfoResource);return new UserProfileFormInfoPart(e,s)}))}(e.formState)})}};g=(0,r.Cg)([(0,o._)(),(0,r.Sn)("design:paramtypes",[n.UserProfileFormService])],g)},83529:(e,t,s)=>{s.r(t),s.d(t,{UserProfileFormInfoPartService:()=>o});var r=s(1118),i=s(46210),a=s(5576);let o=class UserProfileFormInfoPartService{constructor(){this.placeholderContainer=new i.B}};o=(0,r.Cg)([(0,a._)(),(0,r.Sn)("design:paramtypes",[])],o)},71718:(e,t,s)=>{s.r(t),s.d(t,{UserProfileFormBootstrap:()=>d});var r=s(1118),i=s(90781),a=s(50420),o=s(82103),n=s(5576),l=s(63582);const c=(0,a.j)((()=>Promise.all([s.e(11502),s.e(7542),s.e(97493),s.e(67557),s.e(89538),s.e(62570),s.e(95860),s.e(18193)]).then(s.bind(s,66960)).then((e=>e.UserProfileFormPanel))));let d=class UserProfileFormBootstrap extends o.j{constructor(e,t){super(),this.userProfileTabsService=e,this.authInfoService=t}register(){this.userProfileTabsService.tabContainer.add({key:"account",name:"plugin_user_profile_account_title",order:1,isHidden:()=>null===this.authInfoService.userInfo,panel:()=>c})}};d=(0,r.Cg)([(0,n._)(),(0,r.Sn)("design:paramtypes",[l.UserProfileTabsService,i.AuthInfoService])],d)},66960:(e,t,s)=>{s.r(t),s.d(t,{UserProfileFormPanel:()=>S});var r=s(41773),i=s(7838),a=s(15993),o=s(91184),n=s(26533),l=s(18699),c=s(48138),d=s(71635),u=s(86764),h=s(76480),p=s(81321),m=s(97706),f=s(14452),P=s(61041),_=s(29487);const v=(0,i.PA)((function UserProfileForm({state:e}){const t=(0,l.h)(f.NotificationService),s=(0,l.h)(_.UserProfileFormService);return(0,r.jsx)(P.I,{service:s,state:e,onSubmit:function onSubmit({success:e}){e?t.logSuccess({title:"authentication_administration_user_updated"}):t.logError({title:"authentication_administration_user_update_failed"})}})}));var g=s(54658);class UserProfileFormState extends g.a{constructor(e,t,s){super(e,t,s)}}const S=(0,i.PA)((function UserProfileFormPanel({tabId:e}){const t=(0,l.h)(c.q),s=(0,l.h)(_.UserProfileFormService),i=(0,l.h)(m.UserProfileOptionsPanelService),f=(0,l.h)(d.CommonDialogService),[P]=(0,a.useState)((()=>{const e=new UserProfileFormState(t,s,{});return e.setMode(h.c.Edit),e}));return(0,o.H)({executor:i.onClose,handlers:[async function closeHandler(e,t){const s=t.getContext(p.g);if(P.isChanged()&&!s.force){await f.open(n.K,{title:"connections_public_connection_edit_cancel_title",message:"connections_public_connection_edit_cancel_message",confirmActionText:"ui_processing_ok"})===d.DialogueStateResult.Rejected&&u.a.interrupt(t)}}]}),(0,r.jsx)(v,{state:P})}))},29487:(e,t,s)=>{s.r(t),s.d(t,{UserProfileFormService:()=>l});var r=s(1118),i=s(5576),a=s(14452),o=s(34227),n=s(67098);let l=class UserProfileFormService extends n.l{constructor(e,t){super(e,t,"User profile form")}};l=(0,r.Cg)([(0,i._)(),(0,r.Sn)("design:paramtypes",[o.LocalizationService,a.NotificationService])],l)},2464:(e,t,s)=>{s.r(t),s.d(t,{UserProfileOptionsPanel:()=>g,tabsStyleRegistry:()=>v});var r=s(41773),i=s(7838),a=s(64928),o=s(71120),n=s(7167),l=s(16101),c=s(13720),d=s(76652),u=s(18699),h=s(20458),p=s(22321),m=s(44451),f=s(52843);const P={userProfileOptionsPanel:"userProfileOptionsPanel___u8FVx"};var _=s(63582);const v=[[h.A,{mode:"append",styles:[{tabInner:"tabInner___f5rHU",tabOuter:"tabOuter___CBQYg"}]}]],g=(0,i.PA)((function UserProfileOptionsPanel(){const e=(0,a.d)(P),t=(0,u.h)(_.UserProfileTabsService);return(0,r.jsx)(o.U,{className:(0,n.s)(e,{userProfileOptionsPanel:!0}),parent:!0,compact:!0,vertical:!0,noWrap:!0,maximum:!0,children:(0,r.jsxs)(p._,{container:t.tabContainer,lazy:!0,children:[(0,r.jsx)(l.Y,{box:!0,keepSize:!0,noWrap:!0,children:(0,r.jsx)(c.Z,{registry:v,children:(0,r.jsx)(m.w,{underline:!0})})}),(0,r.jsx)(d.m,{vertical:!0,children:(0,r.jsx)(f.A,{})})]})})}))},97706:(e,t,s)=>{s.r(t),s.d(t,{UserProfileOptionsPanelService:()=>P});var r=s(1118),i=s(94866),a=s(11130),o=s(50420),n=s(5576),l=s(44017),c=s(29606),d=s(99138),u=s(86411),h=s(9724),p=s(81321),m=s(63582);const f=(0,o.j)((()=>Promise.all([s.e(11502),s.e(97493),s.e(67557),s.e(89538),s.e(40574)]).then(s.bind(s,2464)).then((e=>e.UserProfileOptionsPanel)))),panelGetter=()=>f;let P=class UserProfileOptionsPanelService{constructor(e,t,s){this.optionsPanelService=e,this.userInfoResource=t,this.userProfileTabsService=s,this.onOpen=new l.H,this.onClose=new c.Q,this.optionsPanelService.closeTask.next(this.onClose,void 0,(()=>this.optionsPanelService.isOpen(panelGetter))),this.userInfoResource.onDataUpdate.addHandler(this.userUpdateHandler.bind(this)),(0,i.Gn)(this,{open:i.XI,close:i.XI})}async open(e){if((0,h.K)(e)?this.userProfileTabsService.tabContainer.select(e):this.userProfileTabsService.tabContainer.select(null),this.optionsPanelService.isOpen(panelGetter))return!0;const t=await this.optionsPanelService.open(panelGetter);return t&&this.onOpen.execute(),t}async close(e){if(!this.optionsPanelService.isOpen(panelGetter))return;const t=new d.a(void 0);if(e){t.getContext(p.g).setForce(e)}await this.optionsPanelService.close(t)}userUpdateHandler(){this.optionsPanelService.isOpen(panelGetter)&&null===this.userInfoResource.data&&this.close(!0)}};P=(0,r.Cg)([(0,n._)(),(0,r.Sn)("design:paramtypes",[u.OptionsPanelService,a.UserInfoResource,m.UserProfileTabsService])],P)},63582:(e,t,s)=>{s.r(t),s.d(t,{UserProfileTabsService:()=>o});var r=s(1118),i=s(5576),a=s(68356);let o=class UserProfileTabsService{constructor(){this.tabContainer=new a.a("User Profile")}};o=(0,r.Cg)([(0,i._)(),(0,r.Sn)("design:paramtypes",[])],o)},81321:(e,t,s)=>{function userProfileContext(){return{force:!1,setForce(e){this.force=e}}}s.d(t,{g:()=>userProfileContext})}}]);