@fad-producto-portal/ng-fad-signature-fea 1.0.0-alpha.0 → 1.0.0-alpha.10

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 (84) hide show
  1. package/assets/images/fad-signature-fea/signature-summary/rejected.svg +20 -0
  2. package/assets/images/fad-signature-fea/signature-summary/send.svg +11 -0
  3. package/esm2022/lib/components/document-approval-list/document-approval-list.component.mjs +35 -81
  4. package/esm2022/lib/components/generic-error-fea/generic-error-fea.component.mjs +3 -3
  5. package/esm2022/lib/components/pdf-viewer-fea/pdf-viewer-fea.component.mjs +79 -0
  6. package/esm2022/lib/components/signature-summary/signature-summary.component.mjs +95 -0
  7. package/esm2022/lib/components/upload-e-signature/upload-e-signature.component.mjs +68 -54
  8. package/esm2022/lib/components/validate-rfc/validate-rfc.component.mjs +30 -18
  9. package/esm2022/lib/components/validate-signature/validate-signature.component.mjs +7 -13
  10. package/esm2022/lib/constants/configuration/index.mjs +2 -1
  11. package/esm2022/lib/constants/configuration/pdf-viewer-fea/index.mjs +2 -0
  12. package/esm2022/lib/constants/configuration/pdf-viewer-fea/pdf-viewer-fea-configuration.const.mjs +17 -0
  13. package/esm2022/lib/constants/configuration/signature-summary/signature-summary-configuration.const.mjs +18 -0
  14. package/esm2022/lib/constants/errors/upload-e-signature/upload-e-signature-error-code.mjs +2 -1
  15. package/esm2022/lib/constants/errors/upload-e-signature/upload-e-signature-error-description.mjs +3 -1
  16. package/esm2022/lib/constants/errors/validate-rfc/validate-rfc-error-code.mjs +4 -1
  17. package/esm2022/lib/constants/errors/validate-rfc/validate-rfc-error-description.mjs +7 -1
  18. package/esm2022/lib/constants/errors/validate-signature/validate-signature-error-code.mjs +2 -1
  19. package/esm2022/lib/constants/errors/validate-signature/validate-signature-error-description.mjs +4 -2
  20. package/esm2022/lib/models/configuration/index.mjs +4 -1
  21. package/esm2022/lib/models/configuration/pdf-viewer-fea/index.mjs +2 -0
  22. package/esm2022/lib/models/configuration/pdf-viewer-fea/pdf-viewer-fea.interface.mjs +2 -0
  23. package/esm2022/lib/models/configuration/signature-summary/index.mjs +2 -0
  24. package/esm2022/lib/models/configuration/signature-summary/signature-summary.interface.mjs +2 -0
  25. package/esm2022/lib/models/configuration/upload-e-signature/upload-e-signature-configuration.interface.mjs +1 -1
  26. package/esm2022/lib/models/customization/legends/index.mjs +4 -1
  27. package/esm2022/lib/models/customization/legends/pdf-viewer-fea/index.mjs +2 -0
  28. package/esm2022/lib/models/customization/legends/pdf-viewer-fea/pdf-viewer-fea-legends.interface.mjs +2 -0
  29. package/esm2022/lib/models/customization/legends/signature-summary/index.mjs +2 -0
  30. package/esm2022/lib/models/customization/legends/signature-summary/signature-summary-legends.interface.mjs +2 -0
  31. package/esm2022/lib/models/customization/style/index.mjs +4 -1
  32. package/esm2022/lib/models/customization/style/pdf-viewer-fea/index.mjs +2 -0
  33. package/esm2022/lib/models/customization/style/pdf-viewer-fea/pdf-viewer-fea-style.interface.mjs +2 -0
  34. package/esm2022/lib/models/customization/style/signature-summary/index.mjs +2 -0
  35. package/esm2022/lib/models/customization/style/signature-summary/signature-summary-style.interface.mjs +2 -0
  36. package/esm2022/lib/models/path-dependencies/index.mjs +4 -1
  37. package/esm2022/lib/models/path-dependencies/pdf-viewer-fea/index.mjs +2 -0
  38. package/esm2022/lib/models/path-dependencies/pdf-viewer-fea/pdf-viewer-fea-dependencies.interface.mjs +2 -0
  39. package/esm2022/lib/models/path-dependencies/signature-summary/index.mjs +2 -0
  40. package/esm2022/lib/models/path-dependencies/signature-summary/signature-summary-dependencies.interface.mjs +2 -0
  41. package/esm2022/lib/ng-fad-signature-fea.module.mjs +15 -5
  42. package/esm2022/public-api.mjs +3 -1
  43. package/fesm2022/fad-producto-portal-ng-fad-signature-fea.mjs +374 -184
  44. package/fesm2022/fad-producto-portal-ng-fad-signature-fea.mjs.map +1 -1
  45. package/lib/components/document-approval-list/document-approval-list.component.d.ts +2 -16
  46. package/lib/components/pdf-viewer-fea/pdf-viewer-fea.component.d.ts +28 -0
  47. package/lib/components/signature-summary/signature-summary.component.d.ts +27 -0
  48. package/lib/components/upload-e-signature/upload-e-signature.component.d.ts +3 -3
  49. package/lib/components/validate-rfc/validate-rfc.component.d.ts +6 -4
  50. package/lib/components/validate-signature/validate-signature.component.d.ts +2 -3
  51. package/lib/constants/configuration/index.d.ts +1 -0
  52. package/lib/constants/configuration/pdf-viewer-fea/index.d.ts +1 -0
  53. package/lib/constants/configuration/pdf-viewer-fea/pdf-viewer-fea-configuration.const.d.ts +2 -0
  54. package/lib/constants/configuration/signature-summary/signature-summary-configuration.const.d.ts +2 -0
  55. package/lib/constants/errors/upload-e-signature/upload-e-signature-error-code.d.ts +2 -1
  56. package/lib/constants/errors/upload-e-signature/upload-e-signature-error-description.d.ts +1 -1
  57. package/lib/constants/errors/validate-rfc/validate-rfc-error-code.d.ts +4 -1
  58. package/lib/constants/errors/validate-rfc/validate-rfc-error-description.d.ts +1 -1
  59. package/lib/constants/errors/validate-signature/validate-signature-error-code.d.ts +2 -1
  60. package/lib/constants/errors/validate-signature/validate-signature-error-description.d.ts +1 -1
  61. package/lib/models/configuration/index.d.ts +3 -0
  62. package/lib/models/configuration/pdf-viewer-fea/index.d.ts +1 -0
  63. package/lib/models/configuration/pdf-viewer-fea/pdf-viewer-fea.interface.d.ts +9 -0
  64. package/lib/models/configuration/signature-summary/index.d.ts +1 -0
  65. package/lib/models/configuration/signature-summary/signature-summary.interface.d.ts +6 -0
  66. package/lib/models/configuration/upload-e-signature/upload-e-signature-configuration.interface.d.ts +2 -0
  67. package/lib/models/customization/legends/index.d.ts +3 -0
  68. package/lib/models/customization/legends/pdf-viewer-fea/index.d.ts +1 -0
  69. package/lib/models/customization/legends/pdf-viewer-fea/pdf-viewer-fea-legends.interface.d.ts +3 -0
  70. package/lib/models/customization/legends/signature-summary/index.d.ts +1 -0
  71. package/lib/models/customization/legends/signature-summary/signature-summary-legends.interface.d.ts +8 -0
  72. package/lib/models/customization/style/index.d.ts +3 -0
  73. package/lib/models/customization/style/pdf-viewer-fea/index.d.ts +1 -0
  74. package/lib/models/customization/style/pdf-viewer-fea/pdf-viewer-fea-style.interface.d.ts +2 -0
  75. package/lib/models/customization/style/signature-summary/index.d.ts +1 -0
  76. package/lib/models/customization/style/signature-summary/signature-summary-style.interface.d.ts +2 -0
  77. package/lib/models/path-dependencies/index.d.ts +3 -0
  78. package/lib/models/path-dependencies/pdf-viewer-fea/index.d.ts +1 -0
  79. package/lib/models/path-dependencies/pdf-viewer-fea/pdf-viewer-fea-dependencies.interface.d.ts +9 -0
  80. package/lib/models/path-dependencies/signature-summary/index.d.ts +1 -0
  81. package/lib/models/path-dependencies/signature-summary/signature-summary-dependencies.interface.d.ts +7 -0
  82. package/lib/ng-fad-signature-fea.module.d.ts +10 -8
  83. package/package.json +3 -3
  84. package/public-api.d.ts +2 -0
@@ -1,22 +1,22 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, Component, Input, Output, ViewChild, NgModule } from '@angular/core';
2
+ import { Component, Input, ViewChild, EventEmitter, Output, NgModule } from '@angular/core';
3
3
  import * as i3 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
- import * as i1 from '@angular/forms';
5
+ import * as i1$1 from '@angular/forms';
6
6
  import { Validators, ReactiveFormsModule } from '@angular/forms';
7
- import * as i5 from '@fad-producto-portal/ng-fad-shared';
7
+ import * as i4 from '@fad-producto-portal/ng-fad-shared';
8
8
  import { ResponseError, SharedUtils, NgFadSharedModule } from '@fad-producto-portal/ng-fad-shared';
9
- import * as i4 from '@fad-producto/ng-fad-image-inline';
9
+ import * as i4$1 from '@fad-producto/ng-fad-image-inline';
10
10
  import { NgFadImageInlineModule } from '@fad-producto/ng-fad-image-inline';
11
- import * as i5$1 from '@fad-producto-portal/ng-fad-viewer';
11
+ import * as i2 from '@fad-producto-portal/ng-fad-viewer';
12
12
  import { GeneralPdfViewerComponent, NgFadViewerModule } from '@fad-producto-portal/ng-fad-viewer';
13
+ import * as i1 from '@fad-producto/ng-fad-pdf-reader';
14
+ import { NgFadPdfReaderService } from '@fad-producto/ng-fad-pdf-reader';
13
15
  import { Utils } from '@fad-producto-portal/fad-common/utils/utils';
14
16
  import { Configuration } from '@fad-producto-portal/fad-common/models/core';
15
- import * as i2 from '@angular/router';
16
- import * as i2$1 from '@fad-producto-portal/ng-fad-services';
17
17
  import { finalize } from 'rxjs';
18
- import * as i2$2 from '@fad-producto/ng-fad-pdf-reader';
19
- import { NgFadPdfReaderService } from '@fad-producto/ng-fad-pdf-reader';
18
+ import * as i2$1 from '@angular/router';
19
+ import * as i2$2 from '@fad-producto-portal/ng-fad-services';
20
20
 
21
21
  const DOCUMENT_APPROVAL_LIST_DEFAULT = {
22
22
  customization: {
@@ -177,6 +177,23 @@ const VALIDATE_SIGNATURE_CONFIGURATION_DEFAULT = {
177
177
  }
178
178
  };
179
179
 
180
+ const PDF_VIEWER_FEA_DEFAULT = {
181
+ pdfMini: {
182
+ configuration: {
183
+ scrollIntoView: true
184
+ }
185
+ },
186
+ customization: {
187
+ moduleCustomization: {
188
+ style: {},
189
+ legends: {}
190
+ }
191
+ },
192
+ pathDependencies: {
193
+ imageDirectory: 'assets/images/fad-signature-fea/pdf-viewer-fea/',
194
+ }
195
+ };
196
+
180
197
  var DocumentApprovalListErrorCode;
181
198
  (function (DocumentApprovalListErrorCode) {
182
199
  DocumentApprovalListErrorCode[DocumentApprovalListErrorCode["SERVICE"] = -1] = "SERVICE";
@@ -219,6 +236,7 @@ var UploadESignatureErrorCode;
219
236
  UploadESignatureErrorCode[UploadESignatureErrorCode["ERROR_BASE_64"] = -7] = "ERROR_BASE_64";
220
237
  UploadESignatureErrorCode[UploadESignatureErrorCode["NO_SIGNER_ID"] = -8] = "NO_SIGNER_ID";
221
238
  UploadESignatureErrorCode[UploadESignatureErrorCode["NO_RFC"] = -9] = "NO_RFC";
239
+ UploadESignatureErrorCode[UploadESignatureErrorCode["PASSWORD_ERROR"] = -10] = "PASSWORD_ERROR";
222
240
  })(UploadESignatureErrorCode || (UploadESignatureErrorCode = {}));
223
241
 
224
242
  const getUploadESignatureErrorDescription = (code) => {
@@ -241,6 +259,8 @@ const getUploadESignatureErrorDescription = (code) => {
241
259
  return "El ID del firmante es requerido";
242
260
  case -9:
243
261
  return "El RFC del firmante es requerido";
262
+ case -10:
263
+ return "La contraseña es incorrecta";
244
264
  default:
245
265
  return 'Unknown error';
246
266
  }
@@ -250,6 +270,9 @@ var ValidateRFCErrorCode;
250
270
  (function (ValidateRFCErrorCode) {
251
271
  ValidateRFCErrorCode[ValidateRFCErrorCode["SERVICE"] = -1] = "SERVICE";
252
272
  ValidateRFCErrorCode[ValidateRFCErrorCode["HTTP"] = -2] = "HTTP";
273
+ ValidateRFCErrorCode[ValidateRFCErrorCode["REQUISITION_ID"] = -3] = "REQUISITION_ID";
274
+ ValidateRFCErrorCode[ValidateRFCErrorCode["SIGNER_ID"] = -4] = "SIGNER_ID";
275
+ ValidateRFCErrorCode[ValidateRFCErrorCode["TICKET"] = -5] = "TICKET";
253
276
  })(ValidateRFCErrorCode || (ValidateRFCErrorCode = {}));
254
277
 
255
278
  const getValidateRFCErrorDescription = (code) => {
@@ -258,6 +281,12 @@ const getValidateRFCErrorDescription = (code) => {
258
281
  return "Service error";
259
282
  case -2:
260
283
  return "HTTP error";
284
+ case -3:
285
+ return "There is not requisitionId";
286
+ case -4:
287
+ return "There is not signerId";
288
+ case -5:
289
+ return "There is not Ticket";
261
290
  default:
262
291
  return 'Unknown error';
263
292
  }
@@ -269,6 +298,7 @@ var ValidateSignatureErrorCode;
269
298
  ValidateSignatureErrorCode[ValidateSignatureErrorCode["HTTP"] = -2] = "HTTP";
270
299
  ValidateSignatureErrorCode[ValidateSignatureErrorCode["NO_REQUISITION_ID"] = -3] = "NO_REQUISITION_ID";
271
300
  ValidateSignatureErrorCode[ValidateSignatureErrorCode["NO_SIGNER_ID"] = -4] = "NO_SIGNER_ID";
301
+ ValidateSignatureErrorCode[ValidateSignatureErrorCode["NO_TICKET"] = -5] = "NO_TICKET";
272
302
  })(ValidateSignatureErrorCode || (ValidateSignatureErrorCode = {}));
273
303
 
274
304
  const getValidateSignatureErrorDescription = (code) => {
@@ -279,13 +309,85 @@ const getValidateSignatureErrorDescription = (code) => {
279
309
  return "HTTP error";
280
310
  case -2:
281
311
  return "Requisition ID is required";
282
- case -3:
312
+ case -4:
283
313
  return "Signer ID is required";
314
+ case -5:
315
+ return "Ticket is required";
284
316
  default:
285
317
  return 'Unknown error';
286
318
  }
287
319
  };
288
320
 
321
+ class PdfViewerFeaComponent {
322
+ constructor(pdfService, cdr) {
323
+ this.pdfService = pdfService;
324
+ this.cdr = cdr;
325
+ this.pages = [];
326
+ this.page = 1;
327
+ this.miniViewConfig = { scrollIntoView: false };
328
+ this.height = 1000;
329
+ }
330
+ ngOnInit() {
331
+ if (this.file) {
332
+ this.initializePdf(this.file);
333
+ }
334
+ }
335
+ initializePdf(pdfBase64) {
336
+ this.pdfService.initialize(pdfBase64, `pdf-${this.index}`);
337
+ this.pdfService.pages.subscribe((res) => {
338
+ if (res) {
339
+ this.pages = [...this.pages, res];
340
+ }
341
+ });
342
+ }
343
+ onPageChange(page) {
344
+ this.page = page;
345
+ }
346
+ scrollToPage(page) {
347
+ this.generalPdfViewerComponent.scrollToPage(page);
348
+ }
349
+ onLoadPage(data) {
350
+ if (data.page === 1) {
351
+ const containerElement = document.getElementById(this.id);
352
+ if (!containerElement) {
353
+ return;
354
+ }
355
+ const observer = new MutationObserver(() => {
356
+ const viewerElement = containerElement.querySelector(`#fad-viewer-page-v1-${data.id}-1`);
357
+ if (viewerElement) {
358
+ observer.disconnect();
359
+ const newHeight = viewerElement.clientHeight + 30;
360
+ if (this.height !== newHeight) {
361
+ this.height = newHeight;
362
+ this.cdr.detectChanges();
363
+ }
364
+ }
365
+ });
366
+ observer.observe(containerElement, { childList: true, subtree: true });
367
+ }
368
+ }
369
+ setCustomizationStyle(targetElement = document.documentElement) {
370
+ this.configuration = Utils.mergeConfiguration(new Configuration(), PDF_VIEWER_FEA_DEFAULT, this.configuration);
371
+ }
372
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PdfViewerFeaComponent, deps: [{ token: i1.NgFadPdfReaderService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
373
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PdfViewerFeaComponent, selector: "ng-fad-signature-fea-pdf-viewer-fea", inputs: { configuration: "configuration", file: "file", index: "index", id: "id" }, providers: [NgFadPdfReaderService], viewQueries: [{ propertyName: "generalPdfViewerComponent", first: true, predicate: GeneralPdfViewerComponent, descendants: true }], ngImport: i0, template: "<div class=\"pdf-viewer\" [id]=\"id\" [style.height.px]=\"height\">\r\n <ng-fad-viewer-general-pdf-viewer\r\n [pages]=\"pages\"\r\n (onpagechange)=\"onPageChange($event)\"\r\n (onloadpage)=\"onLoadPage($event)\">\r\n \r\n <ng-fad-viewer-pdf-mini-view\r\n miniView\r\n [configuration]=\"miniViewConfig\"\r\n [pages]=\"pages\"\r\n [page]=\"page\"\r\n (onpagechange)=\"scrollToPage($event)\"\r\n >\r\n </ng-fad-viewer-pdf-mini-view>\r\n \r\n </ng-fad-viewer-general-pdf-viewer>\r\n</div>", styles: ["ng-fad-viewer-general-pdf-viewer{padding:var(--fad-portal-common-separation-md);box-sizing:border-box}\n"], dependencies: [{ kind: "component", type: i2.GeneralPdfViewerComponent, selector: "ng-fad-viewer-general-pdf-viewer", inputs: ["configuration", "onerror", "pages"], outputs: ["onpagechange", "onloadpage"] }, { kind: "component", type: i2.PdfMiniViewComponent, selector: "ng-fad-viewer-pdf-mini-view", inputs: ["configuration", "pages", "page"], outputs: ["onpagechange"] }] }); }
374
+ }
375
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PdfViewerFeaComponent, decorators: [{
376
+ type: Component,
377
+ args: [{ selector: 'ng-fad-signature-fea-pdf-viewer-fea', providers: [NgFadPdfReaderService], template: "<div class=\"pdf-viewer\" [id]=\"id\" [style.height.px]=\"height\">\r\n <ng-fad-viewer-general-pdf-viewer\r\n [pages]=\"pages\"\r\n (onpagechange)=\"onPageChange($event)\"\r\n (onloadpage)=\"onLoadPage($event)\">\r\n \r\n <ng-fad-viewer-pdf-mini-view\r\n miniView\r\n [configuration]=\"miniViewConfig\"\r\n [pages]=\"pages\"\r\n [page]=\"page\"\r\n (onpagechange)=\"scrollToPage($event)\"\r\n >\r\n </ng-fad-viewer-pdf-mini-view>\r\n \r\n </ng-fad-viewer-general-pdf-viewer>\r\n</div>", styles: ["ng-fad-viewer-general-pdf-viewer{padding:var(--fad-portal-common-separation-md);box-sizing:border-box}\n"] }]
378
+ }], ctorParameters: function () { return [{ type: i1.NgFadPdfReaderService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { configuration: [{
379
+ type: Input
380
+ }], file: [{
381
+ type: Input
382
+ }], index: [{
383
+ type: Input
384
+ }], id: [{
385
+ type: Input
386
+ }], generalPdfViewerComponent: [{
387
+ type: ViewChild,
388
+ args: [GeneralPdfViewerComponent]
389
+ }] } });
390
+
289
391
  class ValidateRfcComponent {
290
392
  constructor(fb, hostContext, route, fadService) {
291
393
  this.fb = fb;
@@ -293,19 +395,14 @@ class ValidateRfcComponent {
293
395
  this.route = route;
294
396
  this.fadService = fadService;
295
397
  this.onerror = new EventEmitter();
296
- this.onevent = new EventEmitter();
398
+ this.oncomplete = new EventEmitter();
399
+ this.onloader = new EventEmitter();
297
400
  this.showComponent = true;
298
- this.requisitionId = '';
299
- this.signerId = '';
300
401
  }
301
402
  ngOnInit() {
302
403
  this.setCustomizationStyle(this.hostContext.nativeElement);
404
+ this.showComponent = this.validateData();
303
405
  this.initializeForm();
304
- this.route.queryParams.subscribe(params => {
305
- this.requisitionId = params['req'];
306
- this.signerId = params['sign'];
307
- console.log(this.requisitionId, this.signerId);
308
- });
309
406
  }
310
407
  initializeForm() {
311
408
  const maxCharacters = this.configuration?.maxCharacters || 13;
@@ -325,43 +422,59 @@ class ValidateRfcComponent {
325
422
  setCustomizationStyle(targetElement = document.documentElement) {
326
423
  this.configuration = Utils.mergeConfiguration(new Configuration(), SIGNATURE_FEA_CONFIGURATION_DEFAULT, this.configuration);
327
424
  }
425
+ validateData() {
426
+ if (!this.ticket) {
427
+ this.onerror.emit(new ResponseError(ValidateRFCErrorCode.REQUISITION_ID, getValidateRFCErrorDescription(ValidateRFCErrorCode.REQUISITION_ID), 'ng-fad-portal-signature-fea-validate-rfc'));
428
+ return false;
429
+ }
430
+ return true;
431
+ }
328
432
  validateRFC() {
329
433
  if (this.validationForm.valid) {
330
434
  console.error("Validar rfc ");
331
435
  const validateReq = {
332
- requisitionId: this.requisitionId,
333
- signerId: this.signerId,
436
+ ticket: this.ticket,
334
437
  rfc: this.codeControl?.value
335
438
  };
336
- this.fadService.validateRfc(validateReq).subscribe({
439
+ this.fadService.validateRfc(validateReq)
440
+ .pipe(finalize(() => this.onloader.emit(false)))
441
+ .subscribe({
337
442
  next: (response) => {
338
443
  if (response.success) {
339
- this.onevent.emit(response);
444
+ this.oncomplete.emit(response);
340
445
  }
341
446
  else {
342
- this.onerror.emit(new ResponseError(ValidateRFCErrorCode.SERVICE, getValidateRFCErrorDescription(ValidateRFCErrorCode.SERVICE), 'ng-fad-portal-signature-fea-validate-rfc'));
447
+ this.onerror.emit(new ResponseError(ValidateRFCErrorCode.SERVICE, response.error, 'ng-fad-portal-signature-fea-validate-rfc'));
343
448
  }
344
449
  },
345
450
  error: (error) => {
346
- this.onerror.emit(new ResponseError(ValidateRFCErrorCode.HTTP, getValidateRFCErrorDescription(ValidateRFCErrorCode.HTTP), 'ng-fad-portal-signature-fea-validate-rfc'));
451
+ this.onerror.emit(new ResponseError(ValidateRFCErrorCode.HTTP, error.error, 'ng-fad-portal-signature-fea-validate-rfc'));
347
452
  }
348
453
  });
349
454
  }
350
455
  }
456
+ onInputChange(event) {
457
+ const inputValue = event.target.value;
458
+ this.validationForm.controls['code'].setValue(inputValue.toUpperCase(), { emitEvent: false });
459
+ }
351
460
  get codeControl() {
352
461
  return this.validationForm.get('code') ?? null;
353
462
  }
354
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ValidateRfcComponent, deps: [{ token: i1.FormBuilder }, { token: i0.ElementRef }, { token: i2.ActivatedRoute }, { token: i2$1.FadService }], target: i0.ɵɵFactoryTarget.Component }); }
355
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ValidateRfcComponent, selector: "ng-fad-signature-fea-validate-rfc", inputs: { configuration: "configuration" }, outputs: { onerror: "onerror", onevent: "onevent" }, ngImport: i0, template: "<div class=\"validation-container fad-container\" *ngIf=\"showComponent\">\r\n <div class=\"title\">{{ configuration.customization?.moduleCustomization?.legends?.title }}</div>\r\n <div class=\"fad-portal-subtitle\">{{ configuration.customization?.moduleCustomization?.legends?.description }}</div>\r\n <form [formGroup]=\"validationForm\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"fad-portal-container-input\">\r\n <input id=\"code\" type=\"text\" formControlName=\"code\" maxlength=\"{{ configuration.maxCharacters || 13 }}\" />\r\n </div>\r\n <ng-fad-portal-shared-form-errors \r\n [formData]=\"codeControl!\" \r\n [configuration]=\"configuration.formErrors?.configuration!\">\r\n </ng-fad-portal-shared-form-errors>\r\n\r\n <button type=\"submit\" class=\"fad-portal-primary\" [disabled]=\"validationForm.invalid\">\r\n {{ configuration.customization?.moduleCustomization?.legends?.buttonLegend }}\r\n </button>\r\n </form>\r\n</div>\r\n", styles: [".validation-container{width:100%;display:flex;flex-direction:column;align-items:start;row-gap:var(--fad-portal-common-separation-md)}@media (max-width: 992px){.validation-container{width:100%;align-items:center}}.validation-container .title{font-family:var(--fad-portal-common-title-font-family);font-size:var(--fad-portal-common-title-font-size)}.validation-container form{display:flex;flex-direction:column;width:100%}.validation-container form .fad-portal-container-input{display:flex;flex-direction:column;row-gap:var(--fad-portal-common-separation-xs)}.validation-container form .error-message{color:var(--fad-portal-common-error-color)}.validation-container form button{margin-top:var(--fad-portal-common-separation-md);cursor:pointer}.validation-container form button:disabled{cursor:auto}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i5.FormErrorsComponent, selector: "ng-fad-portal-shared-form-errors", inputs: ["configuration", "formData"], outputs: ["onerror"] }] }); }
463
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ValidateRfcComponent, deps: [{ token: i1$1.FormBuilder }, { token: i0.ElementRef }, { token: i2$1.ActivatedRoute }, { token: i2$2.FadService }], target: i0.ɵɵFactoryTarget.Component }); }
464
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ValidateRfcComponent, selector: "ng-fad-signature-fea-validate-rfc", inputs: { configuration: "configuration", ticket: "ticket" }, outputs: { onerror: "onerror", oncomplete: "oncomplete", onloader: "onloader" }, ngImport: i0, template: "\r\n <div class=\"validation-container fad-container\" *ngIf=\"showComponent\">\r\n <div class=\"title\">{{ configuration.customization?.moduleCustomization?.legends?.title }}</div>\r\n <div class=\"fad-portal-subtitle\">{{ configuration.customization?.moduleCustomization?.legends?.description }}</div>\r\n <form [formGroup]=\"validationForm\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"fad-portal-container-input\">\r\n <input id=\"code\" type=\"text\" formControlName=\"code\" (input)=\"onInputChange($event)\" maxlength=\"{{ configuration.maxCharacters || 13 }}\" />\r\n </div>\r\n <ng-fad-portal-shared-form-errors \r\n [formData]=\"codeControl!\" \r\n [configuration]=\"configuration.formErrors?.configuration!\">\r\n </ng-fad-portal-shared-form-errors>\r\n \r\n <button type=\"submit\" class=\"fad-portal-primary\" [disabled]=\"validationForm.invalid\">\r\n {{ configuration.customization?.moduleCustomization?.legends?.buttonLegend }}\r\n </button>\r\n </form>\r\n </div>\r\n\r\n\r\n", styles: [".validation-container{width:100%;display:flex;flex-direction:column;align-items:start;row-gap:var(--fad-portal-common-separation-md)}@media (max-width: 992px){.validation-container{width:100%;align-items:center}}.validation-container .title{font-family:var(--fad-portal-common-title-font-family);font-size:var(--fad-portal-common-title-font-size)}.validation-container form{display:flex;flex-direction:column;width:100%}.validation-container form .fad-portal-container-input{display:flex;flex-direction:column;row-gap:var(--fad-portal-common-separation-xs)}.validation-container form .error-message{color:var(--fad-portal-common-error-color)}.validation-container form button{margin-top:var(--fad-portal-common-separation-md);cursor:pointer}.validation-container form button:disabled{cursor:auto}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.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$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.FormErrorsComponent, selector: "ng-fad-portal-shared-form-errors", inputs: ["configuration", "formData"], outputs: ["onerror"] }] }); }
356
465
  }
357
466
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ValidateRfcComponent, decorators: [{
358
467
  type: Component,
359
- args: [{ selector: 'ng-fad-signature-fea-validate-rfc', template: "<div class=\"validation-container fad-container\" *ngIf=\"showComponent\">\r\n <div class=\"title\">{{ configuration.customization?.moduleCustomization?.legends?.title }}</div>\r\n <div class=\"fad-portal-subtitle\">{{ configuration.customization?.moduleCustomization?.legends?.description }}</div>\r\n <form [formGroup]=\"validationForm\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"fad-portal-container-input\">\r\n <input id=\"code\" type=\"text\" formControlName=\"code\" maxlength=\"{{ configuration.maxCharacters || 13 }}\" />\r\n </div>\r\n <ng-fad-portal-shared-form-errors \r\n [formData]=\"codeControl!\" \r\n [configuration]=\"configuration.formErrors?.configuration!\">\r\n </ng-fad-portal-shared-form-errors>\r\n\r\n <button type=\"submit\" class=\"fad-portal-primary\" [disabled]=\"validationForm.invalid\">\r\n {{ configuration.customization?.moduleCustomization?.legends?.buttonLegend }}\r\n </button>\r\n </form>\r\n</div>\r\n", styles: [".validation-container{width:100%;display:flex;flex-direction:column;align-items:start;row-gap:var(--fad-portal-common-separation-md)}@media (max-width: 992px){.validation-container{width:100%;align-items:center}}.validation-container .title{font-family:var(--fad-portal-common-title-font-family);font-size:var(--fad-portal-common-title-font-size)}.validation-container form{display:flex;flex-direction:column;width:100%}.validation-container form .fad-portal-container-input{display:flex;flex-direction:column;row-gap:var(--fad-portal-common-separation-xs)}.validation-container form .error-message{color:var(--fad-portal-common-error-color)}.validation-container form button{margin-top:var(--fad-portal-common-separation-md);cursor:pointer}.validation-container form button:disabled{cursor:auto}\n"] }]
360
- }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i0.ElementRef }, { type: i2.ActivatedRoute }, { type: i2$1.FadService }]; }, propDecorators: { configuration: [{
468
+ args: [{ selector: 'ng-fad-signature-fea-validate-rfc', template: "\r\n <div class=\"validation-container fad-container\" *ngIf=\"showComponent\">\r\n <div class=\"title\">{{ configuration.customization?.moduleCustomization?.legends?.title }}</div>\r\n <div class=\"fad-portal-subtitle\">{{ configuration.customization?.moduleCustomization?.legends?.description }}</div>\r\n <form [formGroup]=\"validationForm\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"fad-portal-container-input\">\r\n <input id=\"code\" type=\"text\" formControlName=\"code\" (input)=\"onInputChange($event)\" maxlength=\"{{ configuration.maxCharacters || 13 }}\" />\r\n </div>\r\n <ng-fad-portal-shared-form-errors \r\n [formData]=\"codeControl!\" \r\n [configuration]=\"configuration.formErrors?.configuration!\">\r\n </ng-fad-portal-shared-form-errors>\r\n \r\n <button type=\"submit\" class=\"fad-portal-primary\" [disabled]=\"validationForm.invalid\">\r\n {{ configuration.customization?.moduleCustomization?.legends?.buttonLegend }}\r\n </button>\r\n </form>\r\n </div>\r\n\r\n\r\n", styles: [".validation-container{width:100%;display:flex;flex-direction:column;align-items:start;row-gap:var(--fad-portal-common-separation-md)}@media (max-width: 992px){.validation-container{width:100%;align-items:center}}.validation-container .title{font-family:var(--fad-portal-common-title-font-family);font-size:var(--fad-portal-common-title-font-size)}.validation-container form{display:flex;flex-direction:column;width:100%}.validation-container form .fad-portal-container-input{display:flex;flex-direction:column;row-gap:var(--fad-portal-common-separation-xs)}.validation-container form .error-message{color:var(--fad-portal-common-error-color)}.validation-container form button{margin-top:var(--fad-portal-common-separation-md);cursor:pointer}.validation-container form button:disabled{cursor:auto}\n"] }]
469
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: i0.ElementRef }, { type: i2$1.ActivatedRoute }, { type: i2$2.FadService }]; }, propDecorators: { configuration: [{
470
+ type: Input
471
+ }], ticket: [{
361
472
  type: Input
362
473
  }], onerror: [{
363
474
  type: Output
364
- }], onevent: [{
475
+ }], oncomplete: [{
476
+ type: Output
477
+ }], onloader: [{
365
478
  type: Output
366
479
  }] } });
367
480
 
@@ -388,13 +501,6 @@ class DocumentApprovalListComponent {
388
501
  approve: ''
389
502
  }
390
503
  };
391
- this.pdfSrc = 'assets/pdf/one-drive.pdf';
392
- this.pages = [];
393
- this.page = 1;
394
- this.height = '500px';
395
- this.miniView = {
396
- scrollIntoView: false
397
- };
398
504
  }
399
505
  ngOnInit() {
400
506
  console.log(this.configuration, this.rfc);
@@ -423,6 +529,10 @@ class DocumentApprovalListComponent {
423
529
  approved: undefined,
424
530
  isVisible: false
425
531
  })));
532
+ if (this.documentsApprovalList.length === 1) {
533
+ this.loadSingleDocument(this.documentsApprovalList[0]);
534
+ }
535
+ this.cdr.detectChanges();
426
536
  }
427
537
  else {
428
538
  this.onerror.emit(new ResponseError(DocumentApprovalListErrorCode.SERVICE, getDocumentApprovalListErrorDescription(DocumentApprovalListErrorCode.SERVICE), 'ng-fad-portal-signature-fea-document-approval-list'));
@@ -433,6 +543,22 @@ class DocumentApprovalListComponent {
433
543
  }
434
544
  });
435
545
  }
546
+ loadSingleDocument(singleDocument) {
547
+ singleDocument.isVisible = true;
548
+ this.fad.getDocumentFea(singleDocument.id, { loader: true, error: true })
549
+ .pipe(finalize(() => this.onloader.emit(false)))
550
+ .subscribe({
551
+ next: (res) => {
552
+ if (singleDocument.doc) {
553
+ singleDocument.doc.file = "data:application/pdf;base64," + res.data.file;
554
+ this.cdr.detectChanges();
555
+ }
556
+ },
557
+ error: () => {
558
+ this.onerror.emit(new ResponseError(DocumentApprovalListErrorCode.ERROR_PDF, getDocumentApprovalListErrorDescription(DocumentApprovalListErrorCode.ERROR_PDF), 'ng-fad-portal-signature-fea-document-approval-list'));
559
+ }
560
+ });
561
+ }
436
562
  toggleApproval(document) {
437
563
  document.approved = document.approved === true ? undefined : true;
438
564
  this.updateApproveAllState();
@@ -461,24 +587,20 @@ class DocumentApprovalListComponent {
461
587
  }
462
588
  seeDocumentFea(document) {
463
589
  document.isVisible = !document.isVisible;
464
- if (document.isVisible) {
590
+ if (document.isVisible && !document.doc?.file) {
465
591
  this.onloader.emit(true);
466
592
  this.fad.getDocumentFea(document.id, { loader: true, error: true })
467
593
  .pipe(finalize(() => this.onloader.emit(false)))
468
594
  .subscribe({
469
595
  next: (res) => {
470
596
  if (document.doc) {
471
- const byteCharacters = atob(res.data.file);
472
- const byteNumbers = new Array(byteCharacters.length).fill(0).map((_, i) => byteCharacters.charCodeAt(i));
473
- const byteArray = new Uint8Array(byteNumbers);
474
- const blob = new Blob([byteArray], { type: 'application/pdf' });
475
- this.getBase64(blob, document);
597
+ document.doc.file = "data:application/pdf;base64," + res.data.file;
476
598
  }
477
599
  else {
478
600
  this.onerror.emit(new ResponseError(DocumentApprovalListErrorCode.SERVICE, getDocumentApprovalListErrorDescription(DocumentApprovalListErrorCode.SERVICE), 'ng-fad-portal-signature-fea-document-approval-list'));
479
601
  }
480
602
  },
481
- error: (error) => {
603
+ error: () => {
482
604
  this.onerror.emit(new ResponseError(DocumentApprovalListErrorCode.HTTP, getDocumentApprovalListErrorDescription(DocumentApprovalListErrorCode.HTTP), 'ng-fad-portal-signature-fea-document-approval-list'));
483
605
  }
484
606
  });
@@ -489,18 +611,16 @@ class DocumentApprovalListComponent {
489
611
  this.fad.getDocumentFea(document.id)
490
612
  .pipe(finalize(() => this.onloader.emit(false)))
491
613
  .subscribe({
492
- next: (res) => {
614
+ next: async (res) => {
493
615
  if (res.success && res.data.file) {
494
616
  const byteCharacters = atob(res.data.file);
495
617
  const byteNumbers = new Array(byteCharacters.length).fill(0).map((_, i) => byteCharacters.charCodeAt(i));
496
618
  const byteArray = new Uint8Array(byteNumbers);
497
619
  const blob = new Blob([byteArray], { type: 'application/pdf' });
498
- const link = window.document.createElement('a');
499
- link.href = URL.createObjectURL(blob);
500
- link.download = document.doc?.name || 'document.pdf';
501
- window.document.body.appendChild(link);
502
- link.click();
503
- window.document.body.removeChild(link);
620
+ await SharedUtils.downloadFile(blob, document.doc?.name).then(res => {
621
+ }).catch(error => {
622
+ this.onerror.emit(new ResponseError(DocumentApprovalListErrorCode.ERROR_PDF, getDocumentApprovalListErrorDescription(DocumentApprovalListErrorCode.ERROR_PDF), 'ng-fad-portal-signature-fea-document-approval-list'));
623
+ });
504
624
  }
505
625
  else {
506
626
  this.onerror.emit(new ResponseError(DocumentApprovalListErrorCode.SERVICE, getDocumentApprovalListErrorDescription(DocumentApprovalListErrorCode.SERVICE), 'ng-fad-portal-signature-fea-document-approval-list'));
@@ -511,68 +631,19 @@ class DocumentApprovalListComponent {
511
631
  }
512
632
  });
513
633
  }
514
- async getBase64(blob, document) {
515
- console.log(blob);
516
- const data = new File([blob], 'file.pdf', { type: 'application/pdf' });
517
- const base64 = await SharedUtils.fileToBase64(data);
518
- if (base64) {
519
- this.initializePdf(base64, document);
520
- }
521
- else {
522
- this.onerror.emit(new ResponseError(DocumentApprovalListErrorCode.ERROR_PDF, getDocumentApprovalListErrorDescription(DocumentApprovalListErrorCode.HTTP), 'ng-fad-portal-signature-fea-document-approval-list'));
523
- }
524
- }
525
- initializePdf(pdf, document) {
526
- if (!this.pagesMap.has(document.id)) {
527
- this.pagesMap.set(document.id, []);
528
- }
529
- else {
530
- this.pagesMap.get(document.id).length = 0;
531
- }
532
- this.pdfService.initialize(pdf, SharedUtils.generateUUID());
533
- this.getPages(document);
534
- }
535
- getPages(document) {
536
- if (!this.pagesMap.has(document.id)) {
537
- this.pagesMap.set(document.id, []);
538
- }
539
- else {
540
- this.pagesMap.get(document.id).length = 0;
541
- }
542
- if (this.pdfLibrary) {
543
- this.pdfLibrary.unsubscribe();
544
- }
545
- this.pdfLibrary = this.pdfService.pages.subscribe(res => {
546
- const docPages = this.pagesMap.get(document.id);
547
- docPages.push(res);
548
- this.cdr.detectChanges();
549
- });
550
- }
551
- //PDF General viewer methods
552
- onpagechange(page) {
553
- this.page = page;
554
- }
555
- scrollToPage(page) {
556
- this.generalPdfViewerComponent.scrollToPage(page);
557
- }
558
- onloadpage(data) {
559
- if (data.page == 1) {
560
- const id = "fad-viewer-page-v1-1";
561
- const dynamicDiv = document.getElementById(id);
562
- ;
563
- this.height = dynamicDiv.clientHeight + 'px';
564
- }
634
+ getDocumentId(id) {
635
+ return "pdf" + id.replace(/-/g, '');
565
636
  }
566
637
  setCustomizationStyle(targetElement = document.documentElement) {
567
638
  this.configuration = Utils.mergeConfiguration(new Configuration(), DOCUMENT_APPROVAL_LIST_DEFAULT, this.configuration);
568
639
  }
569
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DocumentApprovalListComponent, deps: [{ token: i0.ElementRef }, { token: i2$1.FadService }, { token: i0.ChangeDetectorRef }, { token: i2$2.NgFadPdfReaderService }], target: i0.ɵɵFactoryTarget.Component }); }
570
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DocumentApprovalListComponent, selector: "ng-fad-signature-fea-document-approval-list", inputs: { configuration: "configuration", rfc: "rfc" }, outputs: { onloader: "onloader", onevent: "onevent", onerror: "onerror" }, providers: [NgFadPdfReaderService], viewQueries: [{ propertyName: "generalPdfViewerComponent", first: true, predicate: GeneralPdfViewerComponent, descendants: true }], ngImport: i0, template: "\r\n <ng-container *ngFor=\"let requisition of requisitionsFea\">\r\n <div class=\"fad-portal-content\" >\r\n <div class=\"header\" >\r\n <div>\r\n <div class=\"fad-portal-title\">\r\n {{ requisition.name }} ({{requisition.documents.length}})\r\n </div>\r\n <div class=\"info\">\r\n {{configuration.customization?.moduleCustomization?.legends?.sendTo}} Alfredo Villanueva {{ requisition.sendBy }}\r\n </div>\r\n <div class=\"info\">\r\n {{ requisition.sendByEmail }}\r\n </div>\r\n </div>\r\n <div class=\"requisition-id\">\r\n <div class=\"fad-portal-subtitle-bold\">ID {{ requisition.requisitionId }}</div>\r\n </div>\r\n </div>\r\n <div class=\"documents-container\">\r\n <ng-container *ngFor=\"let document of documentsApprovalList\">\r\n <ng-container *ngIf=\"document.idRequisition === requisition.requisitionId\" >\r\n <div class=\"document\" >\r\n <div class=\"information\" >\r\n <div class=\"document-name fad-portal-subtitle-bold\" >\r\n {{ document.doc?.name }}\r\n </div>\r\n <div class=\"validate\">\r\n \r\n <ng-fad-image-inline \r\n [src]=\"document.approved === false ? images.active.reject : images.inactive.reject\"\r\n (click)=\"toggleRejection(document)\">\r\n </ng-fad-image-inline>\r\n \r\n \r\n <ng-fad-image-inline \r\n [src]=\"document.approved === true ? images.active.approve : images.inactive.approve\"\r\n (click)=\"toggleApproval(document)\">\r\n </ng-fad-image-inline>\r\n </div>\r\n \r\n </div>\r\n <div class=\"actions\">\r\n <div>\r\n <div class=\"fad-portal-subtitle-bold\" (click)=\"seeDocumentFea(document)\">\r\n {{ document.isVisible ? 'Ocultar documento' : 'Ver documento' }}\r\n </div>\r\n <div class=\"fad-portal-subtitle-bold\" (click)=\"downloadDocumentFea(document)\">{{configuration.customization?.moduleCustomization?.legends?.download}}</div>\r\n </div>\r\n <div>\r\n {{ document.doc?.pages }} {{configuration.customization?.moduleCustomization?.legends?.pages}}\r\n </div>\r\n </div>\r\n <div class=\"pdf-viewer\" *ngIf=\"document.isVisible\" [style.height.px]=\"1000\">\r\n <ng-fad-viewer-general-pdf-viewer\r\n [pages]=\"pagesMap.get(document.id!) ?? []\"\r\n (onpagechange)=\"onpagechange($event)\"\r\n (onloadpage)=\"onloadpage($event)\">\r\n \r\n <ng-fad-viewer-pdf-mini-view\r\n miniView\r\n [configuration]=\"miniView\"\r\n [pages]=\"pagesMap.get(document.id!) ?? []\"\r\n [page]=\"page\"\r\n (onpagechange)=\"scrollToPage($event)\">\r\n </ng-fad-viewer-pdf-mini-view>\r\n \r\n </ng-fad-viewer-general-pdf-viewer>\r\n </div>\r\n \r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n \r\n </div>\r\n \r\n </div>\r\n </ng-container>\r\n <div class=\"fad-portal-content selector-document\">\r\n <div class=\"document-status-bar\">\r\n \r\n <div *ngIf=\"getApprovedCount() === 0 && getRejectedCount() === 0\" class=\"document-status-message \">\r\n Aprueba los documentos para firmarlos con tu e.firma\r\n </div>\r\n \r\n \r\n <div *ngIf=\"getApprovedCount() > 0 || getRejectedCount() > 0\" class=\"document-status-content\">\r\n <div class=\"approve-all\">\r\n <ng-fad-image-inline \r\n [src]=\"approveAll ? images.active.approve : images.inactive.approve\"\r\n (click)=\"approveAllDocuments()\">\r\n </ng-fad-image-inline>\r\n <span (click)=\"approveAllDocuments()\">Aprobar todos los documentos ({{ documentsApprovalList.length }})</span>\r\n </div>\r\n \r\n \r\n <div class=\"document-counts\">\r\n <span *ngIf=\"getApprovedCount() > 0 && getRejectedCount() === 0\" class=\"fad-portal-informative-bold\">\r\n {{ getApprovedCount() }} documentos aprobados\r\n </span>\r\n <span *ngIf=\"getRejectedCount() > 0 && getApprovedCount() === 0\" class=\"fad-portal-informative-bold\">\r\n {{ getRejectedCount() }} documentos rechazados\r\n </span>\r\n \r\n <ng-container *ngIf=\"getApprovedCount() > 0 && getRejectedCount() > 0\" >\r\n <span class=\"fad-portal-informative-bold\">\r\n {{ getApprovedCount() }} documentos aprobados\r\n </span>\r\n <span class=\"fad-portal-informative-bold\">\r\n {{ getRejectedCount() }} documentos rechazados\r\n </span>\r\n </ng-container>\r\n </div>\r\n \r\n \r\n <button class=\"fad-portal-primary\" (click)=\"emitApprovedDocuments()\">Continuar</button>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n\r\n", styles: [":host{box-sizing:border-box}:host .fad-portal-content{display:flex;flex-direction:column;justify-content:center;width:100%;box-sizing:border-box;margin-top:var(--fad-portal-common-separation-lg)}:host .fad-portal-content .header{display:flex;align-items:center;justify-content:space-between;width:100%;background-color:#f5f5f5;border-radius:var(--fad-portal-common-input-border-radius);padding:var(--fad-portal-common-separation-md);overflow:hidden;box-sizing:border-box}:host .fad-portal-content .header div:nth-child(1){display:flex;flex-direction:column;row-gap:var(--fad-portal-common-separation-xs)}:host .fad-portal-content .header .info{color:var(--fad-portal-common-tertiary-color)}@media (max-width: 992px){:host .fad-portal-content .header{flex-direction:column;align-items:start;justify-content:center;row-gap:var(--fad-portal-common-separation-xs);margin-bottom:var(--fad-portal-common-separation-md)}}:host .fad-portal-content .documents-container{box-sizing:border-box}:host .fad-portal-content .documents-container .document{display:flex;align-items:center;flex-direction:column;width:100%;margin-top:var(--fad-portal-common-separation-md);border-radius:var(--fad-portal-common-input-border-radius);border:1px solid #f5f5f5}:host .fad-portal-content .documents-container .document .information{padding:var(--fad-portal-common-separation-md);display:flex;align-items:center;justify-content:space-between;width:100%}:host .fad-portal-content .documents-container .document .information .validate{padding-left:var(--fad-portal-common-separation-md);padding-right:var(--fad-portal-common-separation-md);display:flex;column-gap:var(--fad-portal-common-separation-md)}:host .fad-portal-content .documents-container .document .information .document-name{padding-left:var(--fad-portal-common-separation-md);padding-right:var(--fad-portal-common-separation-md)}:host .fad-portal-content .documents-container .document .actions{display:flex;align-items:center;justify-content:space-between;width:100%;background-color:#f5f5f5;padding:var(--fad-portal-common-separation-md);box-sizing:border-box;border-radius:var(--fad-portal-common-input-border-radius);border-top-left-radius:0;border-top-right-radius:0}:host .fad-portal-content .documents-container .document .actions div:nth-child(1){display:flex;align-items:center;gap:var(--fad-portal-common-separation-md)}:host .fad-portal-content .documents-container .document .actions div:nth-child(1) div{color:var(--fad-portal-common-primary-color)!important;cursor:pointer}:host .selector-document{width:100%;background-color:#262626;color:#fff;padding:var(--fad-portal-common-separation-md);margin-top:var(--fad-portal-common-separation-md);display:flex;align-items:center;justify-content:space-between;border-radius:var(--fad-portal-common-input-border-radius);box-sizing:border-box}:host .selector-document .document-status-message{display:flex;align-items:center;justify-content:center;width:100%;gap:var(--fad-portal-common-separation-md)}:host .selector-document .document-status-bar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;width:100%;font-size:14px;box-sizing:border-box}:host .selector-document .document-status-bar .document-status-content{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;width:100%;font-size:14px;box-sizing:border-box}:host .selector-document .document-status-bar .approve-all{display:flex;align-items:center;gap:10px;cursor:pointer;box-sizing:border-box}:host .selector-document .document-status-bar .approve-all span{cursor:pointer;-webkit-user-select:none;user-select:none}:host .selector-document .document-status-bar .document-counts{display:flex;flex-direction:column;gap:var(--fad-portal-common-separation-xs);box-sizing:border-box}:host .selector-document .document-status-bar .document-counts span{color:#fff}:host .selector-document .document-status-bar .fad-portal-primary{min-width:0px;width:50%}@media (max-width: 992px){:host .selector-document .document-status-bar .fad-portal-primary{width:100%;margin-top:var(--fad-portal-common-separation-md)}}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.NgFadImageInlineComponent, selector: "ng-fad-image-inline", inputs: ["src"] }, { kind: "component", type: i5$1.GeneralPdfViewerComponent, selector: "ng-fad-viewer-general-pdf-viewer", inputs: ["configuration", "onerror", "pages"], outputs: ["onpagechange", "onloadpage"] }, { kind: "component", type: i5$1.PdfMiniViewComponent, selector: "ng-fad-viewer-pdf-mini-view", inputs: ["configuration", "pages", "page"], outputs: ["onpagechange"] }] }); }
640
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DocumentApprovalListComponent, deps: [{ token: i0.ElementRef }, { token: i2$2.FadService }, { token: i0.ChangeDetectorRef }, { token: i1.NgFadPdfReaderService }], target: i0.ɵɵFactoryTarget.Component }); }
641
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DocumentApprovalListComponent, selector: "ng-fad-signature-fea-document-approval-list", inputs: { configuration: "configuration", rfc: "rfc" }, outputs: { onloader: "onloader", onevent: "onevent", onerror: "onerror" }, providers: [NgFadPdfReaderService], ngImport: i0, template: "<ng-container *ngIf=\"requisitionsFea && requisitionsFea.length > 0\">\r\n <ng-container *ngFor=\"let requisition of requisitionsFea\">\r\n <div class=\"fad-portal-content\" >\r\n <div class=\"header\" >\r\n <div>\r\n <div class=\"fad-portal-title\">\r\n {{ requisition.name }} ({{requisition.documents.length}})\r\n </div>\r\n <div class=\"info\">\r\n {{configuration.customization?.moduleCustomization?.legends?.sendTo}} Alfredo Villanueva {{ requisition.sendBy }}\r\n </div>\r\n <div class=\"info\">\r\n {{ requisition.sendByEmail }}\r\n </div>\r\n </div>\r\n <div class=\"requisition-id\">\r\n <div class=\"fad-portal-content-bold\">ID {{ requisition.requisitionId }}</div>\r\n </div>\r\n </div>\r\n <div class=\"documents-container\">\r\n <ng-container *ngFor=\"let document of documentsApprovalList; let i = index\">\r\n <ng-container *ngIf=\"document.idRequisition === requisition.requisitionId\" >\r\n <div class=\"document\" >\r\n <div class=\"information\" >\r\n <div class=\"document-name fad-portal-content-bold\" >\r\n {{ document.doc?.name }}\r\n </div>\r\n <div class=\"validate\">\r\n \r\n <ng-fad-image-inline\r\n [src]=\"document.approved === false ? images.active.reject : images.inactive.reject\"\r\n (click)=\"toggleRejection(document)\">\r\n </ng-fad-image-inline>\r\n \r\n \r\n <ng-fad-image-inline\r\n [src]=\"document.approved === true ? images.active.approve : images.inactive.approve\"\r\n (click)=\"toggleApproval(document)\">\r\n </ng-fad-image-inline>\r\n </div>\r\n \r\n </div>\r\n <div class=\"actions\">\r\n <div>\r\n <div class=\"fad-portal-content-bold\" (click)=\"seeDocumentFea(document)\">\r\n {{ document.isVisible ? 'Ocultar documento' : 'Ver documento' }}\r\n </div>\r\n <div class=\"fad-portal-content-bold\" (click)=\"downloadDocumentFea(document)\">{{configuration.customization?.moduleCustomization?.legends?.download}}</div>\r\n </div>\r\n <div>\r\n {{ document.doc?.pages }} {{configuration.customization?.moduleCustomization?.legends?.pages}}\r\n </div>\r\n </div>\r\n \r\n <ng-fad-signature-fea-pdf-viewer-fea\r\n *ngIf=\"document.isVisible && document.doc?.file\"\r\n [file]=\"document.doc?.file\"\r\n [index]=\"i\"\r\n [id]=\"getDocumentId(document.id!)\"\r\n >\r\n </ng-fad-signature-fea-pdf-viewer-fea>\r\n \r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n \r\n </div>\r\n \r\n </div>\r\n </ng-container>\r\n <div class=\"fad-portal-content selector-document\">\r\n <div class=\"document-status-bar\">\r\n \r\n <div *ngIf=\"getApprovedCount() === 0 && getRejectedCount() === 0\" class=\"document-status-message \">\r\n Aprueba los documentos para firmarlos con tu e.firma\r\n </div>\r\n \r\n \r\n <div *ngIf=\"getApprovedCount() > 0 || getRejectedCount() > 0\" class=\"document-status-content\">\r\n <div class=\"approve-all\">\r\n <ng-fad-image-inline\r\n [src]=\"approveAll ? images.active.approve : images.inactive.approve\"\r\n (click)=\"approveAllDocuments()\">\r\n </ng-fad-image-inline>\r\n <span (click)=\"approveAllDocuments()\">Aprobar todos los documentos ({{ documentsApprovalList.length }})</span>\r\n </div>\r\n \r\n \r\n <div class=\"document-counts\">\r\n <span *ngIf=\"getApprovedCount() > 0 && getRejectedCount() === 0\" class=\"fad-portal-informative-bold\">\r\n {{ getApprovedCount() }} documentos aprobados\r\n </span>\r\n <span *ngIf=\"getRejectedCount() > 0 && getApprovedCount() === 0\" class=\"fad-portal-informative-bold\">\r\n {{ getRejectedCount() }} documentos rechazados\r\n </span>\r\n \r\n <ng-container *ngIf=\"getApprovedCount() > 0 && getRejectedCount() > 0\" >\r\n <span class=\"fad-portal-informative-bold\">\r\n {{ getApprovedCount() }} documentos aprobados\r\n </span>\r\n <span class=\"fad-portal-informative-bold\">\r\n {{ getRejectedCount() }} documentos rechazados\r\n </span>\r\n </ng-container>\r\n </div>\r\n \r\n \r\n <button class=\"fad-portal-primary\" (click)=\"emitApprovedDocuments()\">Continuar</button>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n </ng-container>\r\n ", styles: [":host{box-sizing:border-box}:host .fad-portal-content{display:flex;flex-direction:column;justify-content:center;width:100%;box-sizing:border-box;margin-top:var(--fad-portal-common-separation-lg)}:host .fad-portal-content .header{display:flex;align-items:center;justify-content:space-between;width:100%;background-color:#f5f5f5;border-radius:var(--fad-portal-common-input-border-radius);padding:var(--fad-portal-common-separation-md);overflow:hidden;box-sizing:border-box}:host .fad-portal-content .header div:nth-child(1){display:flex;flex-direction:column;row-gap:var(--fad-portal-common-separation-xs)}:host .fad-portal-content .header .info{color:var(--fad-portal-common-tertiary-color)}@media (max-width: 992px){:host .fad-portal-content .header{flex-direction:column;align-items:start;justify-content:center;row-gap:var(--fad-portal-common-separation-xs);margin-bottom:var(--fad-portal-common-separation-md)}}:host .fad-portal-content .documents-container{box-sizing:border-box}:host .fad-portal-content .documents-container .document{display:flex;align-items:center;flex-direction:column;width:100%;margin-top:var(--fad-portal-common-separation-md);border-radius:var(--fad-portal-common-input-border-radius);border:1px solid #f5f5f5}:host .fad-portal-content .documents-container .document .information{padding:var(--fad-portal-common-separation-md);display:flex;align-items:center;justify-content:space-between;width:100%}:host .fad-portal-content .documents-container .document .information .validate{padding-left:var(--fad-portal-common-separation-md);padding-right:var(--fad-portal-common-separation-md);display:flex;column-gap:var(--fad-portal-common-separation-md)}:host .fad-portal-content .documents-container .document .information .document-name{padding-left:var(--fad-portal-common-separation-md);padding-right:var(--fad-portal-common-separation-md)}:host .fad-portal-content .documents-container .document .actions{display:flex;align-items:center;justify-content:space-between;width:100%;background-color:#f5f5f5;padding:var(--fad-portal-common-separation-md);box-sizing:border-box;border-radius:var(--fad-portal-common-input-border-radius);border-top-left-radius:0;border-top-right-radius:0}:host .fad-portal-content .documents-container .document .actions div:nth-child(1){display:flex;align-items:center;gap:var(--fad-portal-common-separation-md)}:host .fad-portal-content .documents-container .document .actions div:nth-child(1) div{color:var(--fad-portal-common-primary-color)!important;cursor:pointer}:host .selector-document{width:100%;background-color:var(--fad-portal-common-tertiary-color);color:#fff;padding:var(--fad-portal-common-separation-md);margin-top:var(--fad-portal-common-separation-md);display:flex;align-items:center;justify-content:space-between;border-radius:var(--fad-portal-common-input-border-radius);box-sizing:border-box}:host .selector-document .document-status-message{display:flex;align-items:center;justify-content:center;width:100%;gap:var(--fad-portal-common-separation-md)}:host .selector-document .document-status-bar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;width:100%;font-size:14px;box-sizing:border-box}:host .selector-document .document-status-bar .document-status-content{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;width:100%;font-size:14px;box-sizing:border-box}:host .selector-document .document-status-bar .approve-all{display:flex;align-items:center;gap:10px;cursor:pointer;box-sizing:border-box}:host .selector-document .document-status-bar .approve-all span{cursor:pointer;-webkit-user-select:none;user-select:none}:host .selector-document .document-status-bar .document-counts{display:flex;flex-direction:column;gap:var(--fad-portal-common-separation-xs);box-sizing:border-box}:host .selector-document .document-status-bar .document-counts span{color:#fff}:host .selector-document .document-status-bar .fad-portal-primary{min-width:0px;width:50%}@media (max-width: 992px){:host .selector-document .document-status-bar .fad-portal-primary{width:100%;margin-top:var(--fad-portal-common-separation-md)}}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4$1.NgFadImageInlineComponent, selector: "ng-fad-image-inline", inputs: ["src"] }, { kind: "component", type: PdfViewerFeaComponent, selector: "ng-fad-signature-fea-pdf-viewer-fea", inputs: ["configuration", "file", "index", "id"] }] }); }
571
642
  }
572
643
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DocumentApprovalListComponent, decorators: [{
573
644
  type: Component,
574
- args: [{ selector: 'ng-fad-signature-fea-document-approval-list', providers: [NgFadPdfReaderService], template: "\r\n <ng-container *ngFor=\"let requisition of requisitionsFea\">\r\n <div class=\"fad-portal-content\" >\r\n <div class=\"header\" >\r\n <div>\r\n <div class=\"fad-portal-title\">\r\n {{ requisition.name }} ({{requisition.documents.length}})\r\n </div>\r\n <div class=\"info\">\r\n {{configuration.customization?.moduleCustomization?.legends?.sendTo}} Alfredo Villanueva {{ requisition.sendBy }}\r\n </div>\r\n <div class=\"info\">\r\n {{ requisition.sendByEmail }}\r\n </div>\r\n </div>\r\n <div class=\"requisition-id\">\r\n <div class=\"fad-portal-subtitle-bold\">ID {{ requisition.requisitionId }}</div>\r\n </div>\r\n </div>\r\n <div class=\"documents-container\">\r\n <ng-container *ngFor=\"let document of documentsApprovalList\">\r\n <ng-container *ngIf=\"document.idRequisition === requisition.requisitionId\" >\r\n <div class=\"document\" >\r\n <div class=\"information\" >\r\n <div class=\"document-name fad-portal-subtitle-bold\" >\r\n {{ document.doc?.name }}\r\n </div>\r\n <div class=\"validate\">\r\n \r\n <ng-fad-image-inline \r\n [src]=\"document.approved === false ? images.active.reject : images.inactive.reject\"\r\n (click)=\"toggleRejection(document)\">\r\n </ng-fad-image-inline>\r\n \r\n \r\n <ng-fad-image-inline \r\n [src]=\"document.approved === true ? images.active.approve : images.inactive.approve\"\r\n (click)=\"toggleApproval(document)\">\r\n </ng-fad-image-inline>\r\n </div>\r\n \r\n </div>\r\n <div class=\"actions\">\r\n <div>\r\n <div class=\"fad-portal-subtitle-bold\" (click)=\"seeDocumentFea(document)\">\r\n {{ document.isVisible ? 'Ocultar documento' : 'Ver documento' }}\r\n </div>\r\n <div class=\"fad-portal-subtitle-bold\" (click)=\"downloadDocumentFea(document)\">{{configuration.customization?.moduleCustomization?.legends?.download}}</div>\r\n </div>\r\n <div>\r\n {{ document.doc?.pages }} {{configuration.customization?.moduleCustomization?.legends?.pages}}\r\n </div>\r\n </div>\r\n <div class=\"pdf-viewer\" *ngIf=\"document.isVisible\" [style.height.px]=\"1000\">\r\n <ng-fad-viewer-general-pdf-viewer\r\n [pages]=\"pagesMap.get(document.id!) ?? []\"\r\n (onpagechange)=\"onpagechange($event)\"\r\n (onloadpage)=\"onloadpage($event)\">\r\n \r\n <ng-fad-viewer-pdf-mini-view\r\n miniView\r\n [configuration]=\"miniView\"\r\n [pages]=\"pagesMap.get(document.id!) ?? []\"\r\n [page]=\"page\"\r\n (onpagechange)=\"scrollToPage($event)\">\r\n </ng-fad-viewer-pdf-mini-view>\r\n \r\n </ng-fad-viewer-general-pdf-viewer>\r\n </div>\r\n \r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n \r\n </div>\r\n \r\n </div>\r\n </ng-container>\r\n <div class=\"fad-portal-content selector-document\">\r\n <div class=\"document-status-bar\">\r\n \r\n <div *ngIf=\"getApprovedCount() === 0 && getRejectedCount() === 0\" class=\"document-status-message \">\r\n Aprueba los documentos para firmarlos con tu e.firma\r\n </div>\r\n \r\n \r\n <div *ngIf=\"getApprovedCount() > 0 || getRejectedCount() > 0\" class=\"document-status-content\">\r\n <div class=\"approve-all\">\r\n <ng-fad-image-inline \r\n [src]=\"approveAll ? images.active.approve : images.inactive.approve\"\r\n (click)=\"approveAllDocuments()\">\r\n </ng-fad-image-inline>\r\n <span (click)=\"approveAllDocuments()\">Aprobar todos los documentos ({{ documentsApprovalList.length }})</span>\r\n </div>\r\n \r\n \r\n <div class=\"document-counts\">\r\n <span *ngIf=\"getApprovedCount() > 0 && getRejectedCount() === 0\" class=\"fad-portal-informative-bold\">\r\n {{ getApprovedCount() }} documentos aprobados\r\n </span>\r\n <span *ngIf=\"getRejectedCount() > 0 && getApprovedCount() === 0\" class=\"fad-portal-informative-bold\">\r\n {{ getRejectedCount() }} documentos rechazados\r\n </span>\r\n \r\n <ng-container *ngIf=\"getApprovedCount() > 0 && getRejectedCount() > 0\" >\r\n <span class=\"fad-portal-informative-bold\">\r\n {{ getApprovedCount() }} documentos aprobados\r\n </span>\r\n <span class=\"fad-portal-informative-bold\">\r\n {{ getRejectedCount() }} documentos rechazados\r\n </span>\r\n </ng-container>\r\n </div>\r\n \r\n \r\n <button class=\"fad-portal-primary\" (click)=\"emitApprovedDocuments()\">Continuar</button>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n\r\n", styles: [":host{box-sizing:border-box}:host .fad-portal-content{display:flex;flex-direction:column;justify-content:center;width:100%;box-sizing:border-box;margin-top:var(--fad-portal-common-separation-lg)}:host .fad-portal-content .header{display:flex;align-items:center;justify-content:space-between;width:100%;background-color:#f5f5f5;border-radius:var(--fad-portal-common-input-border-radius);padding:var(--fad-portal-common-separation-md);overflow:hidden;box-sizing:border-box}:host .fad-portal-content .header div:nth-child(1){display:flex;flex-direction:column;row-gap:var(--fad-portal-common-separation-xs)}:host .fad-portal-content .header .info{color:var(--fad-portal-common-tertiary-color)}@media (max-width: 992px){:host .fad-portal-content .header{flex-direction:column;align-items:start;justify-content:center;row-gap:var(--fad-portal-common-separation-xs);margin-bottom:var(--fad-portal-common-separation-md)}}:host .fad-portal-content .documents-container{box-sizing:border-box}:host .fad-portal-content .documents-container .document{display:flex;align-items:center;flex-direction:column;width:100%;margin-top:var(--fad-portal-common-separation-md);border-radius:var(--fad-portal-common-input-border-radius);border:1px solid #f5f5f5}:host .fad-portal-content .documents-container .document .information{padding:var(--fad-portal-common-separation-md);display:flex;align-items:center;justify-content:space-between;width:100%}:host .fad-portal-content .documents-container .document .information .validate{padding-left:var(--fad-portal-common-separation-md);padding-right:var(--fad-portal-common-separation-md);display:flex;column-gap:var(--fad-portal-common-separation-md)}:host .fad-portal-content .documents-container .document .information .document-name{padding-left:var(--fad-portal-common-separation-md);padding-right:var(--fad-portal-common-separation-md)}:host .fad-portal-content .documents-container .document .actions{display:flex;align-items:center;justify-content:space-between;width:100%;background-color:#f5f5f5;padding:var(--fad-portal-common-separation-md);box-sizing:border-box;border-radius:var(--fad-portal-common-input-border-radius);border-top-left-radius:0;border-top-right-radius:0}:host .fad-portal-content .documents-container .document .actions div:nth-child(1){display:flex;align-items:center;gap:var(--fad-portal-common-separation-md)}:host .fad-portal-content .documents-container .document .actions div:nth-child(1) div{color:var(--fad-portal-common-primary-color)!important;cursor:pointer}:host .selector-document{width:100%;background-color:#262626;color:#fff;padding:var(--fad-portal-common-separation-md);margin-top:var(--fad-portal-common-separation-md);display:flex;align-items:center;justify-content:space-between;border-radius:var(--fad-portal-common-input-border-radius);box-sizing:border-box}:host .selector-document .document-status-message{display:flex;align-items:center;justify-content:center;width:100%;gap:var(--fad-portal-common-separation-md)}:host .selector-document .document-status-bar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;width:100%;font-size:14px;box-sizing:border-box}:host .selector-document .document-status-bar .document-status-content{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;width:100%;font-size:14px;box-sizing:border-box}:host .selector-document .document-status-bar .approve-all{display:flex;align-items:center;gap:10px;cursor:pointer;box-sizing:border-box}:host .selector-document .document-status-bar .approve-all span{cursor:pointer;-webkit-user-select:none;user-select:none}:host .selector-document .document-status-bar .document-counts{display:flex;flex-direction:column;gap:var(--fad-portal-common-separation-xs);box-sizing:border-box}:host .selector-document .document-status-bar .document-counts span{color:#fff}:host .selector-document .document-status-bar .fad-portal-primary{min-width:0px;width:50%}@media (max-width: 992px){:host .selector-document .document-status-bar .fad-portal-primary{width:100%;margin-top:var(--fad-portal-common-separation-md)}}\n"] }]
575
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i2$1.FadService }, { type: i0.ChangeDetectorRef }, { type: i2$2.NgFadPdfReaderService }]; }, propDecorators: { configuration: [{
645
+ args: [{ selector: 'ng-fad-signature-fea-document-approval-list', providers: [NgFadPdfReaderService], template: "<ng-container *ngIf=\"requisitionsFea && requisitionsFea.length > 0\">\r\n <ng-container *ngFor=\"let requisition of requisitionsFea\">\r\n <div class=\"fad-portal-content\" >\r\n <div class=\"header\" >\r\n <div>\r\n <div class=\"fad-portal-title\">\r\n {{ requisition.name }} ({{requisition.documents.length}})\r\n </div>\r\n <div class=\"info\">\r\n {{configuration.customization?.moduleCustomization?.legends?.sendTo}} Alfredo Villanueva {{ requisition.sendBy }}\r\n </div>\r\n <div class=\"info\">\r\n {{ requisition.sendByEmail }}\r\n </div>\r\n </div>\r\n <div class=\"requisition-id\">\r\n <div class=\"fad-portal-content-bold\">ID {{ requisition.requisitionId }}</div>\r\n </div>\r\n </div>\r\n <div class=\"documents-container\">\r\n <ng-container *ngFor=\"let document of documentsApprovalList; let i = index\">\r\n <ng-container *ngIf=\"document.idRequisition === requisition.requisitionId\" >\r\n <div class=\"document\" >\r\n <div class=\"information\" >\r\n <div class=\"document-name fad-portal-content-bold\" >\r\n {{ document.doc?.name }}\r\n </div>\r\n <div class=\"validate\">\r\n \r\n <ng-fad-image-inline\r\n [src]=\"document.approved === false ? images.active.reject : images.inactive.reject\"\r\n (click)=\"toggleRejection(document)\">\r\n </ng-fad-image-inline>\r\n \r\n \r\n <ng-fad-image-inline\r\n [src]=\"document.approved === true ? images.active.approve : images.inactive.approve\"\r\n (click)=\"toggleApproval(document)\">\r\n </ng-fad-image-inline>\r\n </div>\r\n \r\n </div>\r\n <div class=\"actions\">\r\n <div>\r\n <div class=\"fad-portal-content-bold\" (click)=\"seeDocumentFea(document)\">\r\n {{ document.isVisible ? 'Ocultar documento' : 'Ver documento' }}\r\n </div>\r\n <div class=\"fad-portal-content-bold\" (click)=\"downloadDocumentFea(document)\">{{configuration.customization?.moduleCustomization?.legends?.download}}</div>\r\n </div>\r\n <div>\r\n {{ document.doc?.pages }} {{configuration.customization?.moduleCustomization?.legends?.pages}}\r\n </div>\r\n </div>\r\n \r\n <ng-fad-signature-fea-pdf-viewer-fea\r\n *ngIf=\"document.isVisible && document.doc?.file\"\r\n [file]=\"document.doc?.file\"\r\n [index]=\"i\"\r\n [id]=\"getDocumentId(document.id!)\"\r\n >\r\n </ng-fad-signature-fea-pdf-viewer-fea>\r\n \r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n \r\n </div>\r\n \r\n </div>\r\n </ng-container>\r\n <div class=\"fad-portal-content selector-document\">\r\n <div class=\"document-status-bar\">\r\n \r\n <div *ngIf=\"getApprovedCount() === 0 && getRejectedCount() === 0\" class=\"document-status-message \">\r\n Aprueba los documentos para firmarlos con tu e.firma\r\n </div>\r\n \r\n \r\n <div *ngIf=\"getApprovedCount() > 0 || getRejectedCount() > 0\" class=\"document-status-content\">\r\n <div class=\"approve-all\">\r\n <ng-fad-image-inline\r\n [src]=\"approveAll ? images.active.approve : images.inactive.approve\"\r\n (click)=\"approveAllDocuments()\">\r\n </ng-fad-image-inline>\r\n <span (click)=\"approveAllDocuments()\">Aprobar todos los documentos ({{ documentsApprovalList.length }})</span>\r\n </div>\r\n \r\n \r\n <div class=\"document-counts\">\r\n <span *ngIf=\"getApprovedCount() > 0 && getRejectedCount() === 0\" class=\"fad-portal-informative-bold\">\r\n {{ getApprovedCount() }} documentos aprobados\r\n </span>\r\n <span *ngIf=\"getRejectedCount() > 0 && getApprovedCount() === 0\" class=\"fad-portal-informative-bold\">\r\n {{ getRejectedCount() }} documentos rechazados\r\n </span>\r\n \r\n <ng-container *ngIf=\"getApprovedCount() > 0 && getRejectedCount() > 0\" >\r\n <span class=\"fad-portal-informative-bold\">\r\n {{ getApprovedCount() }} documentos aprobados\r\n </span>\r\n <span class=\"fad-portal-informative-bold\">\r\n {{ getRejectedCount() }} documentos rechazados\r\n </span>\r\n </ng-container>\r\n </div>\r\n \r\n \r\n <button class=\"fad-portal-primary\" (click)=\"emitApprovedDocuments()\">Continuar</button>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n </ng-container>\r\n ", styles: [":host{box-sizing:border-box}:host .fad-portal-content{display:flex;flex-direction:column;justify-content:center;width:100%;box-sizing:border-box;margin-top:var(--fad-portal-common-separation-lg)}:host .fad-portal-content .header{display:flex;align-items:center;justify-content:space-between;width:100%;background-color:#f5f5f5;border-radius:var(--fad-portal-common-input-border-radius);padding:var(--fad-portal-common-separation-md);overflow:hidden;box-sizing:border-box}:host .fad-portal-content .header div:nth-child(1){display:flex;flex-direction:column;row-gap:var(--fad-portal-common-separation-xs)}:host .fad-portal-content .header .info{color:var(--fad-portal-common-tertiary-color)}@media (max-width: 992px){:host .fad-portal-content .header{flex-direction:column;align-items:start;justify-content:center;row-gap:var(--fad-portal-common-separation-xs);margin-bottom:var(--fad-portal-common-separation-md)}}:host .fad-portal-content .documents-container{box-sizing:border-box}:host .fad-portal-content .documents-container .document{display:flex;align-items:center;flex-direction:column;width:100%;margin-top:var(--fad-portal-common-separation-md);border-radius:var(--fad-portal-common-input-border-radius);border:1px solid #f5f5f5}:host .fad-portal-content .documents-container .document .information{padding:var(--fad-portal-common-separation-md);display:flex;align-items:center;justify-content:space-between;width:100%}:host .fad-portal-content .documents-container .document .information .validate{padding-left:var(--fad-portal-common-separation-md);padding-right:var(--fad-portal-common-separation-md);display:flex;column-gap:var(--fad-portal-common-separation-md)}:host .fad-portal-content .documents-container .document .information .document-name{padding-left:var(--fad-portal-common-separation-md);padding-right:var(--fad-portal-common-separation-md)}:host .fad-portal-content .documents-container .document .actions{display:flex;align-items:center;justify-content:space-between;width:100%;background-color:#f5f5f5;padding:var(--fad-portal-common-separation-md);box-sizing:border-box;border-radius:var(--fad-portal-common-input-border-radius);border-top-left-radius:0;border-top-right-radius:0}:host .fad-portal-content .documents-container .document .actions div:nth-child(1){display:flex;align-items:center;gap:var(--fad-portal-common-separation-md)}:host .fad-portal-content .documents-container .document .actions div:nth-child(1) div{color:var(--fad-portal-common-primary-color)!important;cursor:pointer}:host .selector-document{width:100%;background-color:var(--fad-portal-common-tertiary-color);color:#fff;padding:var(--fad-portal-common-separation-md);margin-top:var(--fad-portal-common-separation-md);display:flex;align-items:center;justify-content:space-between;border-radius:var(--fad-portal-common-input-border-radius);box-sizing:border-box}:host .selector-document .document-status-message{display:flex;align-items:center;justify-content:center;width:100%;gap:var(--fad-portal-common-separation-md)}:host .selector-document .document-status-bar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;width:100%;font-size:14px;box-sizing:border-box}:host .selector-document .document-status-bar .document-status-content{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;width:100%;font-size:14px;box-sizing:border-box}:host .selector-document .document-status-bar .approve-all{display:flex;align-items:center;gap:10px;cursor:pointer;box-sizing:border-box}:host .selector-document .document-status-bar .approve-all span{cursor:pointer;-webkit-user-select:none;user-select:none}:host .selector-document .document-status-bar .document-counts{display:flex;flex-direction:column;gap:var(--fad-portal-common-separation-xs);box-sizing:border-box}:host .selector-document .document-status-bar .document-counts span{color:#fff}:host .selector-document .document-status-bar .fad-portal-primary{min-width:0px;width:50%}@media (max-width: 992px){:host .selector-document .document-status-bar .fad-portal-primary{width:100%;margin-top:var(--fad-portal-common-separation-md)}}\n"] }]
646
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i2$2.FadService }, { type: i0.ChangeDetectorRef }, { type: i1.NgFadPdfReaderService }]; }, propDecorators: { configuration: [{
576
647
  type: Input
577
648
  }], rfc: [{
578
649
  type: Input
@@ -582,9 +653,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
582
653
  type: Output
583
654
  }], onerror: [{
584
655
  type: Output
585
- }], generalPdfViewerComponent: [{
586
- type: ViewChild,
587
- args: [GeneralPdfViewerComponent]
588
656
  }] } });
589
657
 
590
658
  class UploadESignatureComponent {
@@ -693,56 +761,75 @@ class UploadESignatureComponent {
693
761
  allIsRejected() {
694
762
  return this.documents.every(doc => doc.approved === false);
695
763
  }
696
- async signDocuments() {
697
- let canContinue = true;
764
+ async onSignDocuments() {
765
+ const aprovedDocuments = this.documents.filter((doc) => doc.approved);
698
766
  const rejectedDocuments = this.documents.filter((doc) => !doc.approved);
767
+ let cer = null;
768
+ if (aprovedDocuments.length > 0) {
769
+ const response = await this.signDocuments();
770
+ if (!response)
771
+ return;
772
+ cer = response;
773
+ }
699
774
  if (rejectedDocuments.length > 0) {
700
- canContinue = await this.rejectDocuments(true);
775
+ const response = await this.rejectDocuments();
776
+ if (!response)
777
+ return;
701
778
  }
702
- if (!canContinue)
703
- return;
704
- this.onloader.emit(true);
705
- const cer = await this.getBase64File(this.cer?.value);
706
- this.onloader.emit(false);
707
- if (!cer)
708
- return;
709
- this.onloader.emit(true);
710
- const key = await this.getBase64File(this.key?.value);
711
- this.onloader.emit(false);
712
- if (!key)
713
- return;
714
- const aprrovedDocuments = this.documents.filter((doc) => doc.approved);
715
- const body = {
716
- cer: cer.split(',')[1],
717
- key: key.split(',')[1],
718
- password: this.password?.value,
719
- documents: aprrovedDocuments,
720
- signerId: this.rfc
721
- };
722
- this.onloader.emit(true);
723
- this.fad.signFea(body, this.configuration.credentials?.key, this.configuration.credentials?.iv, this.configuration.services?.reject).pipe(finalize(() => {
779
+ this.oncomplete.emit(cer);
780
+ }
781
+ async signDocuments() {
782
+ return new Promise(async (resolve, reject) => {
783
+ this.onloader.emit(true);
784
+ const cer = await this.getBase64File(this.cer?.value);
724
785
  this.onloader.emit(false);
725
- })).subscribe({
726
- next: (res) => {
727
- if (res.success) {
728
- const certificate = this.mifiel.parseCertificate(body.cer);
729
- const data = {
730
- cer: certificate
731
- };
732
- this.oncomplete.emit(data);
733
- }
734
- else {
735
- this.onerror.emit(new ResponseError(UploadESignatureErrorCode.SERVICE, res.error, 'ng-fad-signature-fea-upload-e-signature'));
736
- ;
737
- }
738
- },
739
- error: (error) => {
740
- this.onerror.emit(new ResponseError(UploadESignatureErrorCode.HTTP, error.error, 'ng-fad-signature-fea-upload-e-signature'));
741
- ;
742
- },
786
+ if (!cer)
787
+ reject(null);
788
+ this.onloader.emit(true);
789
+ const key = await this.getBase64File(this.key?.value);
790
+ this.onloader.emit(false);
791
+ if (!key)
792
+ reject(null);
793
+ const aprrovedDocuments = this.documents.filter((doc) => doc.approved);
794
+ const data = {
795
+ cer: cer.split(',')[1],
796
+ key: key.split(',')[1],
797
+ password: this.password?.value,
798
+ documents: aprrovedDocuments,
799
+ signerId: this.rfc
800
+ };
801
+ this.onloader.emit(true);
802
+ const body = await this.mifiel.getSignBody(data);
803
+ this.onloader.emit(false);
804
+ if (!body) {
805
+ this.onerror.emit(new ResponseError(UploadESignatureErrorCode.PASSWORD_ERROR, getUploadESignatureErrorDescription(UploadESignatureErrorCode.PASSWORD_ERROR), 'ng-fad-signature-fea-upload-e-signature'));
806
+ return;
807
+ }
808
+ this.onloader.emit(true);
809
+ this.fad.signFea(body, this.configuration.credentials?.key, this.configuration.credentials?.iv, this.configuration.services?.sign).pipe(finalize(() => {
810
+ this.onloader.emit(false);
811
+ })).subscribe({
812
+ next: (res) => {
813
+ if (res.success) {
814
+ const certificate = this.mifiel.parseCertificate(data.cer);
815
+ const cer = {
816
+ cer: certificate
817
+ };
818
+ resolve(cer);
819
+ }
820
+ else {
821
+ this.onerror.emit(new ResponseError(UploadESignatureErrorCode.SERVICE, res.error, 'ng-fad-signature-fea-upload-e-signature'));
822
+ reject(null);
823
+ }
824
+ },
825
+ error: (error) => {
826
+ this.onerror.emit(new ResponseError(UploadESignatureErrorCode.HTTP, error.error, 'ng-fad-signature-fea-upload-e-signature'));
827
+ reject(null);
828
+ },
829
+ });
743
830
  });
744
831
  }
745
- rejectDocuments(fromSign = false) {
832
+ rejectDocuments() {
746
833
  return new Promise((resolve, reject) => {
747
834
  const rejectedDocuments = this.documents.filter((doc) => !doc.approved);
748
835
  const body = {
@@ -763,25 +850,20 @@ class UploadESignatureComponent {
763
850
  })).subscribe({
764
851
  next: (res) => {
765
852
  if (res.success) {
766
- if (!fromSign)
767
- this.oncomplete.emit(null);
768
853
  resolve(true);
769
854
  }
770
855
  else {
771
856
  this.onerror.emit(new ResponseError(UploadESignatureErrorCode.SERVICE, res.error, 'ng-fad-signature-fea-upload-e-signature'));
772
- reject(null);
857
+ reject(false);
773
858
  }
774
859
  },
775
860
  error: (error) => {
776
861
  this.onerror.emit(new ResponseError(UploadESignatureErrorCode.HTTP, error.error, 'ng-fad-signature-fea-upload-e-signature'));
777
- reject(null);
862
+ reject(false);
778
863
  },
779
864
  });
780
865
  });
781
866
  }
782
- async onRejectDocument() {
783
- await this.rejectDocuments();
784
- }
785
867
  async getBase64File(file) {
786
868
  const data = await SharedUtils.fileToBase64(file).then(base64 => base64).catch(error => null);
787
869
  if (data)
@@ -804,13 +886,13 @@ class UploadESignatureComponent {
804
886
  Utils.setVariableCss('--fad-signature-fea-e-signature-file-border-radius', this.configuration.customization?.moduleCustomization?.style?.file?.borderRadius, { targetElement });
805
887
  Utils.setVariableCss('--fad-signature-fea-e-signature-file-img-background-color', this.configuration.customization?.moduleCustomization?.style?.file?.img?.backgroundColor, { targetElement });
806
888
  }
807
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UploadESignatureComponent, deps: [{ token: i0.ElementRef }, { token: i1.FormBuilder }, { token: i2$1.FadService }, { token: i2$1.MifielService }], target: i0.ɵɵFactoryTarget.Component }); }
808
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: UploadESignatureComponent, selector: "ng-fad-signature-fea-upload-e-signature", inputs: { configuration: "configuration", documents: "documents", signerId: "signerId", rfc: "rfc" }, outputs: { onerror: "onerror", onloader: "onloader", oncomplete: "oncomplete" }, ngImport: i0, template: "<ng-container *ngIf=\"showComponent\">\r\n <div>\r\n <div *ngIf=\"documents.length > 1\" class=\"fad-portal-title-bold\">{{ documentPluralTitle }}</div>\r\n <div *ngIf=\"documents.length === 1\" class=\"fad-portal-title-bold\">{{ documentSingularTitle }}</div>\r\n\r\n <div class=\"container-document fad-portal-content\">\r\n <div *ngFor=\"let i of documents\" class=\"document\">\r\n <div>{{ i.doc.name }}</div>\r\n <div class=\"status fad-portal-content-bold\">{{ i.approved ? configuration.customization?.moduleCustomization?.legends?.documents?.status?.approved : configuration.customization?.moduleCustomization?.legends?.documents?.status?.rejected }}</div>\r\n <div class=\"pages\">{{ i.doc.pages }} {{ i.doc.pages > 1 ? configuration.customization?.moduleCustomization?.legends?.documents?.pages?.plural : configuration.customization?.moduleCustomization?.legends?.documents?.pages?.singular }}</div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!allIsRejected()\">\r\n <div class=\"fad-portal-title-bold\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.title }}</div>\r\n\r\n <div>\r\n <div class=\"container-instruction-file\">\r\n <div class=\"fad-portal-content\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.cer?.label }}</div>\r\n <div *ngIf=\"cer?.value\" class=\"fad-portal-content select-file\" (click)=\"openFilePicker(fileCerInput)\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.upload }}</div>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"!cer?.value\"\r\n class=\"container-upload\"\r\n (click)=\"openFilePicker(fileCerInput)\"\r\n dragDropDocument\r\n [formatList]=\"formatCerList\"\r\n [acceptMultipleFiles]=\"false\"\r\n (onfiledropped)=\"onfiledropped($event, 'cer')\"\r\n (onerror)=\"onerrorDirective($event, 'cer')\">\r\n <div class=\"fad-portal-content instruction\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.cer?.instruction }}</div>\r\n <div class=\"fad-portal-content-bold upload-btn\">\r\n <ng-fad-image-inline [src]=\"uploadImg\"></ng-fad-image-inline>\r\n <span>{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.cer?.upload }}</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"cer?.value\" class=\"container-file\">\r\n <div class=\"document-img\">\r\n <img [src]=\"fileImg\" alt=\"\">\r\n </div>\r\n <div class=\"fad-portal-content\">{{ cer?.value.name }}</div>\r\n </div>\r\n\r\n <input type=\"file\" accept=\".cer\" #fileCerInput style=\"display: none\" (change)=\"onFileChange($event, 'cer')\">\r\n </div>\r\n\r\n <div>\r\n <div class=\"container-instruction-file\">\r\n <div class=\"fad-portal-content\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.key?.label }}</div>\r\n <div *ngIf=\"key?.value\" class=\"fad-portal-content select-file\" (click)=\"openFilePicker(fileKeyInput)\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.upload }}</div>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"!key?.value\"\r\n class=\"container-upload\"\r\n (click)=\"openFilePicker(fileKeyInput)\"\r\n dragDropDocument\r\n [formatList]=\"formatKeyList\"\r\n [acceptMultipleFiles]=\"false\"\r\n (onfiledropped)=\"onfiledropped($event, 'key')\"\r\n (onerror)=\"onerrorDirective($event, 'key')\">\r\n\r\n <div class=\"fad-portal-content instruction\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.key?.instruction }}</div>\r\n <div class=\"fad-portal-content-bold upload-btn\">\r\n <ng-fad-image-inline [src]=\"uploadImg\"></ng-fad-image-inline>\r\n <span>{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.key?.upload }}</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"key?.value\" class=\"container-file\">\r\n <div class=\"document-img\">\r\n <img [src]=\"fileImg\" alt=\"\">\r\n </div>\r\n <div class=\"fad-portal-content\">{{ key?.value.name }}</div>\r\n </div>\r\n\r\n <input type=\"file\" accept=\".key\" #fileKeyInput style=\"display: none\" (change)=\"onFileChange($event, 'key')\">\r\n </div>\r\n\r\n <div class=\"fad-portal-container-input\">\r\n <label class=\"fad-portal-content\" for=\"\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.password?.label }}</label>\r\n <div class=\"input-password\">\r\n <input [type]=\"passwordInputType\" (input)=\"savePassword($event)\">\r\n <div class=\"fad-portal-content-bold password-show\">\r\n <div *ngIf=\"passwordInputType === 'text'\" (click)=\"changePaswordInputType()\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.password?.hide }}</div>\r\n <div *ngIf=\"passwordInputType === 'password'\" (click)=\"changePaswordInputType()\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.password?.show }}</div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </ng-container>\r\n\r\n <div></div>\r\n\r\n <div class=\"fad-portal-content container-confirm\">\r\n <div *ngIf=\"!allIsRejected()\" (click)=\"isValidated = !isValidated\">\r\n <div>\r\n <ng-fad-image-inline *ngIf=\"isValidated\" [src]=\"checkOnImg\"></ng-fad-image-inline>\r\n <ng-fad-image-inline *ngIf=\"!isValidated\" [src]=\"checkOffImg\"></ng-fad-image-inline>\r\n </div>\r\n <div *ngIf=\"documents.length === 1\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.validate?.singular }}</div>\r\n <div *ngIf=\"documents.length > 1\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.validate?.plural }}</div>\r\n </div>\r\n\r\n <div></div>\r\n\r\n <div class=\"action\">\r\n <button type=\"button\" *ngIf=\"documents.length === 1 && !allIsRejected()\" class=\"fad-portal-primary\" [disabled]=\"!form.valid || !isValidated\" (click)=\"signDocuments()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.sign?.singular }}</button>\r\n <button type=\"button\" *ngIf=\"documents.length > 1 && !allIsRejected()\" class=\"fad-portal-primary\" [disabled]=\"!form.valid || !isValidated\" (click)=\"signDocuments()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.sign?.plural }}</button>\r\n <button type=\"button\" *ngIf=\"documents.length === 1 && allIsRejected()\" class=\"fad-portal-primary\" (click)=\"onRejectDocument()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.reject?.singular }}</button>\r\n <button type=\"button\" *ngIf=\"documents.length > 1 && allIsRejected()\" class=\"fad-portal-primary\" (click)=\"onRejectDocument()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.reject?.plural }}</button>\r\n </div>\r\n </div>\r\n</ng-container>\r\n", styles: [":host{display:flex;flex-direction:column;gap:var(--fad-portal-common-separation-md)}:host .container-document{display:flex;flex-direction:column;width:100%;background-color:var(--fad-signature-fea-e-signature-documents-background-color);border-radius:var(--fad-signature-fea-e-signature-documents-border-radius);padding:var(--fad-portal-common-separation-md);box-sizing:border-box;margin-top:var(--fad-portal-common-separation-xs)}:host .container-document .document{display:flex;gap:var(--fad-portal-common-separation-md);justify-content:space-between;border-bottom:1px solid var(--fad-portal-common-border-color);padding:var(--fad-portal-common-separation-md) 0}:host .container-document .document>div{flex:1}:host .container-document .document .status{text-align:center}:host .container-document .document .pages{text-align:end;color:var(--fad-portal-common-legends-secondary)}:host .document:only-child{border-bottom:none!important}:host .container-instruction-file{display:flex;gap:var(--fad-portal-common-separation-md);justify-content:space-between}:host .container-instruction-file .select-file{color:var(--fad-portal-common-primary-color);cursor:pointer}:host .container-upload{width:100%;box-sizing:border-box;border-radius:var(--fad-signature-fea-e-signature-upload-border-radius);border:var(--fad-signature-fea-e-signature-upload-border);padding:var(--fad-portal-common-separation-md);margin-top:var(--fad-portal-common-separation-xs);display:flex;flex-direction:column;gap:var(--fad-portal-common-separation-xs);align-items:center;justify-content:center;text-align:center;background-color:var(--fad-signature-fea-e-signature-upload-background-color)}:host .container-upload .instruction{color:var(--fad-portal-common-legends-secondary)}:host .container-upload .upload-btn{max-width:90%;width:300px;box-sizing:border-box;background-color:var(--fad-signature-fea-e-signature-upload-button-background-color);border-radius:var(--fad-signature-fea-e-signature-upload-button-border-radius);color:var(--fad-portal-common-legends-tertiary);padding:var(--fad-portal-common-separation-xs);cursor:pointer;transition:all .2s ease-out;display:flex;align-items:center;justify-content:center;text-align:center;gap:var(--fad-portal-common-separation-xs)}:host .container-upload .upload-btn:hover{background-color:var(--fad-signature-fea-e-signature-upload-button-hover)}:host .container-file{display:flex;gap:var(--fad-portal-common-separation-md);align-items:center;padding:var(--fad-portal-common-separation-md);border:2px solid var(--fad-portal-common-successful-color);height:71px;border-radius:var(--fad-signature-fea-e-signature-file-border-radius);margin-top:var(--fad-portal-common-separation-xs)}:host .container-file .document-img{background-color:var(--fad-signature-fea-e-signature-file-img-background-color);width:40px;height:40px;border-radius:100%;display:flex;align-items:center;justify-content:center}:host .container-file .document-img img{width:60%;max-width:100%;max-height:100%}:host .fad-portal-container-input .input-password{position:relative}:host .fad-portal-container-input .input-password input{padding-right:100px}:host .fad-portal-container-input .input-password .password-show{position:absolute;right:10px;top:50%;transform:translateY(-50%);color:var(--fad-portal-common-legends-secondary);cursor:pointer}:host .container-confirm{display:flex;justify-content:space-between;align-items:center;gap:var(--fad-portal-common-separation-xs)}:host .container-confirm>div:first-child{display:flex;gap:var(--fad-portal-common-separation-xs)}:host .container-confirm>div:first-child>div:first-child{width:25px;height:25px}:host .container-confirm .action{max-width:80%;width:400px}:host .container-confirm ng-fad-image-inline{cursor:pointer}@media (max-width: 992px){:host .container-document .document{flex-direction:column;gap:var(--fad-portal-common-separation-xs)}:host .container-document .document .status,:host .container-document .document .pages{text-align:start!important}:host .container-confirm{flex-direction:column}:host .container-confirm .action{max-width:100%;width:100%!important}}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.DragDropDocumentDirective, selector: "[dragDropDocument]", inputs: ["formatList", "acceptMultipleFiles"], outputs: ["onfiledropped", "onerror"] }, { kind: "component", type: i4.NgFadImageInlineComponent, selector: "ng-fad-image-inline", inputs: ["src"] }] }); }
889
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UploadESignatureComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.FormBuilder }, { token: i2$2.FadService }, { token: i2$2.MifielService }], target: i0.ɵɵFactoryTarget.Component }); }
890
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: UploadESignatureComponent, selector: "ng-fad-signature-fea-upload-e-signature", inputs: { configuration: "configuration", documents: "documents", signerId: "signerId", rfc: "rfc" }, outputs: { onerror: "onerror", onloader: "onloader", oncomplete: "oncomplete" }, ngImport: i0, template: "<ng-container *ngIf=\"showComponent\">\r\n <div>\r\n <div *ngIf=\"documents.length > 1\" class=\"fad-portal-title-bold\">{{ documentPluralTitle }}</div>\r\n <div *ngIf=\"documents.length === 1\" class=\"fad-portal-title-bold\">{{ documentSingularTitle }}</div>\r\n\r\n <div class=\"container-document fad-portal-content\">\r\n <div *ngFor=\"let i of documents\" class=\"document\">\r\n <div>{{ i.doc.name }}</div>\r\n <div class=\"status fad-portal-content-bold\">{{ i.approved ? configuration.customization?.moduleCustomization?.legends?.documents?.status?.approved : configuration.customization?.moduleCustomization?.legends?.documents?.status?.rejected }}</div>\r\n <div class=\"pages\">{{ i.doc.pages }} {{ i.doc.pages > 1 ? configuration.customization?.moduleCustomization?.legends?.documents?.pages?.plural : configuration.customization?.moduleCustomization?.legends?.documents?.pages?.singular }}</div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!allIsRejected()\">\r\n <div class=\"fad-portal-title-bold\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.title }}</div>\r\n\r\n <div>\r\n <div class=\"container-instruction-file\">\r\n <div class=\"fad-portal-content\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.cer?.label }}</div>\r\n <div *ngIf=\"cer?.value\" class=\"fad-portal-content select-file\" (click)=\"openFilePicker(fileCerInput)\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.upload }}</div>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"!cer?.value\"\r\n class=\"container-upload\"\r\n (click)=\"openFilePicker(fileCerInput)\"\r\n dragDropDocument\r\n [formatList]=\"formatCerList\"\r\n [acceptMultipleFiles]=\"false\"\r\n (onfiledropped)=\"onfiledropped($event, 'cer')\"\r\n (onerror)=\"onerrorDirective($event, 'cer')\">\r\n <div class=\"fad-portal-content instruction\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.cer?.instruction }}</div>\r\n <div class=\"fad-portal-content-bold upload-btn\">\r\n <ng-fad-image-inline [src]=\"uploadImg\"></ng-fad-image-inline>\r\n <span>{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.cer?.upload }}</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"cer?.value\" class=\"container-file\">\r\n <div class=\"document-img\">\r\n <img [src]=\"fileImg\" alt=\"\">\r\n </div>\r\n <div class=\"fad-portal-content\">{{ cer?.value.name }}</div>\r\n </div>\r\n\r\n <input type=\"file\" accept=\".cer\" #fileCerInput style=\"display: none\" (change)=\"onFileChange($event, 'cer')\">\r\n </div>\r\n\r\n <div>\r\n <div class=\"container-instruction-file\">\r\n <div class=\"fad-portal-content\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.key?.label }}</div>\r\n <div *ngIf=\"key?.value\" class=\"fad-portal-content select-file\" (click)=\"openFilePicker(fileKeyInput)\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.upload }}</div>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"!key?.value\"\r\n class=\"container-upload\"\r\n (click)=\"openFilePicker(fileKeyInput)\"\r\n dragDropDocument\r\n [formatList]=\"formatKeyList\"\r\n [acceptMultipleFiles]=\"false\"\r\n (onfiledropped)=\"onfiledropped($event, 'key')\"\r\n (onerror)=\"onerrorDirective($event, 'key')\">\r\n\r\n <div class=\"fad-portal-content instruction\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.key?.instruction }}</div>\r\n <div class=\"fad-portal-content-bold upload-btn\">\r\n <ng-fad-image-inline [src]=\"uploadImg\"></ng-fad-image-inline>\r\n <span>{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.key?.upload }}</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"key?.value\" class=\"container-file\">\r\n <div class=\"document-img\">\r\n <img [src]=\"fileImg\" alt=\"\">\r\n </div>\r\n <div class=\"fad-portal-content\">{{ key?.value.name }}</div>\r\n </div>\r\n\r\n <input type=\"file\" accept=\".key\" #fileKeyInput style=\"display: none\" (change)=\"onFileChange($event, 'key')\">\r\n </div>\r\n\r\n <div class=\"fad-portal-container-input\" [formGroup]=\"form\">\r\n <label class=\"fad-portal-content\" for=\"\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.password?.label }}</label>\r\n <div class=\"input-password\">\r\n <input [type]=\"passwordInputType\" (input)=\"savePassword($event)\" formControlName=\"password\"/>\r\n <div class=\"fad-portal-content-bold password-show\">\r\n <div *ngIf=\"passwordInputType === 'text'\" (click)=\"changePaswordInputType()\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.password?.hide }}</div>\r\n <div *ngIf=\"passwordInputType === 'password'\" (click)=\"changePaswordInputType()\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.password?.show }}</div>\r\n </div>\r\n <ng-fad-portal-shared-form-errors [formData]=\"password!\" [configuration]=\"configuration.formErrors?.configuration!\"></ng-fad-portal-shared-form-errors>\r\n </div>\r\n </div>\r\n\r\n </ng-container>\r\n\r\n <div></div>\r\n\r\n <div class=\"fad-portal-content container-confirm\">\r\n <div *ngIf=\"!allIsRejected()\" (click)=\"isValidated = !isValidated\">\r\n <div>\r\n <ng-fad-image-inline *ngIf=\"isValidated\" [src]=\"checkOnImg\"></ng-fad-image-inline>\r\n <ng-fad-image-inline *ngIf=\"!isValidated\" [src]=\"checkOffImg\"></ng-fad-image-inline>\r\n </div>\r\n <div *ngIf=\"documents.length === 1\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.validate?.singular }}</div>\r\n <div *ngIf=\"documents.length > 1\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.validate?.plural }}</div>\r\n </div>\r\n\r\n <div></div>\r\n\r\n <div class=\"action\">\r\n <button type=\"button\" *ngIf=\"documents.length === 1 && !allIsRejected()\" class=\"fad-portal-primary\" [disabled]=\"!form.valid || !isValidated\" (click)=\"onSignDocuments()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.sign?.singular }}</button>\r\n <button type=\"button\" *ngIf=\"documents.length > 1 && !allIsRejected()\" class=\"fad-portal-primary\" [disabled]=\"!form.valid || !isValidated\" (click)=\"onSignDocuments()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.sign?.plural }}</button>\r\n <button type=\"button\" *ngIf=\"documents.length === 1 && allIsRejected()\" class=\"fad-portal-primary\" (click)=\"onSignDocuments()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.reject?.singular }}</button>\r\n <button type=\"button\" *ngIf=\"documents.length > 1 && allIsRejected()\" class=\"fad-portal-primary\" (click)=\"onSignDocuments()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.reject?.plural }}</button>\r\n </div>\r\n </div>\r\n</ng-container>\r\n", styles: [":host{display:flex;flex-direction:column;gap:var(--fad-portal-common-separation-md)}:host .container-document{display:flex;flex-direction:column;width:100%;background-color:var(--fad-signature-fea-e-signature-documents-background-color);border-radius:var(--fad-signature-fea-e-signature-documents-border-radius);padding:var(--fad-portal-common-separation-md);box-sizing:border-box;margin-top:var(--fad-portal-common-separation-xs)}:host .container-document .document{display:flex;gap:var(--fad-portal-common-separation-md);justify-content:space-between;border-bottom:1px solid var(--fad-portal-common-border-color);padding:var(--fad-portal-common-separation-md) 0}:host .container-document .document>div{flex:1}:host .container-document .document .status{text-align:center}:host .container-document .document .pages{text-align:end;color:var(--fad-portal-common-legends-secondary)}:host .document:only-child{border-bottom:none!important}:host .container-instruction-file{display:flex;gap:var(--fad-portal-common-separation-md);justify-content:space-between}:host .container-instruction-file .select-file{color:var(--fad-portal-common-primary-color);cursor:pointer}:host .container-upload{width:100%;box-sizing:border-box;border-radius:var(--fad-signature-fea-e-signature-upload-border-radius);border:var(--fad-signature-fea-e-signature-upload-border);padding:var(--fad-portal-common-separation-md);margin-top:var(--fad-portal-common-separation-xs);display:flex;flex-direction:column;gap:var(--fad-portal-common-separation-xs);align-items:center;justify-content:center;text-align:center;background-color:var(--fad-signature-fea-e-signature-upload-background-color)}:host .container-upload .instruction{color:var(--fad-portal-common-legends-secondary)}:host .container-upload .upload-btn{max-width:90%;width:300px;box-sizing:border-box;background-color:var(--fad-signature-fea-e-signature-upload-button-background-color);border-radius:var(--fad-signature-fea-e-signature-upload-button-border-radius);color:var(--fad-portal-common-legends-tertiary);padding:var(--fad-portal-common-separation-xs);cursor:pointer;transition:all .2s ease-out;display:flex;align-items:center;justify-content:center;text-align:center;gap:var(--fad-portal-common-separation-xs)}:host .container-upload .upload-btn:hover{background-color:var(--fad-signature-fea-e-signature-upload-button-hover)}:host .container-file{display:flex;gap:var(--fad-portal-common-separation-md);align-items:center;padding:var(--fad-portal-common-separation-md);border:2px solid var(--fad-portal-common-successful-color);height:71px;border-radius:var(--fad-signature-fea-e-signature-file-border-radius);margin-top:var(--fad-portal-common-separation-xs)}:host .container-file .fad-portal-content{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .container-file .document-img{background-color:var(--fad-signature-fea-e-signature-file-img-background-color);width:40px;height:40px;border-radius:100%;display:flex;align-items:center;justify-content:center}:host .container-file .document-img img{width:60%;max-width:100%;max-height:100%}:host .fad-portal-container-input .input-password{position:relative}:host .fad-portal-container-input .input-password input{padding-right:100px}:host .fad-portal-container-input .input-password .password-show{position:absolute;right:10px;top:50%;transform:translateY(-50%);color:var(--fad-portal-common-legends-secondary);cursor:pointer}:host .container-confirm{display:flex;justify-content:space-between;align-items:center;gap:var(--fad-portal-common-separation-xs)}:host .container-confirm>div:first-child{display:flex;gap:var(--fad-portal-common-separation-xs)}:host .container-confirm>div:first-child>div:first-child{width:25px;height:25px}:host .container-confirm .action{max-width:80%;width:400px}:host .container-confirm ng-fad-image-inline{cursor:pointer}@media (max-width: 992px){:host .container-document .document{flex-direction:column;gap:var(--fad-portal-common-separation-xs)}:host .container-document .document .status,:host .container-document .document .pages{text-align:start!important}:host .container-confirm{flex-direction:column}:host .container-confirm .action{max-width:100%;width:100%!important}}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.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$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i4.DragDropDocumentDirective, selector: "[dragDropDocument]", inputs: ["formatList", "acceptMultipleFiles"], outputs: ["onfiledropped", "onerror"] }, { kind: "component", type: i4.FormErrorsComponent, selector: "ng-fad-portal-shared-form-errors", inputs: ["configuration", "formData"], outputs: ["onerror"] }, { kind: "component", type: i4$1.NgFadImageInlineComponent, selector: "ng-fad-image-inline", inputs: ["src"] }] }); }
809
891
  }
810
892
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UploadESignatureComponent, decorators: [{
811
893
  type: Component,
812
- args: [{ selector: 'ng-fad-signature-fea-upload-e-signature', template: "<ng-container *ngIf=\"showComponent\">\r\n <div>\r\n <div *ngIf=\"documents.length > 1\" class=\"fad-portal-title-bold\">{{ documentPluralTitle }}</div>\r\n <div *ngIf=\"documents.length === 1\" class=\"fad-portal-title-bold\">{{ documentSingularTitle }}</div>\r\n\r\n <div class=\"container-document fad-portal-content\">\r\n <div *ngFor=\"let i of documents\" class=\"document\">\r\n <div>{{ i.doc.name }}</div>\r\n <div class=\"status fad-portal-content-bold\">{{ i.approved ? configuration.customization?.moduleCustomization?.legends?.documents?.status?.approved : configuration.customization?.moduleCustomization?.legends?.documents?.status?.rejected }}</div>\r\n <div class=\"pages\">{{ i.doc.pages }} {{ i.doc.pages > 1 ? configuration.customization?.moduleCustomization?.legends?.documents?.pages?.plural : configuration.customization?.moduleCustomization?.legends?.documents?.pages?.singular }}</div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!allIsRejected()\">\r\n <div class=\"fad-portal-title-bold\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.title }}</div>\r\n\r\n <div>\r\n <div class=\"container-instruction-file\">\r\n <div class=\"fad-portal-content\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.cer?.label }}</div>\r\n <div *ngIf=\"cer?.value\" class=\"fad-portal-content select-file\" (click)=\"openFilePicker(fileCerInput)\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.upload }}</div>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"!cer?.value\"\r\n class=\"container-upload\"\r\n (click)=\"openFilePicker(fileCerInput)\"\r\n dragDropDocument\r\n [formatList]=\"formatCerList\"\r\n [acceptMultipleFiles]=\"false\"\r\n (onfiledropped)=\"onfiledropped($event, 'cer')\"\r\n (onerror)=\"onerrorDirective($event, 'cer')\">\r\n <div class=\"fad-portal-content instruction\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.cer?.instruction }}</div>\r\n <div class=\"fad-portal-content-bold upload-btn\">\r\n <ng-fad-image-inline [src]=\"uploadImg\"></ng-fad-image-inline>\r\n <span>{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.cer?.upload }}</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"cer?.value\" class=\"container-file\">\r\n <div class=\"document-img\">\r\n <img [src]=\"fileImg\" alt=\"\">\r\n </div>\r\n <div class=\"fad-portal-content\">{{ cer?.value.name }}</div>\r\n </div>\r\n\r\n <input type=\"file\" accept=\".cer\" #fileCerInput style=\"display: none\" (change)=\"onFileChange($event, 'cer')\">\r\n </div>\r\n\r\n <div>\r\n <div class=\"container-instruction-file\">\r\n <div class=\"fad-portal-content\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.key?.label }}</div>\r\n <div *ngIf=\"key?.value\" class=\"fad-portal-content select-file\" (click)=\"openFilePicker(fileKeyInput)\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.upload }}</div>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"!key?.value\"\r\n class=\"container-upload\"\r\n (click)=\"openFilePicker(fileKeyInput)\"\r\n dragDropDocument\r\n [formatList]=\"formatKeyList\"\r\n [acceptMultipleFiles]=\"false\"\r\n (onfiledropped)=\"onfiledropped($event, 'key')\"\r\n (onerror)=\"onerrorDirective($event, 'key')\">\r\n\r\n <div class=\"fad-portal-content instruction\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.key?.instruction }}</div>\r\n <div class=\"fad-portal-content-bold upload-btn\">\r\n <ng-fad-image-inline [src]=\"uploadImg\"></ng-fad-image-inline>\r\n <span>{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.key?.upload }}</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"key?.value\" class=\"container-file\">\r\n <div class=\"document-img\">\r\n <img [src]=\"fileImg\" alt=\"\">\r\n </div>\r\n <div class=\"fad-portal-content\">{{ key?.value.name }}</div>\r\n </div>\r\n\r\n <input type=\"file\" accept=\".key\" #fileKeyInput style=\"display: none\" (change)=\"onFileChange($event, 'key')\">\r\n </div>\r\n\r\n <div class=\"fad-portal-container-input\">\r\n <label class=\"fad-portal-content\" for=\"\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.password?.label }}</label>\r\n <div class=\"input-password\">\r\n <input [type]=\"passwordInputType\" (input)=\"savePassword($event)\">\r\n <div class=\"fad-portal-content-bold password-show\">\r\n <div *ngIf=\"passwordInputType === 'text'\" (click)=\"changePaswordInputType()\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.password?.hide }}</div>\r\n <div *ngIf=\"passwordInputType === 'password'\" (click)=\"changePaswordInputType()\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.password?.show }}</div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </ng-container>\r\n\r\n <div></div>\r\n\r\n <div class=\"fad-portal-content container-confirm\">\r\n <div *ngIf=\"!allIsRejected()\" (click)=\"isValidated = !isValidated\">\r\n <div>\r\n <ng-fad-image-inline *ngIf=\"isValidated\" [src]=\"checkOnImg\"></ng-fad-image-inline>\r\n <ng-fad-image-inline *ngIf=\"!isValidated\" [src]=\"checkOffImg\"></ng-fad-image-inline>\r\n </div>\r\n <div *ngIf=\"documents.length === 1\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.validate?.singular }}</div>\r\n <div *ngIf=\"documents.length > 1\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.validate?.plural }}</div>\r\n </div>\r\n\r\n <div></div>\r\n\r\n <div class=\"action\">\r\n <button type=\"button\" *ngIf=\"documents.length === 1 && !allIsRejected()\" class=\"fad-portal-primary\" [disabled]=\"!form.valid || !isValidated\" (click)=\"signDocuments()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.sign?.singular }}</button>\r\n <button type=\"button\" *ngIf=\"documents.length > 1 && !allIsRejected()\" class=\"fad-portal-primary\" [disabled]=\"!form.valid || !isValidated\" (click)=\"signDocuments()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.sign?.plural }}</button>\r\n <button type=\"button\" *ngIf=\"documents.length === 1 && allIsRejected()\" class=\"fad-portal-primary\" (click)=\"onRejectDocument()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.reject?.singular }}</button>\r\n <button type=\"button\" *ngIf=\"documents.length > 1 && allIsRejected()\" class=\"fad-portal-primary\" (click)=\"onRejectDocument()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.reject?.plural }}</button>\r\n </div>\r\n </div>\r\n</ng-container>\r\n", styles: [":host{display:flex;flex-direction:column;gap:var(--fad-portal-common-separation-md)}:host .container-document{display:flex;flex-direction:column;width:100%;background-color:var(--fad-signature-fea-e-signature-documents-background-color);border-radius:var(--fad-signature-fea-e-signature-documents-border-radius);padding:var(--fad-portal-common-separation-md);box-sizing:border-box;margin-top:var(--fad-portal-common-separation-xs)}:host .container-document .document{display:flex;gap:var(--fad-portal-common-separation-md);justify-content:space-between;border-bottom:1px solid var(--fad-portal-common-border-color);padding:var(--fad-portal-common-separation-md) 0}:host .container-document .document>div{flex:1}:host .container-document .document .status{text-align:center}:host .container-document .document .pages{text-align:end;color:var(--fad-portal-common-legends-secondary)}:host .document:only-child{border-bottom:none!important}:host .container-instruction-file{display:flex;gap:var(--fad-portal-common-separation-md);justify-content:space-between}:host .container-instruction-file .select-file{color:var(--fad-portal-common-primary-color);cursor:pointer}:host .container-upload{width:100%;box-sizing:border-box;border-radius:var(--fad-signature-fea-e-signature-upload-border-radius);border:var(--fad-signature-fea-e-signature-upload-border);padding:var(--fad-portal-common-separation-md);margin-top:var(--fad-portal-common-separation-xs);display:flex;flex-direction:column;gap:var(--fad-portal-common-separation-xs);align-items:center;justify-content:center;text-align:center;background-color:var(--fad-signature-fea-e-signature-upload-background-color)}:host .container-upload .instruction{color:var(--fad-portal-common-legends-secondary)}:host .container-upload .upload-btn{max-width:90%;width:300px;box-sizing:border-box;background-color:var(--fad-signature-fea-e-signature-upload-button-background-color);border-radius:var(--fad-signature-fea-e-signature-upload-button-border-radius);color:var(--fad-portal-common-legends-tertiary);padding:var(--fad-portal-common-separation-xs);cursor:pointer;transition:all .2s ease-out;display:flex;align-items:center;justify-content:center;text-align:center;gap:var(--fad-portal-common-separation-xs)}:host .container-upload .upload-btn:hover{background-color:var(--fad-signature-fea-e-signature-upload-button-hover)}:host .container-file{display:flex;gap:var(--fad-portal-common-separation-md);align-items:center;padding:var(--fad-portal-common-separation-md);border:2px solid var(--fad-portal-common-successful-color);height:71px;border-radius:var(--fad-signature-fea-e-signature-file-border-radius);margin-top:var(--fad-portal-common-separation-xs)}:host .container-file .document-img{background-color:var(--fad-signature-fea-e-signature-file-img-background-color);width:40px;height:40px;border-radius:100%;display:flex;align-items:center;justify-content:center}:host .container-file .document-img img{width:60%;max-width:100%;max-height:100%}:host .fad-portal-container-input .input-password{position:relative}:host .fad-portal-container-input .input-password input{padding-right:100px}:host .fad-portal-container-input .input-password .password-show{position:absolute;right:10px;top:50%;transform:translateY(-50%);color:var(--fad-portal-common-legends-secondary);cursor:pointer}:host .container-confirm{display:flex;justify-content:space-between;align-items:center;gap:var(--fad-portal-common-separation-xs)}:host .container-confirm>div:first-child{display:flex;gap:var(--fad-portal-common-separation-xs)}:host .container-confirm>div:first-child>div:first-child{width:25px;height:25px}:host .container-confirm .action{max-width:80%;width:400px}:host .container-confirm ng-fad-image-inline{cursor:pointer}@media (max-width: 992px){:host .container-document .document{flex-direction:column;gap:var(--fad-portal-common-separation-xs)}:host .container-document .document .status,:host .container-document .document .pages{text-align:start!important}:host .container-confirm{flex-direction:column}:host .container-confirm .action{max-width:100%;width:100%!important}}\n"] }]
813
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.FormBuilder }, { type: i2$1.FadService }, { type: i2$1.MifielService }]; }, propDecorators: { configuration: [{
894
+ args: [{ selector: 'ng-fad-signature-fea-upload-e-signature', template: "<ng-container *ngIf=\"showComponent\">\r\n <div>\r\n <div *ngIf=\"documents.length > 1\" class=\"fad-portal-title-bold\">{{ documentPluralTitle }}</div>\r\n <div *ngIf=\"documents.length === 1\" class=\"fad-portal-title-bold\">{{ documentSingularTitle }}</div>\r\n\r\n <div class=\"container-document fad-portal-content\">\r\n <div *ngFor=\"let i of documents\" class=\"document\">\r\n <div>{{ i.doc.name }}</div>\r\n <div class=\"status fad-portal-content-bold\">{{ i.approved ? configuration.customization?.moduleCustomization?.legends?.documents?.status?.approved : configuration.customization?.moduleCustomization?.legends?.documents?.status?.rejected }}</div>\r\n <div class=\"pages\">{{ i.doc.pages }} {{ i.doc.pages > 1 ? configuration.customization?.moduleCustomization?.legends?.documents?.pages?.plural : configuration.customization?.moduleCustomization?.legends?.documents?.pages?.singular }}</div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!allIsRejected()\">\r\n <div class=\"fad-portal-title-bold\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.title }}</div>\r\n\r\n <div>\r\n <div class=\"container-instruction-file\">\r\n <div class=\"fad-portal-content\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.cer?.label }}</div>\r\n <div *ngIf=\"cer?.value\" class=\"fad-portal-content select-file\" (click)=\"openFilePicker(fileCerInput)\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.upload }}</div>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"!cer?.value\"\r\n class=\"container-upload\"\r\n (click)=\"openFilePicker(fileCerInput)\"\r\n dragDropDocument\r\n [formatList]=\"formatCerList\"\r\n [acceptMultipleFiles]=\"false\"\r\n (onfiledropped)=\"onfiledropped($event, 'cer')\"\r\n (onerror)=\"onerrorDirective($event, 'cer')\">\r\n <div class=\"fad-portal-content instruction\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.cer?.instruction }}</div>\r\n <div class=\"fad-portal-content-bold upload-btn\">\r\n <ng-fad-image-inline [src]=\"uploadImg\"></ng-fad-image-inline>\r\n <span>{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.cer?.upload }}</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"cer?.value\" class=\"container-file\">\r\n <div class=\"document-img\">\r\n <img [src]=\"fileImg\" alt=\"\">\r\n </div>\r\n <div class=\"fad-portal-content\">{{ cer?.value.name }}</div>\r\n </div>\r\n\r\n <input type=\"file\" accept=\".cer\" #fileCerInput style=\"display: none\" (change)=\"onFileChange($event, 'cer')\">\r\n </div>\r\n\r\n <div>\r\n <div class=\"container-instruction-file\">\r\n <div class=\"fad-portal-content\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.key?.label }}</div>\r\n <div *ngIf=\"key?.value\" class=\"fad-portal-content select-file\" (click)=\"openFilePicker(fileKeyInput)\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.upload }}</div>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"!key?.value\"\r\n class=\"container-upload\"\r\n (click)=\"openFilePicker(fileKeyInput)\"\r\n dragDropDocument\r\n [formatList]=\"formatKeyList\"\r\n [acceptMultipleFiles]=\"false\"\r\n (onfiledropped)=\"onfiledropped($event, 'key')\"\r\n (onerror)=\"onerrorDirective($event, 'key')\">\r\n\r\n <div class=\"fad-portal-content instruction\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.key?.instruction }}</div>\r\n <div class=\"fad-portal-content-bold upload-btn\">\r\n <ng-fad-image-inline [src]=\"uploadImg\"></ng-fad-image-inline>\r\n <span>{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.key?.upload }}</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"key?.value\" class=\"container-file\">\r\n <div class=\"document-img\">\r\n <img [src]=\"fileImg\" alt=\"\">\r\n </div>\r\n <div class=\"fad-portal-content\">{{ key?.value.name }}</div>\r\n </div>\r\n\r\n <input type=\"file\" accept=\".key\" #fileKeyInput style=\"display: none\" (change)=\"onFileChange($event, 'key')\">\r\n </div>\r\n\r\n <div class=\"fad-portal-container-input\" [formGroup]=\"form\">\r\n <label class=\"fad-portal-content\" for=\"\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.password?.label }}</label>\r\n <div class=\"input-password\">\r\n <input [type]=\"passwordInputType\" (input)=\"savePassword($event)\" formControlName=\"password\"/>\r\n <div class=\"fad-portal-content-bold password-show\">\r\n <div *ngIf=\"passwordInputType === 'text'\" (click)=\"changePaswordInputType()\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.password?.hide }}</div>\r\n <div *ngIf=\"passwordInputType === 'password'\" (click)=\"changePaswordInputType()\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.password?.show }}</div>\r\n </div>\r\n <ng-fad-portal-shared-form-errors [formData]=\"password!\" [configuration]=\"configuration.formErrors?.configuration!\"></ng-fad-portal-shared-form-errors>\r\n </div>\r\n </div>\r\n\r\n </ng-container>\r\n\r\n <div></div>\r\n\r\n <div class=\"fad-portal-content container-confirm\">\r\n <div *ngIf=\"!allIsRejected()\" (click)=\"isValidated = !isValidated\">\r\n <div>\r\n <ng-fad-image-inline *ngIf=\"isValidated\" [src]=\"checkOnImg\"></ng-fad-image-inline>\r\n <ng-fad-image-inline *ngIf=\"!isValidated\" [src]=\"checkOffImg\"></ng-fad-image-inline>\r\n </div>\r\n <div *ngIf=\"documents.length === 1\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.validate?.singular }}</div>\r\n <div *ngIf=\"documents.length > 1\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.validate?.plural }}</div>\r\n </div>\r\n\r\n <div></div>\r\n\r\n <div class=\"action\">\r\n <button type=\"button\" *ngIf=\"documents.length === 1 && !allIsRejected()\" class=\"fad-portal-primary\" [disabled]=\"!form.valid || !isValidated\" (click)=\"onSignDocuments()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.sign?.singular }}</button>\r\n <button type=\"button\" *ngIf=\"documents.length > 1 && !allIsRejected()\" class=\"fad-portal-primary\" [disabled]=\"!form.valid || !isValidated\" (click)=\"onSignDocuments()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.sign?.plural }}</button>\r\n <button type=\"button\" *ngIf=\"documents.length === 1 && allIsRejected()\" class=\"fad-portal-primary\" (click)=\"onSignDocuments()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.reject?.singular }}</button>\r\n <button type=\"button\" *ngIf=\"documents.length > 1 && allIsRejected()\" class=\"fad-portal-primary\" (click)=\"onSignDocuments()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.reject?.plural }}</button>\r\n </div>\r\n </div>\r\n</ng-container>\r\n", styles: [":host{display:flex;flex-direction:column;gap:var(--fad-portal-common-separation-md)}:host .container-document{display:flex;flex-direction:column;width:100%;background-color:var(--fad-signature-fea-e-signature-documents-background-color);border-radius:var(--fad-signature-fea-e-signature-documents-border-radius);padding:var(--fad-portal-common-separation-md);box-sizing:border-box;margin-top:var(--fad-portal-common-separation-xs)}:host .container-document .document{display:flex;gap:var(--fad-portal-common-separation-md);justify-content:space-between;border-bottom:1px solid var(--fad-portal-common-border-color);padding:var(--fad-portal-common-separation-md) 0}:host .container-document .document>div{flex:1}:host .container-document .document .status{text-align:center}:host .container-document .document .pages{text-align:end;color:var(--fad-portal-common-legends-secondary)}:host .document:only-child{border-bottom:none!important}:host .container-instruction-file{display:flex;gap:var(--fad-portal-common-separation-md);justify-content:space-between}:host .container-instruction-file .select-file{color:var(--fad-portal-common-primary-color);cursor:pointer}:host .container-upload{width:100%;box-sizing:border-box;border-radius:var(--fad-signature-fea-e-signature-upload-border-radius);border:var(--fad-signature-fea-e-signature-upload-border);padding:var(--fad-portal-common-separation-md);margin-top:var(--fad-portal-common-separation-xs);display:flex;flex-direction:column;gap:var(--fad-portal-common-separation-xs);align-items:center;justify-content:center;text-align:center;background-color:var(--fad-signature-fea-e-signature-upload-background-color)}:host .container-upload .instruction{color:var(--fad-portal-common-legends-secondary)}:host .container-upload .upload-btn{max-width:90%;width:300px;box-sizing:border-box;background-color:var(--fad-signature-fea-e-signature-upload-button-background-color);border-radius:var(--fad-signature-fea-e-signature-upload-button-border-radius);color:var(--fad-portal-common-legends-tertiary);padding:var(--fad-portal-common-separation-xs);cursor:pointer;transition:all .2s ease-out;display:flex;align-items:center;justify-content:center;text-align:center;gap:var(--fad-portal-common-separation-xs)}:host .container-upload .upload-btn:hover{background-color:var(--fad-signature-fea-e-signature-upload-button-hover)}:host .container-file{display:flex;gap:var(--fad-portal-common-separation-md);align-items:center;padding:var(--fad-portal-common-separation-md);border:2px solid var(--fad-portal-common-successful-color);height:71px;border-radius:var(--fad-signature-fea-e-signature-file-border-radius);margin-top:var(--fad-portal-common-separation-xs)}:host .container-file .fad-portal-content{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .container-file .document-img{background-color:var(--fad-signature-fea-e-signature-file-img-background-color);width:40px;height:40px;border-radius:100%;display:flex;align-items:center;justify-content:center}:host .container-file .document-img img{width:60%;max-width:100%;max-height:100%}:host .fad-portal-container-input .input-password{position:relative}:host .fad-portal-container-input .input-password input{padding-right:100px}:host .fad-portal-container-input .input-password .password-show{position:absolute;right:10px;top:50%;transform:translateY(-50%);color:var(--fad-portal-common-legends-secondary);cursor:pointer}:host .container-confirm{display:flex;justify-content:space-between;align-items:center;gap:var(--fad-portal-common-separation-xs)}:host .container-confirm>div:first-child{display:flex;gap:var(--fad-portal-common-separation-xs)}:host .container-confirm>div:first-child>div:first-child{width:25px;height:25px}:host .container-confirm .action{max-width:80%;width:400px}:host .container-confirm ng-fad-image-inline{cursor:pointer}@media (max-width: 992px){:host .container-document .document{flex-direction:column;gap:var(--fad-portal-common-separation-xs)}:host .container-document .document .status,:host .container-document .document .pages{text-align:start!important}:host .container-confirm{flex-direction:column}:host .container-confirm .action{max-width:100%;width:100%!important}}\n"] }]
895
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.FormBuilder }, { type: i2$2.FadService }, { type: i2$2.MifielService }]; }, propDecorators: { configuration: [{
814
896
  type: Input
815
897
  }], documents: [{
816
898
  type: Input
@@ -835,11 +917,11 @@ class GenericErrorFeaComponent {
835
917
  this.configuration = Utils.mergeConfiguration(new Configuration(), GENERIC_ERROR_FEA_CONFIGURATION_DEFAULT, this.configuration);
836
918
  }
837
919
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GenericErrorFeaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
838
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: GenericErrorFeaComponent, selector: "ng-fad-signature-fea-generic-error-fea", inputs: { configuration: "configuration", title: "title", instruction: "instruction" }, ngImport: i0, template: "<ng-fad-image-inline [src]=\"errorIgm\"></ng-fad-image-inline>\n<div class=\"fad-portal-title-bold\">{{ title ? title : configuration.customization?.moduleCustomization?.legends?.title }}</div>\n<div class=\"fad-portal-content\">{{ instruction ? instruction : configuration.customization?.moduleCustomization?.legends?.instruction }}</div>\n", styles: [":host{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:var(--fad-portal-common-separation-md)}\n"], dependencies: [{ kind: "component", type: i4.NgFadImageInlineComponent, selector: "ng-fad-image-inline", inputs: ["src"] }] }); }
920
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: GenericErrorFeaComponent, selector: "ng-fad-signature-fea-generic-error-fea", inputs: { configuration: "configuration", title: "title", instruction: "instruction" }, ngImport: i0, template: "<ng-fad-image-inline [src]=\"errorIgm\"></ng-fad-image-inline>\r\n<div class=\"fad-portal-title-bold\">{{ title ? title : configuration.customization?.moduleCustomization?.legends?.title }}</div>\r\n<div class=\"fad-portal-content\">{{ instruction ? instruction : configuration.customization?.moduleCustomization?.legends?.instruction }}</div>\r\n", styles: [":host{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:var(--fad-portal-common-separation-md)}\n"], dependencies: [{ kind: "component", type: i4$1.NgFadImageInlineComponent, selector: "ng-fad-image-inline", inputs: ["src"] }] }); }
839
921
  }
840
922
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GenericErrorFeaComponent, decorators: [{
841
923
  type: Component,
842
- args: [{ selector: 'ng-fad-signature-fea-generic-error-fea', template: "<ng-fad-image-inline [src]=\"errorIgm\"></ng-fad-image-inline>\n<div class=\"fad-portal-title-bold\">{{ title ? title : configuration.customization?.moduleCustomization?.legends?.title }}</div>\n<div class=\"fad-portal-content\">{{ instruction ? instruction : configuration.customization?.moduleCustomization?.legends?.instruction }}</div>\n", styles: [":host{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:var(--fad-portal-common-separation-md)}\n"] }]
924
+ args: [{ selector: 'ng-fad-signature-fea-generic-error-fea', template: "<ng-fad-image-inline [src]=\"errorIgm\"></ng-fad-image-inline>\r\n<div class=\"fad-portal-title-bold\">{{ title ? title : configuration.customization?.moduleCustomization?.legends?.title }}</div>\r\n<div class=\"fad-portal-content\">{{ instruction ? instruction : configuration.customization?.moduleCustomization?.legends?.instruction }}</div>\r\n", styles: [":host{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:var(--fad-portal-common-separation-md)}\n"] }]
843
925
  }], propDecorators: { configuration: [{
844
926
  type: Input
845
927
  }], title: [{
@@ -863,24 +945,20 @@ class ValidateSignatureComponent {
863
945
  this.getSignerStatusFea();
864
946
  }
865
947
  validateData() {
866
- if (!this.requisitionId) {
867
- this.onerror.emit(new ResponseError(ValidateSignatureErrorCode.NO_REQUISITION_ID, getValidateSignatureErrorDescription(ValidateSignatureErrorCode.NO_REQUISITION_ID), 'ng-fad-signature-fea-validate-signature'));
868
- return false;
869
- }
870
- if (!this.signerId) {
871
- this.onerror.emit(new ResponseError(ValidateSignatureErrorCode.NO_SIGNER_ID, getValidateSignatureErrorDescription(ValidateSignatureErrorCode.NO_SIGNER_ID), 'ng-fad-signature-fea-validate-signature'));
948
+ if (!this.ticket) {
949
+ this.onerror.emit(new ResponseError(ValidateSignatureErrorCode.NO_TICKET, getValidateSignatureErrorDescription(ValidateSignatureErrorCode.NO_TICKET), 'ng-fad-signature-fea-validate-signature'));
872
950
  return false;
873
951
  }
874
952
  return true;
875
953
  }
876
954
  getSignerStatusFea() {
877
955
  this.onloader.emit(true);
878
- this.fad.getSignerStatusFea(this.requisitionId, this.signerId, this.configuration.services?.signerStatusFea)
956
+ this.fad.getSignerStatusByTicket(this.ticket, this.configuration.services?.signerStatusFea)
879
957
  .pipe(finalize(() => this.onloader.emit(false)))
880
958
  .subscribe({
881
959
  next: (res) => {
882
960
  if (res.success) {
883
- res.data === 'COMPLETED' ? this.onsigned.emit(res.data) : this.oncomplete.emit(res.data);
961
+ res.data === 'IN_PROGRESS' ? this.oncomplete.emit(res.data) : this.onsigned.emit(res.data);
884
962
  }
885
963
  else {
886
964
  this.onerror.emit(new ResponseError(ValidateSignatureErrorCode.SERVICE, res.error, 'ng-fad-signature-fea-validate-signature'));
@@ -894,17 +972,15 @@ class ValidateSignatureComponent {
894
972
  setCustomizationStyle(targetElement = document.documentElement) {
895
973
  this.configuration = Utils.mergeConfiguration(new Configuration(), VALIDATE_SIGNATURE_CONFIGURATION_DEFAULT, this.configuration);
896
974
  }
897
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ValidateSignatureComponent, deps: [{ token: i2$1.FadService }], target: i0.ɵɵFactoryTarget.Component }); }
898
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ValidateSignatureComponent, selector: "ng-fad-signature-fea-validate-signature", inputs: { configuration: "configuration", signerId: "signerId", requisitionId: "requisitionId" }, outputs: { onloader: "onloader", onerror: "onerror", oncomplete: "oncomplete", onsigned: "onsigned" }, ngImport: i0, template: "", styles: [""] }); }
975
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ValidateSignatureComponent, deps: [{ token: i2$2.FadService }], target: i0.ɵɵFactoryTarget.Component }); }
976
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ValidateSignatureComponent, selector: "ng-fad-signature-fea-validate-signature", inputs: { configuration: "configuration", ticket: "ticket" }, outputs: { onloader: "onloader", onerror: "onerror", oncomplete: "oncomplete", onsigned: "onsigned" }, ngImport: i0, template: "", styles: [""] }); }
899
977
  }
900
978
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ValidateSignatureComponent, decorators: [{
901
979
  type: Component,
902
980
  args: [{ selector: 'ng-fad-signature-fea-validate-signature', template: "" }]
903
- }], ctorParameters: function () { return [{ type: i2$1.FadService }]; }, propDecorators: { configuration: [{
981
+ }], ctorParameters: function () { return [{ type: i2$2.FadService }]; }, propDecorators: { configuration: [{
904
982
  type: Input
905
- }], signerId: [{
906
- type: Input
907
- }], requisitionId: [{
983
+ }], ticket: [{
908
984
  type: Input
909
985
  }], onloader: [{
910
986
  type: Output
@@ -916,21 +992,131 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
916
992
  type: Output
917
993
  }] } });
918
994
 
995
+ const SIGNATURE_SUMMARY_DEFAULT = {
996
+ dateFormat: 'es-MX',
997
+ customization: {
998
+ moduleCustomization: {
999
+ style: {},
1000
+ legends: {
1001
+ signed: "Documentos firmados",
1002
+ rejected: "Documentos rechazados",
1003
+ legend: "Te hemos enviado el resumen del proceso y el documento firmado a tu correo electrónico",
1004
+ documentRejected: "Documento rechazado"
1005
+ }
1006
+ }
1007
+ },
1008
+ pathDependencies: {
1009
+ imageDirectory: 'assets/images/fad-signature-fea/signature-summary/',
1010
+ }
1011
+ };
1012
+
1013
+ class SignatureSummaryComponent {
1014
+ constructor(hostContext) {
1015
+ this.hostContext = hostContext;
1016
+ this.oncomplete = new EventEmitter();
1017
+ this.images = {
1018
+ reject: '',
1019
+ send: ''
1020
+ };
1021
+ this.signedCount = 0;
1022
+ this.rejectedCount = 0;
1023
+ this.isAllDocumentsRejected = true;
1024
+ this.currentDate = '';
1025
+ this.id = '';
1026
+ this.pdfsName = '';
1027
+ }
1028
+ ngOnInit() {
1029
+ console.log(this.documentRequest);
1030
+ this.setCustomizationStyle(this.hostContext.nativeElement);
1031
+ if (this.configuration?.pathDependencies?.imageDirectory) {
1032
+ this.images.reject = this.configuration.pathDependencies?.images?.reject ?? `${this.configuration.pathDependencies.imageDirectory}/rejected.svg`;
1033
+ this.images.send = this.configuration.pathDependencies?.images?.send ?? `${this.configuration.pathDependencies.imageDirectory}/send.svg`;
1034
+ }
1035
+ this.updateDocumentCounts();
1036
+ this.getPdfNames();
1037
+ this.setCurrentDate();
1038
+ }
1039
+ setCurrentDate() {
1040
+ const now = new Date();
1041
+ let hours = now.getHours();
1042
+ const minutes = now.getMinutes();
1043
+ const amPm = hours >= 12 ? 'PM' : 'AM';
1044
+ hours = hours % 12 || 12;
1045
+ const formattedMinutes = minutes < 10 ? '0' + minutes : minutes;
1046
+ this.currentDate = `${now.toLocaleDateString(this.configuration.dateFormat)} | ${hours}:${formattedMinutes} ${amPm}`;
1047
+ }
1048
+ updateDocumentCounts() {
1049
+ // Contar documentos firmados (approved: true)
1050
+ this.documentRequest.forEach((doc) => {
1051
+ this.id = doc.id;
1052
+ if (doc.approved) {
1053
+ this.signedCount += 1;
1054
+ }
1055
+ else {
1056
+ this.rejectedCount += 1;
1057
+ }
1058
+ });
1059
+ console.log(this.documentRequest, this.signedCount, this.rejectedCount);
1060
+ if (this.signedCount > 0) {
1061
+ this.isAllDocumentsRejected = false;
1062
+ }
1063
+ else {
1064
+ this.isAllDocumentsRejected = true;
1065
+ }
1066
+ }
1067
+ getPdfNames() {
1068
+ let currentFlag = '';
1069
+ let previewFlag = '';
1070
+ this.documentRequest.forEach((doc) => {
1071
+ if (this.pdfsName === '') {
1072
+ this.pdfsName = doc.doc?.name.replace('.pdf', '');
1073
+ currentFlag = doc.idRequisition;
1074
+ previewFlag = doc.idRequisition;
1075
+ }
1076
+ currentFlag = doc.idRequisition;
1077
+ if (currentFlag !== previewFlag) {
1078
+ this.pdfsName += ',' + doc.doc?.name.replace('.pdf', '');
1079
+ currentFlag = doc.idRequisition;
1080
+ previewFlag = doc.idRequisition;
1081
+ }
1082
+ });
1083
+ }
1084
+ setCustomizationStyle(targetElement = document.documentElement) {
1085
+ this.configuration = Utils.mergeConfiguration(new Configuration(), SIGNATURE_SUMMARY_DEFAULT, this.configuration);
1086
+ }
1087
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SignatureSummaryComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
1088
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SignatureSummaryComponent, selector: "ng-fad-signature-fea-signature-summary", inputs: { documentRequest: "documentRequest", configuration: "configuration" }, outputs: { oncomplete: "oncomplete" }, ngImport: i0, template: "<div class=\"fad-portal-content\">\n \n <ng-container *ngIf=\"!isAllDocumentsRejected\" >\n <ng-fad-image-inline\n [src]=\"images.send\"\n >\n </ng-fad-image-inline>\n <div class=\"fad-portal-title-bold\">\n {{pdfsName}}\n </div>\n <div class=\"fad-portal-content-bold date\">{{ currentDate }}</div>\n <div class=\"summary\">\n <div class=\"fad-portal-content-bold signeds\">\n <div>{{configuration.customization?.moduleCustomization?.legends?.signed}}</div>\n <div>{{signedCount}}</div>\n </div>\n <div class=\"line\">\n\n </div>\n <div class=\"fad-portal-content-bold rejecteds\">\n <div>{{configuration.customization?.moduleCustomization?.legends?.rejected}}</div>\n <div>{{rejectedCount}}</div>\n </div>\n </div>\n <div class=\"legends\">\n {{configuration.customization?.moduleCustomization?.legends?.legend}}\n </div>\n </ng-container>\n <ng-container *ngIf=\"isAllDocumentsRejected\" >\n <ng-fad-image-inline\n [src]=\"images.reject\"\n >\n </ng-fad-image-inline>\n <div class=\"document-rejected\"> {{configuration.customization?.moduleCustomization?.legends?.documentRejected}} </div>\n <div class=\"fad-portal-title-bold title-document\">\n {{pdfsName}}\n </div>\n <div class=\"id-requisition\">\n ID {{id}} | {{ currentDate }}\n </div>\n </ng-container>\n \n</div>", styles: [".fad-portal-content{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;row-gap:var(--fad-portal-common-separation-sm)}.fad-portal-content .fad-portal-title{margin-top:var(--fad-portal-common-separation-sm);margin-bottom:var(--fad-portal-common-separation-sm)}.fad-portal-content .date{color:#aaa}.fad-portal-content .summary{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;row-gap:var(--fad-portal-common-separation-sm);margin-bottom:var(--fad-portal-common-separation-xs)}.fad-portal-content .summary .signeds,.fad-portal-content .summary .rejecteds{width:100%;display:flex;justify-content:space-between}.fad-portal-content .summary .line{width:100%;border:1px solid var(--fad-portal-common-border-color)}.fad-portal-content .legends{text-align:center}.fad-portal-content .document-rejected{color:#aaa;margin-bottom:var(--fad-portal-common-separation-sm)}.fad-portal-content .id-requisition{color:#aaa;margin-top:var(--fad-portal-common-separation-sm)}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4$1.NgFadImageInlineComponent, selector: "ng-fad-image-inline", inputs: ["src"] }] }); }
1089
+ }
1090
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SignatureSummaryComponent, decorators: [{
1091
+ type: Component,
1092
+ args: [{ selector: 'ng-fad-signature-fea-signature-summary', template: "<div class=\"fad-portal-content\">\n \n <ng-container *ngIf=\"!isAllDocumentsRejected\" >\n <ng-fad-image-inline\n [src]=\"images.send\"\n >\n </ng-fad-image-inline>\n <div class=\"fad-portal-title-bold\">\n {{pdfsName}}\n </div>\n <div class=\"fad-portal-content-bold date\">{{ currentDate }}</div>\n <div class=\"summary\">\n <div class=\"fad-portal-content-bold signeds\">\n <div>{{configuration.customization?.moduleCustomization?.legends?.signed}}</div>\n <div>{{signedCount}}</div>\n </div>\n <div class=\"line\">\n\n </div>\n <div class=\"fad-portal-content-bold rejecteds\">\n <div>{{configuration.customization?.moduleCustomization?.legends?.rejected}}</div>\n <div>{{rejectedCount}}</div>\n </div>\n </div>\n <div class=\"legends\">\n {{configuration.customization?.moduleCustomization?.legends?.legend}}\n </div>\n </ng-container>\n <ng-container *ngIf=\"isAllDocumentsRejected\" >\n <ng-fad-image-inline\n [src]=\"images.reject\"\n >\n </ng-fad-image-inline>\n <div class=\"document-rejected\"> {{configuration.customization?.moduleCustomization?.legends?.documentRejected}} </div>\n <div class=\"fad-portal-title-bold title-document\">\n {{pdfsName}}\n </div>\n <div class=\"id-requisition\">\n ID {{id}} | {{ currentDate }}\n </div>\n </ng-container>\n \n</div>", styles: [".fad-portal-content{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;row-gap:var(--fad-portal-common-separation-sm)}.fad-portal-content .fad-portal-title{margin-top:var(--fad-portal-common-separation-sm);margin-bottom:var(--fad-portal-common-separation-sm)}.fad-portal-content .date{color:#aaa}.fad-portal-content .summary{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;row-gap:var(--fad-portal-common-separation-sm);margin-bottom:var(--fad-portal-common-separation-xs)}.fad-portal-content .summary .signeds,.fad-portal-content .summary .rejecteds{width:100%;display:flex;justify-content:space-between}.fad-portal-content .summary .line{width:100%;border:1px solid var(--fad-portal-common-border-color)}.fad-portal-content .legends{text-align:center}.fad-portal-content .document-rejected{color:#aaa;margin-bottom:var(--fad-portal-common-separation-sm)}.fad-portal-content .id-requisition{color:#aaa;margin-top:var(--fad-portal-common-separation-sm)}\n"] }]
1093
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { documentRequest: [{
1094
+ type: Input
1095
+ }], configuration: [{
1096
+ type: Input
1097
+ }], oncomplete: [{
1098
+ type: Output
1099
+ }] } });
1100
+
919
1101
  class NgFadSignatureFeaModule {
920
1102
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgFadSignatureFeaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
921
1103
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgFadSignatureFeaModule, declarations: [ValidateRfcComponent,
922
1104
  DocumentApprovalListComponent,
923
1105
  UploadESignatureComponent,
1106
+ PdfViewerFeaComponent,
924
1107
  GenericErrorFeaComponent,
925
- ValidateSignatureComponent], imports: [CommonModule,
1108
+ ValidateSignatureComponent,
1109
+ SignatureSummaryComponent], imports: [CommonModule,
926
1110
  ReactiveFormsModule,
927
1111
  NgFadSharedModule,
928
1112
  NgFadImageInlineModule,
929
1113
  NgFadViewerModule], exports: [ValidateRfcComponent,
930
1114
  DocumentApprovalListComponent,
931
1115
  UploadESignatureComponent,
1116
+ PdfViewerFeaComponent,
932
1117
  GenericErrorFeaComponent,
933
- ValidateSignatureComponent] }); }
1118
+ ValidateSignatureComponent,
1119
+ SignatureSummaryComponent] }); }
934
1120
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgFadSignatureFeaModule, imports: [CommonModule,
935
1121
  ReactiveFormsModule,
936
1122
  NgFadSharedModule,
@@ -944,8 +1130,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
944
1130
  ValidateRfcComponent,
945
1131
  DocumentApprovalListComponent,
946
1132
  UploadESignatureComponent,
1133
+ PdfViewerFeaComponent,
947
1134
  GenericErrorFeaComponent,
948
- ValidateSignatureComponent
1135
+ ValidateSignatureComponent,
1136
+ SignatureSummaryComponent
949
1137
  ],
950
1138
  imports: [
951
1139
  CommonModule,
@@ -958,8 +1146,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
958
1146
  ValidateRfcComponent,
959
1147
  DocumentApprovalListComponent,
960
1148
  UploadESignatureComponent,
1149
+ PdfViewerFeaComponent,
961
1150
  GenericErrorFeaComponent,
962
- ValidateSignatureComponent
1151
+ ValidateSignatureComponent,
1152
+ SignatureSummaryComponent
963
1153
  ]
964
1154
  }]
965
1155
  }] });
@@ -972,5 +1162,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
972
1162
  * Generated bundle index. Do not edit.
973
1163
  */
974
1164
 
975
- export { DOCUMENT_APPROVAL_LIST_DEFAULT, DocumentApprovalListComponent, DocumentApprovalListErrorCode, GENERIC_ERROR_FEA_CONFIGURATION_DEFAULT, GenericErrorFeaComponent, GenericErrorFeaErrorCode, NgFadSignatureFeaModule, SIGNATURE_FEA_CONFIGURATION_DEFAULT, UPLOAD_E_SIGNATURE_CONFIGURATION_DEFAULT, UploadESignatureComponent, UploadESignatureErrorCode, VALIDATE_SIGNATURE_CONFIGURATION_DEFAULT, ValidateRFCErrorCode, ValidateRfcComponent, ValidateSignatureComponent, ValidateSignatureErrorCode, getDocumentApprovalListErrorDescription, getGenericErrorFeaErrorDescription, getUploadESignatureErrorDescription, getValidateRFCErrorDescription, getValidateSignatureErrorDescription };
1165
+ export { DOCUMENT_APPROVAL_LIST_DEFAULT, DocumentApprovalListComponent, DocumentApprovalListErrorCode, GENERIC_ERROR_FEA_CONFIGURATION_DEFAULT, GenericErrorFeaComponent, GenericErrorFeaErrorCode, NgFadSignatureFeaModule, PDF_VIEWER_FEA_DEFAULT, PdfViewerFeaComponent, SIGNATURE_FEA_CONFIGURATION_DEFAULT, SignatureSummaryComponent, UPLOAD_E_SIGNATURE_CONFIGURATION_DEFAULT, UploadESignatureComponent, UploadESignatureErrorCode, VALIDATE_SIGNATURE_CONFIGURATION_DEFAULT, ValidateRFCErrorCode, ValidateRfcComponent, ValidateSignatureComponent, ValidateSignatureErrorCode, getDocumentApprovalListErrorDescription, getGenericErrorFeaErrorDescription, getUploadESignatureErrorDescription, getValidateRFCErrorDescription, getValidateSignatureErrorDescription };
976
1166
  //# sourceMappingURL=fad-producto-portal-ng-fad-signature-fea.mjs.map