1import{c as ie}from"./chunk-32VEU2QD.js";import{b as X,d as ee,e as te,f as re}from"./chunk-SA6RDWCP.js";import{c as W,f as V}from"./chunk-UHG5CZRU.js";import{pb as B,rb as J}from"./chunk-RTJMEUJV.js";import{Af as M,Fe as w,He as H,I as a,Ie as P,Le as q,N as D,Ng as $,Ue as G,Xd as O,Ye as A,Ze as C,af as Z,ag as K,bb as f,bf as z,ca as g,dg as T,fa as v,ff as Q,la as u,ma as m,me as x,na as E,oa as o,pa as h,q as y,rd as l,td as k,va as N,wg as Y,yf as d,zd as L,ze as _}from"./chunk-ZZYPXCWX.js";import{a as j}from"./chunk-GON3DZPO.js";var F=new E("UserProfileNormalizer"),ae=new E("UserProfileSerializer");var de=new E("UserSignUpSerializer"),ue=new E("TitleNormalizer"),S=class{},I=(()=>{class r{constructor(e){this.userProfileAdapter=e}update(e,t){return this.userProfileAdapter.update(e,t)}register(e){return this.userProfileAdapter.register(e)}registerGuest(e,t){return this.userProfileAdapter.registerGuest(e,t)}requestForgotPasswordEmail(e){return this.userProfileAdapter.requestForgotPasswordEmail(e)}resetPassword(e,t){return this.userProfileAdapter.resetPassword(e,t)}updateEmail(e,t,s){return this.userProfileAdapter.updateEmail(e,t,s)}updatePassword(e,t,s){return this.userProfileAdapter.updatePassword(e,t,s)}remove(e){return this.userProfileAdapter.close(e)}getTitles(){return this.userProfileAdapter.loadTitles()}static{this.\u0275fac=function(t){return new(t||r)(o(S))}}static{this.\u0275prov=u({token:r,factory:r.\u0275fac})}}return r})(),se=(()=>{class r{constructor(e,t,s){this.userIdService=e,this.userProfileConnector=t,this.command=s,this.updateCommand=this.command.create(i=>this.userIdService.takeUserId(!0).pipe(g(n=>this.userProfileConnector.updateEmail(n,i.password,i.newUid))),{strategy:A.Queue})}update(e,t){return this.updateCommand.execute({password:e,newUid:t})}static{this.\u0275fac=function(t){return new(t||r)(o(M),o(I),o(C))}}static{this.\u0275prov=u({token:r,factory:r.\u0275fac})}}return r})(),oe=(()=>{class r{constructor(e,t,s){this.userProfileConnector=e,this.userIdService=t,this.command=s,this.updateCommand=this.command.create(i=>this.userIdService.takeUserId(!0).pipe(D(1),g(n=>this.userProfileConnector.updatePassword(n,i.oldPassword,i.newPassword)))),this.resetCommand=this.command.create(i=>this.userProfileConnector.resetPassword(i.token,i.password)),this.requestForgotPasswordEmailCommand=this.command.create(i=>this.userProfileConnector.requestForgotPasswordEmail(i.email))}update(e,t){return this.updateCommand.execute({oldPassword:e,newPassword:t})}reset(e,t){return this.resetCommand.execute({token:e,password:t})}requestForgotPasswordEmail(e){return this.requestForgotPasswordEmailCommand.execute({email:e})}static{this.\u0275fac=function(t){return new(t||r)(o(I),o(M),o(C))}}static{this.\u0275prov=u({token:r,factory:r.\u0275fac})}}return r})(),b=(()=>{class r{constructor(e,t,s,i,n,c,p){this.userAccountService=e,this.authService=t,this.userProfileConnector=s,this.eventService=i,this.userIdService=n,this.query=c,this.command=p,this.updateCommand=this.command.create(R=>this.userIdService.takeUserId(!0).pipe(g(le=>this.userProfileConnector.update(le,R.details).pipe(v(()=>{this.eventService.dispatch({user:R.details},V)})))),{strategy:A.Queue}),this.closeCommand=this.command.create(()=>this.userIdService.takeUserId(!0).pipe(g(R=>this.userProfileConnector.remove(R).pipe(v(()=>this.authService.logout()))))),this.titleQuery=this.query.create(()=>this.userProfileConnector.getTitles(),{reloadOn:[$]})}get(){return this.userAccountService.get()}update(e){return this.updateCommand.execute({details:e})}close(){return this.closeCommand.execute(void 0)}getTitles(){return this.titleQuery.get().pipe(y(e=>e??[]))}static{this.\u0275fac=function(t){return new(t||r)(o(W),o(T),o(I),o(Z),o(M),o(z),o(C))}}static{this.\u0275prov=u({token:r,factory:r.\u0275fac})}}return r})(),ne=(()=>{class r{constructor(e,t,s,i,n){this.userProfile=e,this.userConnector=t,this.authService=s,this.command=i,this.store=n,this.featureConfigService=h(_),this.routingService=h(K),this.registerCommand=this.command.create(({user:c})=>this.userConnector.register(c).pipe(v(()=>{this.store.dispatch(new Y.RegisterUserSuccess)}))),this.registerGuestCommand=this.command.create(c=>this.userConnector.registerGuest(c.guid,c.password).pipe(v(p=>{this.featureConfigService.isEnabled("authorizationCodeFlowByDefault")?this.routingService.go({cxRoute:"login"}):this.authService.loginWithCredentials(p.uid,c.password)})))}register(e){return this.registerCommand.execute({user:e})}registerGuest(e,t){return this.registerGuestCommand.execute({guid:e,password:t})}getTitles(){return this.userProfile.getTitles()}static{this.\u0275fac=function(t){return new(t||r)(o(b),o(I),o(T),o(C),o(O))}}static{this.\u0275prov=u({token:r,factory:r.\u0275fac})}}return r})(),fe=[se,oe,b,ne,{provide:ee,useExisting:se},{provide:te,useExisting:oe},{provide:X,useExisting:b},{provide:re,useExisting:ne}],pe=(()=>{class r{static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275mod=f({type:r})}static{this.\u0275inj=m({providers:[I,...fe]})}}return r})();var ge={backend:{occ:{endpoints:{userRegister:"users",userForgotPassword:"forgottenpasswordtokens",userRestoreToken:"passwordRestoreToken",userResetPassword:"resetpassword",userUpdateLoginId:"users/${userId}/login",userUpdatePassword:"users/${userId}/password",titles:"titles"}}}},U={"Content-Type":"application/json"},ve={"Content-Type":"application/x-www-form-urlencoded"},Ee=(()=>
1{class r{constructor(e,t,s){this.http=e,this.occEndpoints=t,this.converter=s,this.logger=h(q),this.captchaConfig=h(B,{optional:!0}),this.injector=h(N,{optional:!0})}update(e,t){let s=this.occEndpoints.isConfigured("userUpdateProfile")?"userUpdateProfile":"user",i=this.occEndpoints.buildUrl(s,{urlParams:{userId:e}});return t=this.converter.convert(t,ae),this.http.patch(i,t).pipe(a(n=>{throw d(n,this.logger)}))}register(e){let t=this.occEndpoints.buildUrl("userRegister"),s=new l(j({},U));return s=P.createHeader(w,!0,s),s=this.appendCaptchaToken(s),e=this.converter.convert(e,de),this.http.post(t,e,{headers:s}).pipe(a(i=>{throw d(i,this.logger)}),this.converter.pipeable(F))}registerGuest(e,t){let s=this.occEndpoints.buildUrl("userRegister"),i=new l(j({},ve));i=P.createHeader(w,!0,i),i=this.appendCaptchaToken(i);let n=new k().set("guid",e).set("password",t);return this.http.post(s,n,{headers:i}).pipe(a(c=>{throw d(c,this.logger)}),this.converter.pipeable(F))}requestForgotPasswordEmail(e){let t=this.occEndpoints.buildUrl("userRestoreToken"),s={loginId:e},i=new l(U);return i=P.createHeader(w,!0,i),this.http.post(t,s,{headers:i}).pipe(a(n=>{throw d(n,this.logger)}))}resetPassword(e,t){let s=this.occEndpoints.buildUrl("userResetPassword"),i=new l(j({},U));return i=P.createHeader(w,!0,i),this.http.post(s,{token:e,newPassword:t},{headers:i}).pipe(a(n=>{throw d(n,this.logger)}))}updateEmail(e,t,s){let i=this.occEndpoints.buildUrl("userUpdateLoginId",{urlParams:{userId:e}}),n={newLoginId:s,password:t},c=new l(U);return this.http.post(i,n,{headers:c}).pipe(a(p=>{throw d(p,this.logger)}))}updatePassword(e,t,s){let i=this.occEndpoints.buildUrl("userUpdatePassword",{urlParams:{userId:e}}),n={oldPassword:t,newPassword:s},c=new l(U);return this.http.post(i,n,{headers:c}).pipe(a(p=>{throw d(p,this.logger)}))}close(e){let t=this.occEndpoints.isConfigured("userCloseAccount")?"userCloseAccount":"user",s=this.occEndpoints.buildUrl(t,{urlParams:{userId:e}});return this.http.delete(s).pipe(a(i=>{throw d(i,this.logger)}))}loadTitles(){let e=this.occEndpoints.buildUrl("titles");return this.http.get(e).pipe(a(t=>{throw d(t,this.logger)}),y(t=>t.titles??[]),this.converter.pipeableMany(ue))}appendCaptchaToken(e){if(this.injector&&this.captchaConfig?.captchaRenderer){let t=this.injector.get(this.captchaConfig.captchaRenderer),s=t.getCaptchaConfig().subscribe(i=>i.enabled);if(t?.getToken()&&s)return e.append(H,t.getToken())}return e}static{this.\u0275fac=function(t){return new(t||r)(o(L),o(G),o(Q))}}static{this.\u0275prov=u({token:r,factory:r.\u0275fac})}}return r})(),he=(()=>{class r{static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275mod=f({type:r})}static{this.\u0275inj=m({providers:[x(ge),{provide:S,useClass:Ee}]})}}return r})();var ze=(()=>{class r{static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275mod=f({type:r})}static{this.\u0275inj=m({imports:[pe,he,ie,J]})}}return r})();export{ze as UserProfileModule};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.