@strivacity/sdk-angular 1.0.0 → 2.0.0-beta

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.
@@ -1,9 +1,114 @@
1
+ import { initFlow, FallbackError } from '@strivacity/sdk-core';
2
+ export * from '@strivacity/sdk-core';
3
+ export { SDKStorage } from '@strivacity/sdk-core';
4
+ export { HttpClient } from '@strivacity/sdk-core/utils/HttpClient';
1
5
  export { LocalStorage } from '@strivacity/sdk-core/storages/LocalStorage';
2
6
  export { SessionStorage } from '@strivacity/sdk-core/storages/SessionStorage';
3
7
  import * as i0 from '@angular/core';
4
- import { InjectionToken, Injectable, Inject, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
5
- import { BehaviorSubject, from } from 'rxjs';
6
- import { initFlow } from '@strivacity/sdk-core';
8
+ import { Injectable, ViewContainerRef, ViewChild, Input, Component, InjectionToken, Inject, EventEmitter, Output, CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
9
+ import { BehaviorSubject, from, Subscription } from 'rxjs';
10
+ import { unflattenObject } from '@strivacity/sdk-core/utils/object';
11
+
12
+ /**
13
+ * Service that manages Strivacity native widgets.
14
+ */
15
+ class StrivacityWidgetService {
16
+ loading$ = new BehaviorSubject(false);
17
+ forms$ = new BehaviorSubject({});
18
+ messages$ = new BehaviorSubject({});
19
+ state$ = new BehaviorSubject({});
20
+ triggerFallback;
21
+ submitForm;
22
+ setFormValue(formId, widgetId, value) {
23
+ const forms = { ...this.forms$.value };
24
+ forms[formId] = { ...(forms[formId] || {}), [widgetId]: value === '' ? null : value };
25
+ this.forms$.next(forms);
26
+ }
27
+ setMessage(formId, widgetId, value) {
28
+ const messages = { ...this.messages$.value };
29
+ messages[formId] = { ...(messages[formId] || {}), [widgetId]: value };
30
+ this.messages$.next(messages);
31
+ }
32
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: StrivacityWidgetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
33
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: StrivacityWidgetService, providedIn: 'root' });
34
+ }
35
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: StrivacityWidgetService, decorators: [{
36
+ type: Injectable,
37
+ args: [{
38
+ providedIn: 'root',
39
+ }]
40
+ }] });
41
+
42
+ class StyWidgetRenderer {
43
+ widgetService;
44
+ items = [];
45
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
46
+ widgets;
47
+ $containerRef;
48
+ constructor(widgetService) {
49
+ this.widgetService = widgetService;
50
+ }
51
+ ngOnChanges(changes) {
52
+ if (changes['items']) {
53
+ this.render();
54
+ }
55
+ }
56
+ render() {
57
+ this.$containerRef.clear();
58
+ if (!this.items) {
59
+ return;
60
+ }
61
+ for (const item of this.items) {
62
+ if (item.type === 'widget') {
63
+ const form = this.widgetService.state$.value.forms?.find((f) => f.id === item.formId);
64
+ const widget = form?.widgets.find((w) => w.id === item.widgetId);
65
+ const component = widget ? this.widgets[widget.type] : undefined;
66
+ if (!form || !widget || !component) {
67
+ this.widgetService.triggerFallback();
68
+ continue;
69
+ }
70
+ const componentRef = this.$containerRef.createComponent(component);
71
+ componentRef.setInput('formId', item.formId);
72
+ componentRef.setInput('config', widget);
73
+ componentRef.changeDetectorRef.detectChanges();
74
+ }
75
+ else if (item.type === 'vertical' || item.type === 'horizontal') {
76
+ const component = this.widgets.layout;
77
+ if (!component) {
78
+ this.widgetService.triggerFallback();
79
+ continue;
80
+ }
81
+ const widgetRendererRef = this.$containerRef.createComponent(StyWidgetRenderer);
82
+ widgetRendererRef.setInput('items', item.items);
83
+ widgetRendererRef.setInput('widgets', this.widgets);
84
+ widgetRendererRef.changeDetectorRef.detectChanges();
85
+ const layoutRef = this.$containerRef.createComponent(component, {
86
+ projectableNodes: [[widgetRendererRef.location.nativeElement]],
87
+ });
88
+ layoutRef.setInput('formId', item.items[0]?.formId);
89
+ layoutRef.setInput('type', item.type);
90
+ layoutRef.changeDetectorRef.detectChanges();
91
+ }
92
+ else {
93
+ this.widgetService.triggerFallback();
94
+ }
95
+ }
96
+ }
97
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: StyWidgetRenderer, deps: [{ token: StrivacityWidgetService }], target: i0.ɵɵFactoryTarget.Component });
98
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: StyWidgetRenderer, isStandalone: true, selector: "sty-widget-renderer", inputs: { items: "items", widgets: "widgets" }, viewQueries: [{ propertyName: "$containerRef", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: '<ng-container #container></ng-container>', isInline: true, styles: [":host{display:contents}\n"] });
99
+ }
100
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: StyWidgetRenderer, decorators: [{
101
+ type: Component,
102
+ args: [{ standalone: true, selector: 'sty-widget-renderer', template: '<ng-container #container></ng-container>', styles: [":host{display:contents}\n"] }]
103
+ }], ctorParameters: () => [{ type: StrivacityWidgetService }], propDecorators: { items: [{
104
+ type: Input
105
+ }], widgets: [{
106
+ type: Input,
107
+ args: [{ required: true }]
108
+ }], $containerRef: [{
109
+ type: ViewChild,
110
+ args: ['container', { read: ViewContainerRef, static: true }]
111
+ }] } });
7
112
 
8
113
  const STRIVACITY_SDK = new InjectionToken('sty');
9
114
  /**
@@ -30,7 +135,6 @@ class StrivacityAuthService {
30
135
  options;
31
136
  /**
32
137
  * Instance of the authentication flow (PopupFlow or RedirectFlow).
33
- * @protected
34
138
  */
35
139
  sdk;
36
140
  /**
@@ -97,7 +201,11 @@ class StrivacityAuthService {
97
201
  * @returns {Observable<void>} An observable that completes when the login process is done.
98
202
  */
99
203
  login(options) {
100
- return from(this.sdk.login(options));
204
+ const result = this.sdk.login(options);
205
+ if (result instanceof Promise) {
206
+ return from(result);
207
+ }
208
+ return result;
101
209
  }
102
210
  /**
103
211
  * Registers a new user using the specified options.
@@ -106,7 +214,11 @@ class StrivacityAuthService {
106
214
  * @returns {Observable<void>} An observable that completes when the registration process is done.
107
215
  */
108
216
  register(options) {
109
- return from(this.sdk.register(options));
217
+ const result = this.sdk.register(options);
218
+ if (result instanceof Promise) {
219
+ return from(result);
220
+ }
221
+ return result;
110
222
  }
111
223
  /**
112
224
  * Refreshes the current authentication session.
@@ -142,10 +254,10 @@ class StrivacityAuthService {
142
254
  handleCallback(url) {
143
255
  return from(this.sdk.handleCallback(url));
144
256
  }
145
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthService, deps: [{ token: STRIVACITY_SDK }], target: i0.ɵɵFactoryTarget.Injectable });
146
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthService, providedIn: 'root' });
257
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: StrivacityAuthService, deps: [{ token: STRIVACITY_SDK }], target: i0.ɵɵFactoryTarget.Injectable });
258
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: StrivacityAuthService, providedIn: 'root' });
147
259
  }
148
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthService, decorators: [{
260
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: StrivacityAuthService, decorators: [{
149
261
  type: Injectable,
150
262
  args: [{
151
263
  providedIn: 'root',
@@ -155,6 +267,227 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.4", ngImpor
155
267
  args: [STRIVACITY_SDK]
156
268
  }] }] });
157
269
 
270
+ class StyLoginRenderer {
271
+ authService;
272
+ widgetService;
273
+ subscriptions = new Subscription();
274
+ stateSub;
275
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
276
+ createdComponentRefs = [];
277
+ loginHandler;
278
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
279
+ widgets;
280
+ sessionId;
281
+ params = {};
282
+ onLogin = new EventEmitter();
283
+ onFallback = new EventEmitter();
284
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
285
+ onError = new EventEmitter();
286
+ onGlobalMessage = new EventEmitter();
287
+ onBlockReady = new EventEmitter();
288
+ $containerRef;
289
+ constructor(authService, widgetService) {
290
+ this.authService = authService;
291
+ this.widgetService = widgetService;
292
+ this.widgetService.triggerFallback = (hostedUrl) => {
293
+ const url = hostedUrl || this.widgetService.state$.value.hostedUrl;
294
+ if (!url) {
295
+ throw new Error('No hosted URL provided');
296
+ }
297
+ this.onFallback.emit(new FallbackError(new URL(url)));
298
+ };
299
+ this.widgetService.submitForm = async (formId) => {
300
+ try {
301
+ this.widgetService.loading$.next(true);
302
+ const data = await this.loginHandler.submitForm(formId, unflattenObject(this.widgetService.forms$.value[formId]));
303
+ if (await this.authService.sdk.isAuthenticated) {
304
+ this.onLogin.emit(this.authService.sdk.idTokenClaims);
305
+ }
306
+ else {
307
+ const previousState = JSON.parse(JSON.stringify(this.widgetService.state$.value));
308
+ const newState = {
309
+ hostedUrl: data?.hostedUrl ?? this.widgetService.state$.value.hostedUrl,
310
+ finalizeUrl: data?.finalizeUrl ?? this.widgetService.state$.value.finalizeUrl,
311
+ screen: data?.screen ?? this.widgetService.state$.value.screen,
312
+ forms: data?.forms ?? this.widgetService.state$.value.forms,
313
+ layout: data?.layout ?? this.widgetService.state$.value.layout,
314
+ messages: data?.messages ?? this.widgetService.state$.value.messages,
315
+ branding: data?.branding ?? this.widgetService.state$.value.branding,
316
+ };
317
+ if (newState.screen !== this.widgetService.state$.value.screen) {
318
+ const forms = {};
319
+ const messages = {};
320
+ for (const form of newState.forms ?? []) {
321
+ forms[form.id] = {};
322
+ messages[form.id] = {};
323
+ }
324
+ this.widgetService.forms$.next(forms);
325
+ this.widgetService.messages$.next(messages);
326
+ }
327
+ Object.keys(newState.messages ?? {}).forEach((formId) => {
328
+ if (formId === 'global') {
329
+ this.onGlobalMessage.emit(newState.messages?.global?.text ?? '');
330
+ }
331
+ else {
332
+ const messages = { ...this.widgetService.messages$.value };
333
+ messages[formId] = newState.messages[formId];
334
+ this.widgetService.messages$.next(messages);
335
+ }
336
+ });
337
+ this.widgetService.state$.next(newState);
338
+ this.onBlockReady.emit({ previousState, state: structuredClone(newState) });
339
+ this.widgetService.loading$.next(false);
340
+ }
341
+ }
342
+ catch (error) {
343
+ if (error instanceof FallbackError) {
344
+ this.onFallback.emit(error);
345
+ }
346
+ else {
347
+ this.onError.emit(error);
348
+ }
349
+ }
350
+ };
351
+ }
352
+ ngOnInit() {
353
+ this.subscriptions.add(this.widgetService.state$.subscribe((state) => {
354
+ this.render(state);
355
+ }));
356
+ void this.init();
357
+ }
358
+ ngOnDestroy() {
359
+ this.subscriptions.unsubscribe();
360
+ this.clearAndDestroyComponents();
361
+ }
362
+ async init() {
363
+ try {
364
+ this.loginHandler = this.authService.sdk.login(this.params);
365
+ const data = (await this.loginHandler.startSession(this.sessionId));
366
+ const previousState = JSON.parse(JSON.stringify(this.widgetService.state$.value));
367
+ const newState = {
368
+ hostedUrl: data?.hostedUrl ?? this.widgetService.state$.value.hostedUrl,
369
+ finalizeUrl: data?.finalizeUrl ?? this.widgetService.state$.value.finalizeUrl,
370
+ screen: data?.screen ?? this.widgetService.state$.value.screen,
371
+ forms: data?.forms ?? this.widgetService.state$.value.forms,
372
+ layout: data?.layout ?? this.widgetService.state$.value.layout,
373
+ messages: data?.messages ?? this.widgetService.state$.value.messages,
374
+ branding: data?.branding ?? this.widgetService.state$.value.branding,
375
+ };
376
+ if (await this.authService.sdk.isAuthenticated) {
377
+ this.onLogin.emit(this.authService.sdk.idTokenClaims);
378
+ }
379
+ else {
380
+ if (newState.screen !== this.widgetService.state$.value.screen) {
381
+ const newFormContexts = {};
382
+ const newMessageContexts = {};
383
+ for (const form of newState.forms ?? []) {
384
+ newFormContexts[form.id] = {};
385
+ newMessageContexts[form.id] = {};
386
+ }
387
+ this.widgetService.forms$.next(newFormContexts);
388
+ this.widgetService.messages$.next(newMessageContexts);
389
+ }
390
+ Object.keys(newState.messages ?? {}).forEach((formId) => {
391
+ if (formId === 'global') {
392
+ this.onGlobalMessage.emit(newState.messages?.global?.text ?? '');
393
+ }
394
+ else {
395
+ const messages = { ...this.widgetService.messages$.value };
396
+ messages[formId] = newState.messages[formId];
397
+ this.widgetService.messages$.next(messages);
398
+ }
399
+ });
400
+ this.widgetService.state$.next(newState);
401
+ this.onBlockReady.emit({ previousState, state: structuredClone(newState) });
402
+ }
403
+ }
404
+ catch (error) {
405
+ if (error instanceof FallbackError) {
406
+ this.onFallback.emit(error);
407
+ }
408
+ else {
409
+ this.onError.emit(error);
410
+ }
411
+ }
412
+ }
413
+ render(state) {
414
+ this.clearAndDestroyComponents();
415
+ if (state.screen) {
416
+ const component = this.widgets['layout'];
417
+ if (!component) {
418
+ return this.widgetService.triggerFallback();
419
+ }
420
+ const widgetRendererRef = this.$containerRef.createComponent(StyWidgetRenderer);
421
+ widgetRendererRef.setInput('items', state.layout?.items);
422
+ widgetRendererRef.setInput('widgets', this.widgets);
423
+ widgetRendererRef.changeDetectorRef.detectChanges();
424
+ const layoutRef = this.$containerRef.createComponent(component, {
425
+ projectableNodes: [[widgetRendererRef.location.nativeElement]],
426
+ });
427
+ layoutRef.setInput('formId', state.layout?.items[0]?.formId);
428
+ layoutRef.setInput('type', state.layout?.type);
429
+ layoutRef.setInput('tag', 'form');
430
+ layoutRef.changeDetectorRef.detectChanges();
431
+ this.createdComponentRefs.push(widgetRendererRef, layoutRef);
432
+ }
433
+ else {
434
+ const loadingComponentType = this.widgets['loading'];
435
+ if (loadingComponentType) {
436
+ const loadingRef = this.$containerRef.createComponent(loadingComponentType);
437
+ this.createdComponentRefs.push(loadingRef);
438
+ }
439
+ }
440
+ }
441
+ clearAndDestroyComponents() {
442
+ this.createdComponentRefs.forEach((ref) => {
443
+ if (!ref.hostView.destroyed) {
444
+ ref.destroy();
445
+ }
446
+ });
447
+ this.createdComponentRefs = [];
448
+ this.$containerRef?.clear();
449
+ }
450
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: StyLoginRenderer, deps: [{ token: StrivacityAuthService }, { token: StrivacityWidgetService }], target: i0.ɵɵFactoryTarget.Component });
451
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: StyLoginRenderer, isStandalone: true, selector: "sty-login-renderer", inputs: { widgets: "widgets", sessionId: "sessionId", params: "params" }, outputs: { onLogin: "login", onFallback: "fallback", onError: "error", onGlobalMessage: "globalMessage", onBlockReady: "blockReady" }, host: { classAttribute: "login-renderer" }, viewQueries: [{ propertyName: "$containerRef", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: '<ng-container #container></ng-container>', isInline: true });
452
+ }
453
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: StyLoginRenderer, decorators: [{
454
+ type: Component,
455
+ args: [{
456
+ standalone: true,
457
+ // eslint-disable-next-line @angular-eslint/component-selector
458
+ selector: 'sty-login-renderer',
459
+ template: '<ng-container #container></ng-container>',
460
+ host: {
461
+ class: 'login-renderer',
462
+ },
463
+ }]
464
+ }], ctorParameters: () => [{ type: StrivacityAuthService }, { type: StrivacityWidgetService }], propDecorators: { widgets: [{
465
+ type: Input,
466
+ args: [{ required: true }]
467
+ }], sessionId: [{
468
+ type: Input
469
+ }], params: [{
470
+ type: Input
471
+ }], onLogin: [{
472
+ type: Output,
473
+ args: ['login']
474
+ }], onFallback: [{
475
+ type: Output,
476
+ args: ['fallback']
477
+ }], onError: [{
478
+ type: Output,
479
+ args: ['error']
480
+ }], onGlobalMessage: [{
481
+ type: Output,
482
+ args: ['globalMessage']
483
+ }], onBlockReady: [{
484
+ type: Output,
485
+ args: ['blockReady']
486
+ }], $containerRef: [{
487
+ type: ViewChild,
488
+ args: ['container', { read: ViewContainerRef, static: true }]
489
+ }] } });
490
+
158
491
  class StrivacityAuthModule {
159
492
  static forRoot(options) {
160
493
  return {
@@ -162,15 +495,17 @@ class StrivacityAuthModule {
162
495
  providers: [provideStrivacity(options)],
163
496
  };
164
497
  }
165
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
166
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthModule });
167
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthModule, providers: [StrivacityAuthService] });
498
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: StrivacityAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
499
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: StrivacityAuthModule, imports: [StyLoginRenderer], exports: [StyLoginRenderer] });
500
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: StrivacityAuthModule, providers: [StrivacityAuthService] });
168
501
  }
169
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthModule, decorators: [{
502
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: StrivacityAuthModule, decorators: [{
170
503
  type: NgModule,
171
504
  args: [{
172
505
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
173
506
  providers: [StrivacityAuthService],
507
+ imports: [StyLoginRenderer],
508
+ exports: [StyLoginRenderer],
174
509
  }]
175
510
  }] });
176
511
 
@@ -178,5 +513,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.4", ngImpor
178
513
  * Generated bundle index. Do not edit.
179
514
  */
180
515
 
181
- export { STRIVACITY_SDK, StrivacityAuthModule, StrivacityAuthService, provideStrivacity };
516
+ export { STRIVACITY_SDK, StrivacityAuthModule, StrivacityAuthService, StrivacityWidgetService, StyLoginRenderer, provideStrivacity };
182
517
  //# sourceMappingURL=strivacity-sdk-angular.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"strivacity-sdk-angular.mjs","sources":["../../src/lib/utils/helpers.ts","../../src/lib/services/auth.service.ts","../../src/lib/strivacity-auth.module.ts","../../src/strivacity-sdk-angular.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport type { SDKOptions } from '@strivacity/sdk-core';\n\nexport const STRIVACITY_SDK = new InjectionToken<SDKOptions>('sty');\n\n/**\n * Provides the Strivacity SDK configuration as a dependency injection token.\n *\n * This function is used to supply the Strivacity SDK configuration to the application\n * by binding it to the `STRIVACITY_SDK` token.\n *\n * @param {SDKOptions} config The SDK configuration options.\n * @returns {{ provide: InjectionToken<SDKOptions>, useValue: SDKOptions }} An object that provides the SDK configuration using the `STRIVACITY_SDK` token.\n */\nexport function provideStrivacity(config: SDKOptions) {\n\treturn { provide: STRIVACITY_SDK, useValue: config };\n}\n","import { Inject, Injectable } from '@angular/core';\nimport { type Observable, BehaviorSubject, from } from 'rxjs';\nimport type { PopupFlow } from '@strivacity/sdk-core/flows/PopupFlow';\nimport type { RedirectFlow } from '@strivacity/sdk-core/flows/RedirectFlow';\nimport { type SDKOptions, initFlow } from '@strivacity/sdk-core';\nimport type { Session } from '../utils/types';\nimport { STRIVACITY_SDK } from '../utils/helpers';\n\n/**\n * Service that manages Strivacity authentication flows.\n * Supports either PopupFlow or RedirectFlow types.\n *\n * @template Flow Type of authentication flow (PopupFlow or RedirectFlow).\n * @template Options Type of SDK options (defaults to SDKOptions).\n */\n@Injectable({\n\tprovidedIn: 'root',\n})\nexport class StrivacityAuthService<Flow extends PopupFlow | RedirectFlow = PopupFlow | RedirectFlow, Options extends SDKOptions = SDKOptions> {\n\t/**\n\t * Instance of the authentication flow (PopupFlow or RedirectFlow).\n\t * @protected\n\t */\n\tprotected sdk: Flow;\n\t/**\n\t * BehaviorSubject that holds the current session state.\n\t * @protected\n\t * @readonly\n\t */\n\tprivate readonly sessionSubject: BehaviorSubject<Session>;\n\t/**\n\t * Observable that emits the session state changes.\n\t * @readonly\n\t */\n\treadonly session$: Observable<Session>;\n\n\t/**\n\t * Creates an instance of StrivacityAuthService.\n\t *\n\t * @param {Options} options SDK configuration options injected via STRIVACITY_SDK.\n\t */\n\tconstructor(@Inject(STRIVACITY_SDK) public options: Options) {\n\t\tthis.sdk = initFlow(options) as Flow;\n\t\tthis.sessionSubject = new BehaviorSubject<Session>({\n\t\t\tloading: true,\n\t\t\tisAuthenticated: false,\n\t\t\tidTokenClaims: null,\n\t\t\taccessToken: null,\n\t\t\trefreshToken: null,\n\t\t\taccessTokenExpired: true,\n\t\t\taccessTokenExpirationDate: null,\n\t\t});\n\t\tthis.session$ = this.sessionSubject.asObservable();\n\n\t\tconst updateSession = async () => {\n\t\t\tthis.sessionSubject.next({\n\t\t\t\tloading: false,\n\t\t\t\tisAuthenticated: await this.sdk.isAuthenticated,\n\t\t\t\tidTokenClaims: this.sdk.idTokenClaims || null,\n\t\t\t\taccessToken: this.sdk.accessToken || null,\n\t\t\t\trefreshToken: this.sdk.refreshToken || null,\n\t\t\t\taccessTokenExpired: this.sdk.accessTokenExpired,\n\t\t\t\taccessTokenExpirationDate: this.sdk.accessTokenExpirationDate || null,\n\t\t\t});\n\t\t};\n\n\t\tthis.sdk.subscribeToEvent('init', updateSession);\n\t\tthis.sdk.subscribeToEvent('loggedIn', updateSession);\n\t\tthis.sdk.subscribeToEvent('sessionLoaded', updateSession);\n\t\tthis.sdk.subscribeToEvent('tokenRefreshed', updateSession);\n\t\tthis.sdk.subscribeToEvent('tokenRefreshFailed', updateSession);\n\t\tthis.sdk.subscribeToEvent('logoutInitiated', updateSession);\n\t\tthis.sdk.subscribeToEvent('tokenRevoked', updateSession);\n\t\tthis.sdk.subscribeToEvent('tokenRevokeFailed', updateSession);\n\t}\n\n\t/**\n\t * Checks if the user is authenticated.\n\t *\n\t * @returns {Observable<boolean>} An observable that emits the authentication status.\n\t */\n\tisAuthenticated() {\n\t\treturn from(this.sdk.isAuthenticated);\n\t}\n\n\t/**\n\t * Logs the user in using the specified options.\n\t *\n\t * @param {Parameters<Flow['login']>[0]} [options] Options to customize the login behavior.\n\t * @returns {Observable<void>} An observable that completes when the login process is done.\n\t */\n\tlogin(options?: Parameters<Flow['login']>[0]) {\n\t\treturn from(this.sdk.login(options));\n\t}\n\n\t/**\n\t * Registers a new user using the specified options.\n\t *\n\t * @param {Parameters<Flow['register']>[0]} [options] Options to customize the registration behavior.\n\t * @returns {Observable<void>} An observable that completes when the registration process is done.\n\t */\n\tregister(options?: Parameters<Flow['register']>[0]) {\n\t\treturn from(this.sdk.register(options));\n\t}\n\n\t/**\n\t * Refreshes the current authentication session.\n\t *\n\t * @returns {Observable<void>} An observable that completes when the session is refreshed.\n\t */\n\trefresh() {\n\t\treturn from(this.sdk.refresh());\n\t}\n\n\t/**\n\t * Revokes the current session tokens.\n\t *\n\t * @returns {Observable<void>} An observable that completes when the tokens are revoked.\n\t */\n\trevoke() {\n\t\treturn from(this.sdk.revoke());\n\t}\n\n\t/**\n\t * Logs the user out using the specified options.\n\t *\n\t * @param {Parameters<Flow['logout']>[0]} [options] Options to customize the logout behavior.\n\t * @returns {Observable<void>} An observable that completes when the logout process is done.\n\t */\n\tlogout(options?: Parameters<Flow['logout']>[0]) {\n\t\treturn from(this.sdk.logout(options));\n\t}\n\n\t/**\n\t * Handles the authentication callback (e.g., after a redirect or popup flow).\n\t *\n\t * @param {Parameters<Flow['handleCallback']>[0]} [url] The URL to handle for the callback.\n\t * @returns {Observable<void>} An observable that completes when the callback is handled.\n\t */\n\thandleCallback(url?: Parameters<Flow['handleCallback']>[0]) {\n\t\treturn from(this.sdk.handleCallback(url));\n\t}\n}\n","import { type ModuleWithProviders, CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';\nimport type { SDKOptions } from '@strivacity/sdk-core';\nimport { StrivacityAuthService } from './services/auth.service';\nimport { provideStrivacity } from './utils/helpers';\n\n@NgModule({\n\tschemas: [CUSTOM_ELEMENTS_SCHEMA],\n\tproviders: [StrivacityAuthService],\n})\nexport class StrivacityAuthModule {\n\tstatic forRoot(options: SDKOptions): ModuleWithProviders<StrivacityAuthModule> {\n\t\treturn {\n\t\t\tngModule: StrivacityAuthModule,\n\t\t\tproviders: [provideStrivacity(options)],\n\t\t};\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAGa,cAAc,GAAG,IAAI,cAAc,CAAa,KAAK,EAAE;AAEpE;;;;;;;;AAQG;AACG,SAAU,iBAAiB,CAAC,MAAkB,EAAA;IACnD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AACtD;;ACRA;;;;;;AAMG;MAIU,qBAAqB,CAAA;AAuBU,IAAA,OAAA,CAAA;AAtB3C;;;AAGG;AACO,IAAA,GAAG,CAAO;AACpB;;;;AAIG;AACc,IAAA,cAAc,CAA2B;AAC1D;;;AAGG;AACM,IAAA,QAAQ,CAAsB;AAEvC;;;;AAIG;AACH,IAAA,WAAA,CAA2C,OAAgB,EAAA;QAAhB,IAAO,CAAA,OAAA,GAAP,OAAO,CAAS;AAC1D,QAAA,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAS,CAAC;AACrC,QAAA,IAAI,CA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/components/widget-renderer.component.ts","../../src/lib/utils/helpers.ts","../../src/lib/services/auth.service.ts","../../src/lib/components/login-renderer.component.ts","../../src/lib/strivacity-auth.module.ts","../../src/strivacity-sdk-angular.ts"],"sourcesContent":["import type { LoginFlowMessage, LoginFlowState } from '@strivacity/sdk-core';\nimport { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\nexport interface NativeFlowState {\n\tloading: boolean;\n\tformContexts: Record<string, Record<string, unknown>>;\n\tmessageContexts: Record<string, Record<string, string | null>>;\n\tstate: LoginFlowState;\n}\n\n/**\n * Service that manages Strivacity native widgets.\n */\n@Injectable({\n\tprovidedIn: 'root',\n})\nexport class StrivacityWidgetService {\n\treadonly loading$ = new BehaviorSubject<boolean>(false);\n\treadonly forms$ = new BehaviorSubject<Record<string, Record<string, unknown>>>({});\n\treadonly messages$ = new BehaviorSubject<Record<string, Record<string, LoginFlowMessage>>>({});\n\treadonly state$ = new BehaviorSubject<LoginFlowState>({});\n\n\ttriggerFallback!: (hostedUrl?: string) => void;\n\tsubmitForm!: (formId: string) => Promise<void>;\n\n\tsetFormValue(formId: string, widgetId: string, value: unknown) {\n\t\tconst forms = { ...this.forms$.value };\n\t\tforms[formId] = { ...(forms[formId] || {}), [widgetId]: value === '' ? null : value };\n\n\t\tthis.forms$.next(forms);\n\t}\n\n\tsetMessage(formId: string, widgetId: string, value: LoginFlowMessage) {\n\t\tconst messages = { ...this.messages$.value };\n\t\tmessages[formId] = { ...(messages[formId] || {}), [widgetId]: value };\n\n\t\tthis.messages$.next(messages);\n\t}\n}\n","import type { Type, SimpleChanges, OnChanges } from '@angular/core';\nimport type { WidgetType, LayoutWidget, Widget } from '@strivacity/sdk-core';\nimport { Component, Input, ViewContainerRef, ViewChild } from '@angular/core';\nimport { StrivacityWidgetService } from '../services/widget.service';\n\n@Component({\n\tstandalone: true,\n\t// eslint-disable-next-line @angular-eslint/component-selector\n\tselector: 'sty-widget-renderer',\n\ttemplate: '<ng-container #container></ng-container>',\n\tstyles: `\n\t\t:host {\n\t\t\tdisplay: contents;\n\t\t}\n\t`,\n})\nexport class StyWidgetRenderer implements OnChanges {\n\t@Input() items: LayoutWidget['items'] = [];\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t@Input({ required: true }) widgets!: Record<WidgetType, Type<any>>;\n\n\t@ViewChild('container', { read: ViewContainerRef, static: true }) readonly $containerRef!: ViewContainerRef;\n\n\tconstructor(protected widgetService: StrivacityWidgetService) {}\n\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tif (changes['items']) {\n\t\t\tthis.render();\n\t\t}\n\t}\n\n\trender(): void {\n\t\tthis.$containerRef.clear();\n\n\t\tif (!this.items) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const item of this.items) {\n\t\t\tif (item.type === 'widget') {\n\t\t\t\tconst form = this.widgetService.state$.value.forms?.find((f) => f.id === item.formId);\n\t\t\t\tconst widget = form?.widgets.find((w) => w.id === item.widgetId);\n\t\t\t\tconst component = widget ? this.widgets[widget.type] : undefined;\n\n\t\t\t\tif (!form || !widget || !component) {\n\t\t\t\t\tthis.widgetService.triggerFallback();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst componentRef = this.$containerRef.createComponent(component);\n\t\t\t\tcomponentRef.setInput('formId', item.formId);\n\t\t\t\tcomponentRef.setInput('config', widget);\n\t\t\t\tcomponentRef.changeDetectorRef.detectChanges();\n\t\t\t} else if (item.type === 'vertical' || item.type === 'horizontal') {\n\t\t\t\tconst component = this.widgets.layout;\n\n\t\t\t\tif (!component) {\n\t\t\t\t\tthis.widgetService.triggerFallback();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst widgetRendererRef = this.$containerRef.createComponent(StyWidgetRenderer);\n\t\t\t\twidgetRendererRef.setInput('items', item.items);\n\t\t\t\twidgetRendererRef.setInput('widgets', this.widgets);\n\t\t\t\twidgetRendererRef.changeDetectorRef.detectChanges();\n\n\t\t\t\tconst layoutRef = this.$containerRef.createComponent(component, {\n\t\t\t\t\tprojectableNodes: [[widgetRendererRef.location.nativeElement]],\n\t\t\t\t});\n\t\t\t\tlayoutRef.setInput('formId', (item.items[0] as Widget)?.formId);\n\t\t\t\tlayoutRef.setInput('type', item.type);\n\t\t\t\tlayoutRef.changeDetectorRef.detectChanges();\n\t\t\t} else {\n\t\t\t\tthis.widgetService.triggerFallback();\n\t\t\t}\n\t\t}\n\t}\n}\n","import { InjectionToken } from '@angular/core';\nimport type { SDKOptions } from '@strivacity/sdk-core';\n\nexport const STRIVACITY_SDK = new InjectionToken<SDKOptions>('sty');\n\n/**\n * Provides the Strivacity SDK configuration as a dependency injection token.\n *\n * This function is used to supply the Strivacity SDK configuration to the application\n * by binding it to the `STRIVACITY_SDK` token.\n *\n * @param {SDKOptions} config The SDK configuration options.\n * @returns {{ provide: InjectionToken<SDKOptions>, useValue: SDKOptions }} An object that provides the SDK configuration using the `STRIVACITY_SDK` token.\n */\nexport function provideStrivacity(config: SDKOptions) {\n\treturn { provide: STRIVACITY_SDK, useValue: config };\n}\n","import { Inject, Injectable } from '@angular/core';\nimport { type Observable, BehaviorSubject, from } from 'rxjs';\nimport type { PopupFlow } from '@strivacity/sdk-core/flows/PopupFlow';\nimport type { RedirectFlow } from '@strivacity/sdk-core/flows/RedirectFlow';\nimport type { NativeFlow } from '@strivacity/sdk-core/flows/NativeFlow';\nimport { type SDKOptions, initFlow } from '@strivacity/sdk-core';\nimport type { Session } from '../utils/types';\nimport { STRIVACITY_SDK } from '../utils/helpers';\n\n/**\n * Service that manages Strivacity authentication flows.\n * Supports either PopupFlow or RedirectFlow types.\n *\n * @template Flow Type of authentication flow (PopupFlow or RedirectFlow).\n * @template Options Type of SDK options (defaults to SDKOptions).\n */\n@Injectable({\n\tprovidedIn: 'root',\n})\nexport class StrivacityAuthService<\n\tFlow extends PopupFlow | RedirectFlow | NativeFlow = PopupFlow | RedirectFlow | NativeFlow,\n\tOptions extends SDKOptions = SDKOptions,\n> {\n\t/**\n\t * Instance of the authentication flow (PopupFlow or RedirectFlow).\n\t */\n\tsdk: Flow;\n\n\t/**\n\t * BehaviorSubject that holds the current session state.\n\t * @protected\n\t * @readonly\n\t */\n\tprivate readonly sessionSubject: BehaviorSubject<Session>;\n\n\t/**\n\t * Observable that emits the session state changes.\n\t * @readonly\n\t */\n\treadonly session$: Observable<Session>;\n\n\t/**\n\t * Creates an instance of StrivacityAuthService.\n\t *\n\t * @param {Options} options SDK configuration options injected via STRIVACITY_SDK.\n\t */\n\tconstructor(@Inject(STRIVACITY_SDK) public options: Options) {\n\t\tthis.sdk = initFlow(options) as Flow;\n\t\tthis.sessionSubject = new BehaviorSubject<Session>({\n\t\t\tloading: true,\n\t\t\tisAuthenticated: false,\n\t\t\tidTokenClaims: null,\n\t\t\taccessToken: null,\n\t\t\trefreshToken: null,\n\t\t\taccessTokenExpired: true,\n\t\t\taccessTokenExpirationDate: null,\n\t\t});\n\t\tthis.session$ = this.sessionSubject.asObservable();\n\n\t\tconst updateSession = async () => {\n\t\t\tthis.sessionSubject.next({\n\t\t\t\tloading: false,\n\t\t\t\tisAuthenticated: await this.sdk.isAuthenticated,\n\t\t\t\tidTokenClaims: this.sdk.idTokenClaims || null,\n\t\t\t\taccessToken: this.sdk.accessToken || null,\n\t\t\t\trefreshToken: this.sdk.refreshToken || null,\n\t\t\t\taccessTokenExpired: this.sdk.accessTokenExpired,\n\t\t\t\taccessTokenExpirationDate: this.sdk.accessTokenExpirationDate || null,\n\t\t\t});\n\t\t};\n\n\t\tthis.sdk.subscribeToEvent('init', updateSession);\n\t\tthis.sdk.subscribeToEvent('loggedIn', updateSession);\n\t\tthis.sdk.subscribeToEvent('sessionLoaded', updateSession);\n\t\tthis.sdk.subscribeToEvent('tokenRefreshed', updateSession);\n\t\tthis.sdk.subscribeToEvent('tokenRefreshFailed', updateSession);\n\t\tthis.sdk.subscribeToEvent('logoutInitiated', updateSession);\n\t\tthis.sdk.subscribeToEvent('tokenRevoked', updateSession);\n\t\tthis.sdk.subscribeToEvent('tokenRevokeFailed', updateSession);\n\t}\n\n\t/**\n\t * Checks if the user is authenticated.\n\t *\n\t * @returns {Observable<boolean>} An observable that emits the authentication status.\n\t */\n\tisAuthenticated() {\n\t\treturn from(this.sdk.isAuthenticated);\n\t}\n\n\t/**\n\t * Logs the user in using the specified options.\n\t *\n\t * @param {Parameters<Flow['login']>[0]} [options] Options to customize the login behavior.\n\t * @returns {Observable<void>} An observable that completes when the login process is done.\n\t */\n\tlogin(options?: Parameters<Flow['login']>[0]) {\n\t\tconst result = this.sdk.login(options);\n\n\t\tif (result instanceof Promise) {\n\t\t\treturn from(result);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Registers a new user using the specified options.\n\t *\n\t * @param {Parameters<Flow['register']>[0]} [options] Options to customize the registration behavior.\n\t * @returns {Observable<void>} An observable that completes when the registration process is done.\n\t */\n\tregister(options?: Parameters<Flow['register']>[0]) {\n\t\tconst result = this.sdk.register(options);\n\n\t\tif (result instanceof Promise) {\n\t\t\treturn from(result);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Refreshes the current authentication session.\n\t *\n\t * @returns {Observable<void>} An observable that completes when the session is refreshed.\n\t */\n\trefresh() {\n\t\treturn from(this.sdk.refresh());\n\t}\n\n\t/**\n\t * Revokes the current session tokens.\n\t *\n\t * @returns {Observable<void>} An observable that completes when the tokens are revoked.\n\t */\n\trevoke() {\n\t\treturn from(this.sdk.revoke());\n\t}\n\n\t/**\n\t * Logs the user out using the specified options.\n\t *\n\t * @param {Parameters<Flow['logout']>[0]} [options] Options to customize the logout behavior.\n\t * @returns {Observable<void>} An observable that completes when the logout process is done.\n\t */\n\tlogout(options?: Parameters<Flow['logout']>[0]) {\n\t\treturn from(this.sdk.logout(options));\n\t}\n\n\t/**\n\t * Handles the authentication callback (e.g., after a redirect or popup flow).\n\t *\n\t * @param {Parameters<Flow['handleCallback']>[0]} [url] The URL to handle for the callback.\n\t * @returns {Observable<void>} An observable that completes when the callback is handled.\n\t */\n\thandleCallback(url?: Parameters<Flow['handleCallback']>[0]) {\n\t\treturn from(this.sdk.handleCallback(url));\n\t}\n}\n","import type { OnInit, OnDestroy, ComponentRef } from '@angular/core';\nimport type { NativeFlow } from '@strivacity/sdk-core/flows/NativeFlow';\nimport type { IdTokenClaims, NativeParams, WidgetType, LoginFlowState, LoginFlowMessage, Widget } from '@strivacity/sdk-core';\nimport { Component, EventEmitter, Input, Output, Type, ViewChild, ViewContainerRef } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { FallbackError } from '@strivacity/sdk-core';\nimport { StrivacityAuthService } from '../services/auth.service';\nimport { StrivacityWidgetService } from '../services/widget.service';\nimport { unflattenObject } from '@strivacity/sdk-core/utils/object';\nimport { StyWidgetRenderer } from './widget-renderer.component';\n\n@Component({\n\tstandalone: true,\n\t// eslint-disable-next-line @angular-eslint/component-selector\n\tselector: 'sty-login-renderer',\n\ttemplate: '<ng-container #container></ng-container>',\n\thost: {\n\t\tclass: 'login-renderer',\n\t},\n})\nexport class StyLoginRenderer implements OnInit, OnDestroy {\n\tprivate subscriptions = new Subscription();\n\tprivate stateSub?: Subscription;\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tprivate createdComponentRefs: ComponentRef<any>[] = [];\n\tloginHandler!: ReturnType<StrivacityAuthService<NativeFlow>['sdk']['login']>;\n\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t@Input({ required: true }) widgets!: Record<WidgetType, Type<any>>;\n\t@Input() sessionId?: string | null;\n\t@Input() params: NativeParams = {};\n\n\t@Output('login') readonly onLogin = new EventEmitter<IdTokenClaims | null | undefined>();\n\t@Output('fallback') readonly onFallback = new EventEmitter<FallbackError>();\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t@Output('error') readonly onError = new EventEmitter<any>();\n\t@Output('globalMessage') readonly onGlobalMessage = new EventEmitter<string>();\n\t@Output('blockReady') readonly onBlockReady = new EventEmitter<{ previousState: LoginFlowState; state: LoginFlowState }>();\n\n\t@ViewChild('container', { read: ViewContainerRef, static: true }) readonly $containerRef!: ViewContainerRef;\n\n\tconstructor(\n\t\tprotected authService: StrivacityAuthService<NativeFlow>,\n\t\tprotected widgetService: StrivacityWidgetService,\n\t) {\n\t\tthis.widgetService.triggerFallback = (hostedUrl?: string) => {\n\t\t\tconst url = hostedUrl || this.widgetService.state$.value.hostedUrl;\n\n\t\t\tif (!url) {\n\t\t\t\tthrow new Error('No hosted URL provided');\n\t\t\t}\n\n\t\t\tthis.onFallback.emit(new FallbackError(new URL(url)));\n\t\t};\n\t\tthis.widgetService.submitForm = async (formId: string) => {\n\t\t\ttry {\n\t\t\t\tthis.widgetService.loading$.next(true);\n\n\t\t\t\tconst data = await this.loginHandler.submitForm(formId, unflattenObject(this.widgetService.forms$.value[formId]));\n\n\t\t\t\tif (await this.authService.sdk.isAuthenticated) {\n\t\t\t\t\tthis.onLogin.emit(this.authService.sdk.idTokenClaims);\n\t\t\t\t} else {\n\t\t\t\t\tconst previousState = JSON.parse(JSON.stringify(this.widgetService.state$.value));\n\t\t\t\t\tconst newState: LoginFlowState = {\n\t\t\t\t\t\thostedUrl: data?.hostedUrl ?? this.widgetService.state$.value.hostedUrl,\n\t\t\t\t\t\tfinalizeUrl: data?.finalizeUrl ?? this.widgetService.state$.value.finalizeUrl,\n\t\t\t\t\t\tscreen: data?.screen ?? this.widgetService.state$.value.screen,\n\t\t\t\t\t\tforms: data?.forms ?? this.widgetService.state$.value.forms,\n\t\t\t\t\t\tlayout: data?.layout ?? this.widgetService.state$.value.layout,\n\t\t\t\t\t\tmessages: data?.messages ?? this.widgetService.state$.value.messages,\n\t\t\t\t\t\tbranding: data?.branding ?? this.widgetService.state$.value.branding,\n\t\t\t\t\t};\n\n\t\t\t\t\tif (newState.screen !== this.widgetService.state$.value.screen) {\n\t\t\t\t\t\tconst forms: Record<string, Record<string, unknown>> = {};\n\t\t\t\t\t\tconst messages: Record<string, Record<string, LoginFlowMessage>> = {};\n\n\t\t\t\t\t\tfor (const form of newState.forms ?? []) {\n\t\t\t\t\t\t\tforms[form.id] = {};\n\t\t\t\t\t\t\tmessages[form.id] = {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.widgetService.forms$.next(forms);\n\t\t\t\t\t\tthis.widgetService.messages$.next(messages);\n\t\t\t\t\t}\n\n\t\t\t\t\tObject.keys(newState.messages ?? {}).forEach((formId) => {\n\t\t\t\t\t\tif (formId === 'global') {\n\t\t\t\t\t\t\tthis.onGlobalMessage.emit(newState.messages?.global?.text ?? '');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst messages = { ...this.widgetService.messages$.value };\n\t\t\t\t\t\t\tmessages[formId] = newState.messages![formId];\n\t\t\t\t\t\t\tthis.widgetService.messages$.next(messages);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tthis.widgetService.state$.next(newState);\n\t\t\t\t\tthis.onBlockReady.emit({ previousState, state: structuredClone(newState) });\n\t\t\t\t\tthis.widgetService.loading$.next(false);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof FallbackError) {\n\t\t\t\t\tthis.onFallback.emit(error);\n\t\t\t\t} else {\n\t\t\t\t\tthis.onError.emit(error);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tngOnInit() {\n\t\tthis.subscriptions.add(\n\t\t\tthis.widgetService.state$.subscribe((state) => {\n\t\t\t\tthis.render(state);\n\t\t\t}),\n\t\t);\n\t\tvoid this.init();\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.subscriptions.unsubscribe();\n\t\tthis.clearAndDestroyComponents();\n\t}\n\n\tasync init() {\n\t\ttry {\n\t\t\tthis.loginHandler = this.authService.sdk.login(this.params);\n\n\t\t\tconst data = (await this.loginHandler.startSession(this.sessionId)) as LoginFlowState;\n\t\t\tconst previousState = JSON.parse(JSON.stringify(this.widgetService.state$.value));\n\t\t\tconst newState = {\n\t\t\t\thostedUrl: data?.hostedUrl ?? this.widgetService.state$.value.hostedUrl,\n\t\t\t\tfinalizeUrl: data?.finalizeUrl ?? this.widgetService.state$.value.finalizeUrl,\n\t\t\t\tscreen: data?.screen ?? this.widgetService.state$.value.screen,\n\t\t\t\tforms: data?.forms ?? this.widgetService.state$.value.forms,\n\t\t\t\tlayout: data?.layout ?? this.widgetService.state$.value.layout,\n\t\t\t\tmessages: data?.messages ?? this.widgetService.state$.value.messages,\n\t\t\t\tbranding: data?.branding ?? this.widgetService.state$.value.branding,\n\t\t\t};\n\n\t\t\tif (await this.authService.sdk.isAuthenticated) {\n\t\t\t\tthis.onLogin.emit(this.authService.sdk.idTokenClaims);\n\t\t\t} else {\n\t\t\t\tif (newState.screen !== this.widgetService.state$.value.screen) {\n\t\t\t\t\tconst newFormContexts: Record<string, Record<string, unknown>> = {};\n\t\t\t\t\tconst newMessageContexts: Record<string, Record<string, LoginFlowMessage>> = {};\n\n\t\t\t\t\tfor (const form of newState.forms ?? []) {\n\t\t\t\t\t\tnewFormContexts[form.id] = {};\n\t\t\t\t\t\tnewMessageContexts[form.id] = {};\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.widgetService.forms$.next(newFormContexts);\n\t\t\t\t\tthis.widgetService.messages$.next(newMessageContexts);\n\t\t\t\t}\n\n\t\t\t\tObject.keys(newState.messages ?? {}).forEach((formId) => {\n\t\t\t\t\tif (formId === 'global') {\n\t\t\t\t\t\tthis.onGlobalMessage.emit(newState.messages?.global?.text ?? '');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst messages = { ...this.widgetService.messages$.value };\n\t\t\t\t\t\tmessages[formId] = newState.messages![formId];\n\n\t\t\t\t\t\tthis.widgetService.messages$.next(messages);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tthis.widgetService.state$.next(newState);\n\t\t\t\tthis.onBlockReady.emit({ previousState, state: structuredClone(newState) });\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (error instanceof FallbackError) {\n\t\t\t\tthis.onFallback.emit(error);\n\t\t\t} else {\n\t\t\t\tthis.onError.emit(error);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate render(state: LoginFlowState): void {\n\t\tthis.clearAndDestroyComponents();\n\n\t\tif (state.screen) {\n\t\t\tconst component = this.widgets['layout'];\n\n\t\t\tif (!component) {\n\t\t\t\treturn this.widgetService.triggerFallback();\n\t\t\t}\n\n\t\t\tconst widgetRendererRef = this.$containerRef.createComponent(StyWidgetRenderer);\n\t\t\twidgetRendererRef.setInput('items', state.layout?.items);\n\t\t\twidgetRendererRef.setInput('widgets', this.widgets);\n\t\t\twidgetRendererRef.changeDetectorRef.detectChanges();\n\n\t\t\tconst layoutRef = this.$containerRef.createComponent(component, {\n\t\t\t\tprojectableNodes: [[widgetRendererRef.location.nativeElement]],\n\t\t\t});\n\t\t\tlayoutRef.setInput('formId', (state.layout?.items[0] as Widget)?.formId);\n\t\t\tlayoutRef.setInput('type', state.layout?.type);\n\t\t\tlayoutRef.setInput('tag', 'form');\n\t\t\tlayoutRef.changeDetectorRef.detectChanges();\n\n\t\t\tthis.createdComponentRefs.push(widgetRendererRef, layoutRef);\n\t\t} else {\n\t\t\tconst loadingComponentType = this.widgets['loading'];\n\n\t\t\tif (loadingComponentType) {\n\t\t\t\tconst loadingRef = this.$containerRef.createComponent(loadingComponentType);\n\n\t\t\t\tthis.createdComponentRefs.push(loadingRef);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate clearAndDestroyComponents(): void {\n\t\tthis.createdComponentRefs.forEach((ref) => {\n\t\t\tif (!ref.hostView.destroyed) {\n\t\t\t\tref.destroy();\n\t\t\t}\n\t\t});\n\t\tthis.createdComponentRefs = [];\n\t\tthis.$containerRef?.clear();\n\t}\n}\n","import { type ModuleWithProviders, CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';\nimport type { SDKOptions } from '@strivacity/sdk-core';\nimport { StrivacityAuthService } from './services/auth.service';\nimport { provideStrivacity } from './utils/helpers';\nimport { StyLoginRenderer } from './components/login-renderer.component';\n\n@NgModule({\n\tschemas: [CUSTOM_ELEMENTS_SCHEMA],\n\tproviders: [StrivacityAuthService],\n\timports: [StyLoginRenderer],\n\texports: [StyLoginRenderer],\n})\nexport class StrivacityAuthModule {\n\tstatic forRoot(options: SDKOptions): ModuleWithProviders<StrivacityAuthModule> {\n\t\treturn {\n\t\t\tngModule: StrivacityAuthModule,\n\t\t\tproviders: [provideStrivacity(options)],\n\t\t};\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.StrivacityWidgetService","i1.StrivacityAuthService","i2.StrivacityWidgetService"],"mappings":";;;;;;;;;;;AAWA;;AAEG;MAIU,uBAAuB,CAAA;AAC1B,IAAA,QAAQ,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC;AAC9C,IAAA,MAAM,GAAG,IAAI,eAAe,CAA0C,EAAE,CAAC;AACzE,IAAA,SAAS,GAAG,IAAI,eAAe,CAAmD,EAAE,CAAC;AACrF,IAAA,MAAM,GAAG,IAAI,eAAe,CAAiB,EAAE,CAAC;AAEzD,IAAA,eAAe;AACf,IAAA,UAAU;AAEV,IAAA,YAAY,CAAC,MAAc,EAAE,QAAgB,EAAE,KAAc,EAAA;QAC5D,MAAM,KAAK,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE;AACtC,QAAA,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,QAAQ,GAAG,KAAK,KAAK,EAAE,GAAG,IAAI,GAAG,KAAK,EAAE;AAErF,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;;AAGxB,IAAA,UAAU,CAAC,MAAc,EAAE,QAAgB,EAAE,KAAuB,EAAA;QACnE,MAAM,QAAQ,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;QAC5C,QAAQ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OnDestroy } from '@angular/core';
2
+ import type { NativeFlow } from '@strivacity/sdk-core/flows/NativeFlow';
3
+ import type { IdTokenClaims, NativeParams, WidgetType, LoginFlowState } from '@strivacity/sdk-core';
4
+ import { EventEmitter, Type, ViewContainerRef } from '@angular/core';
5
+ import { FallbackError } from '@strivacity/sdk-core';
6
+ import { StrivacityAuthService } from '../services/auth.service';
7
+ import { StrivacityWidgetService } from '../services/widget.service';
8
+ import * as i0 from "@angular/core";
9
+ export declare class StyLoginRenderer implements OnInit, OnDestroy {
10
+ protected authService: StrivacityAuthService<NativeFlow>;
11
+ protected widgetService: StrivacityWidgetService;
12
+ private subscriptions;
13
+ private stateSub?;
14
+ private createdComponentRefs;
15
+ loginHandler: ReturnType<StrivacityAuthService<NativeFlow>['sdk']['login']>;
16
+ widgets: Record<WidgetType, Type<any>>;
17
+ sessionId?: string | null;
18
+ params: NativeParams;
19
+ readonly onLogin: EventEmitter<IdTokenClaims>;
20
+ readonly onFallback: EventEmitter<FallbackError>;
21
+ readonly onError: EventEmitter<any>;
22
+ readonly onGlobalMessage: EventEmitter<string>;
23
+ readonly onBlockReady: EventEmitter<{
24
+ previousState: LoginFlowState;
25
+ state: LoginFlowState;
26
+ }>;
27
+ readonly $containerRef: ViewContainerRef;
28
+ constructor(authService: StrivacityAuthService<NativeFlow>, widgetService: StrivacityWidgetService);
29
+ ngOnInit(): void;
30
+ ngOnDestroy(): void;
31
+ init(): Promise<void>;
32
+ private render;
33
+ private clearAndDestroyComponents;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<StyLoginRenderer, never>;
35
+ static ɵcmp: i0.ɵɵComponentDeclaration<StyLoginRenderer, "sty-login-renderer", never, { "widgets": { "alias": "widgets"; "required": true; }; "sessionId": { "alias": "sessionId"; "required": false; }; "params": { "alias": "params"; "required": false; }; }, { "onLogin": "login"; "onFallback": "fallback"; "onError": "error"; "onGlobalMessage": "globalMessage"; "onBlockReady": "blockReady"; }, never, never, true, never>;
36
+ }
@@ -0,0 +1,16 @@
1
+ import type { Type, SimpleChanges, OnChanges } from '@angular/core';
2
+ import type { WidgetType, LayoutWidget } from '@strivacity/sdk-core';
3
+ import { ViewContainerRef } from '@angular/core';
4
+ import { StrivacityWidgetService } from '../services/widget.service';
5
+ import * as i0 from "@angular/core";
6
+ export declare class StyWidgetRenderer implements OnChanges {
7
+ protected widgetService: StrivacityWidgetService;
8
+ items: LayoutWidget['items'];
9
+ widgets: Record<WidgetType, Type<any>>;
10
+ readonly $containerRef: ViewContainerRef;
11
+ constructor(widgetService: StrivacityWidgetService);
12
+ ngOnChanges(changes: SimpleChanges): void;
13
+ render(): void;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<StyWidgetRenderer, never>;
15
+ static ɵcmp: i0.ɵɵComponentDeclaration<StyWidgetRenderer, "sty-widget-renderer", never, { "items": { "alias": "items"; "required": false; }; "widgets": { "alias": "widgets"; "required": true; }; }, {}, never, never, true, never>;
16
+ }
@@ -1,6 +1,7 @@
1
1
  import { type Observable } from 'rxjs';
2
2
  import type { PopupFlow } from '@strivacity/sdk-core/flows/PopupFlow';
3
3
  import type { RedirectFlow } from '@strivacity/sdk-core/flows/RedirectFlow';
4
+ import type { NativeFlow } from '@strivacity/sdk-core/flows/NativeFlow';
4
5
  import { type SDKOptions } from '@strivacity/sdk-core';
5
6
  import type { Session } from '../utils/types';
6
7
  import * as i0 from "@angular/core";
@@ -11,13 +12,12 @@ import * as i0 from "@angular/core";
11
12
  * @template Flow Type of authentication flow (PopupFlow or RedirectFlow).
12
13
  * @template Options Type of SDK options (defaults to SDKOptions).
13
14
  */
14
- export declare class StrivacityAuthService<Flow extends PopupFlow | RedirectFlow = PopupFlow | RedirectFlow, Options extends SDKOptions = SDKOptions> {
15
+ export declare class StrivacityAuthService<Flow extends PopupFlow | RedirectFlow | NativeFlow = PopupFlow | RedirectFlow | NativeFlow, Options extends SDKOptions = SDKOptions> {
15
16
  options: Options;
16
17
  /**
17
18
  * Instance of the authentication flow (PopupFlow or RedirectFlow).
18
- * @protected
19
19
  */
20
- protected sdk: Flow;
20
+ sdk: Flow;
21
21
  /**
22
22
  * BehaviorSubject that holds the current session state.
23
23
  * @protected
@@ -47,14 +47,14 @@ export declare class StrivacityAuthService<Flow extends PopupFlow | RedirectFlow
47
47
  * @param {Parameters<Flow['login']>[0]} [options] Options to customize the login behavior.
48
48
  * @returns {Observable<void>} An observable that completes when the login process is done.
49
49
  */
50
- login(options?: Parameters<Flow['login']>[0]): Observable<void>;
50
+ login(options?: Parameters<Flow['login']>[0]): import("@strivacity/sdk-core/utils/NativeFlowHandler").NativeFlowHandler | Observable<void>;
51
51
  /**
52
52
  * Registers a new user using the specified options.
53
53
  *
54
54
  * @param {Parameters<Flow['register']>[0]} [options] Options to customize the registration behavior.
55
55
  * @returns {Observable<void>} An observable that completes when the registration process is done.
56
56
  */
57
- register(options?: Parameters<Flow['register']>[0]): Observable<void>;
57
+ register(options?: Parameters<Flow['register']>[0]): import("@strivacity/sdk-core/utils/NativeFlowHandler").NativeFlowHandler | Observable<void>;
58
58
  /**
59
59
  * Refreshes the current authentication session.
60
60
  *