1import{a as E}from"./chunk-X6DCTZMI.js";import{a as y}from"./chunk-R7DU2ZWT.js";import"./chunk-4STF6XGI.js";import{H as et,I as it,P as nt,e as K,ea as ot,f as J,k as q,m as $,p as H,pa as at,q as X,qa as rt,r as Q,s as Y,ua as st,v as Z,va as lt,z as tt}from"./chunk-TXGVB7MQ.js";import{Ba as u,J as w,Ka as e,La as t,Lb as N,Ma as C,Mb as B,Na as A,Oa as T,Od as L,P as I,Pb as V,Q as F,Qa as b,Qb as W,Rd as j,Ta as S,Td as G,Ud as z,V as h,Va as g,W as v,Xc as O,Xd as R,Ya as P,Zc as D,hb as a,ib as m,ja as i,jb as d,ka as x,n as M,tb as p,ub as c,vb as k,za as f,zd as U}from"./chunk-GWEXS2NE.js";import"./chunk-RV33I2IG.js";function _t(n,l){if(n&1&&(e(0,"option",17),a(1),t()),n&2){let o=l.$implicit;u("value",o.code),i(),d(" ",o.name," ")}}function ht(n,l){if(n&1){let o=b();e(0,"div",4)(1,"h2",5)(2,"mat-icon",12),a(3,"translate"),t(),e(4,"span"),a(5),p(6,"translate"),t()(),e(7,"form",13)(8,"mat-form-field",14)(9,"select",15),S("change",function(){h(o);let s=g(2);return v(s.switchLanguage())}),f(10,_t,2,2,"option",16),t()()()()}if(n&2){let o=g(2);i(5),m(c(6,3,"Modules.Settings.Language.Title")),i(2),u("formGroup",o.form),i(3),u("ngForOf",o.languages)}}function vt(n,l){if(n&1){let o=b();e(0,"button",42),S("click",function(){h(o);let s=g(4);return v(s.hideUserTFA())}),a(1),p(2,"translate"),t()}n&2&&(i(),d(" ",c(2,1,"Commons.Actions.Cancel")," "))}function xt(n,l){n&1&&(A(0),a(1),p(2,"translate"),T()),n&2&&(i(),m(c(2,1,"Modules.Profile.Actions.EnableTFA")))}function bt(n,l){n&1&&(A(0),a(1),p(2,"translate"),T()),n&2&&(i(),m(c(2,1,"Modules.Profile.Actions.DisableTFA")))}function St(n,l){if(n&1){let o=b();e(0,"div",39),f(1,vt,3,3,"button",40),e(2,"button",41),S("click",function(){h(o);let s=g(3);return v(s.toggleTFA())}),f(3,xt,3,3,"ng-container",8)(4,bt,3,3,"ng-container",8),t()()}if(n&2){let o=g(3);i(),u("ngIf",!o.userTFA.isTFAEnabled),i(2),u("ngIf",!o.userTFA.isTFAEnabled),i(),u("ngIf",o.userTFA.isTFAEnabled)}}function Ct(n,l){if(n&1){let o=b();A(0),e(1,"ul",18)(2,"li",5)(3,"span",19),a(4,"1"),t(),a(5),p(6,"translate"),t(),e(7,"li",5)(8,"span",19),a(9,"2"),t(),a(10),p(11,"translate"),t(),e(12,"li",5)(13,"span",19),a(14,"3"),t(),a(15),p(16,"translate"),t()(),e(17,"div",20)(18,"div",21)(19,"div")(20,"strong"),a(21),p(22,"translate"),t(),e(23,"div",22),a(24),t()(),e(25,"button",23),p(26,"translate"),S("click",function(){h(o);let s=g(2);return v(s.copyAuthenticatorKey())}),e(27,"mat-icon"),a(28,"content_copy"),t()()(),e(29,"div",24)(30,"div",25)(31,"div",26),C(32,"img",27),e(33,"span",28),a(34,"Microsoft Auth."),t()(),e(35,"div",29)(36,"a",30),C(37,"img",31),t(),e(38,"a",32),C(39,"img",33),t()()(),e(40,"div",34)(41,"div",26),C(42,"img",35),e(43,"span",28),a(44,"Google Auth."),t()(),e(45,"div",29)(46,"a",36),C(47,"img",31),t(),e(48,"a",37),C(49,"img",33),t()()()()(),f(50,St,5,3,"div",38),T()}if(n&2){let o=g(2);i(5),d(" ",c(6,7,"Modules.Profile.Authenticator.TFAEnable1")," "),i(5),d(" ",c(11,9,"Modules.Profile.Authenticator.TFAEnable2")," "),i(5),d(" ",c(16,11,"Modules.Profile.Authenticator.TFAEnable3")," "),i(6),d("",c(22,13,"Modules.Profile.Authenticator.SecretKey"),":"),i(3),m(o.userTFA.authenticatorKey),i(),P("matTooltip",c(26,15,"Modules.Profile.Tooltips.TFACopyCode")),i(25),u("ngIf",o.showTFAConfiguration)}}function At(n,l){if(n&1){let o=b();e(0,"div",10)(1,"div"),a(2),p(3,"translate"),t(),e(4,"button",43),S("click",function(){h(o);let s=g(2);return v(s.showUserTFA())}),a(5),p(6,"translate"),t()()}n&2&&(i(2),m(c(3,2,"Modules.Profile.Authenticator.TFADisable")),i(3),d(" ",c(6,4,"Modules.Profile.Actions.VerifyTFA")," "))}function Tt(n,l){if(n&1){let o=b();e(0,"button",45),S("click",function(){h(o);let s=g(3);return v(s.togglePushNotifications(!1))}),a(1),p(2,"translate"),t()}n&2&&(i(),d(" ",c(2,1,"Modules.Settings.PushNotifications.Disable")," "))}function yt(n,l){if(n&1&&(e(0,"div")(1,"div"),a(2),p(3,"translate"),t(),f(4,Tt,3,3,"button",44),t()),n&2){let o=g(2);i(2),m(c(3,2,"Modules.Settings.PushNotifications.Enabled")),i(2),u("ngIf",o.user.pushNotifications)}}function Et(n,l){if(n&1){let o=b();e(0,"button",45),S("click",function(){h(o);let s=g(3);return v(s.togglePushNotifications(!0))}),a(1),p(2,"translate"),t()}n&2&&(i(),d(" ",c(2,1,"Modules.Settings.PushNotifications.Enable")," "))}function Mt(n,l){if(n&1&&(e(0,"div")(1,"div"),a(2),p(3,"translate"),t(),f(4,Et,3,3,"button",44),t()),n&2){let o=g(2);i(2),m(c(3,2,"Modules.Settings.PushNotifications.Disabled")),i(2),u("ngIf",!o.user.pushNotifications)}}function wt(n,l){if(n&1){let o=b();e(0,"div",3)(1,"div",4)(2,"h2",5)(3,"span"),a(4),p(5,"translate"),t()(),e(6,"ul",6)(7,"li")(8,"strong"),a(9),p(10,"translate"),t(),e(11,"span"),a(12),t()(),e(13,"li")(14,"strong"),a(15),p(16,"translate"),t(),e(17,"span"),a(18),t()(),e(19,"li")(20,"strong"),a(21),p(22,"translate"),t(),e(23,"span"),a(24),t()(),e(25,"li")(26,"strong"),a(27),p(28,"translate"),t(),e(29,"span"),a(30),t()(),e(31,"li")(32,"strong"),a(33),p(34,"translate"),t(),e(35,"span"),a(36),t()(),e(37,"li")(38,"strong"),a(39),p(40,"translate"),t(),e(41,"span"),a(42),p(43,"date"),t()()()(),f(44,ht,11,5,"div",7),e(45,"div",4)(46,"h2",5)(47,"span"),a(48),p(49,"translate"),t()(),f(50,Ct,51,17,"ng-container",8)(51,At,7,6,"div",9),t(),e(52,"div",4)(53,"h2",5)(54,"span"),a(55),p(56,"translate"),t()(),e(57,"div",10),f(58,
1yt,5,4,"div",8)(59,Mt,5,4,"div",8),t()(),C(60,"hr"),e(61,"button",11),S("click",function(){h(o);let s=g();return v(s.logout())}),e(62,"mat-icon",12),a(63,"logout"),t(),a(64),p(65,"translate"),t()()}if(n&2){let o=g();i(4),m(c(5,21,"Modules.Settings.PersonalData.Title")),i(5),d("",c(10,23,"Modules.Settings.PersonalData.Form.FirstName"),":"),i(3),m(o.user.firstName),i(3),d("",c(16,25,"Modules.Settings.PersonalData.Form.LastName"),":"),i(3),m(o.user.lastName),i(3),d("",c(22,27,"Modules.Settings.PersonalData.Form.Email"),":"),i(3),m(o.user.email),i(3),d("",c(28,29,"Modules.Settings.PersonalData.Form.Language"),":"),i(3),m(o.user.language),i(3),d("",c(34,31,"Modules.Settings.PersonalData.Form.Username"),":"),i(3),m(o.user.username),i(3),d("",c(40,33,"Modules.Settings.PersonalData.Form.PasswordExpiration"),":"),i(3),m(k(43,35,o.user.passwordExpiration,"dd/MM/yyyy")),i(2),u("ngIf",o.languages&&o.languages.length>1),i(4),m(c(49,38,"Modules.Profile.Authenticator.Title")),i(2),u("ngIf",o.showTFAConfiguration),i(),u("ngIf",!o.showTFAConfiguration),i(4),m(c(56,40,"Modules.Settings.PushNotifications.Title")),i(3),u("ngIf",o.user.pushNotifications),i(),u("ngIf",!o.user.pushNotifications),i(5),d("",c(65,42,"Modules.Settings.Logout.Button")," ")}}var pt=(()=>{let l=class l{constructor(r,s,_,ct,mt,dt,ut,gt){this.settingsService=r,this.loginService=s,this.pcodeService=_,this.pushNotificationsMiddleware=ct,this.translateService=mt,this.fb=dt,this.router=ut,this.dialog=gt,this.subs=new rt,this.user=null,this.showTFAConfiguration=!1,this.userTFA=null,this.form=this.fb.group({languageCode:this.fb.control(null)})}ngOnInit(){let r=this.pcodeService.getLanguages(),s=this.settingsService.getLoggedUserProfile();this.subs.sink=M([r,s]).subscribe(_=>{this.languages=_[0],this.user=_[1],this.form.get("languageCode").setValue(this.translateService.currentLang),this.getUserTFA()})}switchLanguage(){let r=this.form.get("languageCode").value;this.settingsService.updateLanguage(r).subscribe(()=>{this.pcodeService.changeLanguage(r),this.form.get("languageCode").setValue(r)})}ngOnDestroy(){this.subs.unsubscribe()}togglePushNotifications(r){r?this.enablePushNotifications():this.disablePushNotifications()}enablePushNotifications(){this.pushNotificationsMiddleware.requestSubscription().then(r=>{this.subs.sink=this.pushNotificationsMiddleware.subscribeUser(r).subscribe(()=>{this.user.pushNotifications=!0,this.getPushSubscriptionStatus(r)})}).catch(()=>{this.user.pushNotifications=!1,this.pcodeService.notify("error",this.translateService.instant("Modules.Settings.PushNotifications.ErrorMessage"))})}disablePushNotifications(){this.pushNotificationsMiddleware.requestSubscription().then(r=>{r&&r.unsubscribe().then(()=>{this.subs.sink=this.pushNotificationsMiddleware.unsubscribeUser(r).subscribe(()=>{this.user.pushNotifications=!1})})}).catch(()=>{this.subs.sink=this.pushNotificationsMiddleware.unsubscribeUser(null).subscribe(()=>{this.user.pushNotifications=!1})})}getPushSubscriptionStatus(r){let s=JSON.parse(JSON.stringify(r));this.subs.sink=this.pushNotificationsMiddleware.getSubscriptionStatus({endPoint:s.endpoint,auth:s.keys.auth,p256Dh:s.keys.p256dh}).subscribe(_=>{this.user.pushNotifications=_.status})}logout(){this.pcodeService.confirm("Attenzione!",`Confermi di voler effettuare il logout dall'account ${this.user.username}?`).subscribe(r=>{r&&(this.loginService.logout(!1),this.router.navigate(["/login"]))})}getUserTFA(){this.subs.sink=this.settingsService.getUserTFA().subscribe(r=>{this.userTFA=r,this.userTFA.isTFAEnabled?this.showUserTFA():this.hideUserTFA()})}showUserTFA(){this.showTFAConfiguration=!0}hideUserTFA(){this.showTFAConfiguration=!1}toggleTFA(){this.dialog.open(at,{width:"600px",maxWidth:"90vw",maxHeight:"90%",backdropClass:"pwa-dialog-overlay-wrapper",panelClass:"pwa-dialog-panel",disableClose:!0,autoFocus:!0,position:{bottom:"30px"},scrollStrategy:new U}).componentInstance.formSubmitted.subscribe(s=>{this.subs.sink=this.settingsService.toggleTFA(s).subscribe({next:_=>{this.getUserTFA(),_.isTFAEnabled?this.pcodeService.notify("success",this.translateService.instant("Modules.Profile.Messages.TFAEnableSuccess")):this.pcodeService.n
1otify("success",this.translateService.instant("Modules.Profile.Messages.TFADisableSuccess"))},error:()=>{this.pcodeService.notify("error",this.translateService.instant("Modules.Profile.Errors.InvalidOtpCode"))}})})}copyAuthenticatorKey(){navigator.clipboard.writeText(this.userTFA.authenticatorKey).then(()=>{this.pcodeService.notify("success",this.translateService.instant("Modules.Profile.Messages.CopyTFAClipboard"))})}};l.\u0275fac=function(s){return new(s||l)(x(E),x(tt),x(st),x(y),x(G),x(Z),x(L),x(nt))},l.\u0275cmp=I({type:l,selectors:[["webapp-settings"]],decls:11,vars:1,consts:[[1,"page_title"],[1,"page_content"],["class","inner",4,"ngIf"],[1,"inner"],[1,"mb-6"],[1,"flex","items-center","mb-2"],[1,"settings_list","mt-4"],["class","mb-6",4,"ngIf"],[4,"ngIf"],["class","mt-3 text-sm",4,"ngIf"],[1,"mt-3","text-sm"],["mat-stroked-button","","color","warn",1,"h-8","mt-2","px-6",3,"click"],[1,"mr-2"],[1,"webapp-form",3,"formGroup"],["floatLabel","always"],["matNativeControl","","formControlName","languageCode",3,"change"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"list-none","mt-4","text-sm"],[1,"flex","items-center","justify-center","rounded-full","bg-secondary","text-accent","text-center","min-w-[30px]","h-[30px]","mr-2"],[1,"mt-2"],[1,"flex","items-center"],[1,"text-xs"],["type","button","color","accent","mat-icon-button","","matTooltipPosition","above",1,"ml-1",3,"click","matTooltip"],[1,"mt-5"],[1,"flex","items-center","justify-between","py-2","px-3","border","border-solid","border-neutral-200","rounded-full"],[1,"flex","flex-1","items-center"],["src","/assets/img/shared/microsoft-authenticator.png",1,"h-[24px]"],[1,"text-sm","ml-2"],[1,"flex","items-center","ml-4"],["href","https://apps.apple.com/it/app/microsoft-authenticator/id983156458","target","_blank","matTooltip","App Store"],["src","/assets/img/shared/app-store.png",1,"h-[24px]"],["href","https://play.google.com/store/apps/details?id=com.azure.authenticator","target","_blank","matTooltip","Google Play",1,"ml-4"],["src","/assets/img/shared/google-play.png",1,"h-[24px]"],[1,"flex","items-center","justify-between","mt-3","py-2","px-3","border","border-solid","border-neutral-200","rounded-full"],["src","/assets/img/shared/google-authenticator.png",1,"h-[24px]"],["href","https://apps.apple.com/it/app/google-authenticator/id388497605","target","_blank","matTooltip","App Store"],["href","https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2","target","_blank","matTooltip","Google Play",1,"ml-4"],["class","flex justify-start mt-6",4,"ngIf"],[1,"flex","justify-start","mt-6"],["type","button","mat-stroked-button","","class","px-6 mr-4",3,"click",4,"ngIf"],["type","button","mat-flat-button","","color","accent",1,"px-6",3,"click"],["type","button","mat-stroked-button","",1,"px-6","mr-4",3,"click"],["type","button","mat-flat-button","","color","accent",1,"mt-4","px-6",3,"click"],["mat-flat-button","","color","accent","class","mt-4 my-1 px-6",3,"click",4,"ngIf"],["mat-flat-button","","color","accent",1,"mt-4","my-1","px-6",3,"click"]],template:function(s,_){s&1&&(e(0,"div")(1,"h1",0)(2,"mat-icon"),a(3,"person"),t(),e(4,"span")(5,"span"),a(6,"Profilo"),t(),e(7,"small"),a(8,"Informazioni account e impostazioni."),t()()(),e(9,"div",1),f(10,wt,66,44,"div",2),t()()),s&2&&(i(10),u("ngIf",_.user))},dependencies:[N,B,q,Q,Y,X,K,J,$,H,et,O,D,R,ot,it,V,z],styles:[`@keyframes _ngcontent-%COMP%_blink-animation{to{visibility:hidden}}@-webkit-keyframes _ngcontent-%COMP%_blink-animation{to{visibility:hidden}}@-webkit-keyframes _ngcontent-%COMP%_rotating{0%{-webkit-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes _ngcontent-%COMP%_rotating{0%{-ms-transform:rotate(0deg);-moz-transform:rotate(0deg);-webkit-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0)}to{-ms-transform:rotate(360deg);-moz-transform:rotate(360deg);-webkit-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}.settings_list[_ngcontent-%COMP%]{display:block;list-style:none;margin:0;padding:0}.settings_list[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{display:flex;margin-bottom:10px;padding-bottom:10px;border-bottom:1px dashed #e8d2b6}.settings_list[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] > strong[_ngcontent-%COMP%]{margin-right:10px} 2/*# sourceMappingURL=settings.component-AV6X3NO2.css.map */`]});let n=l;return n})();var It=[{path:"",component:pt,data:{title:"Modules.Settings.PageTitle"}}],pe=(()=>{let l=class l{};l.\u0275fac=function(s){return new(s||l)},l.\u0275mod=F({type:l}),l.\u0275inj=w({providers:[E,y],imports:[W,lt,j.forChild(It)]});let n=l;return n})();export{pe as WebAppSettingsModule}; 3//# sourceMappingURL=chunk-ATHKQJRQ.js.map
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.