@arsedizioni/ars-utils 21.2.209 → 21.2.221

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs +179 -159
  2. package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs.map +1 -1
  3. package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs +2939 -2939
  4. package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
  5. package/fesm2022/arsedizioni-ars-utils-core.mjs +101 -101
  6. package/fesm2022/arsedizioni-ars-utils-core.mjs.map +1 -1
  7. package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs +280 -252
  8. package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs.map +1 -1
  9. package/fesm2022/arsedizioni-ars-utils-help.mjs +115 -102
  10. package/fesm2022/arsedizioni-ars-utils-help.mjs.map +1 -1
  11. package/fesm2022/arsedizioni-ars-utils-support.common.mjs +43 -36
  12. package/fesm2022/arsedizioni-ars-utils-support.common.mjs.map +1 -1
  13. package/fesm2022/arsedizioni-ars-utils-support.ui.mjs +68 -77
  14. package/fesm2022/arsedizioni-ars-utils-support.ui.mjs.map +1 -1
  15. package/fesm2022/arsedizioni-ars-utils-tinymce.mjs +41 -26
  16. package/fesm2022/arsedizioni-ars-utils-tinymce.mjs.map +1 -1
  17. package/fesm2022/arsedizioni-ars-utils-ui.application.mjs +1461 -1390
  18. package/fesm2022/arsedizioni-ars-utils-ui.application.mjs.map +1 -1
  19. package/fesm2022/arsedizioni-ars-utils-ui.mjs +1349 -1204
  20. package/fesm2022/arsedizioni-ars-utils-ui.mjs.map +1 -1
  21. package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs +29 -25
  22. package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs.map +1 -1
  23. package/package.json +1 -1
  24. package/types/arsedizioni-ars-utils-clipper.common.d.ts +88 -62
  25. package/types/arsedizioni-ars-utils-clipper.ui.d.ts +196 -196
  26. package/types/arsedizioni-ars-utils-core.d.ts +16 -16
  27. package/types/arsedizioni-ars-utils-evolution.common.d.ts +131 -70
  28. package/types/arsedizioni-ars-utils-help.d.ts +76 -66
  29. package/types/arsedizioni-ars-utils-support.common.d.ts +29 -19
  30. package/types/arsedizioni-ars-utils-support.ui.d.ts +29 -25
  31. package/types/arsedizioni-ars-utils-tinymce.d.ts +25 -10
  32. package/types/arsedizioni-ars-utils-ui.application.d.ts +597 -467
  33. package/types/arsedizioni-ars-utils-ui.d.ts +474 -337
  34. package/types/arsedizioni-ars-utils-ui.oauth.d.ts +25 -18
@@ -22,11 +22,11 @@ var LoginOAuthType;
22
22
  })(LoginOAuthType || (LoginOAuthType = {}));
23
23
 
24
24
  class ArsUIOAuthModule {
25
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ArsUIOAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
26
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: ArsUIOAuthModule }); }
27
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ArsUIOAuthModule }); }
25
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: ArsUIOAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
26
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.10", ngImport: i0, type: ArsUIOAuthModule }); }
27
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: ArsUIOAuthModule }); }
28
28
  }
29
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ArsUIOAuthModule, decorators: [{
29
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: ArsUIOAuthModule, decorators: [{
30
30
  type: NgModule
31
31
  }] });
32
32
 
@@ -66,17 +66,21 @@ class LoginOAuthComponent {
66
66
  this.msaLService = inject(MsalService);
67
67
  this.dialogService = inject(DialogService);
68
68
  this.ngZone = inject(NgZone);
69
+ /** Emitted when OAuth authentication succeeds. */
69
70
  this.success = output();
71
+ /** Whether to show the introductory info panel. */
70
72
  this.showInfo = input(true, ...(ngDevMode ? [{ debugName: "showInfo" }] : /* istanbul ignore next */ []));
73
+ /** Application name displayed in the info panel. */
71
74
  this.applicationName = input(...(ngDevMode ? [undefined, { debugName: "applicationName" }] : /* istanbul ignore next */ []));
75
+ /** Whether to trigger `initialize()` automatically on mount. */
72
76
  this.autoInitialize = input(false, ...(ngDevMode ? [{ debugName: "autoInitialize" }] : /* istanbul ignore next */ []));
77
+ /** Whether the Microsoft login button is shown. */
73
78
  this.allowMicrosoft = input(true, ...(ngDevMode ? [{ debugName: "allowMicrosoft" }] : /* istanbul ignore next */ []));
79
+ /** Whether the Google login button is shown. */
74
80
  this.allowGoogle = input(true, ...(ngDevMode ? [{ debugName: "allowGoogle" }] : /* istanbul ignore next */ []));
75
81
  this.oauthReady = signal(false, ...(ngDevMode ? [{ debugName: "oauthReady" }] : /* istanbul ignore next */ []));
76
82
  this.oauthMicrosoftReady = signal(false, ...(ngDevMode ? [{ debugName: "oauthMicrosoftReady" }] : /* istanbul ignore next */ []));
77
83
  this.oauthGoogleReady = signal(false, ...(ngDevMode ? [{ debugName: "oauthGoogleReady" }] : /* istanbul ignore next */ []));
78
- }
79
- ngOnInit() {
80
84
  if (this.autoInitialize()) {
81
85
  this.initialize();
82
86
  }
@@ -91,8 +95,9 @@ class LoginOAuthComponent {
91
95
  });
92
96
  }
93
97
  /**
94
- * Initialize open authentication
95
- * Must be a public method
98
+ * Initialize OAuth providers (Microsoft MSAL and Google GSI).
99
+ * Safe to call multiple times — already-initialized providers are skipped.
100
+ * Must be public so the host component can trigger it manually when `autoInitialize` is false.
96
101
  */
97
102
  initialize() {
98
103
  if (this.oauthMicrosoftReady() && this.oauthGoogleReady()) {
@@ -134,8 +139,8 @@ class LoginOAuthComponent {
134
139
  }
135
140
  }
136
141
  /**
137
- * Perform login using MSAL
138
- */
142
+ * Trigger a Microsoft (MSAL) login popup and acquire an access token on success.
143
+ */
139
144
  loginMSAL() {
140
145
  // Clear any in-progress interaction flag that may have been left by a previous incomplete popup
141
146
  sessionStorage.removeItem('msal.interaction.status');
@@ -170,14 +175,14 @@ class LoginOAuthComponent {
170
175
  });
171
176
  }
172
177
  /**
173
- * Perform login using Google
174
- */
178
+ * Trigger the hidden Google GSI button to open the Google sign-in flow.
179
+ */
175
180
  loginGoogle() {
176
181
  // Use wrapper click to prevent Illegal invocation exception
177
182
  googleButtonWrapper.click();
178
183
  }
179
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoginOAuthComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
180
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: LoginOAuthComponent, isStandalone: true, selector: "login-oauth", inputs: { showInfo: { classPropertyName: "showInfo", publicName: "showInfo", isSignal: true, isRequired: false, transformFunction: null }, applicationName: { classPropertyName: "applicationName", publicName: "applicationName", isSignal: true, isRequired: false, transformFunction: null }, autoInitialize: { classPropertyName: "autoInitialize", publicName: "autoInitialize", isSignal: true, isRequired: false, transformFunction: null }, allowMicrosoft: { classPropertyName: "allowMicrosoft", publicName: "allowMicrosoft", isSignal: true, isRequired: false, transformFunction: null }, allowGoogle: { classPropertyName: "allowGoogle", publicName: "allowGoogle", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { success: "success" }, providers: [
184
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: LoginOAuthComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
185
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: LoginOAuthComponent, isStandalone: true, selector: "login-oauth", inputs: { showInfo: { classPropertyName: "showInfo", publicName: "showInfo", isSignal: true, isRequired: false, transformFunction: null }, applicationName: { classPropertyName: "applicationName", publicName: "applicationName", isSignal: true, isRequired: false, transformFunction: null }, autoInitialize: { classPropertyName: "autoInitialize", publicName: "autoInitialize", isSignal: true, isRequired: false, transformFunction: null }, allowMicrosoft: { classPropertyName: "allowMicrosoft", publicName: "allowMicrosoft", isSignal: true, isRequired: false, transformFunction: null }, allowGoogle: { classPropertyName: "allowGoogle", publicName: "allowGoogle", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { success: "success" }, providers: [
181
186
  {
182
187
  provide: MSAL_INSTANCE,
183
188
  deps: [EnvironmentService],
@@ -194,9 +199,9 @@ class LoginOAuthComponent {
194
199
  },
195
200
  MsalService,
196
201
  MsalBroadcastService
197
- ], ngImport: i0, template: "<div class=\"login-oauth\">\r\n @if(showInfo()) {\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n @if(applicationName()) {\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{applicationName()}} e dei servizi ad esso\r\n connessi.</p>\r\n }\r\n </div>\r\n }\r\n @if (allowMicrosoft()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginMSAL()\" [attr.aria-label]=\"'Effettua accesso'\"\r\n [disabled]=\"!oauthMicrosoftReady()\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n }\r\n @if (allowGoogle()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n [attr.aria-label]=\"'Effettua accesso'\" [disabled]=\"!oauthGoogleReady()\">\r\n Accedi con Google</button>\r\n </div>\r\n }\r\n</div>", styles: [".login-oauth{text-align:center}.login-oauth .button{padding:10px 0;width:100%}.login-oauth .message{padding:0 0 10px!important;font-size:small}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
202
+ ], ngImport: i0, template: "<div class=\"login-oauth\">\r\n @if(showInfo()) {\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n @if(applicationName()) {\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{applicationName()}} e dei servizi ad esso\r\n connessi.</p>\r\n }\r\n </div>\r\n }\r\n @if (allowMicrosoft()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginMSAL()\" aria-label=\"Effettua accesso\"\r\n [disabled]=\"!oauthMicrosoftReady()\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n }\r\n @if (allowGoogle()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n aria-label=\"Effettua accesso\" [disabled]=\"!oauthGoogleReady()\">\r\n Accedi con Google</button>\r\n </div>\r\n }\r\n</div>\r\n", styles: [".login-oauth{text-align:center}.login-oauth .button{padding:10px 0;width:100%}.login-oauth .message{padding:0 0 10px!important;font-size:small}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
198
203
  }
199
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoginOAuthComponent, decorators: [{
204
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: LoginOAuthComponent, decorators: [{
200
205
  type: Component,
201
206
  args: [{ selector: 'login-oauth', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
202
207
  {
@@ -217,8 +222,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
217
222
  MsalBroadcastService
218
223
  ], imports: [
219
224
  MatButtonModule
220
- ], template: "<div class=\"login-oauth\">\r\n @if(showInfo()) {\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n @if(applicationName()) {\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{applicationName()}} e dei servizi ad esso\r\n connessi.</p>\r\n }\r\n </div>\r\n }\r\n @if (allowMicrosoft()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginMSAL()\" [attr.aria-label]=\"'Effettua accesso'\"\r\n [disabled]=\"!oauthMicrosoftReady()\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n }\r\n @if (allowGoogle()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n [attr.aria-label]=\"'Effettua accesso'\" [disabled]=\"!oauthGoogleReady()\">\r\n Accedi con Google</button>\r\n </div>\r\n }\r\n</div>", styles: [".login-oauth{text-align:center}.login-oauth .button{padding:10px 0;width:100%}.login-oauth .message{padding:0 0 10px!important;font-size:small}\n"] }]
221
- }], propDecorators: { success: [{ type: i0.Output, args: ["success"] }], showInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "showInfo", required: false }] }], applicationName: [{ type: i0.Input, args: [{ isSignal: true, alias: "applicationName", required: false }] }], autoInitialize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoInitialize", required: false }] }], allowMicrosoft: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowMicrosoft", required: false }] }], allowGoogle: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowGoogle", required: false }] }] } });
225
+ ], template: "<div class=\"login-oauth\">\r\n @if(showInfo()) {\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n @if(applicationName()) {\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{applicationName()}} e dei servizi ad esso\r\n connessi.</p>\r\n }\r\n </div>\r\n }\r\n @if (allowMicrosoft()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginMSAL()\" aria-label=\"Effettua accesso\"\r\n [disabled]=\"!oauthMicrosoftReady()\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n }\r\n @if (allowGoogle()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n aria-label=\"Effettua accesso\" [disabled]=\"!oauthGoogleReady()\">\r\n Accedi con Google</button>\r\n </div>\r\n }\r\n</div>\r\n", styles: [".login-oauth{text-align:center}.login-oauth .button{padding:10px 0;width:100%}.login-oauth .message{padding:0 0 10px!important;font-size:small}\n"] }]
226
+ }], ctorParameters: () => [], propDecorators: { success: [{ type: i0.Output, args: ["success"] }], showInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "showInfo", required: false }] }], applicationName: [{ type: i0.Input, args: [{ isSignal: true, alias: "applicationName", required: false }] }], autoInitialize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoInitialize", required: false }] }], allowMicrosoft: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowMicrosoft", required: false }] }], allowGoogle: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowGoogle", required: false }] }] } });
222
227
  const createFakeGoogleWrapper = () => {
223
228
  const googleLoginWrapper = document.createElement("div");
224
229
  // Or you can simple hide it in CSS rule for custom-google-button
@@ -245,20 +250,19 @@ var googleButtonWrapper;
245
250
 
246
251
  class LoginOAuthOkMSComponent {
247
252
  constructor() {
248
- this.message = input("Accesso in corso...", ...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
249
- }
250
- ngOnInit() {
253
+ /** Message displayed while the popup is completing authentication. */
254
+ this.message = input('Accesso in corso...', ...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
251
255
  // MSAL v5 popup flow: parse the auth response from the URL and send
252
256
  // it back to the opener window via BroadcastChannel, then close the popup.
253
257
  broadcastResponseToMainFrame();
254
258
  }
255
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoginOAuthOkMSComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
256
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: LoginOAuthOkMSComponent, isStandalone: true, selector: "app-login-oauth-ok-ms", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\r\n <div class=\"login-auto fade-in\">\r\n <div class=\"message\">\r\n Autenticazione in corso...\r\n </div>\r\n <mat-progress-bar mode=\"indeterminate\" color=\"primary\"></mat-progress-bar>\r\n </div>\r\n</div>\r\n", styles: [".login-auto{padding:20px 0}.login-auto .message{font-size:large;font-weight:700;color:var(--ars-color-primary);max-width:300px;text-align:center;width:100%;padding:40px 0}\n"], dependencies: [{ kind: "ngmodule", type: FlexModule }, { kind: "directive", type: i1$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i1$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i1$1.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i2.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
259
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: LoginOAuthOkMSComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
260
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.10", type: LoginOAuthOkMSComponent, isStandalone: true, selector: "app-login-oauth-ok-ms", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\r\n <div class=\"login-auto fade-in\">\r\n <div class=\"message\">\r\n Autenticazione in corso...\r\n </div>\r\n <mat-progress-bar mode=\"indeterminate\" color=\"primary\"></mat-progress-bar>\r\n </div>\r\n</div>\r\n", styles: [".login-auto{padding:20px 0}.login-auto .message{font-size:large;font-weight:700;color:var(--ars-color-primary);max-width:300px;text-align:center;width:100%;padding:40px 0}\n"], dependencies: [{ kind: "ngmodule", type: FlexModule }, { kind: "directive", type: i1$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i1$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i1$1.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i2.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
257
261
  }
258
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoginOAuthOkMSComponent, decorators: [{
262
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: LoginOAuthOkMSComponent, decorators: [{
259
263
  type: Component,
260
264
  args: [{ selector: 'app-login-oauth-ok-ms', changeDetection: ChangeDetectionStrategy.OnPush, imports: [FlexModule, MatProgressBarModule], template: "<div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\r\n <div class=\"login-auto fade-in\">\r\n <div class=\"message\">\r\n Autenticazione in corso...\r\n </div>\r\n <mat-progress-bar mode=\"indeterminate\" color=\"primary\"></mat-progress-bar>\r\n </div>\r\n</div>\r\n", styles: [".login-auto{padding:20px 0}.login-auto .message{font-size:large;font-weight:700;color:var(--ars-color-primary);max-width:300px;text-align:center;width:100%;padding:40px 0}\n"] }]
261
- }], propDecorators: { message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }] } });
265
+ }], ctorParameters: () => [], propDecorators: { message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }] } });
262
266
 
263
267
  /*
264
268
  * Public API Surface of ars-utils
@@ -1 +1 @@
1
- {"version":3,"file":"arsedizioni-ars-utils-ui.oauth.mjs","sources":["../../../projects/ars-utils/ui.oauth/ui/definitions.ts","../../../projects/ars-utils/ui.oauth/ui/ui.module.ts","../../../projects/ars-utils/ui.oauth/ui/components/login/login-oauth.component.ts","../../../projects/ars-utils/ui.oauth/ui/components/login/login-oauth.component.html","../../../projects/ars-utils/ui.oauth/ui/components/login-ok/ms/login-oauth-ok-ms.component.ts","../../../projects/ars-utils/ui.oauth/ui/components/login-ok/ms/login-oauth-ok-ms.component.html","../../../projects/ars-utils/ui.oauth/public_api.ts","../../../projects/ars-utils/ui.oauth/arsedizioni-ars-utils-ui.oauth.ts"],"sourcesContent":["export enum LoginOAuthType {\r\n None = 0,\r\n Microsoft = 1,\r\n Google = 2\r\n}\r\n\r\nexport interface LoginOAuthResult {\r\n type: number,\r\n token: string\r\n}","import { NgModule } from \"@angular/core\";\r\n\r\n\r\n@NgModule()\r\nexport class ArsUIOAuthModule { }\r\n\r\nexport * from \"./definitions\";\r\n\r\n\r\n","import { ChangeDetectionStrategy, Component, DestroyRef, NgZone, OnInit, inject, input, output, signal } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { EnvironmentService } from '@arsedizioni/ars-utils/core';\r\nimport { DialogService } from '@arsedizioni/ars-utils/ui';\r\nimport { MSAL_GUARD_CONFIG, MSAL_INSTANCE, MSAL_INTERCEPTOR_CONFIG, MsalBroadcastService, MsalGuardConfiguration, MsalInterceptorConfiguration, MsalService } from '@azure/msal-angular';\r\nimport { AuthenticationResult, BrowserCacheLocation, EventMessage, EventType, IPublicClientApplication, InteractionType, PublicClientApplication } from '@azure/msal-browser';\r\nimport { filter } from 'rxjs';\r\nimport { LoginOAuthResult } from '../../definitions';\r\n\r\nexport function MSALInstanceFactory(environment: EnvironmentService): IPublicClientApplication {\r\n return new PublicClientApplication({\r\n auth: {\r\n clientId: \"6b2c080f-6ab0-4511-a9df-0bce69db5833\",\r\n authority: \"https://login.microsoftonline.com/common\",\r\n redirectUri: environment.appLoginRedirectUri,\r\n },\r\n cache: {\r\n cacheLocation: BrowserCacheLocation.LocalStorage\r\n }\r\n });\r\n}\r\n\r\nexport function MSALInterceptorConfigFactory(environment: EnvironmentService): MsalInterceptorConfiguration {\r\n\r\n return {\r\n interactionType: InteractionType.Popup,\r\n protectedResourceMap: new Map([\r\n [environment.appServiceLoginUri, [\"api://6b2c080f-6ab0-4511-a9df-0bce69db5833/AngularSPAAuthScope\"]],\r\n [\"https://graph.microsoft.com/v2.0/me\", [\"user.read\"]],\r\n ])\r\n };\r\n}\r\n\r\nexport function MSALGuardConfigFactory(): MsalGuardConfiguration {\r\n return {\r\n interactionType: InteractionType.Popup,\r\n authRequest: {\r\n scopes: [\"user.read\"]\r\n }\r\n };\r\n}\r\n\r\n@Component({\r\n selector: 'login-oauth',\r\n templateUrl: './login-oauth.component.html',\r\n styleUrls: ['./login-oauth.component.scss'],\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [\r\n {\r\n provide: MSAL_INSTANCE,\r\n deps: [EnvironmentService],\r\n useFactory: MSALInstanceFactory\r\n },\r\n {\r\n provide: MSAL_GUARD_CONFIG,\r\n useFactory: MSALGuardConfigFactory\r\n },\r\n {\r\n provide: MSAL_INTERCEPTOR_CONFIG,\r\n deps: [EnvironmentService],\r\n useFactory: MSALInterceptorConfigFactory\r\n },\r\n MsalService,\r\n MsalBroadcastService],\r\n imports: [\r\n MatButtonModule\r\n ]\r\n})\r\nexport class LoginOAuthComponent implements OnInit {\r\n private readonly destroyRef = inject(DestroyRef);\r\n private msalBroadcastService = inject(MsalBroadcastService);\r\n private msaLService = inject(MsalService);\r\n private dialogService = inject(DialogService);\r\n private ngZone = inject(NgZone);\r\n readonly success = output<LoginOAuthResult>();\r\n readonly showInfo = input<boolean>(true);\r\n readonly applicationName = input<string>();\r\n readonly autoInitialize = input<boolean>(false);\r\n readonly allowMicrosoft = input<boolean>(true);\r\n readonly allowGoogle = input<boolean>(true);\r\n protected oauthReady = signal<boolean>(false);\r\n protected oauthMicrosoftReady = signal<boolean>(false);\r\n protected oauthGoogleReady = signal<boolean>(false);\r\n\r\n\r\n ngOnInit() {\r\n if (this.autoInitialize()) {\r\n this.initialize();\r\n }\r\n this.msalBroadcastService.msalSubject$\r\n .pipe(\r\n filter((msg: EventMessage) =>\r\n msg.eventType === EventType.LOGOUT_FAILURE ||\r\n msg.eventType === EventType.ACQUIRE_TOKEN_FAILURE),\r\n takeUntilDestroyed(this.destroyRef),\r\n )\r\n .subscribe((r: EventMessage) => {\r\n if (r?.payload) {\r\n const error = r.payload as any;\r\n this.dialogService.error(error?.message ?? 'Errore di autenticazione Microsoft');\r\n }\r\n });\r\n\r\n }\r\n\r\n /**\r\n * Initialize open authentication \r\n * Must be a public method \r\n */\r\n initialize() {\r\n if (this.oauthMicrosoftReady() && this.oauthGoogleReady()) {\r\n return; // Both already loaded\r\n }\r\n this.oauthReady.set(true);\r\n\r\n // Load MS stack only if not already initialized\r\n if (!this.oauthMicrosoftReady()) {\r\n this.msaLService.initialize()\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe(() => {\r\n this.oauthMicrosoftReady.set(true);\r\n });\r\n }\r\n\r\n // Load Google script only if not already initialized\r\n if (!this.oauthGoogleReady()) {\r\n const DSLScript = document.createElement('script');\r\n DSLScript.src = 'https://accounts.google.com/gsi/client';\r\n DSLScript.type = 'text/javascript';\r\n document.body.appendChild(DSLScript);\r\n document.body.removeChild(DSLScript);\r\n\r\n // @ts-ignore\r\n window.onGoogleLibraryLoad = () => {\r\n // initialize google account\r\n // @ts-ignore\r\n google.accounts.id.initialize({\r\n client_id: '71204983077-ag31h3bgt2udcbfr9nn84r9rni2k3snp.apps.googleusercontent.com',\r\n cancel_on_tap_outside: true,\r\n auto_select: false,\r\n callback: (r: any) => {\r\n this.ngZone.run(() => {\r\n this.success.emit({ type: 2, token: r.credential });\r\n });\r\n }\r\n });\r\n\r\n googleButtonWrapper = createFakeGoogleWrapper();\r\n\r\n this.oauthGoogleReady.set(true);\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Perform login using MSAL\r\n */\r\n protected loginMSAL() {\r\n // Clear any in-progress interaction flag that may have been left by a previous incomplete popup\r\n sessionStorage.removeItem('msal.interaction.status');\r\n\r\n this.msaLService.loginPopup()\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe({\r\n next: (r: AuthenticationResult) => {\r\n try {\r\n this.msaLService.instance.setActiveAccount(r.account);\r\n this.msaLService.acquireTokenSilent({\r\n scopes: [\r\n \"api://6b2c080f-6ab0-4511-a9df-0bce69db5833/AngularSPAAuthScope\"\r\n ],\r\n account: r.account\r\n }).subscribe({\r\n next: (tokenResult: AuthenticationResult) => {\r\n console.log(\"Token acquired!\");\r\n this.success.emit({ type: 1, token: tokenResult.accessToken });\r\n },\r\n error: (error: any) => {\r\n this.dialogService.error(error.message);\r\n }\r\n });\r\n } catch (error: any) {\r\n this.dialogService.error(error.message);\r\n }\r\n },\r\n error: (error: any) => {\r\n this.dialogService.error(error.message);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n* Perform login using Google\r\n*/\r\n protected loginGoogle() {\r\n // Use wrapper click to prevent Illegal invocation exception\r\n googleButtonWrapper.click();\r\n }\r\n}\r\n\r\nconst createFakeGoogleWrapper = () => {\r\n const googleLoginWrapper = document.createElement(\"div\");\r\n // Or you can simple hide it in CSS rule for custom-google-button\r\n googleLoginWrapper.style.display = \"none\";\r\n googleLoginWrapper.classList.add(\"custom-google-button\");\r\n\r\n // Add the wrapper to body\r\n document.body.appendChild(googleLoginWrapper);\r\n\r\n // Use GSI javascript api to render the button inside our wrapper\r\n // You can ignore the properties because this button will not appear\r\n // @ts-ignore\r\n window.google.accounts.id.renderButton(googleLoginWrapper, {\r\n type: \"icon\",\r\n width: \"200\",\r\n });\r\n\r\n const googleLoginWrapperButton =\r\n googleLoginWrapper.querySelector(\"div[role=button]\");\r\n\r\n return {\r\n click: () => {\r\n // @ts-ignore\r\n googleLoginWrapperButton.click();\r\n },\r\n };\r\n};\r\nvar googleButtonWrapper: any;\r\n\r\n","<div class=\"login-oauth\">\r\n @if(showInfo()) {\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n @if(applicationName()) {\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{applicationName()}} e dei servizi ad esso\r\n connessi.</p>\r\n }\r\n </div>\r\n }\r\n @if (allowMicrosoft()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginMSAL()\" [attr.aria-label]=\"'Effettua accesso'\"\r\n [disabled]=\"!oauthMicrosoftReady()\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n }\r\n @if (allowGoogle()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n [attr.aria-label]=\"'Effettua accesso'\" [disabled]=\"!oauthGoogleReady()\">\r\n Accedi con Google</button>\r\n </div>\r\n }\r\n</div>","import { ChangeDetectionStrategy, Component, OnInit, input } from '@angular/core';\r\nimport { broadcastResponseToMainFrame } from '@azure/msal-browser/redirect-bridge';\r\nimport { FlexModule } from '@ngbracket/ngx-layout/flex';\r\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\r\n\r\n\r\n@Component({\r\n selector: 'app-login-oauth-ok-ms',\r\n styleUrls: ['./login-oauth-ok-ms.component.scss'],\r\n templateUrl: './login-oauth-ok-ms.component.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [FlexModule, MatProgressBarModule]\r\n})\r\nexport class LoginOAuthOkMSComponent implements OnInit {\r\n\r\n readonly message = input<string>(\"Accesso in corso...\");\r\n\r\n ngOnInit() {\r\n // MSAL v5 popup flow: parse the auth response from the URL and send\r\n // it back to the opener window via BroadcastChannel, then close the popup.\r\n broadcastResponseToMainFrame();\r\n }\r\n}\r\n","<div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\r\n <div class=\"login-auto fade-in\">\r\n <div class=\"message\">\r\n Autenticazione in corso...\r\n </div>\r\n <mat-progress-bar mode=\"indeterminate\" color=\"primary\"></mat-progress-bar>\r\n </div>\r\n</div>\r\n","/*\r\n * Public API Surface of ars-utils\r\n */\r\nexport * from './ui/ui.module';\r\nexport * from './ui/components/login/login-oauth.component';\r\nexport * from './ui/components/login-ok/ms/login-oauth-ok-ms.component';\r\n\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,cAAc,EAAA;AACxB,IAAA,cAAA,CAAA,cAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ;AACR,IAAA,cAAA,CAAA,cAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAa;AACb,IAAA,cAAA,CAAA,cAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAU;AACZ,CAAC,EAJW,cAAc,KAAd,cAAc,GAAA,EAAA,CAAA,CAAA;;MCIb,gBAAgB,CAAA;8GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAhB,gBAAgB,EAAA,CAAA,CAAA;+GAAhB,gBAAgB,EAAA,CAAA,CAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAD5B;;;ACOK,SAAU,mBAAmB,CAAC,WAA+B,EAAA;IACjE,OAAO,IAAI,uBAAuB,CAAC;AACjC,QAAA,IAAI,EAAE;AACJ,YAAA,QAAQ,EAAE,sCAAsC;AAChD,YAAA,SAAS,EAAE,0CAA0C;YACrD,WAAW,EAAE,WAAW,CAAC,mBAAmB;AAC7C,SAAA;AACD,QAAA,KAAK,EAAE;YACL,aAAa,EAAE,oBAAoB,CAAC;AACrC;AACF,KAAA,CAAC;AACJ;AAEM,SAAU,4BAA4B,C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,OAAA,EAAA,aAAA,EAAA,MAAA,CAAA,EAAA,OAAA,EAAA,CAAA,cAAA,CAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAEjC,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAPnC,SAAS;+BACI,uBAAuB,EAAA,eAAA,EAGhB,uBAAuB,CAAC,MAAM,WACtC,CAAC,UAAU,EAAE,oBAAoB,CAAC,EAAA,QAAA,EAAA,2SAAA,EAAA,MAAA,EAAA,CAAA,+KAAA,CAAA,EAAA;;;AEX/C;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"arsedizioni-ars-utils-ui.oauth.mjs","sources":["../../../projects/ars-utils/ui.oauth/ui/definitions.ts","../../../projects/ars-utils/ui.oauth/ui/ui.module.ts","../../../projects/ars-utils/ui.oauth/ui/components/login/login-oauth.component.ts","../../../projects/ars-utils/ui.oauth/ui/components/login/login-oauth.component.html","../../../projects/ars-utils/ui.oauth/ui/components/login-ok/ms/login-oauth-ok-ms.component.ts","../../../projects/ars-utils/ui.oauth/ui/components/login-ok/ms/login-oauth-ok-ms.component.html","../../../projects/ars-utils/ui.oauth/public_api.ts","../../../projects/ars-utils/ui.oauth/arsedizioni-ars-utils-ui.oauth.ts"],"sourcesContent":["export enum LoginOAuthType {\r\n None = 0,\r\n Microsoft = 1,\r\n Google = 2\r\n}\r\n\r\nexport interface LoginOAuthResult {\r\n type: number,\r\n token: string\r\n}","import { NgModule } from \"@angular/core\";\r\n\r\n\r\n@NgModule()\r\nexport class ArsUIOAuthModule { }\r\n\r\nexport * from \"./definitions\";\r\n\r\n\r\n","import { ChangeDetectionStrategy, Component, DestroyRef, NgZone, inject, input, output, signal } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { EnvironmentService } from '@arsedizioni/ars-utils/core';\r\nimport { DialogService } from '@arsedizioni/ars-utils/ui';\r\nimport { MSAL_GUARD_CONFIG, MSAL_INSTANCE, MSAL_INTERCEPTOR_CONFIG, MsalBroadcastService, MsalGuardConfiguration, MsalInterceptorConfiguration, MsalService } from '@azure/msal-angular';\r\nimport { AuthenticationResult, BrowserCacheLocation, EventMessage, EventType, IPublicClientApplication, InteractionType, PublicClientApplication } from '@azure/msal-browser';\r\nimport { filter } from 'rxjs';\r\nimport { LoginOAuthResult } from '../../definitions';\r\n\r\nexport function MSALInstanceFactory(environment: EnvironmentService): IPublicClientApplication {\r\n return new PublicClientApplication({\r\n auth: {\r\n clientId: \"6b2c080f-6ab0-4511-a9df-0bce69db5833\",\r\n authority: \"https://login.microsoftonline.com/common\",\r\n redirectUri: environment.appLoginRedirectUri,\r\n },\r\n cache: {\r\n cacheLocation: BrowserCacheLocation.LocalStorage\r\n }\r\n });\r\n}\r\n\r\nexport function MSALInterceptorConfigFactory(environment: EnvironmentService): MsalInterceptorConfiguration {\r\n\r\n return {\r\n interactionType: InteractionType.Popup,\r\n protectedResourceMap: new Map([\r\n [environment.appServiceLoginUri, [\"api://6b2c080f-6ab0-4511-a9df-0bce69db5833/AngularSPAAuthScope\"]],\r\n [\"https://graph.microsoft.com/v2.0/me\", [\"user.read\"]],\r\n ])\r\n };\r\n}\r\n\r\nexport function MSALGuardConfigFactory(): MsalGuardConfiguration {\r\n return {\r\n interactionType: InteractionType.Popup,\r\n authRequest: {\r\n scopes: [\"user.read\"]\r\n }\r\n };\r\n}\r\n\r\n@Component({\r\n selector: 'login-oauth',\r\n templateUrl: './login-oauth.component.html',\r\n styleUrls: ['./login-oauth.component.scss'],\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [\r\n {\r\n provide: MSAL_INSTANCE,\r\n deps: [EnvironmentService],\r\n useFactory: MSALInstanceFactory\r\n },\r\n {\r\n provide: MSAL_GUARD_CONFIG,\r\n useFactory: MSALGuardConfigFactory\r\n },\r\n {\r\n provide: MSAL_INTERCEPTOR_CONFIG,\r\n deps: [EnvironmentService],\r\n useFactory: MSALInterceptorConfigFactory\r\n },\r\n MsalService,\r\n MsalBroadcastService],\r\n imports: [\r\n MatButtonModule\r\n ]\r\n})\r\nexport class LoginOAuthComponent {\r\n private readonly destroyRef = inject(DestroyRef);\r\n private readonly msalBroadcastService = inject(MsalBroadcastService);\r\n private readonly msaLService = inject(MsalService);\r\n private readonly dialogService = inject(DialogService);\r\n private readonly ngZone = inject(NgZone);\r\n /** Emitted when OAuth authentication succeeds. */\r\n readonly success = output<LoginOAuthResult>();\r\n /** Whether to show the introductory info panel. */\r\n readonly showInfo = input<boolean>(true);\r\n /** Application name displayed in the info panel. */\r\n readonly applicationName = input<string>();\r\n /** Whether to trigger `initialize()` automatically on mount. */\r\n readonly autoInitialize = input<boolean>(false);\r\n /** Whether the Microsoft login button is shown. */\r\n readonly allowMicrosoft = input<boolean>(true);\r\n /** Whether the Google login button is shown. */\r\n readonly allowGoogle = input<boolean>(true);\r\n protected readonly oauthReady = signal<boolean>(false);\r\n protected readonly oauthMicrosoftReady = signal<boolean>(false);\r\n protected readonly oauthGoogleReady = signal<boolean>(false);\r\n\r\n constructor() {\r\n if (this.autoInitialize()) {\r\n this.initialize();\r\n }\r\n this.msalBroadcastService.msalSubject$\r\n .pipe(\r\n filter((msg: EventMessage) =>\r\n msg.eventType === EventType.LOGOUT_FAILURE ||\r\n msg.eventType === EventType.ACQUIRE_TOKEN_FAILURE),\r\n takeUntilDestroyed(this.destroyRef),\r\n )\r\n .subscribe((r: EventMessage) => {\r\n if (r?.payload) {\r\n const error = r.payload as any;\r\n this.dialogService.error(error?.message ?? 'Errore di autenticazione Microsoft');\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Initialize OAuth providers (Microsoft MSAL and Google GSI).\r\n * Safe to call multiple times — already-initialized providers are skipped.\r\n * Must be public so the host component can trigger it manually when `autoInitialize` is false.\r\n */\r\n initialize() {\r\n if (this.oauthMicrosoftReady() && this.oauthGoogleReady()) {\r\n return; // Both already loaded\r\n }\r\n this.oauthReady.set(true);\r\n\r\n // Load MS stack only if not already initialized\r\n if (!this.oauthMicrosoftReady()) {\r\n this.msaLService.initialize()\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe(() => {\r\n this.oauthMicrosoftReady.set(true);\r\n });\r\n }\r\n\r\n // Load Google script only if not already initialized\r\n if (!this.oauthGoogleReady()) {\r\n const DSLScript = document.createElement('script');\r\n DSLScript.src = 'https://accounts.google.com/gsi/client';\r\n DSLScript.type = 'text/javascript';\r\n document.body.appendChild(DSLScript);\r\n document.body.removeChild(DSLScript);\r\n\r\n // @ts-ignore\r\n window.onGoogleLibraryLoad = () => {\r\n // initialize google account\r\n // @ts-ignore\r\n google.accounts.id.initialize({\r\n client_id: '71204983077-ag31h3bgt2udcbfr9nn84r9rni2k3snp.apps.googleusercontent.com',\r\n cancel_on_tap_outside: true,\r\n auto_select: false,\r\n callback: (r: any) => {\r\n this.ngZone.run(() => {\r\n this.success.emit({ type: 2, token: r.credential });\r\n });\r\n }\r\n });\r\n\r\n googleButtonWrapper = createFakeGoogleWrapper();\r\n\r\n this.oauthGoogleReady.set(true);\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Trigger a Microsoft (MSAL) login popup and acquire an access token on success.\r\n */\r\n protected loginMSAL() {\r\n // Clear any in-progress interaction flag that may have been left by a previous incomplete popup\r\n sessionStorage.removeItem('msal.interaction.status');\r\n\r\n this.msaLService.loginPopup()\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe({\r\n next: (r: AuthenticationResult) => {\r\n try {\r\n this.msaLService.instance.setActiveAccount(r.account);\r\n this.msaLService.acquireTokenSilent({\r\n scopes: [\r\n \"api://6b2c080f-6ab0-4511-a9df-0bce69db5833/AngularSPAAuthScope\"\r\n ],\r\n account: r.account\r\n }).subscribe({\r\n next: (tokenResult: AuthenticationResult) => {\r\n console.log(\"Token acquired!\");\r\n this.success.emit({ type: 1, token: tokenResult.accessToken });\r\n },\r\n error: (error: any) => {\r\n this.dialogService.error(error.message);\r\n }\r\n });\r\n } catch (error: any) {\r\n this.dialogService.error(error.message);\r\n }\r\n },\r\n error: (error: any) => {\r\n this.dialogService.error(error.message);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Trigger the hidden Google GSI button to open the Google sign-in flow.\r\n */\r\n protected loginGoogle() {\r\n // Use wrapper click to prevent Illegal invocation exception\r\n googleButtonWrapper.click();\r\n }\r\n}\r\n\r\nconst createFakeGoogleWrapper = () => {\r\n const googleLoginWrapper = document.createElement(\"div\");\r\n // Or you can simple hide it in CSS rule for custom-google-button\r\n googleLoginWrapper.style.display = \"none\";\r\n googleLoginWrapper.classList.add(\"custom-google-button\");\r\n\r\n // Add the wrapper to body\r\n document.body.appendChild(googleLoginWrapper);\r\n\r\n // Use GSI javascript api to render the button inside our wrapper\r\n // You can ignore the properties because this button will not appear\r\n // @ts-ignore\r\n window.google.accounts.id.renderButton(googleLoginWrapper, {\r\n type: \"icon\",\r\n width: \"200\",\r\n });\r\n\r\n const googleLoginWrapperButton =\r\n googleLoginWrapper.querySelector(\"div[role=button]\");\r\n\r\n return {\r\n click: () => {\r\n // @ts-ignore\r\n googleLoginWrapperButton.click();\r\n },\r\n };\r\n};\r\nvar googleButtonWrapper: any;\r\n\r\n","<div class=\"login-oauth\">\r\n @if(showInfo()) {\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n @if(applicationName()) {\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{applicationName()}} e dei servizi ad esso\r\n connessi.</p>\r\n }\r\n </div>\r\n }\r\n @if (allowMicrosoft()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginMSAL()\" aria-label=\"Effettua accesso\"\r\n [disabled]=\"!oauthMicrosoftReady()\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n }\r\n @if (allowGoogle()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n aria-label=\"Effettua accesso\" [disabled]=\"!oauthGoogleReady()\">\r\n Accedi con Google</button>\r\n </div>\r\n }\r\n</div>\r\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\nimport { broadcastResponseToMainFrame } from '@azure/msal-browser/redirect-bridge';\r\nimport { FlexModule } from '@ngbracket/ngx-layout/flex';\r\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\r\n\r\n\r\n@Component({\r\n selector: 'app-login-oauth-ok-ms',\r\n styleUrls: ['./login-oauth-ok-ms.component.scss'],\r\n templateUrl: './login-oauth-ok-ms.component.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [FlexModule, MatProgressBarModule]\r\n})\r\nexport class LoginOAuthOkMSComponent {\r\n\r\n /** Message displayed while the popup is completing authentication. */\r\n readonly message = input<string>('Accesso in corso...');\r\n\r\n constructor() {\r\n // MSAL v5 popup flow: parse the auth response from the URL and send\r\n // it back to the opener window via BroadcastChannel, then close the popup.\r\n broadcastResponseToMainFrame();\r\n }\r\n}\r\n","<div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\r\n <div class=\"login-auto fade-in\">\r\n <div class=\"message\">\r\n Autenticazione in corso...\r\n </div>\r\n <mat-progress-bar mode=\"indeterminate\" color=\"primary\"></mat-progress-bar>\r\n </div>\r\n</div>\r\n","/*\r\n * Public API Surface of ars-utils\r\n */\r\nexport * from './ui/ui.module';\r\nexport * from './ui/components/index';\r\n\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,cAAc,EAAA;AACxB,IAAA,cAAA,CAAA,cAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ;AACR,IAAA,cAAA,CAAA,cAAA,CAAA,WAAA,CAAA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"21.2.221",
4
4
  "author": {
5
5
  "email": "software@arsedizioni.it",
6
6
  "name": "Fabio Buscaroli, Alberto Doria"
@@ -168,15 +168,15 @@ declare class ClipperChannelSettings {
168
168
  sectors: ClipperChannelSettingsItem<string>[];
169
169
  regions: ClipperChannelSettingsItem<string>[];
170
170
  /**
171
- * Check at least one of sector values is contained in sectors list
172
- * @param values : the admitted values
173
- * @returns true if at least one value has been found
171
+ * Returns `true` when the channel is active and at least one of the given sector codes
172
+ * matches a sector assigned to this channel.
173
+ * @param values - Array of sector code strings to test against.
174
174
  */
175
175
  hasAnyOfSectors(values: string[]): boolean;
176
176
  /**
177
- * Check at least one of region values is contained in regions list
178
- * @param values : the admitted values
179
- * @returns true if at least one value has been found
177
+ * Returns `true` when the channel is active and at least one of the given region codes
178
+ * matches a region assigned to this channel.
179
+ * @param values - Array of region code strings to test against.
180
180
  */
181
181
  hasAnyOfRegions(values: string[]): boolean;
182
182
  }
@@ -663,24 +663,25 @@ declare class ClipperDashboard {
663
663
  unreadItems: Signal<[ClipperModule, number][]>;
664
664
  unreadItemsByModel: Signal<[ClipperModel, number][]>;
665
665
  /**
666
- * Update unread items
667
- * @param module : the module
668
- * @param model : the optional model
669
- * @param increment : the increment (can be negative)
666
+ * Increments (or decrements) the unread item counter for the given module or model.
667
+ * Triggers a signal update so computed values and templates react to the change.
668
+ * @param module - The `ClipperModule` whose counter should be adjusted.
669
+ * @param model - Optional `ClipperModel` for sub-module granularity.
670
+ * @param increment - Amount to add (use a negative value to decrement).
670
671
  */
671
672
  updateUnreadItems(module: ClipperModule, model: ClipperModel | undefined, increment: number): void;
672
- /***
673
- * Get the module unread items
674
- * @param module: the module
675
- * @param model : the optional model
676
- * @returns the module unread items
673
+ /**
674
+ * Returns the unread-item count for the given module, or for a specific model within it.
675
+ * @param module - The `ClipperModule` to query.
676
+ * @param model - Optional `ClipperModel` for sub-module granularity.
677
+ * @returns Number of unread items, or `0` when none are found.
677
678
  */
678
679
  getUnreadItems(module: ClipperModule, model?: ClipperModel): number;
679
680
  /**
680
- * Return total unread items
681
- * @returns : the total unread items
681
+ * Returns the sum of unread items across all tracked modules.
682
+ * @returns Total unread-item count.
682
683
  */
683
- gatTotalUnreadItems(): number;
684
+ getTotalUnreadItems(): number;
684
685
  }
685
686
  interface ClipperDayItem {
686
687
  day: string;
@@ -987,95 +988,120 @@ interface ClipperArchiveFilesDeleteParams {
987
988
  }
988
989
  declare class ClipperUtils {
989
990
  /**
990
- * Check if a model is readable
991
- * @param model : the model to check
992
- * @returns : true if the model is readable
991
+ * Returns `true` when the given model corresponds to a readable document type
992
+ * (i.e., can be opened in the document viewer).
993
+ * @param model - The `ClipperModel` to test.
993
994
  */
994
995
  static isClipperModelReadable(model: ClipperModel): boolean;
995
996
  /**
996
- * Return the Clipper module from a document
997
- * @param item: the documenti item
998
- * @returns the module id
997
+ * Returns the `ClipperModule` that owns the given document, derived from its model type.
998
+ * @param item - The document info object to inspect.
999
+ * @returns The matching `ClipperModule`, or `undefined` when the model has no direct module mapping.
999
1000
  */
1000
1001
  static getClipperModuleFromModel(item: ClipperDocumentInfo): ClipperModule | undefined;
1001
1002
  /**
1002
- * Return the Clipper group name
1003
- * @param value: the group value
1004
- * @returns the group name
1003
+ * Returns the display name for the given `ClipperModuleGroup`.
1004
+ * @param value - The module group enum value to look up.
1005
+ * @returns The group display name, or an empty string when not found.
1005
1006
  */
1006
1007
  static getClipperModuleGroupName(value: ClipperModuleGroup): string;
1007
1008
  /**
1008
- * Return the list of modules of a group
1009
- * @param value: the module name
1010
- * @returns the list of modules
1009
+ * Returns the list of `ClipperModule` items belonging to the given module group.
1010
+ * @param value - The module group to filter by.
1011
+ * @returns Array of matching `NameValueItem` entries.
1011
1012
  */
1012
1013
  static getClipperModuleGroupItems(value: ClipperModuleGroup): NameValueItem<ClipperModule>[];
1013
1014
  /**
1014
- * Check modules against current selected in filter
1015
- * @param modules : the modules to check for
1016
- * @param mode : thc check mode: 1) exactly all elements 2) all elements 3) any of the elements specified
1017
- * @returns true if the check is successfull
1015
+ * Tests a set of modules against the currently selected modules in the search filter.
1016
+ * @param modules - The modules to test.
1017
+ * @param currentModules - The currently selected modules to check against.
1018
+ * @param mode - Matching strategy:
1019
+ * `1` = all and only the specified modules (exact set),
1020
+ * `2` = all specified modules must be present,
1021
+ * `3` = at least one specified module must be present.
1022
+ * @returns `true` when the condition defined by `mode` is satisfied.
1018
1023
  */
1019
1024
  private static checkModules;
1020
1025
  /**
1021
- * Return the list of available sort options for a list of modules
1022
- * @param modules : the modules list
1023
- * @returns the list of availbale sort options
1026
+ * Returns the sort options available for the given module selection.
1027
+ * Includes the relevance option only when the query contains free text.
1028
+ * @param modules - Currently selected modules (used to determine which date axes are available).
1029
+ * @param params - Current search params (checked for free-text content).
1030
+ * @returns Array of applicable `NameValueItem<ClipperSort>` sort options.
1024
1031
  */
1025
1032
  static getClipperAvailableSortOptions(modules?: NameValueItem<ClipperModule>[], params?: ClipperSearchParams): NameValueItem<ClipperSort>[];
1026
1033
  }
1027
1034
  declare class ClipperSearchUtils {
1028
1035
  /**
1029
- * Clear the search params object
1030
- * @param params : the search params to clear
1036
+ * Resets all filter fields of a `ClipperSearchParams` instance to their default (empty) values.
1037
+ * @param params - The search-params object to clear.
1031
1038
  */
1032
1039
  static clear(params: ClipperSearchParams): void;
1033
1040
  /**
1034
- * Get hte model list related to a list of modules
1035
- * @param modules: the modules to check
1036
- * @returns the list fo models
1041
+ * Returns the list of `ClipperModel` values that correspond to the given modules.
1042
+ * @param modules - The selected modules to map to their underlying data models.
1043
+ * @returns Array of `ClipperModel` values matching the provided modules.
1037
1044
  */
1038
1045
  static getModulesModels(modules?: NameValueItem<ClipperModule>[]): ClipperModel[];
1039
1046
  /**
1040
- * Check if current filter is a text based search
1041
- * @param params : the search params to check
1042
- * @returns true if is a text based search
1047
+ * Returns `true` when the search params contain a non-empty free-text query.
1048
+ * @param params - The search params to inspect.
1043
1049
  */
1044
1050
  static isTextQuery(params: ClipperSearchParams): boolean;
1045
1051
  /**
1046
- * Try to add a query
1047
- * @param q : the new query
1048
- * @param queries : the new query
1049
- */
1052
+ * Wraps `q` in quotes (if not already quoted) and appends it to `queries`.
1053
+ * @param q - A single search term to process.
1054
+ * @param queries - The accumulated query string to append to.
1055
+ * @returns The updated `queries` string.
1056
+ */
1050
1057
  private static concatTextQuery;
1051
1058
  /**
1052
- * Normalize text query
1053
- * @param text : the text query to normalize
1054
- * @returns : the text normalized or undefined
1059
+ * Normalises a comma-separated search string by wrapping each term in quotes.
1060
+ * @param text - The raw search input to normalise.
1061
+ * @returns The normalised query string, or `undefined` when `text` is empty.
1055
1062
  */
1056
1063
  static normalizeTextQuery(text: string): string | undefined;
1057
1064
  /**
1058
- * Normalize text query 2: adds quotes at the beginning and end of the text
1059
- * only if there are no quoted elements, no '+', and no ' -' (space followed by minus)
1060
- * @param text : the text to normalize
1061
- * @returns : the normalized text
1065
+ * Wraps the entire query in double quotes when it contains no boolean operators
1066
+ * (`"`, `+`, or ` -`), making it an exact-phrase search.
1067
+ * @param text - The query string to normalise.
1068
+ * @returns The normalised query string.
1062
1069
  */
1063
1070
  static normalizeTextQuery2(text: string): string;
1064
1071
  /**
1065
- * Return a rank number from a char value (A, B, C)
1066
- * @param value : the char value
1067
- * @returns the rank number (A = 0.71, B = 0.61, C = 0.51)
1072
+ * Maps a letter rank (`A`, `B`, or any other) to a numeric relevance threshold.
1073
+ * @param value - The single-character rank string.
1074
+ * @returns `0.751` for `'A'`, `0.71` for `'B'`, `0.51` for anything else.
1068
1075
  */
1069
1076
  static getRankFromChar(value: string): number;
1070
1077
  }
1071
1078
 
1072
1079
  declare const PropertiesColors: NameValueItem<string>[];
1073
1080
 
1081
+ /**
1082
+ * HTTP interceptor that attaches Clipper authentication headers to every request
1083
+ * targeting the Clipper service, and broadcasts user-friendly error messages
1084
+ * when the server returns an error response.
1085
+ */
1074
1086
  declare class ClipperAuthInterceptor implements HttpInterceptor {
1075
- private clipperService;
1076
- private broadcastService;
1087
+ private readonly clipperService;
1088
+ private readonly broadcastService;
1077
1089
  private lastErrorTime;
1078
- intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
1090
+ /**
1091
+ * Intercepts every outgoing HTTP request.
1092
+ * When the request targets the Clipper service URI, attaches credentials and
1093
+ * a client-ID header, then pipes the response through an error handler.
1094
+ * @param request - The outgoing HTTP request.
1095
+ * @param next - The next handler in the interceptor chain.
1096
+ * @returns An observable of the HTTP event stream.
1097
+ */
1098
+ intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
1099
+ /**
1100
+ * Processes an HTTP error, broadcasting a user-friendly message when appropriate.
1101
+ * Errors are debounced: only one message is sent per `ERROR_DEBOUNCE_MS` window.
1102
+ * @param error - The raw error value thrown by the HTTP layer.
1103
+ */
1104
+ private handleError;
1079
1105
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClipperAuthInterceptor, never>;
1080
1106
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ClipperAuthInterceptor>;
1081
1107
  }