@tuki-io/tuki-widgets 0.0.197 → 0.0.199

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 (49) hide show
  1. package/esm2020/di2mt/shared/components/stat-card/stat-card.component.mjs +2 -2
  2. package/esm2020/user-creation/src/app.constants.mjs +2 -16
  3. package/esm2020/user-creation/src/shared/material.module.mjs +7 -35
  4. package/esm2020/user-creation/src/shared/services/user-creation-api.service.mjs +19 -43
  5. package/esm2020/user-creation/src/shared/shared.module.mjs +4 -27
  6. package/esm2020/user-creation/src/user-creation.module.mjs +7 -40
  7. package/esm2020/user-creation/src/widgets/user-creation-wizard/components/user-details-step/user-details-step.component.mjs +20 -512
  8. package/esm2020/user-creation/src/widgets/user-creation-wizard/components/user-overview-step/user-overview-step.component.mjs +3 -3
  9. package/esm2020/user-creation/src/widgets/user-creation-wizard/components/user-template-step/user-template-step.component.mjs +34 -80
  10. package/esm2020/user-creation/src/widgets/user-creation-wizard/user-creation-wizard.component.mjs +19 -83
  11. package/esm2020/user-creation/src/widgets/user-creation-wizard/user-creation-wizard.service.mjs +124 -594
  12. package/fesm2015/tuki-io-tuki-widgets-di2mt.mjs +1 -1
  13. package/fesm2015/tuki-io-tuki-widgets-di2mt.mjs.map +1 -1
  14. package/fesm2015/tuki-io-tuki-widgets-user-creation.mjs +325 -1913
  15. package/fesm2015/tuki-io-tuki-widgets-user-creation.mjs.map +1 -1
  16. package/fesm2020/tuki-io-tuki-widgets-di2mt.mjs +1 -1
  17. package/fesm2020/tuki-io-tuki-widgets-di2mt.mjs.map +1 -1
  18. package/fesm2020/tuki-io-tuki-widgets-user-creation.mjs +313 -1868
  19. package/fesm2020/tuki-io-tuki-widgets-user-creation.mjs.map +1 -1
  20. package/package.json +1 -1
  21. package/user-creation/src/app.constants.d.ts +0 -10
  22. package/user-creation/src/shared/material.module.d.ts +1 -5
  23. package/user-creation/src/shared/services/user-creation-api.service.d.ts +2 -8
  24. package/user-creation/src/shared/shared.module.d.ts +1 -3
  25. package/user-creation/src/user-creation.module.d.ts +10 -17
  26. package/user-creation/src/widgets/user-creation-wizard/components/user-details-step/user-details-step.component.d.ts +7 -83
  27. package/user-creation/src/widgets/user-creation-wizard/components/user-template-step/user-template-step.component.d.ts +4 -11
  28. package/user-creation/src/widgets/user-creation-wizard/user-creation-wizard.component.d.ts +0 -18
  29. package/user-creation/src/widgets/user-creation-wizard/user-creation-wizard.service.d.ts +56 -71
  30. package/esm2020/user-creation/src/classes/notification.mjs +0 -32
  31. package/esm2020/user-creation/src/environments/environment.mjs +0 -11
  32. package/esm2020/user-creation/src/interfaces/user-creation-wizard.interfaces.mjs +0 -19
  33. package/esm2020/user-creation/src/shared/components/notification/notification.component.mjs +0 -38
  34. package/esm2020/user-creation/src/shared/pipes/truncate.pipe.mjs +0 -30
  35. package/esm2020/user-creation/src/shared/services/notification.service.mjs +0 -62
  36. package/esm2020/user-creation/src/utils/app-loader/app-loader.mjs +0 -14
  37. package/esm2020/user-creation/src/utils/build-savable-end-user.mjs +0 -147
  38. package/esm2020/user-creation/src/utils/device-name-validation.mjs +0 -23
  39. package/esm2020/user-creation/src/utils/parse-device-name-rule.mjs +0 -26
  40. package/user-creation/src/classes/notification.d.ts +0 -18
  41. package/user-creation/src/environments/environment.d.ts +0 -9
  42. package/user-creation/src/interfaces/user-creation-wizard.interfaces.d.ts +0 -502
  43. package/user-creation/src/shared/components/notification/notification.component.d.ts +0 -19
  44. package/user-creation/src/shared/pipes/truncate.pipe.d.ts +0 -7
  45. package/user-creation/src/shared/services/notification.service.d.ts +0 -18
  46. package/user-creation/src/utils/app-loader/app-loader.d.ts +0 -6
  47. package/user-creation/src/utils/build-savable-end-user.d.ts +0 -23
  48. package/user-creation/src/utils/device-name-validation.d.ts +0 -6
  49. package/user-creation/src/utils/parse-device-name-rule.d.ts +0 -8
@@ -1,237 +1,34 @@
1
- import * as i2 from '@angular/common';
1
+ import * as i4 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { Injectable, Pipe, Component, ChangeDetectionStrategy, NgModule, inject, ViewEncapsulation, EventEmitter, Output, Input, ViewChild } from '@angular/core';
5
- import * as i1$2 from '@angular/forms';
6
- import { ReactiveFormsModule, FormsModule, FormBuilder, Validators, FormControl } from '@angular/forms';
7
- import * as i15 from '@angular/material/expansion';
4
+ import { NgModule, Injectable, inject, Component, Input, EventEmitter, ViewEncapsulation, Output } from '@angular/core';
5
+ import * as i3$1 from '@angular/forms';
6
+ import { FormBuilder, Validators, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
7
+ import * as i9 from '@angular/material/expansion';
8
8
  import { MatExpansionModule } from '@angular/material/expansion';
9
9
  import { MatRadioModule } from '@angular/material/radio';
10
- import * as i4 from '@angular/material/stepper';
10
+ import * as i3$2 from '@angular/material/stepper';
11
11
  import { MatStepperModule } from '@angular/material/stepper';
12
- import { Subject, BehaviorSubject, tap, forkJoin, map, switchMap, of, catchError, takeUntil, take, finalize, startWith, debounceTime, timer, filter, distinctUntilChanged } from 'rxjs';
13
- import * as i3 from '@angular/material/button';
14
- import { MatButtonModule } from '@angular/material/button';
15
12
  import { MatProgressBarModule } from '@angular/material/progress-bar';
16
- import * as i5 from '@angular/material/table';
13
+ import * as i3 from '@angular/material/table';
17
14
  import { MatTableModule } from '@angular/material/table';
18
15
  import * as i5$1 from '@angular/material/tooltip';
19
16
  import { MatTooltipModule } from '@angular/material/tooltip';
20
17
  import { MatCheckboxModule } from '@angular/material/checkbox';
21
- import * as i7 from '@angular/material/icon';
18
+ import * as i4$1 from '@angular/material/button';
19
+ import { MatButtonModule } from '@angular/material/button';
22
20
  import { MatIconModule } from '@angular/material/icon';
23
- import * as i8 from '@angular/material/form-field';
21
+ import * as i5 from '@angular/material/form-field';
24
22
  import { MatFormFieldModule } from '@angular/material/form-field';
25
- import * as i9 from '@angular/material/input';
23
+ import * as i6 from '@angular/material/input';
26
24
  import { MatInputModule } from '@angular/material/input';
27
- import * as i7$1 from '@angular/material/select';
25
+ import * as i7 from '@angular/material/select';
28
26
  import { MatSelectModule } from '@angular/material/select';
29
- import * as i12 from '@angular/material/autocomplete';
30
- import { MatAutocompleteModule } from '@angular/material/autocomplete';
31
- import * as i1$1 from '@angular/material/progress-spinner';
32
- import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
33
- import * as i13 from '@angular/material/paginator';
34
- import { MatPaginatorModule } from '@angular/material/paginator';
35
- import * as i14 from '@angular/material/chips';
36
- import { MatChipsModule } from '@angular/material/chips';
27
+ import { BehaviorSubject, tap, forkJoin, map, Subject, takeUntil, startWith, switchMap, filter, of } from 'rxjs';
37
28
  import * as i1 from '@angular/common/http';
38
- import { HttpHeaders, HttpClientModule, HttpClient } from '@angular/common/http';
29
+ import { HttpHeaders, HttpClientModule } from '@angular/common/http';
39
30
  import { NgApexchartsModule } from 'ng-apexcharts';
40
- import Big from 'big.js';
41
- import { __rest } from 'tslib';
42
- import * as i11 from '@angular/material/core';
43
- import * as i1$3 from '@ngx-translate/core';
44
- import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
45
- import { TranslateHttpLoader } from '@ngx-translate/http-loader';
46
-
47
- const environment = {
48
- production: false,
49
- // apiUrl: 'http://localhost:4200',
50
- apiUrl: 'http://192.168.0.191:8080',
51
- notificationsLifetime: 30000,
52
- longNotificationsLifetime: 45000,
53
- cashCleanTimer: 900000,
54
- cashArrayLength: 10000,
55
- matomoUrl: 'http://192.168.0.136/matomo/',
56
- };
57
-
58
- const TTL_DEFAULT = environment.notificationsLifetime;
59
- const TTL_LONG_DEFAULT = environment.longNotificationsLifetime;
60
- var NotificationType;
61
- (function (NotificationType) {
62
- NotificationType["info"] = "info";
63
- NotificationType["error"] = "error";
64
- NotificationType["success"] = "success";
65
- NotificationType["warning"] = "warning";
66
- })(NotificationType || (NotificationType = {}));
67
- class Notification {
68
- constructor(data) {
69
- this.ttl = TTL_DEFAULT;
70
- Object.assign(this, data || {});
71
- if (this.ttl === undefined) {
72
- this.ttl = this.message && this.message.length && this.message.length < 80 ? TTL_DEFAULT : TTL_LONG_DEFAULT;
73
- }
74
- }
75
- isInfo() {
76
- return this.type === NotificationType.info;
77
- }
78
- isError() {
79
- return this.type === NotificationType.error;
80
- }
81
- isSuccess() {
82
- return this.type === NotificationType.success;
83
- }
84
- isWarning() {
85
- return this.type === NotificationType.warning;
86
- }
87
- }
88
-
89
- const SUCCESS_TIME = 5000;
90
- const INACTIVE_SESSION_MESSAGE = 'Your session was lost due to inactivity. Please login again';
91
- const INACTIVE_SESSION = 'SESSION_INACTIVE';
92
- class NotificationService {
93
- constructor() {
94
- this.listChange = new Subject();
95
- this.max = 0;
96
- this.list = [];
97
- }
98
- error(message, ttl) {
99
- this.notify('error', message, ttl);
100
- }
101
- success(message, ttl) {
102
- this.notify('success', message, (!ttl) ? SUCCESS_TIME : ttl);
103
- }
104
- warning(message, ttl) {
105
- this.notify('warning', message, ttl);
106
- }
107
- info(message, ttl) {
108
- this.notify('info', message, ttl);
109
- }
110
- notify(type, message, ttl) {
111
- const found = this.list.find((n) => n.message === message);
112
- if (found) {
113
- this.remove(found);
114
- }
115
- const notification = new Notification({
116
- id: ++this.max,
117
- type, message, ttl
118
- });
119
- if (notification.ttl > 0) {
120
- notification.timerId = setTimeout(() => this.remove(notification, true), notification.ttl);
121
- }
122
- this.list.push(notification);
123
- this.listChange.next(this.list);
124
- }
125
- remove(notification, auto) {
126
- if (!auto && notification.timerId) {
127
- // clear timeout in case of manual remove
128
- clearInterval(notification.timerId);
129
- }
130
- this.list = this.list.filter(n => n.id !== notification.id);
131
- this.listChange.next(this.list);
132
- }
133
- removeInactiveSessionError() {
134
- if (!this.list || !this.list.length) {
135
- return;
136
- }
137
- this.list = this.list.filter(n => n.message !== INACTIVE_SESSION_MESSAGE && n.message !== INACTIVE_SESSION);
138
- this.listChange.next(this.list);
139
- }
140
- }
141
- NotificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
142
- NotificationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NotificationService });
143
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NotificationService, decorators: [{
144
- type: Injectable
145
- }], ctorParameters: function () { return []; } });
146
-
147
- const API = {
148
- WEBEX_CHECK_CONTROL_HUB_INTEGRATION: "/webex/api/search/webex/customers/:customerId/controlhubexists",
149
- SITES: "/dcp/api/customers/:customerId/sites",
150
- SITE: "/dcp/api/sites/:siteId",
151
- DEVICE_TYPES: "/dcp/api/provision/options/:siteId/devicetypes",
152
- SITE_SETTINGS: "/dcp/api/sites/:siteId/settings",
153
- VM_USER_TEMPLATES: "/dcp/api/provision/options/:siteId/vmusertemplates",
154
- EXISTING_USERS: "/dcp/api/provision/:siteId/users",
155
- USER_TEMPLATES_UPLOAD_LIST: "/dcp/api/searchbulkupdate/uploadedusertemplatelist",
156
- USER_TEMPLATE_TOKEN: "/dcp/api/bulkupdate/:customerId/usertemplate/:id/token",
157
- AVAILABLE_DN_IN_RANGES: "/dcp/api/sites/:siteId/available-dn-in-ranges",
158
- USER_CHECK_ID_EXISTING: "/dcp/api/provision/:siteId/users/:userId",
159
- LDAP_USERS: "/dcp/api/provision/:siteId/users",
160
- USERS: "/dcp/api/provision/:siteId/users",
161
- CREATE_NEW_USER_FROM_TEMPLATE: "/dcp/api/provision/newUserFromUserTemplate",
162
- DEVICE_DEFAULTS: "/api/provision/options/:siteId/devicedefaults/:deviceType",
163
- };
164
- const USER_CREATION_TYPES = {
165
- CUCM: 'CUCM',
166
- MT: 'MT'
167
- };
168
- const MAX_INTEGER = 2147483647;
169
- const CUTTING_SYMBOLS = [
170
- " ",
171
- "_",
172
- "-"
173
- ];
174
- const BREADCRUMB_LENGTH_LIMIT = 20;
175
- const DEFAULT_CUTTING_LENGTH = 15;
176
-
177
- class TruncatePipe {
178
- transform(value, args) {
179
- if (!value) {
180
- return '';
181
- }
182
- if (args) {
183
- const limit = args.length > 0 ? parseInt(args[0], 10) : 20;
184
- const trail = args.length > 1 ? args[1] : '...';
185
- return value.length > limit ? value.substring(0, limit) + trail : value;
186
- }
187
- if (value.length <= BREADCRUMB_LENGTH_LIMIT) {
188
- return value;
189
- }
190
- const foundSymbol = CUTTING_SYMBOLS.find((symbol) => value.includes(symbol, DEFAULT_CUTTING_LENGTH));
191
- const cutIndex = foundSymbol ? value.indexOf(foundSymbol, DEFAULT_CUTTING_LENGTH) : BREADCRUMB_LENGTH_LIMIT;
192
- return value.substring(0, cutIndex) + '...';
193
- }
194
- }
195
- TruncatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
196
- TruncatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: TruncatePipe, name: "truncate" });
197
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TruncatePipe, decorators: [{
198
- type: Pipe,
199
- args: [{
200
- name: 'truncate'
201
- }]
202
- }] });
203
-
204
- class NotificationsComponent {
205
- constructor(notificationService, ref) {
206
- this.notificationService = notificationService;
207
- this.ref = ref;
208
- }
209
- ngOnInit() {
210
- this.listChangeSubscribe();
211
- }
212
- ngOnDestroy() {
213
- this.listSubscription.unsubscribe();
214
- }
215
- readMore() {
216
- this.isReadMore = !this.isReadMore;
217
- }
218
- removeNotification(notification) {
219
- this.notificationService.remove(notification);
220
- }
221
- listChangeSubscribe() {
222
- this.listSubscription = this.notificationService.listChange
223
- .subscribe((list) => {
224
- this.list = list;
225
- this.ref.detectChanges();
226
- });
227
- }
228
- }
229
- NotificationsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NotificationsComponent, deps: [{ token: NotificationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
230
- NotificationsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: NotificationsComponent, selector: "app-notification", ngImport: i0, template: "\n\n<div class=\"notification-block\" role=\"alert\" aria-live=\"assertive\">\n <div class=\"notification\"\n *ngFor=\"let notification of list\"\n [ngClass]=\"{'error': notification.isError(), 'success': notification.isSuccess()}\">\n\n <div class=\"flex-box\">\n <div class=\"notification-icons-block\">\n <i *ngIf=\"notification.isError()\" class=\"fa fa-exclamation-triangle\"></i>\n <i *ngIf=\"notification.isWarning()\" class=\"fa fa-hand-paper-o\"></i>\n <i *ngIf=\"notification.isSuccess()\" class=\"fa fa-check\"></i>\n <i *ngIf=\"notification.isInfo()\" class=\"fa fa-info-circle\"></i>\n </div>\n <div *ngIf=\"!isReadMore\" class=\"message-block\">\n {{notification.message | truncate:[93]}}\n </div>\n <div *ngIf=\"isReadMore\" class=\"message-block\">\n {{notification.message}}\n </div>\n </div>\n <div class=\"read-more-error link clickable\" *ngIf=\"notification.message && notification.message.length > 93\"\n (click)=\"readMore()\">{{(isReadMore ? 'Collapse' : 'Read More')}}</div>\n <button\n class=\"close\"\n mat-icon-button\n (click)=\"removeNotification(notification)\">\n <img class=\"notification-icon-close\" src=\"assets/icons/close_icon_modal.svg\" alt=\"\">\n </button>\n </div>\n</div>\n\n", styles: ["@import\"https://fonts.googleapis.com/css?family=Poppins:400,100,200,300,500,600,800,700,900\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400&display=swap\";.notification-block{right:10px;top:80px;position:absolute;z-index:100}.notification-block .read-more-error{margin:10px 13px 3px 0;text-align:right}.notification-block .notification{padding:15px 0 10px 10px;margin-bottom:18px;color:#333;border-radius:3px;border-top:1.5px solid #e5e1cd;background:#fcf8e3;box-shadow:0 8px 12px #091e4226,0 0 1px #091e424f;width:368px;position:relative}.notification-block .notification .message-block{font-size:14px;font-family:Poppins,Poppins,sans-serif!important;word-break:break-word;width:270px}.notification-block .notification .notification-icon-close{height:24px}.notification-block .notification.error{background:#FFE9E9;border-top:1.5px solid #E16D6D}.notification-block .notification.success{background:#e3f4dc;border-top:1.5px solid #b3d692}.notification-block .notification .fa-exclamation-triangle{color:#e16d6d!important}.notification-block .notification .fa-check{color:#a0c37f!important}.notification-block .notification .fa-info-circle,.notification-block .notification .fa-hand-paper-o{color:#bdb89e!important}.notification-block .notification .fa{font-size:20px}.notification-block .notification .close{position:absolute;top:2px;right:-5px}.notification-block .notification .close .fa{font-size:14px}.notification-block .notification .fa{margin:0;color:inherit}@media screen and (max-width: 600px){.notification-block{width:50%;min-width:150px}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "pipe", type: TruncatePipe, name: "truncate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
231
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NotificationsComponent, decorators: [{
232
- type: Component,
233
- args: [{ selector: 'app-notification', changeDetection: ChangeDetectionStrategy.OnPush, template: "\n\n<div class=\"notification-block\" role=\"alert\" aria-live=\"assertive\">\n <div class=\"notification\"\n *ngFor=\"let notification of list\"\n [ngClass]=\"{'error': notification.isError(), 'success': notification.isSuccess()}\">\n\n <div class=\"flex-box\">\n <div class=\"notification-icons-block\">\n <i *ngIf=\"notification.isError()\" class=\"fa fa-exclamation-triangle\"></i>\n <i *ngIf=\"notification.isWarning()\" class=\"fa fa-hand-paper-o\"></i>\n <i *ngIf=\"notification.isSuccess()\" class=\"fa fa-check\"></i>\n <i *ngIf=\"notification.isInfo()\" class=\"fa fa-info-circle\"></i>\n </div>\n <div *ngIf=\"!isReadMore\" class=\"message-block\">\n {{notification.message | truncate:[93]}}\n </div>\n <div *ngIf=\"isReadMore\" class=\"message-block\">\n {{notification.message}}\n </div>\n </div>\n <div class=\"read-more-error link clickable\" *ngIf=\"notification.message && notification.message.length > 93\"\n (click)=\"readMore()\">{{(isReadMore ? 'Collapse' : 'Read More')}}</div>\n <button\n class=\"close\"\n mat-icon-button\n (click)=\"removeNotification(notification)\">\n <img class=\"notification-icon-close\" src=\"assets/icons/close_icon_modal.svg\" alt=\"\">\n </button>\n </div>\n</div>\n\n", styles: ["@import\"https://fonts.googleapis.com/css?family=Poppins:400,100,200,300,500,600,800,700,900\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400&display=swap\";.notification-block{right:10px;top:80px;position:absolute;z-index:100}.notification-block .read-more-error{margin:10px 13px 3px 0;text-align:right}.notification-block .notification{padding:15px 0 10px 10px;margin-bottom:18px;color:#333;border-radius:3px;border-top:1.5px solid #e5e1cd;background:#fcf8e3;box-shadow:0 8px 12px #091e4226,0 0 1px #091e424f;width:368px;position:relative}.notification-block .notification .message-block{font-size:14px;font-family:Poppins,Poppins,sans-serif!important;word-break:break-word;width:270px}.notification-block .notification .notification-icon-close{height:24px}.notification-block .notification.error{background:#FFE9E9;border-top:1.5px solid #E16D6D}.notification-block .notification.success{background:#e3f4dc;border-top:1.5px solid #b3d692}.notification-block .notification .fa-exclamation-triangle{color:#e16d6d!important}.notification-block .notification .fa-check{color:#a0c37f!important}.notification-block .notification .fa-info-circle,.notification-block .notification .fa-hand-paper-o{color:#bdb89e!important}.notification-block .notification .fa{font-size:20px}.notification-block .notification .close{position:absolute;top:2px;right:-5px}.notification-block .notification .close .fa{font-size:14px}.notification-block .notification .fa{margin:0;color:inherit}@media screen and (max-width: 600px){.notification-block{width:50%;min-width:150px}}\n"] }]
234
- }], ctorParameters: function () { return [{ type: NotificationService }, { type: i0.ChangeDetectorRef }]; } });
31
+ import * as i8 from '@angular/material/core';
235
32
 
236
33
  class MaterialModule {
237
34
  }
@@ -244,11 +41,7 @@ MaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
244
41
  MatIconModule,
245
42
  MatFormFieldModule,
246
43
  MatInputModule,
247
- MatSelectModule,
248
- MatAutocompleteModule,
249
- MatProgressSpinnerModule,
250
- MatPaginatorModule,
251
- MatChipsModule], exports: [MatProgressBarModule,
44
+ MatSelectModule], exports: [MatProgressBarModule,
252
45
  MatTooltipModule,
253
46
  MatTableModule,
254
47
  MatCheckboxModule,
@@ -256,11 +49,7 @@ MaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
256
49
  MatIconModule,
257
50
  MatFormFieldModule,
258
51
  MatInputModule,
259
- MatSelectModule,
260
- MatAutocompleteModule,
261
- MatProgressSpinnerModule,
262
- MatPaginatorModule,
263
- MatChipsModule] });
52
+ MatSelectModule] });
264
53
  MaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, imports: [MatProgressBarModule,
265
54
  MatTooltipModule,
266
55
  MatTableModule,
@@ -269,11 +58,7 @@ MaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
269
58
  MatIconModule,
270
59
  MatFormFieldModule,
271
60
  MatInputModule,
272
- MatSelectModule,
273
- MatAutocompleteModule,
274
- MatProgressSpinnerModule,
275
- MatPaginatorModule,
276
- MatChipsModule, MatProgressBarModule,
61
+ MatSelectModule, MatProgressBarModule,
277
62
  MatTooltipModule,
278
63
  MatTableModule,
279
64
  MatCheckboxModule,
@@ -281,11 +66,7 @@ MaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
281
66
  MatIconModule,
282
67
  MatFormFieldModule,
283
68
  MatInputModule,
284
- MatSelectModule,
285
- MatAutocompleteModule,
286
- MatProgressSpinnerModule,
287
- MatPaginatorModule,
288
- MatChipsModule] });
69
+ MatSelectModule] });
289
70
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, decorators: [{
290
71
  type: NgModule,
291
72
  args: [{
@@ -298,11 +79,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
298
79
  MatIconModule,
299
80
  MatFormFieldModule,
300
81
  MatInputModule,
301
- MatSelectModule,
302
- MatAutocompleteModule,
303
- MatProgressSpinnerModule,
304
- MatPaginatorModule,
305
- MatChipsModule,
82
+ MatSelectModule
306
83
  ],
307
84
  exports: [
308
85
  MatProgressBarModule,
@@ -313,15 +90,97 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
313
90
  MatIconModule,
314
91
  MatFormFieldModule,
315
92
  MatInputModule,
316
- MatSelectModule,
317
- MatAutocompleteModule,
318
- MatProgressSpinnerModule,
319
- MatPaginatorModule,
320
- MatChipsModule,
93
+ MatSelectModule
321
94
  ]
322
95
  }]
323
96
  }] });
324
97
 
98
+ const getSavableData = (model, exclude) => {
99
+ let result = Object.keys(model);
100
+ if (exclude && exclude.length) {
101
+ result = result.filter(key => !exclude.some(item => item === key));
102
+ }
103
+ return result.reduce((result, key) => {
104
+ if (model[key] instanceof Array && model[key].length && model[key][0].getSavableData) {
105
+ result[key] = model[key].map((item) => item.getSavableData());
106
+ }
107
+ else if (model[key] instanceof Object && model[key].getSavableData) {
108
+ result[key] = model[key].getSavableData();
109
+ }
110
+ else {
111
+ result[key] = model[key];
112
+ }
113
+ return result;
114
+ }, {});
115
+ };
116
+
117
+ class Site {
118
+ constructor(site) {
119
+ Object.assign(this, site);
120
+ this.initForm();
121
+ }
122
+ initForm() {
123
+ const formBuilder = new FormBuilder();
124
+ const formSettings = {
125
+ name: [this.name || '', [Validators.required]],
126
+ shortName: [this.shortName || '', [Validators.required]],
127
+ cucm: [this.cucm || ''],
128
+ cuc: [this.cuc || ''],
129
+ address1: [this.address1 || ''],
130
+ zipCode: [this.country || ''],
131
+ city: [this.city || ''],
132
+ state: [this.state || ''],
133
+ country: [this.country || '', [Validators.required]],
134
+ isAfterTtu: [this.isAfterTtu || ''],
135
+ ttuEnableDate: [this.ttuEnableDate || '']
136
+ };
137
+ this.form = formBuilder.group(formSettings);
138
+ }
139
+ getSavableData() {
140
+ const nonSavableData = ['form'];
141
+ return getSavableData(this, nonSavableData);
142
+ }
143
+ getId() {
144
+ return this.id;
145
+ }
146
+ }
147
+ class SiteDefaults {
148
+ constructor(siteDefaults, isSharedLineSite) {
149
+ this.routePartitionFilter = [];
150
+ this.devicePoolFilter = [];
151
+ this.cssFilter = [];
152
+ this.voicemailProfileFilter = [];
153
+ if (siteDefaults) {
154
+ Object.assign(this, siteDefaults);
155
+ this.enableEm = siteDefaults.enableEm === 'true';
156
+ this.routePartitionFilter.sort();
157
+ this.devicePoolFilter.sort();
158
+ this.cssFilter.sort();
159
+ this.voicemailProfileFilter.sort();
160
+ }
161
+ if (isSharedLineSite) {
162
+ this.cssFilter = (siteDefaults === null || siteDefaults === void 0 ? void 0 : siteDefaults.sharedSitesCssFilter) || [];
163
+ this.routePartitionFilter = (siteDefaults === null || siteDefaults === void 0 ? void 0 : siteDefaults.sharedSitesRPFilter) || [];
164
+ }
165
+ }
166
+ }
167
+
168
+ const API = {
169
+ WEBEX_CHECK_CONTROL_HUB_INTEGRATION: "/webex/api/search/webex/customers/:customerId/controlhubexists",
170
+ SITES: "/api/customers/:customerId/sites",
171
+ SITE: "/dcp/api/sites/:siteId",
172
+ DEVICE_TYPES: "/dcp/api/provision/options/:siteId/devicetypes",
173
+ SITE_SETTINGS: "/dcp/api/sites/:siteId/settings",
174
+ VM_USER_TEMPLATES: "/dcp/api/provision/options/:siteId/vmusertemplates",
175
+ USER_TEMPLATES_UPLOAD_LIST: "/dcp/api/searchbulkupdate/uploadedusertemplatelist",
176
+ USER_TEMPLATE_TOKEN: "/dcp/api/bulkupdate/:customerId/usertemplate/:id/token",
177
+ };
178
+ const USER_CREATION_TYPES = {
179
+ CUCM: 'CUCM',
180
+ MT: 'MT'
181
+ };
182
+ const MAX_INTEGER = 2147483647;
183
+
325
184
  class APIService {
326
185
  constructor(httpClient) {
327
186
  this.httpClient = httpClient;
@@ -399,26 +258,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
399
258
  }]
400
259
  }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
401
260
 
402
- const BERLIN_MT_SITE = {
403
- address2: "Address 2",
404
- address3: "Address 3",
405
- country: "IL",
406
- cucm: {
407
- platformType: "CUCM",
408
- id: 2073,
409
- name: "DI_220"
410
- },
411
- id: 9329,
412
- name: "Berlin_MT",
413
- hqStatus: false,
414
- hasActivated: true,
415
- isAfterTtu: false,
416
- prefetchDn: false,
417
- settings: [],
418
- shortName: "Berl1758105407",
419
- state: "",
420
- timezone: "GMT"
421
- };
422
261
  class UserCreationApiService {
423
262
  constructor() {
424
263
  this._allSites = [];
@@ -448,21 +287,32 @@ class UserCreationApiService {
448
287
  // }
449
288
  // this.allCustomerSites$.next(true);
450
289
  // return this._allSites;
451
- this.sitesListSubject$.next([BERLIN_MT_SITE, ...res.pageData].sort((a, b) => a.name.localeCompare(b.name)));
290
+ this.sitesListSubject$.next(res.pageData);
452
291
  }));
453
292
  // .pipe(this.handleError(true));
454
293
  }
455
- getSiteAllData(siteId) {
294
+ getSiteData(siteId) {
456
295
  // this.dataPending = true;
457
296
  return forkJoin([
458
297
  this.getSite(siteId),
298
+ this.getDeviceTypes(siteId),
459
299
  this.getSiteDefaults(siteId, false),
460
- // this.getDeviceTypes(siteId),
461
- // this.getVoiceMailUserTemplates(siteId)
462
- ]);
300
+ this.getVoiceMailUserTemplates(siteId)
301
+ ]).pipe(tap(() => {
302
+ // this.userFeaturesService.setDefaultUcProfile();
303
+ }));
463
304
  }
464
305
  getSite(siteId, isEdit) {
465
- return this.apiService.fetch(API.SITE.replace(':siteId', String(siteId)), null, false);
306
+ return this.apiService.fetch(API.SITE.replace(':siteId', String(siteId)), null, false)
307
+ .pipe(map((siteData) => {
308
+ const site = new Site(siteData);
309
+ // if (isEdit) {
310
+ // this.setEditSite(site);
311
+ // } else {
312
+ // this.setCurrentSite(site);
313
+ // }
314
+ return site;
315
+ }));
466
316
  }
467
317
  getDeviceTypes(siteId) {
468
318
  return this.apiService.fetch(API.DEVICE_TYPES.replace(':siteId', String(siteId)), null, true);
@@ -506,22 +356,6 @@ class UserCreationApiService {
506
356
  return this.apiService.fetch(API.USER_TEMPLATE_TOKEN.replace(':customerId', customerId).replace(':id', id));
507
357
  // .pipe(this.handleError(false, true));
508
358
  }
509
- getAvailableDnInRanges(siteId, params) {
510
- return this.apiService.fetch(API.AVAILABLE_DN_IN_RANGES.replace(':siteId', siteId), params);
511
- }
512
- getLdapUsers(siteId, params) {
513
- return this.apiService.fetch(API.LDAP_USERS.replace(':siteId', siteId), params);
514
- }
515
- checkUserIdExisting(siteId, userId) {
516
- return this.apiService.fetch(API.USER_CHECK_ID_EXISTING.replace(':siteId', siteId).replace(':userId', userId));
517
- }
518
- saveTemplateUser(user, templateId, siteId) {
519
- return this.apiService.post(API.CREATE_NEW_USER_FROM_TEMPLATE, user, { siteId: siteId, templateId: templateId });
520
- }
521
- getDeviceDefaults(siteId, deviceType) {
522
- const encodedType = encodeURIComponent(deviceType);
523
- return this.apiService.fetch(API.DEVICE_DEFAULTS.replace(':siteId', siteId).replace(':deviceType', encodedType));
524
- }
525
359
  }
526
360
  UserCreationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
527
361
  UserCreationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationApiService });
@@ -535,25 +369,11 @@ SharedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "1
535
369
  SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, imports: [CommonModule,
536
370
  MaterialModule,
537
371
  NgApexchartsModule,
538
- HttpClientModule,
539
- ReactiveFormsModule,
540
- FormsModule], exports: [MaterialModule,
541
- ReactiveFormsModule,
542
- FormsModule,
543
- MatTableModule,
544
- NgApexchartsModule,
545
- HttpClientModule] });
372
+ HttpClientModule], exports: [MaterialModule] });
546
373
  SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, imports: [CommonModule,
547
374
  MaterialModule,
548
375
  NgApexchartsModule,
549
- HttpClientModule,
550
- ReactiveFormsModule,
551
- FormsModule, MaterialModule,
552
- ReactiveFormsModule,
553
- FormsModule,
554
- MatTableModule,
555
- NgApexchartsModule,
556
- HttpClientModule] });
376
+ HttpClientModule, MaterialModule] });
557
377
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, decorators: [{
558
378
  type: NgModule,
559
379
  args: [{
@@ -563,333 +383,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
563
383
  MaterialModule,
564
384
  NgApexchartsModule,
565
385
  HttpClientModule,
566
- ReactiveFormsModule,
567
- FormsModule,
568
386
  ],
569
387
  exports: [
570
- MaterialModule,
571
- ReactiveFormsModule,
572
- FormsModule,
573
- MatTableModule,
574
- NgApexchartsModule,
575
- HttpClientModule,
388
+ MaterialModule
576
389
  ]
577
390
  }]
578
391
  }] });
579
392
 
580
- function deviceNameValidator(options) {
581
- return (control) => {
582
- var _a, _b;
583
- const raw = String((_a = control.value) !== null && _a !== void 0 ? _a : '').trim();
584
- if (!raw || !((_b = options.regex) === null || _b === void 0 ? void 0 : _b.trim())) {
585
- return null;
586
- }
587
- try {
588
- const rule = new RegExp(`^(?:${options.regex})$`);
589
- if (!rule.test(raw)) {
590
- return {
591
- deviceName: {
592
- caption: options.caption || options.regex,
593
- },
594
- };
595
- }
596
- }
597
- catch (_c) {
598
- return null;
599
- }
600
- return null;
601
- };
602
- }
603
-
604
- const getSavableData = (model, exclude) => {
605
- let result = Object.keys(model);
606
- if (exclude && exclude.length) {
607
- result = result.filter(key => !exclude.some(item => item === key));
608
- }
609
- return result.reduce((result, key) => {
610
- if (model[key] instanceof Array && model[key].length && model[key][0].getSavableData) {
611
- result[key] = model[key].map((item) => item.getSavableData());
612
- }
613
- else if (model[key] instanceof Object && model[key].getSavableData) {
614
- result[key] = model[key].getSavableData();
615
- }
616
- else {
617
- result[key] = model[key];
618
- }
619
- return result;
620
- }, {});
621
- };
622
-
623
- class Site {
624
- constructor(site) {
625
- Object.assign(this, site);
626
- this.initForm();
627
- }
628
- initForm() {
629
- const formBuilder = new FormBuilder();
630
- const formSettings = {
631
- name: [this.name || '', [Validators.required]],
632
- shortName: [this.shortName || '', [Validators.required]],
633
- cucm: [this.cucm || ''],
634
- cuc: [this.cuc || ''],
635
- address1: [this.address1 || ''],
636
- zipCode: [this.country || ''],
637
- city: [this.city || ''],
638
- state: [this.state || ''],
639
- country: [this.country || '', [Validators.required]],
640
- isAfterTtu: [this.isAfterTtu || ''],
641
- ttuEnableDate: [this.ttuEnableDate || '']
642
- };
643
- this.form = formBuilder.group(formSettings);
644
- }
645
- getSavableData() {
646
- const nonSavableData = ['form'];
647
- return getSavableData(this, nonSavableData);
648
- }
649
- getId() {
650
- return this.id;
651
- }
652
- }
653
- class SiteDefaults {
654
- constructor(siteDefaults, isSharedLineSite) {
655
- this.routePartitionFilter = [];
656
- this.devicePoolFilter = [];
657
- this.cssFilter = [];
658
- this.voicemailProfileFilter = [];
659
- if (siteDefaults) {
660
- Object.assign(this, siteDefaults);
661
- this.enableEm = siteDefaults.enableEm === 'true';
662
- this.routePartitionFilter.sort();
663
- this.devicePoolFilter.sort();
664
- this.cssFilter.sort();
665
- this.voicemailProfileFilter.sort();
666
- }
667
- if (isSharedLineSite) {
668
- this.cssFilter = (siteDefaults === null || siteDefaults === void 0 ? void 0 : siteDefaults.sharedSitesCssFilter) || [];
669
- this.routePartitionFilter = (siteDefaults === null || siteDefaults === void 0 ? void 0 : siteDefaults.sharedSitesRPFilter) || [];
670
- }
671
- }
672
- }
673
-
674
- var DnRangeType;
675
- (function (DnRangeType) {
676
- DnRangeType["extension"] = "EXTENSION";
677
- DnRangeType["cpg"] = "CPG";
678
- DnRangeType["callpark"] = "CALLPARK";
679
- DnRangeType["huntgroup"] = "HUNTGROUP";
680
- DnRangeType["meetme"] = "MEETME";
681
- DnRangeType["did"] = "DID";
682
- })(DnRangeType || (DnRangeType = {}));
683
- var UserViewType;
684
- (function (UserViewType) {
685
- UserViewType[UserViewType["details"] = 0] = "details";
686
- UserViewType[UserViewType["devices"] = 1] = "devices";
687
- UserViewType[UserViewType["lines"] = 2] = "lines";
688
- UserViewType[UserViewType["snr"] = 3] = "snr";
689
- UserViewType[UserViewType["features"] = 4] = "features";
690
- UserViewType[UserViewType["overview"] = 5] = "overview";
691
- })(UserViewType || (UserViewType = {}));
692
-
693
- const ENTITY_CHANGE_TYPE = {
694
- ADDED: 'added',
695
- UPDATED: 'updated',
696
- EXISTING: 'existing',
697
- REMOVED: 'removed',
698
- };
699
- function deepClone(value) {
700
- return JSON.parse(JSON.stringify(value));
701
- }
702
- function toApiBooleanString(value) {
703
- if (value === true || value === 'true') {
704
- return 'true';
705
- }
706
- if (value === false || value === 'false') {
707
- return 'false';
708
- }
709
- return value == null || value === '' ? '' : String(value);
710
- }
711
- function toApiStringValue(value) {
712
- if (value === true) {
713
- return 'true';
714
- }
715
- if (value === false) {
716
- return 'false';
717
- }
718
- return value == null ? '' : String(value);
719
- }
720
- function normalizeCallInfoDisplay(callInfoDisplay) {
721
- if (!callInfoDisplay) {
722
- return null;
723
- }
724
- if (typeof callInfoDisplay === 'string') {
725
- try {
726
- const parsed = JSON.parse(callInfoDisplay);
727
- return normalizeCallInfoDisplay(parsed);
728
- }
729
- catch (_a) {
730
- return null;
731
- }
732
- }
733
- if (typeof callInfoDisplay !== 'object') {
734
- return null;
735
- }
736
- const source = callInfoDisplay;
737
- return {
738
- callerName: source['callerName'] != null ? toApiBooleanString(source['callerName']) : null,
739
- callerNumber: source['callerNumber'] != null ? toApiBooleanString(source['callerNumber']) : null,
740
- redirectedNumber: source['redirectedNumber'] != null ? toApiBooleanString(source['redirectedNumber']) : null,
741
- dialedNumber: source['dialedNumber'] != null ? toApiBooleanString(source['dialedNumber']) : null,
742
- };
743
- }
744
- function normalizeDidPattern(didPattern, line, directoryNumber) {
745
- var _a;
746
- if (didPattern && typeof didPattern === 'object') {
747
- return didPattern;
748
- }
749
- if (typeof didPattern === 'string' && didPattern.trim()) {
750
- return { calledPartyTransformationMask: didPattern };
751
- }
752
- const dn = directoryNumber || ((_a = line === null || line === void 0 ? void 0 : line.directoryNumber) === null || _a === void 0 ? void 0 : _a.directoryNumber);
753
- if (dn) {
754
- return { calledPartyTransformationMask: dn };
755
- }
756
- return null;
757
- }
758
- function normalizeDirectoryNumber(directoryNumber) {
759
- var _a, _b, _c;
760
- const { displayValue: _displayValue } = directoryNumber, rest = __rest(directoryNumber, ["displayValue"]);
761
- return {
762
- directoryNumber: (_a = rest.directoryNumber) !== null && _a !== void 0 ? _a : '',
763
- routePartitionName: (_b = rest.routePartitionName) !== null && _b !== void 0 ? _b : '',
764
- templateDirectoryNumber: rest.templateDirectoryNumber,
765
- pkid: rest.pkid || null,
766
- dnType: rest.dnType || null,
767
- subType: (_c = rest.subType) !== null && _c !== void 0 ? _c : null,
768
- };
769
- }
770
- function prepareLineAssociation(association, line) {
771
- var _a, _b, _c, _d;
772
- const prepared = deepClone(association);
773
- const lineDn = line === null || line === void 0 ? void 0 : line.directoryNumber;
774
- if (lineDn) {
775
- prepared.directoryNumber = Object.assign(Object.assign({}, prepared.directoryNumber), { directoryNumber: lineDn.directoryNumber || '', routePartitionName: lineDn.routePartitionName || '', templateDirectoryNumber: (_a = lineDn.templateDirectoryNumber) !== null && _a !== void 0 ? _a : (_b = prepared.directoryNumber) === null || _b === void 0 ? void 0 : _b.templateDirectoryNumber });
776
- }
777
- prepared.directoryNumber = normalizeDirectoryNumber(prepared.directoryNumber);
778
- prepared.entityChangeType = prepared.entityChangeType || ENTITY_CHANGE_TYPE.ADDED;
779
- prepared.logMissedCall = toApiBooleanString(prepared.logMissedCall);
780
- prepared.callInfoDisplay = normalizeCallInfoDisplay(prepared.callInfoDisplay);
781
- prepared.didPattern = normalizeDidPattern(prepared.didPattern, line, (_c = prepared.directoryNumber) === null || _c === void 0 ? void 0 : _c.directoryNumber);
782
- prepared.visualMWI = toApiStringValue(prepared.visualMWI);
783
- prepared.audibleMWI = toApiStringValue(prepared.audibleMWI);
784
- prepared.associated = (_d = prepared.associated) !== null && _d !== void 0 ? _d : true;
785
- return prepared;
786
- }
787
- function prepareLine(line) {
788
- const prepared = deepClone(line);
789
- prepared.entityChangeType = prepared.entityChangeType || ENTITY_CHANGE_TYPE.ADDED;
790
- if (prepared.directoryNumber) {
791
- prepared.directoryNumber = normalizeDirectoryNumber(prepared.directoryNumber);
792
- }
793
- return prepared;
794
- }
795
- function syncDeviceLineAssociations(device, lines) {
796
- device.lineAssociations = (device.lineAssociations || []).map((association, index) => prepareLineAssociation(association, lines[index]));
797
- }
798
- function prepareDeviceForSave(device, userId, lines, deviceName) {
799
- var _a;
800
- const prepared = deepClone(device);
801
- const resolvedName = deviceName.trim();
802
- prepared.name = resolvedName;
803
- prepared.newName = resolvedName;
804
- prepared.entityChangeType = prepared.entityChangeType || ENTITY_CHANGE_TYPE.ADDED;
805
- prepared.createDeviceMode = (_a = prepared.createDeviceMode) !== null && _a !== void 0 ? _a : false;
806
- if (prepared.extraOptions) {
807
- prepared.extraOptions.mobilityUserId = userId;
808
- }
809
- syncDeviceLineAssociations(prepared, lines);
810
- return prepared;
811
- }
812
- function resolvePrimaryLineReference(user) {
813
- var _a, _b, _c, _d, _e, _f;
814
- const firstDeviceAssociation = (_d = (_c = (_b = (_a = user.devices) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.lineAssociations) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.directoryNumber;
815
- if (firstDeviceAssociation) {
816
- return firstDeviceAssociation;
817
- }
818
- const firstLineDn = (_f = (_e = user.lines) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.directoryNumber;
819
- return firstLineDn !== null && firstLineDn !== void 0 ? firstLineDn : null;
820
- }
821
- function buildSavableEndUser(endUser, lines, devices, deviceProfiles, form, options = {}) {
822
- const user = deepClone(endUser);
823
- user.userid = form.userId || user.userid || '';
824
- user.firstName = form.firstName || user.firstName || '';
825
- user.lastName = form.lastName || user.lastName || '';
826
- user.email = form.email || user.email || '';
827
- user.createUserMode = false;
828
- user.lines = (lines || []).map(line => prepareLine(line));
829
- user.devices = (devices || []).map((device, index) => { var _a, _b, _c, _d; return prepareDeviceForSave(device, user.userid || '', user.lines, (_d = (_c = (_b = (_a = options.resolveDeviceName) === null || _a === void 0 ? void 0 : _a.call(options, index, device)) !== null && _b !== void 0 ? _b : device.name) !== null && _c !== void 0 ? _c : device.newName) !== null && _d !== void 0 ? _d : ''); });
830
- user.deviceProfiles = (deviceProfiles || []).map((profile, index) => { var _a, _b, _c, _d; return prepareDeviceForSave(profile, user.userid || '', user.lines, (_d = (_c = (_b = (_a = options.resolveDeviceProfileName) === null || _a === void 0 ? void 0 : _a.call(options, index, profile)) !== null && _b !== void 0 ? _b : profile.name) !== null && _c !== void 0 ? _c : profile.newName) !== null && _d !== void 0 ? _d : ''); });
831
- user.primaryLineReference = resolvePrimaryLineReference(user);
832
- const snr = user.singleNumberReach;
833
- if (snr && !snr.remoteDestinationProfileName) {
834
- user.singleNumberReach = null;
835
- }
836
- return user;
837
- }
838
-
839
- /**
840
- * Strips a leading device-prefix group from `deviceNameRegex`, returning the pattern
841
- * to validate the name field value (without matPrefix).
842
- *
843
- * - `([sS][eE][pP]|BAT)[0-9a-fA-F]{12}` → `[0-9a-fA-F]{12}`
844
- * - `[a-zA-Z0-9]{1,15}` → `[a-zA-Z0-9]{1,15}` (unchanged)
845
- */
846
- function parseDeviceNameRegexBody(deviceNameRegex) {
847
- var _a;
848
- const fullRegex = (_a = deviceNameRegex === null || deviceNameRegex === void 0 ? void 0 : deviceNameRegex.trim()) !== null && _a !== void 0 ? _a : '';
849
- if (!fullRegex) {
850
- return '';
851
- }
852
- return stripLeadingPrefixGroup(fullRegex);
853
- }
854
- function stripLeadingPrefixGroup(regex) {
855
- var _a, _b;
856
- const parenMatch = regex.match(/^(\(.+?\))(.+)$/s);
857
- if ((_a = parenMatch === null || parenMatch === void 0 ? void 0 : parenMatch[2]) === null || _a === void 0 ? void 0 : _a.trim()) {
858
- return parenMatch[2];
859
- }
860
- const literalMatch = regex.match(/^([A-Za-z]+)(\[.+\])$/s);
861
- if ((_b = literalMatch === null || literalMatch === void 0 ? void 0 : literalMatch[2]) === null || _b === void 0 ? void 0 : _b.trim()) {
862
- return literalMatch[2];
863
- }
864
- return regex;
865
- }
866
-
867
393
  class UserCreationWizardService {
868
- get currentSite() {
869
- return this._currentSite;
870
- }
871
- get firstLineRoutePartition() {
872
- var _a, _b, _c;
873
- return (_c = (_b = (_a = this.lines[0]) === null || _a === void 0 ? void 0 : _a.directoryNumber) === null || _b === void 0 ? void 0 : _b.routePartitionName) !== null && _c !== void 0 ? _c : '';
874
- }
875
- get siteDefaultRoutePartition() {
876
- var _a;
877
- return ((_a = this.siteDefaults) === null || _a === void 0 ? void 0 : _a.routePartition) || '';
878
- }
879
- get routePartitionNamesList() {
880
- return this.siteDefaults ? this.siteDefaults.routePartitionFilter : [];
881
- }
882
394
  constructor() {
883
- this.userCreationApiService = inject(UserCreationApiService);
395
+ this.api = inject(UserCreationApiService);
884
396
  this.ldapTableColumns = ['userId', 'firstName', 'lastName', 'email', 'add'];
885
397
  this.userCreationTypes = ['CUCM', 'MT'];
886
- this.template = null;
887
- this.endUser = null;
888
- this.lines = [];
889
- this.devices = [];
890
- this.deviceProfiles = [];
891
- this.templateLinesSnapshot = null;
892
- this._currentSite = null;
893
398
  this.siteOptions = [];
894
399
  this.templateOptions = [];
895
400
  this.lineOptions = [];
@@ -899,92 +404,40 @@ class UserCreationWizardService {
899
404
  this.overviewUsers = [];
900
405
  this.overviewLines = [];
901
406
  this.overviewDevices = [];
902
- this.overviewDeviceProfiles = [];
903
- this.userDetailsFormValue = null;
904
407
  this.userDetailsForm = {
905
408
  userId: '',
906
409
  firstName: '',
907
410
  lastName: '',
908
- email: '',
411
+ email: ''
909
412
  };
910
413
  this.lineSelections = [];
911
414
  this.deviceEntries = [];
912
- this.availableNumbers = [];
913
- this.deviceTypes = [];
914
- this.siteDefaults = null;
915
- this.originalSiteDefaults = null;
916
- this.templateLines = [];
917
- this.templateDevices = [];
918
- this.templateUserDetails = {};
919
415
  this.selectedSite = null;
920
- this.selectedTemplateName = null;
921
- this.selectedTemplateId = null;
416
+ this.selectedTemplate = null;
922
417
  this.selectedUserCreationType = 'CUCM';
923
- this.availableDidPatternsMappedToDn = {};
924
- this.deviceDefaultsLoadedSubject = new Subject();
925
- this.deviceDefaultsLoaded$ = this.deviceDefaultsLoadedSubject.asObservable();
926
- this.selectedLdapUser = null;
927
- this.ldapUsersTotal = 0;
928
- // this.loadPlaceholderData();
929
- }
930
- get isLdapIntegrated() {
931
- var _a;
932
- return !!((_a = this.endUser) === null || _a === void 0 ? void 0 : _a.ldapIntegrated);
933
- }
934
- selectLdapUser(user) {
935
- var _a, _b, _c, _d, _e, _f;
936
- this.selectedLdapUser = user;
937
- if (this.endUser) {
938
- this.endUser.ldapIntegrated = true;
939
- this.endUser.userid = user.userid;
940
- this.endUser.firstName = (_a = user.firstName) !== null && _a !== void 0 ? _a : '';
941
- this.endUser.lastName = (_b = user.lastName) !== null && _b !== void 0 ? _b : '';
942
- this.endUser.email = (_c = user.email) !== null && _c !== void 0 ? _c : '';
943
- }
944
- this.userDetailsForm = {
945
- userId: user.userid,
946
- firstName: (_d = user.firstName) !== null && _d !== void 0 ? _d : '',
947
- lastName: (_e = user.lastName) !== null && _e !== void 0 ? _e : '',
948
- email: (_f = user.email) !== null && _f !== void 0 ? _f : '',
949
- };
950
- this.rebuildOverviewUsers();
418
+ this.addedLdapUserIds = new Set();
419
+ this.loadPlaceholderData();
951
420
  }
952
- clearLdapUserSelection() {
953
- this.selectedLdapUser = null;
954
- if (this.endUser) {
955
- this.endUser.ldapIntegrated = false;
956
- this.endUser.userid = '';
957
- this.endUser.firstName = '';
958
- this.endUser.lastName = '';
959
- this.endUser.email = '';
960
- }
421
+ addLdapUser(row) {
961
422
  this.userDetailsForm = {
962
- userId: '',
963
- firstName: '',
964
- lastName: '',
965
- email: '',
423
+ userId: row.userId,
424
+ firstName: row.firstName,
425
+ lastName: row.lastName,
426
+ email: row.email
966
427
  };
428
+ this.addedLdapUserIds.add(row.userId);
967
429
  this.rebuildOverviewUsers();
968
430
  }
969
- isLdapUserRowSelected(row) {
970
- var _a;
971
- return ((_a = this.selectedLdapUser) === null || _a === void 0 ? void 0 : _a.userid) === row.userid;
972
- }
973
- setLdapUsersResult(users, total) {
974
- this.ldapUsers = users;
975
- this.ldapUsersTotal = total;
431
+ isLdapUserAdded(row) {
432
+ return this.addedLdapUserIds.has(row.userId);
976
433
  }
977
434
  setSelectedSite(site) {
978
- this.selectedSite = site || null;
435
+ this.selectedSite = site;
979
436
  }
980
437
  setSelectedTemplate(template) {
981
- this.selectedTemplateName = (template === null || template === void 0 ? void 0 : template.name) || null;
982
- this.selectedTemplateId = (template === null || template === void 0 ? void 0 : template.id) || null;
438
+ this.selectedTemplate = template;
983
439
  this.rebuildOverviewUsers();
984
440
  }
985
- setCurrentSite(site) {
986
- this._currentSite = site;
987
- }
988
441
  resetTemplateDrivenData() {
989
442
  this.lineOptions = [];
990
443
  this.routePartitionOptions = [];
@@ -995,169 +448,84 @@ class UserCreationWizardService {
995
448
  this.rebuildOverviewDevices();
996
449
  }
997
450
  applyTemplateTokenPayload(payload) {
998
- var _a, _b, _c, _d;
999
- this.template = this.extractTemplateFromTokenPayload(payload);
1000
- this.endUser = ((_a = this.template) === null || _a === void 0 ? void 0 : _a.endUser) || null;
1001
- this.lines = this.endUser && Array.isArray((_b = this.endUser) === null || _b === void 0 ? void 0 : _b.lines) ? this.endUser.lines : [];
1002
- this.devices = this.endUser && Array.isArray((_c = this.endUser) === null || _c === void 0 ? void 0 : _c.devices) ? this.endUser.devices : [];
1003
- this.deviceProfiles = this.endUser && Array.isArray((_d = this.endUser) === null || _d === void 0 ? void 0 : _d.deviceProfiles) ? this.endUser.deviceProfiles : [];
1004
- this.initTemplateDnsNamesForLines();
1005
- // this.userDetailsForm = {
1006
- // userId: this.valueToString(this.endUser?.userid ?? ''),
1007
- // firstName: this.valueToString(this.endUser?.firstName ?? ''),
1008
- // lastName: this.valueToString(this.endUser?.lastName ?? ''),
1009
- // email: this.valueToString(this.endUser?.email ?? '')
1010
- // };
1011
- // const mappedLineOptions: LineOption[] = linesFromTemplate
1012
- // .map(line => ({
1013
- // number: this.valueToString(line?.directoryNumber?.directoryNumber),
1014
- // did: this.valueToString(line?.didPatterns?.[0]?.pattern || line?.directoryNumber?.directoryNumber),
1015
- // css: this.valueToString(
1016
- // typeof line?.callingSearchSpace === 'string'
1017
- // ? line.callingSearchSpace
1018
- // : line?.callingSearchSpace?.name
1019
- // ),
1020
- // description: this.valueToString(line?.description)
1021
- // }))
1022
- // .filter(line => line.number.trim().length > 0);
1023
- this.devices.forEach(device => this.initDeviceWithSiteInfo(device));
1024
- this.deviceProfiles.forEach(device => this.initDeviceWithSiteInfo(device));
1025
- this.lines.forEach(line => this.initLineWithSiteInfo(line));
1026
- this.captureTemplateLinesSnapshot();
1027
- if (this.selectedSite) {
1028
- this.loadDeviceDefaultsForDevices(this.selectedSite).subscribe();
1029
- }
1030
- // if (mappedLineOptions.length) {
1031
- // this.lineOptions = this.uniqueByNumber(mappedLineOptions);
1032
- // this.lineSelections = this.lineOptions.map(line => ({
1033
- // lineNumber: line.number,
1034
- // routePartitionName: linesFromTemplate.find(
1035
- // source => (source?.directoryNumber?.directoryNumber || '') === line.number
1036
- // )?.directoryNumber?.routePartitionName || null
1037
- // }));
1038
- // } else {
1039
- // const lineAssociations = devicesFromTemplate.flatMap(device => device.lineAssociations || []);
1040
- // const associatedLineOptions: LineOption[] = lineAssociations
1041
- // .map(association => {
1042
- // const number = association?.directoryNumber?.directoryNumber || '';
1043
- // return {
1044
- // number,
1045
- // did: number,
1046
- // css: '',
1047
- // description: ''
1048
- // };
1049
- // })
1050
- // .filter(line => line.number.trim().length > 0);
1051
- // this.lineOptions = this.uniqueByNumber(associatedLineOptions);
1052
- // this.lineSelections = this.lineOptions.map(line => ({
1053
- // lineNumber: line.number,
1054
- // routePartitionName: lineAssociations.find(
1055
- // source => (source?.directoryNumber?.directoryNumber || '') === line.number
1056
- // )?.directoryNumber?.routePartitionName || null
1057
- // }));
1058
- // this.templateLines.forEach((line: any) => this.initLineWithSiteInfo(line));
1059
- // this.initTemplateDnsNamesForLines(this.templateLines);
1060
- // }
1061
- // const routePartitions = this.lineSelections
1062
- // .map(line => line.routePartitionName)
1063
- // .filter((value): value is string => !!value && value.trim().length > 0);
1064
- // this.routePartitionOptions = this.uniqueStrings(routePartitions);
1065
- // this.deviceEntries = devicesFromTemplate.map(device => ({
1066
- // deviceType: this.valueToString(device.deviceType),
1067
- // protocol: this.valueToString(device.protocol),
1068
- // buttonTemplate: this.valueToString(device.buttonTemplate),
1069
- // name: this.valueToString(device.name)
1070
- // }));
1071
- // this.deviceRows = this.deviceEntries.map((_, index) => index + 1);
1072
- // this.rebuildOverviewUsers();
1073
- // this.rebuildOverviewLines();
1074
- // this.rebuildOverviewDevices();
1075
- }
1076
- setSelectedUserCreationType(type) {
1077
- this.selectedUserCreationType = type;
1078
- }
1079
- resetUserDetailsStepState() {
1080
- this.userDetailsFormValue = null;
451
+ const template = this.extractTemplateFromTokenPayload(payload);
452
+ const endUser = (template === null || template === void 0 ? void 0 : template.endUser) || {};
453
+ const linesFromTemplate = Array.isArray(endUser.lines) ? endUser.lines : [];
454
+ const devicesFromTemplate = Array.isArray(endUser.devices) ? endUser.devices : [];
1081
455
  this.userDetailsForm = {
1082
- userId: '',
1083
- firstName: '',
1084
- lastName: '',
1085
- email: '',
456
+ userId: this.valueToString(endUser.userid),
457
+ firstName: this.valueToString(endUser.firstName),
458
+ lastName: this.valueToString(endUser.lastName),
459
+ email: this.valueToString(endUser.email)
1086
460
  };
1087
- this.selectedLdapUser = null;
1088
- this.ldapUsers = [];
1089
- this.ldapUsersTotal = 0;
1090
- if (this.templateLinesSnapshot) {
1091
- this.lines = JSON.parse(JSON.stringify(this.templateLinesSnapshot));
461
+ const mappedLineOptions = linesFromTemplate
462
+ .map(line => {
463
+ var _a, _b, _c, _d, _e;
464
+ return ({
465
+ number: this.valueToString((_a = line === null || line === void 0 ? void 0 : line.directoryNumber) === null || _a === void 0 ? void 0 : _a.directoryNumber),
466
+ did: this.valueToString(((_c = (_b = line === null || line === void 0 ? void 0 : line.didPatterns) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.pattern) || ((_d = line === null || line === void 0 ? void 0 : line.directoryNumber) === null || _d === void 0 ? void 0 : _d.directoryNumber)),
467
+ css: this.valueToString(typeof (line === null || line === void 0 ? void 0 : line.callingSearchSpace) === 'string'
468
+ ? line.callingSearchSpace
469
+ : (_e = line === null || line === void 0 ? void 0 : line.callingSearchSpace) === null || _e === void 0 ? void 0 : _e.name),
470
+ description: this.valueToString(line === null || line === void 0 ? void 0 : line.description)
471
+ });
472
+ })
473
+ .filter(line => line.number.trim().length > 0);
474
+ if (mappedLineOptions.length) {
475
+ this.lineOptions = this.uniqueByNumber(mappedLineOptions);
476
+ this.lineSelections = this.lineOptions.map(line => {
477
+ var _a, _b;
478
+ return ({
479
+ lineNumber: line.number,
480
+ routePartitionName: ((_b = (_a = linesFromTemplate.find(source => { var _a; return (((_a = source === null || source === void 0 ? void 0 : source.directoryNumber) === null || _a === void 0 ? void 0 : _a.directoryNumber) || '') === line.number; })) === null || _a === void 0 ? void 0 : _a.directoryNumber) === null || _b === void 0 ? void 0 : _b.routePartitionName) || null
481
+ });
482
+ });
1092
483
  }
1093
- this.devices.forEach(device => {
1094
- device.name = '';
1095
- });
1096
- this.deviceProfiles.forEach(profile => {
1097
- profile.name = '';
1098
- });
1099
- if (this.endUser) {
1100
- this.endUser.userid = '';
1101
- this.endUser.firstName = '';
1102
- this.endUser.lastName = '';
1103
- this.endUser.email = '';
1104
- this.endUser.ldapIntegrated = false;
1105
- this.endUser.lines = this.lines;
484
+ else {
485
+ const lineAssociations = devicesFromTemplate.flatMap(device => device.lineAssociations || []);
486
+ const associatedLineOptions = lineAssociations
487
+ .map(association => {
488
+ var _a;
489
+ const number = ((_a = association === null || association === void 0 ? void 0 : association.directoryNumber) === null || _a === void 0 ? void 0 : _a.directoryNumber) || '';
490
+ return {
491
+ number,
492
+ did: number,
493
+ css: '',
494
+ description: ''
495
+ };
496
+ })
497
+ .filter(line => line.number.trim().length > 0);
498
+ this.lineOptions = this.uniqueByNumber(associatedLineOptions);
499
+ this.lineSelections = this.lineOptions.map(line => {
500
+ var _a, _b;
501
+ return ({
502
+ lineNumber: line.number,
503
+ routePartitionName: ((_b = (_a = lineAssociations.find(source => { var _a; return (((_a = source === null || source === void 0 ? void 0 : source.directoryNumber) === null || _a === void 0 ? void 0 : _a.directoryNumber) || '') === line.number; })) === null || _a === void 0 ? void 0 : _a.directoryNumber) === null || _b === void 0 ? void 0 : _b.routePartitionName) || null
504
+ });
505
+ });
1106
506
  }
1107
- this.overviewUsers = [];
507
+ const routePartitions = this.lineSelections
508
+ .map(line => line.routePartitionName)
509
+ .filter((value) => !!value && value.trim().length > 0);
510
+ this.routePartitionOptions = this.uniqueStrings(routePartitions);
511
+ this.deviceEntries = devicesFromTemplate.map(device => ({
512
+ deviceType: this.valueToString(device.deviceType),
513
+ protocol: this.valueToString(device.protocol),
514
+ buttonTemplate: this.valueToString(device.buttonTemplate),
515
+ name: this.valueToString(device.name)
516
+ }));
517
+ this.deviceRows = this.deviceEntries.map((_, index) => index + 1);
518
+ this.rebuildOverviewUsers();
1108
519
  this.rebuildOverviewLines();
1109
520
  this.rebuildOverviewDevices();
1110
- this.rebuildOverviewDeviceProfiles();
1111
521
  }
1112
- captureTemplateLinesSnapshot() {
1113
- this.templateLinesSnapshot = JSON.parse(JSON.stringify(this.lines));
522
+ setSelectedUserCreationType(type) {
523
+ this.selectedUserCreationType = type;
1114
524
  }
1115
525
  setUserDetailsField(field, value) {
1116
526
  this.userDetailsForm = Object.assign(Object.assign({}, this.userDetailsForm), { [field]: value });
1117
527
  this.rebuildOverviewUsers();
1118
528
  }
1119
- applyUserDetailsFormValue(formValue) {
1120
- var _a, _b, _c;
1121
- this.userDetailsFormValue = formValue;
1122
- this.userDetailsForm = {
1123
- userId: formValue.userId || '',
1124
- firstName: formValue.firstName || '',
1125
- lastName: formValue.lastName || '',
1126
- email: formValue.email || '',
1127
- };
1128
- (_a = formValue.lines) === null || _a === void 0 ? void 0 : _a.forEach((lineValue, index) => {
1129
- const line = this.lines[index];
1130
- if (!(line === null || line === void 0 ? void 0 : line.directoryNumber)) {
1131
- return;
1132
- }
1133
- line.directoryNumber.directoryNumber = lineValue.number || '';
1134
- line.directoryNumber.routePartitionName = lineValue.routePartition || '';
1135
- });
1136
- (_b = formValue.devices) === null || _b === void 0 ? void 0 : _b.forEach((deviceValue, index) => {
1137
- const device = this.devices[index];
1138
- if (!device) {
1139
- return;
1140
- }
1141
- device.name = deviceValue.name || '';
1142
- });
1143
- (_c = formValue.deviceProfiles) === null || _c === void 0 ? void 0 : _c.forEach((profileValue, index) => {
1144
- const profile = this.deviceProfiles[index];
1145
- if (!profile) {
1146
- return;
1147
- }
1148
- profile.name = profileValue.name || '';
1149
- });
1150
- if (this.endUser) {
1151
- this.endUser.userid = formValue.userId || '';
1152
- this.endUser.firstName = formValue.firstName || '';
1153
- this.endUser.lastName = formValue.lastName || '';
1154
- this.endUser.email = formValue.email || '';
1155
- }
1156
- this.rebuildOverviewUsers();
1157
- this.rebuildOverviewLines();
1158
- this.rebuildOverviewDevices();
1159
- this.rebuildOverviewDeviceProfiles();
1160
- }
1161
529
  setLineSelection(index, lineNumber) {
1162
530
  if (!this.lineSelections[index]) {
1163
531
  return;
@@ -1199,86 +567,64 @@ class UserCreationWizardService {
1199
567
  }
1200
568
  return entry.name || '';
1201
569
  }
1202
- getSiteAllData(siteId) {
1203
- return this.userCreationApiService.getSiteAllData(siteId).pipe(tap((res) => {
1204
- if (res && res[0]) {
1205
- const site = new Site(res[0]);
1206
- this.selectedSite = site.id;
570
+ // Placeholder bootstrap until backend APIs are connected.
571
+ loadPlaceholderData() {
572
+ var _a;
573
+ this.siteOptions = ['Site 1', 'Site 2', 'Site 3'];
574
+ this.templateOptions = ['User 8851 Office'];
575
+ this.lineOptions = [
576
+ {
577
+ number: '557046',
578
+ did: '+13125557046',
579
+ css: 'Atlanta_internal_css',
580
+ description: ''
581
+ },
582
+ {
583
+ number: '557047',
584
+ did: '+13125557047',
585
+ css: 'Atlanta_internal_css',
586
+ description: ''
587
+ },
588
+ {
589
+ number: '557048',
590
+ did: '+13125557048',
591
+ css: 'Atlanta_internal_css',
592
+ description: ''
1207
593
  }
1208
- if (res && res[1]) {
1209
- this.siteDefaults = new SiteDefaults(res[1], false);
1210
- this.originalSiteDefaults = new SiteDefaults(res[1], false);
1211
- this.routePartitionOptions = [...this.routePartitionNamesList];
594
+ ];
595
+ this.routePartitionOptions = ['Atlanta_internal_PT', 'Beijing_national_PT'];
596
+ this.deviceRows = [1, 2];
597
+ this.ldapUsers = [
598
+ { userId: 'John.Doe', firstName: 'John', lastName: 'Doe', email: 'john.doe@car.west.io' },
599
+ { userId: 'Jane.Smith', firstName: 'Jane', lastName: 'Smith', email: 'jane.smith@car.west.io' }
600
+ ];
601
+ this.lineSelections = [
602
+ {
603
+ lineNumber: null,
604
+ routePartitionName: this.routePartitionOptions[0] || null
1212
605
  }
1213
- if (res && res[2]) {
1214
- this.deviceTypes = res[2];
606
+ ];
607
+ this.deviceEntries = [
608
+ {
609
+ deviceType: 'Cisco 8851',
610
+ protocol: 'SIP',
611
+ buttonTemplate: 'Standard 8851 SIP',
612
+ name: ''
613
+ },
614
+ {
615
+ deviceType: 'Cisco Unified Client Services Framework',
616
+ protocol: 'SIP',
617
+ buttonTemplate: 'Standard Client Services Framework',
618
+ name: ''
1215
619
  }
1216
- }), switchMap(res => this.loadDeviceDefaultsForDevices(siteId).pipe(map(() => res))));
1217
- }
1218
- loadDeviceDefaultsForDevices(siteId) {
1219
- const deviceTypes = this.getUniqueDeviceTypes();
1220
- if (!deviceTypes.length) {
1221
- return of(undefined);
1222
- }
1223
- const requests = deviceTypes.map(deviceType => this.userCreationApiService.getDeviceDefaults(String(siteId), deviceType).pipe(tap(defaults => this.applyDeviceDefaultsToType(deviceType, defaults)), catchError(() => of(null))));
1224
- return forkJoin(requests).pipe(tap(() => this.deviceDefaultsLoadedSubject.next()), map(() => undefined));
1225
- }
1226
- getUniqueDeviceTypes() {
1227
- const types = [
1228
- ...this.devices.map(device => device.deviceType),
1229
- ...this.deviceProfiles.map(profile => profile.deviceType),
1230
- ].filter((type) => !!type && type.trim().length > 0);
1231
- return [...new Set(types)];
1232
- }
1233
- applyDeviceDefaultsToType(deviceType, defaults) {
1234
- const nameValidationRegex = parseDeviceNameRegexBody(defaults.deviceNameRegex);
1235
- const targets = [...this.devices, ...this.deviceProfiles].filter(device => device.deviceType === deviceType);
1236
- targets.forEach(device => {
1237
- device.deviceDefaults = defaults;
1238
- device.nameValidationRegex = nameValidationRegex;
1239
- device.nameValidationCaption = defaults.deviceNameExplained;
1240
- });
1241
- }
1242
- getDeviceNamePrefix(deviceIndex, isProfile = false) {
1243
- var _a;
1244
- const device = isProfile ? this.deviceProfiles[deviceIndex] : this.devices[deviceIndex];
1245
- const prefix = (_a = device === null || device === void 0 ? void 0 : device.prefix) === null || _a === void 0 ? void 0 : _a.trim();
1246
- return prefix || null;
1247
- }
1248
- getDeviceNameValidationCaption(deviceIndex, isProfile = false) {
1249
- var _a;
1250
- const device = isProfile ? this.deviceProfiles[deviceIndex] : this.devices[deviceIndex];
1251
- return (device === null || device === void 0 ? void 0 : device.nameValidationCaption) || ((_a = device === null || device === void 0 ? void 0 : device.deviceDefaults) === null || _a === void 0 ? void 0 : _a.deviceNameExplained) || '';
1252
- }
1253
- getDeviceNameValidationOptions(deviceIndex, isProfile = false) {
1254
- var _a, _b;
1255
- const device = isProfile ? this.deviceProfiles[deviceIndex] : this.devices[deviceIndex];
1256
- const regex = ((_a = device === null || device === void 0 ? void 0 : device.nameValidationRegex) === null || _a === void 0 ? void 0 : _a.trim()) ||
1257
- parseDeviceNameRegexBody((_b = device === null || device === void 0 ? void 0 : device.deviceDefaults) === null || _b === void 0 ? void 0 : _b.deviceNameRegex);
1258
- if (!regex) {
1259
- return null;
1260
- }
1261
- return {
1262
- regex,
1263
- caption: this.getDeviceNameValidationCaption(deviceIndex, isProfile),
1264
- };
1265
- }
1266
- getNumberRange(siteId, routePartition) {
1267
- this.availableDidPatternsMappedToDn = {};
1268
- const pageSize = 9999;
1269
- const params = { dntype: DnRangeType.extension, routepartition: routePartition, size: pageSize, page: 0 };
1270
- this.availableNumbers = [];
1271
- return this.userCreationApiService.getAvailableDnInRanges(siteId, params)
1272
- .pipe(map((res) => {
1273
- res.availableNumberList.forEach((availableNumber) => {
1274
- this.setAvailableDidMappedToDn(availableNumber);
1275
- this.availableNumbers = [...this.availableNumbers, ...this.getUnwrapNumberRange(availableNumber)];
1276
- });
1277
- }));
1278
- // .pipe(this.handleError(true, false));
620
+ ];
621
+ this.selectedTemplate = (_a = this.selectedTemplate) !== null && _a !== void 0 ? _a : null;
622
+ this.rebuildOverviewUsers();
623
+ this.rebuildOverviewLines();
624
+ this.rebuildOverviewDevices();
1279
625
  }
1280
626
  rebuildOverviewUsers() {
1281
- const userTemplate = this.selectedTemplateName || '';
627
+ const userTemplate = this.selectedTemplate || '';
1282
628
  const hasUserData = Object.values(this.userDetailsForm).some(value => value.trim().length > 0);
1283
629
  this.overviewUsers = hasUserData
1284
630
  ? [{
@@ -1291,24 +637,6 @@ class UserCreationWizardService {
1291
637
  : [];
1292
638
  }
1293
639
  rebuildOverviewLines() {
1294
- var _a;
1295
- const formLines = (_a = this.userDetailsFormValue) === null || _a === void 0 ? void 0 : _a.lines;
1296
- if (formLines === null || formLines === void 0 ? void 0 : formLines.length) {
1297
- this.overviewLines = formLines
1298
- .filter(line => { var _a; return !!((_a = line === null || line === void 0 ? void 0 : line.number) === null || _a === void 0 ? void 0 : _a.trim()); })
1299
- .map((lineValue, index) => {
1300
- const templateLine = this.lines[index];
1301
- const css = this.valueToString(templateLine === null || templateLine === void 0 ? void 0 : templateLine.callingSearchSpace);
1302
- return {
1303
- number: lineValue.number,
1304
- did: lineValue.lineNumber || lineValue.number,
1305
- routePartitionName: lineValue.routePartition || '',
1306
- css,
1307
- description: this.valueToString(templateLine === null || templateLine === void 0 ? void 0 : templateLine.description),
1308
- };
1309
- });
1310
- return;
1311
- }
1312
640
  this.overviewLines = this.lineSelections
1313
641
  .map(selection => {
1314
642
  if (!(selection === null || selection === void 0 ? void 0 : selection.lineNumber)) {
@@ -1329,20 +657,7 @@ class UserCreationWizardService {
1329
657
  .filter((line) => !!line);
1330
658
  }
1331
659
  rebuildOverviewDevices() {
1332
- var _a;
1333
660
  const selectedLineNumbers = this.overviewLines.map(line => line.number).join(', ');
1334
- const formDevices = (_a = this.userDetailsFormValue) === null || _a === void 0 ? void 0 : _a.devices;
1335
- if (formDevices === null || formDevices === void 0 ? void 0 : formDevices.length) {
1336
- this.overviewDevices = formDevices
1337
- .filter(device => { var _a, _b; return !!((_a = device.deviceType) === null || _a === void 0 ? void 0 : _a.trim()) || !!((_b = device.name) === null || _b === void 0 ? void 0 : _b.trim()); })
1338
- .map(device => ({
1339
- name: device.name || '',
1340
- deviceType: device.deviceType || '',
1341
- lines: selectedLineNumbers,
1342
- description: `${device.protocol || ''} / ${device.buttonTemplate || ''}`.trim(),
1343
- }));
1344
- return;
1345
- }
1346
661
  this.overviewDevices = this.deviceEntries
1347
662
  .map((device, index) => ({
1348
663
  device,
@@ -1356,23 +671,6 @@ class UserCreationWizardService {
1356
671
  description: `${device.protocol} / ${device.buttonTemplate}`
1357
672
  }));
1358
673
  }
1359
- rebuildOverviewDeviceProfiles() {
1360
- var _a;
1361
- const selectedLineNumbers = this.overviewLines.map(line => line.number).join(', ');
1362
- const formProfiles = (_a = this.userDetailsFormValue) === null || _a === void 0 ? void 0 : _a.deviceProfiles;
1363
- if (!(formProfiles === null || formProfiles === void 0 ? void 0 : formProfiles.length)) {
1364
- this.overviewDeviceProfiles = [];
1365
- return;
1366
- }
1367
- this.overviewDeviceProfiles = formProfiles
1368
- .filter(profile => { var _a, _b; return !!((_a = profile.deviceType) === null || _a === void 0 ? void 0 : _a.trim()) || !!((_b = profile.name) === null || _b === void 0 ? void 0 : _b.trim()); })
1369
- .map(profile => ({
1370
- name: profile.name || '',
1371
- deviceType: profile.deviceType || '',
1372
- lines: selectedLineNumbers,
1373
- description: `${profile.protocol || ''} / ${profile.buttonTemplate || ''}`.trim(),
1374
- }));
1375
- }
1376
674
  extractTemplateFromTokenPayload(payload) {
1377
675
  if (!payload || typeof payload !== 'object') {
1378
676
  return null;
@@ -1399,252 +697,10 @@ class UserCreationWizardService {
1399
697
  valueToString(value) {
1400
698
  return typeof value === 'string' ? value : '';
1401
699
  }
1402
- getUnwrapNumberRange(availableNumber) {
1403
- let unwrapNumberRange = this.unwrapNumberRange(availableNumber.phoneNumberRange.from, availableNumber.phoneNumberRange.to)
1404
- .map((unwrappedNumber) => {
1405
- const dn = availableNumber.phoneNumberRange.prefix + unwrappedNumber;
1406
- let str = dn;
1407
- if (this.availableDidPatternsMappedToDn[dn] && this.availableDidPatternsMappedToDn[dn].length > 0) {
1408
- if (this.availableDidPatternsMappedToDn[dn][0]['mappedDids'] && this.availableDidPatternsMappedToDn[dn][0]['mappedDids'].length > 0) {
1409
- str += ' DID: ' + (this.availableDidPatternsMappedToDn[dn][0]['mappedDids'].length > 1 ? 'multiple' :
1410
- this.availableDidPatternsMappedToDn[dn][0]['mappedDids'][0]);
1411
- }
1412
- if (this.availableDidPatternsMappedToDn[dn][0]['vm']) {
1413
- str += ' In Use - VM';
1414
- }
1415
- }
1416
- return str;
1417
- });
1418
- unwrapNumberRange = unwrapNumberRange.filter((unwrappedNumber) => !availableNumber.usedNumbers.includes(unwrappedNumber));
1419
- return unwrapNumberRange;
1420
- }
1421
- unwrapNumberRange(start, end) {
1422
- const regExp = /(^0+)/;
1423
- let leadingZeros = '';
1424
- const matches = start.match(regExp);
1425
- if (matches) {
1426
- leadingZeros = matches[1];
1427
- }
1428
- const startNumeric = new Big(start);
1429
- const endNumeric = new Big(end);
1430
- return Array.from({ length: Number(endNumeric.minus(startNumeric).plus(new Big(1)).toFixed(0)) }, (v, k) => {
1431
- const number = String(startNumeric.plus(new Big(k.toString())).toFixed(0));
1432
- if ((leadingZeros + number).length > start.length) {
1433
- leadingZeros = leadingZeros.substr(1);
1434
- }
1435
- return leadingZeros + number;
1436
- });
1437
- }
1438
- setAvailableDidMappedToDn(availableNumber) {
1439
- if (availableNumber.unUsedNumbersWithDids && availableNumber.unUsedNumbersWithDids.length) {
1440
- availableNumber.unUsedNumbersWithDids.forEach((numberWithDids) => {
1441
- const dn = numberWithDids['unUsedNumber'];
1442
- this.availableDidPatternsMappedToDn[dn] = [{}];
1443
- if (numberWithDids['translationPatternList'] && numberWithDids['translationPatternList'].length > 0) {
1444
- this.availableDidPatternsMappedToDn[dn] = numberWithDids['translationPatternList'];
1445
- this.availableDidPatternsMappedToDn[dn][0]['mappedDids'] = [{}];
1446
- if (numberWithDids['mappedDids'] && numberWithDids['mappedDids'].length > 0) {
1447
- this.availableDidPatternsMappedToDn[dn][0]['mappedDids'] = numberWithDids['mappedDids'];
1448
- }
1449
- }
1450
- this.availableDidPatternsMappedToDn[dn][0]['vm'] = numberWithDids['vm'];
1451
- });
1452
- }
1453
- }
1454
700
  // TODO: replace placeholders with real API integration.
1455
701
  loadDataFromApi() {
1456
702
  // this.api.getWizardBootstrapData().subscribe(...)
1457
703
  }
1458
- initLineWithSiteInfo(line) {
1459
- var _a, _b;
1460
- line.directoryNumber.routePartitionName = ((_a = this.siteDefaults) === null || _a === void 0 ? void 0 : _a.routePartition) || '';
1461
- let callingSearchSpaceVal = ((_b = this.siteDefaults) === null || _b === void 0 ? void 0 : _b.lineCss) || '';
1462
- line.callingSearchSpace = callingSearchSpaceVal;
1463
- }
1464
- // private initTemplateDnsNamesForLines(userLines: TemplateLineLike[]): void {
1465
- // const routePartition = this.siteDefaults?.routePartition || '';
1466
- // if (userLines && userLines.length > 0) {
1467
- // userLines.forEach((line, index) => {
1468
- // line && line.directoryNumber && (line.directoryNumber.templateDirectoryNumber = line.directoryNumber.directoryNumber);
1469
- // line && line.directoryNumber && (line.directoryNumber.directoryNumber = '');
1470
- // return line;
1471
- // });
1472
- // // const routePartition = this.siteDefaults?.routePartition || '';
1473
- // // if (line.lineAssociations && line.lineAssociations.length) {
1474
- // // this.setLineAssociationsForDevice(line, routePartition);
1475
- // // }
1476
- // }
1477
- // this.templateDevices.forEach(device => {
1478
- // if (device.lineAssociations && device.lineAssociations.length) {
1479
- // this.setLineAssociationsForDevice(device, routePartition);
1480
- // }
1481
- // });
1482
- // }
1483
- setLineAssociationsForDevice(device, routePartition) {
1484
- const lineAssociations = device.lineAssociations || [];
1485
- if (lineAssociations && lineAssociations.length) {
1486
- lineAssociations.forEach(lineAssociation => {
1487
- lineAssociation && lineAssociation.directoryNumber && (lineAssociation.directoryNumber.templateDirectoryNumber = lineAssociation.directoryNumber.directoryNumber || '');
1488
- lineAssociation && lineAssociation.directoryNumber && (lineAssociation.directoryNumber.routePartitionName = routePartition);
1489
- });
1490
- }
1491
- }
1492
- initDeviceWithSiteInfo(device) {
1493
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1494
- device.newName = device.name;
1495
- device.name = '';
1496
- if (!device['enabledExtensionMobility']) {
1497
- device.enabledExtensionMobility = (_b = (_a = this.siteDefaults) === null || _a === void 0 ? void 0 : _a.enableEm) !== null && _b !== void 0 ? _b : false;
1498
- }
1499
- else if (device['enabledExtensionMobility'].toString() === 'Yes') {
1500
- device.enabledExtensionMobility = true;
1501
- }
1502
- else if (device['enabledExtensionMobility'].toString() === 'No') {
1503
- device.enabledExtensionMobility = false;
1504
- }
1505
- if (device.location) {
1506
- const replacedValue = (_e = this.replaceDynamicValueSiteInfo(device.location, (_d = (_c = this.currentSite) === null || _c === void 0 ? void 0 : _c.shortName) !== null && _d !== void 0 ? _d : '')) !== null && _e !== void 0 ? _e : null;
1507
- device.location = replacedValue;
1508
- }
1509
- if (device.location) {
1510
- const replacedValue = (_h = this.replaceDynamicValueSiteInfo(device.devicePoolName, (_g = (_f = this.currentSite) === null || _f === void 0 ? void 0 : _f.shortName) !== null && _g !== void 0 ? _g : '')) !== null && _h !== void 0 ? _h : null;
1511
- device.devicePoolName = replacedValue;
1512
- }
1513
- if (device.location) {
1514
- const replacedValue = (_l = this.replaceDynamicValueSiteInfo(device.callingSearchSpaceName, (_k = (_j = this.currentSite) === null || _j === void 0 ? void 0 : _j.shortName) !== null && _k !== void 0 ? _k : '')) !== null && _l !== void 0 ? _l : null;
1515
- device.callingSearchSpaceName = replacedValue;
1516
- }
1517
- if (device.extraOptions) {
1518
- const replacedValue = (_p = this.replaceDynamicValueSiteInfo(device.extraOptions.aarCss, (_o = (_m = this.currentSite) === null || _m === void 0 ? void 0 : _m.shortName) !== null && _o !== void 0 ? _o : '')) !== null && _p !== void 0 ? _p : null;
1519
- device.extraOptions.aarCss = replacedValue;
1520
- }
1521
- if (!device.description && this.siteDefaults) {
1522
- device.description = this.siteDefaults.deviceDescription;
1523
- }
1524
- }
1525
- replaceDynamicValueSiteInfo(fieldValue, siteShortName) {
1526
- if (fieldValue) {
1527
- fieldValue = this.replaceDynamicValueFormat(fieldValue);
1528
- const paramsToReplaces = { 'SiteShortName': siteShortName };
1529
- return this.mutliStringReplace(paramsToReplaces, fieldValue);
1530
- }
1531
- return null;
1532
- }
1533
- replaceDynamicValueFormat(str) {
1534
- str = str.replace(/\[FN\]/ig, '[FN]').replace(/\[LN\]/ig, '[LN]').replace(/\[ID\]/ig, '[UserId]')
1535
- .replace(/\[UserId\]/ig, '[UserId]').replace(/<Match User ID>/ig, '[UserId]')
1536
- .replace(/\[Email\]/ig, '[Email]').replace(/\[DN\(/ig, '[DN(')
1537
- .replace(/\[SiteShortName\]/ig, '[SiteShortName]').replace(/\$\(SiteShortName\)/ig, '[SiteShortName]')
1538
- .replace(/\$\{SiteShortName\}/ig, '[SiteShortName]').replace(/{SiteShortName}/ig, '[SiteShortName]')
1539
- .replace(/\[FN\(/ig, '[FN(').replace(/\[LN\(/ig, '[LN(')
1540
- .replace(/\[ID\(/ig, '[ID(');
1541
- return str;
1542
- }
1543
- mutliStringReplace(object, input, directoryNumber, user) {
1544
- var val = input;
1545
- if (val.includes('[DN]') && directoryNumber && !directoryNumber.includes('Line')) {
1546
- val = val.replace('[DN]', directoryNumber);
1547
- }
1548
- var indexOfDN = val.indexOf('[DN(');
1549
- if (indexOfDN !== -1 && directoryNumber) {
1550
- var digit = val.substring(indexOfDN + 4, val.indexOf(')', indexOfDN + 4));
1551
- var digitCount = Number(digit) || 0;
1552
- var dnDigit = (digitCount > val.length) ? directoryNumber : directoryNumber.substring(directoryNumber.length - digitCount, directoryNumber.length);
1553
- val = val.replace('[DN(' + digit + ')]', dnDigit);
1554
- }
1555
- var indexOfFN = val.indexOf('[FN(');
1556
- if (indexOfFN !== -1 && user && user.firstName) {
1557
- var digit = val.substring(indexOfFN + 4, val.indexOf(')', indexOfFN + 4));
1558
- var fnDigit = user.firstName.substring(0, digit);
1559
- val = val.replace('[FN(' + digit + ')]', fnDigit);
1560
- }
1561
- var indexOfLN = val.indexOf('[LN(');
1562
- if (indexOfLN !== -1 && user && user.lastName) {
1563
- var digit = val.substring(indexOfLN + 4, val.indexOf(')', indexOfLN + 4));
1564
- var lnDigit = user.lastName.substring(0, digit);
1565
- val = val.replace('[LN(' + digit + ')]', lnDigit);
1566
- }
1567
- var indexOfID = val.indexOf('[ID(');
1568
- if (indexOfID !== -1 && user && user.userid) {
1569
- var digit = val.substring(indexOfID + 4, val.indexOf(')', indexOfID + 4));
1570
- var idDigit = user.userid.substring(0, digit);
1571
- val = val.replace('[ID(' + digit + ')]', idDigit);
1572
- }
1573
- var entries = Object.entries(object);
1574
- entries.forEach((para) => {
1575
- var find = '[' + para[0] + ']';
1576
- var replacement = para[1] != null ? String(para[1]) : '';
1577
- val = val.split(find).join(replacement);
1578
- });
1579
- return val;
1580
- }
1581
- initTemplateDnsNamesForLines() {
1582
- var _a, _b;
1583
- if (this.lines && this.lines.length > 0) {
1584
- this.lines.forEach((line, index) => {
1585
- line.directoryNumber.templateDirectoryNumber = line.directoryNumber.directoryNumber;
1586
- line.directoryNumber.directoryNumber = '';
1587
- return line;
1588
- });
1589
- const routePartition = ((_a = this.siteDefaults) === null || _a === void 0 ? void 0 : _a.routePartition) || '';
1590
- this.devices.forEach(device => {
1591
- if (device.lineAssociations && device.lineAssociations.length) {
1592
- this.setLineAssociationsForDevice(device, routePartition);
1593
- }
1594
- });
1595
- this.deviceProfiles.forEach(deviceProfile => {
1596
- if (deviceProfile.lineAssociations && deviceProfile.lineAssociations.length) {
1597
- this.setLineAssociationsForDevice(deviceProfile, routePartition);
1598
- }
1599
- });
1600
- if (((_b = this.endUser) === null || _b === void 0 ? void 0 : _b.singleNumberReach) && this.endUser.singleNumberReach.associatedLines && this.endUser.singleNumberReach.associatedLines.length) {
1601
- if (this.endUser.singleNumberReach.associatedLines && this.endUser.singleNumberReach.associatedLines.length) {
1602
- this.endUser.singleNumberReach.associatedLines.map(lineAssociation => {
1603
- lineAssociation.directoryNumber.templateDirectoryNumber = lineAssociation.directoryNumber.directoryNumber;
1604
- lineAssociation.directoryNumber.routePartitionName = routePartition;
1605
- });
1606
- }
1607
- if (this.endUser.singleNumberReach.remoteDestinations && this.endUser.singleNumberReach.remoteDestinations.length) {
1608
- this.endUser.singleNumberReach.remoteDestinations.forEach(remoteDestination => {
1609
- if (remoteDestination.lineAssociations && remoteDestination.lineAssociations.length) {
1610
- remoteDestination.lineAssociations.map(lineAssociation => {
1611
- lineAssociation.directoryNumber.templateDirectoryNumber = lineAssociation.directoryNumber.directoryNumber;
1612
- lineAssociation.directoryNumber.routePartitionName = routePartition;
1613
- });
1614
- }
1615
- });
1616
- }
1617
- }
1618
- }
1619
- }
1620
- buildSavableEndUser() {
1621
- if (!this.endUser) {
1622
- throw new Error('No template user loaded');
1623
- }
1624
- return buildSavableEndUser(this.endUser, this.lines, this.devices, this.deviceProfiles, this.userDetailsForm, {
1625
- resolveDeviceName: (index, device) => this.resolveDeviceNameForSave(index, device),
1626
- resolveDeviceProfileName: (index, profile) => this.resolveDeviceNameForSave(index, profile),
1627
- });
1628
- }
1629
- resolveDeviceNameForSave(_index, device) {
1630
- var _a;
1631
- const rawName = (device.name || device.newName || '').trim();
1632
- if (!rawName) {
1633
- return '';
1634
- }
1635
- const prefix = (_a = device.prefix) === null || _a === void 0 ? void 0 : _a.trim();
1636
- if (prefix && !rawName.toUpperCase().startsWith(prefix.toUpperCase())) {
1637
- return `${prefix}${rawName}`;
1638
- }
1639
- return rawName;
1640
- }
1641
- saveNewUser() {
1642
- var _a, _b;
1643
- const user = this.buildSavableEndUser();
1644
- const siteId = String((_a = this.selectedSite) !== null && _a !== void 0 ? _a : '');
1645
- const templateId = String((_b = this.selectedTemplateId) !== null && _b !== void 0 ? _b : '');
1646
- return this.userCreationApiService.saveTemplateUser(user, templateId, siteId);
1647
- }
1648
704
  }
1649
705
  UserCreationWizardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationWizardService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1650
706
  UserCreationWizardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationWizardService });
@@ -1652,535 +708,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1652
708
  type: Injectable
1653
709
  }], ctorParameters: function () { return []; } });
1654
710
 
1655
- class AppLoaderComponent {
1656
- constructor() {
1657
- }
1658
- }
1659
- AppLoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1660
- AppLoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AppLoaderComponent, selector: "app-loader", ngImport: i0, template: "<div class=\"overlay\">\n <mat-progress-spinner\n class=\"page-spinner\"\n mode=\"indeterminate\"\n [diameter]=\"70\"\n strokeWidth=\"3\"></mat-progress-spinner>\n</div>\n", styles: [".overlay{position:fixed;width:100%;height:100%;inset:0;background-color:#fff3;z-index:200;display:flex;justify-content:center;align-items:center}\n"], dependencies: [{ kind: "component", type: i1$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }], encapsulation: i0.ViewEncapsulation.None });
1661
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppLoaderComponent, decorators: [{
1662
- type: Component,
1663
- args: [{ selector: 'app-loader', encapsulation: ViewEncapsulation.None, template: "<div class=\"overlay\">\n <mat-progress-spinner\n class=\"page-spinner\"\n mode=\"indeterminate\"\n [diameter]=\"70\"\n strokeWidth=\"3\"></mat-progress-spinner>\n</div>\n", styles: [".overlay{position:fixed;width:100%;height:100%;inset:0;background-color:#fff3;z-index:200;display:flex;justify-content:center;align-items:center}\n"] }]
1664
- }], ctorParameters: function () { return []; } });
1665
-
1666
- const LDAP_PAGE_SIZE = 10;
1667
711
  class UserDetailsStepComponent {
1668
- get linesFormArray() {
1669
- return this.userDetailsForm.get('lines');
1670
- }
1671
- get devicesFormArray() {
1672
- return this.userDetailsForm.get('devices');
1673
- }
1674
- get deviceProfilesFormArray() {
1675
- return this.userDetailsForm.get('deviceProfiles');
1676
- }
1677
- get selectedLdapUser() {
1678
- return this.userCreationWizardService.selectedLdapUser;
1679
- }
1680
- get ldapTotalCount() {
1681
- return this.userCreationWizardService.ldapUsersTotal;
1682
- }
1683
- get hasLdapUsers() {
1684
- return this.userCreationWizardService.ldapUsers.length > 0;
1685
- }
1686
- constructor(fb, userCreationApiService, userCreationWizardService) {
1687
- this.fb = fb;
1688
- this.userCreationApiService = userCreationApiService;
712
+ constructor(userCreationWizardService) {
1689
713
  this.userCreationWizardService = userCreationWizardService;
1690
- this.validityChange = new EventEmitter();
1691
- this.userIdCheckPending = false;
1692
- this.loadingAvailableNumbers = false;
1693
- this.ldapLoading = false;
1694
- this.ldapSearchAttempted = false;
1695
- this.ldapPageSize = LDAP_PAGE_SIZE;
1696
- this.ldapPageIndex = 0;
1697
- this.ldapQueryTypeOptions = [
1698
- { label: 'User ID', value: 'userId' },
1699
- { label: 'First Name', value: 'firstName' },
1700
- { label: 'Last Name', value: 'lastName' },
1701
- ];
1702
- this.filteredAvailableNumbersByLine = [];
1703
- this.filteredRoutePartitionsByLine = [];
1704
- this.destroy$ = new Subject();
1705
- this.userIdAsyncValidator = this.createUserIdAsyncValidator();
1706
- this.ldapSearchForm = this.fb.group({
1707
- queryValue: [''],
1708
- queryType: ['userId'],
1709
- });
1710
- this.userDetailsForm = this.fb.group({
1711
- userId: ['', [Validators.required], [this.userIdAsyncValidator]],
1712
- firstName: ['', Validators.required],
1713
- lastName: ['', Validators.required],
1714
- email: ['', [Validators.required, Validators.email]],
1715
- lines: this.fb.array([]),
1716
- devices: this.fb.array([]),
1717
- deviceProfiles: this.fb.array([]),
1718
- });
1719
- }
1720
- ngOnInit() {
1721
- const savedFormValue = this.userCreationWizardService.userDetailsFormValue;
1722
- const isRestoringPreviousEntry = !!savedFormValue;
1723
- if (!isRestoringPreviousEntry) {
1724
- this.resetLdapSearchForm();
1725
- }
1726
- this.buildDynamicFormArrays(savedFormValue);
1727
- if (isRestoringPreviousEntry) {
1728
- this.patchUserFieldsFromSavedValue(savedFormValue);
1729
- }
1730
- else {
1731
- this.patchUserFieldsFromService();
1732
- }
1733
- this.initLineFilters();
1734
- this.setupFormSync();
1735
- this.setupValidityEmitter();
1736
- this.fetchInitialAvailableNumbers();
1737
- if (!isRestoringPreviousEntry) {
1738
- this.userCreationWizardService.applyUserDetailsFormValue(this.userDetailsForm.getRawValue());
1739
- }
1740
- this.applyDeviceNameValidators();
1741
- this.userCreationWizardService.deviceDefaultsLoaded$
1742
- .pipe(takeUntil(this.destroy$))
1743
- .subscribe(() => {
1744
- this.applyDeviceNameValidators();
1745
- this.emitValidity();
1746
- });
1747
- if (this.userCreationWizardService.isLdapIntegrated && this.selectedLdapUser) {
1748
- this.applyLdapIntegratedFormState();
1749
- }
1750
- this.emitValidity();
1751
- }
1752
- ngOnDestroy() {
1753
- this.destroy$.next();
1754
- this.destroy$.complete();
1755
- }
1756
- isStepValid() {
1757
- return this.userDetailsForm.valid && !this.userIdCheckPending;
1758
- }
1759
- markAllAsTouched() {
1760
- this.userDetailsForm.markAllAsTouched();
1761
- this.emitValidity();
1762
- }
1763
- syncToService() {
1764
- this.userCreationWizardService.applyUserDetailsFormValue(this.userDetailsForm.getRawValue());
1765
- }
1766
- getLineGroup(index) {
1767
- return this.linesFormArray.at(index);
1768
- }
1769
- getDeviceGroup(index) {
1770
- return this.devicesFormArray.at(index);
1771
- }
1772
- getDeviceProfileGroup(index) {
1773
- return this.deviceProfilesFormArray.at(index);
1774
- }
1775
- getDeviceNamePrefix(index) {
1776
- return this.userCreationWizardService.getDeviceNamePrefix(index, false);
1777
- }
1778
- getDeviceProfileNamePrefix(index) {
1779
- return this.userCreationWizardService.getDeviceNamePrefix(index, true);
1780
- }
1781
- getDeviceNameValidationCaption(index) {
1782
- return this.userCreationWizardService.getDeviceNameValidationCaption(index, false);
1783
- }
1784
- getDeviceProfileNameValidationCaption(index) {
1785
- return this.userCreationWizardService.getDeviceNameValidationCaption(index, true);
1786
- }
1787
- getFilteredNumbers(lineIndex) {
1788
- var _a;
1789
- return (_a = this.filteredAvailableNumbersByLine[lineIndex]) !== null && _a !== void 0 ? _a : [];
1790
- }
1791
- getFilteredRoutePartitions(lineIndex) {
1792
- var _a;
1793
- return (_a = this.filteredRoutePartitionsByLine[lineIndex]) !== null && _a !== void 0 ? _a : [];
1794
- }
1795
- filterAvailableNumbers(lineIndex, event) {
1796
- var _a;
1797
- const raw = ((_a = event.target) === null || _a === void 0 ? void 0 : _a.value) || '';
1798
- this.applyNumberFilter(lineIndex, raw);
1799
- }
1800
- filterRoutePartitions(lineIndex, event) {
1801
- var _a;
1802
- const raw = ((_a = event.target) === null || _a === void 0 ? void 0 : _a.value) || '';
1803
- this.applyRoutePartitionFilter(lineIndex, raw);
1804
- }
1805
- onRoutePartitionSelected(lineIndex, routePartition) {
1806
- var _a, _b;
1807
- const lineGroup = this.linesFormArray.at(lineIndex);
1808
- (_a = lineGroup.get('routePartition')) === null || _a === void 0 ? void 0 : _a.setValue(routePartition, { emitEvent: false });
1809
- (_b = lineGroup.get('number')) === null || _b === void 0 ? void 0 : _b.setValue('');
1810
- this.applyRoutePartitionFilter(lineIndex, routePartition);
1811
- this.loadAvailableNumbersForLine(lineIndex, routePartition);
1812
- }
1813
- onNumberSelected(lineIndex, number) {
1814
- var _a;
1815
- const lineGroup = this.linesFormArray.at(lineIndex);
1816
- const displayNumber = this.extractDirectoryNumber(number);
1817
- (_a = lineGroup.get('number')) === null || _a === void 0 ? void 0 : _a.setValue(displayNumber, { emitEvent: true });
1818
- }
1819
- searchLdapUsers(pageIndex = 0) {
1820
- var _a, _b;
1821
- const queryValue = String((_a = this.ldapSearchForm.get('queryValue')) === null || _a === void 0 ? void 0 : _a.value).trim() || undefined;
1822
- const siteId = this.userCreationWizardService.selectedSite;
1823
- if (!siteId) {
1824
- this.userCreationWizardService.setLdapUsersResult([], 0);
1825
- this.ldapPageIndex = 0;
1826
- this.ldapSearchAttempted = false;
1827
- return;
1828
- }
1829
- this.ldapPageIndex = pageIndex;
1830
- const queryType = (_b = this.ldapSearchForm.get('queryType')) === null || _b === void 0 ? void 0 : _b.value;
1831
- const params = {
1832
- size: String(LDAP_PAGE_SIZE),
1833
- page: String(pageIndex),
1834
- deviceless: 'true',
1835
- querytype: queryType,
1836
- withEmailOnly: 'true',
1837
- queryvalue: queryValue,
1838
- };
1839
- this.ldapLoading = true;
1840
- this.userCreationApiService
1841
- .getLdapUsers(String(siteId), params)
1842
- .pipe(take(1), map((res) => {
1843
- var _a, _b;
1844
- return ({
1845
- users: (_a = res === null || res === void 0 ? void 0 : res.pageData) !== null && _a !== void 0 ? _a : [],
1846
- total: (_b = res === null || res === void 0 ? void 0 : res.total) !== null && _b !== void 0 ? _b : 0,
1847
- });
1848
- }), catchError(() => of({ users: [], total: 0 })), finalize(() => {
1849
- this.ldapLoading = false;
1850
- }))
1851
- .subscribe(({ users, total }) => {
1852
- this.ldapSearchAttempted = true;
1853
- this.userCreationWizardService.setLdapUsersResult(users, total);
1854
- });
1855
- }
1856
- onLdapPageChange(event) {
1857
- this.searchLdapUsers(event.pageIndex);
1858
- }
1859
- onAddLdapUser(row) {
1860
- var _a, _b, _c;
1861
- this.userCreationWizardService.selectLdapUser(row);
1862
- this.userDetailsForm.patchValue({
1863
- userId: row.userid,
1864
- firstName: (_a = row.firstName) !== null && _a !== void 0 ? _a : '',
1865
- lastName: (_b = row.lastName) !== null && _b !== void 0 ? _b : '',
1866
- email: (_c = row.email) !== null && _c !== void 0 ? _c : '',
1867
- });
1868
- this.applyLdapIntegratedFormState();
1869
- this.emitValidity();
1870
- }
1871
- onDeleteLdapUser(row) {
1872
- if (!this.userCreationWizardService.isLdapUserRowSelected(row)) {
1873
- return;
1874
- }
1875
- this.clearLdapSelection();
1876
- }
1877
- onRemoveLdapTag() {
1878
- this.clearLdapSelection();
1879
- }
1880
- isLdapUserRowSelected(row) {
1881
- return this.userCreationWizardService.isLdapUserRowSelected(row);
1882
- }
1883
- clearLdapSelection() {
1884
- this.userCreationWizardService.clearLdapUserSelection();
1885
- this.userDetailsForm.patchValue({
1886
- userId: '',
1887
- firstName: '',
1888
- lastName: '',
1889
- email: '',
1890
- });
1891
- this.restoreManualEntryFormState();
1892
- this.emitValidity();
1893
- }
1894
- applyLdapIntegratedFormState() {
1895
- var _a;
1896
- this.setUserIdentityFieldsReadonly(true);
1897
- this.toggleUserIdAsyncValidator(false);
1898
- (_a = this.userDetailsForm.get('userId')) === null || _a === void 0 ? void 0 : _a.updateValueAndValidity({ emitEvent: false });
1899
- }
1900
- restoreManualEntryFormState() {
1901
- var _a;
1902
- this.setUserIdentityFieldsReadonly(false);
1903
- this.toggleUserIdAsyncValidator(true);
1904
- (_a = this.userDetailsForm.get('userId')) === null || _a === void 0 ? void 0 : _a.updateValueAndValidity();
1905
- }
1906
- setUserIdentityFieldsReadonly(readonly) {
1907
- ['userId', 'firstName', 'lastName', 'email'].forEach(fieldName => {
1908
- const control = this.userDetailsForm.get(fieldName);
1909
- if (!control) {
1910
- return;
1911
- }
1912
- if (readonly) {
1913
- control.disable({ emitEvent: false });
1914
- }
1915
- else {
1916
- control.enable({ emitEvent: false });
1917
- }
1918
- });
1919
- }
1920
- toggleUserIdAsyncValidator(enabled) {
1921
- const control = this.userDetailsForm.get('userId');
1922
- if (!control) {
1923
- return;
1924
- }
1925
- if (enabled) {
1926
- control.setAsyncValidators([this.userIdAsyncValidator]);
1927
- }
1928
- else {
1929
- control.clearAsyncValidators();
1930
- }
1931
- control.updateValueAndValidity({ emitEvent: false });
1932
- }
1933
- setupValidityEmitter() {
1934
- this.userDetailsForm.statusChanges
1935
- .pipe(startWith(this.userDetailsForm.status), takeUntil(this.destroy$))
1936
- .subscribe(() => this.emitValidity());
1937
- }
1938
- emitValidity() {
1939
- this.validityChange.emit(this.isStepValid());
1940
- }
1941
- buildDynamicFormArrays(savedFormValue) {
1942
- const service = this.userCreationWizardService;
1943
- const linesArray = this.linesFormArray;
1944
- const devicesArray = this.devicesFormArray;
1945
- const profilesArray = this.deviceProfilesFormArray;
1946
- while (linesArray.length) {
1947
- linesArray.removeAt(0);
1948
- }
1949
- while (devicesArray.length) {
1950
- devicesArray.removeAt(0);
1951
- }
1952
- while (profilesArray.length) {
1953
- profilesArray.removeAt(0);
1954
- }
1955
- service.lines.forEach((line, index) => {
1956
- var _a, _b, _c, _d, _e, _f, _g, _h;
1957
- const savedLine = (_a = savedFormValue === null || savedFormValue === void 0 ? void 0 : savedFormValue.lines) === null || _a === void 0 ? void 0 : _a[index];
1958
- const lineGroup = this.fb.group({
1959
- lineNumber: [
1960
- {
1961
- value: ((_b = line.directoryNumber) === null || _b === void 0 ? void 0 : _b.templateDirectoryNumber) || '',
1962
- disabled: true,
1963
- },
1964
- ],
1965
- number: [
1966
- (_e = (_c = savedLine === null || savedLine === void 0 ? void 0 : savedLine.number) !== null && _c !== void 0 ? _c : (_d = line.directoryNumber) === null || _d === void 0 ? void 0 : _d.directoryNumber) !== null && _e !== void 0 ? _e : '',
1967
- Validators.required,
1968
- ],
1969
- routePartition: [
1970
- (_h = (_f = savedLine === null || savedLine === void 0 ? void 0 : savedLine.routePartition) !== null && _f !== void 0 ? _f : (_g = line.directoryNumber) === null || _g === void 0 ? void 0 : _g.routePartitionName) !== null && _h !== void 0 ? _h : '',
1971
- Validators.required,
1972
- ],
1973
- });
1974
- linesArray.push(lineGroup);
1975
- this.setupLineListeners(index, lineGroup);
1976
- });
1977
- service.devices.forEach((device, index) => {
1978
- var _a, _b, _c;
1979
- const savedDevice = (_a = savedFormValue === null || savedFormValue === void 0 ? void 0 : savedFormValue.devices) === null || _a === void 0 ? void 0 : _a[index];
1980
- devicesArray.push(this.fb.group({
1981
- deviceType: [{ value: device.deviceType || '', disabled: true }],
1982
- protocol: [{ value: device.protocol || '', disabled: true }],
1983
- buttonTemplate: [{ value: device.buttonTemplate || '', disabled: true }],
1984
- name: [
1985
- (_c = (_b = savedDevice === null || savedDevice === void 0 ? void 0 : savedDevice.name) !== null && _b !== void 0 ? _b : device.name) !== null && _c !== void 0 ? _c : '',
1986
- this.buildDeviceNameValidators(index, false),
1987
- ],
1988
- }));
1989
- });
1990
- service.deviceProfiles.forEach((profile, index) => {
1991
- var _a, _b, _c;
1992
- const savedProfile = (_a = savedFormValue === null || savedFormValue === void 0 ? void 0 : savedFormValue.deviceProfiles) === null || _a === void 0 ? void 0 : _a[index];
1993
- profilesArray.push(this.fb.group({
1994
- deviceType: [{ value: profile.deviceType || '', disabled: true }],
1995
- protocol: [{ value: profile.protocol || '', disabled: true }],
1996
- buttonTemplate: [{ value: profile.buttonTemplate || '', disabled: true }],
1997
- name: [
1998
- (_c = (_b = savedProfile === null || savedProfile === void 0 ? void 0 : savedProfile.name) !== null && _b !== void 0 ? _b : profile.name) !== null && _c !== void 0 ? _c : '',
1999
- this.buildDeviceNameValidators(index, true),
2000
- ],
2001
- }));
2002
- });
2003
- }
2004
- buildDeviceNameValidators(deviceIndex, isProfile) {
2005
- const validators = isProfile ? [] : [Validators.required];
2006
- const options = this.userCreationWizardService.getDeviceNameValidationOptions(deviceIndex, isProfile);
2007
- if (options) {
2008
- validators.push(deviceNameValidator(options));
2009
- }
2010
- return validators;
2011
- }
2012
- applyDeviceNameValidators() {
2013
- this.devicesFormArray.controls.forEach((_, index) => {
2014
- const nameControl = this.getDeviceGroup(index).get('name');
2015
- nameControl === null || nameControl === void 0 ? void 0 : nameControl.setValidators(this.buildDeviceNameValidators(index, false));
2016
- nameControl === null || nameControl === void 0 ? void 0 : nameControl.updateValueAndValidity({ emitEvent: false });
2017
- });
2018
- this.deviceProfilesFormArray.controls.forEach((_, index) => {
2019
- const nameControl = this.getDeviceProfileGroup(index).get('name');
2020
- nameControl === null || nameControl === void 0 ? void 0 : nameControl.setValidators(this.buildDeviceNameValidators(index, true));
2021
- nameControl === null || nameControl === void 0 ? void 0 : nameControl.updateValueAndValidity({ emitEvent: false });
2022
- });
2023
- }
2024
- resetLdapSearchForm() {
2025
- this.ldapSearchForm.reset({
2026
- queryValue: '',
2027
- queryType: 'userId',
2028
- });
2029
- this.ldapSearchAttempted = false;
2030
- this.ldapPageIndex = 0;
2031
- this.userIdCheckPending = false;
2032
- }
2033
- patchUserFieldsFromSavedValue(saved) {
2034
- this.userDetailsForm.patchValue({
2035
- userId: saved.userId || '',
2036
- firstName: saved.firstName || '',
2037
- lastName: saved.lastName || '',
2038
- email: saved.email || '',
2039
- });
2040
- }
2041
- patchUserFieldsFromService() {
2042
- const service = this.userCreationWizardService;
2043
- const endUser = service.endUser;
2044
- this.userDetailsForm.patchValue({
2045
- userId: (endUser === null || endUser === void 0 ? void 0 : endUser.userid) || service.userDetailsForm.userId || '',
2046
- firstName: (endUser === null || endUser === void 0 ? void 0 : endUser.firstName) || service.userDetailsForm.firstName || '',
2047
- lastName: (endUser === null || endUser === void 0 ? void 0 : endUser.lastName) || service.userDetailsForm.lastName || '',
2048
- email: (endUser === null || endUser === void 0 ? void 0 : endUser.email) || service.userDetailsForm.email || '',
2049
- });
2050
- this.userDetailsForm.markAsPristine();
2051
- this.userDetailsForm.markAsUntouched();
2052
- }
2053
- setupLineListeners(lineIndex, lineGroup) {
2054
- var _a, _b;
2055
- (_a = lineGroup
2056
- .get('routePartition')) === null || _a === void 0 ? void 0 : _a.valueChanges.pipe(debounceTime(300), takeUntil(this.destroy$)).subscribe(value => {
2057
- this.applyRoutePartitionFilter(lineIndex, String(value !== null && value !== void 0 ? value : ''));
2058
- });
2059
- (_b = lineGroup
2060
- .get('number')) === null || _b === void 0 ? void 0 : _b.valueChanges.pipe(debounceTime(150), takeUntil(this.destroy$)).subscribe(value => {
2061
- this.applyNumberFilter(lineIndex, String(value !== null && value !== void 0 ? value : ''));
2062
- });
2063
- }
2064
- initLineFilters() {
2065
- const partitions = this.userCreationWizardService.routePartitionOptions;
2066
- const numbers = this.userCreationWizardService.availableNumbers;
2067
- this.filteredRoutePartitionsByLine = this.linesFormArray.controls.map((_, index) => {
2068
- var _a, _b;
2069
- const current = String((_b = (_a = this.linesFormArray.at(index).get('routePartition')) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '');
2070
- return this.filterOptions(partitions, current);
2071
- });
2072
- this.filteredAvailableNumbersByLine = this.linesFormArray.controls.map((_, index) => {
2073
- var _a, _b;
2074
- const current = String((_b = (_a = this.linesFormArray.at(index).get('number')) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '');
2075
- return this.filterOptions(numbers, current);
2076
- });
2077
- }
2078
- setupFormSync() {
2079
- this.userDetailsForm.valueChanges
2080
- .pipe(debounceTime(200), takeUntil(this.destroy$))
2081
- .subscribe(() => {
2082
- this.userCreationWizardService.applyUserDetailsFormValue(this.userDetailsForm.getRawValue());
2083
- });
2084
- }
2085
- fetchInitialAvailableNumbers() {
2086
- var _a, _b;
2087
- const firstPartition = this.linesFormArray.length > 0
2088
- ? String((_b = (_a = this.linesFormArray.at(0).get('routePartition')) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '').trim()
2089
- : this.userCreationWizardService.firstLineRoutePartition ||
2090
- this.userCreationWizardService.siteDefaultRoutePartition ||
2091
- '';
2092
- if (firstPartition) {
2093
- this.loadAvailableNumbersForLine(0, firstPartition, false);
2094
- }
2095
- }
2096
- loadAvailableNumbersForLine(lineIndex, routePartition, clearNumber = true) {
2097
- var _a;
2098
- const siteId = this.userCreationWizardService.selectedSite;
2099
- if (!siteId || !routePartition.trim()) {
2100
- return;
2101
- }
2102
- if (clearNumber) {
2103
- (_a = this.linesFormArray.at(lineIndex).get('number')) === null || _a === void 0 ? void 0 : _a.setValue('');
2104
- }
2105
- this.loadingAvailableNumbers = true;
2106
- this.userCreationWizardService
2107
- .getNumberRange(String(siteId), routePartition)
2108
- .pipe(take(1), catchError(() => of(null)), finalize(() => {
2109
- this.loadingAvailableNumbers = false;
2110
- this.refreshNumberFilters();
2111
- }))
2112
- .subscribe();
2113
- }
2114
- refreshNumberFilters() {
2115
- const numbers = this.userCreationWizardService.availableNumbers;
2116
- this.filteredAvailableNumbersByLine = this.linesFormArray.controls.map((_, index) => {
2117
- var _a, _b;
2118
- const current = String((_b = (_a = this.linesFormArray.at(index).get('number')) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '');
2119
- return this.filterOptions(numbers, current);
2120
- });
2121
- }
2122
- applyNumberFilter(lineIndex, raw) {
2123
- const value = raw.trim().toLowerCase();
2124
- const source = this.userCreationWizardService.availableNumbers || [];
2125
- this.filteredAvailableNumbersByLine[lineIndex] = value.length
2126
- ? source.filter(n => !!n && n.toLowerCase().includes(value))
2127
- : [...source];
2128
- }
2129
- applyRoutePartitionFilter(lineIndex, raw) {
2130
- const value = raw.trim().toLowerCase();
2131
- const source = this.userCreationWizardService.routePartitionOptions || [];
2132
- this.filteredRoutePartitionsByLine[lineIndex] = value.length
2133
- ? source.filter(n => !!n && n.toLowerCase().includes(value))
2134
- : [...source];
2135
- }
2136
- filterOptions(source, raw) {
2137
- const value = raw.trim().toLowerCase();
2138
- if (!value.length) {
2139
- return [...source];
2140
- }
2141
- return source.filter(item => !!item && item.toLowerCase().includes(value));
2142
714
  }
2143
- extractDirectoryNumber(value) {
2144
- const trimmed = value.trim();
2145
- const spaceIndex = trimmed.indexOf(' ');
2146
- return spaceIndex > -1 ? trimmed.substring(0, spaceIndex) : trimmed;
715
+ onAddUser(row) {
716
+ this.userCreationWizardService.addLdapUser(row);
2147
717
  }
2148
- createUserIdAsyncValidator() {
2149
- return (control) => {
2150
- var _a;
2151
- if (this.userCreationWizardService.isLdapIntegrated) {
2152
- this.userIdCheckPending = false;
2153
- return of(null);
2154
- }
2155
- const userId = String((_a = control.value) !== null && _a !== void 0 ? _a : '').trim();
2156
- const siteId = this.userCreationWizardService.selectedSite;
2157
- if (!userId || !siteId) {
2158
- this.userIdCheckPending = false;
2159
- this.emitValidity();
2160
- return of(null);
2161
- }
2162
- this.userIdCheckPending = true;
2163
- this.emitValidity();
2164
- return timer(500).pipe(switchMap(() => this.userCreationApiService
2165
- .checkUserIdExisting(String(siteId), encodeURIComponent(encodeURIComponent(userId)))
2166
- .pipe(map(() => ({ userIdExists: true })), catchError(() => of(null)))), tap(() => {
2167
- this.userIdCheckPending = false;
2168
- this.emitValidity();
2169
- }), finalize(() => {
2170
- this.userIdCheckPending = false;
2171
- this.emitValidity();
2172
- }));
2173
- };
718
+ getDeviceName(index) {
719
+ return this.userCreationWizardService.getDeviceDisplayName(index);
2174
720
  }
2175
721
  }
2176
- UserDetailsStepComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserDetailsStepComponent, deps: [{ token: i1$2.FormBuilder }, { token: UserCreationApiService }, { token: UserCreationWizardService }], target: i0.ɵɵFactoryTarget.Component });
2177
- UserDetailsStepComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UserDetailsStepComponent, selector: "tk-user-details-step", outputs: { validityChange: "validityChange" }, ngImport: i0, template: "<app-loader *ngIf=\"loadingAvailableNumbers\"></app-loader>\r\n<section class=\"details-step-content\">\r\n <form [formGroup]=\"userDetailsForm\">\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">User details</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"details-step-section__part\">\r\n <div class=\"details-inline-fields\">\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">User ID</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput placeholder=\"User ID\" formControlName=\"userId\" />\r\n <mat-error *ngIf=\"userDetailsForm.get('userId')?.hasError('required') && userDetailsForm.get('userId')?.touched\">\r\n User ID is required\r\n </mat-error>\r\n <mat-error *ngIf=\"userDetailsForm.get('userId')?.hasError('userIdExists') && userDetailsForm.get('userId')?.touched\">\r\n User ID already exists\r\n </mat-error>\r\n <mat-hint *ngIf=\"userIdCheckPending\">Checking user ID...</mat-hint>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">First Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput placeholder=\"First Name\" formControlName=\"firstName\" />\r\n <mat-error *ngIf=\"userDetailsForm.get('firstName')?.hasError('required') && userDetailsForm.get('firstName')?.touched\">\r\n First name is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Last Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput placeholder=\"Last Name\" formControlName=\"lastName\" />\r\n <mat-error *ngIf=\"userDetailsForm.get('lastName')?.hasError('required') && userDetailsForm.get('lastName')?.touched\">\r\n Last name is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Email</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput placeholder=\"Email\" formControlName=\"email\" />\r\n <mat-error *ngIf=\"userDetailsForm.get('email')?.invalid && userDetailsForm.get('email')?.touched\">\r\n <span *ngIf=\"userDetailsForm.get('email')?.hasError('required')\">Email is required</span>\r\n <span *ngIf=\"userDetailsForm.get('email')?.hasError('email')\">Please enter a valid email</span>\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">User Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"User Template\"\r\n [value]=\"userCreationWizardService.selectedTemplateName || ''\"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"details-step-section__part\">\r\n <mat-accordion class=\"details-user-accordion\">\r\n <mat-expansion-panel togglePosition=\"before\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>Choose an existing or a LDAP user</mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <div class=\"details-user-accordion__content\">\r\n <div class=\"details-ldap-search\" [formGroup]=\"ldapSearchForm\">\r\n <mat-form-field\r\n class=\"details-ldap-search__input\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n >\r\n <input\r\n matInput\r\n placeholder=\"Search\"\r\n formControlName=\"queryValue\"\r\n (keyup.enter)=\"searchLdapUsers()\"\r\n />\r\n </mat-form-field>\r\n\r\n <mat-form-field\r\n class=\"details-ldap-search__select\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n >\r\n <mat-select formControlName=\"queryType\">\r\n <mat-option *ngFor=\"let option of ldapQueryTypeOptions\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-chip-list *ngIf=\"selectedLdapUser\" class=\"details-ldap-search__chip\">\r\n <mat-chip removable (removed)=\"onRemoveLdapTag()\">\r\n {{ selectedLdapUser.userid }}\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip>\r\n </mat-chip-list>\r\n\r\n <button\r\n mat-button\r\n class=\"details-ldap-search__btn\"\r\n type=\"button\"\r\n [disabled]=\"ldapLoading\"\r\n (click)=\"searchLdapUsers()\"\r\n >\r\n Search\r\n </button>\r\n </div>\r\n\r\n <app-loader *ngIf=\"ldapLoading\"></app-loader>\r\n\r\n <p\r\n *ngIf=\"!ldapLoading && ldapSearchAttempted && !hasLdapUsers\"\r\n class=\"details-ldap-table__empty\"\r\n >\r\n No users found\r\n </p>\r\n\r\n <table\r\n *ngIf=\"!ldapLoading && hasLdapUsers\"\r\n mat-table\r\n [dataSource]=\"userCreationWizardService.ldapUsers\"\r\n class=\"details-ldap-table\"\r\n >\r\n <ng-container matColumnDef=\"userId\">\r\n <th mat-header-cell *matHeaderCellDef>User Id</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.userid }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"firstName\">\r\n <th mat-header-cell *matHeaderCellDef>First Name</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.firstName }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"lastName\">\r\n <th mat-header-cell *matHeaderCellDef>Last Name</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.lastName }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"email\">\r\n <th mat-header-cell *matHeaderCellDef>Email</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.email }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"add\">\r\n <th mat-header-cell *matHeaderCellDef>Add</th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <button\r\n *ngIf=\"!isLdapUserRowSelected(row); else deleteLdapUserBtn\"\r\n mat-button\r\n class=\"details-ldap-table__add-btn\"\r\n type=\"button\"\r\n (click)=\"onAddLdapUser(row)\"\r\n >\r\n Add User\r\n </button>\r\n <ng-template #deleteLdapUserBtn>\r\n <button\r\n mat-button\r\n class=\"details-ldap-table__add-btn details-ldap-table__add-btn--delete\"\r\n type=\"button\"\r\n (click)=\"onDeleteLdapUser(row)\"\r\n >\r\n Delete user\r\n </button>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"userCreationWizardService.ldapTableColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: userCreationWizardService.ldapTableColumns\"></tr>\r\n </table>\r\n\r\n <mat-paginator\r\n *ngIf=\"!ldapLoading && hasLdapUsers\"\r\n class=\"details-ldap-paginator\"\r\n [length]=\"ldapTotalCount\"\r\n [pageSize]=\"ldapPageSize\"\r\n [pageIndex]=\"ldapPageIndex\"\r\n [pageSizeOptions]=\"[ldapPageSize]\"\r\n [hidePageSize]=\"true\"\r\n [disabled]=\"ldapLoading\"\r\n (page)=\"onLdapPageChange($event)\"\r\n ></mat-paginator>\r\n </div>\r\n </mat-expansion-panel>\r\n </mat-accordion>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Lines</h3>\r\n <div class=\"details-step-section__content\" formArrayName=\"lines\">\r\n <div class=\"line-route-list\">\r\n <div\r\n class=\"line-route-row\"\r\n *ngFor=\"let lineGroup of linesFormArray.controls; let idx = index\"\r\n [formGroupName]=\"idx\"\r\n >\r\n <div class=\"line-info\">\r\n <mat-form-field\r\n class=\"details-step-input line-route-field\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n hideRequiredMarker\r\n >\r\n <input matInput placeholder=\"Line number\" formControlName=\"lineNumber\" />\r\n </mat-form-field>\r\n\r\n <mat-form-field\r\n class=\"details-step-input line-route-field\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n hideRequiredMarker\r\n >\r\n <input\r\n matInput\r\n placeholder=\"Search for a number\"\r\n formControlName=\"number\"\r\n [matAutocomplete]=\"numberAuto\"\r\n (input)=\"filterAvailableNumbers(idx, $event)\"\r\n />\r\n <mat-autocomplete\r\n #numberAuto=\"matAutocomplete\"\r\n [panelWidth]=\"'auto'\"\r\n (optionSelected)=\"onNumberSelected(idx, $event.option.value)\"\r\n >\r\n <mat-option *ngFor=\"let option of getFilteredNumbers(idx)\" [value]=\"option\">\r\n {{ option }}\r\n </mat-option>\r\n </mat-autocomplete>\r\n <mat-error *ngIf=\"getLineGroup(idx).get('number')?.invalid && getLineGroup(idx).get('number')?.touched\">\r\n Number is required\r\n </mat-error>\r\n </mat-form-field>\r\n\r\n <mat-form-field\r\n class=\"details-step-input line-route-field\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n hideRequiredMarker\r\n >\r\n <input\r\n matInput\r\n placeholder=\"Select route partition\"\r\n formControlName=\"routePartition\"\r\n [matAutocomplete]=\"routePartitionAuto\"\r\n (input)=\"filterRoutePartitions(idx, $event)\"\r\n />\r\n <mat-autocomplete\r\n #routePartitionAuto=\"matAutocomplete\"\r\n (optionSelected)=\"onRoutePartitionSelected(idx, $event.option.value)\"\r\n >\r\n <mat-option\r\n *ngFor=\"let routePartition of getFilteredRoutePartitions(idx)\"\r\n [value]=\"routePartition\"\r\n >\r\n {{ routePartition }}\r\n </mat-option>\r\n </mat-autocomplete>\r\n <mat-error *ngIf=\"getLineGroup(idx).get('routePartition')?.invalid && getLineGroup(idx).get('routePartition')?.touched\">\r\n Route partition is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Devices</h3>\r\n <div class=\"details-step-section__content\" formArrayName=\"devices\">\r\n <div class=\"devices-rows\">\r\n <div\r\n class=\"details-inline-fields details-inline-fields--four\"\r\n *ngFor=\"let deviceGroup of devicesFormArray.controls; let idx = index\"\r\n [formGroupName]=\"idx\"\r\n >\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Device type</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"deviceType\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Protocol</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"protocol\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Button Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"buttonTemplate\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <span matPrefix *ngIf=\"getDeviceNamePrefix(idx) as devicePrefix\">{{ devicePrefix }}</span>\r\n <input matInput placeholder=\"Name\" formControlName=\"name\" />\r\n <mat-error *ngIf=\"getDeviceGroup(idx).get('name')?.hasError('deviceName') && getDeviceGroup(idx).get('name')?.touched\">\r\n {{ getDeviceGroup(idx).get('name')?.getError('deviceName')?.caption || getDeviceNameValidationCaption(idx) || 'Please enter a valid device name' }}\r\n </mat-error>\r\n <mat-error *ngIf=\"getDeviceGroup(idx).get('name')?.hasError('required') && getDeviceGroup(idx).get('name')?.touched\">\r\n Name is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\" *ngIf=\"deviceProfilesFormArray.length\">\r\n <h3 class=\"details-step-section__title\">Device profiles</h3>\r\n <div class=\"details-step-section__content\" formArrayName=\"deviceProfiles\">\r\n <div class=\"devices-rows\">\r\n <div\r\n class=\"details-inline-fields details-inline-fields--four\"\r\n *ngFor=\"let profileGroup of deviceProfilesFormArray.controls; let idx = index\"\r\n [formGroupName]=\"idx\"\r\n >\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Device type</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"deviceType\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Protocol</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"protocol\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Button Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"buttonTemplate\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <span matPrefix *ngIf=\"getDeviceProfileNamePrefix(idx) as profilePrefix\">{{ profilePrefix }}</span>\r\n <input matInput placeholder=\"Name\" formControlName=\"name\" />\r\n <mat-error *ngIf=\"getDeviceProfileGroup(idx).get('name')?.hasError('deviceName') && getDeviceProfileGroup(idx).get('name')?.touched\">\r\n {{ getDeviceProfileGroup(idx).get('name')?.getError('deviceName')?.caption || getDeviceProfileNameValidationCaption(idx) || 'Please enter a valid device name' }}\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n </form>\r\n</section>\r\n", styles: [".details-step-content{display:flex;flex-direction:column;gap:0}.details-step-dropdowns{display:flex;flex-direction:column;gap:1rem}.details-step-field{display:flex;flex-direction:column;gap:8px}.details-step-label{font-size:16px;font-weight:400;line-height:100%;letter-spacing:0;color:#333}.details-step-select{width:333px}.details-step-divider{border-top:1px solid #d9d9d9;margin-top:24px}.details-step-sections{display:flex;flex-direction:column}.details-step-section{display:flex;flex-direction:column;gap:0;padding:24px 0}.details-step-sections>.details-step-section:first-child{padding-top:0}.details-step-section+.details-step-section{border-top:1px solid #d9d9d9}.details-step-section__title{margin:0;font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:100%;letter-spacing:0;color:#333}.details-step-section__content{margin-top:24px}.details-step-section__part+.details-step-section__part{margin-top:24px}.details-user-accordion{width:100%}.details-user-accordion__content{padding:12px 0 0}.details-ldap-search{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:16px}.details-ldap-search__input{min-width:180px;width:180px}.details-ldap-search__select{flex:0 1 180px;min-width:160px}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-wrapper,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-wrapper{padding-bottom:0;margin:0}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-flex,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-flex{align-items:center;height:36px;border:1px solid #767676;border-radius:4px;padding:0 12px}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-outline,:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-outline-start,:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-outline-end,:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-outline-gap,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-outline,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-outline-start,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-outline-end,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-infix,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-infix{width:100%;border-top:0;padding:0;display:flex;align-items:center;min-height:unset}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-input-element,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-input-element{margin:0;line-height:20px}:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-select-trigger{display:flex;align-items:center;width:100%;height:100%}:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-select-value{display:flex;align-items:center;max-width:100%}:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-select-arrow-wrapper{display:flex;align-items:center}.details-ldap-search__chip{flex:0 0 auto}.details-ldap-search__btn{flex:0 0 auto;min-width:0;padding:0 12px;font-family:Inter,sans-serif;font-size:14px;font-weight:500;color:#0d56aa}.details-ldap-paginator{margin-top:8px}.details-ldap-table__add-btn--delete{color:#c62828}.details-ldap-table{width:100%}.details-ldap-table__empty{margin:16px 0 8px;font-family:Inter,sans-serif;font-size:14px;line-height:20px;color:#737480;text-align:center}.details-ldap-table__row--disabled{opacity:.35}.details-ldap-table__add-btn{min-width:0;padding:0;font-family:Inter,sans-serif;font-size:14px;font-weight:500;line-height:20px;letter-spacing:0;color:#0d56aa}:host ::ng-deep .details-ldap-table .mat-header-cell{font-family:Inter,sans-serif;font-size:12px;font-weight:500;line-height:16px;letter-spacing:0;color:#737480;height:30px;padding:7px 8px}:host ::ng-deep .details-ldap-table .mat-cell{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0;color:#333;height:40px;padding:8px}.details-inline-fields{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px}.details-inline-fields--four{grid-template-columns:repeat(4,minmax(0,1fr))}.devices-rows{display:flex;flex-direction:column;gap:24px}.details-inline-field{display:flex;flex-direction:column;gap:4px}.details-inline-field__label{color:#c0c2ce;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0}.details-step-input{width:100%}.line-route-list{display:flex;flex-direction:column;gap:16px}.line-route-row{display:flex;gap:16px}.line-info{display:flex;align-items:flex-start;gap:16px}.line-route-field{flex:1 1 180px;min-width:160px}.line-route-field{display:flex;flex-direction:column;gap:0}.line-route-field:nth-of-type(1) .line-route-select{width:230px}.line-route-field .line-route-select{width:185px}:host ::ng-deep .details-step-select .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .details-step-input .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .details-step-select .mat-form-field-flex{align-items:center;height:36px;border:1px solid #767676;border-radius:6px;padding:0 12px}:host ::ng-deep .details-step-input .mat-form-field-flex{align-items:center;height:36px;border:1px solid #767676;border-radius:4px;padding:10px 8px}:host ::ng-deep .details-step-select .mat-form-field-outline,:host ::ng-deep .details-step-select .mat-form-field-outline-start,:host ::ng-deep .details-step-select .mat-form-field-outline-end,:host ::ng-deep .details-step-select .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-step-input .mat-form-field-outline,:host ::ng-deep .details-step-input .mat-form-field-outline-start,:host ::ng-deep .details-step-input .mat-form-field-outline-end,:host ::ng-deep .details-step-input .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-step-select .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .details-step-input .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .details-step-select .mat-select-trigger{display:flex;align-items:center;justify-content:space-between;height:100%}:host ::ng-deep .details-step-input .mat-input-element{height:100%;margin:0}:host ::ng-deep .details-step-input.mat-form-field-disabled .mat-form-field-flex{background-color:#f5f6fa;border-color:#b8beca;opacity:.55;cursor:not-allowed}:host ::ng-deep .details-step-input .mat-input-element:disabled{color:#7f8694;-webkit-text-fill-color:#7f8694;cursor:not-allowed}:host ::ng-deep .line-info .details-step-input .mat-form-field-flex{height:36px;padding:0 8px}:host ::ng-deep .line-info .details-step-input .mat-form-field-infix{padding:0}:host ::ng-deep .line-info .details-step-input .mat-input-element{font-size:14px;line-height:20px}:host ::ng-deep .mat-form-field-subscript-wrapper{position:relative}:host ::ng-deep .line-info .details-step-input .mat-form-field-subscript-wrapper{margin-top:4px;position:relative}:host ::ng-deep .details-user-accordion .mat-expansion-panel{border:0;border-radius:0!important;background:transparent;box-shadow:none!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header{padding:0 0 0 8px;min-height:32px;height:32px}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header-title{margin:0;display:flex;align-items:center;font-family:Inter,sans-serif;font-size:14px;font-weight:500;line-height:20px;letter-spacing:0;color:#333}:host ::ng-deep .details-user-accordion .mat-expansion-panel-body{padding:0!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-content{display:flex;align-items:center}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-expansion-indicator{display:block!important;opacity:1!important;color:#333!important;align-self:center;margin:0 8px 0 0!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-expansion-indicator:after{color:#333!important;border-color:#333!important;position:relative;top:-4px}:host ::ng-deep .devices-rows .details-inline-fields .details-inline-field .mat-form-field .mat-form-field-flex{display:flex;gap:3px}:host ::ng-deep .devices-rows .details-inline-fields .details-inline-field .mat-form-field .mat-form-field-flex .mat-form-field-prefix{top:1px}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i5.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i5.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i5.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i5.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i5.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i5.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i5.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i5.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i5.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i8.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i8.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i9.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i7$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i11.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i12.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i12.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i13.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "component", type: i14.MatChipList, selector: "mat-chip-list", inputs: ["role", "aria-describedby", "errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { kind: "directive", type: i14.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "role", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { kind: "directive", type: i14.MatChipRemove, selector: "[matChipRemove]" }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1$2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i15.MatAccordion, selector: "mat-accordion", inputs: ["multi", "hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i15.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i15.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "directive", type: i15.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "component", type: AppLoaderComponent, selector: "app-loader" }] });
722
+ UserDetailsStepComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserDetailsStepComponent, deps: [{ token: UserCreationWizardService }], target: i0.ɵɵFactoryTarget.Component });
723
+ UserDetailsStepComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UserDetailsStepComponent, selector: "tk-user-details-step", ngImport: i0, template: "<section class=\"details-step-content\">\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">User details</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"details-step-section__part\">\r\n <div class=\"details-inline-fields\">\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">User ID</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"User ID\"\r\n [value]=\"userCreationWizardService.userDetailsForm.userId\"\r\n (input)=\"\r\n userCreationWizardService.setUserDetailsField(\r\n 'userId',\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">First Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"First Name\"\r\n [value]=\"userCreationWizardService.userDetailsForm.firstName\"\r\n (input)=\"\r\n userCreationWizardService.setUserDetailsField(\r\n 'firstName',\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Last Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Last Name\"\r\n [value]=\"userCreationWizardService.userDetailsForm.lastName\"\r\n (input)=\"\r\n userCreationWizardService.setUserDetailsField(\r\n 'lastName',\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Email</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Email\"\r\n [value]=\"userCreationWizardService.userDetailsForm.email\"\r\n (input)=\"\r\n userCreationWizardService.setUserDetailsField(\r\n 'email',\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">User Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"User Template\"\r\n [value]=\"userCreationWizardService.selectedTemplate || ''\"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"details-step-section__part\">\r\n <mat-accordion class=\"details-user-accordion\">\r\n <mat-expansion-panel togglePosition=\"before\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title\r\n >Choose an existing or a LDAP user</mat-panel-title\r\n >\r\n </mat-expansion-panel-header>\r\n <div class=\"details-user-accordion__content\">\r\n <table\r\n mat-table\r\n [dataSource]=\"userCreationWizardService.ldapUsers\"\r\n class=\"details-ldap-table\"\r\n >\r\n <ng-container matColumnDef=\"userId\">\r\n <th mat-header-cell *matHeaderCellDef>User ID</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.userId }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"firstName\">\r\n <th mat-header-cell *matHeaderCellDef>First Name</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.firstName }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"lastName\">\r\n <th mat-header-cell *matHeaderCellDef>Last Name</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.lastName }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"email\">\r\n <th mat-header-cell *matHeaderCellDef>Email</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.email }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"add\">\r\n <th mat-header-cell *matHeaderCellDef>Add</th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <button\r\n mat-button\r\n class=\"details-ldap-table__add-btn\"\r\n type=\"button\"\r\n [disabled]=\"\r\n userCreationWizardService.isLdapUserAdded(row)\r\n \"\r\n (click)=\"onAddUser(row)\"\r\n >\r\n Add user\r\n </button>\r\n </td>\r\n </ng-container>\r\n\r\n <tr\r\n mat-header-row\r\n *matHeaderRowDef=\"\r\n userCreationWizardService.ldapTableColumns\r\n \"\r\n ></tr>\r\n <tr\r\n mat-row\r\n *matRowDef=\"\r\n let row;\r\n columns: userCreationWizardService.ldapTableColumns\r\n \"\r\n [class.details-ldap-table__row--disabled]=\"\r\n userCreationWizardService.isLdapUserAdded(row)\r\n \"\r\n ></tr>\r\n </table>\r\n </div>\r\n </mat-expansion-panel>\r\n </mat-accordion>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Lines</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"line-route-list\">\r\n <div\r\n class=\"line-route-row\"\r\n *ngFor=\"\r\n let lineSelection of userCreationWizardService.lineSelections;\r\n let idx = index\r\n \"\r\n >\r\n <div class=\"line-route-field\">\r\n <mat-form-field\r\n class=\"details-step-select line-route-select\"\r\n appearance=\"outline\"\r\n >\r\n <mat-select\r\n placeholder=\"Select line\"\r\n [value]=\"lineSelection.lineNumber\"\r\n (selectionChange)=\"\r\n userCreationWizardService.setLineSelection(\r\n idx,\r\n $event.value\r\n )\r\n \"\r\n >\r\n <mat-option\r\n *ngFor=\"let line of userCreationWizardService.lineOptions\"\r\n [value]=\"line.number\"\r\n >\r\n {{ line.number }} - {{ line.did }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"line-route-field\">\r\n <mat-form-field\r\n class=\"details-step-select line-route-select\"\r\n appearance=\"outline\"\r\n >\r\n <mat-select\r\n placeholder=\"Select route partition\"\r\n [value]=\"lineSelection.routePartitionName\"\r\n (selectionChange)=\"\r\n userCreationWizardService.setRoutePartitionSelection(\r\n idx,\r\n $event.value\r\n )\r\n \"\r\n >\r\n <mat-option\r\n *ngFor=\"\r\n let partition of userCreationWizardService.routePartitionOptions\r\n \"\r\n [value]=\"partition\"\r\n >\r\n {{ partition }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Devices</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"devices-rows\">\r\n <div\r\n class=\"details-inline-fields details-inline-fields--four\"\r\n *ngFor=\"\r\n let _row of userCreationWizardService.deviceRows;\r\n let idx = index\r\n \"\r\n >\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Device type</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Device type\"\r\n [value]=\"\r\n userCreationWizardService.deviceEntries[idx].deviceType ||\r\n ''\r\n \"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Protocol</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Protocol\"\r\n [value]=\"\r\n userCreationWizardService.deviceEntries[idx].protocol || ''\r\n \"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Button Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Button Template\"\r\n [value]=\"\r\n userCreationWizardService.deviceEntries[idx]\r\n .buttonTemplate || ''\r\n \"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Name\"\r\n [value]=\"getDeviceName(idx)\"\r\n (input)=\"\r\n userCreationWizardService.setDeviceName(\r\n idx,\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n</section>\r\n", styles: [".details-step-content{display:flex;flex-direction:column;gap:0}.details-step-dropdowns{display:flex;flex-direction:column;gap:1rem}.details-step-field{display:flex;flex-direction:column;gap:8px}.details-step-label{font-size:16px;font-weight:400;line-height:100%;letter-spacing:0;color:#333}.details-step-select{width:333px}.details-step-divider{border-top:1px solid #d9d9d9;margin-top:24px}.details-step-sections{display:flex;flex-direction:column}.details-step-section{display:flex;flex-direction:column;gap:0;padding:24px 0}.details-step-sections>.details-step-section:first-child{padding-top:0}.details-step-section+.details-step-section{border-top:1px solid #d9d9d9}.details-step-section__title{margin:0;font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:100%;letter-spacing:0;color:#333}.details-step-section__content{margin-top:24px}.details-step-section__part+.details-step-section__part{margin-top:24px}.details-user-accordion{width:100%}.details-user-accordion__content{padding:12px 0 0}.details-ldap-table{width:100%}.details-ldap-table__row--disabled{opacity:.35}.details-ldap-table__add-btn{min-width:0;padding:0;font-family:Inter,sans-serif;font-size:14px;font-weight:500;line-height:20px;letter-spacing:0;color:#0d56aa}:host ::ng-deep .details-ldap-table .mat-header-cell{font-family:Inter,sans-serif;font-size:12px;font-weight:500;line-height:16px;letter-spacing:0;color:#737480;height:30px;padding:7px 8px}:host ::ng-deep .details-ldap-table .mat-cell{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0;color:#333;height:40px;padding:8px}.details-inline-fields{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px}.details-inline-fields--four{grid-template-columns:repeat(4,minmax(0,1fr))}.devices-rows{display:flex;flex-direction:column;gap:24px}.details-inline-field{display:flex;flex-direction:column;gap:4px}.details-inline-field__label{color:#c0c2ce;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0}.details-step-input{width:100%}.line-route-list{display:flex;flex-direction:column;gap:16px}.line-route-row{display:flex;gap:16px}.line-route-field{display:flex;flex-direction:column;gap:0}.line-route-field:nth-of-type(1) .line-route-select{width:230px}.line-route-field .line-route-select{width:185px}:host ::ng-deep .details-step-select .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .details-step-input .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .details-step-select .mat-form-field-flex{align-items:center;height:32px;border:1px solid #767676;border-radius:6px;padding:0 12px}:host ::ng-deep .details-step-input .mat-form-field-flex{align-items:center;height:36px;border:1px solid #767676;border-radius:4px;padding:10px 8px}:host ::ng-deep .details-step-select .mat-form-field-outline,:host ::ng-deep .details-step-select .mat-form-field-outline-start,:host ::ng-deep .details-step-select .mat-form-field-outline-end,:host ::ng-deep .details-step-select .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-step-input .mat-form-field-outline,:host ::ng-deep .details-step-input .mat-form-field-outline-start,:host ::ng-deep .details-step-input .mat-form-field-outline-end,:host ::ng-deep .details-step-input .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-step-select .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .details-step-input .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .details-step-select .mat-select-trigger{display:flex;align-items:center;justify-content:space-between;height:100%}:host ::ng-deep .details-step-input .mat-input-element{height:100%;margin:0}:host ::ng-deep .details-step-input.mat-form-field-disabled .mat-form-field-flex{background-color:#f5f6fa;border-color:#b8beca;opacity:.55;cursor:not-allowed}:host ::ng-deep .details-step-input .mat-input-element:disabled{color:#7f8694;-webkit-text-fill-color:#7f8694;cursor:not-allowed}:host ::ng-deep .details-user-accordion .mat-expansion-panel{border:0;border-radius:0!important;background:transparent;box-shadow:none!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header{padding:0 0 0 8px;min-height:32px;height:32px}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header-title{margin:0;display:flex;align-items:center;font-family:Inter,sans-serif;font-size:14px;font-weight:500;line-height:20px;letter-spacing:0;color:#333}:host ::ng-deep .details-user-accordion .mat-expansion-panel-body{padding:0!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-content{display:flex;align-items:center}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-expansion-indicator{display:block!important;opacity:1!important;color:#333!important;align-self:center;margin:0 8px 0 0!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-expansion-indicator:after{color:#333!important;border-color:#333!important;position:relative;top:-4px}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i3.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i3.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i3.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i3.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i3.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i3.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i3.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i3.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i3.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i4$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i8.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i9.MatAccordion, selector: "mat-accordion", inputs: ["multi", "hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i9.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i9.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "directive", type: i9.MatExpansionPanelTitle, selector: "mat-panel-title" }] });
2178
724
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserDetailsStepComponent, decorators: [{
2179
725
  type: Component,
2180
- args: [{ selector: 'tk-user-details-step', template: "<app-loader *ngIf=\"loadingAvailableNumbers\"></app-loader>\r\n<section class=\"details-step-content\">\r\n <form [formGroup]=\"userDetailsForm\">\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">User details</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"details-step-section__part\">\r\n <div class=\"details-inline-fields\">\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">User ID</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput placeholder=\"User ID\" formControlName=\"userId\" />\r\n <mat-error *ngIf=\"userDetailsForm.get('userId')?.hasError('required') && userDetailsForm.get('userId')?.touched\">\r\n User ID is required\r\n </mat-error>\r\n <mat-error *ngIf=\"userDetailsForm.get('userId')?.hasError('userIdExists') && userDetailsForm.get('userId')?.touched\">\r\n User ID already exists\r\n </mat-error>\r\n <mat-hint *ngIf=\"userIdCheckPending\">Checking user ID...</mat-hint>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">First Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput placeholder=\"First Name\" formControlName=\"firstName\" />\r\n <mat-error *ngIf=\"userDetailsForm.get('firstName')?.hasError('required') && userDetailsForm.get('firstName')?.touched\">\r\n First name is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Last Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput placeholder=\"Last Name\" formControlName=\"lastName\" />\r\n <mat-error *ngIf=\"userDetailsForm.get('lastName')?.hasError('required') && userDetailsForm.get('lastName')?.touched\">\r\n Last name is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Email</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput placeholder=\"Email\" formControlName=\"email\" />\r\n <mat-error *ngIf=\"userDetailsForm.get('email')?.invalid && userDetailsForm.get('email')?.touched\">\r\n <span *ngIf=\"userDetailsForm.get('email')?.hasError('required')\">Email is required</span>\r\n <span *ngIf=\"userDetailsForm.get('email')?.hasError('email')\">Please enter a valid email</span>\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">User Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"User Template\"\r\n [value]=\"userCreationWizardService.selectedTemplateName || ''\"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"details-step-section__part\">\r\n <mat-accordion class=\"details-user-accordion\">\r\n <mat-expansion-panel togglePosition=\"before\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>Choose an existing or a LDAP user</mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <div class=\"details-user-accordion__content\">\r\n <div class=\"details-ldap-search\" [formGroup]=\"ldapSearchForm\">\r\n <mat-form-field\r\n class=\"details-ldap-search__input\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n >\r\n <input\r\n matInput\r\n placeholder=\"Search\"\r\n formControlName=\"queryValue\"\r\n (keyup.enter)=\"searchLdapUsers()\"\r\n />\r\n </mat-form-field>\r\n\r\n <mat-form-field\r\n class=\"details-ldap-search__select\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n >\r\n <mat-select formControlName=\"queryType\">\r\n <mat-option *ngFor=\"let option of ldapQueryTypeOptions\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-chip-list *ngIf=\"selectedLdapUser\" class=\"details-ldap-search__chip\">\r\n <mat-chip removable (removed)=\"onRemoveLdapTag()\">\r\n {{ selectedLdapUser.userid }}\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip>\r\n </mat-chip-list>\r\n\r\n <button\r\n mat-button\r\n class=\"details-ldap-search__btn\"\r\n type=\"button\"\r\n [disabled]=\"ldapLoading\"\r\n (click)=\"searchLdapUsers()\"\r\n >\r\n Search\r\n </button>\r\n </div>\r\n\r\n <app-loader *ngIf=\"ldapLoading\"></app-loader>\r\n\r\n <p\r\n *ngIf=\"!ldapLoading && ldapSearchAttempted && !hasLdapUsers\"\r\n class=\"details-ldap-table__empty\"\r\n >\r\n No users found\r\n </p>\r\n\r\n <table\r\n *ngIf=\"!ldapLoading && hasLdapUsers\"\r\n mat-table\r\n [dataSource]=\"userCreationWizardService.ldapUsers\"\r\n class=\"details-ldap-table\"\r\n >\r\n <ng-container matColumnDef=\"userId\">\r\n <th mat-header-cell *matHeaderCellDef>User Id</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.userid }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"firstName\">\r\n <th mat-header-cell *matHeaderCellDef>First Name</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.firstName }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"lastName\">\r\n <th mat-header-cell *matHeaderCellDef>Last Name</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.lastName }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"email\">\r\n <th mat-header-cell *matHeaderCellDef>Email</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.email }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"add\">\r\n <th mat-header-cell *matHeaderCellDef>Add</th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <button\r\n *ngIf=\"!isLdapUserRowSelected(row); else deleteLdapUserBtn\"\r\n mat-button\r\n class=\"details-ldap-table__add-btn\"\r\n type=\"button\"\r\n (click)=\"onAddLdapUser(row)\"\r\n >\r\n Add User\r\n </button>\r\n <ng-template #deleteLdapUserBtn>\r\n <button\r\n mat-button\r\n class=\"details-ldap-table__add-btn details-ldap-table__add-btn--delete\"\r\n type=\"button\"\r\n (click)=\"onDeleteLdapUser(row)\"\r\n >\r\n Delete user\r\n </button>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"userCreationWizardService.ldapTableColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: userCreationWizardService.ldapTableColumns\"></tr>\r\n </table>\r\n\r\n <mat-paginator\r\n *ngIf=\"!ldapLoading && hasLdapUsers\"\r\n class=\"details-ldap-paginator\"\r\n [length]=\"ldapTotalCount\"\r\n [pageSize]=\"ldapPageSize\"\r\n [pageIndex]=\"ldapPageIndex\"\r\n [pageSizeOptions]=\"[ldapPageSize]\"\r\n [hidePageSize]=\"true\"\r\n [disabled]=\"ldapLoading\"\r\n (page)=\"onLdapPageChange($event)\"\r\n ></mat-paginator>\r\n </div>\r\n </mat-expansion-panel>\r\n </mat-accordion>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Lines</h3>\r\n <div class=\"details-step-section__content\" formArrayName=\"lines\">\r\n <div class=\"line-route-list\">\r\n <div\r\n class=\"line-route-row\"\r\n *ngFor=\"let lineGroup of linesFormArray.controls; let idx = index\"\r\n [formGroupName]=\"idx\"\r\n >\r\n <div class=\"line-info\">\r\n <mat-form-field\r\n class=\"details-step-input line-route-field\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n hideRequiredMarker\r\n >\r\n <input matInput placeholder=\"Line number\" formControlName=\"lineNumber\" />\r\n </mat-form-field>\r\n\r\n <mat-form-field\r\n class=\"details-step-input line-route-field\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n hideRequiredMarker\r\n >\r\n <input\r\n matInput\r\n placeholder=\"Search for a number\"\r\n formControlName=\"number\"\r\n [matAutocomplete]=\"numberAuto\"\r\n (input)=\"filterAvailableNumbers(idx, $event)\"\r\n />\r\n <mat-autocomplete\r\n #numberAuto=\"matAutocomplete\"\r\n [panelWidth]=\"'auto'\"\r\n (optionSelected)=\"onNumberSelected(idx, $event.option.value)\"\r\n >\r\n <mat-option *ngFor=\"let option of getFilteredNumbers(idx)\" [value]=\"option\">\r\n {{ option }}\r\n </mat-option>\r\n </mat-autocomplete>\r\n <mat-error *ngIf=\"getLineGroup(idx).get('number')?.invalid && getLineGroup(idx).get('number')?.touched\">\r\n Number is required\r\n </mat-error>\r\n </mat-form-field>\r\n\r\n <mat-form-field\r\n class=\"details-step-input line-route-field\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n hideRequiredMarker\r\n >\r\n <input\r\n matInput\r\n placeholder=\"Select route partition\"\r\n formControlName=\"routePartition\"\r\n [matAutocomplete]=\"routePartitionAuto\"\r\n (input)=\"filterRoutePartitions(idx, $event)\"\r\n />\r\n <mat-autocomplete\r\n #routePartitionAuto=\"matAutocomplete\"\r\n (optionSelected)=\"onRoutePartitionSelected(idx, $event.option.value)\"\r\n >\r\n <mat-option\r\n *ngFor=\"let routePartition of getFilteredRoutePartitions(idx)\"\r\n [value]=\"routePartition\"\r\n >\r\n {{ routePartition }}\r\n </mat-option>\r\n </mat-autocomplete>\r\n <mat-error *ngIf=\"getLineGroup(idx).get('routePartition')?.invalid && getLineGroup(idx).get('routePartition')?.touched\">\r\n Route partition is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Devices</h3>\r\n <div class=\"details-step-section__content\" formArrayName=\"devices\">\r\n <div class=\"devices-rows\">\r\n <div\r\n class=\"details-inline-fields details-inline-fields--four\"\r\n *ngFor=\"let deviceGroup of devicesFormArray.controls; let idx = index\"\r\n [formGroupName]=\"idx\"\r\n >\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Device type</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"deviceType\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Protocol</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"protocol\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Button Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"buttonTemplate\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <span matPrefix *ngIf=\"getDeviceNamePrefix(idx) as devicePrefix\">{{ devicePrefix }}</span>\r\n <input matInput placeholder=\"Name\" formControlName=\"name\" />\r\n <mat-error *ngIf=\"getDeviceGroup(idx).get('name')?.hasError('deviceName') && getDeviceGroup(idx).get('name')?.touched\">\r\n {{ getDeviceGroup(idx).get('name')?.getError('deviceName')?.caption || getDeviceNameValidationCaption(idx) || 'Please enter a valid device name' }}\r\n </mat-error>\r\n <mat-error *ngIf=\"getDeviceGroup(idx).get('name')?.hasError('required') && getDeviceGroup(idx).get('name')?.touched\">\r\n Name is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\" *ngIf=\"deviceProfilesFormArray.length\">\r\n <h3 class=\"details-step-section__title\">Device profiles</h3>\r\n <div class=\"details-step-section__content\" formArrayName=\"deviceProfiles\">\r\n <div class=\"devices-rows\">\r\n <div\r\n class=\"details-inline-fields details-inline-fields--four\"\r\n *ngFor=\"let profileGroup of deviceProfilesFormArray.controls; let idx = index\"\r\n [formGroupName]=\"idx\"\r\n >\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Device type</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"deviceType\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Protocol</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"protocol\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Button Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"buttonTemplate\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <span matPrefix *ngIf=\"getDeviceProfileNamePrefix(idx) as profilePrefix\">{{ profilePrefix }}</span>\r\n <input matInput placeholder=\"Name\" formControlName=\"name\" />\r\n <mat-error *ngIf=\"getDeviceProfileGroup(idx).get('name')?.hasError('deviceName') && getDeviceProfileGroup(idx).get('name')?.touched\">\r\n {{ getDeviceProfileGroup(idx).get('name')?.getError('deviceName')?.caption || getDeviceProfileNameValidationCaption(idx) || 'Please enter a valid device name' }}\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n </form>\r\n</section>\r\n", styles: [".details-step-content{display:flex;flex-direction:column;gap:0}.details-step-dropdowns{display:flex;flex-direction:column;gap:1rem}.details-step-field{display:flex;flex-direction:column;gap:8px}.details-step-label{font-size:16px;font-weight:400;line-height:100%;letter-spacing:0;color:#333}.details-step-select{width:333px}.details-step-divider{border-top:1px solid #d9d9d9;margin-top:24px}.details-step-sections{display:flex;flex-direction:column}.details-step-section{display:flex;flex-direction:column;gap:0;padding:24px 0}.details-step-sections>.details-step-section:first-child{padding-top:0}.details-step-section+.details-step-section{border-top:1px solid #d9d9d9}.details-step-section__title{margin:0;font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:100%;letter-spacing:0;color:#333}.details-step-section__content{margin-top:24px}.details-step-section__part+.details-step-section__part{margin-top:24px}.details-user-accordion{width:100%}.details-user-accordion__content{padding:12px 0 0}.details-ldap-search{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:16px}.details-ldap-search__input{min-width:180px;width:180px}.details-ldap-search__select{flex:0 1 180px;min-width:160px}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-wrapper,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-wrapper{padding-bottom:0;margin:0}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-flex,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-flex{align-items:center;height:36px;border:1px solid #767676;border-radius:4px;padding:0 12px}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-outline,:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-outline-start,:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-outline-end,:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-outline-gap,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-outline,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-outline-start,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-outline-end,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-infix,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-infix{width:100%;border-top:0;padding:0;display:flex;align-items:center;min-height:unset}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-input-element,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-input-element{margin:0;line-height:20px}:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-select-trigger{display:flex;align-items:center;width:100%;height:100%}:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-select-value{display:flex;align-items:center;max-width:100%}:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-select-arrow-wrapper{display:flex;align-items:center}.details-ldap-search__chip{flex:0 0 auto}.details-ldap-search__btn{flex:0 0 auto;min-width:0;padding:0 12px;font-family:Inter,sans-serif;font-size:14px;font-weight:500;color:#0d56aa}.details-ldap-paginator{margin-top:8px}.details-ldap-table__add-btn--delete{color:#c62828}.details-ldap-table{width:100%}.details-ldap-table__empty{margin:16px 0 8px;font-family:Inter,sans-serif;font-size:14px;line-height:20px;color:#737480;text-align:center}.details-ldap-table__row--disabled{opacity:.35}.details-ldap-table__add-btn{min-width:0;padding:0;font-family:Inter,sans-serif;font-size:14px;font-weight:500;line-height:20px;letter-spacing:0;color:#0d56aa}:host ::ng-deep .details-ldap-table .mat-header-cell{font-family:Inter,sans-serif;font-size:12px;font-weight:500;line-height:16px;letter-spacing:0;color:#737480;height:30px;padding:7px 8px}:host ::ng-deep .details-ldap-table .mat-cell{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0;color:#333;height:40px;padding:8px}.details-inline-fields{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px}.details-inline-fields--four{grid-template-columns:repeat(4,minmax(0,1fr))}.devices-rows{display:flex;flex-direction:column;gap:24px}.details-inline-field{display:flex;flex-direction:column;gap:4px}.details-inline-field__label{color:#c0c2ce;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0}.details-step-input{width:100%}.line-route-list{display:flex;flex-direction:column;gap:16px}.line-route-row{display:flex;gap:16px}.line-info{display:flex;align-items:flex-start;gap:16px}.line-route-field{flex:1 1 180px;min-width:160px}.line-route-field{display:flex;flex-direction:column;gap:0}.line-route-field:nth-of-type(1) .line-route-select{width:230px}.line-route-field .line-route-select{width:185px}:host ::ng-deep .details-step-select .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .details-step-input .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .details-step-select .mat-form-field-flex{align-items:center;height:36px;border:1px solid #767676;border-radius:6px;padding:0 12px}:host ::ng-deep .details-step-input .mat-form-field-flex{align-items:center;height:36px;border:1px solid #767676;border-radius:4px;padding:10px 8px}:host ::ng-deep .details-step-select .mat-form-field-outline,:host ::ng-deep .details-step-select .mat-form-field-outline-start,:host ::ng-deep .details-step-select .mat-form-field-outline-end,:host ::ng-deep .details-step-select .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-step-input .mat-form-field-outline,:host ::ng-deep .details-step-input .mat-form-field-outline-start,:host ::ng-deep .details-step-input .mat-form-field-outline-end,:host ::ng-deep .details-step-input .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-step-select .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .details-step-input .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .details-step-select .mat-select-trigger{display:flex;align-items:center;justify-content:space-between;height:100%}:host ::ng-deep .details-step-input .mat-input-element{height:100%;margin:0}:host ::ng-deep .details-step-input.mat-form-field-disabled .mat-form-field-flex{background-color:#f5f6fa;border-color:#b8beca;opacity:.55;cursor:not-allowed}:host ::ng-deep .details-step-input .mat-input-element:disabled{color:#7f8694;-webkit-text-fill-color:#7f8694;cursor:not-allowed}:host ::ng-deep .line-info .details-step-input .mat-form-field-flex{height:36px;padding:0 8px}:host ::ng-deep .line-info .details-step-input .mat-form-field-infix{padding:0}:host ::ng-deep .line-info .details-step-input .mat-input-element{font-size:14px;line-height:20px}:host ::ng-deep .mat-form-field-subscript-wrapper{position:relative}:host ::ng-deep .line-info .details-step-input .mat-form-field-subscript-wrapper{margin-top:4px;position:relative}:host ::ng-deep .details-user-accordion .mat-expansion-panel{border:0;border-radius:0!important;background:transparent;box-shadow:none!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header{padding:0 0 0 8px;min-height:32px;height:32px}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header-title{margin:0;display:flex;align-items:center;font-family:Inter,sans-serif;font-size:14px;font-weight:500;line-height:20px;letter-spacing:0;color:#333}:host ::ng-deep .details-user-accordion .mat-expansion-panel-body{padding:0!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-content{display:flex;align-items:center}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-expansion-indicator{display:block!important;opacity:1!important;color:#333!important;align-self:center;margin:0 8px 0 0!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-expansion-indicator:after{color:#333!important;border-color:#333!important;position:relative;top:-4px}:host ::ng-deep .devices-rows .details-inline-fields .details-inline-field .mat-form-field .mat-form-field-flex{display:flex;gap:3px}:host ::ng-deep .devices-rows .details-inline-fields .details-inline-field .mat-form-field .mat-form-field-flex .mat-form-field-prefix{top:1px}\n"] }]
2181
- }], ctorParameters: function () { return [{ type: i1$2.FormBuilder }, { type: UserCreationApiService }, { type: UserCreationWizardService }]; }, propDecorators: { validityChange: [{
2182
- type: Output
2183
- }] } });
726
+ args: [{ selector: 'tk-user-details-step', template: "<section class=\"details-step-content\">\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">User details</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"details-step-section__part\">\r\n <div class=\"details-inline-fields\">\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">User ID</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"User ID\"\r\n [value]=\"userCreationWizardService.userDetailsForm.userId\"\r\n (input)=\"\r\n userCreationWizardService.setUserDetailsField(\r\n 'userId',\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">First Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"First Name\"\r\n [value]=\"userCreationWizardService.userDetailsForm.firstName\"\r\n (input)=\"\r\n userCreationWizardService.setUserDetailsField(\r\n 'firstName',\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Last Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Last Name\"\r\n [value]=\"userCreationWizardService.userDetailsForm.lastName\"\r\n (input)=\"\r\n userCreationWizardService.setUserDetailsField(\r\n 'lastName',\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Email</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Email\"\r\n [value]=\"userCreationWizardService.userDetailsForm.email\"\r\n (input)=\"\r\n userCreationWizardService.setUserDetailsField(\r\n 'email',\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">User Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"User Template\"\r\n [value]=\"userCreationWizardService.selectedTemplate || ''\"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"details-step-section__part\">\r\n <mat-accordion class=\"details-user-accordion\">\r\n <mat-expansion-panel togglePosition=\"before\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title\r\n >Choose an existing or a LDAP user</mat-panel-title\r\n >\r\n </mat-expansion-panel-header>\r\n <div class=\"details-user-accordion__content\">\r\n <table\r\n mat-table\r\n [dataSource]=\"userCreationWizardService.ldapUsers\"\r\n class=\"details-ldap-table\"\r\n >\r\n <ng-container matColumnDef=\"userId\">\r\n <th mat-header-cell *matHeaderCellDef>User ID</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.userId }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"firstName\">\r\n <th mat-header-cell *matHeaderCellDef>First Name</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.firstName }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"lastName\">\r\n <th mat-header-cell *matHeaderCellDef>Last Name</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.lastName }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"email\">\r\n <th mat-header-cell *matHeaderCellDef>Email</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.email }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"add\">\r\n <th mat-header-cell *matHeaderCellDef>Add</th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <button\r\n mat-button\r\n class=\"details-ldap-table__add-btn\"\r\n type=\"button\"\r\n [disabled]=\"\r\n userCreationWizardService.isLdapUserAdded(row)\r\n \"\r\n (click)=\"onAddUser(row)\"\r\n >\r\n Add user\r\n </button>\r\n </td>\r\n </ng-container>\r\n\r\n <tr\r\n mat-header-row\r\n *matHeaderRowDef=\"\r\n userCreationWizardService.ldapTableColumns\r\n \"\r\n ></tr>\r\n <tr\r\n mat-row\r\n *matRowDef=\"\r\n let row;\r\n columns: userCreationWizardService.ldapTableColumns\r\n \"\r\n [class.details-ldap-table__row--disabled]=\"\r\n userCreationWizardService.isLdapUserAdded(row)\r\n \"\r\n ></tr>\r\n </table>\r\n </div>\r\n </mat-expansion-panel>\r\n </mat-accordion>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Lines</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"line-route-list\">\r\n <div\r\n class=\"line-route-row\"\r\n *ngFor=\"\r\n let lineSelection of userCreationWizardService.lineSelections;\r\n let idx = index\r\n \"\r\n >\r\n <div class=\"line-route-field\">\r\n <mat-form-field\r\n class=\"details-step-select line-route-select\"\r\n appearance=\"outline\"\r\n >\r\n <mat-select\r\n placeholder=\"Select line\"\r\n [value]=\"lineSelection.lineNumber\"\r\n (selectionChange)=\"\r\n userCreationWizardService.setLineSelection(\r\n idx,\r\n $event.value\r\n )\r\n \"\r\n >\r\n <mat-option\r\n *ngFor=\"let line of userCreationWizardService.lineOptions\"\r\n [value]=\"line.number\"\r\n >\r\n {{ line.number }} - {{ line.did }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"line-route-field\">\r\n <mat-form-field\r\n class=\"details-step-select line-route-select\"\r\n appearance=\"outline\"\r\n >\r\n <mat-select\r\n placeholder=\"Select route partition\"\r\n [value]=\"lineSelection.routePartitionName\"\r\n (selectionChange)=\"\r\n userCreationWizardService.setRoutePartitionSelection(\r\n idx,\r\n $event.value\r\n )\r\n \"\r\n >\r\n <mat-option\r\n *ngFor=\"\r\n let partition of userCreationWizardService.routePartitionOptions\r\n \"\r\n [value]=\"partition\"\r\n >\r\n {{ partition }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Devices</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"devices-rows\">\r\n <div\r\n class=\"details-inline-fields details-inline-fields--four\"\r\n *ngFor=\"\r\n let _row of userCreationWizardService.deviceRows;\r\n let idx = index\r\n \"\r\n >\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Device type</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Device type\"\r\n [value]=\"\r\n userCreationWizardService.deviceEntries[idx].deviceType ||\r\n ''\r\n \"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Protocol</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Protocol\"\r\n [value]=\"\r\n userCreationWizardService.deviceEntries[idx].protocol || ''\r\n \"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Button Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Button Template\"\r\n [value]=\"\r\n userCreationWizardService.deviceEntries[idx]\r\n .buttonTemplate || ''\r\n \"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Name\"\r\n [value]=\"getDeviceName(idx)\"\r\n (input)=\"\r\n userCreationWizardService.setDeviceName(\r\n idx,\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n</section>\r\n", styles: [".details-step-content{display:flex;flex-direction:column;gap:0}.details-step-dropdowns{display:flex;flex-direction:column;gap:1rem}.details-step-field{display:flex;flex-direction:column;gap:8px}.details-step-label{font-size:16px;font-weight:400;line-height:100%;letter-spacing:0;color:#333}.details-step-select{width:333px}.details-step-divider{border-top:1px solid #d9d9d9;margin-top:24px}.details-step-sections{display:flex;flex-direction:column}.details-step-section{display:flex;flex-direction:column;gap:0;padding:24px 0}.details-step-sections>.details-step-section:first-child{padding-top:0}.details-step-section+.details-step-section{border-top:1px solid #d9d9d9}.details-step-section__title{margin:0;font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:100%;letter-spacing:0;color:#333}.details-step-section__content{margin-top:24px}.details-step-section__part+.details-step-section__part{margin-top:24px}.details-user-accordion{width:100%}.details-user-accordion__content{padding:12px 0 0}.details-ldap-table{width:100%}.details-ldap-table__row--disabled{opacity:.35}.details-ldap-table__add-btn{min-width:0;padding:0;font-family:Inter,sans-serif;font-size:14px;font-weight:500;line-height:20px;letter-spacing:0;color:#0d56aa}:host ::ng-deep .details-ldap-table .mat-header-cell{font-family:Inter,sans-serif;font-size:12px;font-weight:500;line-height:16px;letter-spacing:0;color:#737480;height:30px;padding:7px 8px}:host ::ng-deep .details-ldap-table .mat-cell{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0;color:#333;height:40px;padding:8px}.details-inline-fields{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px}.details-inline-fields--four{grid-template-columns:repeat(4,minmax(0,1fr))}.devices-rows{display:flex;flex-direction:column;gap:24px}.details-inline-field{display:flex;flex-direction:column;gap:4px}.details-inline-field__label{color:#c0c2ce;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0}.details-step-input{width:100%}.line-route-list{display:flex;flex-direction:column;gap:16px}.line-route-row{display:flex;gap:16px}.line-route-field{display:flex;flex-direction:column;gap:0}.line-route-field:nth-of-type(1) .line-route-select{width:230px}.line-route-field .line-route-select{width:185px}:host ::ng-deep .details-step-select .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .details-step-input .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .details-step-select .mat-form-field-flex{align-items:center;height:32px;border:1px solid #767676;border-radius:6px;padding:0 12px}:host ::ng-deep .details-step-input .mat-form-field-flex{align-items:center;height:36px;border:1px solid #767676;border-radius:4px;padding:10px 8px}:host ::ng-deep .details-step-select .mat-form-field-outline,:host ::ng-deep .details-step-select .mat-form-field-outline-start,:host ::ng-deep .details-step-select .mat-form-field-outline-end,:host ::ng-deep .details-step-select .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-step-input .mat-form-field-outline,:host ::ng-deep .details-step-input .mat-form-field-outline-start,:host ::ng-deep .details-step-input .mat-form-field-outline-end,:host ::ng-deep .details-step-input .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-step-select .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .details-step-input .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .details-step-select .mat-select-trigger{display:flex;align-items:center;justify-content:space-between;height:100%}:host ::ng-deep .details-step-input .mat-input-element{height:100%;margin:0}:host ::ng-deep .details-step-input.mat-form-field-disabled .mat-form-field-flex{background-color:#f5f6fa;border-color:#b8beca;opacity:.55;cursor:not-allowed}:host ::ng-deep .details-step-input .mat-input-element:disabled{color:#7f8694;-webkit-text-fill-color:#7f8694;cursor:not-allowed}:host ::ng-deep .details-user-accordion .mat-expansion-panel{border:0;border-radius:0!important;background:transparent;box-shadow:none!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header{padding:0 0 0 8px;min-height:32px;height:32px}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header-title{margin:0;display:flex;align-items:center;font-family:Inter,sans-serif;font-size:14px;font-weight:500;line-height:20px;letter-spacing:0;color:#333}:host ::ng-deep .details-user-accordion .mat-expansion-panel-body{padding:0!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-content{display:flex;align-items:center}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-expansion-indicator{display:block!important;opacity:1!important;color:#333!important;align-self:center;margin:0 8px 0 0!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-expansion-indicator:after{color:#333!important;border-color:#333!important;position:relative;top:-4px}\n"] }]
727
+ }], ctorParameters: function () { return [{ type: UserCreationWizardService }]; } });
2184
728
 
2185
729
  class UserOverviewStepComponent {
2186
730
  constructor(userCreationWizardService) {
@@ -2191,21 +735,17 @@ class UserOverviewStepComponent {
2191
735
  }
2192
736
  }
2193
737
  UserOverviewStepComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserOverviewStepComponent, deps: [{ token: UserCreationWizardService }], target: i0.ɵɵFactoryTarget.Component });
2194
- UserOverviewStepComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UserOverviewStepComponent, selector: "tk-user-overview-step", ngImport: i0, template: "<section class=\"details-step-content\">\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">User details</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"USER_DETAILS_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of USER_DETAILS_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let user of userCreationWizardService.overviewUsers\">\r\n <span>{{ user.userId }}</span>\r\n <span>{{ user.firstName }}</span>\r\n <span>{{ user.lastName }}</span>\r\n <span>{{ user.email }}</span>\r\n <span>{{ user.userTemplate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n\r\n <div class=\"details-step-divider\"></div>\r\n\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Lines</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"LINES_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of LINES_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let line of userCreationWizardService.overviewLines\">\r\n <span>{{ line.number }}</span>\r\n <span>{{ line.did }}</span>\r\n <span>{{ line.routePartitionName }}</span>\r\n <span>{{ line.css }}</span>\r\n <span>{{ line.description }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n\r\n <div class=\"details-step-divider\"></div>\r\n\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Devices</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"DEVICES_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of DEVICES_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let device of userCreationWizardService.overviewDevices\">\r\n <span>{{ device.name }}</span>\r\n <span>{{ device.deviceType }}</span>\r\n <span>{{ device.lines }}</span>\r\n <span>{{ device.description }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n\r\n <ng-container *ngIf=\"userCreationWizardService.overviewDeviceProfiles.length\">\r\n <div class=\"details-step-divider\"></div>\r\n\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Device profiles</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"DEVICES_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of DEVICES_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let device of userCreationWizardService.overviewDeviceProfiles\">\r\n <span>{{ device.name }}</span>\r\n <span>{{ device.deviceType }}</span>\r\n <span>{{ device.lines }}</span>\r\n <span>{{ device.description }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n </ng-container>\r\n\r\n <div class=\"details-step-divider\"></div>\r\n\r\n <!-- <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Single Number Reach</h3>\r\n <div class=\"details-step-section__content\"></div>\r\n </section>\r\n </div> -->\r\n\r\n <!-- <div class=\"details-step-divider\"></div>\r\n\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Features</h3>\r\n <div class=\"details-step-section__content\">\r\n <span style=\"margin-right: 1rem;\">Voicemail</span> 557046\r\n </div>\r\n </section>\r\n </div> -->\r\n</section>\r\n", styles: [".details-step-content{display:flex;flex-direction:column;gap:24px}.details-step-divider{border-top:1px solid #d9d9d9}.details-step-sections{display:flex;flex-direction:column}.details-step-section{display:flex;flex-direction:column;gap:16px}.details-step-section+.details-step-section{border-top:1px solid #d9d9d9}.details-step-section__title{margin:0;font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:100%;letter-spacing:0;color:#333}.preview-list{display:flex;flex-direction:column;gap:4px}.preview-list__header,.preview-list__row{display:grid;grid-template-columns:repeat(var(--preview-cols, 1),minmax(0,1fr));column-gap:24px}.preview-list__header>span,.preview-list__row>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--Gray-700, #737480);font-family:Inter,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:16px}.preview-list__row>span{min-width:0;color:var(--Gray-700, #333);font-family:Inter,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:150%}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
738
+ UserOverviewStepComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UserOverviewStepComponent, selector: "tk-user-overview-step", ngImport: i0, template: "<section class=\"details-step-content\">\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">User details</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"USER_DETAILS_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of USER_DETAILS_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let user of userCreationWizardService.overviewUsers\">\r\n <span>{{ user.userId }}</span>\r\n <span>{{ user.firstName }}</span>\r\n <span>{{ user.lastName }}</span>\r\n <span>{{ user.email }}</span>\r\n <span>{{ user.userTemplate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n \r\n <div class=\"details-step-divider\"></div>\r\n \r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Lines</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"LINES_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of LINES_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let line of userCreationWizardService.overviewLines\">\r\n <span>{{ line.number }}</span>\r\n <span>{{ line.did }}</span>\r\n <span>{{ line.routePartitionName }}</span>\r\n <span>{{ line.css }}</span>\r\n <span>{{ line.description }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n \r\n <div class=\"details-step-divider\"></div>\r\n \r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Devices</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"DEVICES_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of DEVICES_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let device of userCreationWizardService.overviewDevices\">\r\n <span>{{ device.name }}</span>\r\n <span>{{ device.deviceType }}</span>\r\n <span>{{ device.lines }}</span>\r\n <span>{{ device.description }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n\r\n <div class=\"details-step-divider\"></div>\r\n \r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Single Number Reach</h3>\r\n <div class=\"details-step-section__content\"></div>\r\n </section>\r\n </div>\r\n\r\n <div class=\"details-step-divider\"></div>\r\n \r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Features</h3>\r\n <div class=\"details-step-section__content\">\r\n <span style=\"margin-right: 1rem;\">Voicemail</span> 557046\r\n </div>\r\n </section>\r\n </div>\r\n\r\n</section>", styles: [".details-step-content{display:flex;flex-direction:column;gap:24px}.details-step-divider{border-top:1px solid #d9d9d9}.details-step-sections{display:flex;flex-direction:column}.details-step-section{display:flex;flex-direction:column;gap:16px}.details-step-section+.details-step-section{border-top:1px solid #d9d9d9}.details-step-section__title{margin:0;font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:100%;letter-spacing:0;color:#333}.preview-list{display:flex;flex-direction:column;gap:4px}.preview-list__header,.preview-list__row{display:grid;grid-template-columns:repeat(var(--preview-cols, 1),minmax(0,1fr));column-gap:24px}.preview-list__header>span,.preview-list__row>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--Gray-700, #737480);font-family:Inter,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:16px}.preview-list__row>span{min-width:0;color:var(--Gray-700, #333);font-family:Inter,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:150%}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
2195
739
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserOverviewStepComponent, decorators: [{
2196
740
  type: Component,
2197
- args: [{ selector: 'tk-user-overview-step', template: "<section class=\"details-step-content\">\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">User details</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"USER_DETAILS_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of USER_DETAILS_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let user of userCreationWizardService.overviewUsers\">\r\n <span>{{ user.userId }}</span>\r\n <span>{{ user.firstName }}</span>\r\n <span>{{ user.lastName }}</span>\r\n <span>{{ user.email }}</span>\r\n <span>{{ user.userTemplate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n\r\n <div class=\"details-step-divider\"></div>\r\n\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Lines</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"LINES_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of LINES_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let line of userCreationWizardService.overviewLines\">\r\n <span>{{ line.number }}</span>\r\n <span>{{ line.did }}</span>\r\n <span>{{ line.routePartitionName }}</span>\r\n <span>{{ line.css }}</span>\r\n <span>{{ line.description }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n\r\n <div class=\"details-step-divider\"></div>\r\n\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Devices</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"DEVICES_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of DEVICES_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let device of userCreationWizardService.overviewDevices\">\r\n <span>{{ device.name }}</span>\r\n <span>{{ device.deviceType }}</span>\r\n <span>{{ device.lines }}</span>\r\n <span>{{ device.description }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n\r\n <ng-container *ngIf=\"userCreationWizardService.overviewDeviceProfiles.length\">\r\n <div class=\"details-step-divider\"></div>\r\n\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Device profiles</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"DEVICES_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of DEVICES_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let device of userCreationWizardService.overviewDeviceProfiles\">\r\n <span>{{ device.name }}</span>\r\n <span>{{ device.deviceType }}</span>\r\n <span>{{ device.lines }}</span>\r\n <span>{{ device.description }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n </ng-container>\r\n\r\n <div class=\"details-step-divider\"></div>\r\n\r\n <!-- <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Single Number Reach</h3>\r\n <div class=\"details-step-section__content\"></div>\r\n </section>\r\n </div> -->\r\n\r\n <!-- <div class=\"details-step-divider\"></div>\r\n\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Features</h3>\r\n <div class=\"details-step-section__content\">\r\n <span style=\"margin-right: 1rem;\">Voicemail</span> 557046\r\n </div>\r\n </section>\r\n </div> -->\r\n</section>\r\n", styles: [".details-step-content{display:flex;flex-direction:column;gap:24px}.details-step-divider{border-top:1px solid #d9d9d9}.details-step-sections{display:flex;flex-direction:column}.details-step-section{display:flex;flex-direction:column;gap:16px}.details-step-section+.details-step-section{border-top:1px solid #d9d9d9}.details-step-section__title{margin:0;font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:100%;letter-spacing:0;color:#333}.preview-list{display:flex;flex-direction:column;gap:4px}.preview-list__header,.preview-list__row{display:grid;grid-template-columns:repeat(var(--preview-cols, 1),minmax(0,1fr));column-gap:24px}.preview-list__header>span,.preview-list__row>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--Gray-700, #737480);font-family:Inter,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:16px}.preview-list__row>span{min-width:0;color:var(--Gray-700, #333);font-family:Inter,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:150%}\n"] }]
741
+ args: [{ selector: 'tk-user-overview-step', template: "<section class=\"details-step-content\">\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">User details</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"USER_DETAILS_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of USER_DETAILS_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let user of userCreationWizardService.overviewUsers\">\r\n <span>{{ user.userId }}</span>\r\n <span>{{ user.firstName }}</span>\r\n <span>{{ user.lastName }}</span>\r\n <span>{{ user.email }}</span>\r\n <span>{{ user.userTemplate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n \r\n <div class=\"details-step-divider\"></div>\r\n \r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Lines</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"LINES_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of LINES_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let line of userCreationWizardService.overviewLines\">\r\n <span>{{ line.number }}</span>\r\n <span>{{ line.did }}</span>\r\n <span>{{ line.routePartitionName }}</span>\r\n <span>{{ line.css }}</span>\r\n <span>{{ line.description }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n \r\n <div class=\"details-step-divider\"></div>\r\n \r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Devices</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"DEVICES_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of DEVICES_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let device of userCreationWizardService.overviewDevices\">\r\n <span>{{ device.name }}</span>\r\n <span>{{ device.deviceType }}</span>\r\n <span>{{ device.lines }}</span>\r\n <span>{{ device.description }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n\r\n <div class=\"details-step-divider\"></div>\r\n \r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Single Number Reach</h3>\r\n <div class=\"details-step-section__content\"></div>\r\n </section>\r\n </div>\r\n\r\n <div class=\"details-step-divider\"></div>\r\n \r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Features</h3>\r\n <div class=\"details-step-section__content\">\r\n <span style=\"margin-right: 1rem;\">Voicemail</span> 557046\r\n </div>\r\n </section>\r\n </div>\r\n\r\n</section>", styles: [".details-step-content{display:flex;flex-direction:column;gap:24px}.details-step-divider{border-top:1px solid #d9d9d9}.details-step-sections{display:flex;flex-direction:column}.details-step-section{display:flex;flex-direction:column;gap:16px}.details-step-section+.details-step-section{border-top:1px solid #d9d9d9}.details-step-section__title{margin:0;font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:100%;letter-spacing:0;color:#333}.preview-list{display:flex;flex-direction:column;gap:4px}.preview-list__header,.preview-list__row{display:grid;grid-template-columns:repeat(var(--preview-cols, 1),minmax(0,1fr));column-gap:24px}.preview-list__header>span,.preview-list__row>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--Gray-700, #737480);font-family:Inter,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:16px}.preview-list__row>span{min-width:0;color:var(--Gray-700, #333);font-family:Inter,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:150%}\n"] }]
2198
742
  }], ctorParameters: function () { return [{ type: UserCreationWizardService }]; } });
2199
743
 
2200
744
  class UserTemplateStepComponent {
2201
- get isLoading() {
2202
- return this.loadingSites || this.loadingSiteData;
2203
- }
2204
745
  constructor(userCreationWizardService, userCreationService, fb) {
2205
746
  this.userCreationWizardService = userCreationWizardService;
2206
747
  this.userCreationService = userCreationService;
2207
748
  this.fb = fb;
2208
- this.validityChange = new EventEmitter();
2209
749
  this.formGroup = this.fb.group({
2210
750
  userType: [USER_CREATION_TYPES.CUCM],
2211
751
  siteId: [null],
@@ -2213,8 +753,8 @@ class UserTemplateStepComponent {
2213
753
  });
2214
754
  this.userCreationType = USER_CREATION_TYPES.CUCM;
2215
755
  this.USER_CREATION_TYPES = USER_CREATION_TYPES;
2216
- // readonly defaultTemplateName = 'User 8851 Office';
2217
- // readonly fallbackTemplateId = '-1';
756
+ this.defaultTemplateName = 'User 8851 Office';
757
+ this.fallbackTemplateId = '-1';
2218
758
  this.destroy$ = new Subject();
2219
759
  this.sitesList = [];
2220
760
  this.sitesList$ = this.userCreationService.sitesList$.pipe(takeUntil(this.destroy$), tap((res) => this.sitesList = res));
@@ -2224,21 +764,18 @@ class UserTemplateStepComponent {
2224
764
  const templateControl = this.formGroup.get('userTemplateId');
2225
765
  const currentTemplateId = templateControl === null || templateControl === void 0 ? void 0 : templateControl.value;
2226
766
  const selectedSiteId = (_a = this.formGroup.get('siteId')) === null || _a === void 0 ? void 0 : _a.value;
2227
- // const defaultTemplate = this.templates.find(
2228
- // template => template.name === this.defaultTemplateName
2229
- // );
767
+ const defaultTemplate = this.templates.find(template => template.name === this.defaultTemplateName);
2230
768
  const hasSelectedSite = selectedSiteId !== null && selectedSiteId !== undefined;
2231
- // if (hasSelectedSite && defaultTemplate && String(currentTemplateId || '') !== String(defaultTemplate.id)) {
2232
- // templateControl?.setValue(String(defaultTemplate.id));
2233
- // }
769
+ if (hasSelectedSite && defaultTemplate && String(currentTemplateId || '') !== String(defaultTemplate.id)) {
770
+ templateControl === null || templateControl === void 0 ? void 0 : templateControl.setValue(String(defaultTemplate.id));
771
+ }
2234
772
  }), takeUntil(this.destroy$));
2235
773
  this.isTemplateSelectable = false;
2236
774
  this.templates = [];
2237
- this.loadingSites = false;
2238
- this.loadingSiteData = false;
2239
- this.templateToggleFormControl = new FormControl(false);
775
+ this.templateToggleFormControl = new FormControl(true);
2240
776
  }
2241
777
  ngOnInit() {
778
+ var _a;
2242
779
  this.formGroup.get('userType').valueChanges
2243
780
  .pipe(takeUntil(this.destroy$))
2244
781
  .subscribe((value) => {
@@ -2250,24 +787,11 @@ class UserTemplateStepComponent {
2250
787
  .pipe(
2251
788
  // filter((value) => value !== null && value !== undefined),
2252
789
  tap((value) => {
2253
- // this.formGroup.get('userTemplateId')?.setValue(this.fallbackTemplateId);
2254
- const selectedSite = this.sitesList.find(site => String(site.id) === String(value));
2255
- if (selectedSite) {
2256
- this.userCreationWizardService.setCurrentSite(selectedSite);
2257
- }
2258
- return this.userCreationWizardService.setSelectedSite(value);
2259
- }), takeUntil(this.destroy$), switchMap((value) => {
2260
- if (value === null || value === undefined || value === '') {
2261
- this.loadingSiteData = false;
2262
- return of(null);
2263
- }
2264
- this.loadingSiteData = true;
2265
- return forkJoin([
2266
- this.userCreationService.fetchAllUserTemplates(Number(value)),
2267
- this.userCreationWizardService.getSiteAllData(Number(value)),
2268
- ]).pipe(finalize(() => {
2269
- this.loadingSiteData = false;
2270
- }));
790
+ var _a;
791
+ (_a = this.formGroup.get('userTemplateId')) === null || _a === void 0 ? void 0 : _a.setValue(this.fallbackTemplateId);
792
+ // return this.userCreationWizardService.setSelectedTemplate(value);
793
+ }), startWith((_a = this.formGroup.get('siteId')) === null || _a === void 0 ? void 0 : _a.value), takeUntil(this.destroy$), switchMap((value) => {
794
+ return this.userCreationService.fetchAllUserTemplates(Number(value));
2271
795
  }))
2272
796
  .subscribe();
2273
797
  // .subscribe((value) => {
@@ -2275,41 +799,36 @@ class UserTemplateStepComponent {
2275
799
  // })
2276
800
  this.formGroup.get('userTemplateId').valueChanges
2277
801
  .pipe(filter((value) => value !== null && value !== undefined && String(value).trim().length > 0), takeUntil(this.destroy$), switchMap((value) => {
2278
- // if (String(value) === this.fallbackTemplateId) {
2279
- // this.userCreationWizardService.setSelectedTemplate(this.defaultTemplateName);
2280
- // return of(null);
2281
- // }
802
+ if (String(value) === this.fallbackTemplateId) {
803
+ this.userCreationWizardService.setSelectedTemplate(this.defaultTemplateName);
804
+ return of(null);
805
+ }
2282
806
  return this.userCreationService.getUserTemplateToken(String(value), String(String(this.customerId)))
2283
807
  .pipe(tap((payload) => {
2284
808
  const selectedTemplate = this.templates.find(template => String(template.id) === String(value));
2285
- this.userCreationWizardService.setSelectedTemplate(selectedTemplate);
809
+ this.userCreationWizardService.setSelectedTemplate((selectedTemplate === null || selectedTemplate === void 0 ? void 0 : selectedTemplate.name) || null);
2286
810
  this.userCreationWizardService.applyTemplateTokenPayload(payload);
2287
811
  }));
2288
812
  }))
2289
813
  .subscribe();
2290
- this.templateToggleFormControl.valueChanges
2291
- .pipe(startWith(true), takeUntil(this.destroy$), distinctUntilChanged())
2292
- .subscribe((value) => {
2293
- var _a, _b;
2294
- if (value === true) {
2295
- const siteId = ((_a = this.formGroup.get('siteId')) === null || _a === void 0 ? void 0 : _a.value) || 7095;
2296
- this.userCreationService.fetchAllUserTemplates(siteId)
2297
- .subscribe();
2298
- }
2299
- else {
2300
- (_b = this.formGroup.get('userTemplateId')) === null || _b === void 0 ? void 0 : _b.reset();
2301
- }
2302
- });
814
+ // this.templateToggleFormControl.valueChanges
815
+ // .pipe(startWith(true), takeUntil(this.destroy$), distinctUntilChanged())
816
+ // .subscribe((value) => {
817
+ // if(value === true) {
818
+ // const siteId = this.formGroup.get('siteId')?.value || 7095;
819
+ // this.userCreationService.fetchAllUserTemplates(siteId)
820
+ // .subscribe();
821
+ // } else {
822
+ // this.formGroup.get('userTemplateId')?.reset();
823
+ // }
824
+ // });
2303
825
  this.getData();
2304
- this.formGroup.statusChanges
2305
- .pipe(startWith(this.formGroup.status), takeUntil(this.destroy$))
2306
- .subscribe(() => this.validityChange.emit(this.isStepValid()));
2307
826
  }
2308
827
  reseFieldstForm() {
2309
828
  var _a, _b;
2310
829
  (_a = this.formGroup.get('siteId')) === null || _a === void 0 ? void 0 : _a.reset();
2311
830
  (_b = this.formGroup.get('userTemplateId')) === null || _b === void 0 ? void 0 : _b.reset();
2312
- this.userCreationWizardService.setSelectedTemplate();
831
+ this.userCreationWizardService.setSelectedTemplate(null);
2313
832
  this.userCreationWizardService.resetTemplateDrivenData();
2314
833
  }
2315
834
  getData() {
@@ -2320,10 +839,7 @@ class UserTemplateStepComponent {
2320
839
  .subscribe();
2321
840
  }
2322
841
  getSites(isOnlyWithLocations) {
2323
- this.loadingSites = true;
2324
- return this.userCreationService.getAllCustomerSites(String(this.customerId), isOnlyWithLocations).pipe(finalize(() => {
2325
- this.loadingSites = false;
2326
- }));
842
+ return this.userCreationService.getAllCustomerSites(String(this.customerId), isOnlyWithLocations);
2327
843
  }
2328
844
  isCUCM(site) {
2329
845
  var _a;
@@ -2335,54 +851,28 @@ class UserTemplateStepComponent {
2335
851
  const foundedSite = this.sitesList.find((site) => site.id === siteId);
2336
852
  return siteId && foundedSite ? foundedSite.name : '';
2337
853
  }
2338
- getSelectedTemplateName() {
2339
- var _a;
2340
- const templateId = (_a = this.formGroup.get('userTemplateId')) === null || _a === void 0 ? void 0 : _a.value;
2341
- const foundedTemplate = this.templates.find((template) => String(template.id) === String(templateId));
2342
- return templateId && foundedTemplate ? foundedTemplate.name : '';
2343
- }
2344
- isStepValid() {
2345
- var _a, _b;
2346
- const siteId = (_a = this.formGroup.get('siteId')) === null || _a === void 0 ? void 0 : _a.value;
2347
- const templateId = (_b = this.formGroup.get('userTemplateId')) === null || _b === void 0 ? void 0 : _b.value;
2348
- return siteId !== null && siteId !== undefined && String(templateId || '').trim().length > 0;
2349
- }
2350
- markStepTouched() {
2351
- var _a, _b;
2352
- (_a = this.formGroup.get('siteId')) === null || _a === void 0 ? void 0 : _a.markAsTouched();
2353
- (_b = this.formGroup.get('userTemplateId')) === null || _b === void 0 ? void 0 : _b.markAsTouched();
2354
- }
2355
854
  ngOnDestroy() {
2356
855
  this.destroy$.next();
2357
856
  this.destroy$.complete();
2358
857
  }
2359
858
  }
2360
- UserTemplateStepComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserTemplateStepComponent, deps: [{ token: UserCreationWizardService }, { token: UserCreationApiService }, { token: i1$2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
2361
- UserTemplateStepComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UserTemplateStepComponent, selector: "tk-user-template-step", inputs: { customerId: "customerId" }, outputs: { validityChange: "validityChange" }, ngImport: i0, template: "<section class=\"template-step-content\">\r\n <app-loader *ngIf=\"isLoading\"></app-loader>\r\n <ng-container [formGroup]=\"formGroup\">\r\n <!-- <div class=\"template-step-field template-step-field--user-type\">\r\n <label class=\"template-step-label\">User type</label>\r\n <mat-radio-group class=\"user-type-mat-radio-group\" formControlName=\"userType\">\r\n <mat-radio-button class=\"user-type-mat-radio\" id=\"userCreationCucm\" [value]=\"USER_CREATION_TYPES.CUCM\">\r\n UCM/DI\r\n </mat-radio-button>\r\n <mat-radio-button class=\"user-type-mat-radio\" id=\"userCreationMT\" [value]=\"USER_CREATION_TYPES.MT\">\r\n MT\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n </div> -->\r\n\r\n <div class=\"template-step-field\">\r\n <label class=\"template-step-label\">Select site</label>\r\n <mat-form-field class=\"template-step-select\" appearance=\"outline\">\r\n <mat-select\r\n placeholder=\"Site name\"\r\n formControlName=\"siteId\">\r\n\r\n <mat-select-trigger>\r\n {{ getSelectedSiteName() }}\r\n </mat-select-trigger>\r\n\r\n <mat-option *ngFor=\"let site of sitesList$ | async\" [value]=\"site.id\">\r\n <div class=\"option-row\">\r\n <span class=\"name\">{{ site.name }}</span>\r\n <span *ngIf=\"site.name === 'Berlin' else notBerlinSite\" class=\"type\">{{ 'Multi Tenant' }}</span>\r\n <ng-template #notBerlinSite>\r\n <span class=\"type\">{{ isCUCM(site) ? 'UCM' : 'Dedicated Instance' }}</span>\r\n </ng-template>\r\n </div>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n\r\n <ng-container *ngIf=\"formGroup.get('userType')?.value === USER_CREATION_TYPES.CUCM\">\r\n <div class=\"template-step-field\">\r\n <!-- <label class=\"template-step-label\">Would you like to use a template for the user creation?</label> -->\r\n <!-- <mat-radio-group [formControl]=\"templateToggleFormControl\">\r\n <mat-radio-button [color]=\"'primary'\" [value]=\"true\">\r\n {{ 'Yes' }}\r\n </mat-radio-button>\r\n <mat-radio-button [color]=\"'primary'\" [value]=\"false\">\r\n {{ 'No' }}\r\n </mat-radio-button>\r\n </mat-radio-group> -->\r\n\r\n <!-- <ng-container *ngIf=\"templateToggleFormControl.value === true\"> -->\r\n <label class=\"template-step-label\">Select user template</label>\r\n <mat-form-field class=\"template-step-select\" appearance=\"outline\">\r\n <mat-select\r\n placeholder=\"Templates\"\r\n formControlName=\"userTemplateId\">\r\n <mat-select-trigger>\r\n <span matTooltip=\"'A new user will be created based on the selected template, including a Cisco 8851 physical device with a single line configured, without SNR (Single Number Reach) and without voicemail.'\">\r\n {{ getSelectedTemplateName() }}\r\n </span>\r\n </mat-select-trigger>\r\n <mat-option *ngFor=\"let template of templatesList$ | async\" [value]=\"template.id\">\r\n {{ template.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n <!-- </ng-container> -->\r\n </div>\r\n </ng-container>\r\n \r\n </ng-container>\r\n</section>\r\n", styles: [".template-step-content{display:flex;flex-direction:column;gap:20px;max-width:420px}.template-step-field{display:flex;flex-direction:column;gap:10px}.template-step-field .mat-radio-group{display:flex;gap:10px}.template-step-field--user-type{margin-bottom:6px}.template-step-label{font-size:14px;font-weight:600;line-height:100%;letter-spacing:.1px;color:#2a2f3b}.template-step-select{width:100%;max-width:333px}.user-type-mat-radio-group{display:flex;flex-direction:column;gap:10px;margin-left:16px;margin-top:8px}.user-type-mat-radio{color:#2a2f3b;font-size:14px;font-weight:500}:host ::ng-deep .user-type-mat-radio .mat-radio-label{gap:10px}:host ::ng-deep .user-type-mat-radio .mat-radio-outer-circle{border-color:#8a93a3;border-width:2px}:host ::ng-deep .user-type-mat-radio .mat-radio-inner-circle{background-color:#1170cf}:host ::ng-deep .user-type-mat-radio.mat-radio-checked .mat-radio-outer-circle{border-color:#1170cf}:host ::ng-deep .user-type-mat-radio.mat-radio-checked .mat-radio-ripple .mat-ripple-element{background-color:#1176ce26!important}:host ::ng-deep .user-type-mat-radio .mdc-radio__outer-circle{border-color:#8a93a3!important;border-width:2px!important}:host ::ng-deep .user-type-mat-radio .mdc-radio__inner-circle{border-color:#1170cf!important}:host ::ng-deep .user-type-mat-radio.mat-mdc-radio-checked .mdc-radio__outer-circle{border-color:#1170cf!important}:host ::ng-deep .user-type-mat-radio.mat-mdc-radio-checked .mdc-radio__background:before{background-color:#1176ce1f!important}:host ::ng-deep .template-step-select .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .template-step-select .mat-form-field-flex{align-items:center;height:32px;border:1px solid #767676;border-radius:6px;padding:0 12px}:host ::ng-deep .template-step-select .mat-form-field-outline,:host ::ng-deep .template-step-select .mat-form-field-outline-start,:host ::ng-deep .template-step-select .mat-form-field-outline-end,:host ::ng-deep .template-step-select .mat-form-field-outline-gap{display:none}:host ::ng-deep .template-step-select .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .template-step-select .mat-select-trigger{display:flex;align-items:center;justify-content:space-between;height:100%}::ng-deep .option-row{display:flex;justify-content:space-between;align-items:center;width:100%}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i7$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "directive", type: i7$1.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i11.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: AppLoaderComponent, selector: "app-loader" }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }] });
859
+ UserTemplateStepComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserTemplateStepComponent, deps: [{ token: UserCreationWizardService }, { token: UserCreationApiService }, { token: i3$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
860
+ UserTemplateStepComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UserTemplateStepComponent, selector: "tk-user-template-step", inputs: { customerId: "customerId" }, ngImport: i0, template: "<section class=\"template-step-content\">\r\n <ng-container [formGroup]=\"formGroup\">\r\n <!-- <div class=\"template-step-field template-step-field--user-type\">\r\n <label class=\"template-step-label\">User type</label>\r\n <mat-radio-group class=\"user-type-mat-radio-group\" formControlName=\"userType\">\r\n <mat-radio-button class=\"user-type-mat-radio\" id=\"userCreationCucm\" [value]=\"USER_CREATION_TYPES.CUCM\">\r\n UCM/DI\r\n </mat-radio-button>\r\n <mat-radio-button class=\"user-type-mat-radio\" id=\"userCreationMT\" [value]=\"USER_CREATION_TYPES.MT\">\r\n MT\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n </div> -->\r\n\r\n <div class=\"template-step-field\">\r\n <label class=\"template-step-label\">Select site</label>\r\n <mat-form-field class=\"template-step-select\" appearance=\"outline\">\r\n <mat-select\r\n placeholder=\"Site name\"\r\n formControlName=\"siteId\">\r\n\r\n <mat-select-trigger>\r\n {{ getSelectedSiteName() }}\r\n </mat-select-trigger>\r\n\r\n <mat-option *ngFor=\"let site of sitesList$ | async\" [value]=\"site.id\">\r\n <div class=\"option-row\">\r\n <span class=\"name\">{{ site.name }}</span>\r\n <span *ngIf=\"site.name === 'Berlin' else notBerlinSite\" class=\"type\">{{ 'Multi Tenant' }}</span>\r\n <ng-template #notBerlinSite>\r\n <span class=\"type\">{{ isCUCM(site) ? 'UCM' : 'Dedicated Instance' }}</span>\r\n </ng-template>\r\n </div>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n\r\n <ng-container *ngIf=\"formGroup.get('userType')?.value === USER_CREATION_TYPES.CUCM\">\r\n <div class=\"template-step-field\">\r\n <!-- <label class=\"template-step-label\">Would you like to use a template for the user creation?</label>\r\n <mat-radio-group [formControl]=\"templateToggleFormControl\">\r\n <mat-radio-button [color]=\"'primary'\" [value]=\"true\">\r\n {{ 'Yes' }}\r\n </mat-radio-button>\r\n <mat-radio-button [color]=\"'primary'\" [value]=\"false\">\r\n {{ 'No' }}\r\n </mat-radio-button>\r\n </mat-radio-group> -->\r\n\r\n <!-- <ng-container *ngIf=\"templateToggleFormControl.value === true\"> -->\r\n <label class=\"template-step-label\">Select user template</label>\r\n <mat-form-field class=\"template-step-select\" appearance=\"outline\">\r\n <mat-select\r\n placeholder=\"Templates\"\r\n formControlName=\"userTemplateId\">\r\n <mat-select-trigger>\r\n <span matTooltip=\"'A new user will be created based on the selected template, including a Cisco 8851 physical device with a single line configured, without SNR (Single Number Reach) and without voicemail.'\">\r\n {{ defaultTemplateName }}\r\n </span>\r\n </mat-select-trigger>\r\n <mat-option [value]=\"fallbackTemplateId\">\r\n {{ defaultTemplateName }}\r\n </mat-option>\r\n <mat-option *ngFor=\"let template of templatesList$ | async\" [value]=\"template.id\">\r\n {{ template.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n <!-- </ng-container> -->\r\n </div>\r\n </ng-container>\r\n \r\n </ng-container>\r\n</section>\r\n", styles: [".template-step-content{display:flex;flex-direction:column;gap:20px;max-width:420px}.template-step-field{display:flex;flex-direction:column;gap:10px}.template-step-field--user-type{margin-bottom:6px}.template-step-label{font-size:14px;font-weight:600;line-height:100%;letter-spacing:.1px;color:#2a2f3b}.template-step-select{width:100%;max-width:333px}.user-type-mat-radio-group{display:flex;flex-direction:column;gap:10px;margin-left:16px;margin-top:8px}.user-type-mat-radio{color:#2a2f3b;font-size:14px;font-weight:500}:host ::ng-deep .user-type-mat-radio .mat-radio-label{gap:10px}:host ::ng-deep .user-type-mat-radio .mat-radio-outer-circle{border-color:#8a93a3;border-width:2px}:host ::ng-deep .user-type-mat-radio .mat-radio-inner-circle{background-color:#1170cf}:host ::ng-deep .user-type-mat-radio.mat-radio-checked .mat-radio-outer-circle{border-color:#1170cf}:host ::ng-deep .user-type-mat-radio.mat-radio-checked .mat-radio-ripple .mat-ripple-element{background-color:#1176ce26!important}:host ::ng-deep .user-type-mat-radio .mdc-radio__outer-circle{border-color:#8a93a3!important;border-width:2px!important}:host ::ng-deep .user-type-mat-radio .mdc-radio__inner-circle{border-color:#1170cf!important}:host ::ng-deep .user-type-mat-radio.mat-mdc-radio-checked .mdc-radio__outer-circle{border-color:#1170cf!important}:host ::ng-deep .user-type-mat-radio.mat-mdc-radio-checked .mdc-radio__background:before{background-color:#1176ce1f!important}:host ::ng-deep .template-step-select .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .template-step-select .mat-form-field-flex{align-items:center;height:32px;border:1px solid #767676;border-radius:6px;padding:0 12px}:host ::ng-deep .template-step-select .mat-form-field-outline,:host ::ng-deep .template-step-select .mat-form-field-outline-start,:host ::ng-deep .template-step-select .mat-form-field-outline-end,:host ::ng-deep .template-step-select .mat-form-field-outline-gap{display:none}:host ::ng-deep .template-step-select .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .template-step-select .mat-select-trigger{display:flex;align-items:center;justify-content:space-between;height:100%}::ng-deep .option-row{display:flex;justify-content:space-between;align-items:center;width:100%}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "directive", type: i7.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i8.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] });
2362
861
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserTemplateStepComponent, decorators: [{
2363
862
  type: Component,
2364
- args: [{ selector: 'tk-user-template-step', template: "<section class=\"template-step-content\">\r\n <app-loader *ngIf=\"isLoading\"></app-loader>\r\n <ng-container [formGroup]=\"formGroup\">\r\n <!-- <div class=\"template-step-field template-step-field--user-type\">\r\n <label class=\"template-step-label\">User type</label>\r\n <mat-radio-group class=\"user-type-mat-radio-group\" formControlName=\"userType\">\r\n <mat-radio-button class=\"user-type-mat-radio\" id=\"userCreationCucm\" [value]=\"USER_CREATION_TYPES.CUCM\">\r\n UCM/DI\r\n </mat-radio-button>\r\n <mat-radio-button class=\"user-type-mat-radio\" id=\"userCreationMT\" [value]=\"USER_CREATION_TYPES.MT\">\r\n MT\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n </div> -->\r\n\r\n <div class=\"template-step-field\">\r\n <label class=\"template-step-label\">Select site</label>\r\n <mat-form-field class=\"template-step-select\" appearance=\"outline\">\r\n <mat-select\r\n placeholder=\"Site name\"\r\n formControlName=\"siteId\">\r\n\r\n <mat-select-trigger>\r\n {{ getSelectedSiteName() }}\r\n </mat-select-trigger>\r\n\r\n <mat-option *ngFor=\"let site of sitesList$ | async\" [value]=\"site.id\">\r\n <div class=\"option-row\">\r\n <span class=\"name\">{{ site.name }}</span>\r\n <span *ngIf=\"site.name === 'Berlin' else notBerlinSite\" class=\"type\">{{ 'Multi Tenant' }}</span>\r\n <ng-template #notBerlinSite>\r\n <span class=\"type\">{{ isCUCM(site) ? 'UCM' : 'Dedicated Instance' }}</span>\r\n </ng-template>\r\n </div>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n\r\n <ng-container *ngIf=\"formGroup.get('userType')?.value === USER_CREATION_TYPES.CUCM\">\r\n <div class=\"template-step-field\">\r\n <!-- <label class=\"template-step-label\">Would you like to use a template for the user creation?</label> -->\r\n <!-- <mat-radio-group [formControl]=\"templateToggleFormControl\">\r\n <mat-radio-button [color]=\"'primary'\" [value]=\"true\">\r\n {{ 'Yes' }}\r\n </mat-radio-button>\r\n <mat-radio-button [color]=\"'primary'\" [value]=\"false\">\r\n {{ 'No' }}\r\n </mat-radio-button>\r\n </mat-radio-group> -->\r\n\r\n <!-- <ng-container *ngIf=\"templateToggleFormControl.value === true\"> -->\r\n <label class=\"template-step-label\">Select user template</label>\r\n <mat-form-field class=\"template-step-select\" appearance=\"outline\">\r\n <mat-select\r\n placeholder=\"Templates\"\r\n formControlName=\"userTemplateId\">\r\n <mat-select-trigger>\r\n <span matTooltip=\"'A new user will be created based on the selected template, including a Cisco 8851 physical device with a single line configured, without SNR (Single Number Reach) and without voicemail.'\">\r\n {{ getSelectedTemplateName() }}\r\n </span>\r\n </mat-select-trigger>\r\n <mat-option *ngFor=\"let template of templatesList$ | async\" [value]=\"template.id\">\r\n {{ template.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n <!-- </ng-container> -->\r\n </div>\r\n </ng-container>\r\n \r\n </ng-container>\r\n</section>\r\n", styles: [".template-step-content{display:flex;flex-direction:column;gap:20px;max-width:420px}.template-step-field{display:flex;flex-direction:column;gap:10px}.template-step-field .mat-radio-group{display:flex;gap:10px}.template-step-field--user-type{margin-bottom:6px}.template-step-label{font-size:14px;font-weight:600;line-height:100%;letter-spacing:.1px;color:#2a2f3b}.template-step-select{width:100%;max-width:333px}.user-type-mat-radio-group{display:flex;flex-direction:column;gap:10px;margin-left:16px;margin-top:8px}.user-type-mat-radio{color:#2a2f3b;font-size:14px;font-weight:500}:host ::ng-deep .user-type-mat-radio .mat-radio-label{gap:10px}:host ::ng-deep .user-type-mat-radio .mat-radio-outer-circle{border-color:#8a93a3;border-width:2px}:host ::ng-deep .user-type-mat-radio .mat-radio-inner-circle{background-color:#1170cf}:host ::ng-deep .user-type-mat-radio.mat-radio-checked .mat-radio-outer-circle{border-color:#1170cf}:host ::ng-deep .user-type-mat-radio.mat-radio-checked .mat-radio-ripple .mat-ripple-element{background-color:#1176ce26!important}:host ::ng-deep .user-type-mat-radio .mdc-radio__outer-circle{border-color:#8a93a3!important;border-width:2px!important}:host ::ng-deep .user-type-mat-radio .mdc-radio__inner-circle{border-color:#1170cf!important}:host ::ng-deep .user-type-mat-radio.mat-mdc-radio-checked .mdc-radio__outer-circle{border-color:#1170cf!important}:host ::ng-deep .user-type-mat-radio.mat-mdc-radio-checked .mdc-radio__background:before{background-color:#1176ce1f!important}:host ::ng-deep .template-step-select .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .template-step-select .mat-form-field-flex{align-items:center;height:32px;border:1px solid #767676;border-radius:6px;padding:0 12px}:host ::ng-deep .template-step-select .mat-form-field-outline,:host ::ng-deep .template-step-select .mat-form-field-outline-start,:host ::ng-deep .template-step-select .mat-form-field-outline-end,:host ::ng-deep .template-step-select .mat-form-field-outline-gap{display:none}:host ::ng-deep .template-step-select .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .template-step-select .mat-select-trigger{display:flex;align-items:center;justify-content:space-between;height:100%}::ng-deep .option-row{display:flex;justify-content:space-between;align-items:center;width:100%}\n"] }]
2365
- }], ctorParameters: function () { return [{ type: UserCreationWizardService }, { type: UserCreationApiService }, { type: i1$2.FormBuilder }]; }, propDecorators: { customerId: [{
863
+ args: [{ selector: 'tk-user-template-step', template: "<section class=\"template-step-content\">\r\n <ng-container [formGroup]=\"formGroup\">\r\n <!-- <div class=\"template-step-field template-step-field--user-type\">\r\n <label class=\"template-step-label\">User type</label>\r\n <mat-radio-group class=\"user-type-mat-radio-group\" formControlName=\"userType\">\r\n <mat-radio-button class=\"user-type-mat-radio\" id=\"userCreationCucm\" [value]=\"USER_CREATION_TYPES.CUCM\">\r\n UCM/DI\r\n </mat-radio-button>\r\n <mat-radio-button class=\"user-type-mat-radio\" id=\"userCreationMT\" [value]=\"USER_CREATION_TYPES.MT\">\r\n MT\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n </div> -->\r\n\r\n <div class=\"template-step-field\">\r\n <label class=\"template-step-label\">Select site</label>\r\n <mat-form-field class=\"template-step-select\" appearance=\"outline\">\r\n <mat-select\r\n placeholder=\"Site name\"\r\n formControlName=\"siteId\">\r\n\r\n <mat-select-trigger>\r\n {{ getSelectedSiteName() }}\r\n </mat-select-trigger>\r\n\r\n <mat-option *ngFor=\"let site of sitesList$ | async\" [value]=\"site.id\">\r\n <div class=\"option-row\">\r\n <span class=\"name\">{{ site.name }}</span>\r\n <span *ngIf=\"site.name === 'Berlin' else notBerlinSite\" class=\"type\">{{ 'Multi Tenant' }}</span>\r\n <ng-template #notBerlinSite>\r\n <span class=\"type\">{{ isCUCM(site) ? 'UCM' : 'Dedicated Instance' }}</span>\r\n </ng-template>\r\n </div>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n\r\n <ng-container *ngIf=\"formGroup.get('userType')?.value === USER_CREATION_TYPES.CUCM\">\r\n <div class=\"template-step-field\">\r\n <!-- <label class=\"template-step-label\">Would you like to use a template for the user creation?</label>\r\n <mat-radio-group [formControl]=\"templateToggleFormControl\">\r\n <mat-radio-button [color]=\"'primary'\" [value]=\"true\">\r\n {{ 'Yes' }}\r\n </mat-radio-button>\r\n <mat-radio-button [color]=\"'primary'\" [value]=\"false\">\r\n {{ 'No' }}\r\n </mat-radio-button>\r\n </mat-radio-group> -->\r\n\r\n <!-- <ng-container *ngIf=\"templateToggleFormControl.value === true\"> -->\r\n <label class=\"template-step-label\">Select user template</label>\r\n <mat-form-field class=\"template-step-select\" appearance=\"outline\">\r\n <mat-select\r\n placeholder=\"Templates\"\r\n formControlName=\"userTemplateId\">\r\n <mat-select-trigger>\r\n <span matTooltip=\"'A new user will be created based on the selected template, including a Cisco 8851 physical device with a single line configured, without SNR (Single Number Reach) and without voicemail.'\">\r\n {{ defaultTemplateName }}\r\n </span>\r\n </mat-select-trigger>\r\n <mat-option [value]=\"fallbackTemplateId\">\r\n {{ defaultTemplateName }}\r\n </mat-option>\r\n <mat-option *ngFor=\"let template of templatesList$ | async\" [value]=\"template.id\">\r\n {{ template.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n <!-- </ng-container> -->\r\n </div>\r\n </ng-container>\r\n \r\n </ng-container>\r\n</section>\r\n", styles: [".template-step-content{display:flex;flex-direction:column;gap:20px;max-width:420px}.template-step-field{display:flex;flex-direction:column;gap:10px}.template-step-field--user-type{margin-bottom:6px}.template-step-label{font-size:14px;font-weight:600;line-height:100%;letter-spacing:.1px;color:#2a2f3b}.template-step-select{width:100%;max-width:333px}.user-type-mat-radio-group{display:flex;flex-direction:column;gap:10px;margin-left:16px;margin-top:8px}.user-type-mat-radio{color:#2a2f3b;font-size:14px;font-weight:500}:host ::ng-deep .user-type-mat-radio .mat-radio-label{gap:10px}:host ::ng-deep .user-type-mat-radio .mat-radio-outer-circle{border-color:#8a93a3;border-width:2px}:host ::ng-deep .user-type-mat-radio .mat-radio-inner-circle{background-color:#1170cf}:host ::ng-deep .user-type-mat-radio.mat-radio-checked .mat-radio-outer-circle{border-color:#1170cf}:host ::ng-deep .user-type-mat-radio.mat-radio-checked .mat-radio-ripple .mat-ripple-element{background-color:#1176ce26!important}:host ::ng-deep .user-type-mat-radio .mdc-radio__outer-circle{border-color:#8a93a3!important;border-width:2px!important}:host ::ng-deep .user-type-mat-radio .mdc-radio__inner-circle{border-color:#1170cf!important}:host ::ng-deep .user-type-mat-radio.mat-mdc-radio-checked .mdc-radio__outer-circle{border-color:#1170cf!important}:host ::ng-deep .user-type-mat-radio.mat-mdc-radio-checked .mdc-radio__background:before{background-color:#1176ce1f!important}:host ::ng-deep .template-step-select .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .template-step-select .mat-form-field-flex{align-items:center;height:32px;border:1px solid #767676;border-radius:6px;padding:0 12px}:host ::ng-deep .template-step-select .mat-form-field-outline,:host ::ng-deep .template-step-select .mat-form-field-outline-start,:host ::ng-deep .template-step-select .mat-form-field-outline-end,:host ::ng-deep .template-step-select .mat-form-field-outline-gap{display:none}:host ::ng-deep .template-step-select .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .template-step-select .mat-select-trigger{display:flex;align-items:center;justify-content:space-between;height:100%}::ng-deep .option-row{display:flex;justify-content:space-between;align-items:center;width:100%}\n"] }]
864
+ }], ctorParameters: function () { return [{ type: UserCreationWizardService }, { type: UserCreationApiService }, { type: i3$1.FormBuilder }]; }, propDecorators: { customerId: [{
2366
865
  type: Input
2367
- }], validityChange: [{
2368
- type: Output
2369
866
  }] } });
2370
867
 
2371
- const USER_CREATED_SUCCESSFLLY = 'User created successfully';
2372
868
  class UserCreationWizardComponent {
2373
- constructor(notificationService) {
2374
- this.notificationService = notificationService;
869
+ constructor() {
2375
870
  this.apiService = inject(APIService);
2376
- this.userCreationWizardService = inject(UserCreationWizardService);
2377
871
  this.title = 'Create User';
2378
872
  this.cancel = new EventEmitter();
2379
873
  this.submit = new EventEmitter();
2380
874
  this.isSubmitting = false;
2381
875
  this.submitTimerId = null;
2382
- this.selectedIndex = 0;
2383
- this.templateStepValid = false;
2384
- this.detailsStepValid = false;
2385
- this.isLoading = false;
2386
876
  }
2387
877
  ngOnInit() {
2388
878
  this.apiService.token = this.token;
@@ -2391,43 +881,17 @@ class UserCreationWizardComponent {
2391
881
  onCancel() {
2392
882
  this.cancel.emit();
2393
883
  }
2394
- onStepSelectionChange(event) {
2395
- this.selectedIndex = event.selectedIndex;
2396
- if (event.selectedIndex === 1 && event.previouslySelectedIndex === 0) {
2397
- this.userCreationWizardService.resetUserDetailsStepState();
2398
- this.detailsStepValid = false;
2399
- }
2400
- }
2401
- onStepperNext(stepper) {
2402
- var _a, _b, _c, _d, _e;
2403
- if (stepper.selectedIndex === 0) {
2404
- if (!((_a = this.templateStep) === null || _a === void 0 ? void 0 : _a.isStepValid())) {
2405
- (_b = this.templateStep) === null || _b === void 0 ? void 0 : _b.markStepTouched();
2406
- return;
2407
- }
2408
- }
2409
- if (stepper.selectedIndex === 1) {
2410
- if (!((_c = this.detailsStep) === null || _c === void 0 ? void 0 : _c.isStepValid())) {
2411
- (_d = this.detailsStep) === null || _d === void 0 ? void 0 : _d.markAllAsTouched();
2412
- return;
2413
- }
2414
- (_e = this.detailsStep) === null || _e === void 0 ? void 0 : _e.syncToService();
2415
- }
2416
- stepper.next();
2417
- }
2418
884
  onSubmit() {
2419
885
  if (this.isSubmitting) {
2420
886
  return;
2421
887
  }
2422
888
  this.isSubmitting = true;
2423
- // const delayMs = 3000 + Math.floor(Math.random() * 1001);
2424
- // this.submitTimerId = window.setTimeout(() => {
2425
- // this.isSubmitting = false;
2426
- // this.submitTimerId = null;
2427
- // this.notificationService.success('User created successfully!');
2428
- // this.submit.emit();
2429
- // }, delayMs);
2430
- this._saveChanges();
889
+ const delayMs = 3000 + Math.floor(Math.random() * 1001);
890
+ this.submitTimerId = window.setTimeout(() => {
891
+ this.isSubmitting = false;
892
+ this.submitTimerId = null;
893
+ this.submit.emit();
894
+ }, delayMs);
2431
895
  }
2432
896
  ngOnDestroy() {
2433
897
  if (this.submitTimerId) {
@@ -2435,34 +899,13 @@ class UserCreationWizardComponent {
2435
899
  this.submitTimerId = null;
2436
900
  }
2437
901
  }
2438
- _saveChanges() {
2439
- this.isLoading = true;
2440
- this.userCreationWizardService.saveNewUser()
2441
- .subscribe((res) => {
2442
- this.isLoading = false;
2443
- this.isSubmitting = false;
2444
- this.notificationService.success('User created successfully!');
2445
- this.submit.emit();
2446
- }, (error) => {
2447
- var _a;
2448
- this.isLoading = false;
2449
- this.isSubmitting = false;
2450
- if (typeof error === 'string' && error.indexOf(USER_CREATED_SUCCESSFLLY) > -1) {
2451
- this.notificationService.success('User created successfully!');
2452
- this.submit.emit();
2453
- }
2454
- else {
2455
- this.notificationService.error(((_a = error === null || error === void 0 ? void 0 : error.error) === null || _a === void 0 ? void 0 : _a.message) || 'An error occurred while creating the user. Please try again.');
2456
- }
2457
- });
2458
- }
2459
902
  }
2460
- UserCreationWizardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationWizardComponent, deps: [{ token: NotificationService }], target: i0.ɵɵFactoryTarget.Component });
2461
- UserCreationWizardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UserCreationWizardComponent, selector: "tk-user-creation-wizard", inputs: { title: "title", host: "host", token: "token", customerId: "customerId" }, outputs: { cancel: "cancel", submit: "submit" }, viewQueries: [{ propertyName: "templateStep", first: true, predicate: UserTemplateStepComponent, descendants: true }, { propertyName: "detailsStep", first: true, predicate: UserDetailsStepComponent, descendants: true }], ngImport: i0, template: "<app-notification></app-notification>\n<app-loader *ngIf=\"isLoading\"></app-loader>\n<div class=\"move-user-stepper-container\" [attr.aria-busy]=\"isSubmitting\">\n <header class=\"move-user-header\">\n <div class=\"move-user-header__title\">{{ title }}</div>\n <div class=\"move-user-header__close\">\n <span class=\"app-icon user-creation-close-icon\" (click)=\"onCancel()\"></span>\n </div>\n </header>\n\n <div id=\"user-creation-stepper\">\n <mat-stepper [linear]=\"false\" labelPosition=\"bottom\" #stepper\n [selectedIndex]=\"selectedIndex\"\n (selectionChange)=\"onStepSelectionChange($event)\">\n\n <mat-step>\n <div class=\"step-title\">Step 1: User creation with template</div>\n <ng-template matStepLabel>User creation</ng-template>\n\n <ng-container *ngIf=\"selectedIndex === 0\">\n <div class=\"move-user-tab-content-box\">\n <tk-user-template-step\n [customerId]=\"customerId\"\n (validityChange)=\"templateStepValid = $event\"\n ></tk-user-template-step>\n </div>\n </ng-container>\n </mat-step>\n\n <mat-step>\n <div class=\"step-title\">Step 2 : User details</div>\n <ng-template matStepLabel>User details</ng-template>\n\n <ng-container *ngIf=\"selectedIndex === 1\">\n <div class=\"move-user-tab-content-box\">\n <tk-user-details-step (validityChange)=\"detailsStepValid = $event\"></tk-user-details-step>\n </div>\n </ng-container>\n </mat-step>\n\n <mat-step>\n <div class=\"step-title\">Step 3: Review</div>\n <ng-template matStepLabel>Review</ng-template>\n\n <ng-container *ngIf=\"selectedIndex === 2\">\n <div class=\"move-user-tab-content-box\">\n <tk-user-overview-step></tk-user-overview-step>\n </div>\n </ng-container>\n </mat-step>\n </mat-stepper>\n\n <div class=\"wizard-actions\">\n <ng-container [ngSwitch]=\"stepper.selectedIndex\">\n <ng-container *ngSwitchCase=\"0\">\n <button\n mat-button\n class=\"uc-btn uc-btn-primary\"\n type=\"button\"\n [disabled]=\"!templateStepValid\"\n (click)=\"onStepperNext(stepper)\"\n >\n Next\n </button>\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"onCancel()\">\n Cancel\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"1\">\n <button\n mat-button\n class=\"uc-btn uc-btn-primary\"\n type=\"button\"\n [disabled]=\"!detailsStepValid\"\n (click)=\"onStepperNext(stepper)\"\n >\n Next\n </button>\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"stepper.previous()\">\n Previous\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"2\">\n <button\n mat-button\n class=\"uc-btn uc-btn-primary\"\n type=\"button\"\n [disabled]=\"isSubmitting\"\n (click)=\"onSubmit()\"\n >\n <span class=\"uc-btn__inline-content\">\n <span class=\"uc-btn__spinner\" *ngIf=\"isSubmitting\" aria-hidden=\"true\"></span>\n <span>{{ isSubmitting ? 'Creating...' : 'Create' }}</span>\n </span>\n </button>\n <button\n mat-button\n class=\"uc-btn uc-btn-secondary\"\n type=\"button\"\n [disabled]=\"isSubmitting\"\n (click)=\"stepper.previous()\"\n >\n Previous\n </button>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <div class=\"wizard-loading-overlay\" [class.wizard-loading-overlay--visible]=\"isSubmitting\" aria-hidden=\"true\"></div>\n</div>", styles: [".move-user-stepper-container{background-color:#f3f3f3;padding:0 0 16px;position:relative;overflow:hidden}.move-user-header{background-color:#1170cf;height:45px;padding:1rem 1.5rem;display:flex;align-items:center;justify-content:space-between;color:#fff;font-size:18px;font-weight:500}.move-user-header__close{cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:0}.move-user-header__close i{font-size:25px;font-weight:100}.app-icon{height:20px;width:20px;display:block;cursor:pointer;background-repeat:no-repeat;background-position:center}.user-creation-close-icon{background-image:url(\"data:image/svg+xml,%3Csvg width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M13.0606 11.9998L19.2803 5.78001C19.35 5.71038 19.4052 5.6277 19.4429 5.53672C19.4806 5.44573 19.5 5.34822 19.5 5.24974C19.5 5.15126 19.4806 5.05374 19.4429 4.96276C19.4052 4.87177 19.3499 4.7891 19.2803 4.71947C19.2107 4.64983 19.128 4.5946 19.037 4.55691C18.946 4.51923 18.8485 4.49983 18.75 4.49983C18.6515 4.49984 18.554 4.51924 18.463 4.55692C18.3721 4.59461 18.2894 4.64985 18.2198 4.71949L12 10.9392L5.78026 4.71949C5.71077 4.64921 5.62807 4.59335 5.53691 4.55514C5.44576 4.51692 5.34795 4.49711 5.24911 4.49683C5.15027 4.49655 5.05235 4.51581 4.96098 4.55351C4.86961 4.59121 4.78659 4.64659 4.7167 4.71648C4.64681 4.78638 4.59143 4.8694 4.55374 4.96077C4.51605 5.05214 4.49679 5.15006 4.49707 5.2489C4.49736 5.34774 4.51718 5.44555 4.5554 5.5367C4.59361 5.62786 4.64947 5.71055 4.71976 5.78004L10.9395 11.9998L4.71976 18.2195C4.65013 18.2892 4.59489 18.3718 4.5572 18.4628C4.51951 18.5538 4.50011 18.6513 4.50011 18.7498C4.50011 18.8483 4.51951 18.9458 4.5572 19.0368C4.59488 19.1278 4.65012 19.2105 4.71976 19.2801C4.7894 19.3497 4.87207 19.405 4.96305 19.4427C5.05403 19.4803 5.15155 19.4997 5.25003 19.4997C5.34851 19.4997 5.44603 19.4803 5.53701 19.4427C5.628 19.405 5.71067 19.3497 5.78031 19.2801L12.0001 13.0603L18.2198 19.2801C18.3604 19.4207 18.5512 19.4997 18.7501 19.4997C18.949 19.4997 19.1397 19.4207 19.2804 19.2801C19.421 19.1395 19.5 18.9487 19.5 18.7498C19.5 18.5509 19.421 18.3602 19.2804 18.2195L13.0606 11.9998Z%22 fill%3D%22white%22 fill-opacity%3D%220.95%22%2F%3E%3C%2Fsvg%3E\");background-size:20px 20px}#user-creation-stepper{display:flex;flex-direction:column;width:100%}#user-creation-stepper .mat-stepper-horizontal{margin:0 auto;width:100%;background-color:transparent}#user-creation-stepper .mat-horizontal-stepper-header-container{margin:0 auto;width:800px}#user-creation-stepper .mat-step-icon{width:28px;height:28px;border:3px solid hsl(0,0%,50.2%)}#user-creation-stepper .mat-step-icon-selected{background-color:#c6c6c6!important;border-color:#19487d}#user-creation-stepper .mat-step-icon-state-number{background-color:#fff}#user-creation-stepper .mat-step-icon-state-edit,#user-creation-stepper .mat-step-header .mat-step-icon-state-done{background-color:#1170cf;border-color:#1170cf}#user-creation-stepper .mat-step-icon-content{display:none}#user-creation-stepper .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child):before,#user-creation-stepper [dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child):before,#user-creation-stepper .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child):after,#user-creation-stepper [dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child):after{border-top-width:3px!important}#user-creation-stepper .mat-horizontal-stepper-header:before,#user-creation-stepper .mat-horizontal-stepper-header:after,#user-creation-stepper .mat-stepper-horizontal-line{border-top-color:#1170cf!important;border-top-width:3px!important;border-top-style:solid!important}#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-stepper-horizontal-line,#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-horizontal-stepper-header:before,#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-horizontal-stepper-header:after{border-top-width:3px!important;background-color:#7b7b7b!important;border-top-color:#7b7b7b!important}#user-creation-stepper .mat-horizontal-content-container{padding:0!important;margin-top:3rem}#user-creation-stepper .mat-horizontal-stepper-content[aria-expanded=true]{padding-bottom:0}.step-title{font-size:26px;font-weight:500;width:70%;margin:0 auto 1rem;min-height:32px;display:flex;align-items:center}.wizard-actions{display:flex;flex-flow:row-reverse;justify-content:flex-start;align-items:center;margin:16px 16px 0 0;align-self:flex-end;gap:1rem;position:relative;z-index:30}.uc-btn{border-radius:50px!important;padding:8px 16px!important;min-width:80px!important;line-height:normal!important;cursor:pointer}.uc-btn__inline-content{display:inline-flex;align-items:center;gap:8px}.uc-btn__spinner{width:14px;height:14px;border:2px solid rgba(255,255,255,.5);border-top-color:#fff;border-radius:50%;animation:uc-btn-spin .7s linear infinite}@keyframes uc-btn-spin{to{transform:rotate(360deg)}}.uc-btn-primary{background-color:#000!important;color:#fff!important;border:1px solid black!important}.uc-btn-secondary{background-color:#fff!important;color:#000!important;border:1px solid black!important}.move-user-tab-content-box{width:70%;margin:0 auto;background-color:#fff;min-height:350px;border:1px solid #C3C1C1;border-radius:8px;box-sizing:border-box;padding:25px}.wizard-loading-overlay{position:absolute;inset:0;background:rgba(243,243,243,.72);backdrop-filter:blur(1px);opacity:0;pointer-events:none;transition:opacity .18s ease;z-index:20}.wizard-loading-overlay--visible{opacity:1;pointer-events:auto}.wizard-actions .uc-btn-primary.mat-button-disabled{background-color:#bbb;color:#fff;border:1px solid grey;cursor:default!important;opacity:.3}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatStep, selector: "mat-step", inputs: ["color"], exportAs: ["matStep"] }, { kind: "directive", type: i4.MatStepLabel, selector: "[matStepLabel]" }, { kind: "component", type: i4.MatStepper, selector: "mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]", inputs: ["selectedIndex", "disableRipple", "color", "labelPosition", "headerPosition", "animationDuration"], outputs: ["animationDone"], exportAs: ["matStepper", "matVerticalStepper", "matHorizontalStepper"] }, { kind: "component", type: UserTemplateStepComponent, selector: "tk-user-template-step", inputs: ["customerId"], outputs: ["validityChange"] }, { kind: "component", type: NotificationsComponent, selector: "app-notification" }, { kind: "component", type: UserDetailsStepComponent, selector: "tk-user-details-step", outputs: ["validityChange"] }, { kind: "component", type: UserOverviewStepComponent, selector: "tk-user-overview-step" }, { kind: "component", type: AppLoaderComponent, selector: "app-loader" }], encapsulation: i0.ViewEncapsulation.None });
903
+ UserCreationWizardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationWizardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
904
+ UserCreationWizardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UserCreationWizardComponent, selector: "tk-user-creation-wizard", inputs: { title: "title", host: "host", token: "token", customerId: "customerId" }, outputs: { cancel: "cancel", submit: "submit" }, ngImport: i0, template: "<div class=\"move-user-stepper-container\" [attr.aria-busy]=\"isSubmitting\">\n <header class=\"move-user-header\">\n <div class=\"move-user-header__title\">{{ title }}</div>\n <div class=\"move-user-header__close\">\n <span class=\"app-icon user-creation-close-icon\" (click)=\"onCancel()\"></span>\n </div>\n </header>\n\n <div id=\"user-creation-stepper\">\n <mat-stepper [linear]=\"false\" labelPosition=\"bottom\" #stepper>\n <mat-step>\n <div class=\"step-title\">Step 1: User creation with template</div>\n <ng-template matStepLabel>User creation</ng-template>\n\n <div class=\"move-user-tab-content-box\">\n <tk-user-template-step [customerId]=\"customerId\"></tk-user-template-step>\n </div>\n </mat-step>\n\n <mat-step>\n <div class=\"step-title\">Step 2 : User details</div>\n <ng-template matStepLabel>User details</ng-template>\n\n <div class=\"move-user-tab-content-box\">\n <tk-user-details-step></tk-user-details-step>\n </div>\n </mat-step>\n\n <mat-step>\n <div class=\"step-title\">Step 3: Review</div>\n <ng-template matStepLabel>Review</ng-template>\n\n <div class=\"move-user-tab-content-box\">\n <tk-user-overview-step></tk-user-overview-step>\n </div>\n </mat-step>\n </mat-stepper>\n\n <div class=\"wizard-actions\">\n <ng-container [ngSwitch]=\"stepper.selectedIndex\">\n <ng-container *ngSwitchCase=\"0\">\n <button mat-button class=\"uc-btn uc-btn-primary\" type=\"button\" (click)=\"stepper.next()\">\n Next\n </button>\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"onCancel()\">\n Cancel\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"1\">\n <button mat-button class=\"uc-btn uc-btn-primary\" type=\"button\" (click)=\"stepper.next()\">\n Next\n </button>\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"stepper.previous()\">\n Previous\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"2\">\n <button\n mat-button\n class=\"uc-btn uc-btn-primary\"\n type=\"button\"\n [disabled]=\"isSubmitting\"\n (click)=\"onSubmit()\"\n >\n <span class=\"uc-btn__inline-content\">\n <span class=\"uc-btn__spinner\" *ngIf=\"isSubmitting\" aria-hidden=\"true\"></span>\n <span>{{ isSubmitting ? 'Creating...' : 'Create' }}</span>\n </span>\n </button>\n <button\n mat-button\n class=\"uc-btn uc-btn-secondary\"\n type=\"button\"\n [disabled]=\"isSubmitting\"\n (click)=\"stepper.previous()\"\n >\n Previous\n </button>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <div class=\"wizard-loading-overlay\" [class.wizard-loading-overlay--visible]=\"isSubmitting\" aria-hidden=\"true\"></div>\n</div>\n", styles: [".move-user-stepper-container{background-color:#f3f3f3;padding:0 0 16px;position:relative;overflow:hidden}.move-user-header{background-color:#1170cf;height:45px;padding:1rem 1.5rem;display:flex;align-items:center;justify-content:space-between;color:#fff;font-size:18px;font-weight:500}.move-user-header__close{cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:0}.move-user-header__close i{font-size:25px;font-weight:100}.app-icon{height:20px;width:20px;display:block;cursor:pointer;background-repeat:no-repeat;background-position:center}.user-creation-close-icon{background-image:url(\"data:image/svg+xml,%3Csvg width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M13.0606 11.9998L19.2803 5.78001C19.35 5.71038 19.4052 5.6277 19.4429 5.53672C19.4806 5.44573 19.5 5.34822 19.5 5.24974C19.5 5.15126 19.4806 5.05374 19.4429 4.96276C19.4052 4.87177 19.3499 4.7891 19.2803 4.71947C19.2107 4.64983 19.128 4.5946 19.037 4.55691C18.946 4.51923 18.8485 4.49983 18.75 4.49983C18.6515 4.49984 18.554 4.51924 18.463 4.55692C18.3721 4.59461 18.2894 4.64985 18.2198 4.71949L12 10.9392L5.78026 4.71949C5.71077 4.64921 5.62807 4.59335 5.53691 4.55514C5.44576 4.51692 5.34795 4.49711 5.24911 4.49683C5.15027 4.49655 5.05235 4.51581 4.96098 4.55351C4.86961 4.59121 4.78659 4.64659 4.7167 4.71648C4.64681 4.78638 4.59143 4.8694 4.55374 4.96077C4.51605 5.05214 4.49679 5.15006 4.49707 5.2489C4.49736 5.34774 4.51718 5.44555 4.5554 5.5367C4.59361 5.62786 4.64947 5.71055 4.71976 5.78004L10.9395 11.9998L4.71976 18.2195C4.65013 18.2892 4.59489 18.3718 4.5572 18.4628C4.51951 18.5538 4.50011 18.6513 4.50011 18.7498C4.50011 18.8483 4.51951 18.9458 4.5572 19.0368C4.59488 19.1278 4.65012 19.2105 4.71976 19.2801C4.7894 19.3497 4.87207 19.405 4.96305 19.4427C5.05403 19.4803 5.15155 19.4997 5.25003 19.4997C5.34851 19.4997 5.44603 19.4803 5.53701 19.4427C5.628 19.405 5.71067 19.3497 5.78031 19.2801L12.0001 13.0603L18.2198 19.2801C18.3604 19.4207 18.5512 19.4997 18.7501 19.4997C18.949 19.4997 19.1397 19.4207 19.2804 19.2801C19.421 19.1395 19.5 18.9487 19.5 18.7498C19.5 18.5509 19.421 18.3602 19.2804 18.2195L13.0606 11.9998Z%22 fill%3D%22white%22 fill-opacity%3D%220.95%22%2F%3E%3C%2Fsvg%3E\");background-size:20px 20px}#user-creation-stepper{display:flex;flex-direction:column;width:100%}#user-creation-stepper .mat-stepper-horizontal{margin:0 auto;width:100%;background-color:transparent}#user-creation-stepper .mat-horizontal-stepper-header-container{margin:0 auto;width:800px}#user-creation-stepper .mat-step-icon{width:28px;height:28px;border:3px solid hsl(0,0%,50.2%)}#user-creation-stepper .mat-step-icon-selected{background-color:#c6c6c6!important;border-color:#19487d}#user-creation-stepper .mat-step-icon-state-number{background-color:#fff}#user-creation-stepper .mat-step-icon-state-edit,#user-creation-stepper .mat-step-header .mat-step-icon-state-done{background-color:#1170cf;border-color:#1170cf}#user-creation-stepper .mat-step-icon-content{display:none}#user-creation-stepper .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child):before,#user-creation-stepper [dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child):before,#user-creation-stepper .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child):after,#user-creation-stepper [dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child):after{border-top-width:3px!important}#user-creation-stepper .mat-horizontal-stepper-header:before,#user-creation-stepper .mat-horizontal-stepper-header:after,#user-creation-stepper .mat-stepper-horizontal-line{border-top-color:#1170cf!important;border-top-width:3px!important;border-top-style:solid!important}#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-stepper-horizontal-line,#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-horizontal-stepper-header:before,#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-horizontal-stepper-header:after{border-top-width:3px!important;background-color:#7b7b7b!important;border-top-color:#7b7b7b!important}#user-creation-stepper .mat-horizontal-content-container{padding:0!important;margin-top:3rem}#user-creation-stepper .mat-horizontal-stepper-content[aria-expanded=true]{padding-bottom:0}.step-title{font-size:26px;font-weight:500;width:70%;margin:0 auto 1rem;min-height:32px;display:flex;align-items:center}.wizard-actions{display:flex;flex-flow:row-reverse;justify-content:flex-start;align-items:center;margin:16px 16px 0 0;align-self:flex-end;gap:1rem;position:relative;z-index:30}.uc-btn{border-radius:50px!important;padding:8px 16px!important;min-width:80px!important;line-height:normal!important;cursor:pointer}.uc-btn__inline-content{display:inline-flex;align-items:center;gap:8px}.uc-btn__spinner{width:14px;height:14px;border:2px solid rgba(255,255,255,.5);border-top-color:#fff;border-radius:50%;animation:uc-btn-spin .7s linear infinite}@keyframes uc-btn-spin{to{transform:rotate(360deg)}}.uc-btn-primary{background-color:#000!important;color:#fff!important;border:1px solid black!important}.uc-btn-secondary{background-color:#fff!important;color:#000!important;border:1px solid black!important}.move-user-tab-content-box{width:70%;margin:0 auto;background-color:#fff;min-height:350px;border:1px solid #C3C1C1;border-radius:8px;box-sizing:border-box;padding:25px}.wizard-loading-overlay{position:absolute;inset:0;background:rgba(243,243,243,.72);backdrop-filter:blur(1px);opacity:0;pointer-events:none;transition:opacity .18s ease;z-index:20}.wizard-loading-overlay--visible{opacity:1;pointer-events:auto}.mat-button-disabled{background-color:#bbb;color:#fff;border:1px solid grey;cursor:default!important}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i4$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$2.MatStep, selector: "mat-step", inputs: ["color"], exportAs: ["matStep"] }, { kind: "directive", type: i3$2.MatStepLabel, selector: "[matStepLabel]" }, { kind: "component", type: i3$2.MatStepper, selector: "mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]", inputs: ["selectedIndex", "disableRipple", "color", "labelPosition", "headerPosition", "animationDuration"], outputs: ["animationDone"], exportAs: ["matStepper", "matVerticalStepper", "matHorizontalStepper"] }, { kind: "component", type: UserTemplateStepComponent, selector: "tk-user-template-step", inputs: ["customerId"] }, { kind: "component", type: UserDetailsStepComponent, selector: "tk-user-details-step" }, { kind: "component", type: UserOverviewStepComponent, selector: "tk-user-overview-step" }], encapsulation: i0.ViewEncapsulation.None });
2462
905
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationWizardComponent, decorators: [{
2463
906
  type: Component,
2464
- args: [{ selector: 'tk-user-creation-wizard', encapsulation: ViewEncapsulation.None, template: "<app-notification></app-notification>\n<app-loader *ngIf=\"isLoading\"></app-loader>\n<div class=\"move-user-stepper-container\" [attr.aria-busy]=\"isSubmitting\">\n <header class=\"move-user-header\">\n <div class=\"move-user-header__title\">{{ title }}</div>\n <div class=\"move-user-header__close\">\n <span class=\"app-icon user-creation-close-icon\" (click)=\"onCancel()\"></span>\n </div>\n </header>\n\n <div id=\"user-creation-stepper\">\n <mat-stepper [linear]=\"false\" labelPosition=\"bottom\" #stepper\n [selectedIndex]=\"selectedIndex\"\n (selectionChange)=\"onStepSelectionChange($event)\">\n\n <mat-step>\n <div class=\"step-title\">Step 1: User creation with template</div>\n <ng-template matStepLabel>User creation</ng-template>\n\n <ng-container *ngIf=\"selectedIndex === 0\">\n <div class=\"move-user-tab-content-box\">\n <tk-user-template-step\n [customerId]=\"customerId\"\n (validityChange)=\"templateStepValid = $event\"\n ></tk-user-template-step>\n </div>\n </ng-container>\n </mat-step>\n\n <mat-step>\n <div class=\"step-title\">Step 2 : User details</div>\n <ng-template matStepLabel>User details</ng-template>\n\n <ng-container *ngIf=\"selectedIndex === 1\">\n <div class=\"move-user-tab-content-box\">\n <tk-user-details-step (validityChange)=\"detailsStepValid = $event\"></tk-user-details-step>\n </div>\n </ng-container>\n </mat-step>\n\n <mat-step>\n <div class=\"step-title\">Step 3: Review</div>\n <ng-template matStepLabel>Review</ng-template>\n\n <ng-container *ngIf=\"selectedIndex === 2\">\n <div class=\"move-user-tab-content-box\">\n <tk-user-overview-step></tk-user-overview-step>\n </div>\n </ng-container>\n </mat-step>\n </mat-stepper>\n\n <div class=\"wizard-actions\">\n <ng-container [ngSwitch]=\"stepper.selectedIndex\">\n <ng-container *ngSwitchCase=\"0\">\n <button\n mat-button\n class=\"uc-btn uc-btn-primary\"\n type=\"button\"\n [disabled]=\"!templateStepValid\"\n (click)=\"onStepperNext(stepper)\"\n >\n Next\n </button>\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"onCancel()\">\n Cancel\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"1\">\n <button\n mat-button\n class=\"uc-btn uc-btn-primary\"\n type=\"button\"\n [disabled]=\"!detailsStepValid\"\n (click)=\"onStepperNext(stepper)\"\n >\n Next\n </button>\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"stepper.previous()\">\n Previous\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"2\">\n <button\n mat-button\n class=\"uc-btn uc-btn-primary\"\n type=\"button\"\n [disabled]=\"isSubmitting\"\n (click)=\"onSubmit()\"\n >\n <span class=\"uc-btn__inline-content\">\n <span class=\"uc-btn__spinner\" *ngIf=\"isSubmitting\" aria-hidden=\"true\"></span>\n <span>{{ isSubmitting ? 'Creating...' : 'Create' }}</span>\n </span>\n </button>\n <button\n mat-button\n class=\"uc-btn uc-btn-secondary\"\n type=\"button\"\n [disabled]=\"isSubmitting\"\n (click)=\"stepper.previous()\"\n >\n Previous\n </button>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <div class=\"wizard-loading-overlay\" [class.wizard-loading-overlay--visible]=\"isSubmitting\" aria-hidden=\"true\"></div>\n</div>", styles: [".move-user-stepper-container{background-color:#f3f3f3;padding:0 0 16px;position:relative;overflow:hidden}.move-user-header{background-color:#1170cf;height:45px;padding:1rem 1.5rem;display:flex;align-items:center;justify-content:space-between;color:#fff;font-size:18px;font-weight:500}.move-user-header__close{cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:0}.move-user-header__close i{font-size:25px;font-weight:100}.app-icon{height:20px;width:20px;display:block;cursor:pointer;background-repeat:no-repeat;background-position:center}.user-creation-close-icon{background-image:url(\"data:image/svg+xml,%3Csvg width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M13.0606 11.9998L19.2803 5.78001C19.35 5.71038 19.4052 5.6277 19.4429 5.53672C19.4806 5.44573 19.5 5.34822 19.5 5.24974C19.5 5.15126 19.4806 5.05374 19.4429 4.96276C19.4052 4.87177 19.3499 4.7891 19.2803 4.71947C19.2107 4.64983 19.128 4.5946 19.037 4.55691C18.946 4.51923 18.8485 4.49983 18.75 4.49983C18.6515 4.49984 18.554 4.51924 18.463 4.55692C18.3721 4.59461 18.2894 4.64985 18.2198 4.71949L12 10.9392L5.78026 4.71949C5.71077 4.64921 5.62807 4.59335 5.53691 4.55514C5.44576 4.51692 5.34795 4.49711 5.24911 4.49683C5.15027 4.49655 5.05235 4.51581 4.96098 4.55351C4.86961 4.59121 4.78659 4.64659 4.7167 4.71648C4.64681 4.78638 4.59143 4.8694 4.55374 4.96077C4.51605 5.05214 4.49679 5.15006 4.49707 5.2489C4.49736 5.34774 4.51718 5.44555 4.5554 5.5367C4.59361 5.62786 4.64947 5.71055 4.71976 5.78004L10.9395 11.9998L4.71976 18.2195C4.65013 18.2892 4.59489 18.3718 4.5572 18.4628C4.51951 18.5538 4.50011 18.6513 4.50011 18.7498C4.50011 18.8483 4.51951 18.9458 4.5572 19.0368C4.59488 19.1278 4.65012 19.2105 4.71976 19.2801C4.7894 19.3497 4.87207 19.405 4.96305 19.4427C5.05403 19.4803 5.15155 19.4997 5.25003 19.4997C5.34851 19.4997 5.44603 19.4803 5.53701 19.4427C5.628 19.405 5.71067 19.3497 5.78031 19.2801L12.0001 13.0603L18.2198 19.2801C18.3604 19.4207 18.5512 19.4997 18.7501 19.4997C18.949 19.4997 19.1397 19.4207 19.2804 19.2801C19.421 19.1395 19.5 18.9487 19.5 18.7498C19.5 18.5509 19.421 18.3602 19.2804 18.2195L13.0606 11.9998Z%22 fill%3D%22white%22 fill-opacity%3D%220.95%22%2F%3E%3C%2Fsvg%3E\");background-size:20px 20px}#user-creation-stepper{display:flex;flex-direction:column;width:100%}#user-creation-stepper .mat-stepper-horizontal{margin:0 auto;width:100%;background-color:transparent}#user-creation-stepper .mat-horizontal-stepper-header-container{margin:0 auto;width:800px}#user-creation-stepper .mat-step-icon{width:28px;height:28px;border:3px solid hsl(0,0%,50.2%)}#user-creation-stepper .mat-step-icon-selected{background-color:#c6c6c6!important;border-color:#19487d}#user-creation-stepper .mat-step-icon-state-number{background-color:#fff}#user-creation-stepper .mat-step-icon-state-edit,#user-creation-stepper .mat-step-header .mat-step-icon-state-done{background-color:#1170cf;border-color:#1170cf}#user-creation-stepper .mat-step-icon-content{display:none}#user-creation-stepper .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child):before,#user-creation-stepper [dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child):before,#user-creation-stepper .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child):after,#user-creation-stepper [dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child):after{border-top-width:3px!important}#user-creation-stepper .mat-horizontal-stepper-header:before,#user-creation-stepper .mat-horizontal-stepper-header:after,#user-creation-stepper .mat-stepper-horizontal-line{border-top-color:#1170cf!important;border-top-width:3px!important;border-top-style:solid!important}#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-stepper-horizontal-line,#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-horizontal-stepper-header:before,#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-horizontal-stepper-header:after{border-top-width:3px!important;background-color:#7b7b7b!important;border-top-color:#7b7b7b!important}#user-creation-stepper .mat-horizontal-content-container{padding:0!important;margin-top:3rem}#user-creation-stepper .mat-horizontal-stepper-content[aria-expanded=true]{padding-bottom:0}.step-title{font-size:26px;font-weight:500;width:70%;margin:0 auto 1rem;min-height:32px;display:flex;align-items:center}.wizard-actions{display:flex;flex-flow:row-reverse;justify-content:flex-start;align-items:center;margin:16px 16px 0 0;align-self:flex-end;gap:1rem;position:relative;z-index:30}.uc-btn{border-radius:50px!important;padding:8px 16px!important;min-width:80px!important;line-height:normal!important;cursor:pointer}.uc-btn__inline-content{display:inline-flex;align-items:center;gap:8px}.uc-btn__spinner{width:14px;height:14px;border:2px solid rgba(255,255,255,.5);border-top-color:#fff;border-radius:50%;animation:uc-btn-spin .7s linear infinite}@keyframes uc-btn-spin{to{transform:rotate(360deg)}}.uc-btn-primary{background-color:#000!important;color:#fff!important;border:1px solid black!important}.uc-btn-secondary{background-color:#fff!important;color:#000!important;border:1px solid black!important}.move-user-tab-content-box{width:70%;margin:0 auto;background-color:#fff;min-height:350px;border:1px solid #C3C1C1;border-radius:8px;box-sizing:border-box;padding:25px}.wizard-loading-overlay{position:absolute;inset:0;background:rgba(243,243,243,.72);backdrop-filter:blur(1px);opacity:0;pointer-events:none;transition:opacity .18s ease;z-index:20}.wizard-loading-overlay--visible{opacity:1;pointer-events:auto}.wizard-actions .uc-btn-primary.mat-button-disabled{background-color:#bbb;color:#fff;border:1px solid grey;cursor:default!important;opacity:.3}\n"] }]
2465
- }], ctorParameters: function () { return [{ type: NotificationService }]; }, propDecorators: { title: [{
907
+ args: [{ selector: 'tk-user-creation-wizard', encapsulation: ViewEncapsulation.None, template: "<div class=\"move-user-stepper-container\" [attr.aria-busy]=\"isSubmitting\">\n <header class=\"move-user-header\">\n <div class=\"move-user-header__title\">{{ title }}</div>\n <div class=\"move-user-header__close\">\n <span class=\"app-icon user-creation-close-icon\" (click)=\"onCancel()\"></span>\n </div>\n </header>\n\n <div id=\"user-creation-stepper\">\n <mat-stepper [linear]=\"false\" labelPosition=\"bottom\" #stepper>\n <mat-step>\n <div class=\"step-title\">Step 1: User creation with template</div>\n <ng-template matStepLabel>User creation</ng-template>\n\n <div class=\"move-user-tab-content-box\">\n <tk-user-template-step [customerId]=\"customerId\"></tk-user-template-step>\n </div>\n </mat-step>\n\n <mat-step>\n <div class=\"step-title\">Step 2 : User details</div>\n <ng-template matStepLabel>User details</ng-template>\n\n <div class=\"move-user-tab-content-box\">\n <tk-user-details-step></tk-user-details-step>\n </div>\n </mat-step>\n\n <mat-step>\n <div class=\"step-title\">Step 3: Review</div>\n <ng-template matStepLabel>Review</ng-template>\n\n <div class=\"move-user-tab-content-box\">\n <tk-user-overview-step></tk-user-overview-step>\n </div>\n </mat-step>\n </mat-stepper>\n\n <div class=\"wizard-actions\">\n <ng-container [ngSwitch]=\"stepper.selectedIndex\">\n <ng-container *ngSwitchCase=\"0\">\n <button mat-button class=\"uc-btn uc-btn-primary\" type=\"button\" (click)=\"stepper.next()\">\n Next\n </button>\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"onCancel()\">\n Cancel\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"1\">\n <button mat-button class=\"uc-btn uc-btn-primary\" type=\"button\" (click)=\"stepper.next()\">\n Next\n </button>\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"stepper.previous()\">\n Previous\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"2\">\n <button\n mat-button\n class=\"uc-btn uc-btn-primary\"\n type=\"button\"\n [disabled]=\"isSubmitting\"\n (click)=\"onSubmit()\"\n >\n <span class=\"uc-btn__inline-content\">\n <span class=\"uc-btn__spinner\" *ngIf=\"isSubmitting\" aria-hidden=\"true\"></span>\n <span>{{ isSubmitting ? 'Creating...' : 'Create' }}</span>\n </span>\n </button>\n <button\n mat-button\n class=\"uc-btn uc-btn-secondary\"\n type=\"button\"\n [disabled]=\"isSubmitting\"\n (click)=\"stepper.previous()\"\n >\n Previous\n </button>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <div class=\"wizard-loading-overlay\" [class.wizard-loading-overlay--visible]=\"isSubmitting\" aria-hidden=\"true\"></div>\n</div>\n", styles: [".move-user-stepper-container{background-color:#f3f3f3;padding:0 0 16px;position:relative;overflow:hidden}.move-user-header{background-color:#1170cf;height:45px;padding:1rem 1.5rem;display:flex;align-items:center;justify-content:space-between;color:#fff;font-size:18px;font-weight:500}.move-user-header__close{cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:0}.move-user-header__close i{font-size:25px;font-weight:100}.app-icon{height:20px;width:20px;display:block;cursor:pointer;background-repeat:no-repeat;background-position:center}.user-creation-close-icon{background-image:url(\"data:image/svg+xml,%3Csvg width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M13.0606 11.9998L19.2803 5.78001C19.35 5.71038 19.4052 5.6277 19.4429 5.53672C19.4806 5.44573 19.5 5.34822 19.5 5.24974C19.5 5.15126 19.4806 5.05374 19.4429 4.96276C19.4052 4.87177 19.3499 4.7891 19.2803 4.71947C19.2107 4.64983 19.128 4.5946 19.037 4.55691C18.946 4.51923 18.8485 4.49983 18.75 4.49983C18.6515 4.49984 18.554 4.51924 18.463 4.55692C18.3721 4.59461 18.2894 4.64985 18.2198 4.71949L12 10.9392L5.78026 4.71949C5.71077 4.64921 5.62807 4.59335 5.53691 4.55514C5.44576 4.51692 5.34795 4.49711 5.24911 4.49683C5.15027 4.49655 5.05235 4.51581 4.96098 4.55351C4.86961 4.59121 4.78659 4.64659 4.7167 4.71648C4.64681 4.78638 4.59143 4.8694 4.55374 4.96077C4.51605 5.05214 4.49679 5.15006 4.49707 5.2489C4.49736 5.34774 4.51718 5.44555 4.5554 5.5367C4.59361 5.62786 4.64947 5.71055 4.71976 5.78004L10.9395 11.9998L4.71976 18.2195C4.65013 18.2892 4.59489 18.3718 4.5572 18.4628C4.51951 18.5538 4.50011 18.6513 4.50011 18.7498C4.50011 18.8483 4.51951 18.9458 4.5572 19.0368C4.59488 19.1278 4.65012 19.2105 4.71976 19.2801C4.7894 19.3497 4.87207 19.405 4.96305 19.4427C5.05403 19.4803 5.15155 19.4997 5.25003 19.4997C5.34851 19.4997 5.44603 19.4803 5.53701 19.4427C5.628 19.405 5.71067 19.3497 5.78031 19.2801L12.0001 13.0603L18.2198 19.2801C18.3604 19.4207 18.5512 19.4997 18.7501 19.4997C18.949 19.4997 19.1397 19.4207 19.2804 19.2801C19.421 19.1395 19.5 18.9487 19.5 18.7498C19.5 18.5509 19.421 18.3602 19.2804 18.2195L13.0606 11.9998Z%22 fill%3D%22white%22 fill-opacity%3D%220.95%22%2F%3E%3C%2Fsvg%3E\");background-size:20px 20px}#user-creation-stepper{display:flex;flex-direction:column;width:100%}#user-creation-stepper .mat-stepper-horizontal{margin:0 auto;width:100%;background-color:transparent}#user-creation-stepper .mat-horizontal-stepper-header-container{margin:0 auto;width:800px}#user-creation-stepper .mat-step-icon{width:28px;height:28px;border:3px solid hsl(0,0%,50.2%)}#user-creation-stepper .mat-step-icon-selected{background-color:#c6c6c6!important;border-color:#19487d}#user-creation-stepper .mat-step-icon-state-number{background-color:#fff}#user-creation-stepper .mat-step-icon-state-edit,#user-creation-stepper .mat-step-header .mat-step-icon-state-done{background-color:#1170cf;border-color:#1170cf}#user-creation-stepper .mat-step-icon-content{display:none}#user-creation-stepper .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child):before,#user-creation-stepper [dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child):before,#user-creation-stepper .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child):after,#user-creation-stepper [dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child):after{border-top-width:3px!important}#user-creation-stepper .mat-horizontal-stepper-header:before,#user-creation-stepper .mat-horizontal-stepper-header:after,#user-creation-stepper .mat-stepper-horizontal-line{border-top-color:#1170cf!important;border-top-width:3px!important;border-top-style:solid!important}#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-stepper-horizontal-line,#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-horizontal-stepper-header:before,#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-horizontal-stepper-header:after{border-top-width:3px!important;background-color:#7b7b7b!important;border-top-color:#7b7b7b!important}#user-creation-stepper .mat-horizontal-content-container{padding:0!important;margin-top:3rem}#user-creation-stepper .mat-horizontal-stepper-content[aria-expanded=true]{padding-bottom:0}.step-title{font-size:26px;font-weight:500;width:70%;margin:0 auto 1rem;min-height:32px;display:flex;align-items:center}.wizard-actions{display:flex;flex-flow:row-reverse;justify-content:flex-start;align-items:center;margin:16px 16px 0 0;align-self:flex-end;gap:1rem;position:relative;z-index:30}.uc-btn{border-radius:50px!important;padding:8px 16px!important;min-width:80px!important;line-height:normal!important;cursor:pointer}.uc-btn__inline-content{display:inline-flex;align-items:center;gap:8px}.uc-btn__spinner{width:14px;height:14px;border:2px solid rgba(255,255,255,.5);border-top-color:#fff;border-radius:50%;animation:uc-btn-spin .7s linear infinite}@keyframes uc-btn-spin{to{transform:rotate(360deg)}}.uc-btn-primary{background-color:#000!important;color:#fff!important;border:1px solid black!important}.uc-btn-secondary{background-color:#fff!important;color:#000!important;border:1px solid black!important}.move-user-tab-content-box{width:70%;margin:0 auto;background-color:#fff;min-height:350px;border:1px solid #C3C1C1;border-radius:8px;box-sizing:border-box;padding:25px}.wizard-loading-overlay{position:absolute;inset:0;background:rgba(243,243,243,.72);backdrop-filter:blur(1px);opacity:0;pointer-events:none;transition:opacity .18s ease;z-index:20}.wizard-loading-overlay--visible{opacity:1;pointer-events:auto}.mat-button-disabled{background-color:#bbb;color:#fff;border:1px solid grey;cursor:default!important}\n"] }]
908
+ }], propDecorators: { title: [{
2466
909
  type: Input
2467
910
  }], host: [{
2468
911
  type: Input
@@ -2474,38 +917,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
2474
917
  type: Output
2475
918
  }], submit: [{
2476
919
  type: Output
2477
- }], templateStep: [{
2478
- type: ViewChild,
2479
- args: [UserTemplateStepComponent]
2480
- }], detailsStep: [{
2481
- type: ViewChild,
2482
- args: [UserDetailsStepComponent]
2483
920
  }] } });
2484
921
 
2485
- function HttpLoaderFactory(http) {
2486
- return new TranslateHttpLoader(http);
2487
- }
2488
922
  class UserCreationModule {
2489
923
  }
2490
924
  UserCreationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2491
925
  UserCreationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: UserCreationModule, declarations: [UserCreationWizardComponent,
2492
926
  UserTemplateStepComponent,
2493
- NotificationsComponent,
2494
927
  UserDetailsStepComponent,
2495
- UserOverviewStepComponent,
2496
- AppLoaderComponent,
2497
- TruncatePipe], imports: [CommonModule,
928
+ UserOverviewStepComponent], imports: [CommonModule,
2498
929
  SharedModule,
2499
930
  MaterialModule,
2500
931
  MatStepperModule,
2501
932
  MatExpansionModule,
2502
933
  FormsModule,
2503
934
  ReactiveFormsModule,
2504
- MatRadioModule, i1$3.TranslateModule], exports: [UserCreationWizardComponent] });
935
+ MatRadioModule], exports: [UserCreationWizardComponent] });
2505
936
  UserCreationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationModule, providers: [
2506
937
  UserCreationApiService,
2507
938
  UserCreationWizardService,
2508
- NotificationService,
2509
939
  ], imports: [CommonModule,
2510
940
  SharedModule,
2511
941
  MaterialModule,
@@ -2513,25 +943,15 @@ UserCreationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", vers
2513
943
  MatExpansionModule,
2514
944
  FormsModule,
2515
945
  ReactiveFormsModule,
2516
- MatRadioModule,
2517
- TranslateModule.forRoot({
2518
- loader: {
2519
- provide: TranslateLoader,
2520
- useFactory: HttpLoaderFactory,
2521
- deps: [HttpClient]
2522
- }
2523
- })] });
946
+ MatRadioModule] });
2524
947
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationModule, decorators: [{
2525
948
  type: NgModule,
2526
949
  args: [{
2527
950
  declarations: [
2528
951
  UserCreationWizardComponent,
2529
952
  UserTemplateStepComponent,
2530
- NotificationsComponent,
2531
953
  UserDetailsStepComponent,
2532
- UserOverviewStepComponent,
2533
- AppLoaderComponent,
2534
- TruncatePipe,
954
+ UserOverviewStepComponent
2535
955
  ],
2536
956
  imports: [
2537
957
  CommonModule,
@@ -2541,22 +961,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
2541
961
  MatExpansionModule,
2542
962
  FormsModule,
2543
963
  ReactiveFormsModule,
2544
- MatRadioModule,
2545
- TranslateModule.forRoot({
2546
- loader: {
2547
- provide: TranslateLoader,
2548
- useFactory: HttpLoaderFactory,
2549
- deps: [HttpClient]
2550
- }
2551
- }),
964
+ MatRadioModule
2552
965
  ],
2553
966
  exports: [
2554
- UserCreationWizardComponent,
967
+ UserCreationWizardComponent
2555
968
  ],
2556
969
  providers: [
2557
970
  UserCreationApiService,
2558
971
  UserCreationWizardService,
2559
- NotificationService,
2560
972
  ]
2561
973
  }]
2562
974
  }] });
@@ -2574,5 +986,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
2574
986
  * Generated bundle index. Do not edit.
2575
987
  */
2576
988
 
2577
- export { HttpLoaderFactory, USER_CREATED_SUCCESSFLLY, UserCreationModule, UserCreationWizardComponent };
989
+ export { UserCreationModule, UserCreationWizardComponent };
2578
990
  //# sourceMappingURL=tuki-io-tuki-widgets-user-creation.mjs.map