ngx-scandoc 1.0.1 → 1.0.3
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.
- package/core/components/base.component.d.ts +6 -0
- package/core/components/camera-switch/camera-switch.component.d.ts +11 -0
- package/core/components/components.module.d.ts +10 -3
- package/core/components/scan/scan.component.d.ts +119 -0
- package/core/components/scan-results/scan-results.component.d.ts +20 -0
- package/core/components/webcam/webcam/webcam.component.d.ts +5 -2
- package/core/interfaces/config.d.ts +16 -0
- package/dialogs/components/blank/blank.component.d.ts +2 -3
- package/dialogs/components/scan-profile/scan-profile.component.d.ts +10 -116
- package/dialogs/components/turn-document/turn-document.component.d.ts +12 -0
- package/dialogs/dialogs.core.provider.d.ts +1 -1
- package/dialogs/dialogs.module.d.ts +2 -2
- package/esm2020/core/components/base.component.mjs +15 -0
- package/esm2020/core/components/camera-switch/camera-switch.component.mjs +22 -0
- package/esm2020/core/components/components.module.mjs +34 -6
- package/esm2020/core/components/scan/scan.component.mjs +582 -0
- package/esm2020/core/components/scan-results/scan-results.component.mjs +38 -0
- package/esm2020/core/components/webcam/webcam/webcam.component.mjs +23 -12
- package/esm2020/core/interfaces/config.mjs +2 -0
- package/esm2020/dialogs/components/blank/blank.component.mjs +6 -7
- package/esm2020/dialogs/components/scan-profile/scan-profile.component.mjs +33 -741
- package/esm2020/dialogs/components/scan-selfie/scan-selfie.component.mjs +2 -2
- package/esm2020/dialogs/components/turn-document/turn-document.component.mjs +32 -0
- package/esm2020/dialogs/dialogs.core.provider.mjs +18 -9
- package/esm2020/dialogs/dialogs.module.mjs +7 -7
- package/esm2020/lib/ngx-scandoc.module.mjs +1 -1
- package/esm2020/providers/auth.provider.mjs +3 -2
- package/esm2020/providers/camera.provider.mjs +40 -0
- package/esm2020/providers/interceptor.provider.mjs +2 -2
- package/esm2020/providers/layout.provider.mjs +28 -0
- package/esm2020/providers/scan.provider.mjs +4 -6
- package/esm2020/public-api.mjs +4 -2
- package/fesm2015/ngx-scandoc.mjs +1765 -1752
- package/fesm2015/ngx-scandoc.mjs.map +1 -1
- package/fesm2020/ngx-scandoc.mjs +1962 -1949
- package/fesm2020/ngx-scandoc.mjs.map +1 -1
- package/lib/ngx-scandoc.module.d.ts +1 -15
- package/package.json +1 -1
- package/providers/auth.provider.d.ts +1 -1
- package/providers/camera.provider.d.ts +17 -0
- package/providers/layout.provider.d.ts +11 -0
- package/providers/scan.provider.d.ts +3 -5
- package/public-api.d.ts +3 -1
- package/dialogs/components/scan-mobile/scan-mobile.component.d.ts +0 -16
- package/esm2020/dialogs/components/scan-mobile/scan-mobile.component.mjs +0 -43
package/fesm2020/ngx-scandoc.mjs
CHANGED
|
@@ -1,66 +1,65 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Component, Input, Output, ViewChild, HostListener, NgModule,
|
|
2
|
+
import { Injectable, EventEmitter, Component, Input, Output, ViewChild, HostListener, NgModule, Inject, ChangeDetectionStrategy, HostBinding, Pipe, ViewContainerRef } from '@angular/core';
|
|
3
3
|
import * as i5 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { Observable, from, of,
|
|
6
|
-
import { tap, switchMap, map, share, catchError } from 'rxjs/operators';
|
|
5
|
+
import { Observable, from, Subject, of, tap as tap$1, distinctUntilChanged, throwError } from 'rxjs';
|
|
6
|
+
import { tap, switchMap, takeUntil, map, share, catchError } from 'rxjs/operators';
|
|
7
7
|
import * as i1 from '@angular/cdk/layout';
|
|
8
8
|
import { Breakpoints } from '@angular/cdk/layout';
|
|
9
9
|
import * as i2 from '@angular/cdk/platform';
|
|
10
10
|
import { PlatformModule } from '@angular/cdk/platform';
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
11
|
+
import { v4 } from 'uuid';
|
|
12
|
+
import * as i4 from '@angular/forms';
|
|
13
|
+
import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
14
|
+
import moment from 'moment';
|
|
15
|
+
import * as i1$1 from '@angular/common/http';
|
|
16
|
+
import { HttpHeaders, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
17
|
+
import * as i1$2 from '@ngx-translate/core';
|
|
18
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
19
|
+
import jwt_decode from 'jwt-decode';
|
|
20
|
+
import * as i7$1 from '@angular/material/icon';
|
|
21
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
22
|
+
import * as i6 from '@angular/material/button';
|
|
15
23
|
import { MatButtonModule } from '@angular/material/button';
|
|
16
|
-
import * as
|
|
24
|
+
import * as i9 from '@angular/material/progress-bar';
|
|
25
|
+
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
26
|
+
import * as i5$1 from '@angular/material/card';
|
|
17
27
|
import { MatCardModule } from '@angular/material/card';
|
|
28
|
+
import * as i7 from '@ngx-formly/core';
|
|
29
|
+
import { FormlyModule } from '@ngx-formly/core';
|
|
30
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
31
|
+
import { MatBadgeModule } from '@angular/material/badge';
|
|
18
32
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
19
33
|
import { MatChipsModule } from '@angular/material/chips';
|
|
20
|
-
import * as
|
|
34
|
+
import * as i6$1 from '@angular/material/core';
|
|
21
35
|
import { MatNativeDateModule } from '@angular/material/core';
|
|
22
36
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
23
|
-
import * as i1$
|
|
37
|
+
import * as i1$4 from '@angular/material/dialog';
|
|
24
38
|
import { MatDialogModule, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
25
|
-
import * as i9 from '@angular/material/icon';
|
|
26
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
27
39
|
import { MatInputModule } from '@angular/material/input';
|
|
28
40
|
import { MatListModule } from '@angular/material/list';
|
|
29
41
|
import { MatMenuModule } from '@angular/material/menu';
|
|
30
42
|
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
31
|
-
import * as i1$4 from '@angular/material/progress-bar';
|
|
32
|
-
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
33
43
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
34
|
-
import * as
|
|
44
|
+
import * as i5$2 from '@angular/material/select';
|
|
35
45
|
import { MatSelectModule } from '@angular/material/select';
|
|
36
46
|
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
37
47
|
import { MatSliderModule } from '@angular/material/slider';
|
|
38
48
|
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
39
49
|
import { MatTableModule } from '@angular/material/table';
|
|
40
50
|
import { MatTabsModule } from '@angular/material/tabs';
|
|
41
|
-
import * as i6 from '@angular/forms';
|
|
42
|
-
import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
43
|
-
import { v4 } from 'uuid';
|
|
44
|
-
import moment from 'moment';
|
|
45
|
-
import * as i1$2 from '@angular/common/http';
|
|
46
|
-
import { HttpHeaders, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
47
|
-
import jwt_decode from 'jwt-decode';
|
|
48
|
-
import * as i4 from '@angular/flex-layout';
|
|
49
|
-
import { FlexModule, FlexLayoutModule } from '@angular/flex-layout';
|
|
50
|
-
import * as i5$1 from '@angular/flex-layout/extended';
|
|
51
|
-
import * as i4$1 from '@ngx-translate/core';
|
|
52
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
53
|
-
import { webSocket } from 'rxjs/webSocket';
|
|
54
|
-
import * as i3$1 from 'angularx-qrcode';
|
|
55
|
-
import { QRCodeModule } from 'angularx-qrcode';
|
|
56
|
-
import * as i6$1 from '@angular/material/form-field';
|
|
57
|
-
import * as i8$1 from '@ngx-formly/core';
|
|
58
|
-
import { FormlyModule } from '@ngx-formly/core';
|
|
59
51
|
import { FieldType, FormlyMaterialModule } from '@ngx-formly/material';
|
|
60
|
-
import * as i3
|
|
52
|
+
import * as i3 from 'ngx-avatars';
|
|
61
53
|
import { AvatarModule } from 'ngx-avatars';
|
|
62
54
|
import { FormlySelectModule } from '@ngx-formly/core/select';
|
|
63
55
|
import { FormlyMatDatepickerModule } from '@ngx-formly/material/datepicker';
|
|
56
|
+
import * as i4$1 from '@angular/material/form-field';
|
|
57
|
+
import * as i1$3 from '@angular/platform-browser';
|
|
58
|
+
import * as i4$2 from '@angular/flex-layout';
|
|
59
|
+
import { FlexModule, FlexLayoutModule } from '@angular/flex-layout';
|
|
60
|
+
import * as i5$3 from '@angular/flex-layout/extended';
|
|
61
|
+
import { QRCodeModule } from 'angularx-qrcode';
|
|
62
|
+
import { webSocket } from 'rxjs/webSocket';
|
|
64
63
|
|
|
65
64
|
/**
|
|
66
65
|
* Container class for a captured webcam image
|
|
@@ -402,12 +401,63 @@ addEventListener('message', ({ data }) => {
|
|
|
402
401
|
});
|
|
403
402
|
`;
|
|
404
403
|
|
|
405
|
-
class
|
|
406
|
-
constructor(
|
|
404
|
+
class BaseComponent {
|
|
405
|
+
constructor() {
|
|
406
|
+
this.$destroy = new Subject();
|
|
407
|
+
}
|
|
408
|
+
__subs(observable) {
|
|
409
|
+
return observable.pipe(takeUntil(this.$destroy));
|
|
410
|
+
}
|
|
411
|
+
__destroy() {
|
|
412
|
+
this.$destroy.next(true);
|
|
413
|
+
this.$destroy.complete();
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
class NgxScandocCameraProvider {
|
|
418
|
+
constructor() {
|
|
419
|
+
this.switchCamera = new Subject();
|
|
420
|
+
this.cameraReady = false;
|
|
421
|
+
this.cameraSwitched = new Subject();
|
|
422
|
+
this.multipleWebcamsAvailable = false;
|
|
423
|
+
this.setup();
|
|
424
|
+
}
|
|
425
|
+
setup() {
|
|
426
|
+
WebcamUtil.getAvailableVideoInputs().subscribe((mediaDevices) => {
|
|
427
|
+
console.log('[DEVICES]', mediaDevices.map((d) => d.label));
|
|
428
|
+
this.mediaDevices = mediaDevices;
|
|
429
|
+
this.multipleWebcamsAvailable = mediaDevices && mediaDevices.length > 1;
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
selectCamera(event) {
|
|
433
|
+
this.switchCamera.next(event.value);
|
|
434
|
+
}
|
|
435
|
+
cameraWasSwitched(deviceId) {
|
|
436
|
+
console.log('[active device]', deviceId);
|
|
437
|
+
this.deviceId = deviceId;
|
|
438
|
+
this.cameraReady = true;
|
|
439
|
+
}
|
|
440
|
+
get nextWebcamObservable() {
|
|
441
|
+
return this.switchCamera.asObservable();
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
NgxScandocCameraProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxScandocCameraProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
445
|
+
NgxScandocCameraProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxScandocCameraProvider, providedIn: 'root' });
|
|
446
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NgxScandocCameraProvider, decorators: [{
|
|
447
|
+
type: Injectable,
|
|
448
|
+
args: [{
|
|
449
|
+
providedIn: 'root',
|
|
450
|
+
}]
|
|
451
|
+
}], ctorParameters: function () { return []; } });
|
|
452
|
+
|
|
453
|
+
class WebcamComponent extends BaseComponent {
|
|
454
|
+
constructor(breakpointObserver, platform, cd, zone, cameraProvider) {
|
|
455
|
+
super();
|
|
407
456
|
this.breakpointObserver = breakpointObserver;
|
|
408
457
|
this.platform = platform;
|
|
409
458
|
this.cd = cd;
|
|
410
459
|
this.zone = zone;
|
|
460
|
+
this.cameraProvider = cameraProvider;
|
|
411
461
|
/** Defines the max width of the webcam area in px */
|
|
412
462
|
this.width = 640;
|
|
413
463
|
/** Defines the max height of the webcam area in px */
|
|
@@ -614,6 +664,7 @@ class WebcamComponent {
|
|
|
614
664
|
this.video.nativeElement.setAttribute('width', this.canvasSize.width);
|
|
615
665
|
}
|
|
616
666
|
}
|
|
667
|
+
this.drawRectangle();
|
|
617
668
|
this.cd.detectChanges();
|
|
618
669
|
}
|
|
619
670
|
setupWorker() {
|
|
@@ -637,14 +688,14 @@ class WebcamComponent {
|
|
|
637
688
|
ngAfterViewInit() {
|
|
638
689
|
this.setupWorker();
|
|
639
690
|
if (this.imageHandler) {
|
|
640
|
-
this.imageHandler.subscribe((resp) => {
|
|
691
|
+
this.__subs(this.imageHandler).subscribe((resp) => {
|
|
641
692
|
if (resp.type === 'stop') {
|
|
642
693
|
this.worker?.postMessage({ type: 'stop' });
|
|
643
694
|
}
|
|
644
695
|
});
|
|
645
696
|
}
|
|
646
|
-
this.breakpointObserver
|
|
647
|
-
.observe([Breakpoints.HandsetPortrait, Breakpoints.HandsetLandscape])
|
|
697
|
+
this.__subs(this.breakpointObserver
|
|
698
|
+
.observe([Breakpoints.HandsetPortrait, Breakpoints.HandsetLandscape]))
|
|
648
699
|
.subscribe((state) => {
|
|
649
700
|
if (this.platform.IOS || this.platform.ANDROID) {
|
|
650
701
|
// this.landscape = state.breakpoints[Breakpoints.HandsetLandscape];
|
|
@@ -699,6 +750,7 @@ class WebcamComponent {
|
|
|
699
750
|
});
|
|
700
751
|
this.nativeVideoElement.srcObject = null;
|
|
701
752
|
}
|
|
753
|
+
this.__destroy();
|
|
702
754
|
// this.nativeVideoElement.src = null;
|
|
703
755
|
// this.nativeVideoElement.srcObject = null;
|
|
704
756
|
}
|
|
@@ -925,6 +977,8 @@ class WebcamComponent {
|
|
|
925
977
|
frameRate: { min: 20, ideal: 30, max: 31 },
|
|
926
978
|
};
|
|
927
979
|
}
|
|
980
|
+
// desired.height.ideal = 1000;
|
|
981
|
+
// desired.width.ideal = 1000;
|
|
928
982
|
if (desired.height.ideal && desired.height.ideal >= 1600) {
|
|
929
983
|
desired.height.ideal = 1600;
|
|
930
984
|
desired.width.ideal = 1600;
|
|
@@ -1054,17 +1108,19 @@ class WebcamComponent {
|
|
|
1054
1108
|
get cardRectangle() {
|
|
1055
1109
|
const _canvas = this.canvas.nativeElement;
|
|
1056
1110
|
const docSize = this.type === 'selfie' ? 1 : 86 / 55;
|
|
1111
|
+
console.log(_canvas.width, _canvas.height);
|
|
1057
1112
|
let padding = 10;
|
|
1058
1113
|
let rWidth = _canvas.width - 2 * padding;
|
|
1059
1114
|
let rHeight = rWidth / docSize;
|
|
1060
1115
|
let top = (_canvas.height - rHeight) / 2;
|
|
1061
|
-
if (!this.isMobile) {
|
|
1116
|
+
if ((!this.isMobile && _canvas.width !== _canvas.height)) {
|
|
1062
1117
|
padding = 40;
|
|
1063
1118
|
rHeight = _canvas.height - 2 * padding;
|
|
1064
1119
|
rWidth = rHeight * docSize;
|
|
1065
1120
|
top = (_canvas.height - rHeight) / 2;
|
|
1066
1121
|
padding = (_canvas.width - rWidth) / 2;
|
|
1067
1122
|
}
|
|
1123
|
+
console.log(padding, top, rWidth, rHeight);
|
|
1068
1124
|
return { padding, top, rWidth, rHeight };
|
|
1069
1125
|
}
|
|
1070
1126
|
get snapRectangle() {
|
|
@@ -1084,6 +1140,7 @@ class WebcamComponent {
|
|
|
1084
1140
|
const activeDeviceId = WebcamComponent.getDeviceIdFromMediaStreamTrack(stream.getVideoTracks()[0]);
|
|
1085
1141
|
const videoTrack = stream.getTracks()[0];
|
|
1086
1142
|
this.trackSettings = videoTrack.getSettings();
|
|
1143
|
+
this.cameraProvider.cameraWasSwitched(activeDeviceId);
|
|
1087
1144
|
this.cameraSwitched.next(activeDeviceId);
|
|
1088
1145
|
setTimeout(() => {
|
|
1089
1146
|
this.zone.run(() => {
|
|
@@ -1189,12 +1246,12 @@ WebcamComponent.DEFAULT_VIDEO_OPTIONS = {
|
|
|
1189
1246
|
};
|
|
1190
1247
|
WebcamComponent.DEFAULT_IMAGE_TYPE = 'image/jpeg';
|
|
1191
1248
|
WebcamComponent.DEFAULT_IMAGE_QUALITY = 1;
|
|
1192
|
-
WebcamComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: WebcamComponent, deps: [{ token: i1.BreakpointObserver }, { token: i2.Platform }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
1193
|
-
WebcamComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: WebcamComponent, selector: "app-webcam", inputs: { imageHandler: "imageHandler", id: "id", type: "type", width: "width", height: "height", videoOptions: "videoOptions", allowCameraSwitch: "allowCameraSwitch", mirrorImage: "mirrorImage", captureImageData: "captureImageData", imageType: "imageType", imageQuality: "imageQuality", trigger: "trigger", switchCamera: "switchCamera" }, outputs: { imageCapture: "imageCapture", initError: "initError", imageClick: "imageClick", cameraSwitched: "cameraSwitched", videoReady: "videoReady", destroyed: "destroyed" }, host: { listeners: { "window:resize": "onResize($event)" } }, viewQueries: [{ propertyName: "video", first: true, predicate: ["video"], descendants: true, static: true }, { propertyName: "videoStreamer", first: true, predicate: ["videoStreamer"], descendants: true, static: true }, { propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true, static: true }, { propertyName: "canvasSnapshot", first: true, predicate: ["canvasSnapshot"], descendants: true, static: true }, { propertyName: "canvasResize", first: true, predicate: ["canvasResize"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"webcam-wrapper\">\n <div>\n <video\n #video\n autoplay\n muted\n style=\"display: block\"\n playsinline\n\n ></video>\n\n <div class=\"rectangle\">\n <canvas\n #canvas\n [ngStyle]=\"{ visibility: showVideo ? 'visible' : 'hidden' }\"\n [width]=\"canvasSize.width\"\n [height]=\"canvasSize.height\"\n ></canvas>\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:row;flex:1;transform:transale3d(0,0,0);background-color:#000}.webcam-wrapper{display:flex;flex-direction:row;align-items:center;flex:1;justify-content:center}.webcam-wrapper canvas{transform:transale3d(0,0,0);display:block;position:relative;z-index:20;left:0;top:0}.webcam-wrapper .rectangle{position:absolute;left:0;top:0;display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%;height:100%}\n"], dependencies: [{ kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
1249
|
+
WebcamComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: WebcamComponent, deps: [{ token: i1.BreakpointObserver }, { token: i2.Platform }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: NgxScandocCameraProvider }], target: i0.ɵɵFactoryTarget.Component });
|
|
1250
|
+
WebcamComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: WebcamComponent, selector: "app-webcam", inputs: { imageHandler: "imageHandler", id: "id", type: "type", width: "width", height: "height", videoOptions: "videoOptions", allowCameraSwitch: "allowCameraSwitch", mirrorImage: "mirrorImage", captureImageData: "captureImageData", imageType: "imageType", imageQuality: "imageQuality", trigger: "trigger", switchCamera: "switchCamera" }, outputs: { imageCapture: "imageCapture", initError: "initError", imageClick: "imageClick", cameraSwitched: "cameraSwitched", videoReady: "videoReady", destroyed: "destroyed" }, host: { listeners: { "window:resize": "onResize($event)" } }, viewQueries: [{ propertyName: "video", first: true, predicate: ["video"], descendants: true, static: true }, { propertyName: "videoStreamer", first: true, predicate: ["videoStreamer"], descendants: true, static: true }, { propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true, static: true }, { propertyName: "canvasSnapshot", first: true, predicate: ["canvasSnapshot"], descendants: true, static: true }, { propertyName: "canvasResize", first: true, predicate: ["canvasResize"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"webcam-wrapper\">\n <div>\n <video\n #video\n autoplay\n muted\n style=\"display: block\"\n playsinline\n\n ></video>\n\n <div class=\"rectangle\">\n\n <canvas\n #canvas\n [ngStyle]=\"{ visibility: showVideo ? 'visible' : 'hidden' }\"\n [width]=\"canvasSize.width\"\n [height]=\"canvasSize.height\"\n ></canvas>\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:row;flex:1;transform:transale3d(0,0,0);background-color:#000}.webcam-wrapper{display:flex;flex-direction:row;align-items:center;flex:1;justify-content:center}.webcam-wrapper canvas{transform:transale3d(0,0,0);display:block;position:relative;z-index:20;left:0;top:0}.webcam-wrapper .rectangle{position:absolute;left:0;top:0;display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%;height:100%}\n"], dependencies: [{ kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
1194
1251
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: WebcamComponent, decorators: [{
|
|
1195
1252
|
type: Component,
|
|
1196
|
-
args: [{ selector: 'app-webcam', template: "<div class=\"webcam-wrapper\">\n <div>\n <video\n #video\n autoplay\n muted\n style=\"display: block\"\n playsinline\n\n ></video>\n\n <div class=\"rectangle\">\n <canvas\n #canvas\n [ngStyle]=\"{ visibility: showVideo ? 'visible' : 'hidden' }\"\n [width]=\"canvasSize.width\"\n [height]=\"canvasSize.height\"\n ></canvas>\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:row;flex:1;transform:transale3d(0,0,0);background-color:#000}.webcam-wrapper{display:flex;flex-direction:row;align-items:center;flex:1;justify-content:center}.webcam-wrapper canvas{transform:transale3d(0,0,0);display:block;position:relative;z-index:20;left:0;top:0}.webcam-wrapper .rectangle{position:absolute;left:0;top:0;display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%;height:100%}\n"] }]
|
|
1197
|
-
}], ctorParameters: function () { return [{ type: i1.BreakpointObserver }, { type: i2.Platform }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }]; }, propDecorators: { imageHandler: [{
|
|
1253
|
+
args: [{ selector: 'app-webcam', template: "<div class=\"webcam-wrapper\">\n <div>\n <video\n #video\n autoplay\n muted\n style=\"display: block\"\n playsinline\n\n ></video>\n\n <div class=\"rectangle\">\n\n <canvas\n #canvas\n [ngStyle]=\"{ visibility: showVideo ? 'visible' : 'hidden' }\"\n [width]=\"canvasSize.width\"\n [height]=\"canvasSize.height\"\n ></canvas>\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:row;flex:1;transform:transale3d(0,0,0);background-color:#000}.webcam-wrapper{display:flex;flex-direction:row;align-items:center;flex:1;justify-content:center}.webcam-wrapper canvas{transform:transale3d(0,0,0);display:block;position:relative;z-index:20;left:0;top:0}.webcam-wrapper .rectangle{position:absolute;left:0;top:0;display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%;height:100%}\n"] }]
|
|
1254
|
+
}], ctorParameters: function () { return [{ type: i1.BreakpointObserver }, { type: i2.Platform }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: NgxScandocCameraProvider }]; }, propDecorators: { imageHandler: [{
|
|
1198
1255
|
type: Input
|
|
1199
1256
|
}], id: [{
|
|
1200
1257
|
type: Input
|
|
@@ -1269,256 +1326,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
1269
1326
|
}]
|
|
1270
1327
|
}] });
|
|
1271
1328
|
|
|
1272
|
-
class
|
|
1273
|
-
}
|
|
1274
|
-
CoreComponentsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CoreComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1275
|
-
CoreComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CoreComponentsModule, imports: [CommonModule, WebcamModule], exports: [WebcamModule] });
|
|
1276
|
-
CoreComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CoreComponentsModule, imports: [CommonModule, WebcamModule, WebcamModule] });
|
|
1277
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CoreComponentsModule, decorators: [{
|
|
1278
|
-
type: NgModule,
|
|
1279
|
-
args: [{
|
|
1280
|
-
imports: [CommonModule, WebcamModule],
|
|
1281
|
-
declarations: [],
|
|
1282
|
-
exports: [WebcamModule],
|
|
1283
|
-
}]
|
|
1284
|
-
}] });
|
|
1285
|
-
|
|
1286
|
-
class SafeResourceUrlPipe {
|
|
1287
|
-
constructor(sanitizer) {
|
|
1288
|
-
this.sanitizer = sanitizer;
|
|
1289
|
-
}
|
|
1290
|
-
transform(style) {
|
|
1291
|
-
return this.sanitizer.bypassSecurityTrustResourceUrl(style);
|
|
1292
|
-
// return this.sanitizer.bypassSecurityTrustStyle(style);
|
|
1293
|
-
// return this.sanitizer.bypassSecurityTrustXxx(style); - see docs
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
SafeResourceUrlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SafeResourceUrlPipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1297
|
-
SafeResourceUrlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SafeResourceUrlPipe, name: "safeResourceUrl" });
|
|
1298
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SafeResourceUrlPipe, decorators: [{
|
|
1299
|
-
type: Pipe,
|
|
1300
|
-
args: [{ name: 'safeResourceUrl' }]
|
|
1301
|
-
}], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }]; } });
|
|
1302
|
-
|
|
1303
|
-
class CorePipesModule {
|
|
1304
|
-
}
|
|
1305
|
-
CorePipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CorePipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1306
|
-
CorePipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CorePipesModule, declarations: [SafeResourceUrlPipe], exports: [SafeResourceUrlPipe] });
|
|
1307
|
-
CorePipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CorePipesModule });
|
|
1308
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CorePipesModule, decorators: [{
|
|
1309
|
-
type: NgModule,
|
|
1310
|
-
args: [{
|
|
1311
|
-
declarations: [SafeResourceUrlPipe],
|
|
1312
|
-
imports: [],
|
|
1313
|
-
exports: [
|
|
1314
|
-
SafeResourceUrlPipe,
|
|
1315
|
-
],
|
|
1316
|
-
}]
|
|
1317
|
-
}] });
|
|
1318
|
-
|
|
1319
|
-
class MaterialModule {
|
|
1320
|
-
}
|
|
1321
|
-
MaterialModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1322
|
-
MaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: MaterialModule, imports: [MatNativeDateModule,
|
|
1323
|
-
MatDatepickerModule,
|
|
1324
|
-
MatCardModule,
|
|
1325
|
-
MatMenuModule,
|
|
1326
|
-
MatIconModule,
|
|
1327
|
-
MatButtonModule,
|
|
1328
|
-
MatDialogModule,
|
|
1329
|
-
MatInputModule,
|
|
1330
|
-
MatSnackBarModule,
|
|
1331
|
-
MatProgressBarModule,
|
|
1332
|
-
MatTableModule,
|
|
1333
|
-
MatProgressSpinnerModule,
|
|
1334
|
-
MatPaginatorModule,
|
|
1335
|
-
MatSelectModule,
|
|
1336
|
-
MatCheckboxModule,
|
|
1337
|
-
MatChipsModule,
|
|
1338
|
-
MatBadgeModule,
|
|
1339
|
-
MatListModule,
|
|
1340
|
-
MatTabsModule,
|
|
1341
|
-
MatSliderModule,
|
|
1342
|
-
MatSlideToggleModule], exports: [MatNativeDateModule,
|
|
1343
|
-
MatDatepickerModule,
|
|
1344
|
-
MatSelectModule,
|
|
1345
|
-
MatCardModule,
|
|
1346
|
-
MatMenuModule,
|
|
1347
|
-
MatIconModule,
|
|
1348
|
-
MatButtonModule,
|
|
1349
|
-
MatDialogModule,
|
|
1350
|
-
MatInputModule,
|
|
1351
|
-
MatSnackBarModule,
|
|
1352
|
-
MatProgressBarModule,
|
|
1353
|
-
MatProgressSpinnerModule,
|
|
1354
|
-
MatTableModule,
|
|
1355
|
-
MatPaginatorModule,
|
|
1356
|
-
MatChipsModule,
|
|
1357
|
-
MatBadgeModule,
|
|
1358
|
-
MatCheckboxModule,
|
|
1359
|
-
MatListModule,
|
|
1360
|
-
MatTabsModule,
|
|
1361
|
-
MatSlideToggleModule,
|
|
1362
|
-
MatAutocompleteModule] });
|
|
1363
|
-
MaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MaterialModule, imports: [MatNativeDateModule,
|
|
1364
|
-
MatDatepickerModule,
|
|
1365
|
-
MatCardModule,
|
|
1366
|
-
MatMenuModule,
|
|
1367
|
-
MatIconModule,
|
|
1368
|
-
MatButtonModule,
|
|
1369
|
-
MatDialogModule,
|
|
1370
|
-
MatInputModule,
|
|
1371
|
-
MatSnackBarModule,
|
|
1372
|
-
MatProgressBarModule,
|
|
1373
|
-
MatTableModule,
|
|
1374
|
-
MatProgressSpinnerModule,
|
|
1375
|
-
MatPaginatorModule,
|
|
1376
|
-
MatSelectModule,
|
|
1377
|
-
MatCheckboxModule,
|
|
1378
|
-
MatChipsModule,
|
|
1379
|
-
MatBadgeModule,
|
|
1380
|
-
MatListModule,
|
|
1381
|
-
MatTabsModule,
|
|
1382
|
-
MatSliderModule,
|
|
1383
|
-
MatSlideToggleModule, MatNativeDateModule,
|
|
1384
|
-
MatDatepickerModule,
|
|
1385
|
-
MatSelectModule,
|
|
1386
|
-
MatCardModule,
|
|
1387
|
-
MatMenuModule,
|
|
1388
|
-
MatIconModule,
|
|
1389
|
-
MatButtonModule,
|
|
1390
|
-
MatDialogModule,
|
|
1391
|
-
MatInputModule,
|
|
1392
|
-
MatSnackBarModule,
|
|
1393
|
-
MatProgressBarModule,
|
|
1394
|
-
MatProgressSpinnerModule,
|
|
1395
|
-
MatTableModule,
|
|
1396
|
-
MatPaginatorModule,
|
|
1397
|
-
MatChipsModule,
|
|
1398
|
-
MatBadgeModule,
|
|
1399
|
-
MatCheckboxModule,
|
|
1400
|
-
MatListModule,
|
|
1401
|
-
MatTabsModule,
|
|
1402
|
-
MatSlideToggleModule,
|
|
1403
|
-
MatAutocompleteModule] });
|
|
1404
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MaterialModule, decorators: [{
|
|
1405
|
-
type: NgModule,
|
|
1406
|
-
args: [{
|
|
1407
|
-
imports: [
|
|
1408
|
-
MatNativeDateModule,
|
|
1409
|
-
MatDatepickerModule,
|
|
1410
|
-
MatCardModule,
|
|
1411
|
-
MatMenuModule,
|
|
1412
|
-
MatIconModule,
|
|
1413
|
-
MatButtonModule,
|
|
1414
|
-
MatDialogModule,
|
|
1415
|
-
MatInputModule,
|
|
1416
|
-
MatSnackBarModule,
|
|
1417
|
-
MatProgressBarModule,
|
|
1418
|
-
MatTableModule,
|
|
1419
|
-
MatProgressSpinnerModule,
|
|
1420
|
-
MatPaginatorModule,
|
|
1421
|
-
MatSelectModule,
|
|
1422
|
-
MatCheckboxModule,
|
|
1423
|
-
MatChipsModule,
|
|
1424
|
-
MatBadgeModule,
|
|
1425
|
-
MatListModule,
|
|
1426
|
-
MatTabsModule,
|
|
1427
|
-
MatSliderModule,
|
|
1428
|
-
MatSlideToggleModule,
|
|
1429
|
-
],
|
|
1430
|
-
exports: [
|
|
1431
|
-
MatNativeDateModule,
|
|
1432
|
-
MatDatepickerModule,
|
|
1433
|
-
MatSelectModule,
|
|
1434
|
-
MatCardModule,
|
|
1435
|
-
MatMenuModule,
|
|
1436
|
-
MatIconModule,
|
|
1437
|
-
MatButtonModule,
|
|
1438
|
-
MatDialogModule,
|
|
1439
|
-
MatInputModule,
|
|
1440
|
-
MatSnackBarModule,
|
|
1441
|
-
MatProgressBarModule,
|
|
1442
|
-
MatProgressSpinnerModule,
|
|
1443
|
-
MatTableModule,
|
|
1444
|
-
MatPaginatorModule,
|
|
1445
|
-
MatChipsModule,
|
|
1446
|
-
MatBadgeModule,
|
|
1447
|
-
MatCheckboxModule,
|
|
1448
|
-
MatListModule,
|
|
1449
|
-
MatTabsModule,
|
|
1450
|
-
MatSlideToggleModule,
|
|
1451
|
-
MatAutocompleteModule,
|
|
1452
|
-
],
|
|
1453
|
-
providers: [],
|
|
1454
|
-
}]
|
|
1455
|
-
}] });
|
|
1456
|
-
|
|
1457
|
-
class AuthProvider {
|
|
1329
|
+
class ScanProvider {
|
|
1458
1330
|
constructor(http, config) {
|
|
1459
1331
|
this.http = http;
|
|
1460
1332
|
this.config = config;
|
|
1461
|
-
this.
|
|
1462
|
-
this.
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
console.log('EXPIRED');
|
|
1471
|
-
return true;
|
|
1472
|
-
}
|
|
1473
|
-
const { iat, exp } = this.tokenTimestamps;
|
|
1474
|
-
return iat + 20 > exp;
|
|
1475
|
-
}
|
|
1476
|
-
resetToken() {
|
|
1477
|
-
this.token = '';
|
|
1478
|
-
}
|
|
1479
|
-
get accesToken() {
|
|
1480
|
-
return this.tokenExpired ? this.getToken() : of(this.token);
|
|
1481
|
-
}
|
|
1482
|
-
getToken() {
|
|
1483
|
-
return this.http
|
|
1484
|
-
.post(this.config.path, {
|
|
1485
|
-
clientId: this.config.clientId,
|
|
1486
|
-
token: this.config.tokenName,
|
|
1487
|
-
})
|
|
1488
|
-
.pipe(map((data) => data.accessToken), tap((token) => {
|
|
1489
|
-
this.token = token;
|
|
1490
|
-
const decoded = jwt_decode(this.token);
|
|
1491
|
-
const { iat, exp } = decoded;
|
|
1492
|
-
this.tokenTimestamps = { iat, exp };
|
|
1493
|
-
}));
|
|
1494
|
-
}
|
|
1495
|
-
}
|
|
1496
|
-
AuthProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthProvider, deps: [{ token: i1$2.HttpClient }, { token: 'configAuth' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1497
|
-
AuthProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthProvider, providedIn: 'root' });
|
|
1498
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthProvider, decorators: [{
|
|
1499
|
-
type: Injectable,
|
|
1500
|
-
args: [{
|
|
1501
|
-
providedIn: 'root',
|
|
1502
|
-
}]
|
|
1503
|
-
}], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: undefined, decorators: [{
|
|
1504
|
-
type: Inject,
|
|
1505
|
-
args: ['configAuth']
|
|
1506
|
-
}] }]; } });
|
|
1507
|
-
|
|
1508
|
-
class ScanProvider {
|
|
1509
|
-
constructor(http, auth, config) {
|
|
1510
|
-
this.http = http;
|
|
1511
|
-
this.auth = auth;
|
|
1512
|
-
this.config = config;
|
|
1513
|
-
this.enableVerification = true;
|
|
1514
|
-
this.canStoreImages = true;
|
|
1515
|
-
}
|
|
1516
|
-
genderList() {
|
|
1517
|
-
return {
|
|
1518
|
-
M: 'MALE',
|
|
1519
|
-
'M/M': 'MALE',
|
|
1520
|
-
F: 'FEMALE',
|
|
1521
|
-
'F/F': 'FEMALE',
|
|
1333
|
+
this.enableVerification = true;
|
|
1334
|
+
this.canStoreImages = true;
|
|
1335
|
+
}
|
|
1336
|
+
genderList() {
|
|
1337
|
+
return {
|
|
1338
|
+
M: 'MALE',
|
|
1339
|
+
'M/M': 'MALE',
|
|
1340
|
+
F: 'FEMALE',
|
|
1341
|
+
'F/F': 'FEMALE',
|
|
1522
1342
|
};
|
|
1523
1343
|
}
|
|
1524
1344
|
stateless(DocumentFaceImage, LiveFaceImage) {
|
|
@@ -1975,1104 +1795,1663 @@ class ScanProvider {
|
|
|
1975
1795
|
});
|
|
1976
1796
|
}
|
|
1977
1797
|
}
|
|
1978
|
-
ScanProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanProvider, deps: [{ token: i1$
|
|
1798
|
+
ScanProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanProvider, deps: [{ token: i1$1.HttpClient }, { token: 'config' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1979
1799
|
ScanProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanProvider, providedIn: 'root' });
|
|
1980
1800
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanProvider, decorators: [{
|
|
1981
1801
|
type: Injectable,
|
|
1982
1802
|
args: [{
|
|
1983
1803
|
providedIn: 'root',
|
|
1984
1804
|
}]
|
|
1985
|
-
}], ctorParameters: function () { return [{ type: i1$
|
|
1805
|
+
}], ctorParameters: function () { return [{ type: i1$1.HttpClient }, { type: undefined, decorators: [{
|
|
1986
1806
|
type: Inject,
|
|
1987
1807
|
args: ['config']
|
|
1988
1808
|
}] }]; } });
|
|
1989
1809
|
|
|
1990
|
-
class
|
|
1991
|
-
constructor(
|
|
1992
|
-
this.
|
|
1993
|
-
this.
|
|
1994
|
-
this.
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
}
|
|
1998
|
-
setModel(model) {
|
|
1999
|
-
this.data.data.model = model;
|
|
2000
|
-
this.init();
|
|
1810
|
+
class LayoutProvider {
|
|
1811
|
+
constructor(breakpointObserver) {
|
|
1812
|
+
this.breakpointObserver = breakpointObserver;
|
|
1813
|
+
this.isMobile = false;
|
|
1814
|
+
this.breakpoint$ = this.breakpointObserver
|
|
1815
|
+
.observe(['(min-width: 768px)'])
|
|
1816
|
+
.pipe(tap$1((value) => console.log(value)), distinctUntilChanged());
|
|
2001
1817
|
}
|
|
2002
1818
|
init() {
|
|
2003
|
-
this.
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
componentRef.instance.data = this.data.data;
|
|
2008
|
-
componentRef.instance.dialogRef = this.dialogRef;
|
|
2009
|
-
if (componentRef.instance.init) {
|
|
2010
|
-
componentRef.instance.init();
|
|
2011
|
-
}
|
|
2012
|
-
this.cd.detectChanges();
|
|
2013
|
-
}
|
|
2014
|
-
ngAfterViewInit() {
|
|
2015
|
-
if (!this.initSet) {
|
|
2016
|
-
this.init();
|
|
2017
|
-
}
|
|
1819
|
+
this.breakpoint$.subscribe((v) => {
|
|
1820
|
+
this.isMobile = !v.matches;
|
|
1821
|
+
document.body.className = this.isMobile ? 'mobile' : 'desktop';
|
|
1822
|
+
});
|
|
2018
1823
|
}
|
|
2019
1824
|
}
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type:
|
|
2023
|
-
type:
|
|
2024
|
-
args: [{
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
}] }, { type: i0.ComponentFactoryResolver }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { body: [{
|
|
2029
|
-
type: ViewChild,
|
|
2030
|
-
args: ['body', { read: ViewContainerRef, static: true }]
|
|
2031
|
-
}] } });
|
|
2032
|
-
|
|
2033
|
-
class LoadingComponent {
|
|
2034
|
-
}
|
|
2035
|
-
LoadingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2036
|
-
LoadingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: LoadingComponent, selector: "app-loading", ngImport: i0, template: "<div style=\"width:240px;\">\n\n <div class=\"pb-16\" style=\"font-size: 18px;padding-bottom:16px;\">\n Loading...\n </div>\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: i1$4.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }] });
|
|
2037
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoadingComponent, decorators: [{
|
|
2038
|
-
type: Component,
|
|
2039
|
-
args: [{ selector: 'app-loading', template: "<div style=\"width:240px;\">\n\n <div class=\"pb-16\" style=\"font-size: 18px;padding-bottom:16px;\">\n Loading...\n </div>\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n</div>\n" }]
|
|
2040
|
-
}] });
|
|
1825
|
+
LayoutProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LayoutProvider, deps: [{ token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1826
|
+
LayoutProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LayoutProvider, providedIn: 'root' });
|
|
1827
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LayoutProvider, decorators: [{
|
|
1828
|
+
type: Injectable,
|
|
1829
|
+
args: [{
|
|
1830
|
+
providedIn: 'root',
|
|
1831
|
+
}]
|
|
1832
|
+
}], ctorParameters: function () { return [{ type: i1.BreakpointObserver }]; } });
|
|
2041
1833
|
|
|
2042
|
-
class
|
|
2043
|
-
constructor(
|
|
2044
|
-
this.
|
|
2045
|
-
this.
|
|
2046
|
-
this.
|
|
2047
|
-
this.
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
dirty: 'opps.svg',
|
|
1834
|
+
class AuthProvider {
|
|
1835
|
+
constructor(http, config) {
|
|
1836
|
+
this.http = http;
|
|
1837
|
+
this.config = config;
|
|
1838
|
+
this.token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJDbGllbnQiOiJQcm90ZWwiLCJTdWJDbGllbnQiOiJIMSIsIklzc3VlVGltZSI6IjA5LjAzLjIwMjIsIDA5OjQ3OjAwIn0.u_FP16TGuZ4LtGbsIxBjy8vCJJuTyBbRs2gPPZU2vgaeSvLdfi1iEVcRjRVh873hkluOtotUGmw0v3Jdh-cHgQ';
|
|
1839
|
+
this.tokenTimestamps = {
|
|
1840
|
+
exp: 0,
|
|
1841
|
+
iat: 0,
|
|
2051
1842
|
};
|
|
2052
|
-
this.options = {};
|
|
2053
1843
|
}
|
|
2054
|
-
|
|
2055
|
-
|
|
1844
|
+
setConfig() { }
|
|
1845
|
+
get tokenExpired() {
|
|
1846
|
+
return false;
|
|
1847
|
+
if (this.token == '' || this.tokenTimestamps.exp === 0) {
|
|
1848
|
+
console.log('EXPIRED');
|
|
1849
|
+
return true;
|
|
1850
|
+
}
|
|
1851
|
+
const { iat, exp } = this.tokenTimestamps;
|
|
1852
|
+
return iat + 20 > exp;
|
|
2056
1853
|
}
|
|
2057
|
-
|
|
2058
|
-
this.
|
|
1854
|
+
resetToken() {
|
|
1855
|
+
this.token = '';
|
|
2059
1856
|
}
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
this.options = this.data.options || {};
|
|
2063
|
-
this.type = this.options.type || this.data.type || 'prompt';
|
|
1857
|
+
get accesToken() {
|
|
1858
|
+
return this.tokenExpired ? this.getToken() : of(this.token);
|
|
2064
1859
|
}
|
|
2065
|
-
|
|
2066
|
-
this.
|
|
1860
|
+
getToken() {
|
|
1861
|
+
return this.http
|
|
1862
|
+
.post(this.config.path, {
|
|
1863
|
+
clientId: this.config.clientId,
|
|
1864
|
+
token: this.config.tokenName,
|
|
1865
|
+
})
|
|
1866
|
+
.pipe(map((data) => data.accessToken), tap((token) => {
|
|
1867
|
+
this.token = token;
|
|
1868
|
+
const decoded = jwt_decode(this.token);
|
|
1869
|
+
const { iat, exp } = decoded;
|
|
1870
|
+
this.tokenTimestamps = { iat, exp };
|
|
1871
|
+
}));
|
|
2067
1872
|
}
|
|
2068
|
-
close() { }
|
|
2069
1873
|
}
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type:
|
|
2073
|
-
type:
|
|
2074
|
-
args: [{
|
|
2075
|
-
|
|
1874
|
+
AuthProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthProvider, deps: [{ token: i1$1.HttpClient }, { token: 'configAuth' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1875
|
+
AuthProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthProvider, providedIn: 'root' });
|
|
1876
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthProvider, decorators: [{
|
|
1877
|
+
type: Injectable,
|
|
1878
|
+
args: [{
|
|
1879
|
+
providedIn: 'root',
|
|
1880
|
+
}]
|
|
1881
|
+
}], ctorParameters: function () { return [{ type: i1$1.HttpClient }, { type: undefined, decorators: [{
|
|
2076
1882
|
type: Inject,
|
|
2077
|
-
args: [
|
|
2078
|
-
}] }]; }
|
|
2079
|
-
type: HostListener,
|
|
2080
|
-
args: ['document:keyup.enter', ['$event']]
|
|
2081
|
-
}], onEscapePress: [{
|
|
2082
|
-
type: HostListener,
|
|
2083
|
-
args: ['document:keyup.escape', ['$event']]
|
|
2084
|
-
}] } });
|
|
1883
|
+
args: ['configAuth']
|
|
1884
|
+
}] }]; } });
|
|
2085
1885
|
|
|
2086
|
-
class
|
|
2087
|
-
constructor() {
|
|
2088
|
-
this.
|
|
2089
|
-
}
|
|
2090
|
-
connect(id = 1) {
|
|
2091
|
-
this.subject = webSocket('wss://localhost:3000?id=' + id);
|
|
2092
|
-
}
|
|
2093
|
-
setup() {
|
|
2094
|
-
this.connect(1);
|
|
2095
|
-
// try {
|
|
2096
|
-
// this.pc = new RTCPeerConnection({
|
|
2097
|
-
// iceServers: [
|
|
2098
|
-
// { urls: 'stun:stun.services.mozilla.com' },
|
|
2099
|
-
// { urls: 'stun:stun.l.google.com:19302' },
|
|
2100
|
-
// ],
|
|
2101
|
-
// });
|
|
2102
|
-
// } catch (error) {
|
|
2103
|
-
// console.log(error);
|
|
2104
|
-
// this.pc = new RTCPeerConnection({
|
|
2105
|
-
// iceServers: [
|
|
2106
|
-
// { urls: 'stun:stun.services.mozilla.com' },
|
|
2107
|
-
// { urls: 'stun:stun.l.google.com:19302' },
|
|
2108
|
-
// ],
|
|
2109
|
-
// });
|
|
2110
|
-
// }
|
|
2111
|
-
// this.pc.onicecandidate = (event) => {
|
|
2112
|
-
// event.candidate
|
|
2113
|
-
// ? this.sendMessage({ ice: event.candidate })
|
|
2114
|
-
// : console.log('Sent All Ice');
|
|
2115
|
-
// };
|
|
2116
|
-
// if (this.pc) {
|
|
2117
|
-
// from(this.pc.createOffer())
|
|
2118
|
-
// .pipe(switchMap((offer) => from(this.pc.setLocalDescription(offer))))
|
|
2119
|
-
// .subscribe((data: any) => {
|
|
2120
|
-
// this.sendMessage({
|
|
2121
|
-
// type: 'offer',
|
|
2122
|
-
// sdp: this.pc.localDescription,
|
|
2123
|
-
// });
|
|
2124
|
-
// });
|
|
2125
|
-
// }
|
|
1886
|
+
class TranslationProvider {
|
|
1887
|
+
constructor(translate) {
|
|
1888
|
+
this.translate = translate;
|
|
2126
1889
|
}
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
1890
|
+
forms(item, namespace = null) {
|
|
1891
|
+
if (item.fieldGroup) {
|
|
1892
|
+
item.fieldGroup = item.fieldGroup.map((field) => this.forms(field));
|
|
1893
|
+
}
|
|
1894
|
+
const prefix = namespace ? namespace + '.' : '';
|
|
1895
|
+
if (item.templateOptions &&
|
|
1896
|
+
(item.templateOptions.label ||
|
|
1897
|
+
item.templateOptions.placeholder ||
|
|
1898
|
+
item.templateOptions.options)) {
|
|
1899
|
+
if (!item.expressionProperties) {
|
|
1900
|
+
item.expressionProperties = {};
|
|
1901
|
+
}
|
|
1902
|
+
if (item.templateOptions.label) {
|
|
1903
|
+
item.expressionProperties['templateOptions.label'] =
|
|
1904
|
+
this.translate.stream(prefix + item.templateOptions.label);
|
|
1905
|
+
}
|
|
1906
|
+
if (item.templateOptions.placeholder) {
|
|
1907
|
+
item.expressionProperties['templateOptions.placeholder'] =
|
|
1908
|
+
this.translate.stream(prefix + item.templateOptions.placeholder);
|
|
1909
|
+
}
|
|
1910
|
+
if (Array.isArray(item.templateOptions.options)) {
|
|
1911
|
+
item.expressionProperties['templateOptions.options'] =
|
|
1912
|
+
item.templateOptions.options.map((m) => {
|
|
1913
|
+
// console.log(m);
|
|
1914
|
+
if (m.label) {
|
|
1915
|
+
m.label = this.translate.instant(prefix + m.label);
|
|
1916
|
+
}
|
|
1917
|
+
return m;
|
|
1918
|
+
});
|
|
1919
|
+
}
|
|
1920
|
+
}
|
|
1921
|
+
return item;
|
|
2130
1922
|
}
|
|
2131
1923
|
}
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type:
|
|
1924
|
+
TranslationProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TranslationProvider, deps: [{ token: i1$2.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1925
|
+
TranslationProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TranslationProvider, providedIn: 'root' });
|
|
1926
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TranslationProvider, decorators: [{
|
|
2135
1927
|
type: Injectable,
|
|
2136
1928
|
args: [{
|
|
2137
1929
|
providedIn: 'root',
|
|
2138
1930
|
}]
|
|
2139
|
-
}], ctorParameters: function () { return []; } });
|
|
1931
|
+
}], ctorParameters: function () { return [{ type: i1$2.TranslateService }]; } });
|
|
2140
1932
|
|
|
2141
|
-
class
|
|
2142
|
-
constructor(
|
|
2143
|
-
this.dialogRef = dialogRef;
|
|
2144
|
-
this.data = data;
|
|
2145
|
-
this.rtcProvider = rtcProvider;
|
|
2146
|
-
}
|
|
2147
|
-
ngOnInit() {
|
|
2148
|
-
this.rtcProvider.setup();
|
|
2149
|
-
this.rtcProvider.subject.subscribe((msg) => {
|
|
2150
|
-
console.log('[MSG]' + msg);
|
|
2151
|
-
}, // Called whenever there is a message from the server.
|
|
2152
|
-
(err) => console.log(err), // Called if at any point WebSocket API signals some kind of error.
|
|
2153
|
-
() => console.log('complete') // Called when connection is closed (for whatever reason).
|
|
2154
|
-
);
|
|
2155
|
-
console.log(this.data);
|
|
2156
|
-
const path = 'https://192.168.1.104:4200/';
|
|
2157
|
-
this.code = path + 'mobile?id=1';
|
|
2158
|
-
}
|
|
2159
|
-
close() {
|
|
2160
|
-
this.dialogRef.close();
|
|
2161
|
-
}
|
|
2162
|
-
action() { }
|
|
2163
|
-
}
|
|
2164
|
-
ScanMobileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanMobileComponent, deps: [{ token: i1$3.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: webRtcProvider }], target: i0.ɵɵFactoryTarget.Component });
|
|
2165
|
-
ScanMobileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScanMobileComponent, selector: "app-scan-mobile", ngImport: i0, template: "<header class=\"page-header\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <div class=\"title\" ngClass.lt-sm=\"title-small\">\n Send to mobile\n\n <!-- {{ data.text.statusText }} {{ data.text.status }} -->\n </div>\n\n <span fxFlex></span>\n\n <!-- <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button> -->\n <!-- <mat-icon class=\"mr-16\" style=\"color:#888;\">info_outline</mat-icon> -->\n</header>\n\n<div fxLayout=\"column\" fxLayoutAlign=\"center center\">\n <!-- <img\n style=\"height: 240px; margin: 34px 0px;display: none;\"\n [src]=\"'/assets/images/illustrations/' + images[type]\"\n /> -->\n <!-- <img style=\"width:60px;\" src=\"/assets/images/illustrations/door-lock.png\"> -->\n\n<qrcode [qrdata]=\"code\" [width]=\"256\" [errorCorrectionLevel]=\"'M'\"></qrcode>\n\n\n</div>\n\n<!-- -->\n\n<footer>\n <div class=\"actions\" fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button (click)=\"close()\" mat-raised-button>\n {{ \"core.page.cancel\" | translate }}\n </button>\n\n <button (click)=\"action()\" color=\"accent\" mat-raised-button>\n <ng-container>\n {{ \"core.page.ok\" | translate }}\n </ng-container>\n </button>\n </div>\n</footer>\n", styles: [":host{display:flex;flex-direction:column;flex:1;height:100%;width:100%}.title{font-size:18px}.text{padding:0 30px;text-align:center;font-size:16px;margin:40px 0}.actions{min-height:60px}.actions button{min-width:120px;margin-right:16px;box-shadow:none;text-transform:uppercase}footer{background-color:#fff}footer button{box-shadow:none!important;border:1px solid rgba(0,0,0,.12);font-size:13px}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"], dependencies: [{ kind: "component", type: i3$1.QRCodeComponent, selector: "qrcode", inputs: ["allowEmptyString", "colorDark", "colorLight", "cssClass", "elementType", "errorCorrectionLevel", "imageSrc", "imageHeight", "imageWidth", "margin", "qrdata", "scale", "version", "width", "alt", "ariaLabel", "title"], outputs: ["qrCodeURL"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i5$1.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }] });
|
|
2166
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanMobileComponent, decorators: [{
|
|
2167
|
-
type: Component,
|
|
2168
|
-
args: [{ selector: 'app-scan-mobile', template: "<header class=\"page-header\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <div class=\"title\" ngClass.lt-sm=\"title-small\">\n Send to mobile\n\n <!-- {{ data.text.statusText }} {{ data.text.status }} -->\n </div>\n\n <span fxFlex></span>\n\n <!-- <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button> -->\n <!-- <mat-icon class=\"mr-16\" style=\"color:#888;\">info_outline</mat-icon> -->\n</header>\n\n<div fxLayout=\"column\" fxLayoutAlign=\"center center\">\n <!-- <img\n style=\"height: 240px; margin: 34px 0px;display: none;\"\n [src]=\"'/assets/images/illustrations/' + images[type]\"\n /> -->\n <!-- <img style=\"width:60px;\" src=\"/assets/images/illustrations/door-lock.png\"> -->\n\n<qrcode [qrdata]=\"code\" [width]=\"256\" [errorCorrectionLevel]=\"'M'\"></qrcode>\n\n\n</div>\n\n<!-- -->\n\n<footer>\n <div class=\"actions\" fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button (click)=\"close()\" mat-raised-button>\n {{ \"core.page.cancel\" | translate }}\n </button>\n\n <button (click)=\"action()\" color=\"accent\" mat-raised-button>\n <ng-container>\n {{ \"core.page.ok\" | translate }}\n </ng-container>\n </button>\n </div>\n</footer>\n", styles: [":host{display:flex;flex-direction:column;flex:1;height:100%;width:100%}.title{font-size:18px}.text{padding:0 30px;text-align:center;font-size:16px;margin:40px 0}.actions{min-height:60px}.actions button{min-width:120px;margin-right:16px;box-shadow:none;text-transform:uppercase}footer{background-color:#fff}footer button{box-shadow:none!important;border:1px solid rgba(0,0,0,.12);font-size:13px}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"] }]
|
|
2169
|
-
}], ctorParameters: function () { return [{ type: i1$3.MatDialogRef }, { type: undefined, decorators: [{
|
|
2170
|
-
type: Inject,
|
|
2171
|
-
args: [MAT_DIALOG_DATA]
|
|
2172
|
-
}] }, { type: webRtcProvider }]; } });
|
|
2173
|
-
|
|
2174
|
-
class ScanSelfieComponent {
|
|
2175
|
-
constructor(cd, scanProvider, dialogs,
|
|
2176
|
-
// private formProvider: ScanFieldsProvider,
|
|
2177
|
-
translate) {
|
|
2178
|
-
this.cd = cd;
|
|
2179
|
-
this.scanProvider = scanProvider;
|
|
2180
|
-
this.dialogs = dialogs;
|
|
1933
|
+
class ScanFieldsProvider {
|
|
1934
|
+
constructor(translate, provider) {
|
|
2181
1935
|
this.translate = translate;
|
|
2182
|
-
this.
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
side: 'FRONT',
|
|
2187
|
-
},
|
|
1936
|
+
this.provider = provider;
|
|
1937
|
+
}
|
|
1938
|
+
update() {
|
|
1939
|
+
return [
|
|
2188
1940
|
{
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
1941
|
+
fieldGroupClassName: 'px-16',
|
|
1942
|
+
fieldGroup: [
|
|
1943
|
+
{
|
|
1944
|
+
wrappers: [],
|
|
1945
|
+
type: 'checkbox',
|
|
1946
|
+
key: 'profile',
|
|
1947
|
+
class: 'checkbox ',
|
|
1948
|
+
defaultValue: true,
|
|
1949
|
+
templateOptions: {
|
|
1950
|
+
label: 'form.scan.document.update.profile',
|
|
1951
|
+
},
|
|
1952
|
+
},
|
|
1953
|
+
{
|
|
1954
|
+
wrappers: [],
|
|
1955
|
+
type: 'checkbox',
|
|
1956
|
+
class: 'checkbox ',
|
|
1957
|
+
key: 'document',
|
|
1958
|
+
defaultValue: true,
|
|
1959
|
+
templateOptions: {
|
|
1960
|
+
label: 'form.scan.document.update.document',
|
|
1961
|
+
},
|
|
1962
|
+
},
|
|
1963
|
+
{
|
|
1964
|
+
wrappers: [],
|
|
1965
|
+
type: 'checkbox',
|
|
1966
|
+
class: 'checkbox ',
|
|
1967
|
+
key: 'attachment',
|
|
1968
|
+
defaultValue: true,
|
|
1969
|
+
templateOptions: {
|
|
1970
|
+
label: 'form.scan.document.update.attachment',
|
|
1971
|
+
},
|
|
1972
|
+
},
|
|
1973
|
+
].map((item) => this.translate.forms(item)),
|
|
2193
1974
|
},
|
|
2194
1975
|
];
|
|
2195
|
-
this.type = 'desktop';
|
|
2196
|
-
this.actions = new EventEmitter();
|
|
2197
|
-
this.mediaDevices = [];
|
|
2198
|
-
this.videoOptions = {
|
|
2199
|
-
width: 1920,
|
|
2200
|
-
height: 1080,
|
|
2201
|
-
facingMode: 'environment',
|
|
2202
|
-
};
|
|
2203
|
-
this.multipleWebcamsAvailable = false;
|
|
2204
|
-
// webcam snapshot trigger
|
|
2205
|
-
this.documentTypeSelected = false;
|
|
2206
|
-
this.preview = null;
|
|
2207
|
-
this.allowCameraSwitch = true;
|
|
2208
|
-
this.error = false;
|
|
2209
|
-
this.cameraReady = false;
|
|
2210
|
-
this.scaning = false;
|
|
2211
|
-
this.scanDatas = [];
|
|
2212
|
-
this.trigger = new Subject();
|
|
2213
|
-
// switch to next / previous / specific webcam; true/false: forward/backwards, string: deviceId
|
|
2214
|
-
this.nextWebcam = new Subject();
|
|
2215
|
-
this.form = new FormGroup({});
|
|
2216
|
-
}
|
|
2217
|
-
onResize() {
|
|
2218
|
-
if (this.wraper) {
|
|
2219
|
-
this.width = this.wraper.nativeElement.clientWidth;
|
|
2220
|
-
this.height = this.wraper.nativeElement.clientHeight;
|
|
2221
|
-
console.log(this.width, this.height);
|
|
2222
|
-
setTimeout(() => {
|
|
2223
|
-
const video = this.wraper?.nativeElement.querySelector('video');
|
|
2224
|
-
if (video) {
|
|
2225
|
-
// console.log(video.clientWidth, video.clientHeight);
|
|
2226
|
-
this.videoWidth = video.clientWidth;
|
|
2227
|
-
this.videoHeight = video.clientHeight;
|
|
2228
|
-
}
|
|
2229
|
-
}, 100);
|
|
2230
|
-
this.cd.detectChanges();
|
|
2231
|
-
}
|
|
2232
|
-
}
|
|
2233
|
-
init() {
|
|
2234
|
-
console.log('HAS MULTI');
|
|
2235
|
-
// this.result=true;
|
|
2236
|
-
// this.result ={};
|
|
2237
|
-
this.fields = []; //this.formProvider.document();
|
|
2238
|
-
WebcamUtil.getAvailableVideoInputs().subscribe((mediaDevices) => {
|
|
2239
|
-
console.log('[DEVICES]', mediaDevices);
|
|
2240
|
-
this.mediaDevices = mediaDevices;
|
|
2241
|
-
this.multipleWebcamsAvailable = mediaDevices && mediaDevices.length > 1;
|
|
2242
|
-
this.singleScan(this.scanBlastData[0]);
|
|
2243
|
-
});
|
|
2244
|
-
}
|
|
2245
|
-
handleImage(webcamImage) {
|
|
2246
|
-
console.log('[received webcam image]', webcamImage);
|
|
2247
|
-
this.webcamImage = webcamImage;
|
|
2248
|
-
this.preview = webcamImage.imageAsDataUrl;
|
|
2249
|
-
this.cd.detectChanges();
|
|
2250
|
-
}
|
|
2251
|
-
handleInitError(error) {
|
|
2252
|
-
console.log(error);
|
|
2253
|
-
}
|
|
2254
|
-
get scanBlastCanUpload() {
|
|
2255
|
-
return this.scanBlastData[0].image ? true : false;
|
|
2256
|
-
}
|
|
2257
|
-
cameraWasSwitched(deviceId) {
|
|
2258
|
-
console.log('active device: ' + deviceId);
|
|
2259
|
-
this.deviceId = deviceId;
|
|
2260
|
-
this.cameraReady = true;
|
|
2261
|
-
this.defaultDevice = deviceId;
|
|
2262
|
-
this.onResize();
|
|
2263
|
-
}
|
|
2264
|
-
get nextWebcamObservable() {
|
|
2265
|
-
return this.nextWebcam.asObservable();
|
|
2266
|
-
}
|
|
2267
|
-
ngAfterViewInit() {
|
|
2268
|
-
this.cd.detectChanges();
|
|
2269
|
-
}
|
|
2270
|
-
selectCamera(event) {
|
|
2271
|
-
console.log(event);
|
|
2272
|
-
this.nextWebcam.next(event.value);
|
|
2273
|
-
}
|
|
2274
|
-
close() {
|
|
2275
|
-
this.dialogRef?.close();
|
|
2276
|
-
}
|
|
2277
|
-
singleScan(side) {
|
|
2278
|
-
this.scanType = side.side;
|
|
2279
|
-
this.preview = null;
|
|
2280
|
-
this.selectedSide = side;
|
|
2281
|
-
this.selectedSide.image = null;
|
|
2282
|
-
this.documentTypeSelected = true;
|
|
2283
|
-
this.scanBlastData[1].disabled = false;
|
|
2284
|
-
this.cd.detectChanges();
|
|
2285
|
-
setTimeout(() => {
|
|
2286
|
-
this.onResize();
|
|
2287
|
-
}, 10);
|
|
2288
|
-
}
|
|
2289
|
-
getBase64(file) {
|
|
2290
|
-
return new Observable((observer) => {
|
|
2291
|
-
const reader = new FileReader();
|
|
2292
|
-
reader.readAsDataURL(file);
|
|
2293
|
-
reader.onload = () => {
|
|
2294
|
-
observer.next(reader.result);
|
|
2295
|
-
};
|
|
2296
|
-
reader.onerror = (error) => {
|
|
2297
|
-
observer.error(error);
|
|
2298
|
-
};
|
|
2299
|
-
});
|
|
2300
|
-
}
|
|
2301
|
-
handleFileInput(target, event, side) {
|
|
2302
|
-
const files = target.files;
|
|
2303
|
-
this.selectedSide = side;
|
|
2304
|
-
console.log(files);
|
|
2305
|
-
const file = files.item(0);
|
|
2306
|
-
this.resolutionLimit(file)
|
|
2307
|
-
.pipe(switchMap((valid) => {
|
|
2308
|
-
return valid ? this.getBase64(file) : of(false);
|
|
2309
|
-
}))
|
|
2310
|
-
.subscribe((imageAsDataUrl) => {
|
|
2311
|
-
// console.log(imageAsDataUrl);
|
|
2312
|
-
event.target.value = null;
|
|
2313
|
-
if (!imageAsDataUrl) {
|
|
2314
|
-
this.dialogs.alert('core.page.error', this.translate.instant('pms.dialogs.components.scanProfile.minResolution'));
|
|
2315
|
-
}
|
|
2316
|
-
else {
|
|
2317
|
-
side.image = {
|
|
2318
|
-
imageAsDataUrl,
|
|
2319
|
-
};
|
|
2320
|
-
if (this.selectedSide.side === 'FRONT') {
|
|
2321
|
-
this.scanBlastData[1].disabled = false;
|
|
2322
|
-
}
|
|
2323
|
-
}
|
|
2324
|
-
this.cd.detectChanges();
|
|
2325
|
-
});
|
|
2326
|
-
}
|
|
2327
|
-
rotateBase64Image(base64data) {
|
|
2328
|
-
return new Observable((observer) => {
|
|
2329
|
-
const canvas = document.createElement('canvas');
|
|
2330
|
-
const ctx = canvas.getContext('2d');
|
|
2331
|
-
var image = new Image();
|
|
2332
|
-
image.src = base64data;
|
|
2333
|
-
image.onload = () => {
|
|
2334
|
-
console.log(canvas);
|
|
2335
|
-
canvas.width = image.height;
|
|
2336
|
-
canvas.height = image.width;
|
|
2337
|
-
if (ctx) {
|
|
2338
|
-
ctx.rotate((90 * Math.PI) / 180);
|
|
2339
|
-
ctx.translate(0, -canvas.width);
|
|
2340
|
-
ctx.drawImage(image, 0, 0);
|
|
2341
|
-
observer.next(canvas.toDataURL());
|
|
2342
|
-
}
|
|
2343
|
-
else {
|
|
2344
|
-
observer.error({ type: 'generic error' });
|
|
2345
|
-
}
|
|
2346
|
-
};
|
|
2347
|
-
image.onerror = (e) => {
|
|
2348
|
-
observer.error(e);
|
|
2349
|
-
};
|
|
2350
|
-
});
|
|
2351
1976
|
}
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
1977
|
+
document() {
|
|
1978
|
+
return [
|
|
1979
|
+
{
|
|
1980
|
+
className: 'w-200-p',
|
|
1981
|
+
fieldGroupClassName: 'form-flex-row border-card profile-details',
|
|
1982
|
+
fieldGroup: [
|
|
1983
|
+
{
|
|
1984
|
+
className: 'card-group',
|
|
1985
|
+
fieldGroupClassName: 'wraper',
|
|
1986
|
+
fieldGroup: [
|
|
1987
|
+
{
|
|
1988
|
+
type: 'title',
|
|
1989
|
+
templateOptions: {
|
|
1990
|
+
label: 'form.scan.document.guestDetailsTitle',
|
|
1991
|
+
},
|
|
1992
|
+
},
|
|
1993
|
+
// {
|
|
1994
|
+
// type: 'profile-image',
|
|
1995
|
+
// key: '_avatar',
|
|
1996
|
+
// templateOptions: {
|
|
1997
|
+
// label: 'form.scan.document.firstName',
|
|
1998
|
+
// },
|
|
1999
|
+
// },
|
|
2000
|
+
{
|
|
2001
|
+
type: 'input',
|
|
2002
|
+
key: 'firstName',
|
|
2003
|
+
className: 'small',
|
|
2004
|
+
templateOptions: {
|
|
2005
|
+
label: 'form.scan.document.firstName',
|
|
2006
|
+
required: true,
|
|
2007
|
+
},
|
|
2008
|
+
},
|
|
2009
|
+
{
|
|
2010
|
+
type: 'input',
|
|
2011
|
+
key: 'lastName',
|
|
2012
|
+
className: 'small',
|
|
2013
|
+
templateOptions: {
|
|
2014
|
+
label: 'form.scan.document.lastName',
|
|
2015
|
+
required: true,
|
|
2016
|
+
},
|
|
2017
|
+
},
|
|
2018
|
+
{
|
|
2019
|
+
className: 'small',
|
|
2020
|
+
key: 'secondName',
|
|
2021
|
+
type: 'input',
|
|
2022
|
+
templateOptions: {
|
|
2023
|
+
color: 'accent',
|
|
2024
|
+
label: 'form.scan.document.secondLastName',
|
|
2025
|
+
},
|
|
2026
|
+
hideExpression: 'model.hideSecondLastName',
|
|
2027
|
+
},
|
|
2028
|
+
{
|
|
2029
|
+
type: 'input',
|
|
2030
|
+
key: 'middleName',
|
|
2031
|
+
className: 'small',
|
|
2032
|
+
templateOptions: {
|
|
2033
|
+
label: 'form.scan.document.middleName',
|
|
2034
|
+
},
|
|
2035
|
+
},
|
|
2036
|
+
{
|
|
2037
|
+
className: '',
|
|
2038
|
+
fieldGroupClassName: 'form-flex-row space-between',
|
|
2039
|
+
fieldGroup: [
|
|
2040
|
+
{
|
|
2041
|
+
type: 'datepicker',
|
|
2042
|
+
key: 'birthDate',
|
|
2043
|
+
className: 'w-100-p small mr-8',
|
|
2044
|
+
templateOptions: {
|
|
2045
|
+
label: 'form.scan.document.birthDate',
|
|
2046
|
+
},
|
|
2047
|
+
},
|
|
2048
|
+
{
|
|
2049
|
+
type: 'select',
|
|
2050
|
+
key: 'gender',
|
|
2051
|
+
className: 'w-100-p small ml-8',
|
|
2052
|
+
templateOptions: {
|
|
2053
|
+
label: 'form.scan.document.gender',
|
|
2054
|
+
options: [
|
|
2055
|
+
{ value: 'MALE', label: 'MALE' },
|
|
2056
|
+
{ value: 'FEMALE', label: 'FEMALE' },
|
|
2057
|
+
{ value: 'NA', label: 'N/A' },
|
|
2058
|
+
],
|
|
2059
|
+
},
|
|
2060
|
+
},
|
|
2061
|
+
],
|
|
2062
|
+
},
|
|
2063
|
+
{
|
|
2064
|
+
type: 'input',
|
|
2065
|
+
key: 'birthPlace',
|
|
2066
|
+
className: 'small',
|
|
2067
|
+
templateOptions: {
|
|
2068
|
+
label: 'form.scan.document.birthPlace',
|
|
2069
|
+
},
|
|
2070
|
+
},
|
|
2071
|
+
{
|
|
2072
|
+
type: 'select',
|
|
2073
|
+
key: 'birthCountry',
|
|
2074
|
+
className: 'small',
|
|
2075
|
+
templateOptions: {
|
|
2076
|
+
label: 'form.scan.document.birthCountry',
|
|
2077
|
+
options: this.provider.countries(),
|
|
2078
|
+
},
|
|
2079
|
+
},
|
|
2080
|
+
{
|
|
2081
|
+
className: 'small',
|
|
2082
|
+
key: 'nationality',
|
|
2083
|
+
type: 'select',
|
|
2084
|
+
templateOptions: {
|
|
2085
|
+
label: 'form.scan.document.nationality',
|
|
2086
|
+
// appearance: 'outline',
|
|
2087
|
+
// options: this.profileProvider.nationalities(),
|
|
2088
|
+
options: this.provider.countries(),
|
|
2089
|
+
},
|
|
2090
|
+
},
|
|
2091
|
+
],
|
|
2092
|
+
},
|
|
2093
|
+
{
|
|
2094
|
+
className: 'card-group',
|
|
2095
|
+
fieldGroupClassName: 'wraper',
|
|
2096
|
+
fieldGroup: [
|
|
2097
|
+
{
|
|
2098
|
+
type: 'title',
|
|
2099
|
+
templateOptions: {
|
|
2100
|
+
label: 'form.scan.document.documentTitle',
|
|
2101
|
+
},
|
|
2102
|
+
},
|
|
2103
|
+
{
|
|
2104
|
+
type: 'select',
|
|
2105
|
+
key: 'documentType',
|
|
2106
|
+
templateOptions: {
|
|
2107
|
+
label: 'form.scan.document.documentType',
|
|
2108
|
+
options: [
|
|
2109
|
+
{ value: 'ID', label: 'Identity Document' },
|
|
2110
|
+
{ value: 'PASS', label: 'Passport' },
|
|
2111
|
+
{ value: 'DL', label: 'Driver Licence' },
|
|
2112
|
+
],
|
|
2113
|
+
// valueProp: 'id',
|
|
2114
|
+
// labelProp: 'value',
|
|
2115
|
+
required: true,
|
|
2116
|
+
},
|
|
2117
|
+
},
|
|
2118
|
+
{
|
|
2119
|
+
type: 'input',
|
|
2120
|
+
key: 'documentNumber',
|
|
2121
|
+
templateOptions: {
|
|
2122
|
+
label: 'form.scan.document.documentNumber',
|
|
2123
|
+
required: true,
|
|
2124
|
+
},
|
|
2125
|
+
},
|
|
2126
|
+
{
|
|
2127
|
+
className: '',
|
|
2128
|
+
fieldGroupClassName: 'form-flex-row space-between',
|
|
2129
|
+
fieldGroup: [
|
|
2130
|
+
{
|
|
2131
|
+
type: 'datepicker',
|
|
2132
|
+
key: 'issueDate',
|
|
2133
|
+
className: 'small mr-8',
|
|
2134
|
+
templateOptions: {
|
|
2135
|
+
label: 'form.scan.document.issueDate',
|
|
2136
|
+
},
|
|
2137
|
+
},
|
|
2138
|
+
{
|
|
2139
|
+
type: 'datepicker',
|
|
2140
|
+
key: 'expirationDate',
|
|
2141
|
+
className: 'small ml-8',
|
|
2142
|
+
templateOptions: {
|
|
2143
|
+
label: 'form.scan.document.expirationDate',
|
|
2144
|
+
},
|
|
2145
|
+
},
|
|
2146
|
+
],
|
|
2147
|
+
},
|
|
2148
|
+
{
|
|
2149
|
+
type: 'select',
|
|
2150
|
+
key: 'issueStateCode',
|
|
2151
|
+
templateOptions: {
|
|
2152
|
+
label: 'form.scan.document.issuingStateCode',
|
|
2153
|
+
options: this.provider.countries(),
|
|
2154
|
+
},
|
|
2155
|
+
},
|
|
2156
|
+
{
|
|
2157
|
+
type: 'input',
|
|
2158
|
+
key: 'issuingPlace',
|
|
2159
|
+
templateOptions: {
|
|
2160
|
+
label: 'form.scan.document.issuingPlace',
|
|
2161
|
+
required: false,
|
|
2162
|
+
},
|
|
2163
|
+
},
|
|
2164
|
+
{
|
|
2165
|
+
className: '',
|
|
2166
|
+
fieldGroupClassName: 'form-flex-row space-between',
|
|
2167
|
+
fieldGroup: [
|
|
2168
|
+
{
|
|
2169
|
+
type: 'title',
|
|
2170
|
+
templateOptions: {
|
|
2171
|
+
label: 'form.scan.document.addressTitle',
|
|
2172
|
+
badge: 'communications',
|
|
2173
|
+
},
|
|
2174
|
+
},
|
|
2175
|
+
].map((item) => this.translate.forms(item)),
|
|
2176
|
+
},
|
|
2177
|
+
// {
|
|
2178
|
+
// className: 'small',
|
|
2179
|
+
// key: 'typeID',
|
|
2180
|
+
// type: 'select',
|
|
2181
|
+
// templateOptions: {
|
|
2182
|
+
// label: 'form.profile.address.type',
|
|
2183
|
+
// required: true,
|
|
2184
|
+
// // options: this.profileProvider.addressTypes(),
|
|
2185
|
+
// expressionProperties: {
|
|
2186
|
+
// 'templateOptions.disabled': (model: any) =>
|
|
2187
|
+
// model.newAddress,
|
|
2188
|
+
// },
|
|
2189
|
+
// onClearValue: (field: FormlyFieldConfig) => {
|
|
2190
|
+
// field.formControl?.setValue('');
|
|
2191
|
+
// field.model.typeID = 0;
|
|
2192
|
+
// },
|
|
2193
|
+
// onSetNewValue: (field: FormlyFieldConfig, optObj: any) => {
|
|
2194
|
+
// field.formControl?.setValue(optObj.value);
|
|
2195
|
+
// field.model.typeID = optObj.value;
|
|
2196
|
+
// },
|
|
2197
|
+
// },
|
|
2198
|
+
// expressionProperties: {
|
|
2199
|
+
// 'templateOptions.disabled': (model: any) => !model.newAddress,
|
|
2200
|
+
// },
|
|
2201
|
+
// },
|
|
2202
|
+
{
|
|
2203
|
+
className: 'small',
|
|
2204
|
+
key: 'country',
|
|
2205
|
+
type: 'select',
|
|
2206
|
+
templateOptions: {
|
|
2207
|
+
required: true,
|
|
2208
|
+
label: 'form.profile.address.country',
|
|
2209
|
+
options: this.provider.countries(),
|
|
2210
|
+
},
|
|
2211
|
+
// expressionProperties: {
|
|
2212
|
+
// 'templateOptions.disabled': (model: any) => !model.newAddress,
|
|
2213
|
+
// },
|
|
2214
|
+
hooks: {
|
|
2215
|
+
onInit: (model) => {
|
|
2216
|
+
console.log(model);
|
|
2217
|
+
},
|
|
2218
|
+
},
|
|
2219
|
+
},
|
|
2220
|
+
{
|
|
2221
|
+
className: '',
|
|
2222
|
+
fieldGroupClassName: 'form-flex-row space-between',
|
|
2223
|
+
fieldGroup: [
|
|
2224
|
+
{
|
|
2225
|
+
className: 'mr-8 w-100-p',
|
|
2226
|
+
key: 'zip',
|
|
2227
|
+
type: 'input',
|
|
2228
|
+
templateOptions: {
|
|
2229
|
+
label: 'form.profile.address.zip',
|
|
2230
|
+
labelProp: (item) => {
|
|
2231
|
+
return `${item.zip} (${item.city})`;
|
|
2232
|
+
},
|
|
2233
|
+
set: (field, option) => {
|
|
2234
|
+
// console.log(option, field);
|
|
2235
|
+
field.formControl.setValue(option.value.zip);
|
|
2236
|
+
// set CITY
|
|
2237
|
+
field.form.get('city').setValue(option.value.city);
|
|
2238
|
+
},
|
|
2239
|
+
filter: (key, field) => {
|
|
2240
|
+
// return this.profileProvider.zipCodes({
|
|
2241
|
+
// countryCode: field.form.get('country').value,
|
|
2242
|
+
// zip: key,
|
|
2243
|
+
// });
|
|
2244
|
+
},
|
|
2245
|
+
},
|
|
2246
|
+
// expressionProperties: {
|
|
2247
|
+
// 'templateOptions.disabled': (model: any) =>
|
|
2248
|
+
// !model.newAddress,
|
|
2249
|
+
// },
|
|
2250
|
+
},
|
|
2251
|
+
{
|
|
2252
|
+
className: 'small ml-8',
|
|
2253
|
+
key: 'city',
|
|
2254
|
+
type: 'input',
|
|
2255
|
+
templateOptions: {
|
|
2256
|
+
label: 'form.profile.address.city',
|
|
2257
|
+
},
|
|
2258
|
+
// expressionProperties: {
|
|
2259
|
+
// 'templateOptions.disabled': (model: any) =>
|
|
2260
|
+
// !model.newAddress,
|
|
2261
|
+
// },
|
|
2262
|
+
},
|
|
2263
|
+
].map((item) => this.translate.forms(item)),
|
|
2264
|
+
},
|
|
2265
|
+
// {
|
|
2266
|
+
// className: 'small',
|
|
2267
|
+
// key: 'state',
|
|
2268
|
+
// type: 'input',
|
|
2269
|
+
// templateOptions: {
|
|
2270
|
+
// label: 'form.profile.address.state',
|
|
2271
|
+
// },
|
|
2272
|
+
// // expressionProperties: {
|
|
2273
|
+
// // 'templateOptions.disabled': (model: any) => !model.newAddress,
|
|
2274
|
+
// // },
|
|
2275
|
+
// },
|
|
2276
|
+
// {
|
|
2277
|
+
// className: 'small',
|
|
2278
|
+
// key: 'countryStateID',
|
|
2279
|
+
// type: 'select',
|
|
2280
|
+
// templateOptions: {
|
|
2281
|
+
// label: 'form.profile.address.regionalStatistics',
|
|
2282
|
+
// options: this.provider.countries(),
|
|
2283
|
+
// },
|
|
2284
|
+
// // expressionProperties: {
|
|
2285
|
+
// // 'templateOptions.disabled': (model: any) => !model.newAddress,
|
|
2286
|
+
// // },
|
|
2287
|
+
// },
|
|
2288
|
+
{
|
|
2289
|
+
className: 'small w-100-p',
|
|
2290
|
+
key: 'street1',
|
|
2291
|
+
type: 'input',
|
|
2292
|
+
templateOptions: {
|
|
2293
|
+
label: 'form.profile.address.street',
|
|
2294
|
+
},
|
|
2295
|
+
// expressionProperties: {
|
|
2296
|
+
// 'templateOptions.disabled': (model: any) => !model.newAddress,
|
|
2297
|
+
// },
|
|
2298
|
+
},
|
|
2299
|
+
],
|
|
2300
|
+
},
|
|
2301
|
+
],
|
|
2302
|
+
},
|
|
2303
|
+
].map((item) => this.translate.forms(item));
|
|
2391
2304
|
}
|
|
2392
|
-
|
|
2393
|
-
|
|
2305
|
+
}
|
|
2306
|
+
ScanFieldsProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanFieldsProvider, deps: [{ token: TranslationProvider }, { token: ScanProvider }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2307
|
+
ScanFieldsProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanFieldsProvider, providedIn: 'root' });
|
|
2308
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanFieldsProvider, decorators: [{
|
|
2309
|
+
type: Injectable,
|
|
2310
|
+
args: [{
|
|
2311
|
+
providedIn: 'root',
|
|
2312
|
+
}]
|
|
2313
|
+
}], ctorParameters: function () { return [{ type: TranslationProvider }, { type: ScanProvider }]; } });
|
|
2314
|
+
|
|
2315
|
+
class ScanResultsComponent {
|
|
2316
|
+
constructor(cameraProvider, formProvider) {
|
|
2317
|
+
this.cameraProvider = cameraProvider;
|
|
2318
|
+
this.formProvider = formProvider;
|
|
2319
|
+
this.action = new EventEmitter();
|
|
2394
2320
|
}
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2321
|
+
ngOnInit() {
|
|
2322
|
+
this.fields = this.formProvider.document();
|
|
2323
|
+
}
|
|
2324
|
+
ngOnDestroy() { }
|
|
2325
|
+
selfie() {
|
|
2326
|
+
this.action.emit({ selfie: true });
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
ScanResultsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanResultsComponent, deps: [{ token: NgxScandocCameraProvider }, { token: ScanFieldsProvider }], target: i0.ɵɵFactoryTarget.Component });
|
|
2330
|
+
ScanResultsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScanResultsComponent, selector: "ngx-scan-results", inputs: { model: "model", images: "images", form: "form" }, outputs: { action: "action" }, ngImport: i0, template: "<div class=\"wraper\">\n <div style=\"flex: 1\">\n <mat-card style=\"margin: 4px; padding: 4px 16px\">\n <h3>Avatar</h3>\n <div class=\"selfieContainer\">\n <div class=\"selfie\">\n <img *ngIf=\"model?._avatar\" class=\"preview\" [src]=\"model._avatar\" />\n </div>\n <button (click)=\"selfie()\" mat-raised-button>Take selfie</button>\n </div>\n </mat-card>\n\n <form\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n class=\"px-16 py-0 w-100-p\"\n [formGroup]=\"form\"\n >\n <formly-form\n ngClass.lt-md=\"mobile\"\n fxFlex\n [form]=\"form\"\n [fields]=\"fields\"\n [model]=\"model\"\n >\n </formly-form>\n </form>\n </div>\n <div style=\"flex: 1\" class=\"pr-16 m-4\">\n <mat-card style=\"margin: 4px; padding-top: 2px\" class=\"images\">\n <h3>Images</h3>\n <ng-container *ngFor=\"let img of images\">\n <div fxLayout=\"column\">\n <ng-container *ngIf=\"img.side === 0\">\n <div class=\"title\">Front Side</div>\n </ng-container>\n <ng-container *ngIf=\"img.side === 1\">\n <div class=\"title\">Back Side</div>\n </ng-container>\n <img\n class=\"preview\"\n style=\"max-width: 460px; border-radius: 1rem\"\n [src]=\"img.data\"\n />\n </div>\n </ng-container>\n </mat-card>\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;overflow:hidden}.images .title{padding:8px 0;font-weight:600}.images img{margin-bottom:16px;width:100%}.wraper{padding:8px 8px 0 0;overflow:auto;flex:1;display:flex;flex-direction:row}mat-card{box-shadow:none!important}.selfieContainer{display:flex;flex-direction:row;align-items:center}.selfieContainer .selfie{width:150px}.selfieContainer .selfie .preview{width:120px;height:120px;border-radius:80px}.selfieContainer .button{box-shadow:none;border:1px solid rgba(0,0,0,.1)}\n"], dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: i5$1.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i6.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
2331
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanResultsComponent, decorators: [{
|
|
2332
|
+
type: Component,
|
|
2333
|
+
args: [{ selector: 'ngx-scan-results', template: "<div class=\"wraper\">\n <div style=\"flex: 1\">\n <mat-card style=\"margin: 4px; padding: 4px 16px\">\n <h3>Avatar</h3>\n <div class=\"selfieContainer\">\n <div class=\"selfie\">\n <img *ngIf=\"model?._avatar\" class=\"preview\" [src]=\"model._avatar\" />\n </div>\n <button (click)=\"selfie()\" mat-raised-button>Take selfie</button>\n </div>\n </mat-card>\n\n <form\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n class=\"px-16 py-0 w-100-p\"\n [formGroup]=\"form\"\n >\n <formly-form\n ngClass.lt-md=\"mobile\"\n fxFlex\n [form]=\"form\"\n [fields]=\"fields\"\n [model]=\"model\"\n >\n </formly-form>\n </form>\n </div>\n <div style=\"flex: 1\" class=\"pr-16 m-4\">\n <mat-card style=\"margin: 4px; padding-top: 2px\" class=\"images\">\n <h3>Images</h3>\n <ng-container *ngFor=\"let img of images\">\n <div fxLayout=\"column\">\n <ng-container *ngIf=\"img.side === 0\">\n <div class=\"title\">Front Side</div>\n </ng-container>\n <ng-container *ngIf=\"img.side === 1\">\n <div class=\"title\">Back Side</div>\n </ng-container>\n <img\n class=\"preview\"\n style=\"max-width: 460px; border-radius: 1rem\"\n [src]=\"img.data\"\n />\n </div>\n </ng-container>\n </mat-card>\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;overflow:hidden}.images .title{padding:8px 0;font-weight:600}.images img{margin-bottom:16px;width:100%}.wraper{padding:8px 8px 0 0;overflow:auto;flex:1;display:flex;flex-direction:row}mat-card{box-shadow:none!important}.selfieContainer{display:flex;flex-direction:row;align-items:center}.selfieContainer .selfie{width:150px}.selfieContainer .selfie .preview{width:120px;height:120px;border-radius:80px}.selfieContainer .button{box-shadow:none;border:1px solid rgba(0,0,0,.1)}\n"] }]
|
|
2334
|
+
}], ctorParameters: function () { return [{ type: NgxScandocCameraProvider }, { type: ScanFieldsProvider }]; }, propDecorators: { model: [{
|
|
2335
|
+
type: Input
|
|
2336
|
+
}], images: [{
|
|
2337
|
+
type: Input
|
|
2338
|
+
}], form: [{
|
|
2339
|
+
type: Input
|
|
2340
|
+
}], action: [{
|
|
2341
|
+
type: Output
|
|
2342
|
+
}] } });
|
|
2343
|
+
|
|
2344
|
+
class ScanComponent extends BaseComponent {
|
|
2345
|
+
constructor(cd, zone, translate, cameraProvider, injector, layoutProvider, auth // private api: ServerProvider
|
|
2346
|
+
) {
|
|
2347
|
+
super();
|
|
2348
|
+
this.cd = cd;
|
|
2349
|
+
this.zone = zone;
|
|
2350
|
+
this.translate = translate;
|
|
2351
|
+
this.cameraProvider = cameraProvider;
|
|
2352
|
+
this.injector = injector;
|
|
2353
|
+
this.layoutProvider = layoutProvider;
|
|
2354
|
+
this.auth = auth;
|
|
2355
|
+
this.scanBlastData = [
|
|
2356
|
+
{
|
|
2357
|
+
title: 'pms.dialogs.components.scanProfile.front',
|
|
2358
|
+
description: 'pms.dialogs.components.scanProfile.frontDescription',
|
|
2359
|
+
side: 'FRONT',
|
|
2360
|
+
},
|
|
2361
|
+
{
|
|
2362
|
+
title: 'pms.dialogs.components.scanProfile.back',
|
|
2363
|
+
description: 'pms.dialogs.components.scanProfile.backDescription',
|
|
2364
|
+
disabled: true,
|
|
2365
|
+
side: 'BACK',
|
|
2366
|
+
},
|
|
2367
|
+
];
|
|
2368
|
+
this.type = 'desktop';
|
|
2369
|
+
this.actions = new EventEmitter();
|
|
2370
|
+
this.mediaDevices = [];
|
|
2371
|
+
this.videoOptions = {
|
|
2372
|
+
width: 1920,
|
|
2373
|
+
height: 1080,
|
|
2374
|
+
facingMode: 'environment',
|
|
2375
|
+
};
|
|
2376
|
+
this.startTime = 0;
|
|
2377
|
+
this.isDebug = false;
|
|
2378
|
+
this.multipleWebcamsAvailable = false;
|
|
2379
|
+
this.scanInProgress = false;
|
|
2380
|
+
// webcam snapshot trigger
|
|
2381
|
+
this.documentTypeSelected = false;
|
|
2382
|
+
this.preview = null;
|
|
2383
|
+
this.errorCode = '1000';
|
|
2384
|
+
this.displayInfo = 'Position document inside rectange and hold steady.';
|
|
2385
|
+
this.allowCameraSwitch = true;
|
|
2386
|
+
this.verificationErrorSent = false;
|
|
2387
|
+
this.error = false;
|
|
2388
|
+
this.cameraReady = false;
|
|
2389
|
+
this.scaning = false;
|
|
2390
|
+
this.imageHandler = new Subject();
|
|
2391
|
+
this.logData = {
|
|
2392
|
+
AcceptTermsAndConditions: true,
|
|
2393
|
+
Request: null,
|
|
2394
|
+
Response: null,
|
|
2395
|
+
ExpectedOutput: null,
|
|
2396
|
+
};
|
|
2397
|
+
this.scanDatas = [];
|
|
2398
|
+
this.idScan = null;
|
|
2399
|
+
this.validation = false;
|
|
2400
|
+
this.scannedImages = [];
|
|
2401
|
+
this.scanDelay = 0;
|
|
2402
|
+
this.trigger = new Subject();
|
|
2403
|
+
// switch to next / previous / specific webcam; true/false: forward/backwards, string: deviceId
|
|
2404
|
+
this.nextWebcam = new Subject();
|
|
2405
|
+
this.imageVerified = false;
|
|
2406
|
+
this.form = new FormGroup({});
|
|
2407
|
+
this.isMobile = false;
|
|
2408
|
+
this.showDialog = false;
|
|
2409
|
+
this.scanImageTimestamps = {
|
|
2410
|
+
time: 0,
|
|
2411
|
+
load: 0,
|
|
2412
|
+
};
|
|
2413
|
+
this.scanProvider = this.injector.get(ScanProvider);
|
|
2414
|
+
}
|
|
2415
|
+
get class() {
|
|
2416
|
+
return this.isMobile;
|
|
2417
|
+
}
|
|
2418
|
+
onResize() {
|
|
2419
|
+
if (this.wraper) {
|
|
2420
|
+
this.width = this.wraper.nativeElement.clientWidth;
|
|
2421
|
+
this.height = this.wraper.nativeElement.clientHeight;
|
|
2422
|
+
setTimeout(() => {
|
|
2423
|
+
const video = this.wraper?.nativeElement.querySelector('video');
|
|
2424
|
+
if (video) {
|
|
2425
|
+
// console.log(video.clientWidth, video.clientHeight);
|
|
2426
|
+
this.videoWidth = video.clientWidth;
|
|
2427
|
+
this.videoHeight = video.clientHeight;
|
|
2428
|
+
}
|
|
2429
|
+
this.cd.detectChanges();
|
|
2430
|
+
}, 100);
|
|
2431
|
+
this.cd.detectChanges();
|
|
2400
2432
|
}
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2433
|
+
}
|
|
2434
|
+
resetLogData() {
|
|
2435
|
+
this.logData = {
|
|
2436
|
+
Request: null,
|
|
2437
|
+
Response: null,
|
|
2438
|
+
ExpectedOutput: null,
|
|
2404
2439
|
AcceptTermsAndConditions: true,
|
|
2405
|
-
DataFields: {
|
|
2406
|
-
FrontImageType: 'base64',
|
|
2407
|
-
FrontImageCropped: false,
|
|
2408
|
-
BackImageType: 'base64',
|
|
2409
|
-
BackImageCropped: false,
|
|
2410
|
-
FrontImage: this.getImgBase64(0),
|
|
2411
|
-
BackImage: this.scanBlastData[1].image ? this.getImgBase64(1) : null,
|
|
2412
|
-
},
|
|
2413
|
-
Settings: {
|
|
2414
|
-
ShouldValidate: true,
|
|
2415
|
-
ShouldReturnDocumentImage: true,
|
|
2416
|
-
ShouldReturnFaceIfDetected: true,
|
|
2417
|
-
SkipImageSizeCheck: true,
|
|
2418
|
-
CanStoreImages: this.scanProvider.canStoreImages,
|
|
2419
|
-
},
|
|
2420
|
-
// CallBackUrl: 'http://demo:5000/report/extracted/',
|
|
2421
2440
|
};
|
|
2422
|
-
|
|
2423
|
-
|
|
2441
|
+
}
|
|
2442
|
+
ngOnDestroy() {
|
|
2443
|
+
if (this.scanTimeout) {
|
|
2444
|
+
clearTimeout(this.scanTimeout);
|
|
2424
2445
|
}
|
|
2425
|
-
this.
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
this.result = this.scanProvider.parseBlast(results);
|
|
2438
|
-
console.log('RES', this.result);
|
|
2439
|
-
this.model = this.result.model;
|
|
2440
|
-
if (data.ImageData?.FaceImage) {
|
|
2441
|
-
this.model._avatar =
|
|
2442
|
-
'data:image/jpeg;base64,' + data.ImageData?.FaceImage;
|
|
2443
|
-
}
|
|
2444
|
-
console.log('MODEL', this.model);
|
|
2445
|
-
}
|
|
2446
|
-
else {
|
|
2447
|
-
console.log('ERROR');
|
|
2448
|
-
// this.scanSide = 0;
|
|
2449
|
-
this.error = true;
|
|
2450
|
-
this.preview = true;
|
|
2451
|
-
// this.documentTypeSelected = false;
|
|
2452
|
-
// this.retry();
|
|
2453
|
-
}
|
|
2454
|
-
this.cd.detectChanges();
|
|
2455
|
-
}, (err) => {
|
|
2456
|
-
loading.close();
|
|
2457
|
-
// this.scanSide = 0;
|
|
2458
|
-
this.error = true;
|
|
2459
|
-
this.preview = true;
|
|
2460
|
-
this.documentTypeSelected = true;
|
|
2461
|
-
this.scaning = false;
|
|
2462
|
-
});
|
|
2446
|
+
if (this.imageHandlerSubscription) {
|
|
2447
|
+
this.imageHandlerSubscription.unsubscribe();
|
|
2448
|
+
}
|
|
2449
|
+
console.log('DESTROXY');
|
|
2450
|
+
this.__destroy();
|
|
2451
|
+
}
|
|
2452
|
+
init() {
|
|
2453
|
+
this.auth.accesToken.subscribe();
|
|
2454
|
+
this.resetLogData();
|
|
2455
|
+
// this.result=true;
|
|
2456
|
+
// this.result ={};
|
|
2457
|
+
console.log('INIT SCAN');
|
|
2463
2458
|
}
|
|
2464
2459
|
cameraOff(ev) {
|
|
2465
2460
|
this.cameraReady = false;
|
|
2466
2461
|
this.cd.detectChanges();
|
|
2467
2462
|
}
|
|
2468
2463
|
continue() {
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
this.
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
this.dialogRef?.close(this.webcamImage);
|
|
2478
|
-
}
|
|
2479
|
-
else {
|
|
2480
|
-
this.dialogs.alert('Verification failed!', "We can't verify that your selfie is same as image on document.");
|
|
2481
|
-
}
|
|
2482
|
-
console.log(resp);
|
|
2483
|
-
}, (err) => {
|
|
2484
|
-
loading.close();
|
|
2485
|
-
this.dialogRef?.close(this.webcamImage);
|
|
2486
|
-
});
|
|
2487
|
-
}
|
|
2488
|
-
else {
|
|
2489
|
-
this.dialogRef?.close(this.webcamImage);
|
|
2490
|
-
}
|
|
2491
|
-
// this.dialogRef.close(this.webcamImage)
|
|
2492
|
-
}
|
|
2493
|
-
retry() {
|
|
2494
|
-
this.preview = false;
|
|
2495
|
-
this.result = false;
|
|
2496
|
-
if (this.error) {
|
|
2497
|
-
this.documentTypeSelected = false;
|
|
2498
|
-
this.scanBlastData.forEach((element) => {
|
|
2499
|
-
element.image = null;
|
|
2500
|
-
});
|
|
2501
|
-
}
|
|
2502
|
-
this.error = false;
|
|
2503
|
-
}
|
|
2504
|
-
triggerSnapshot() {
|
|
2505
|
-
this.trigger.next(0);
|
|
2464
|
+
this.documentTypeSelected = false;
|
|
2465
|
+
setTimeout(() => {
|
|
2466
|
+
this.selectedSide.image = this.webcamImage;
|
|
2467
|
+
if (this.selectedSide.side === 'FRONT') {
|
|
2468
|
+
this.scanBlastData[1].disabled = false;
|
|
2469
|
+
}
|
|
2470
|
+
this.cd.detectChanges();
|
|
2471
|
+
}, 200);
|
|
2506
2472
|
}
|
|
2507
2473
|
scan() {
|
|
2508
|
-
|
|
2509
|
-
this.
|
|
2510
|
-
this.
|
|
2474
|
+
// this.triggerSnapshot();
|
|
2475
|
+
// this.scanDatas[0] = true;
|
|
2476
|
+
// if (this.scanTimeout) {
|
|
2477
|
+
// clearTimeout(this.scanTimeout);
|
|
2478
|
+
// }
|
|
2479
|
+
// this.scanTimeout = setTimeout(() => {
|
|
2480
|
+
// this.scan();
|
|
2481
|
+
// }, 1);
|
|
2511
2482
|
}
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
this.
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2483
|
+
handleImage(webcamImage) {
|
|
2484
|
+
// console.log('[received webcam image]', webcamImage);
|
|
2485
|
+
this.zone.runOutsideAngular(() => {
|
|
2486
|
+
const time = new Date().getTime();
|
|
2487
|
+
if (this.scanImageTimestamps.load > 0) {
|
|
2488
|
+
const { load } = this.scanImageTimestamps;
|
|
2489
|
+
const diff = time - load;
|
|
2490
|
+
// console.log('time:', diff);
|
|
2491
|
+
this.scanDelay = diff;
|
|
2492
|
+
}
|
|
2493
|
+
this.scanImageTimestamps.load = time;
|
|
2494
|
+
if (webcamImage.imageData) {
|
|
2495
|
+
this.scannedImages.push(webcamImage);
|
|
2496
|
+
}
|
|
2497
|
+
this.cd.detectChanges();
|
|
2498
|
+
if (this.scannedImages.length > 4 && !this.validation) {
|
|
2499
|
+
console.timeEnd('scan');
|
|
2500
|
+
console.time('scan');
|
|
2501
|
+
// get last 10
|
|
2502
|
+
console.log('CAPTURED:', this.scannedImages.length);
|
|
2503
|
+
const images = this.scannedImages.slice(-5);
|
|
2504
|
+
// set images to 0
|
|
2505
|
+
this.scannedImages = [];
|
|
2506
|
+
const imagesArray = images.map((m) => m.imageResized.split(',')[1]);
|
|
2507
|
+
this.validation = true;
|
|
2508
|
+
this.handleBurstData(imagesArray, images);
|
|
2509
|
+
}
|
|
2510
|
+
if (this.cameraReady) {
|
|
2511
|
+
this.trigger.next(new Date().getTime());
|
|
2512
|
+
}
|
|
2523
2513
|
});
|
|
2524
|
-
this.cd.detectChanges();
|
|
2525
2514
|
}
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
ScanSelfieComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScanSelfieComponent, selector: "app-scan-selfie", inputs: { type: "type" }, outputs: { actions: "actions" }, host: { listeners: { "window:resize": "onResize($event)" } }, viewQueries: [{ propertyName: "wraper", first: true, predicate: ["wraper"], descendants: true }], ngImport: i0, template: "<header class=\"page-header\" fxLayout=\"row\">\n <div class=\"title\" ngClass.lt-sm=\"title-small\">Selfie</div>\n\n <span fxFlex></span>\n <ng-container\n *ngIf=\"\n documentTypeSelected &&\n !result &&\n !error &&\n multipleWebcamsAvailable &&\n !preview\n \"\n >\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <mat-form-field\n style=\"font-size: 14px; width: 200px; margin-top: 8px\"\n class=\"w-200 mr-16 mt-8\"\n >\n <mat-label> Camera </mat-label>\n <mat-select\n (selectionChange)=\"selectCamera($event)\"\n [(ngModel)]=\"deviceId\"\n >\n <mat-option\n *ngFor=\"let device of mediaDevices\"\n [value]=\"device.deviceId\"\n >\n {{ device.label }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <ng-container>\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container>\n <!-- <ng-container *ngIf=\"type === 'desktop'\">\n <div class=\"separator\"></div>\n <button mat-button (click)=\"sendMobile()\">\n <mat-icon>tablet_mac</mat-icon>\n </button>\n\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container> -->\n</header>\n\n<div *ngIf=\"!result\" fxFlex fxLayout=\"column\">\n <div fxFlex #wraper class=\"wraper\" fxLayout=\"row\">\n <div\n style=\"\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n z-index: 20;\n background-color: whitesmoke;\n \"\n *ngIf=\"!cameraReady && !preview\"\n >\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n\n <ng-container *ngIf=\"!error\">\n <!-- <div\n class=\"rectangle\"\n [ngStyle]=\"{\n 'width.px': videoHeight * 0.75 * 1.588,\n 'height.px': videoHeight * 0.75\n }\"\n ></div>\n <svg\n *ngIf=\"videoWidth\"\n style=\"position: absolute; left: 0px; top: 0px\"\n width=\"0\"\n height=\"0\"\n >\n <defs>\n <clipPath id=\"myClip\">\n <rect\n stroke-width=\"6\"\n stroke-color=\"red\"\n [attr.x]=\"(videoWidth - videoHeight * 0.75 * 1.588) / 2\"\n [attr.y]=\"(videoHeight * 0.25) / 2\"\n [attr.width]=\"videoHeight * 0.75 * 1.588\"\n [attr.height]=\"videoHeight * 0.75\"\n rx=\"25\"\n />\n </clipPath>\n </defs>\n </svg> -->\n\n <app-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main\"\n [imageQuality]=\"1\"\n #webcam\n fxFlex\n [trigger]=\"trigger\"\n (imageCapture)=\"handleImage($event)\"\n [allowCameraSwitch]=\"allowCameraSwitch\"\n [videoOptions]=\"videoOptions\"\n [switchCamera]=\"nextWebcamObservable\"\n (cameraSwitched)=\"cameraWasSwitched($event)\"\n (initError)=\"handleInitError($event)\"\n type=\"selfie\"\n [width]=\"width\"\n [height]=\"height\"\n (destroyed)=\"cameraOff($event)\"\n >\n </app-webcam>\n </ng-container>\n <div\n fxLayout=\"row\"\n fxFlex\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"z-index: 20; position: absolute; width: 100%; height: 100%\"\n >\n <div\n class=\"scanPreview\"\n fxFlex\n fxLayout=\"column\"\n *ngIf=\"!error && !scaning\"\n >\n <div\n fxFlex\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer fxLayout=\"row\" class=\"p-8\">\n <button\n [disabled]=\"!cameraReady\"\n class=\"w-100-p\"\n *ngIf=\"!preview\"\n mat-raised-button\n (click)=\"scan()\"\n >\n <ng-container>\n TAKE SELFIE\n </ng-container>\n </button>\n\n <div\n class=\"w-100-p\"\n *ngIf=\"preview\"\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n fxFlex\n >\n <button fxFlex class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n RETRY\n </button>\n\n <button\n [disabled]=\"error\"\n fxFlex\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n CONTINUE\n\n </button>\n </div>\n </footer>\n</div>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5}.element{margin-bottom:8px}.element label{font-size:14px}.element div{font-size:18px}.wraper{position:relative;overflow:hidden}h3{color:#459ae5;font-size:16px}.preview{width:100%;border-radius:1%}.documentTypeWraper{width:400px}.documentTypeWraper .label{font-size:14px;margin-bottom:20px}.documentTypeWraper button{box-shadow:none}.overPane{position:absolute;width:100%;height:100%;top:0;left:0}.overPane app-webcam{clip-path:url(#myClip)}.subhead{height:55px;padding-top:8px}.rectangle{z-index:2;position:absolute;top:50%;left:50%;width:85.6mm;height:53.98mm;transform:translate(-50%,-50%);box-sizing:border-box;border:2px dashed #459be5;border-radius:3mm}.mask{z-index:1;position:absolute;width:100%;height:100%;background-position:center center;background-size:380mm;background-repeat:no-repeat}.label{font-size:11px;margin-top:4px}footer button{box-shadow:none!important;height:45px;min-height:45px;border:1px solid rgba(0,0,0,.12);text-transform:uppercase}h4{font-size:16px}.images label{font-size:11px;color:#888;line-height:20px}.images .title{padding:8px 0;font-weight:600}.images img{margin-bottom:16px}.error .title{font-size:22px}.error ul{font-size:18px}.photo{width:120px;height:120px;overflow:hidden}.signature{width:200px}mat-card{box-shadow:none!important}.scanBlastWraper button{text-transform:uppercase}.scanBlastWraper.mobile mat-card{margin:4px!important}.scanBlastWraper.mobile .description{font-size:12px;flex-direction:row!important}.scanBlastWraper.mobile .description .imgWrap{padding:0!important}.scanBlastWraper.mobile .description .btnActions{position:absolute;right:0}.scanBlastWraper.mobile .description button{font-size:11px!important;margin:0!important;position:absolute;right:16px}.scanBlastWraper.mobile .description button.rotateButton{top:58px}.scanBlastWraper.mobile .description button.remButton{top:8px}.scanBlastWraper.mobile .description button mat-icon{margin:0!important}.scanBlastWraper.mobile .description button div.label{display:none}.mobile .scanBlast button{font-size:11px!important}.scanBlast{display:flex;flex-direction:row;flex:1;padding:0 4px}.scanBlast mat-card{padding:0;box-shadow:none;margin:8px 4px;flex:1}.scanBlast mat-card .head{display:flex;flex-direction:row;align-items:center;justify-items:center;border-bottom:1px solid rgba(0,0,0,.12);height:60px;padding:8px}.scanBlast mat-card .head.small{height:30px!important;padding:4px 8px!important}.scanBlast mat-card .head.small .title{font-size:12px!important;margin-left:4px!important}.scanBlast mat-card .head button{max-width:120px;height:40px;box-shadow:none;border:1px solid rgba(0,0,0,.12)}.scanBlast mat-card .head .title{margin-left:16px;color:#459ae5;font-size:16px}.scanBlast mat-card .content{margin:8px;flex:1}.scanBlast mat-card .description{text-align:center;color:#888;font-size:14px}.scanBlast mat-card .actions{background-color:#e9e9e9;display:flex;flex-direction:row}.scanBlast mat-card .actions .mat-button-disabled{background-color:#fff!important}.scanBlast mat-card .actions button{box-shadow:none;width:50%;margin:8px;height:40px;font-size:12px}.scanBlast mat-card .actions button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder{flex:1;border-radius:6px;display:flex;flex-direction:column}.scanBlast mat-card .previewPlaceholder .description{display:flex;flex:1;flex-direction:column;justify-content:center}.scanBlast mat-card .previewPlaceholder button{box-shadow:none;margin-top:8px;height:40px;font-size:12px}.scanBlast mat-card .previewPlaceholder button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder .imgWrap{flex-direction:column;flex:1;padding:8px;background-color:#f5f5f5;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap img{width:100%;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap .image{background-position:center;background-repeat:no-repeat;background-size:contain}.mr-4{margin-right:4px}.ml-4{margin-left:4px}.p-16{padding:16px}.p-8{padding:8px}.py-16{padding:16px 0}.w-100-p{width:100%}.scanPreview{padding:16px}.scanPreview .image{background-position:center;background-repeat:no-repeat;background-size:contain}.empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center}.summary label{font-size:12px;color:#888;margin-top:2px}.summary .name{font-size:14px}.selfieContainer{display:flex;flex-direction:column;margin-bottom:20px}.selfieContainer button{box-shadow:none;border:1px solid rgba(0,0,0,.12)}.selfieContainer .selfie{margin:8px auto;width:120px;height:120px;border-radius:60px;border:1px solid rgba(0,0,0,.12)}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"], dependencies: [{ kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6$1.MatLabel, selector: "mat-label" }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i8.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i9.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i1$4.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: WebcamComponent, selector: "app-webcam", inputs: ["imageHandler", "id", "type", "width", "height", "videoOptions", "allowCameraSwitch", "mirrorImage", "captureImageData", "imageType", "imageQuality", "trigger", "switchCamera"], outputs: ["imageCapture", "initError", "imageClick", "cameraSwitched", "videoReady", "destroyed"] }, { kind: "directive", type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i5$1.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2515
|
+
handleBurstData(imagesArray, images, type = 'plain') {
|
|
2516
|
+
this.__subs(this.scanProvider.burst(imagesArray)).subscribe((resp) => {
|
|
2517
|
+
this.displayInfo = resp.Info;
|
|
2518
|
+
console.timeEnd('validationPOST');
|
|
2519
|
+
console.log('AnalysisTime', resp.AnalysisTime);
|
|
2520
|
+
const { DocType, Series, Side, InfoCode } = resp;
|
|
2521
|
+
// if (InfoCode === '1006' && this.idScan) {
|
|
2522
|
+
// this.handleLongValidationError(image);
|
|
2523
|
+
// }
|
|
2524
|
+
if (resp.Validated) {
|
|
2525
|
+
console.log('[SCANNED INDEX]', resp.Index);
|
|
2526
|
+
const selectedImage = images[resp.Index];
|
|
2527
|
+
// this.preview = this.webcamImage.imageAsDataUrl;
|
|
2528
|
+
this.cd.detectChanges();
|
|
2529
|
+
let image = selectedImage;
|
|
2530
|
+
if (type == 'worker') {
|
|
2531
|
+
const dataUrl = this.handleBitmapImage(selectedImage.bitmap);
|
|
2532
|
+
image = { dataUrl };
|
|
2533
|
+
}
|
|
2534
|
+
if (InfoCode === '1007') {
|
|
2535
|
+
// For ID ask for other side
|
|
2536
|
+
if (Side === 'FRONT') {
|
|
2537
|
+
this.scanBlastData[0].image = image;
|
|
2538
|
+
}
|
|
2539
|
+
else {
|
|
2540
|
+
this.scanBlastData[1].image = image;
|
|
2541
|
+
}
|
|
2542
|
+
if (this.scanBlastData[0].image && this.scanBlastData[1].image) {
|
|
2543
|
+
console.warn('UPLOAD');
|
|
2544
|
+
if (type == 'worker') {
|
|
2545
|
+
this.imageHandler.next({ type: 'stop' });
|
|
2546
|
+
}
|
|
2547
|
+
this.scanBlastFinish();
|
|
2548
|
+
}
|
|
2549
|
+
else {
|
|
2550
|
+
const num = Side === 'FRONT' ? 1 : 0;
|
|
2551
|
+
this.singleScan(this.scanBlastData[num]);
|
|
2552
|
+
this.scan();
|
|
2553
|
+
this.idScan = this.scanBlastData[num].side;
|
|
2554
|
+
if (!this.showDialog) {
|
|
2555
|
+
this.showDialog = true;
|
|
2556
|
+
this.zone.run(() => {
|
|
2557
|
+
this.dialogs.turnDocument(this.idScan).subscribe(() => {
|
|
2558
|
+
this.showDialog = false;
|
|
2559
|
+
this.validation = false;
|
|
2560
|
+
});
|
|
2561
|
+
});
|
|
2562
|
+
}
|
|
2563
|
+
console.log('ID SIDE', this.idScan);
|
|
2564
|
+
this.displayInfo = 'Please turn the document over!';
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
else {
|
|
2568
|
+
this.scanBlastData[0].image = image;
|
|
2569
|
+
console.warn('UPLOAD');
|
|
2570
|
+
if (type == 'worker') {
|
|
2571
|
+
this.imageHandler.next({ type: 'stop' });
|
|
2572
|
+
}
|
|
2573
|
+
this.scanBlastFinish();
|
|
2574
|
+
}
|
|
2575
|
+
this.scannedImages = [];
|
|
2576
|
+
// this.scanBlastData[0].image = selectedImage;
|
|
2577
|
+
//this.scanBlastFinish();
|
|
2578
|
+
}
|
|
2579
|
+
else {
|
|
2580
|
+
this.validation = false;
|
|
2581
|
+
}
|
|
2582
|
+
});
|
|
2557
2583
|
}
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
console.warn('Component missing', name, this.components);
|
|
2561
|
-
}
|
|
2562
|
-
return this.components[name].component;
|
|
2584
|
+
handleInitError(error) {
|
|
2585
|
+
console.log(error);
|
|
2563
2586
|
}
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
const panelClass = config.panelClass ? config.panelClass : config.name;
|
|
2567
|
-
const component = this.getComponent(config.name);
|
|
2568
|
-
const dialogRef = this.matDialog.open(this.blank, {
|
|
2569
|
-
panelClass,
|
|
2570
|
-
data: {
|
|
2571
|
-
data: config.data,
|
|
2572
|
-
withComponent,
|
|
2573
|
-
component,
|
|
2574
|
-
},
|
|
2575
|
-
autoFocus: false,
|
|
2576
|
-
width: config.width || '',
|
|
2577
|
-
height: config.height || '',
|
|
2578
|
-
maxWidth: config.maxWidth || '',
|
|
2579
|
-
minWidth: config.minWidth || '',
|
|
2580
|
-
maxHeight: config.maxHeight || '',
|
|
2581
|
-
minHeight: config.minHeight || '',
|
|
2582
|
-
position: config.position || {},
|
|
2583
|
-
hasBackdrop: config.hasBackdrop === undefined ? true : config.hasBackdrop,
|
|
2584
|
-
disableClose: config.disableClose === undefined ? true : config.disableClose,
|
|
2585
|
-
});
|
|
2586
|
-
return dialogRef;
|
|
2587
|
+
get scanBlastCanUpload() {
|
|
2588
|
+
return this.scanBlastData[0].image ? true : false;
|
|
2587
2589
|
}
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2590
|
+
cameraWasSwitched(deviceId) {
|
|
2591
|
+
console.log('[active device]', deviceId);
|
|
2592
|
+
this.deviceId = deviceId;
|
|
2593
|
+
this.cameraReady = true;
|
|
2594
|
+
this.defaultDevice = deviceId;
|
|
2595
|
+
setTimeout(() => {
|
|
2596
|
+
this.onResize();
|
|
2597
|
+
this.scan();
|
|
2598
|
+
}, 300);
|
|
2594
2599
|
}
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
return this.open({
|
|
2598
|
-
name: 'Loading',
|
|
2599
|
-
data: { title },
|
|
2600
|
-
});
|
|
2600
|
+
get nextWebcamObservable() {
|
|
2601
|
+
return this.nextWebcam.asObservable();
|
|
2601
2602
|
}
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2603
|
+
handleLongValidationError(img) {
|
|
2604
|
+
// save current image after 10sec
|
|
2605
|
+
const diff = (Date.now() - this.startTime) / 1000;
|
|
2606
|
+
if (diff > 15 &&
|
|
2607
|
+
!this.verificationErrorSent &&
|
|
2608
|
+
this.scanProvider.config.development) {
|
|
2609
|
+
this.verificationErrorSent = true;
|
|
2610
|
+
const dataUrl = this.handleBitmapImage(img.bitmap);
|
|
2611
|
+
console.warn('SENT');
|
|
2612
|
+
// this.displayInfo = 'Cant detect document!';
|
|
2613
|
+
this.logData.Request = this.__subs(this.scanProvider.sendLog({
|
|
2614
|
+
AcceptTermsAndConditions: true,
|
|
2615
|
+
ExpectedOutput: {},
|
|
2616
|
+
Request: {
|
|
2617
|
+
verification: dataUrl.split(',')[1],
|
|
2618
|
+
},
|
|
2619
|
+
Response: {
|
|
2620
|
+
TransactionID: v4(),
|
|
2621
|
+
},
|
|
2622
|
+
})).subscribe();
|
|
2623
|
+
}
|
|
2610
2624
|
}
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
data,
|
|
2625
|
+
ngAfterViewInit() {
|
|
2626
|
+
this.cd.detectChanges();
|
|
2627
|
+
this.autoScan();
|
|
2628
|
+
this.__subs(this.layoutProvider.breakpoint$).subscribe((v) => {
|
|
2629
|
+
this.isMobile = !v.matches;
|
|
2630
|
+
console.log('MNOBILE', this.isMobile);
|
|
2618
2631
|
});
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2632
|
+
this.imageHandlerSubscription = this.imageHandler.subscribe((webcamImage) => {
|
|
2633
|
+
// return;
|
|
2634
|
+
if (this.startTime === 0) {
|
|
2635
|
+
this.startTime = Date.now();
|
|
2636
|
+
}
|
|
2637
|
+
this.zone.runOutsideAngular(() => {
|
|
2638
|
+
if (webcamImage.base64) {
|
|
2639
|
+
const time = new Date().getTime();
|
|
2640
|
+
if (this.scanImageTimestamps.load > 0) {
|
|
2641
|
+
const { load } = this.scanImageTimestamps;
|
|
2642
|
+
const diff = time - load;
|
|
2643
|
+
// console.warn('TIME', diff);
|
|
2644
|
+
this.scanDelay = diff;
|
|
2645
|
+
}
|
|
2646
|
+
this.scanImageTimestamps.load = time;
|
|
2647
|
+
this.scannedImages.push(webcamImage);
|
|
2648
|
+
this.handleLongValidationError(webcamImage);
|
|
2649
|
+
}
|
|
2650
|
+
// this.cd.detectChanges();
|
|
2651
|
+
if (this.scannedImages.length > 4 && !this.validation) {
|
|
2652
|
+
// get last 10
|
|
2653
|
+
console.timeEnd('validationTOTAL_UI');
|
|
2654
|
+
console.time('validationTOTAL_UI');
|
|
2655
|
+
const images = this.scannedImages.slice(-5);
|
|
2656
|
+
// set images to 0
|
|
2657
|
+
this.scannedImages = [];
|
|
2658
|
+
console.log(images);
|
|
2659
|
+
const imagesArray = images.map((m) => m.base64.split(',')[1]);
|
|
2660
|
+
this.validation = true;
|
|
2661
|
+
this.handleBurstData(imagesArray, images, 'worker');
|
|
2662
|
+
console.time('validationPOST');
|
|
2663
|
+
}
|
|
2664
|
+
this.cd.detectChanges();
|
|
2665
|
+
});
|
|
2625
2666
|
});
|
|
2626
2667
|
}
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
this.translate = translate;
|
|
2640
|
-
}
|
|
2641
|
-
forms(item, namespace = null) {
|
|
2642
|
-
if (item.fieldGroup) {
|
|
2643
|
-
item.fieldGroup = item.fieldGroup.map((field) => this.forms(field));
|
|
2644
|
-
}
|
|
2645
|
-
const prefix = namespace ? namespace + '.' : '';
|
|
2646
|
-
if (item.templateOptions &&
|
|
2647
|
-
(item.templateOptions.label ||
|
|
2648
|
-
item.templateOptions.placeholder ||
|
|
2649
|
-
item.templateOptions.options)) {
|
|
2650
|
-
if (!item.expressionProperties) {
|
|
2651
|
-
item.expressionProperties = {};
|
|
2652
|
-
}
|
|
2653
|
-
if (item.templateOptions.label) {
|
|
2654
|
-
item.expressionProperties['templateOptions.label'] =
|
|
2655
|
-
this.translate.stream(prefix + item.templateOptions.label);
|
|
2656
|
-
}
|
|
2657
|
-
if (item.templateOptions.placeholder) {
|
|
2658
|
-
item.expressionProperties['templateOptions.placeholder'] =
|
|
2659
|
-
this.translate.stream(prefix + item.templateOptions.placeholder);
|
|
2660
|
-
}
|
|
2661
|
-
if (Array.isArray(item.templateOptions.options)) {
|
|
2662
|
-
item.expressionProperties['templateOptions.options'] =
|
|
2663
|
-
item.templateOptions.options.map((m) => {
|
|
2664
|
-
// console.log(m);
|
|
2665
|
-
if (m.label) {
|
|
2666
|
-
m.label = this.translate.instant(prefix + m.label);
|
|
2667
|
-
}
|
|
2668
|
-
return m;
|
|
2669
|
-
});
|
|
2670
|
-
}
|
|
2668
|
+
handleBitmapImage(bitmap) {
|
|
2669
|
+
const { width, height } = bitmap;
|
|
2670
|
+
const offscreenSmall = document.createElement('canvas');
|
|
2671
|
+
offscreenSmall.width = width;
|
|
2672
|
+
offscreenSmall.height = height;
|
|
2673
|
+
const ctx = offscreenSmall.getContext('bitmaprenderer');
|
|
2674
|
+
if (ctx) {
|
|
2675
|
+
ctx.imageSmoothingEnabled = false;
|
|
2676
|
+
ctx.transferFromImageBitmap(bitmap);
|
|
2677
|
+
bitmap.close();
|
|
2678
|
+
const data = ctx.canvas.toDataURL('image/jpeg');
|
|
2679
|
+
return data;
|
|
2671
2680
|
}
|
|
2672
|
-
return
|
|
2681
|
+
return null;
|
|
2673
2682
|
}
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
type: Injectable,
|
|
2679
|
-
args: [{
|
|
2680
|
-
providedIn: 'root',
|
|
2681
|
-
}]
|
|
2682
|
-
}], ctorParameters: function () { return [{ type: i4$1.TranslateService }]; } });
|
|
2683
|
-
|
|
2684
|
-
class ScanFieldsProvider {
|
|
2685
|
-
constructor(translate, provider) {
|
|
2686
|
-
this.translate = translate;
|
|
2687
|
-
this.provider = provider;
|
|
2683
|
+
autoScan() {
|
|
2684
|
+
const side = this.scanBlastData[0];
|
|
2685
|
+
this.idScan = null;
|
|
2686
|
+
this.singleScan(side);
|
|
2688
2687
|
}
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
templateOptions: {
|
|
2701
|
-
label: 'form.scan.document.update.profile',
|
|
2702
|
-
},
|
|
2703
|
-
},
|
|
2704
|
-
{
|
|
2705
|
-
wrappers: [],
|
|
2706
|
-
type: 'checkbox',
|
|
2707
|
-
class: 'checkbox ',
|
|
2708
|
-
key: 'document',
|
|
2709
|
-
defaultValue: true,
|
|
2710
|
-
templateOptions: {
|
|
2711
|
-
label: 'form.scan.document.update.document',
|
|
2712
|
-
},
|
|
2713
|
-
},
|
|
2714
|
-
{
|
|
2715
|
-
wrappers: [],
|
|
2716
|
-
type: 'checkbox',
|
|
2717
|
-
class: 'checkbox ',
|
|
2718
|
-
key: 'attachment',
|
|
2719
|
-
defaultValue: true,
|
|
2720
|
-
templateOptions: {
|
|
2721
|
-
label: 'form.scan.document.update.attachment',
|
|
2722
|
-
},
|
|
2723
|
-
},
|
|
2724
|
-
].map((item) => this.translate.forms(item)),
|
|
2725
|
-
},
|
|
2726
|
-
];
|
|
2688
|
+
singleScan(side) {
|
|
2689
|
+
this.scanType = side.side;
|
|
2690
|
+
this.preview = null;
|
|
2691
|
+
this.selectedSide = side;
|
|
2692
|
+
this.selectedSide.image = null;
|
|
2693
|
+
this.documentTypeSelected = true;
|
|
2694
|
+
this.scanBlastData[1].disabled = false;
|
|
2695
|
+
this.cd.detectChanges();
|
|
2696
|
+
setTimeout(() => {
|
|
2697
|
+
this.onResize();
|
|
2698
|
+
}, 10);
|
|
2727
2699
|
}
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2700
|
+
getImgBase64(num) {
|
|
2701
|
+
console.log('GET 64');
|
|
2702
|
+
return this.scanBlastData[num].image.dataUrl.split(',')[1];
|
|
2703
|
+
}
|
|
2704
|
+
scanBlastFinish() {
|
|
2705
|
+
console.time('upload');
|
|
2706
|
+
if (this.type === 'mobile') {
|
|
2707
|
+
this.actions.emit({ data: this.scanBlastData });
|
|
2708
|
+
this.retake();
|
|
2709
|
+
return;
|
|
2710
|
+
}
|
|
2711
|
+
this.idScan = null;
|
|
2712
|
+
// const loading = this.dialogs.loading();
|
|
2713
|
+
this.scaning = true;
|
|
2714
|
+
this.cd.detectChanges();
|
|
2715
|
+
console.time('payload');
|
|
2716
|
+
const payload = {
|
|
2717
|
+
AcceptTermsAndConditions: true,
|
|
2718
|
+
DataFields: {
|
|
2719
|
+
FrontImageType: 'base64',
|
|
2720
|
+
FrontImageCropped: false,
|
|
2721
|
+
BackImageType: 'base64',
|
|
2722
|
+
BackImageCropped: false,
|
|
2723
|
+
FrontImage: this.getImgBase64(0),
|
|
2724
|
+
BackImage: this.scanBlastData[1].image ? this.getImgBase64(1) : null,
|
|
2725
|
+
},
|
|
2726
|
+
Settings: {
|
|
2727
|
+
ShouldValidate: true,
|
|
2728
|
+
ShouldReturnDocumentImage: true,
|
|
2729
|
+
ShouldReturnFaceIfDetected: true,
|
|
2730
|
+
SkipImageSizeCheck: true,
|
|
2731
|
+
CanStoreImages: this.scanProvider.canStoreImages,
|
|
2732
|
+
},
|
|
2733
|
+
// CallBackUrl: 'http://demo:5000/report/extracted/',
|
|
2734
|
+
};
|
|
2735
|
+
if (!this.scanBlastData[1].image) {
|
|
2736
|
+
payload.Settings.IgnoreBackImage = true;
|
|
2737
|
+
}
|
|
2738
|
+
this.logData.Request = JSON.parse(JSON.stringify(payload));
|
|
2739
|
+
console.timeEnd('payload');
|
|
2740
|
+
this.__subs(this.scanProvider.blastPost(payload)).subscribe((data) => {
|
|
2741
|
+
//console.log(data);
|
|
2742
|
+
const results = data.Data;
|
|
2743
|
+
console.timeEnd('upload');
|
|
2744
|
+
console.time('parse');
|
|
2745
|
+
// data.InfoCode = '1001';
|
|
2746
|
+
this.logData.Response = JSON.parse(JSON.stringify(data));
|
|
2747
|
+
//loading.close();
|
|
2748
|
+
this.documentTypeSelected = true;
|
|
2749
|
+
this.scaning = false;
|
|
2750
|
+
if (data.InfoCode === '1001') {
|
|
2751
|
+
this.error = true;
|
|
2752
|
+
console.log('[ERROR] 1001');
|
|
2753
|
+
this.errorCode = '1001';
|
|
2754
|
+
// this.scanSide = 0;
|
|
2755
|
+
this.preview = true;
|
|
2756
|
+
this.cd.detectChanges();
|
|
2757
|
+
return;
|
|
2758
|
+
}
|
|
2759
|
+
if (data.InfoCode === '1002') {
|
|
2760
|
+
this.error = true;
|
|
2761
|
+
console.log('[ERROR] 1002');
|
|
2762
|
+
this.errorCode = '1002';
|
|
2763
|
+
// this.scanSide = 0;
|
|
2764
|
+
this.preview = true;
|
|
2765
|
+
this.cd.detectChanges();
|
|
2766
|
+
return;
|
|
2767
|
+
}
|
|
2768
|
+
if (results && data.Metadata.length > 0 && data.InfoCode === '1000') {
|
|
2769
|
+
console.log('Extraction time', data.AnalysisTime);
|
|
2770
|
+
this.zone.run(() => {
|
|
2771
|
+
if (data.ImageData?.Documents) {
|
|
2772
|
+
const { Documents } = data.ImageData;
|
|
2773
|
+
this.images = Documents.map((image, i) => {
|
|
2774
|
+
return { data: 'data:image/jpeg;base64,' + Documents[i] };
|
|
2775
|
+
});
|
|
2776
|
+
}
|
|
2777
|
+
this.result = this.scanProvider.parseBlast(results);
|
|
2778
|
+
console.log('RES', this.result);
|
|
2779
|
+
this.cd.detectChanges();
|
|
2780
|
+
this.model = this.result.model;
|
|
2781
|
+
if (data.ImageData?.FaceImage) {
|
|
2782
|
+
this.model._avatar =
|
|
2783
|
+
'data:image/jpeg;base64,' + data.ImageData?.FaceImage;
|
|
2784
|
+
}
|
|
2785
|
+
console.log('MODEL', this.model);
|
|
2786
|
+
this.cd.detectChanges();
|
|
2787
|
+
});
|
|
2788
|
+
}
|
|
2789
|
+
else {
|
|
2790
|
+
console.log('ERROR');
|
|
2791
|
+
// this.scanSide = 0;
|
|
2792
|
+
this.error = true;
|
|
2793
|
+
this.preview = true;
|
|
2794
|
+
this.cd.detectChanges();
|
|
2795
|
+
// this.documentTypeSelected = false;
|
|
2796
|
+
// this.retry();
|
|
2797
|
+
}
|
|
2798
|
+
this.cd.detectChanges();
|
|
2799
|
+
console.timeEnd('parse');
|
|
2800
|
+
}, (err) => {
|
|
2801
|
+
// loading.close();
|
|
2802
|
+
// this.scanSide = 0;
|
|
2803
|
+
this.error = true;
|
|
2804
|
+
this.preview = true;
|
|
2805
|
+
this.documentTypeSelected = true;
|
|
2806
|
+
this.scaning = false;
|
|
2807
|
+
});
|
|
2808
|
+
}
|
|
2809
|
+
retry() {
|
|
2810
|
+
this.preview = false;
|
|
2811
|
+
this.validation = false;
|
|
2812
|
+
this.errorCode = '1000';
|
|
2813
|
+
this.result = false;
|
|
2814
|
+
if (this.error) {
|
|
2815
|
+
this.documentTypeSelected = false;
|
|
2816
|
+
this.scanBlastData.forEach((element) => {
|
|
2817
|
+
element.image = null;
|
|
2818
|
+
});
|
|
2819
|
+
}
|
|
2820
|
+
this.error = false;
|
|
2821
|
+
this.autoScan();
|
|
2822
|
+
this.cd.detectChanges();
|
|
2823
|
+
}
|
|
2824
|
+
triggerSnapshot() {
|
|
2825
|
+
this.trigger.next(0);
|
|
2826
|
+
}
|
|
2827
|
+
retake() {
|
|
2828
|
+
this.validation = false;
|
|
2829
|
+
this.preview = false;
|
|
2830
|
+
this.error = false;
|
|
2831
|
+
this.result = false;
|
|
2832
|
+
this.scanSide = 0;
|
|
2833
|
+
this.imageVerified = false;
|
|
2834
|
+
this.scanDatas = [];
|
|
2835
|
+
this.scaning = false;
|
|
2836
|
+
this.images = [];
|
|
2837
|
+
this.scanInProgress = false;
|
|
2838
|
+
this.documentTypeSelected = false;
|
|
2839
|
+
this.scanBlastData.forEach((m) => {
|
|
2840
|
+
m.image = null;
|
|
2841
|
+
});
|
|
2842
|
+
this.autoScan();
|
|
2843
|
+
this.cd.detectChanges();
|
|
2844
|
+
}
|
|
2845
|
+
use() {
|
|
2846
|
+
// save images??
|
|
2847
|
+
if (this.scanProvider.canStoreImages) {
|
|
2848
|
+
this.logData.ExpectedOutput = JSON.parse(JSON.stringify(this.model));
|
|
2849
|
+
if (this.logData.ExpectedOutput?._avatar) {
|
|
2850
|
+
delete this.logData.ExpectedOutput._avatar;
|
|
2851
|
+
}
|
|
2852
|
+
this.__subs(this.scanProvider.sendLog(this.logData)).subscribe();
|
|
2853
|
+
console.log(this.logData);
|
|
2854
|
+
}
|
|
2855
|
+
this.dialogRef?.close({
|
|
2856
|
+
model: this.model,
|
|
2857
|
+
images: this.images,
|
|
2858
|
+
});
|
|
2859
|
+
}
|
|
2860
|
+
selfie() {
|
|
2861
|
+
this.dialogs
|
|
2862
|
+
.scanSelfie({ avatar: this.model._avatar })
|
|
2863
|
+
.afterClosed()
|
|
2864
|
+
.subscribe((resp) => {
|
|
2865
|
+
if (resp) {
|
|
2866
|
+
console.log(resp);
|
|
2867
|
+
if (this.scanProvider.enableVerification) {
|
|
2868
|
+
this.imageVerified = true;
|
|
2869
|
+
}
|
|
2870
|
+
this.model._avatar = resp.imageAsDataUrl;
|
|
2871
|
+
this.cd.detectChanges();
|
|
2872
|
+
}
|
|
2873
|
+
});
|
|
2874
|
+
}
|
|
2875
|
+
videoReady(event) {
|
|
2876
|
+
this.cameraReady = event;
|
|
2877
|
+
if (this.cameraReady && !this.scanInProgress) {
|
|
2878
|
+
this.scanInProgress = true;
|
|
2879
|
+
setTimeout(() => {
|
|
2880
|
+
this.trigger.next(new Date().getTime());
|
|
2881
|
+
}, 1000);
|
|
2882
|
+
}
|
|
2883
|
+
}
|
|
2884
|
+
}
|
|
2885
|
+
ScanComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i1$2.TranslateService }, { token: NgxScandocCameraProvider }, { token: i0.Injector }, { token: LayoutProvider }, { token: AuthProvider }], target: i0.ɵɵFactoryTarget.Component });
|
|
2886
|
+
ScanComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScanComponent, selector: "ngx-scan", inputs: { type: "type", dialogs: "dialogs", showDialog: "showDialog" }, outputs: { actions: "actions" }, host: { listeners: { "window:resize": "onResize($event)" }, properties: { "class.mobile": "this.class" } }, viewQueries: [{ propertyName: "wraper", first: true, predicate: ["wraper"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<section *ngIf=\"result\">\n <ngx-scan-results\n (action)=\"selfie()\"\n [form]=\"form\"\n [model]=\"model\"\n [images]=\"images\"\n ></ngx-scan-results>\n\n <footer>\n <div class=\"actions\">\n <button fxFlex class=\"mr-4\" mat-raised-button (click)=\"retake()\">\n {{ \"pms.dialogs.components.scanProfile.reTake\" | translate }}\n </button>\n <button\n [disabled]=\"error || form.invalid\"\n fxFlex\n class=\"ml-4\"\n mat-raised-button\n (click)=\"use()\"\n >\n {{ \"pms.dialogs.components.scanProfile.useData\" | translate }}\n </button>\n </div>\n </footer>\n</section>\n\n<section *ngIf=\"!result && documentTypeSelected\">\n <div #wraper class=\"wraper\">\n <div class=\"loading\" *ngIf=\"!cameraReady && !preview\">\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n\n <ng-container *ngIf=\"!error\">\n <app-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main\"\n [imageQuality]=\"1\"\n #webcam\n fxFlex\n type=\"document\"\n [trigger]=\"trigger\"\n [imageHandler]=\"imageHandler\"\n (imageCapture)=\"handleImage($event)\"\n [allowCameraSwitch]=\"allowCameraSwitch\"\n [videoOptions]=\"videoOptions\"\n [switchCamera]=\"cameraProvider.nextWebcamObservable\"\n (cameraSwitched)=\"cameraWasSwitched($event)\"\n (initError)=\"handleInitError($event)\"\n [width]=\"width\"\n [height]=\"height\"\n (destroyed)=\"cameraOff($event)\"\n (videoReady)=\"videoReady($event)\"\n >\n </app-webcam>\n </ng-container>\n <div\n fxLayout=\"row\"\n fxFlex\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"z-index: 20; position: absolute; width: 100%; height: 100%\"\n >\n <div class=\"p-16 error\" *ngIf=\"error\">\n <div>\n <div class=\"title\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <mat-icon>error_outline</mat-icon\n ><span class=\"ml-8\">{{\n \"pms.dialogs.components.scanProfile.unableToDetectId\" | translate\n }}</span>\n </div>\n\n <ng-container *ngIf=\"errorCode === '1001'\">\n <div>\n Could not classify the given object as a supported document.\n </div>\n </ng-container>\n <ng-container *ngIf=\"errorCode === '1002'\">\n <div>\n Something is wrong with extraction data. Please try again.\n </div>\n </ng-container>\n\n <ul *ngIf=\"errorCode === '1000'\">\n <li>\n {{\n \"pms.dialogs.components.scanProfile.placeIdCloseToDevice\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.ensureSufficientLight\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.holdDocumentSteady\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.makeSureAllEdgesOfTheIdAreVisible\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.makeSureThereAreNoGlareAndShadowsOnTheId\"\n | translate\n }}\n </li>\n </ul>\n </div>\n </div>\n\n <div\n class=\"scanPreview\"\n fxFlex\n fxLayout=\"column\"\n *ngIf=\"!error && !scaning\"\n >\n <!-- <div class=\"py-16\" style=\"font-size: 16px\">\n {{\n \"pms.dialogs.components.scanProfile.ensureAllTextsAreVisible\"\n | translate\n }}\n </div> -->\n <div\n fxFlex\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer>\n <div\n class=\"displayInfo\"\n ngClass.lt-sm=\"mobile\"\n *ngIf=\"!preview && cameraReady\"\n >\n {{ displayInfo }}\n </div>\n <!-- <div style=\"height: 26px\">\n <div\n style=\"text-align: center; font-size: 18px\"\n *ngIf=\"idScan && !preview && cameraReady\"\n >\n <ng-container *ngIf=\"idScan === 'BACK'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureBack\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"idScan === 'FRONT'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureFront\" | translate }}\n </ng-container>\n </div>\n </div> -->\n\n <div class=\"actions\" *ngIf=\"preview\">\n <button fxFlex class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n {{ \"pms.dialogs.components.scanProfile.retry\" | translate }}\n </button>\n\n <button\n [disabled]=\"error\"\n fxFlex\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n {{\n \"pms.dialogs.components.scanProfile.continueWithSelectedImage\"\n | translate\n }}\n </button>\n </div>\n </footer>\n</section>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5;overflow:hidden}section{flex:1;display:flex;flex-direction:column;position:relative;overflow:hidden}.wraper{position:relative;overflow:hidden;display:flex;flex-direction:column;flex:1}.wraper .loading{position:absolute;inset:0;z-index:20;background-color:#f5f5f5}.documentTurnOver{position:absolute;width:100%;height:100%;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.documentTurnOver mat-icon{width:200px;color:#fff;height:200px;font-size:100px}.displayInfo{text-align:center;flex:1;width:100%;background-color:#000;height:50px;line-height:50px;color:#fff;z-index:200}.displayInfo.mobile{font-size:12px}.preview{width:100%;border-radius:1%}footer button{box-shadow:none!important;height:45px;min-height:45px;text-transform:uppercase}footer .actions{display:flex;flex-direction:row;align-items:center;padding:8px}footer .actions button{flex:1}.error{display:flex;align-items:center;justify-content:center;flex:1}.error .title{font-size:20px;margin-bottom:8px}.error .title mat-icon{margin-right:8px}.error ul{font-size:18px;list-style-type:none}mat-card{box-shadow:none!important}.mr-4{margin-right:4px}.ml-4{margin-left:4px}.p-16{padding:16px}.p-8{padding:8px}.py-16{padding:16px 0}.w-100-p{width:100%}.scanPreview{padding:16px}.scanPreview .image{background-position:center;background-repeat:no-repeat;background-size:contain}.empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: WebcamComponent, selector: "app-webcam", inputs: ["imageHandler", "id", "type", "width", "height", "videoOptions", "allowCameraSwitch", "mirrorImage", "captureImageData", "imageType", "imageQuality", "trigger", "switchCamera"], outputs: ["imageCapture", "initError", "imageClick", "cameraSwitched", "videoReady", "destroyed"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i9.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: ScanResultsComponent, selector: "ngx-scan-results", inputs: ["model", "images", "form"], outputs: ["action"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2887
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanComponent, decorators: [{
|
|
2888
|
+
type: Component,
|
|
2889
|
+
args: [{ selector: 'ngx-scan', changeDetection: ChangeDetectionStrategy.OnPush, template: "<section *ngIf=\"result\">\n <ngx-scan-results\n (action)=\"selfie()\"\n [form]=\"form\"\n [model]=\"model\"\n [images]=\"images\"\n ></ngx-scan-results>\n\n <footer>\n <div class=\"actions\">\n <button fxFlex class=\"mr-4\" mat-raised-button (click)=\"retake()\">\n {{ \"pms.dialogs.components.scanProfile.reTake\" | translate }}\n </button>\n <button\n [disabled]=\"error || form.invalid\"\n fxFlex\n class=\"ml-4\"\n mat-raised-button\n (click)=\"use()\"\n >\n {{ \"pms.dialogs.components.scanProfile.useData\" | translate }}\n </button>\n </div>\n </footer>\n</section>\n\n<section *ngIf=\"!result && documentTypeSelected\">\n <div #wraper class=\"wraper\">\n <div class=\"loading\" *ngIf=\"!cameraReady && !preview\">\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n\n <ng-container *ngIf=\"!error\">\n <app-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main\"\n [imageQuality]=\"1\"\n #webcam\n fxFlex\n type=\"document\"\n [trigger]=\"trigger\"\n [imageHandler]=\"imageHandler\"\n (imageCapture)=\"handleImage($event)\"\n [allowCameraSwitch]=\"allowCameraSwitch\"\n [videoOptions]=\"videoOptions\"\n [switchCamera]=\"cameraProvider.nextWebcamObservable\"\n (cameraSwitched)=\"cameraWasSwitched($event)\"\n (initError)=\"handleInitError($event)\"\n [width]=\"width\"\n [height]=\"height\"\n (destroyed)=\"cameraOff($event)\"\n (videoReady)=\"videoReady($event)\"\n >\n </app-webcam>\n </ng-container>\n <div\n fxLayout=\"row\"\n fxFlex\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"z-index: 20; position: absolute; width: 100%; height: 100%\"\n >\n <div class=\"p-16 error\" *ngIf=\"error\">\n <div>\n <div class=\"title\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <mat-icon>error_outline</mat-icon\n ><span class=\"ml-8\">{{\n \"pms.dialogs.components.scanProfile.unableToDetectId\" | translate\n }}</span>\n </div>\n\n <ng-container *ngIf=\"errorCode === '1001'\">\n <div>\n Could not classify the given object as a supported document.\n </div>\n </ng-container>\n <ng-container *ngIf=\"errorCode === '1002'\">\n <div>\n Something is wrong with extraction data. Please try again.\n </div>\n </ng-container>\n\n <ul *ngIf=\"errorCode === '1000'\">\n <li>\n {{\n \"pms.dialogs.components.scanProfile.placeIdCloseToDevice\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.ensureSufficientLight\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.holdDocumentSteady\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.makeSureAllEdgesOfTheIdAreVisible\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.makeSureThereAreNoGlareAndShadowsOnTheId\"\n | translate\n }}\n </li>\n </ul>\n </div>\n </div>\n\n <div\n class=\"scanPreview\"\n fxFlex\n fxLayout=\"column\"\n *ngIf=\"!error && !scaning\"\n >\n <!-- <div class=\"py-16\" style=\"font-size: 16px\">\n {{\n \"pms.dialogs.components.scanProfile.ensureAllTextsAreVisible\"\n | translate\n }}\n </div> -->\n <div\n fxFlex\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer>\n <div\n class=\"displayInfo\"\n ngClass.lt-sm=\"mobile\"\n *ngIf=\"!preview && cameraReady\"\n >\n {{ displayInfo }}\n </div>\n <!-- <div style=\"height: 26px\">\n <div\n style=\"text-align: center; font-size: 18px\"\n *ngIf=\"idScan && !preview && cameraReady\"\n >\n <ng-container *ngIf=\"idScan === 'BACK'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureBack\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"idScan === 'FRONT'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureFront\" | translate }}\n </ng-container>\n </div>\n </div> -->\n\n <div class=\"actions\" *ngIf=\"preview\">\n <button fxFlex class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n {{ \"pms.dialogs.components.scanProfile.retry\" | translate }}\n </button>\n\n <button\n [disabled]=\"error\"\n fxFlex\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n {{\n \"pms.dialogs.components.scanProfile.continueWithSelectedImage\"\n | translate\n }}\n </button>\n </div>\n </footer>\n</section>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5;overflow:hidden}section{flex:1;display:flex;flex-direction:column;position:relative;overflow:hidden}.wraper{position:relative;overflow:hidden;display:flex;flex-direction:column;flex:1}.wraper .loading{position:absolute;inset:0;z-index:20;background-color:#f5f5f5}.documentTurnOver{position:absolute;width:100%;height:100%;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.documentTurnOver mat-icon{width:200px;color:#fff;height:200px;font-size:100px}.displayInfo{text-align:center;flex:1;width:100%;background-color:#000;height:50px;line-height:50px;color:#fff;z-index:200}.displayInfo.mobile{font-size:12px}.preview{width:100%;border-radius:1%}footer button{box-shadow:none!important;height:45px;min-height:45px;text-transform:uppercase}footer .actions{display:flex;flex-direction:row;align-items:center;padding:8px}footer .actions button{flex:1}.error{display:flex;align-items:center;justify-content:center;flex:1}.error .title{font-size:20px;margin-bottom:8px}.error .title mat-icon{margin-right:8px}.error ul{font-size:18px;list-style-type:none}mat-card{box-shadow:none!important}.mr-4{margin-right:4px}.ml-4{margin-left:4px}.p-16{padding:16px}.p-8{padding:8px}.py-16{padding:16px 0}.w-100-p{width:100%}.scanPreview{padding:16px}.scanPreview .image{background-position:center;background-repeat:no-repeat;background-size:contain}.empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center}\n"] }]
|
|
2890
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i1$2.TranslateService }, { type: NgxScandocCameraProvider }, { type: i0.Injector }, { type: LayoutProvider }, { type: AuthProvider }]; }, propDecorators: { type: [{
|
|
2891
|
+
type: Input
|
|
2892
|
+
}], dialogs: [{
|
|
2893
|
+
type: Input
|
|
2894
|
+
}], actions: [{
|
|
2895
|
+
type: Output
|
|
2896
|
+
}], showDialog: [{
|
|
2897
|
+
type: Input
|
|
2898
|
+
}], wraper: [{
|
|
2899
|
+
type: ViewChild,
|
|
2900
|
+
args: ['wraper']
|
|
2901
|
+
}], class: [{
|
|
2902
|
+
type: HostBinding,
|
|
2903
|
+
args: ['class.mobile']
|
|
2904
|
+
}], onResize: [{
|
|
2905
|
+
type: HostListener,
|
|
2906
|
+
args: ['window:resize', ['$event']]
|
|
2907
|
+
}] } });
|
|
2908
|
+
|
|
2909
|
+
class MaterialModule {
|
|
2910
|
+
}
|
|
2911
|
+
MaterialModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2912
|
+
MaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: MaterialModule, imports: [MatNativeDateModule,
|
|
2913
|
+
MatDatepickerModule,
|
|
2914
|
+
MatCardModule,
|
|
2915
|
+
MatMenuModule,
|
|
2916
|
+
MatIconModule,
|
|
2917
|
+
MatButtonModule,
|
|
2918
|
+
MatDialogModule,
|
|
2919
|
+
MatInputModule,
|
|
2920
|
+
MatSnackBarModule,
|
|
2921
|
+
MatProgressBarModule,
|
|
2922
|
+
MatTableModule,
|
|
2923
|
+
MatProgressSpinnerModule,
|
|
2924
|
+
MatPaginatorModule,
|
|
2925
|
+
MatSelectModule,
|
|
2926
|
+
MatCheckboxModule,
|
|
2927
|
+
MatChipsModule,
|
|
2928
|
+
MatBadgeModule,
|
|
2929
|
+
MatListModule,
|
|
2930
|
+
MatTabsModule,
|
|
2931
|
+
MatSliderModule,
|
|
2932
|
+
MatSlideToggleModule], exports: [MatNativeDateModule,
|
|
2933
|
+
MatDatepickerModule,
|
|
2934
|
+
MatSelectModule,
|
|
2935
|
+
MatCardModule,
|
|
2936
|
+
MatMenuModule,
|
|
2937
|
+
MatIconModule,
|
|
2938
|
+
MatButtonModule,
|
|
2939
|
+
MatDialogModule,
|
|
2940
|
+
MatInputModule,
|
|
2941
|
+
MatSnackBarModule,
|
|
2942
|
+
MatProgressBarModule,
|
|
2943
|
+
MatProgressSpinnerModule,
|
|
2944
|
+
MatTableModule,
|
|
2945
|
+
MatPaginatorModule,
|
|
2946
|
+
MatChipsModule,
|
|
2947
|
+
MatBadgeModule,
|
|
2948
|
+
MatCheckboxModule,
|
|
2949
|
+
MatListModule,
|
|
2950
|
+
MatTabsModule,
|
|
2951
|
+
MatSlideToggleModule,
|
|
2952
|
+
MatAutocompleteModule] });
|
|
2953
|
+
MaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MaterialModule, imports: [MatNativeDateModule,
|
|
2954
|
+
MatDatepickerModule,
|
|
2955
|
+
MatCardModule,
|
|
2956
|
+
MatMenuModule,
|
|
2957
|
+
MatIconModule,
|
|
2958
|
+
MatButtonModule,
|
|
2959
|
+
MatDialogModule,
|
|
2960
|
+
MatInputModule,
|
|
2961
|
+
MatSnackBarModule,
|
|
2962
|
+
MatProgressBarModule,
|
|
2963
|
+
MatTableModule,
|
|
2964
|
+
MatProgressSpinnerModule,
|
|
2965
|
+
MatPaginatorModule,
|
|
2966
|
+
MatSelectModule,
|
|
2967
|
+
MatCheckboxModule,
|
|
2968
|
+
MatChipsModule,
|
|
2969
|
+
MatBadgeModule,
|
|
2970
|
+
MatListModule,
|
|
2971
|
+
MatTabsModule,
|
|
2972
|
+
MatSliderModule,
|
|
2973
|
+
MatSlideToggleModule, MatNativeDateModule,
|
|
2974
|
+
MatDatepickerModule,
|
|
2975
|
+
MatSelectModule,
|
|
2976
|
+
MatCardModule,
|
|
2977
|
+
MatMenuModule,
|
|
2978
|
+
MatIconModule,
|
|
2979
|
+
MatButtonModule,
|
|
2980
|
+
MatDialogModule,
|
|
2981
|
+
MatInputModule,
|
|
2982
|
+
MatSnackBarModule,
|
|
2983
|
+
MatProgressBarModule,
|
|
2984
|
+
MatProgressSpinnerModule,
|
|
2985
|
+
MatTableModule,
|
|
2986
|
+
MatPaginatorModule,
|
|
2987
|
+
MatChipsModule,
|
|
2988
|
+
MatBadgeModule,
|
|
2989
|
+
MatCheckboxModule,
|
|
2990
|
+
MatListModule,
|
|
2991
|
+
MatTabsModule,
|
|
2992
|
+
MatSlideToggleModule,
|
|
2993
|
+
MatAutocompleteModule] });
|
|
2994
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MaterialModule, decorators: [{
|
|
2995
|
+
type: NgModule,
|
|
2996
|
+
args: [{
|
|
2997
|
+
imports: [
|
|
2998
|
+
MatNativeDateModule,
|
|
2999
|
+
MatDatepickerModule,
|
|
3000
|
+
MatCardModule,
|
|
3001
|
+
MatMenuModule,
|
|
3002
|
+
MatIconModule,
|
|
3003
|
+
MatButtonModule,
|
|
3004
|
+
MatDialogModule,
|
|
3005
|
+
MatInputModule,
|
|
3006
|
+
MatSnackBarModule,
|
|
3007
|
+
MatProgressBarModule,
|
|
3008
|
+
MatTableModule,
|
|
3009
|
+
MatProgressSpinnerModule,
|
|
3010
|
+
MatPaginatorModule,
|
|
3011
|
+
MatSelectModule,
|
|
3012
|
+
MatCheckboxModule,
|
|
3013
|
+
MatChipsModule,
|
|
3014
|
+
MatBadgeModule,
|
|
3015
|
+
MatListModule,
|
|
3016
|
+
MatTabsModule,
|
|
3017
|
+
MatSliderModule,
|
|
3018
|
+
MatSlideToggleModule,
|
|
3019
|
+
],
|
|
3020
|
+
exports: [
|
|
3021
|
+
MatNativeDateModule,
|
|
3022
|
+
MatDatepickerModule,
|
|
3023
|
+
MatSelectModule,
|
|
3024
|
+
MatCardModule,
|
|
3025
|
+
MatMenuModule,
|
|
3026
|
+
MatIconModule,
|
|
3027
|
+
MatButtonModule,
|
|
3028
|
+
MatDialogModule,
|
|
3029
|
+
MatInputModule,
|
|
3030
|
+
MatSnackBarModule,
|
|
3031
|
+
MatProgressBarModule,
|
|
3032
|
+
MatProgressSpinnerModule,
|
|
3033
|
+
MatTableModule,
|
|
3034
|
+
MatPaginatorModule,
|
|
3035
|
+
MatChipsModule,
|
|
3036
|
+
MatBadgeModule,
|
|
3037
|
+
MatCheckboxModule,
|
|
3038
|
+
MatListModule,
|
|
3039
|
+
MatTabsModule,
|
|
3040
|
+
MatSlideToggleModule,
|
|
3041
|
+
MatAutocompleteModule,
|
|
3042
|
+
],
|
|
3043
|
+
providers: [],
|
|
3044
|
+
}]
|
|
3045
|
+
}] });
|
|
3046
|
+
|
|
3047
|
+
class AvatarTypeComponent extends FieldType {
|
|
3048
|
+
constructor(cd) {
|
|
3049
|
+
super();
|
|
3050
|
+
this.cd = cd;
|
|
3051
|
+
this.width = 'w-120';
|
|
3052
|
+
this.padding = 'px-32 pt-8 pb-8';
|
|
3053
|
+
}
|
|
3054
|
+
ngOnChange() { }
|
|
3055
|
+
ngAfterViewInit() {
|
|
3056
|
+
if (this.to.width) {
|
|
3057
|
+
this.width = this.to.width;
|
|
3058
|
+
}
|
|
3059
|
+
if (this.to.padding) {
|
|
3060
|
+
this.padding = this.to.padding;
|
|
3061
|
+
}
|
|
3062
|
+
this.cd.detectChanges();
|
|
3063
|
+
}
|
|
3064
|
+
}
|
|
3065
|
+
AvatarTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AvatarTypeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3066
|
+
AvatarTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: AvatarTypeComponent, selector: "app-formly-avatar-type", usesInheritance: true, ngImport: i0, template: `
|
|
3067
|
+
<mat-card
|
|
3068
|
+
[ngClass]="padding"
|
|
3069
|
+
fxLayout="column"
|
|
3070
|
+
fxLayoutAlign="center center"
|
|
3071
|
+
>
|
|
3072
|
+
<ngx-avatars
|
|
3073
|
+
[name]="model[key.toString()]"
|
|
3074
|
+
[ngClass]="width"
|
|
3075
|
+
></ngx-avatars>
|
|
3076
|
+
</mat-card>
|
|
3077
|
+
`, isInline: true, styles: ["mat-card{border-radius:0;box-shadow:none!important}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i5$1.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i3.AvatarComponent, selector: "ngx-avatars", inputs: ["round", "size", "textSizeRatio", "bgColor", "fgColor", "borderColor", "style", "cornerRadius", "facebookId", "twitterId", "googleId", "instagramId", "vkontakteId", "skypeId", "gravatarId", "githubId", "src", "name", "value", "referrerpolicy", "placeholder", "initialsSize"], outputs: ["clickOnAvatar"] }] });
|
|
3078
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AvatarTypeComponent, decorators: [{
|
|
3079
|
+
type: Component,
|
|
3080
|
+
args: [{ selector: 'app-formly-avatar-type', template: `
|
|
3081
|
+
<mat-card
|
|
3082
|
+
[ngClass]="padding"
|
|
3083
|
+
fxLayout="column"
|
|
3084
|
+
fxLayoutAlign="center center"
|
|
3085
|
+
>
|
|
3086
|
+
<ngx-avatars
|
|
3087
|
+
[name]="model[key.toString()]"
|
|
3088
|
+
[ngClass]="width"
|
|
3089
|
+
></ngx-avatars>
|
|
3090
|
+
</mat-card>
|
|
3091
|
+
`, styles: ["mat-card{border-radius:0;box-shadow:none!important}\n"] }]
|
|
3092
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
|
|
3093
|
+
|
|
3094
|
+
class TitleTypeComponent extends FieldType {
|
|
3095
|
+
constructor(cd) {
|
|
3096
|
+
super();
|
|
3097
|
+
this.cd = cd;
|
|
3098
|
+
}
|
|
3099
|
+
ngOnInit() {
|
|
3100
|
+
this.opt = {
|
|
3101
|
+
badge: this.to.badge,
|
|
3102
|
+
};
|
|
3103
|
+
}
|
|
3104
|
+
ngAfterViewInit() {
|
|
3105
|
+
this.cd.detectChanges();
|
|
3106
|
+
}
|
|
3107
|
+
}
|
|
3108
|
+
TitleTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TitleTypeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3109
|
+
TitleTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TitleTypeComponent, selector: "app-formly-title-type", usesInheritance: true, ngImport: i0, template: `
|
|
3110
|
+
<div fxLayout="row" fxLayoutAlign="start center">
|
|
3111
|
+
<h3>
|
|
3112
|
+
<span>{{ to.label }}</span>
|
|
3113
|
+
|
|
3114
|
+
<span
|
|
3115
|
+
*ngIf="opt.badge && model[opt.badge] && model[opt.badge].length > 1"
|
|
3116
|
+
matBadgeSize="small"
|
|
3117
|
+
matBadgeColor="primary"
|
|
3118
|
+
matBadgeOverlap="false"
|
|
3119
|
+
></span>
|
|
3120
|
+
</h3>
|
|
3121
|
+
<span fxFlex></span>
|
|
3122
|
+
<div *ngIf="to.chip" class="chip">
|
|
3123
|
+
{{ to.chip | translate }}
|
|
3124
|
+
</div>
|
|
3125
|
+
</div>
|
|
3126
|
+
`, isInline: true, styles: [".chip{background:whitesmoke;border-radius:6px;padding:4px 8px;font-size:12px;color:#888;font-weight:600}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }] });
|
|
3127
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TitleTypeComponent, decorators: [{
|
|
3128
|
+
type: Component,
|
|
3129
|
+
args: [{ selector: 'app-formly-title-type', template: `
|
|
3130
|
+
<div fxLayout="row" fxLayoutAlign="start center">
|
|
3131
|
+
<h3>
|
|
3132
|
+
<span>{{ to.label }}</span>
|
|
3133
|
+
|
|
3134
|
+
<span
|
|
3135
|
+
*ngIf="opt.badge && model[opt.badge] && model[opt.badge].length > 1"
|
|
3136
|
+
matBadgeSize="small"
|
|
3137
|
+
matBadgeColor="primary"
|
|
3138
|
+
matBadgeOverlap="false"
|
|
3139
|
+
></span>
|
|
3140
|
+
</h3>
|
|
3141
|
+
<span fxFlex></span>
|
|
3142
|
+
<div *ngIf="to.chip" class="chip">
|
|
3143
|
+
{{ to.chip | translate }}
|
|
3144
|
+
</div>
|
|
3145
|
+
</div>
|
|
3146
|
+
`, styles: [".chip{background:whitesmoke;border-radius:6px;padding:4px 8px;font-size:12px;color:#888;font-weight:600}\n"] }]
|
|
3147
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
|
|
3148
|
+
|
|
3149
|
+
class ProfileImageTypeComponent extends FieldType {
|
|
3150
|
+
constructor(cd) {
|
|
3151
|
+
super();
|
|
3152
|
+
this.cd = cd;
|
|
3153
|
+
}
|
|
3154
|
+
ngOnChange() { }
|
|
3155
|
+
ngAfterViewInit() {
|
|
3156
|
+
if (this.to.width) {
|
|
3157
|
+
this.width = this.to.width;
|
|
3158
|
+
}
|
|
3159
|
+
if (this.to.padding) {
|
|
3160
|
+
this.padding = this.to.padding;
|
|
3161
|
+
}
|
|
3162
|
+
this.cd.detectChanges();
|
|
3163
|
+
}
|
|
3164
|
+
}
|
|
3165
|
+
ProfileImageTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ProfileImageTypeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3166
|
+
ProfileImageTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ProfileImageTypeComponent, selector: "app-formly-profile-image-type", usesInheritance: true, ngImport: i0, template: `
|
|
3167
|
+
<mat-card
|
|
3168
|
+
|
|
3169
|
+
fxLayout="column"
|
|
3170
|
+
fxLayoutAlign="center center"
|
|
3171
|
+
>
|
|
3172
|
+
<ngx-avatars
|
|
3173
|
+
class="profile-image"
|
|
3174
|
+
[src]="model[key.toString()]"
|
|
3175
|
+
[size]="150"
|
|
3176
|
+
|
|
3177
|
+
></ngx-avatars>
|
|
3178
|
+
</mat-card>
|
|
3179
|
+
`, isInline: true, styles: ["mat-card{border-radius:0;box-shadow:none!important}.profile-image{width:150px;height:150px;border-radius:50%}\n"], dependencies: [{ kind: "component", type: i5$1.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i3.AvatarComponent, selector: "ngx-avatars", inputs: ["round", "size", "textSizeRatio", "bgColor", "fgColor", "borderColor", "style", "cornerRadius", "facebookId", "twitterId", "googleId", "instagramId", "vkontakteId", "skypeId", "gravatarId", "githubId", "src", "name", "value", "referrerpolicy", "placeholder", "initialsSize"], outputs: ["clickOnAvatar"] }] });
|
|
3180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ProfileImageTypeComponent, decorators: [{
|
|
3181
|
+
type: Component,
|
|
3182
|
+
args: [{ selector: 'app-formly-profile-image-type', template: `
|
|
3183
|
+
<mat-card
|
|
3184
|
+
|
|
3185
|
+
fxLayout="column"
|
|
3186
|
+
fxLayoutAlign="center center"
|
|
3187
|
+
>
|
|
3188
|
+
<ngx-avatars
|
|
3189
|
+
class="profile-image"
|
|
3190
|
+
[src]="model[key.toString()]"
|
|
3191
|
+
[size]="150"
|
|
3192
|
+
|
|
3193
|
+
></ngx-avatars>
|
|
3194
|
+
</mat-card>
|
|
3195
|
+
`, styles: ["mat-card{border-radius:0;box-shadow:none!important}.profile-image{width:150px;height:150px;border-radius:50%}\n"] }]
|
|
3196
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
|
|
3197
|
+
|
|
3198
|
+
class AppFormModule {
|
|
3199
|
+
}
|
|
3200
|
+
AppFormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3201
|
+
AppFormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: AppFormModule, declarations: [TitleTypeComponent,
|
|
3202
|
+
AvatarTypeComponent,
|
|
3203
|
+
ProfileImageTypeComponent], imports: [CommonModule,
|
|
3204
|
+
FormsModule,
|
|
3205
|
+
FormlyMatDatepickerModule,
|
|
3206
|
+
FormlySelectModule,
|
|
3207
|
+
MaterialModule,
|
|
3208
|
+
AvatarModule,
|
|
3209
|
+
TranslateModule,
|
|
3210
|
+
FormlyMaterialModule, i7.FormlyModule], exports: [FormlyModule] });
|
|
3211
|
+
AppFormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppFormModule, imports: [CommonModule,
|
|
3212
|
+
FormsModule,
|
|
3213
|
+
FormlyMatDatepickerModule,
|
|
3214
|
+
FormlySelectModule,
|
|
3215
|
+
MaterialModule,
|
|
3216
|
+
AvatarModule,
|
|
3217
|
+
TranslateModule,
|
|
3218
|
+
FormlyMaterialModule,
|
|
3219
|
+
FormlyModule.forRoot({
|
|
3220
|
+
types: [
|
|
3221
|
+
{
|
|
3222
|
+
name: 'title',
|
|
3223
|
+
component: TitleTypeComponent,
|
|
3224
|
+
wrappers: [],
|
|
3225
|
+
},
|
|
3226
|
+
{
|
|
3227
|
+
name: 'profile-image',
|
|
3228
|
+
component: ProfileImageTypeComponent,
|
|
3229
|
+
wrappers: [],
|
|
3230
|
+
},
|
|
3231
|
+
],
|
|
3232
|
+
}), FormlyModule] });
|
|
3233
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppFormModule, decorators: [{
|
|
3234
|
+
type: NgModule,
|
|
3235
|
+
args: [{
|
|
3236
|
+
declarations: [
|
|
3237
|
+
TitleTypeComponent,
|
|
3238
|
+
AvatarTypeComponent,
|
|
3239
|
+
ProfileImageTypeComponent,
|
|
3240
|
+
],
|
|
3241
|
+
imports: [
|
|
3242
|
+
CommonModule,
|
|
3243
|
+
FormsModule,
|
|
3244
|
+
FormlyMatDatepickerModule,
|
|
3245
|
+
FormlySelectModule,
|
|
3246
|
+
MaterialModule,
|
|
3247
|
+
AvatarModule,
|
|
3248
|
+
TranslateModule,
|
|
3249
|
+
FormlyMaterialModule,
|
|
3250
|
+
FormlyModule.forRoot({
|
|
3251
|
+
types: [
|
|
3252
|
+
{
|
|
3253
|
+
name: 'title',
|
|
3254
|
+
component: TitleTypeComponent,
|
|
3255
|
+
wrappers: [],
|
|
2969
3256
|
},
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
fieldGroup: [
|
|
2975
|
-
{
|
|
2976
|
-
className: 'mr-8 w-100-p',
|
|
2977
|
-
key: 'zip',
|
|
2978
|
-
type: 'input',
|
|
2979
|
-
templateOptions: {
|
|
2980
|
-
label: 'form.profile.address.zip',
|
|
2981
|
-
labelProp: (item) => {
|
|
2982
|
-
return `${item.zip} (${item.city})`;
|
|
2983
|
-
},
|
|
2984
|
-
set: (field, option) => {
|
|
2985
|
-
// console.log(option, field);
|
|
2986
|
-
field.formControl.setValue(option.value.zip);
|
|
2987
|
-
// set CITY
|
|
2988
|
-
field.form.get('city').setValue(option.value.city);
|
|
2989
|
-
},
|
|
2990
|
-
filter: (key, field) => {
|
|
2991
|
-
// return this.profileProvider.zipCodes({
|
|
2992
|
-
// countryCode: field.form.get('country').value,
|
|
2993
|
-
// zip: key,
|
|
2994
|
-
// });
|
|
2995
|
-
},
|
|
2996
|
-
},
|
|
2997
|
-
// expressionProperties: {
|
|
2998
|
-
// 'templateOptions.disabled': (model: any) =>
|
|
2999
|
-
// !model.newAddress,
|
|
3000
|
-
// },
|
|
3001
|
-
},
|
|
3002
|
-
{
|
|
3003
|
-
className: 'small ml-8',
|
|
3004
|
-
key: 'city',
|
|
3005
|
-
type: 'input',
|
|
3006
|
-
templateOptions: {
|
|
3007
|
-
label: 'form.profile.address.city',
|
|
3008
|
-
},
|
|
3009
|
-
// expressionProperties: {
|
|
3010
|
-
// 'templateOptions.disabled': (model: any) =>
|
|
3011
|
-
// !model.newAddress,
|
|
3012
|
-
// },
|
|
3013
|
-
},
|
|
3014
|
-
].map((item) => this.translate.forms(item)),
|
|
3015
|
-
},
|
|
3016
|
-
// {
|
|
3017
|
-
// className: 'small',
|
|
3018
|
-
// key: 'state',
|
|
3019
|
-
// type: 'input',
|
|
3020
|
-
// templateOptions: {
|
|
3021
|
-
// label: 'form.profile.address.state',
|
|
3022
|
-
// },
|
|
3023
|
-
// // expressionProperties: {
|
|
3024
|
-
// // 'templateOptions.disabled': (model: any) => !model.newAddress,
|
|
3025
|
-
// // },
|
|
3026
|
-
// },
|
|
3027
|
-
// {
|
|
3028
|
-
// className: 'small',
|
|
3029
|
-
// key: 'countryStateID',
|
|
3030
|
-
// type: 'select',
|
|
3031
|
-
// templateOptions: {
|
|
3032
|
-
// label: 'form.profile.address.regionalStatistics',
|
|
3033
|
-
// options: this.provider.countries(),
|
|
3034
|
-
// },
|
|
3035
|
-
// // expressionProperties: {
|
|
3036
|
-
// // 'templateOptions.disabled': (model: any) => !model.newAddress,
|
|
3037
|
-
// // },
|
|
3038
|
-
// },
|
|
3039
|
-
{
|
|
3040
|
-
className: 'small w-100-p',
|
|
3041
|
-
key: 'street1',
|
|
3042
|
-
type: 'input',
|
|
3043
|
-
templateOptions: {
|
|
3044
|
-
label: 'form.profile.address.street',
|
|
3257
|
+
{
|
|
3258
|
+
name: 'profile-image',
|
|
3259
|
+
component: ProfileImageTypeComponent,
|
|
3260
|
+
wrappers: [],
|
|
3045
3261
|
},
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3262
|
+
],
|
|
3263
|
+
}),
|
|
3264
|
+
],
|
|
3265
|
+
providers: [],
|
|
3266
|
+
exports: [FormlyModule],
|
|
3267
|
+
}]
|
|
3268
|
+
}] });
|
|
3269
|
+
|
|
3270
|
+
class CameraSwitchComponent {
|
|
3271
|
+
constructor(cameraProvider) {
|
|
3272
|
+
this.cameraProvider = cameraProvider;
|
|
3055
3273
|
}
|
|
3274
|
+
ngAfterViewInit() { }
|
|
3275
|
+
ngOnDestroy() { }
|
|
3056
3276
|
}
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type:
|
|
3060
|
-
type:
|
|
3277
|
+
CameraSwitchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CameraSwitchComponent, deps: [{ token: NgxScandocCameraProvider }], target: i0.ɵɵFactoryTarget.Component });
|
|
3278
|
+
CameraSwitchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: CameraSwitchComponent, selector: "ngx-scan-camera-switch", ngImport: i0, template: "<mat-form-field\n style=\"font-size: 14px; width: 200px; margin-top: 8px\"\n class=\"w-100 mr-16 mt-8\"\n>\n <mat-label> Camera </mat-label>\n <mat-select (selectionChange)=\"cameraProvider.selectCamera($event)\" [(ngModel)]=\"cameraProvider.deviceId\">\n <mat-option *ngFor=\"let device of cameraProvider.mediaDevices\" [value]=\"device.deviceId\">\n {{ device.label }}\n </mat-option>\n </mat-select>\n</mat-form-field>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1}\n"], dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "component", type: i5$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i6$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }] });
|
|
3279
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CameraSwitchComponent, decorators: [{
|
|
3280
|
+
type: Component,
|
|
3281
|
+
args: [{ selector: 'ngx-scan-camera-switch', template: "<mat-form-field\n style=\"font-size: 14px; width: 200px; margin-top: 8px\"\n class=\"w-100 mr-16 mt-8\"\n>\n <mat-label> Camera </mat-label>\n <mat-select (selectionChange)=\"cameraProvider.selectCamera($event)\" [(ngModel)]=\"cameraProvider.deviceId\">\n <mat-option *ngFor=\"let device of cameraProvider.mediaDevices\" [value]=\"device.deviceId\">\n {{ device.label }}\n </mat-option>\n </mat-select>\n</mat-form-field>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1}\n"] }]
|
|
3282
|
+
}], ctorParameters: function () { return [{ type: NgxScandocCameraProvider }]; } });
|
|
3283
|
+
|
|
3284
|
+
class CoreComponentsModule {
|
|
3285
|
+
}
|
|
3286
|
+
CoreComponentsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CoreComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3287
|
+
CoreComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CoreComponentsModule, declarations: [ScanComponent, ScanResultsComponent, CameraSwitchComponent], imports: [CommonModule,
|
|
3288
|
+
FormsModule,
|
|
3289
|
+
TranslateModule,
|
|
3290
|
+
WebcamModule,
|
|
3291
|
+
MaterialModule,
|
|
3292
|
+
AppFormModule,
|
|
3293
|
+
ReactiveFormsModule], exports: [WebcamModule, ScanComponent, CameraSwitchComponent] });
|
|
3294
|
+
CoreComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CoreComponentsModule, imports: [CommonModule,
|
|
3295
|
+
FormsModule,
|
|
3296
|
+
TranslateModule,
|
|
3297
|
+
WebcamModule,
|
|
3298
|
+
MaterialModule,
|
|
3299
|
+
AppFormModule,
|
|
3300
|
+
ReactiveFormsModule, WebcamModule] });
|
|
3301
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CoreComponentsModule, decorators: [{
|
|
3302
|
+
type: NgModule,
|
|
3061
3303
|
args: [{
|
|
3062
|
-
|
|
3304
|
+
imports: [
|
|
3305
|
+
CommonModule,
|
|
3306
|
+
FormsModule,
|
|
3307
|
+
TranslateModule,
|
|
3308
|
+
WebcamModule,
|
|
3309
|
+
MaterialModule,
|
|
3310
|
+
AppFormModule,
|
|
3311
|
+
ReactiveFormsModule,
|
|
3312
|
+
],
|
|
3313
|
+
declarations: [ScanComponent, ScanResultsComponent, CameraSwitchComponent],
|
|
3314
|
+
exports: [WebcamModule, ScanComponent, CameraSwitchComponent],
|
|
3315
|
+
providers: [],
|
|
3063
3316
|
}]
|
|
3064
|
-
}]
|
|
3317
|
+
}] });
|
|
3318
|
+
|
|
3319
|
+
class SafeResourceUrlPipe {
|
|
3320
|
+
constructor(sanitizer) {
|
|
3321
|
+
this.sanitizer = sanitizer;
|
|
3322
|
+
}
|
|
3323
|
+
transform(style) {
|
|
3324
|
+
return this.sanitizer.bypassSecurityTrustResourceUrl(style);
|
|
3325
|
+
// return this.sanitizer.bypassSecurityTrustStyle(style);
|
|
3326
|
+
// return this.sanitizer.bypassSecurityTrustXxx(style); - see docs
|
|
3327
|
+
}
|
|
3328
|
+
}
|
|
3329
|
+
SafeResourceUrlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SafeResourceUrlPipe, deps: [{ token: i1$3.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
3330
|
+
SafeResourceUrlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SafeResourceUrlPipe, name: "safeResourceUrl" });
|
|
3331
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SafeResourceUrlPipe, decorators: [{
|
|
3332
|
+
type: Pipe,
|
|
3333
|
+
args: [{ name: 'safeResourceUrl' }]
|
|
3334
|
+
}], ctorParameters: function () { return [{ type: i1$3.DomSanitizer }]; } });
|
|
3335
|
+
|
|
3336
|
+
class CorePipesModule {
|
|
3337
|
+
}
|
|
3338
|
+
CorePipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CorePipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3339
|
+
CorePipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CorePipesModule, declarations: [SafeResourceUrlPipe], exports: [SafeResourceUrlPipe] });
|
|
3340
|
+
CorePipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CorePipesModule });
|
|
3341
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CorePipesModule, decorators: [{
|
|
3342
|
+
type: NgModule,
|
|
3343
|
+
args: [{
|
|
3344
|
+
declarations: [SafeResourceUrlPipe],
|
|
3345
|
+
imports: [],
|
|
3346
|
+
exports: [
|
|
3347
|
+
SafeResourceUrlPipe,
|
|
3348
|
+
],
|
|
3349
|
+
}]
|
|
3350
|
+
}] });
|
|
3351
|
+
|
|
3352
|
+
class BlankComponent {
|
|
3353
|
+
constructor(dialogRef, data, cd) {
|
|
3354
|
+
this.dialogRef = dialogRef;
|
|
3355
|
+
this.data = data;
|
|
3356
|
+
this.cd = cd;
|
|
3357
|
+
this.initSet = false;
|
|
3358
|
+
}
|
|
3359
|
+
setModel(model) {
|
|
3360
|
+
this.data.data.model = model;
|
|
3361
|
+
this.init();
|
|
3362
|
+
}
|
|
3363
|
+
init() {
|
|
3364
|
+
this.initSet = true;
|
|
3365
|
+
this.body?.clear();
|
|
3366
|
+
const componentRef = this.body?.createComponent(this.data.component);
|
|
3367
|
+
componentRef.instance.data = this.data.data;
|
|
3368
|
+
// componentRef.instance.dialogs = this.dialogs;
|
|
3369
|
+
componentRef.instance.dialogRef = this.dialogRef;
|
|
3370
|
+
if (componentRef.instance.init) {
|
|
3371
|
+
componentRef.instance.init();
|
|
3372
|
+
}
|
|
3373
|
+
this.cd.detectChanges();
|
|
3374
|
+
}
|
|
3375
|
+
ngAfterViewInit() {
|
|
3376
|
+
if (!this.initSet) {
|
|
3377
|
+
this.init();
|
|
3378
|
+
}
|
|
3379
|
+
}
|
|
3380
|
+
}
|
|
3381
|
+
BlankComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BlankComponent, deps: [{ token: i1$4.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3382
|
+
BlankComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: BlankComponent, selector: "app-dialog-blank", viewQueries: [{ propertyName: "body", first: true, predicate: ["body"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<ng-template #body></ng-template>\n", styles: [":host{display:flex;flex:1;flex-direction:column;overflow:hidden;height:100%}\n"] });
|
|
3383
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BlankComponent, decorators: [{
|
|
3384
|
+
type: Component,
|
|
3385
|
+
args: [{ selector: 'app-dialog-blank', template: "<ng-template #body></ng-template>\n", styles: [":host{display:flex;flex:1;flex-direction:column;overflow:hidden;height:100%}\n"] }]
|
|
3386
|
+
}], ctorParameters: function () { return [{ type: i1$4.MatDialogRef }, { type: undefined, decorators: [{
|
|
3387
|
+
type: Inject,
|
|
3388
|
+
args: [MAT_DIALOG_DATA]
|
|
3389
|
+
}] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { body: [{
|
|
3390
|
+
type: ViewChild,
|
|
3391
|
+
args: ['body', { read: ViewContainerRef, static: true }]
|
|
3392
|
+
}] } });
|
|
3393
|
+
|
|
3394
|
+
class LoadingComponent {
|
|
3395
|
+
}
|
|
3396
|
+
LoadingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3397
|
+
LoadingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: LoadingComponent, selector: "app-loading", ngImport: i0, template: "<div style=\"width:240px;\">\n\n <div class=\"pb-16\" style=\"font-size: 18px;padding-bottom:16px;\">\n Loading...\n </div>\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: i9.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }] });
|
|
3398
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoadingComponent, decorators: [{
|
|
3399
|
+
type: Component,
|
|
3400
|
+
args: [{ selector: 'app-loading', template: "<div style=\"width:240px;\">\n\n <div class=\"pb-16\" style=\"font-size: 18px;padding-bottom:16px;\">\n Loading...\n </div>\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n</div>\n" }]
|
|
3401
|
+
}] });
|
|
3402
|
+
|
|
3403
|
+
class ConfirmComponent {
|
|
3404
|
+
constructor(dialogRef, data) {
|
|
3405
|
+
this.dialogRef = dialogRef;
|
|
3406
|
+
this.data = data;
|
|
3407
|
+
this.showDetails = false;
|
|
3408
|
+
this.images = {
|
|
3409
|
+
alert: 'page-lost.svg',
|
|
3410
|
+
prompt: 'bedroom.svg',
|
|
3411
|
+
dirty: 'opps.svg',
|
|
3412
|
+
};
|
|
3413
|
+
this.options = {};
|
|
3414
|
+
}
|
|
3415
|
+
onEnterPress(e) {
|
|
3416
|
+
this.action(true);
|
|
3417
|
+
}
|
|
3418
|
+
onEscapePress(e) {
|
|
3419
|
+
this.action(false);
|
|
3420
|
+
}
|
|
3421
|
+
ngOnInit() {
|
|
3422
|
+
console.log(this.data);
|
|
3423
|
+
this.options = this.data.options || {};
|
|
3424
|
+
this.type = this.options.type || this.data.type || 'prompt';
|
|
3425
|
+
}
|
|
3426
|
+
action(key) {
|
|
3427
|
+
this.dialogRef.close(key);
|
|
3428
|
+
}
|
|
3429
|
+
close() { }
|
|
3430
|
+
}
|
|
3431
|
+
ConfirmComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ConfirmComponent, deps: [{ token: i1$4.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
3432
|
+
ConfirmComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ConfirmComponent, selector: "app-confirm", host: { listeners: { "document:keyup.enter": "onEnterPress($event)", "document:keyup.escape": "onEscapePress($event)" } }, ngImport: i0, template: "<header class=\"page-header\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n\n\n <div class=\"title\" ngClass.lt-sm=\"title-small\">\n {{ data.title | translate }}\n\n <!-- {{ data.text.statusText }} {{ data.text.status }} -->\n </div>\n\n <span fxFlex></span>\n\n <!-- <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button> -->\n <!-- <mat-icon class=\"mr-16\" style=\"color:#888;\">info_outline</mat-icon> -->\n</header>\n\n<div fxLayout=\"column\" fxLayoutAlign=\"center center\">\n <!-- <img\n style=\"height: 240px; margin: 34px 0px;display: none;\"\n [src]=\"'/assets/images/illustrations/' + images[type]\"\n /> -->\n <!-- <img style=\"width:60px;\" src=\"/assets/images/illustrations/door-lock.png\"> -->\n\n <div class=\"text\" *ngIf=\"data.text\">\n <span [innerHtml]=\"data.text\"></span>\n </div>\n</div>\n\n<!-- -->\n\n<footer>\n\n <div class=\"actions\" fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button\n *ngIf=\"!data.alert && !options?.hideCancelButton\"\n (click)=\"action(false)\"\n mat-raised-button\n >\n {{ data.cancel || 'core.page.cancel' | translate }}\n </button>\n\n <button\n *ngIf=\"data.no && !options?.hideNoButton\"\n (click)=\"action('no')\"\n\n mat-raised-button\n >\n {{ data.no }}\n </button>\n <button\n *ngIf=\"!data.hideOkButton && !options?.hideOkButton\"\n (click)=\"action(true)\"\n color=\"accent\"\n mat-raised-button\n >\n <ng-container *ngIf=\"!data.alert\">\n {{ data.ok || 'core.page.confirm' | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"data.alert\">\n {{ data.ok || 'core.page.close' | translate }}\n </ng-container>\n </button>\n </div>\n</footer>\n", styles: [":host{display:flex;flex-direction:column;flex:1;height:100%;width:100%}.title{font-size:18px}.text{padding:0 30px;text-align:center;font-size:16px;margin:40px 0}.actions{min-height:60px}.actions button{min-width:120px;margin-right:16px;box-shadow:none;text-transform:uppercase}footer{background-color:#fff}footer button{box-shadow:none!important;border:1px solid rgba(0,0,0,.12);font-size:13px}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4$2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4$2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i4$2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i5$3.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }] });
|
|
3433
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ConfirmComponent, decorators: [{
|
|
3434
|
+
type: Component,
|
|
3435
|
+
args: [{ selector: 'app-confirm', template: "<header class=\"page-header\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n\n\n <div class=\"title\" ngClass.lt-sm=\"title-small\">\n {{ data.title | translate }}\n\n <!-- {{ data.text.statusText }} {{ data.text.status }} -->\n </div>\n\n <span fxFlex></span>\n\n <!-- <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button> -->\n <!-- <mat-icon class=\"mr-16\" style=\"color:#888;\">info_outline</mat-icon> -->\n</header>\n\n<div fxLayout=\"column\" fxLayoutAlign=\"center center\">\n <!-- <img\n style=\"height: 240px; margin: 34px 0px;display: none;\"\n [src]=\"'/assets/images/illustrations/' + images[type]\"\n /> -->\n <!-- <img style=\"width:60px;\" src=\"/assets/images/illustrations/door-lock.png\"> -->\n\n <div class=\"text\" *ngIf=\"data.text\">\n <span [innerHtml]=\"data.text\"></span>\n </div>\n</div>\n\n<!-- -->\n\n<footer>\n\n <div class=\"actions\" fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button\n *ngIf=\"!data.alert && !options?.hideCancelButton\"\n (click)=\"action(false)\"\n mat-raised-button\n >\n {{ data.cancel || 'core.page.cancel' | translate }}\n </button>\n\n <button\n *ngIf=\"data.no && !options?.hideNoButton\"\n (click)=\"action('no')\"\n\n mat-raised-button\n >\n {{ data.no }}\n </button>\n <button\n *ngIf=\"!data.hideOkButton && !options?.hideOkButton\"\n (click)=\"action(true)\"\n color=\"accent\"\n mat-raised-button\n >\n <ng-container *ngIf=\"!data.alert\">\n {{ data.ok || 'core.page.confirm' | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"data.alert\">\n {{ data.ok || 'core.page.close' | translate }}\n </ng-container>\n </button>\n </div>\n</footer>\n", styles: [":host{display:flex;flex-direction:column;flex:1;height:100%;width:100%}.title{font-size:18px}.text{padding:0 30px;text-align:center;font-size:16px;margin:40px 0}.actions{min-height:60px}.actions button{min-width:120px;margin-right:16px;box-shadow:none;text-transform:uppercase}footer{background-color:#fff}footer button{box-shadow:none!important;border:1px solid rgba(0,0,0,.12);font-size:13px}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"] }]
|
|
3436
|
+
}], ctorParameters: function () { return [{ type: i1$4.MatDialogRef }, { type: undefined, decorators: [{
|
|
3437
|
+
type: Inject,
|
|
3438
|
+
args: [MAT_DIALOG_DATA]
|
|
3439
|
+
}] }]; }, propDecorators: { onEnterPress: [{
|
|
3440
|
+
type: HostListener,
|
|
3441
|
+
args: ['document:keyup.enter', ['$event']]
|
|
3442
|
+
}], onEscapePress: [{
|
|
3443
|
+
type: HostListener,
|
|
3444
|
+
args: ['document:keyup.escape', ['$event']]
|
|
3445
|
+
}] } });
|
|
3065
3446
|
|
|
3066
|
-
class
|
|
3067
|
-
constructor(cd, scanProvider, dialogs,
|
|
3068
|
-
|
|
3447
|
+
class ScanSelfieComponent {
|
|
3448
|
+
constructor(cd, scanProvider, dialogs,
|
|
3449
|
+
// private formProvider: ScanFieldsProvider,
|
|
3450
|
+
translate) {
|
|
3069
3451
|
this.cd = cd;
|
|
3070
3452
|
this.scanProvider = scanProvider;
|
|
3071
3453
|
this.dialogs = dialogs;
|
|
3072
|
-
this.formProvider = formProvider;
|
|
3073
|
-
this.zone = zone;
|
|
3074
3454
|
this.translate = translate;
|
|
3075
|
-
this.auth = auth;
|
|
3076
3455
|
this.scanBlastData = [
|
|
3077
3456
|
{
|
|
3078
3457
|
title: 'pms.dialogs.components.scanProfile.front',
|
|
@@ -3094,46 +3473,25 @@ class ScanProfileComponent {
|
|
|
3094
3473
|
height: 1080,
|
|
3095
3474
|
facingMode: 'environment',
|
|
3096
3475
|
};
|
|
3097
|
-
this.startTime = 0;
|
|
3098
|
-
this.isDebug = false;
|
|
3099
3476
|
this.multipleWebcamsAvailable = false;
|
|
3100
|
-
this.scanInProgress = false;
|
|
3101
3477
|
// webcam snapshot trigger
|
|
3102
3478
|
this.documentTypeSelected = false;
|
|
3103
3479
|
this.preview = null;
|
|
3104
|
-
this.errorCode = '1000';
|
|
3105
|
-
this.displayInfo = 'Position document inside rectange and hold steady.';
|
|
3106
3480
|
this.allowCameraSwitch = true;
|
|
3107
|
-
this.verificationErrorSent = false;
|
|
3108
3481
|
this.error = false;
|
|
3109
3482
|
this.cameraReady = false;
|
|
3110
3483
|
this.scaning = false;
|
|
3111
|
-
this.imageHandler = new Subject();
|
|
3112
|
-
this.logData = {
|
|
3113
|
-
AcceptTermsAndConditions: true,
|
|
3114
|
-
Request: null,
|
|
3115
|
-
Response: null,
|
|
3116
|
-
ExpectedOutput: null,
|
|
3117
|
-
};
|
|
3118
3484
|
this.scanDatas = [];
|
|
3119
|
-
this.idScan = null;
|
|
3120
|
-
this.validation = false;
|
|
3121
|
-
this.scannedImages = [];
|
|
3122
|
-
this.scanDelay = 0;
|
|
3123
3485
|
this.trigger = new Subject();
|
|
3124
3486
|
// switch to next / previous / specific webcam; true/false: forward/backwards, string: deviceId
|
|
3125
3487
|
this.nextWebcam = new Subject();
|
|
3126
|
-
this.imageVerified = false;
|
|
3127
3488
|
this.form = new FormGroup({});
|
|
3128
|
-
this.scanImageTimestamps = {
|
|
3129
|
-
time: 0,
|
|
3130
|
-
load: 0,
|
|
3131
|
-
};
|
|
3132
3489
|
}
|
|
3133
3490
|
onResize() {
|
|
3134
3491
|
if (this.wraper) {
|
|
3135
3492
|
this.width = this.wraper.nativeElement.clientWidth;
|
|
3136
3493
|
this.height = this.wraper.nativeElement.clientHeight;
|
|
3494
|
+
console.log(this.width, this.height);
|
|
3137
3495
|
setTimeout(() => {
|
|
3138
3496
|
const video = this.wraper?.nativeElement.querySelector('video');
|
|
3139
3497
|
if (video) {
|
|
@@ -3141,214 +3499,27 @@ class ScanProfileComponent {
|
|
|
3141
3499
|
this.videoWidth = video.clientWidth;
|
|
3142
3500
|
this.videoHeight = video.clientHeight;
|
|
3143
3501
|
}
|
|
3144
|
-
this.cd.detectChanges();
|
|
3145
3502
|
}, 100);
|
|
3146
3503
|
this.cd.detectChanges();
|
|
3147
3504
|
}
|
|
3148
3505
|
}
|
|
3149
|
-
resetLogData() {
|
|
3150
|
-
this.logData = {
|
|
3151
|
-
Request: null,
|
|
3152
|
-
Response: null,
|
|
3153
|
-
ExpectedOutput: null,
|
|
3154
|
-
AcceptTermsAndConditions: true,
|
|
3155
|
-
};
|
|
3156
|
-
}
|
|
3157
|
-
ngOnDestroy() {
|
|
3158
|
-
if (this.scanTimeout) {
|
|
3159
|
-
clearTimeout(this.scanTimeout);
|
|
3160
|
-
}
|
|
3161
|
-
if (this.imageHandlerSubscription) {
|
|
3162
|
-
this.imageHandlerSubscription.unsubscribe();
|
|
3163
|
-
}
|
|
3164
|
-
}
|
|
3165
3506
|
init() {
|
|
3166
|
-
|
|
3167
|
-
this.resetLogData();
|
|
3507
|
+
console.log('HAS MULTI');
|
|
3168
3508
|
// this.result=true;
|
|
3169
3509
|
// this.result ={};
|
|
3170
|
-
this.fields = this.formProvider.document();
|
|
3510
|
+
this.fields = []; //this.formProvider.document();
|
|
3171
3511
|
WebcamUtil.getAvailableVideoInputs().subscribe((mediaDevices) => {
|
|
3172
|
-
console.log('[DEVICES]', mediaDevices
|
|
3512
|
+
console.log('[DEVICES]', mediaDevices);
|
|
3173
3513
|
this.mediaDevices = mediaDevices;
|
|
3174
3514
|
this.multipleWebcamsAvailable = mediaDevices && mediaDevices.length > 1;
|
|
3515
|
+
this.singleScan(this.scanBlastData[0]);
|
|
3175
3516
|
});
|
|
3176
3517
|
}
|
|
3177
|
-
scan() {
|
|
3178
|
-
// this.triggerSnapshot();
|
|
3179
|
-
// this.scanDatas[0] = true;
|
|
3180
|
-
// if (this.scanTimeout) {
|
|
3181
|
-
// clearTimeout(this.scanTimeout);
|
|
3182
|
-
// }
|
|
3183
|
-
// this.scanTimeout = setTimeout(() => {
|
|
3184
|
-
// this.scan();
|
|
3185
|
-
// }, 1);
|
|
3186
|
-
}
|
|
3187
|
-
DataUrlFromImage() { }
|
|
3188
3518
|
handleImage(webcamImage) {
|
|
3189
|
-
|
|
3190
|
-
this.
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
"');background-size: contain; background-repeat: no-repeat;";
|
|
3194
|
-
// console.log('%c ', consoleBackground);
|
|
3195
|
-
const time = new Date().getTime();
|
|
3196
|
-
if (this.scanImageTimestamps.load > 0) {
|
|
3197
|
-
const { load } = this.scanImageTimestamps;
|
|
3198
|
-
const diff = time - load;
|
|
3199
|
-
// console.log('time:', diff);
|
|
3200
|
-
this.scanDelay = diff;
|
|
3201
|
-
}
|
|
3202
|
-
this.scanImageTimestamps.load = time;
|
|
3203
|
-
if (webcamImage.imageData) {
|
|
3204
|
-
this.scannedImages.push(webcamImage);
|
|
3205
|
-
}
|
|
3206
|
-
this.cd.detectChanges();
|
|
3207
|
-
if (this.scannedImages.length > 4 && !this.validation) {
|
|
3208
|
-
console.timeEnd('scan');
|
|
3209
|
-
console.time('scan');
|
|
3210
|
-
// get last 10
|
|
3211
|
-
console.log('CAPTURED:', this.scannedImages.length);
|
|
3212
|
-
const images = this.scannedImages.slice(-5);
|
|
3213
|
-
// set images to 0
|
|
3214
|
-
this.scannedImages = [];
|
|
3215
|
-
const imagesArray = images.map((m) => m.imageResized.split(',')[1]);
|
|
3216
|
-
this.validation = true;
|
|
3217
|
-
this.handleBurstData(imagesArray, images);
|
|
3218
|
-
// this.scanProvider.burst(imagesArray).subscribe((resp: any) => {
|
|
3219
|
-
// // console.clear()
|
|
3220
|
-
// console.log([resp.Info]);
|
|
3221
|
-
// this.validation = false;
|
|
3222
|
-
// this.displayInfo = resp.Info;
|
|
3223
|
-
// if (resp.Validated) {
|
|
3224
|
-
// if (this.scanTimeout) {
|
|
3225
|
-
// clearTimeout(this.scanTimeout);
|
|
3226
|
-
// }
|
|
3227
|
-
// this.webcamImage = images[resp.Index];
|
|
3228
|
-
// // this.preview = this.webcamImage.imageAsDataUrl;
|
|
3229
|
-
// this.cd.detectChanges();
|
|
3230
|
-
// const { DocType, Series, Side } = resp;
|
|
3231
|
-
// // For ID ask for other side
|
|
3232
|
-
// if (DocType === 'ID') {
|
|
3233
|
-
// if (Side === 'FRONT') {
|
|
3234
|
-
// this.scanBlastData[0].image = this.webcamImage;
|
|
3235
|
-
// } else {
|
|
3236
|
-
// this.scanBlastData[1].image = this.webcamImage;
|
|
3237
|
-
// }
|
|
3238
|
-
// if (this.scanBlastData[0].image && this.scanBlastData[1].image) {
|
|
3239
|
-
// console.warn('UPLOAD');
|
|
3240
|
-
// this.scanBlastFinish();
|
|
3241
|
-
// } else {
|
|
3242
|
-
// const num = Side === 'FRONT' ? 1 : 0;
|
|
3243
|
-
// this.singleScan(this.scanBlastData[num]);
|
|
3244
|
-
// this.scan();
|
|
3245
|
-
// this.idScan = this.scanBlastData[num].side;
|
|
3246
|
-
// console.log('ID SIDE', this.idScan);
|
|
3247
|
-
// this.displayInfo = 'Please turn the document over!';
|
|
3248
|
-
// }
|
|
3249
|
-
// } else {
|
|
3250
|
-
// this.scanBlastData[0].image = this.webcamImage;
|
|
3251
|
-
// console.warn('UPLOAD');
|
|
3252
|
-
// this.scanBlastFinish();
|
|
3253
|
-
// }
|
|
3254
|
-
// console.log(DocType, Series, Side);
|
|
3255
|
-
// this.scannedImages = [];
|
|
3256
|
-
// }
|
|
3257
|
-
// });
|
|
3258
|
-
}
|
|
3259
|
-
if (this.cameraReady) {
|
|
3260
|
-
// console.log('delay', this.scanDelay);
|
|
3261
|
-
//console.log('timeD', new Date().getTime());
|
|
3262
|
-
this.trigger.next(new Date().getTime());
|
|
3263
|
-
// if (this.scanDelay < 100) {
|
|
3264
|
-
// const diff = 100 - this.scanDelay;
|
|
3265
|
-
// console.log(diff);
|
|
3266
|
-
// const time2 = new Date().getTime();
|
|
3267
|
-
// // const sub = of(1)
|
|
3268
|
-
// // .pipe(delay(diff))
|
|
3269
|
-
// // .subscribe((resp) => {
|
|
3270
|
-
// // console.log(new Date().getTime()-time);
|
|
3271
|
-
// // this.trigger.next();
|
|
3272
|
-
// // sub.unsubscribe();
|
|
3273
|
-
// // });
|
|
3274
|
-
// const timeout = setTimeout(() => {
|
|
3275
|
-
// console.log('TO', new Date().getTime() - time2);
|
|
3276
|
-
// this.trigger.next();
|
|
3277
|
-
// clearTimeout(timeout);
|
|
3278
|
-
// }, diff);
|
|
3279
|
-
// } else {
|
|
3280
|
-
// this.trigger.next();
|
|
3281
|
-
// }
|
|
3282
|
-
}
|
|
3283
|
-
});
|
|
3284
|
-
// this.scanImageTimestamps = {
|
|
3285
|
-
// time: new Date().getTime(),
|
|
3286
|
-
// load:
|
|
3287
|
-
// };
|
|
3288
|
-
// this.webcamImage = webcamImage;
|
|
3289
|
-
// this.preview = webcamImage.imageAsDataUrl;
|
|
3290
|
-
// this.cd.detectChanges();
|
|
3291
|
-
}
|
|
3292
|
-
handleBurstData(imagesArray, images, type = 'plain') {
|
|
3293
|
-
this.scanProvider.burst(imagesArray).subscribe((resp) => {
|
|
3294
|
-
this.displayInfo = resp.Info;
|
|
3295
|
-
console.timeEnd('validationPOST');
|
|
3296
|
-
console.log('AnalysisTime', resp.AnalysisTime);
|
|
3297
|
-
const { DocType, Series, Side, InfoCode } = resp;
|
|
3298
|
-
// if (InfoCode === '1006' && this.idScan) {
|
|
3299
|
-
// this.handleLongValidationError(image);
|
|
3300
|
-
// }
|
|
3301
|
-
if (resp.Validated) {
|
|
3302
|
-
console.log('[SCANNED INDEX]', resp.Index);
|
|
3303
|
-
const selectedImage = images[resp.Index];
|
|
3304
|
-
// this.preview = this.webcamImage.imageAsDataUrl;
|
|
3305
|
-
this.cd.detectChanges();
|
|
3306
|
-
let image = selectedImage;
|
|
3307
|
-
if (type == 'worker') {
|
|
3308
|
-
const dataUrl = this.handleBitmapImage(selectedImage.bitmap);
|
|
3309
|
-
image = { dataUrl };
|
|
3310
|
-
}
|
|
3311
|
-
if (InfoCode === '1007') {
|
|
3312
|
-
// For ID ask for other side
|
|
3313
|
-
if (Side === 'FRONT') {
|
|
3314
|
-
this.scanBlastData[0].image = image;
|
|
3315
|
-
}
|
|
3316
|
-
else {
|
|
3317
|
-
this.scanBlastData[1].image = image;
|
|
3318
|
-
}
|
|
3319
|
-
if (this.scanBlastData[0].image && this.scanBlastData[1].image) {
|
|
3320
|
-
console.warn('UPLOAD');
|
|
3321
|
-
if (type == 'worker') {
|
|
3322
|
-
this.imageHandler.next({ type: 'stop' });
|
|
3323
|
-
}
|
|
3324
|
-
this.scanBlastFinish();
|
|
3325
|
-
}
|
|
3326
|
-
else {
|
|
3327
|
-
const num = Side === 'FRONT' ? 1 : 0;
|
|
3328
|
-
this.singleScan(this.scanBlastData[num]);
|
|
3329
|
-
this.scan();
|
|
3330
|
-
this.idScan = this.scanBlastData[num].side;
|
|
3331
|
-
console.log('ID SIDE', this.idScan);
|
|
3332
|
-
this.displayInfo = 'Please turn the document over!';
|
|
3333
|
-
this.validation = false;
|
|
3334
|
-
}
|
|
3335
|
-
}
|
|
3336
|
-
else {
|
|
3337
|
-
this.scanBlastData[0].image = image;
|
|
3338
|
-
console.warn('UPLOAD');
|
|
3339
|
-
if (type == 'worker') {
|
|
3340
|
-
this.imageHandler.next({ type: 'stop' });
|
|
3341
|
-
}
|
|
3342
|
-
this.scanBlastFinish();
|
|
3343
|
-
}
|
|
3344
|
-
this.scannedImages = [];
|
|
3345
|
-
// this.scanBlastData[0].image = selectedImage;
|
|
3346
|
-
//this.scanBlastFinish();
|
|
3347
|
-
}
|
|
3348
|
-
else {
|
|
3349
|
-
this.validation = false;
|
|
3350
|
-
}
|
|
3351
|
-
});
|
|
3519
|
+
console.log('[received webcam image]', webcamImage);
|
|
3520
|
+
this.webcamImage = webcamImage;
|
|
3521
|
+
this.preview = webcamImage.imageAsDataUrl;
|
|
3522
|
+
this.cd.detectChanges();
|
|
3352
3523
|
}
|
|
3353
3524
|
handleInitError(error) {
|
|
3354
3525
|
console.log(error);
|
|
@@ -3357,103 +3528,21 @@ class ScanProfileComponent {
|
|
|
3357
3528
|
return this.scanBlastData[0].image ? true : false;
|
|
3358
3529
|
}
|
|
3359
3530
|
cameraWasSwitched(deviceId) {
|
|
3360
|
-
console.log('
|
|
3531
|
+
console.log('active device: ' + deviceId);
|
|
3361
3532
|
this.deviceId = deviceId;
|
|
3362
3533
|
this.cameraReady = true;
|
|
3363
3534
|
this.defaultDevice = deviceId;
|
|
3364
|
-
|
|
3365
|
-
this.onResize();
|
|
3366
|
-
this.scan();
|
|
3367
|
-
}, 300);
|
|
3535
|
+
this.onResize();
|
|
3368
3536
|
}
|
|
3369
3537
|
get nextWebcamObservable() {
|
|
3370
3538
|
return this.nextWebcam.asObservable();
|
|
3371
3539
|
}
|
|
3372
|
-
handleLongValidationError(img) {
|
|
3373
|
-
// save current image after 10sec
|
|
3374
|
-
const diff = (Date.now() - this.startTime) / 1000;
|
|
3375
|
-
if (diff > 15 && !this.verificationErrorSent) {
|
|
3376
|
-
this.verificationErrorSent = true;
|
|
3377
|
-
const dataUrl = this.handleBitmapImage(img.bitmap);
|
|
3378
|
-
console.warn('SENT');
|
|
3379
|
-
this.displayInfo = 'Cant detect document!';
|
|
3380
|
-
this.logData.Request = this.scanProvider
|
|
3381
|
-
.sendLog({
|
|
3382
|
-
AcceptTermsAndConditions: true,
|
|
3383
|
-
ExpectedOutput: {},
|
|
3384
|
-
Request: {
|
|
3385
|
-
verification: dataUrl.split(',')[1],
|
|
3386
|
-
},
|
|
3387
|
-
Response: {
|
|
3388
|
-
TransactionID: v4(),
|
|
3389
|
-
},
|
|
3390
|
-
})
|
|
3391
|
-
.subscribe();
|
|
3392
|
-
}
|
|
3393
|
-
}
|
|
3394
3540
|
ngAfterViewInit() {
|
|
3395
3541
|
this.cd.detectChanges();
|
|
3396
|
-
this.autoScan();
|
|
3397
|
-
this.imageHandlerSubscription = this.imageHandler.subscribe((webcamImage) => {
|
|
3398
|
-
// return;
|
|
3399
|
-
if (this.startTime === 0) {
|
|
3400
|
-
this.startTime = Date.now();
|
|
3401
|
-
}
|
|
3402
|
-
this.zone.runOutsideAngular(() => {
|
|
3403
|
-
if (webcamImage.base64) {
|
|
3404
|
-
const time = new Date().getTime();
|
|
3405
|
-
if (this.scanImageTimestamps.load > 0) {
|
|
3406
|
-
const { load } = this.scanImageTimestamps;
|
|
3407
|
-
const diff = time - load;
|
|
3408
|
-
console.warn('TIME', diff);
|
|
3409
|
-
this.scanDelay = diff;
|
|
3410
|
-
}
|
|
3411
|
-
this.scanImageTimestamps.load = time;
|
|
3412
|
-
this.scannedImages.push(webcamImage);
|
|
3413
|
-
this.handleLongValidationError(webcamImage);
|
|
3414
|
-
}
|
|
3415
|
-
// this.cd.detectChanges();
|
|
3416
|
-
if (this.scannedImages.length > 4 && !this.validation) {
|
|
3417
|
-
// get last 10
|
|
3418
|
-
console.timeEnd('validationTOTAL_UI');
|
|
3419
|
-
console.time('validationTOTAL_UI');
|
|
3420
|
-
const images = this.scannedImages.slice(-5);
|
|
3421
|
-
// set images to 0
|
|
3422
|
-
this.scannedImages = [];
|
|
3423
|
-
console.log(images);
|
|
3424
|
-
const imagesArray = images.map((m) => m.base64.split(',')[1]);
|
|
3425
|
-
this.validation = true;
|
|
3426
|
-
this.handleBurstData(imagesArray, images, 'worker');
|
|
3427
|
-
console.time('validationPOST');
|
|
3428
|
-
}
|
|
3429
|
-
this.cd.detectChanges();
|
|
3430
|
-
});
|
|
3431
|
-
});
|
|
3432
|
-
}
|
|
3433
|
-
handleBitmapImage(bitmap) {
|
|
3434
|
-
const { width, height } = bitmap;
|
|
3435
|
-
const offscreenSmall = document.createElement('canvas');
|
|
3436
|
-
offscreenSmall.width = width;
|
|
3437
|
-
offscreenSmall.height = height;
|
|
3438
|
-
const ctx = offscreenSmall.getContext('bitmaprenderer');
|
|
3439
|
-
if (ctx) {
|
|
3440
|
-
ctx.imageSmoothingEnabled = false;
|
|
3441
|
-
ctx.transferFromImageBitmap(bitmap);
|
|
3442
|
-
bitmap.close();
|
|
3443
|
-
const data = ctx.canvas.toDataURL('image/jpeg');
|
|
3444
|
-
return data;
|
|
3445
|
-
}
|
|
3446
|
-
return null;
|
|
3447
|
-
}
|
|
3448
|
-
autoScan() {
|
|
3449
|
-
const side = this.scanBlastData[0];
|
|
3450
|
-
this.idScan = null;
|
|
3451
|
-
this.singleScan(side);
|
|
3452
3542
|
}
|
|
3453
3543
|
selectCamera(event) {
|
|
3454
|
-
|
|
3544
|
+
console.log(event);
|
|
3455
3545
|
this.nextWebcam.next(event.value);
|
|
3456
|
-
this.scanInProgress = false;
|
|
3457
3546
|
}
|
|
3458
3547
|
close() {
|
|
3459
3548
|
this.dialogRef?.close();
|
|
@@ -3534,7 +3623,7 @@ class ScanProfileComponent {
|
|
|
3534
3623
|
});
|
|
3535
3624
|
}
|
|
3536
3625
|
sendMobile() {
|
|
3537
|
-
this.dialogs.scanMobile({ id: 1 });
|
|
3626
|
+
// this.dialogs.scanMobile({ id: 1 });
|
|
3538
3627
|
}
|
|
3539
3628
|
singleScanRotate(side) {
|
|
3540
3629
|
console.log(side);
|
|
@@ -3574,21 +3663,16 @@ class ScanProfileComponent {
|
|
|
3574
3663
|
});
|
|
3575
3664
|
}
|
|
3576
3665
|
getImgBase64(num) {
|
|
3577
|
-
console.log('GET 64');
|
|
3578
3666
|
return this.scanBlastData[num].image.dataUrl.split(',')[1];
|
|
3579
3667
|
}
|
|
3580
3668
|
scanBlastFinish() {
|
|
3581
|
-
console.time('upload');
|
|
3582
3669
|
if (this.type === 'mobile') {
|
|
3583
3670
|
this.actions.emit({ data: this.scanBlastData });
|
|
3584
3671
|
this.retake();
|
|
3585
3672
|
return;
|
|
3586
3673
|
}
|
|
3587
|
-
|
|
3588
|
-
// const loading = this.dialogs.loading();
|
|
3674
|
+
const loading = this.dialogs.loading();
|
|
3589
3675
|
this.scaning = true;
|
|
3590
|
-
this.cd.detectChanges();
|
|
3591
|
-
console.time('payload');
|
|
3592
3676
|
const payload = {
|
|
3593
3677
|
AcceptTermsAndConditions: true,
|
|
3594
3678
|
DataFields: {
|
|
@@ -3610,73 +3694,39 @@ class ScanProfileComponent {
|
|
|
3610
3694
|
};
|
|
3611
3695
|
if (!this.scanBlastData[1].image) {
|
|
3612
3696
|
payload.Settings.IgnoreBackImage = true;
|
|
3613
|
-
}
|
|
3614
|
-
this.
|
|
3615
|
-
console.timeEnd('payload');
|
|
3616
|
-
this.scanProvider
|
|
3617
|
-
.blastPost(payload)
|
|
3618
|
-
.subscribe((data) => {
|
|
3619
|
-
//console.log(data);
|
|
3697
|
+
}
|
|
3698
|
+
this.scanProvider.blastPost(payload).subscribe((data) => {
|
|
3620
3699
|
const results = data.Data;
|
|
3621
|
-
|
|
3622
|
-
console.time('parse');
|
|
3623
|
-
// data.InfoCode = '1001';
|
|
3624
|
-
this.logData.Response = JSON.parse(JSON.stringify(data));
|
|
3625
|
-
//loading.close();
|
|
3700
|
+
loading.close();
|
|
3626
3701
|
this.documentTypeSelected = true;
|
|
3627
3702
|
this.scaning = false;
|
|
3628
|
-
if (data.
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
this.
|
|
3643
|
-
this.cd.detectChanges();
|
|
3644
|
-
return;
|
|
3645
|
-
}
|
|
3646
|
-
if (results && data.Metadata.length > 0 && data.InfoCode === '1000') {
|
|
3647
|
-
console.log('Extraction time', data.AnalysisTime);
|
|
3648
|
-
this.zone.run(() => {
|
|
3649
|
-
if (data.ImageData?.Documents) {
|
|
3650
|
-
const { Documents } = data.ImageData;
|
|
3651
|
-
this.images = Documents.map((image, i) => {
|
|
3652
|
-
return { data: 'data:image/jpeg;base64,' + Documents[i] };
|
|
3653
|
-
});
|
|
3654
|
-
}
|
|
3655
|
-
this.result = this.scanProvider.parseBlast(results);
|
|
3656
|
-
console.log('RES', this.result);
|
|
3657
|
-
this.cd.detectChanges();
|
|
3658
|
-
this.model = this.result.model;
|
|
3659
|
-
if (data.ImageData?.FaceImage) {
|
|
3660
|
-
this.model._avatar =
|
|
3661
|
-
'data:image/jpeg;base64,' + data.ImageData?.FaceImage;
|
|
3662
|
-
}
|
|
3663
|
-
console.log('MODEL', this.model);
|
|
3664
|
-
this.cd.detectChanges();
|
|
3665
|
-
});
|
|
3703
|
+
if (results && data.Metadata.length > 0) {
|
|
3704
|
+
if (data.ImageData?.Documents) {
|
|
3705
|
+
const { Documents } = data.ImageData;
|
|
3706
|
+
this.images = Documents.map((image, i) => {
|
|
3707
|
+
return { data: 'data:image/jpeg;base64,' + Documents[i] };
|
|
3708
|
+
});
|
|
3709
|
+
}
|
|
3710
|
+
this.result = this.scanProvider.parseBlast(results);
|
|
3711
|
+
console.log('RES', this.result);
|
|
3712
|
+
this.model = this.result.model;
|
|
3713
|
+
if (data.ImageData?.FaceImage) {
|
|
3714
|
+
this.model._avatar =
|
|
3715
|
+
'data:image/jpeg;base64,' + data.ImageData?.FaceImage;
|
|
3716
|
+
}
|
|
3717
|
+
console.log('MODEL', this.model);
|
|
3666
3718
|
}
|
|
3667
3719
|
else {
|
|
3668
3720
|
console.log('ERROR');
|
|
3669
3721
|
// this.scanSide = 0;
|
|
3670
3722
|
this.error = true;
|
|
3671
3723
|
this.preview = true;
|
|
3672
|
-
this.cd.detectChanges();
|
|
3673
3724
|
// this.documentTypeSelected = false;
|
|
3674
3725
|
// this.retry();
|
|
3675
3726
|
}
|
|
3676
3727
|
this.cd.detectChanges();
|
|
3677
|
-
console.timeEnd('parse');
|
|
3678
3728
|
}, (err) => {
|
|
3679
|
-
|
|
3729
|
+
loading.close();
|
|
3680
3730
|
// this.scanSide = 0;
|
|
3681
3731
|
this.error = true;
|
|
3682
3732
|
this.preview = true;
|
|
@@ -3689,19 +3739,32 @@ class ScanProfileComponent {
|
|
|
3689
3739
|
this.cd.detectChanges();
|
|
3690
3740
|
}
|
|
3691
3741
|
continue() {
|
|
3692
|
-
this.
|
|
3693
|
-
|
|
3694
|
-
this.
|
|
3695
|
-
|
|
3696
|
-
this.
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3742
|
+
if (this.scanProvider.enableVerification) {
|
|
3743
|
+
const loading = this.dialogs.loading();
|
|
3744
|
+
console.log(this.data.avatar);
|
|
3745
|
+
this.scanProvider
|
|
3746
|
+
.stateless(this.data.avatar.split(',')[1], this.webcamImage?.imageAsDataUrl.split(',')[1])
|
|
3747
|
+
.subscribe((resp) => {
|
|
3748
|
+
loading.close();
|
|
3749
|
+
if (resp.Data?.Verified) {
|
|
3750
|
+
this.dialogRef?.close(this.webcamImage);
|
|
3751
|
+
}
|
|
3752
|
+
else {
|
|
3753
|
+
this.dialogs.alert('Verification failed!', "We can't verify that your selfie is same as image on document.");
|
|
3754
|
+
}
|
|
3755
|
+
console.log(resp);
|
|
3756
|
+
}, (err) => {
|
|
3757
|
+
loading.close();
|
|
3758
|
+
this.dialogRef?.close(this.webcamImage);
|
|
3759
|
+
});
|
|
3760
|
+
}
|
|
3761
|
+
else {
|
|
3762
|
+
this.dialogRef?.close(this.webcamImage);
|
|
3763
|
+
}
|
|
3764
|
+
// this.dialogRef.close(this.webcamImage)
|
|
3700
3765
|
}
|
|
3701
3766
|
retry() {
|
|
3702
3767
|
this.preview = false;
|
|
3703
|
-
this.validation = false;
|
|
3704
|
-
this.errorCode = '1000';
|
|
3705
3768
|
this.result = false;
|
|
3706
3769
|
if (this.error) {
|
|
3707
3770
|
this.documentTypeSelected = false;
|
|
@@ -3710,79 +3773,38 @@ class ScanProfileComponent {
|
|
|
3710
3773
|
});
|
|
3711
3774
|
}
|
|
3712
3775
|
this.error = false;
|
|
3713
|
-
this.autoScan();
|
|
3714
|
-
this.cd.detectChanges();
|
|
3715
3776
|
}
|
|
3716
3777
|
triggerSnapshot() {
|
|
3717
3778
|
this.trigger.next(0);
|
|
3718
3779
|
}
|
|
3780
|
+
scan() {
|
|
3781
|
+
console.log('SCAN');
|
|
3782
|
+
this.triggerSnapshot();
|
|
3783
|
+
this.scanDatas[0] = true;
|
|
3784
|
+
}
|
|
3719
3785
|
retake() {
|
|
3720
|
-
this.validation = false;
|
|
3721
3786
|
this.preview = false;
|
|
3722
3787
|
this.error = false;
|
|
3723
3788
|
this.result = false;
|
|
3724
3789
|
this.scanSide = 0;
|
|
3725
|
-
this.imageVerified = false;
|
|
3726
3790
|
this.scanDatas = [];
|
|
3727
3791
|
this.scaning = false;
|
|
3728
3792
|
this.images = [];
|
|
3729
|
-
this.scanInProgress = false;
|
|
3730
3793
|
this.documentTypeSelected = false;
|
|
3731
3794
|
this.scanBlastData.forEach((m) => {
|
|
3732
3795
|
m.image = null;
|
|
3733
3796
|
});
|
|
3734
|
-
this.autoScan();
|
|
3735
3797
|
this.cd.detectChanges();
|
|
3736
3798
|
}
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
}
|
|
3740
|
-
use() {
|
|
3741
|
-
// save images??
|
|
3742
|
-
if (this.scanProvider.canStoreImages) {
|
|
3743
|
-
this.logData.ExpectedOutput = JSON.parse(JSON.stringify(this.model));
|
|
3744
|
-
if (this.logData.ExpectedOutput?._avatar) {
|
|
3745
|
-
delete this.logData.ExpectedOutput._avatar;
|
|
3746
|
-
}
|
|
3747
|
-
this.scanProvider.sendLog(this.logData).subscribe();
|
|
3748
|
-
console.log(this.logData);
|
|
3749
|
-
}
|
|
3750
|
-
this.dialogRef?.close({
|
|
3751
|
-
model: this.model,
|
|
3752
|
-
images: this.images,
|
|
3753
|
-
});
|
|
3754
|
-
}
|
|
3755
|
-
selfie() {
|
|
3756
|
-
this.dialogs
|
|
3757
|
-
.scanSelfie({ avatar: this.model._avatar })
|
|
3758
|
-
.afterClosed()
|
|
3759
|
-
.subscribe((resp) => {
|
|
3760
|
-
if (resp) {
|
|
3761
|
-
console.log(resp);
|
|
3762
|
-
if (this.scanProvider.enableVerification) {
|
|
3763
|
-
this.imageVerified = true;
|
|
3764
|
-
}
|
|
3765
|
-
this.model._avatar = resp.imageAsDataUrl;
|
|
3766
|
-
this.cd.detectChanges();
|
|
3767
|
-
}
|
|
3768
|
-
});
|
|
3769
|
-
}
|
|
3770
|
-
videoReady(event) {
|
|
3771
|
-
this.cameraReady = event;
|
|
3772
|
-
if (this.cameraReady && !this.scanInProgress) {
|
|
3773
|
-
this.scanInProgress = true;
|
|
3774
|
-
setTimeout(() => {
|
|
3775
|
-
this.trigger.next(new Date().getTime());
|
|
3776
|
-
}, 1000);
|
|
3777
|
-
}
|
|
3778
|
-
}
|
|
3799
|
+
use() { }
|
|
3800
|
+
selfie() { }
|
|
3779
3801
|
}
|
|
3780
|
-
|
|
3781
|
-
ScanProfileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScanProfileComponent, selector: "app-scan-profile", inputs: { type: "type" }, outputs: { actions: "actions" }, host: { listeners: { "window:resize": "onResize($event)" } }, viewQueries: [{ propertyName: "wraper", first: true, predicate: ["wraper"], descendants: true }], ngImport: i0, template: "<!-- <div *ngIf=\"isDebug\" class=\"debug\">\n <ng-container *ngFor=\"let img of scannedImages; let index = index\">\n <div style=\"display: flex; flex-direction: column\">\n <img [src]=\"img.imageResized\" />\n {{ index }}\n </div>\n </ng-container>\n</div> -->\n\n<header class=\"page-header\">\n <div class=\"title\" ngClass.lt-sm=\"title-small\">Scan</div>\n\n <span fxFlex></span>\n\n <!-- <mat-slide-toggle style=\"margin:0px 20px\" [(ngModel)]=\"isDebug\"\n >Debug</mat-slide-toggle\n > -->\n\n <ng-container\n *ngIf=\"\n documentTypeSelected &&\n !result &&\n !error &&\n multipleWebcamsAvailable &&\n !preview\n \"\n >\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <mat-form-field\n style=\"font-size: 14px; width: 200px; margin-top: 8px\"\n class=\"w-100 mr-16 mt-8\"\n >\n <mat-label> Camera </mat-label>\n <mat-select\n (selectionChange)=\"selectCamera($event)\"\n [(ngModel)]=\"deviceId\"\n >\n <mat-option\n *ngFor=\"let device of mediaDevices\"\n [value]=\"device.deviceId\"\n >\n {{ device.label }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"type === 'desktop'\">\n <!-- <div class=\"separator\"></div>\n <button mat-button (click)=\"sendMobile()\">\n <mat-icon>tablet_mac</mat-icon>\n </button> -->\n\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container>\n</header>\n\n<div *ngIf=\"result\" fxFlex fxLayout=\"column\">\n <!-- <div *ngIf=\"result\" fxFlex fxLayout=\"column\"> -->\n <div\n fxFlex\n #wraper\n class=\"wraper\"\n fxLayout=\"row\"\n style=\"overflow: auto\"\n protelPerfectScrollbar\n class=\"pt-8 pr-8\"\n fxLayout.lt-md=\"column\"\n >\n <div fxFlex class=\"\">\n <div fxFlex>\n <mat-card style=\"margin: 4px; padding: 4px 16px\">\n <h3>Avatar</h3>\n <div\n style=\"display: flex; flex-direction: row; align-items: center\"\n class=\"selfieContainer\"\n >\n <div class=\"selfie\" style=\"width: 200px\">\n <img\n *ngIf=\"model?._avatar\"\n class=\"preview\"\n style=\"width: 120px; height: 120px; border-radius: 60px\"\n [src]=\"model._avatar\"\n />\n </div>\n <button\n [disabled]=\"imageVerified\"\n (click)=\"selfie()\"\n mat-raised-button\n >\n Take selfie\n </button>\n </div>\n </mat-card>\n\n <form\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n class=\"px-16 py-0 w-100-p\"\n [formGroup]=\"form\"\n >\n <formly-form\n ngClass.lt-md=\"mobile\"\n fxFlex\n [form]=\"form\"\n [fields]=\"fields\"\n [model]=\"model\"\n >\n </formly-form>\n </form>\n </div>\n </div>\n <div fxFlex class=\"pr-16 m-4\">\n <mat-card style=\"margin: 4px; padding-top: 2px\" class=\"images\">\n <h3>Images</h3>\n <ng-container *ngFor=\"let img of images\">\n <div fxLayout=\"column\">\n <ng-container *ngIf=\"img.side === 0\">\n <div class=\"title\">Front Side</div>\n </ng-container>\n <ng-container *ngIf=\"img.side === 1\">\n <div class=\"title\">Back Side</div>\n </ng-container>\n <img\n class=\"preview\"\n style=\"max-width: 460px; border-radius: 1rem\"\n [src]=\"img.data\"\n />\n </div>\n </ng-container>\n </mat-card>\n </div>\n </div>\n\n <div></div>\n\n <footer fxLayout=\"row\" class=\"p-8\">\n <div class=\"w-100-p\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <button fxFlex class=\"mr-8\" mat-raised-button (click)=\"retake()\">\n {{ \"pms.dialogs.components.scanProfile.reTake\" | translate }}\n </button>\n <button\n [disabled]=\"error || form.invalid\"\n fxFlex\n class=\"ml-8\"\n mat-raised-button\n (click)=\"use()\"\n >\n {{ \"pms.dialogs.components.scanProfile.useData\" | translate }}\n </button>\n </div>\n </footer>\n</div>\n\n<div\n style=\"position: relative\"\n *ngIf=\"!result && documentTypeSelected\"\n fxFlex\n fxLayout=\"column\"\n>\n <div fxFlex #wraper class=\"wraper\" fxLayout=\"row\">\n <div\n style=\"\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n z-index: 20;\n background-color: whitesmoke;\n \"\n *ngIf=\"!cameraReady && !preview\"\n >\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n\n <div *ngIf=\"!preview\" style=\"position: absolute; left: 0px\">\n DELAY:{{ scanDelay }}\n </div>\n\n <div\n *ngIf=\"scaning\"\n style=\"\n position: absolute;\n z-index: 200;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n \"\n fxlayout=\"row\"\n fxLayoutAlign=\"center center\"\n >\n <!-- <mat-progress-spinner\n mode=\"indeterminate\"\n color=\"accent\"\n [strokeWidth]=\"10\"\n ></mat-progress-spinner> -->\n </div>\n\n <ng-container *ngIf=\"!error\">\n <!-- <div\n class=\"rectangle\"\n [ngStyle]=\"{\n 'width.px': videoHeight * 0.75 * 1.588,\n 'height.px': videoHeight * 0.75\n }\"\n ></div>\n <svg\n *ngIf=\"videoWidth\"\n style=\"position: absolute; left: 0px; top: 0px\"\n width=\"0\"\n height=\"0\"\n >\n <defs>\n <clipPath id=\"myClip\">\n <rect\n stroke-width=\"6\"\n stroke-color=\"red\"\n [attr.x]=\"(videoWidth - videoHeight * 0.75 * 1.588) / 2\"\n [attr.y]=\"(videoHeight * 0.25) / 2\"\n [attr.width]=\"videoHeight * 0.75 * 1.588\"\n [attr.height]=\"videoHeight * 0.75\"\n rx=\"25\"\n />\n </clipPath>\n </defs>\n </svg> -->\n\n <app-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main\"\n [imageQuality]=\"1\"\n #webcam\n fxFlex\n type=\"document\"\n [trigger]=\"trigger\"\n [imageHandler]=\"imageHandler\"\n (imageCapture)=\"handleImage($event)\"\n [allowCameraSwitch]=\"allowCameraSwitch\"\n [videoOptions]=\"videoOptions\"\n [switchCamera]=\"nextWebcamObservable\"\n (cameraSwitched)=\"cameraWasSwitched($event)\"\n (initError)=\"handleInitError($event)\"\n [width]=\"width\"\n [height]=\"height\"\n (destroyed)=\"cameraOff($event)\"\n (videoReady)=\"videoReady($event)\"\n >\n </app-webcam>\n </ng-container>\n <div\n fxLayout=\"row\"\n fxFlex\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"z-index: 20; position: absolute; width: 100%; height: 100%\"\n >\n <div class=\"p-16 error\" *ngIf=\"error\">\n <div style=\"max-width: \">\n <div class=\"title\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <mat-icon>error_outline</mat-icon\n ><span class=\"ml-8\">{{\n \"pms.dialogs.components.scanProfile.unableToDetectId\" | translate\n }}</span>\n </div>\n\n <ng-container *ngIf=\"errorCode === '1001'\">\n <div>\n Could not classify the given object as a supported document.\n </div>\n </ng-container>\n <ng-container *ngIf=\"errorCode === '1002'\">\n <div>\n Something is wrong with extraction data. Please try again.\n </div>\n </ng-container>\n\n <ul *ngIf=\"errorCode === '1000'\">\n <li>\n {{\n \"pms.dialogs.components.scanProfile.placeIdCloseToDevice\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.ensureSufficientLight\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.holdDocumentSteady\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.makeSureAllEdgesOfTheIdAreVisible\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.makeSureThereAreNoGlareAndShadowsOnTheId\"\n | translate\n }}\n </li>\n </ul>\n </div>\n </div>\n\n <div\n class=\"scanPreview\"\n fxFlex\n fxLayout=\"column\"\n *ngIf=\"!error && !scaning\"\n >\n <!-- <div class=\"py-16\" style=\"font-size: 16px\">\n {{\n \"pms.dialogs.components.scanProfile.ensureAllTextsAreVisible\"\n | translate\n }}\n </div> -->\n <div\n fxFlex\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer fxLayout=\"row\" style=\"height: 80px\" class=\"p-8\">\n <div class=\"displayInfo\" ngClass.lt-sm=\"mobile\" *ngIf=\"!preview && cameraReady\">\n {{ displayInfo }}\n </div>\n <div style=\"height: 26px\">\n <div\n style=\"text-align: center; font-size: 18px\"\n *ngIf=\"idScan && !preview && cameraReady\"\n >\n <ng-container *ngIf=\"idScan === 'BACK'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureBack\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"idScan === 'FRONT'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureFront\" | translate }}\n </ng-container>\n </div>\n </div>\n\n <!-- <button\n [disabled]=\"!cameraReady\"\n class=\"w-100-p\"\n *ngIf=\"!preview\"\n mat-raised-button\n (click)=\"scan()\"\n >\n <ng-container>\n <ng-container *ngIf=\"scanType === 'FRONT'\">{{\n \"pms.dialogs.components.scanProfile.captureFront\" | translate\n }}</ng-container>\n <ng-container *ngIf=\"scanType === 'BACK'\">{{\n \"pms.dialogs.components.scanProfile.captureBack\" | translate\n }}</ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"scanSide === 1\">{{\n \"pms.dialogs.components.scanProfile.captureBackOfId\" | translate\n }}</ng-container>\n </button> -->\n\n <div\n class=\"w-100-p\"\n *ngIf=\"preview\"\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n fxFlex\n >\n <button fxFlex class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n {{ \"pms.dialogs.components.scanProfile.retry\" | translate }}\n </button>\n\n <button\n [disabled]=\"error\"\n fxFlex\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n {{\n \"pms.dialogs.components.scanProfile.continueWithSelectedImage\"\n | translate\n }}\n </button>\n </div>\n </footer>\n</div>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5}.page-header{display:flex;flex-direction:row;align-items:center}.page-header button{height:100%}.debug{position:absolute;left:0;width:100%;height:80px;top:0;border-bottom:1px solid #ccc;background-color:#f8f8f8;display:flex;overflow:hidden;color:#000}.debug img{height:50px;border:1px solid #000}.displayInfo{text-align:center;height:20px;flex:1;position:absolute;width:100%;background-color:#000;height:30px;bottom:55px;left:0;line-height:30px;color:#fff;z-index:200}.displayInfo.mobile{font-size:12px}.element{margin-bottom:8px}.element label{font-size:14px}.element div{font-size:18px}.wraper{position:relative;overflow:hidden}.preview{width:100%;border-radius:1%}.documentTypeWraper{width:400px}.documentTypeWraper .label{font-size:14px;margin-bottom:20px}.documentTypeWraper button{box-shadow:none}.overPane{position:absolute;width:100%;height:100%;top:0;left:0}.overPane app-webcam{clip-path:url(#myClip)}.subhead{height:55px;padding-top:8px}.rectangle{z-index:2;position:absolute;top:50%;left:50%;width:85.6mm;height:53.98mm;transform:translate(-50%,-50%);box-sizing:border-box;border:2px dashed #459be5;border-radius:3mm}.mask{z-index:1;position:absolute;width:100%;height:100%;background-position:center center;background-size:380mm;background-repeat:no-repeat}.label{font-size:11px;margin-top:4px}footer button{box-shadow:none!important;height:45px;min-height:45px;text-transform:uppercase}h4{font-size:16px}.images .title{padding:8px 0;font-weight:600}.images img{margin-bottom:16px}.error{display:flex;align-items:center;justify-content:center;flex:1}.error .title{font-size:20px;margin-bottom:8px}.error .title mat-icon{margin-right:8px}.error ul{font-size:18px;list-style-type:none}.photo{width:120px;height:120px;overflow:hidden}.signature{width:200px}mat-card{box-shadow:none!important}.scanBlastWraper button{text-transform:uppercase}.scanBlastWraper.mobile mat-card{margin:4px!important}.scanBlastWraper.mobile .description{flex-direction:row!important}.scanBlastWraper.mobile .description .imgWrap{padding:0!important}.scanBlastWraper.mobile .description .btnActions{position:absolute;right:0}.scanBlastWraper.mobile .description button{margin:0!important;position:absolute;right:16px}.scanBlastWraper.mobile .description button.rotateButton{top:58px}.scanBlastWraper.mobile .description button.remButton{top:8px}.scanBlastWraper.mobile .description button mat-icon{margin:0!important}.scanBlastWraper.mobile .description button div.label{display:none}.scanBlast{display:flex;flex-direction:row;flex:1;padding:0 4px}.scanBlast mat-card{padding:0;box-shadow:none;margin:8px 4px;flex:1}.scanBlast mat-card .head{display:flex;flex-direction:row;align-items:center;justify-items:center;border-bottom:1px solid rgba(0,0,0,.12);height:60px;padding:8px}.scanBlast mat-card .head.small{height:30px!important;padding:4px 8px!important}.scanBlast mat-card .head.small .title{font-size:12px!important;margin-left:4px!important}.scanBlast mat-card .head button{max-width:120px;height:40px;box-shadow:none;border:1px solid rgba(0,0,0,.12)}.scanBlast mat-card .head .title{margin-left:16px;color:#459ae5;font-size:16px}.scanBlast mat-card .content{margin:8px;flex:1}.scanBlast mat-card .description{text-align:center;color:#888}.scanBlast mat-card .actions{background-color:#e9e9e9;display:flex;flex-direction:row}.scanBlast mat-card .actions .mat-button-disabled{background-color:#fff!important}.scanBlast mat-card .actions button{box-shadow:none;width:50%;margin:8px;height:40px;font-size:12px}.scanBlast mat-card .actions button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder{flex:1;border-radius:6px;display:flex;flex-direction:column}.scanBlast mat-card .previewPlaceholder .description{display:flex;flex:1;flex-direction:column;justify-content:center}.scanBlast mat-card .previewPlaceholder button{box-shadow:none;margin-top:8px;height:40px;font-size:12px}.scanBlast mat-card .previewPlaceholder button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder .imgWrap{flex-direction:column;flex:1;padding:8px;background-color:#f5f5f5;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap img{width:100%;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap .image{background-position:center;background-repeat:no-repeat;background-size:contain}.mr-4{margin-right:4px}.ml-4{margin-left:4px}.p-16{padding:16px}.p-8{padding:8px}.py-16{padding:16px 0}.w-100-p{width:100%}.scanPreview{padding:16px}.scanPreview .image{background-position:center;background-repeat:no-repeat;background-size:contain}.empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"], dependencies: [{ kind: "directive", type: i6.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i6.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i8$1.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }, { kind: "component", type: i6$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6$1.MatLabel, selector: "mat-label" }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i8.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i12.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i9.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i1$4.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: WebcamComponent, selector: "app-webcam", inputs: ["imageHandler", "id", "type", "width", "height", "videoOptions", "allowCameraSwitch", "mirrorImage", "captureImageData", "imageType", "imageQuality", "trigger", "switchCamera"], outputs: ["imageCapture", "initError", "imageClick", "cameraSwitched", "videoReady", "destroyed"] }, { kind: "directive", type: i4.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i4.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i5$1.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3782
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type:
|
|
3802
|
+
ScanSelfieComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanSelfieComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: ScanProvider }, { token: DialogsCoreProvider }, { token: i1$2.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3803
|
+
ScanSelfieComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScanSelfieComponent, selector: "app-scan-selfie", inputs: { type: "type" }, outputs: { actions: "actions" }, host: { listeners: { "window:resize": "onResize($event)" } }, viewQueries: [{ propertyName: "wraper", first: true, predicate: ["wraper"], descendants: true }], ngImport: i0, template: "<header class=\"page-header\" fxLayout=\"row\">\n <div class=\"title\" ngClass.lt-sm=\"title-small\">Selfie</div>\n\n <span fxFlex></span>\n <ng-container\n *ngIf=\"\n documentTypeSelected &&\n !result &&\n !error &&\n multipleWebcamsAvailable &&\n !preview\n \"\n >\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <mat-form-field\n style=\"font-size: 14px; width: 200px; margin-top: 8px\"\n class=\"w-200 mr-16 mt-8\"\n >\n <mat-label> Camera </mat-label>\n <mat-select\n (selectionChange)=\"selectCamera($event)\"\n [(ngModel)]=\"deviceId\"\n >\n <mat-option\n *ngFor=\"let device of mediaDevices\"\n [value]=\"device.deviceId\"\n >\n {{ device.label }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <ng-container>\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container>\n <!-- <ng-container *ngIf=\"type === 'desktop'\">\n <div class=\"separator\"></div>\n <button mat-button (click)=\"sendMobile()\">\n <mat-icon>tablet_mac</mat-icon>\n </button>\n\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container> -->\n</header>\n\n<div *ngIf=\"!result\" fxFlex fxLayout=\"column\">\n <div fxFlex #wraper class=\"wraper\" fxLayout=\"row\">\n <div\n style=\"\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n z-index: 20;\n background-color: whitesmoke;\n \"\n *ngIf=\"!cameraReady && !preview\"\n >\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n\n <ng-container *ngIf=\"!error\">\n <!-- <div\n class=\"rectangle\"\n [ngStyle]=\"{\n 'width.px': videoHeight * 0.75 * 1.588,\n 'height.px': videoHeight * 0.75\n }\"\n ></div>\n <svg\n *ngIf=\"videoWidth\"\n style=\"position: absolute; left: 0px; top: 0px\"\n width=\"0\"\n height=\"0\"\n >\n <defs>\n <clipPath id=\"myClip\">\n <rect\n stroke-width=\"6\"\n stroke-color=\"red\"\n [attr.x]=\"(videoWidth - videoHeight * 0.75 * 1.588) / 2\"\n [attr.y]=\"(videoHeight * 0.25) / 2\"\n [attr.width]=\"videoHeight * 0.75 * 1.588\"\n [attr.height]=\"videoHeight * 0.75\"\n rx=\"25\"\n />\n </clipPath>\n </defs>\n </svg> -->\n\n <app-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main\"\n [imageQuality]=\"1\"\n #webcam\n fxFlex\n [trigger]=\"trigger\"\n (imageCapture)=\"handleImage($event)\"\n [allowCameraSwitch]=\"allowCameraSwitch\"\n [videoOptions]=\"videoOptions\"\n [switchCamera]=\"nextWebcamObservable\"\n (cameraSwitched)=\"cameraWasSwitched($event)\"\n (initError)=\"handleInitError($event)\"\n type=\"selfie\"\n [width]=\"width\"\n [height]=\"height\"\n (destroyed)=\"cameraOff($event)\"\n >\n </app-webcam>\n </ng-container>\n <div\n fxLayout=\"row\"\n fxFlex\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"z-index: 20; position: absolute; width: 100%; height: 100%\"\n >\n <div\n class=\"scanPreview\"\n fxFlex\n fxLayout=\"column\"\n *ngIf=\"!error && !scaning\"\n >\n <div\n fxFlex\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer fxLayout=\"row\" class=\"p-8\">\n <button\n [disabled]=\"!cameraReady\"\n class=\"w-100-p\"\n *ngIf=\"!preview\"\n mat-raised-button\n (click)=\"scan()\"\n >\n <ng-container>\n TAKE SELFIE\n </ng-container>\n </button>\n\n <div\n class=\"w-100-p\"\n *ngIf=\"preview\"\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n fxFlex\n >\n <button fxFlex class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n RETRY\n </button>\n\n <button\n [disabled]=\"error\"\n fxFlex\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n CONTINUE\n\n </button>\n </div>\n </footer>\n</div>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5}.element{margin-bottom:8px}.element label{font-size:14px}.element div{font-size:18px}.wraper{position:relative;overflow:hidden}h3{color:#459ae5;font-size:16px}.preview{width:100%;border-radius:1%}.documentTypeWraper{width:400px}.documentTypeWraper .label{font-size:14px;margin-bottom:20px}.documentTypeWraper button{box-shadow:none}.overPane{position:absolute;width:100%;height:100%;top:0;left:0}.overPane app-webcam{clip-path:url(#myClip)}.subhead{height:55px;padding-top:8px}.rectangle{z-index:2;position:absolute;top:50%;left:50%;width:85.6mm;height:53.98mm;transform:translate(-50%,-50%);box-sizing:border-box;border:2px dashed #459be5;border-radius:3mm}.mask{z-index:1;position:absolute;width:100%;height:100%;background-position:center center;background-size:380mm;background-repeat:no-repeat}.label{font-size:11px;margin-top:4px}footer button{box-shadow:none!important;height:45px;min-height:45px;border:1px solid rgba(0,0,0,.12);text-transform:uppercase}h4{font-size:16px}.images label{font-size:11px;color:#888;line-height:20px}.images .title{padding:8px 0;font-weight:600}.images img{margin-bottom:16px}.error .title{font-size:22px}.error ul{font-size:18px}.photo{width:120px;height:120px;overflow:hidden}.signature{width:200px}mat-card{box-shadow:none!important}.scanBlastWraper button{text-transform:uppercase}.scanBlastWraper.mobile mat-card{margin:4px!important}.scanBlastWraper.mobile .description{font-size:12px;flex-direction:row!important}.scanBlastWraper.mobile .description .imgWrap{padding:0!important}.scanBlastWraper.mobile .description .btnActions{position:absolute;right:0}.scanBlastWraper.mobile .description button{font-size:11px!important;margin:0!important;position:absolute;right:16px}.scanBlastWraper.mobile .description button.rotateButton{top:58px}.scanBlastWraper.mobile .description button.remButton{top:8px}.scanBlastWraper.mobile .description button mat-icon{margin:0!important}.scanBlastWraper.mobile .description button div.label{display:none}.mobile .scanBlast button{font-size:11px!important}.scanBlast{display:flex;flex-direction:row;flex:1;padding:0 4px}.scanBlast mat-card{padding:0;box-shadow:none;margin:8px 4px;flex:1}.scanBlast mat-card .head{display:flex;flex-direction:row;align-items:center;justify-items:center;border-bottom:1px solid rgba(0,0,0,.12);height:60px;padding:8px}.scanBlast mat-card .head.small{height:30px!important;padding:4px 8px!important}.scanBlast mat-card .head.small .title{font-size:12px!important;margin-left:4px!important}.scanBlast mat-card .head button{max-width:120px;height:40px;box-shadow:none;border:1px solid rgba(0,0,0,.12)}.scanBlast mat-card .head .title{margin-left:16px;color:#459ae5;font-size:16px}.scanBlast mat-card .content{margin:8px;flex:1}.scanBlast mat-card .description{text-align:center;color:#888;font-size:14px}.scanBlast mat-card .actions{background-color:#e9e9e9;display:flex;flex-direction:row}.scanBlast mat-card .actions .mat-button-disabled{background-color:#fff!important}.scanBlast mat-card .actions button{box-shadow:none;width:50%;margin:8px;height:40px;font-size:12px}.scanBlast mat-card .actions button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder{flex:1;border-radius:6px;display:flex;flex-direction:column}.scanBlast mat-card .previewPlaceholder .description{display:flex;flex:1;flex-direction:column;justify-content:center}.scanBlast mat-card .previewPlaceholder button{box-shadow:none;margin-top:8px;height:40px;font-size:12px}.scanBlast mat-card .previewPlaceholder button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder .imgWrap{flex-direction:column;flex:1;padding:8px;background-color:#f5f5f5;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap img{width:100%;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap .image{background-position:center;background-repeat:no-repeat;background-size:contain}.mr-4{margin-right:4px}.ml-4{margin-left:4px}.p-16{padding:16px}.p-8{padding:8px}.py-16{padding:16px 0}.w-100-p{width:100%}.scanPreview{padding:16px}.scanPreview .image{background-position:center;background-repeat:no-repeat;background-size:contain}.empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center}.summary label{font-size:12px;color:#888;margin-top:2px}.summary .name{font-size:14px}.selfieContainer{display:flex;flex-direction:column;margin-bottom:20px}.selfieContainer button{box-shadow:none;border:1px solid rgba(0,0,0,.12)}.selfieContainer .selfie{margin:8px auto;width:120px;height:120px;border-radius:60px;border:1px solid rgba(0,0,0,.12)}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"], dependencies: [{ kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "component", type: i5$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i6$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i9.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: WebcamComponent, selector: "app-webcam", inputs: ["imageHandler", "id", "type", "width", "height", "videoOptions", "allowCameraSwitch", "mirrorImage", "captureImageData", "imageType", "imageQuality", "trigger", "switchCamera"], outputs: ["imageCapture", "initError", "imageClick", "cameraSwitched", "videoReady", "destroyed"] }, { kind: "directive", type: i4$2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4$2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i4$2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i5$3.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3804
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanSelfieComponent, decorators: [{
|
|
3783
3805
|
type: Component,
|
|
3784
|
-
args: [{ selector: 'app-scan-profile', changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- <div *ngIf=\"isDebug\" class=\"debug\">\n <ng-container *ngFor=\"let img of scannedImages; let index = index\">\n <div style=\"display: flex; flex-direction: column\">\n <img [src]=\"img.imageResized\" />\n {{ index }}\n </div>\n </ng-container>\n</div> -->\n\n<header class=\"page-header\">\n <div class=\"title\" ngClass.lt-sm=\"title-small\">Scan</div>\n\n <span fxFlex></span>\n\n <!-- <mat-slide-toggle style=\"margin:0px 20px\" [(ngModel)]=\"isDebug\"\n >Debug</mat-slide-toggle\n > -->\n\n <ng-container\n *ngIf=\"\n documentTypeSelected &&\n !result &&\n !error &&\n multipleWebcamsAvailable &&\n !preview\n \"\n >\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <mat-form-field\n style=\"font-size: 14px; width: 200px; margin-top: 8px\"\n class=\"w-100 mr-16 mt-8\"\n >\n <mat-label> Camera </mat-label>\n <mat-select\n (selectionChange)=\"selectCamera($event)\"\n [(ngModel)]=\"deviceId\"\n >\n <mat-option\n *ngFor=\"let device of mediaDevices\"\n [value]=\"device.deviceId\"\n >\n {{ device.label }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"type === 'desktop'\">\n <!-- <div class=\"separator\"></div>\n <button mat-button (click)=\"sendMobile()\">\n <mat-icon>tablet_mac</mat-icon>\n </button> -->\n\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container>\n</header>\n\n<div *ngIf=\"result\" fxFlex fxLayout=\"column\">\n <!-- <div *ngIf=\"result\" fxFlex fxLayout=\"column\"> -->\n <div\n fxFlex\n #wraper\n class=\"wraper\"\n fxLayout=\"row\"\n style=\"overflow: auto\"\n protelPerfectScrollbar\n class=\"pt-8 pr-8\"\n fxLayout.lt-md=\"column\"\n >\n <div fxFlex class=\"\">\n <div fxFlex>\n <mat-card style=\"margin: 4px; padding: 4px 16px\">\n <h3>Avatar</h3>\n <div\n style=\"display: flex; flex-direction: row; align-items: center\"\n class=\"selfieContainer\"\n >\n <div class=\"selfie\" style=\"width: 200px\">\n <img\n *ngIf=\"model?._avatar\"\n class=\"preview\"\n style=\"width: 120px; height: 120px; border-radius: 60px\"\n [src]=\"model._avatar\"\n />\n </div>\n <button\n [disabled]=\"imageVerified\"\n (click)=\"selfie()\"\n mat-raised-button\n >\n Take selfie\n </button>\n </div>\n </mat-card>\n\n <form\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n class=\"px-16 py-0 w-100-p\"\n [formGroup]=\"form\"\n >\n <formly-form\n ngClass.lt-md=\"mobile\"\n fxFlex\n [form]=\"form\"\n [fields]=\"fields\"\n [model]=\"model\"\n >\n </formly-form>\n </form>\n </div>\n </div>\n <div fxFlex class=\"pr-16 m-4\">\n <mat-card style=\"margin: 4px; padding-top: 2px\" class=\"images\">\n <h3>Images</h3>\n <ng-container *ngFor=\"let img of images\">\n <div fxLayout=\"column\">\n <ng-container *ngIf=\"img.side === 0\">\n <div class=\"title\">Front Side</div>\n </ng-container>\n <ng-container *ngIf=\"img.side === 1\">\n <div class=\"title\">Back Side</div>\n </ng-container>\n <img\n class=\"preview\"\n style=\"max-width: 460px; border-radius: 1rem\"\n [src]=\"img.data\"\n />\n </div>\n </ng-container>\n </mat-card>\n </div>\n </div>\n\n <div></div>\n\n <footer fxLayout=\"row\" class=\"p-8\">\n <div class=\"w-100-p\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <button fxFlex class=\"mr-8\" mat-raised-button (click)=\"retake()\">\n {{ \"pms.dialogs.components.scanProfile.reTake\" | translate }}\n </button>\n <button\n [disabled]=\"error || form.invalid\"\n fxFlex\n class=\"ml-8\"\n mat-raised-button\n (click)=\"use()\"\n >\n {{ \"pms.dialogs.components.scanProfile.useData\" | translate }}\n </button>\n </div>\n </footer>\n</div>\n\n<div\n style=\"position: relative\"\n *ngIf=\"!result && documentTypeSelected\"\n fxFlex\n fxLayout=\"column\"\n>\n <div fxFlex #wraper class=\"wraper\" fxLayout=\"row\">\n <div\n style=\"\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n z-index: 20;\n background-color: whitesmoke;\n \"\n *ngIf=\"!cameraReady && !preview\"\n >\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n\n <div *ngIf=\"!preview\" style=\"position: absolute; left: 0px\">\n DELAY:{{ scanDelay }}\n </div>\n\n <div\n *ngIf=\"scaning\"\n style=\"\n position: absolute;\n z-index: 200;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n \"\n fxlayout=\"row\"\n fxLayoutAlign=\"center center\"\n >\n <!-- <mat-progress-spinner\n mode=\"indeterminate\"\n color=\"accent\"\n [strokeWidth]=\"10\"\n ></mat-progress-spinner> -->\n </div>\n\n <ng-container *ngIf=\"!error\">\n <!-- <div\n class=\"rectangle\"\n [ngStyle]=\"{\n 'width.px': videoHeight * 0.75 * 1.588,\n 'height.px': videoHeight * 0.75\n }\"\n ></div>\n <svg\n *ngIf=\"videoWidth\"\n style=\"position: absolute; left: 0px; top: 0px\"\n width=\"0\"\n height=\"0\"\n >\n <defs>\n <clipPath id=\"myClip\">\n <rect\n stroke-width=\"6\"\n stroke-color=\"red\"\n [attr.x]=\"(videoWidth - videoHeight * 0.75 * 1.588) / 2\"\n [attr.y]=\"(videoHeight * 0.25) / 2\"\n [attr.width]=\"videoHeight * 0.75 * 1.588\"\n [attr.height]=\"videoHeight * 0.75\"\n rx=\"25\"\n />\n </clipPath>\n </defs>\n </svg> -->\n\n <app-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main\"\n [imageQuality]=\"1\"\n #webcam\n fxFlex\n type=\"document\"\n [trigger]=\"trigger\"\n [imageHandler]=\"imageHandler\"\n (imageCapture)=\"handleImage($event)\"\n [allowCameraSwitch]=\"allowCameraSwitch\"\n [videoOptions]=\"videoOptions\"\n [switchCamera]=\"nextWebcamObservable\"\n (cameraSwitched)=\"cameraWasSwitched($event)\"\n (initError)=\"handleInitError($event)\"\n [width]=\"width\"\n [height]=\"height\"\n (destroyed)=\"cameraOff($event)\"\n (videoReady)=\"videoReady($event)\"\n >\n </app-webcam>\n </ng-container>\n <div\n fxLayout=\"row\"\n fxFlex\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"z-index: 20; position: absolute; width: 100%; height: 100%\"\n >\n <div class=\"p-16 error\" *ngIf=\"error\">\n <div style=\"max-width: \">\n <div class=\"title\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <mat-icon>error_outline</mat-icon\n ><span class=\"ml-8\">{{\n \"pms.dialogs.components.scanProfile.unableToDetectId\" | translate\n }}</span>\n </div>\n\n <ng-container *ngIf=\"errorCode === '1001'\">\n <div>\n Could not classify the given object as a supported document.\n </div>\n </ng-container>\n <ng-container *ngIf=\"errorCode === '1002'\">\n <div>\n Something is wrong with extraction data. Please try again.\n </div>\n </ng-container>\n\n <ul *ngIf=\"errorCode === '1000'\">\n <li>\n {{\n \"pms.dialogs.components.scanProfile.placeIdCloseToDevice\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.ensureSufficientLight\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.holdDocumentSteady\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.makeSureAllEdgesOfTheIdAreVisible\"\n | translate\n }}\n </li>\n <li>\n {{\n \"pms.dialogs.components.scanProfile.makeSureThereAreNoGlareAndShadowsOnTheId\"\n | translate\n }}\n </li>\n </ul>\n </div>\n </div>\n\n <div\n class=\"scanPreview\"\n fxFlex\n fxLayout=\"column\"\n *ngIf=\"!error && !scaning\"\n >\n <!-- <div class=\"py-16\" style=\"font-size: 16px\">\n {{\n \"pms.dialogs.components.scanProfile.ensureAllTextsAreVisible\"\n | translate\n }}\n </div> -->\n <div\n fxFlex\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer fxLayout=\"row\" style=\"height: 80px\" class=\"p-8\">\n <div class=\"displayInfo\" ngClass.lt-sm=\"mobile\" *ngIf=\"!preview && cameraReady\">\n {{ displayInfo }}\n </div>\n <div style=\"height: 26px\">\n <div\n style=\"text-align: center; font-size: 18px\"\n *ngIf=\"idScan && !preview && cameraReady\"\n >\n <ng-container *ngIf=\"idScan === 'BACK'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureBack\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"idScan === 'FRONT'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureFront\" | translate }}\n </ng-container>\n </div>\n </div>\n\n <!-- <button\n [disabled]=\"!cameraReady\"\n class=\"w-100-p\"\n *ngIf=\"!preview\"\n mat-raised-button\n (click)=\"scan()\"\n >\n <ng-container>\n <ng-container *ngIf=\"scanType === 'FRONT'\">{{\n \"pms.dialogs.components.scanProfile.captureFront\" | translate\n }}</ng-container>\n <ng-container *ngIf=\"scanType === 'BACK'\">{{\n \"pms.dialogs.components.scanProfile.captureBack\" | translate\n }}</ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"scanSide === 1\">{{\n \"pms.dialogs.components.scanProfile.captureBackOfId\" | translate\n }}</ng-container>\n </button> -->\n\n <div\n class=\"w-100-p\"\n *ngIf=\"preview\"\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n fxFlex\n >\n <button fxFlex class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n {{ \"pms.dialogs.components.scanProfile.retry\" | translate }}\n </button>\n\n <button\n [disabled]=\"error\"\n fxFlex\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n {{\n \"pms.dialogs.components.scanProfile.continueWithSelectedImage\"\n | translate\n }}\n </button>\n </div>\n </footer>\n</div>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5}.page-header{display:flex;flex-direction:row;align-items:center}.page-header button{height:100%}.debug{position:absolute;left:0;width:100%;height:80px;top:0;border-bottom:1px solid #ccc;background-color:#f8f8f8;display:flex;overflow:hidden;color:#000}.debug img{height:50px;border:1px solid #000}.displayInfo{text-align:center;height:20px;flex:1;position:absolute;width:100%;background-color:#000;height:30px;bottom:55px;left:0;line-height:30px;color:#fff;z-index:200}.displayInfo.mobile{font-size:12px}.element{margin-bottom:8px}.element label{font-size:14px}.element div{font-size:18px}.wraper{position:relative;overflow:hidden}.preview{width:100%;border-radius:1%}.documentTypeWraper{width:400px}.documentTypeWraper .label{font-size:14px;margin-bottom:20px}.documentTypeWraper button{box-shadow:none}.overPane{position:absolute;width:100%;height:100%;top:0;left:0}.overPane app-webcam{clip-path:url(#myClip)}.subhead{height:55px;padding-top:8px}.rectangle{z-index:2;position:absolute;top:50%;left:50%;width:85.6mm;height:53.98mm;transform:translate(-50%,-50%);box-sizing:border-box;border:2px dashed #459be5;border-radius:3mm}.mask{z-index:1;position:absolute;width:100%;height:100%;background-position:center center;background-size:380mm;background-repeat:no-repeat}.label{font-size:11px;margin-top:4px}footer button{box-shadow:none!important;height:45px;min-height:45px;text-transform:uppercase}h4{font-size:16px}.images .title{padding:8px 0;font-weight:600}.images img{margin-bottom:16px}.error{display:flex;align-items:center;justify-content:center;flex:1}.error .title{font-size:20px;margin-bottom:8px}.error .title mat-icon{margin-right:8px}.error ul{font-size:18px;list-style-type:none}.photo{width:120px;height:120px;overflow:hidden}.signature{width:200px}mat-card{box-shadow:none!important}.scanBlastWraper button{text-transform:uppercase}.scanBlastWraper.mobile mat-card{margin:4px!important}.scanBlastWraper.mobile .description{flex-direction:row!important}.scanBlastWraper.mobile .description .imgWrap{padding:0!important}.scanBlastWraper.mobile .description .btnActions{position:absolute;right:0}.scanBlastWraper.mobile .description button{margin:0!important;position:absolute;right:16px}.scanBlastWraper.mobile .description button.rotateButton{top:58px}.scanBlastWraper.mobile .description button.remButton{top:8px}.scanBlastWraper.mobile .description button mat-icon{margin:0!important}.scanBlastWraper.mobile .description button div.label{display:none}.scanBlast{display:flex;flex-direction:row;flex:1;padding:0 4px}.scanBlast mat-card{padding:0;box-shadow:none;margin:8px 4px;flex:1}.scanBlast mat-card .head{display:flex;flex-direction:row;align-items:center;justify-items:center;border-bottom:1px solid rgba(0,0,0,.12);height:60px;padding:8px}.scanBlast mat-card .head.small{height:30px!important;padding:4px 8px!important}.scanBlast mat-card .head.small .title{font-size:12px!important;margin-left:4px!important}.scanBlast mat-card .head button{max-width:120px;height:40px;box-shadow:none;border:1px solid rgba(0,0,0,.12)}.scanBlast mat-card .head .title{margin-left:16px;color:#459ae5;font-size:16px}.scanBlast mat-card .content{margin:8px;flex:1}.scanBlast mat-card .description{text-align:center;color:#888}.scanBlast mat-card .actions{background-color:#e9e9e9;display:flex;flex-direction:row}.scanBlast mat-card .actions .mat-button-disabled{background-color:#fff!important}.scanBlast mat-card .actions button{box-shadow:none;width:50%;margin:8px;height:40px;font-size:12px}.scanBlast mat-card .actions button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder{flex:1;border-radius:6px;display:flex;flex-direction:column}.scanBlast mat-card .previewPlaceholder .description{display:flex;flex:1;flex-direction:column;justify-content:center}.scanBlast mat-card .previewPlaceholder button{box-shadow:none;margin-top:8px;height:40px;font-size:12px}.scanBlast mat-card .previewPlaceholder button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder .imgWrap{flex-direction:column;flex:1;padding:8px;background-color:#f5f5f5;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap img{width:100%;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap .image{background-position:center;background-repeat:no-repeat;background-size:contain}.mr-4{margin-right:4px}.ml-4{margin-left:4px}.p-16{padding:16px}.p-8{padding:8px}.py-16{padding:16px 0}.w-100-p{width:100%}.scanPreview{padding:16px}.scanPreview .image{background-position:center;background-repeat:no-repeat;background-size:contain}.empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"] }]
|
|
3785
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: ScanProvider }, { type: DialogsCoreProvider }, { type:
|
|
3806
|
+
args: [{ selector: 'app-scan-selfie', changeDetection: ChangeDetectionStrategy.OnPush, template: "<header class=\"page-header\" fxLayout=\"row\">\n <div class=\"title\" ngClass.lt-sm=\"title-small\">Selfie</div>\n\n <span fxFlex></span>\n <ng-container\n *ngIf=\"\n documentTypeSelected &&\n !result &&\n !error &&\n multipleWebcamsAvailable &&\n !preview\n \"\n >\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <mat-form-field\n style=\"font-size: 14px; width: 200px; margin-top: 8px\"\n class=\"w-200 mr-16 mt-8\"\n >\n <mat-label> Camera </mat-label>\n <mat-select\n (selectionChange)=\"selectCamera($event)\"\n [(ngModel)]=\"deviceId\"\n >\n <mat-option\n *ngFor=\"let device of mediaDevices\"\n [value]=\"device.deviceId\"\n >\n {{ device.label }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n </ng-container>\n\n <ng-container>\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container>\n <!-- <ng-container *ngIf=\"type === 'desktop'\">\n <div class=\"separator\"></div>\n <button mat-button (click)=\"sendMobile()\">\n <mat-icon>tablet_mac</mat-icon>\n </button>\n\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container> -->\n</header>\n\n<div *ngIf=\"!result\" fxFlex fxLayout=\"column\">\n <div fxFlex #wraper class=\"wraper\" fxLayout=\"row\">\n <div\n style=\"\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n z-index: 20;\n background-color: whitesmoke;\n \"\n *ngIf=\"!cameraReady && !preview\"\n >\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n\n <ng-container *ngIf=\"!error\">\n <!-- <div\n class=\"rectangle\"\n [ngStyle]=\"{\n 'width.px': videoHeight * 0.75 * 1.588,\n 'height.px': videoHeight * 0.75\n }\"\n ></div>\n <svg\n *ngIf=\"videoWidth\"\n style=\"position: absolute; left: 0px; top: 0px\"\n width=\"0\"\n height=\"0\"\n >\n <defs>\n <clipPath id=\"myClip\">\n <rect\n stroke-width=\"6\"\n stroke-color=\"red\"\n [attr.x]=\"(videoWidth - videoHeight * 0.75 * 1.588) / 2\"\n [attr.y]=\"(videoHeight * 0.25) / 2\"\n [attr.width]=\"videoHeight * 0.75 * 1.588\"\n [attr.height]=\"videoHeight * 0.75\"\n rx=\"25\"\n />\n </clipPath>\n </defs>\n </svg> -->\n\n <app-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main\"\n [imageQuality]=\"1\"\n #webcam\n fxFlex\n [trigger]=\"trigger\"\n (imageCapture)=\"handleImage($event)\"\n [allowCameraSwitch]=\"allowCameraSwitch\"\n [videoOptions]=\"videoOptions\"\n [switchCamera]=\"nextWebcamObservable\"\n (cameraSwitched)=\"cameraWasSwitched($event)\"\n (initError)=\"handleInitError($event)\"\n type=\"selfie\"\n [width]=\"width\"\n [height]=\"height\"\n (destroyed)=\"cameraOff($event)\"\n >\n </app-webcam>\n </ng-container>\n <div\n fxLayout=\"row\"\n fxFlex\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"z-index: 20; position: absolute; width: 100%; height: 100%\"\n >\n <div\n class=\"scanPreview\"\n fxFlex\n fxLayout=\"column\"\n *ngIf=\"!error && !scaning\"\n >\n <div\n fxFlex\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer fxLayout=\"row\" class=\"p-8\">\n <button\n [disabled]=\"!cameraReady\"\n class=\"w-100-p\"\n *ngIf=\"!preview\"\n mat-raised-button\n (click)=\"scan()\"\n >\n <ng-container>\n TAKE SELFIE\n </ng-container>\n </button>\n\n <div\n class=\"w-100-p\"\n *ngIf=\"preview\"\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n fxFlex\n >\n <button fxFlex class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n RETRY\n </button>\n\n <button\n [disabled]=\"error\"\n fxFlex\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n CONTINUE\n\n </button>\n </div>\n </footer>\n</div>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5}.element{margin-bottom:8px}.element label{font-size:14px}.element div{font-size:18px}.wraper{position:relative;overflow:hidden}h3{color:#459ae5;font-size:16px}.preview{width:100%;border-radius:1%}.documentTypeWraper{width:400px}.documentTypeWraper .label{font-size:14px;margin-bottom:20px}.documentTypeWraper button{box-shadow:none}.overPane{position:absolute;width:100%;height:100%;top:0;left:0}.overPane app-webcam{clip-path:url(#myClip)}.subhead{height:55px;padding-top:8px}.rectangle{z-index:2;position:absolute;top:50%;left:50%;width:85.6mm;height:53.98mm;transform:translate(-50%,-50%);box-sizing:border-box;border:2px dashed #459be5;border-radius:3mm}.mask{z-index:1;position:absolute;width:100%;height:100%;background-position:center center;background-size:380mm;background-repeat:no-repeat}.label{font-size:11px;margin-top:4px}footer button{box-shadow:none!important;height:45px;min-height:45px;border:1px solid rgba(0,0,0,.12);text-transform:uppercase}h4{font-size:16px}.images label{font-size:11px;color:#888;line-height:20px}.images .title{padding:8px 0;font-weight:600}.images img{margin-bottom:16px}.error .title{font-size:22px}.error ul{font-size:18px}.photo{width:120px;height:120px;overflow:hidden}.signature{width:200px}mat-card{box-shadow:none!important}.scanBlastWraper button{text-transform:uppercase}.scanBlastWraper.mobile mat-card{margin:4px!important}.scanBlastWraper.mobile .description{font-size:12px;flex-direction:row!important}.scanBlastWraper.mobile .description .imgWrap{padding:0!important}.scanBlastWraper.mobile .description .btnActions{position:absolute;right:0}.scanBlastWraper.mobile .description button{font-size:11px!important;margin:0!important;position:absolute;right:16px}.scanBlastWraper.mobile .description button.rotateButton{top:58px}.scanBlastWraper.mobile .description button.remButton{top:8px}.scanBlastWraper.mobile .description button mat-icon{margin:0!important}.scanBlastWraper.mobile .description button div.label{display:none}.mobile .scanBlast button{font-size:11px!important}.scanBlast{display:flex;flex-direction:row;flex:1;padding:0 4px}.scanBlast mat-card{padding:0;box-shadow:none;margin:8px 4px;flex:1}.scanBlast mat-card .head{display:flex;flex-direction:row;align-items:center;justify-items:center;border-bottom:1px solid rgba(0,0,0,.12);height:60px;padding:8px}.scanBlast mat-card .head.small{height:30px!important;padding:4px 8px!important}.scanBlast mat-card .head.small .title{font-size:12px!important;margin-left:4px!important}.scanBlast mat-card .head button{max-width:120px;height:40px;box-shadow:none;border:1px solid rgba(0,0,0,.12)}.scanBlast mat-card .head .title{margin-left:16px;color:#459ae5;font-size:16px}.scanBlast mat-card .content{margin:8px;flex:1}.scanBlast mat-card .description{text-align:center;color:#888;font-size:14px}.scanBlast mat-card .actions{background-color:#e9e9e9;display:flex;flex-direction:row}.scanBlast mat-card .actions .mat-button-disabled{background-color:#fff!important}.scanBlast mat-card .actions button{box-shadow:none;width:50%;margin:8px;height:40px;font-size:12px}.scanBlast mat-card .actions button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder{flex:1;border-radius:6px;display:flex;flex-direction:column}.scanBlast mat-card .previewPlaceholder .description{display:flex;flex:1;flex-direction:column;justify-content:center}.scanBlast mat-card .previewPlaceholder button{box-shadow:none;margin-top:8px;height:40px;font-size:12px}.scanBlast mat-card .previewPlaceholder button mat-icon{margin-right:8px}.scanBlast mat-card .previewPlaceholder .imgWrap{flex-direction:column;flex:1;padding:8px;background-color:#f5f5f5;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap img{width:100%;border-radius:4px}.scanBlast mat-card .previewPlaceholder .imgWrap .image{background-position:center;background-repeat:no-repeat;background-size:contain}.mr-4{margin-right:4px}.ml-4{margin-left:4px}.p-16{padding:16px}.p-8{padding:8px}.py-16{padding:16px 0}.w-100-p{width:100%}.scanPreview{padding:16px}.scanPreview .image{background-position:center;background-repeat:no-repeat;background-size:contain}.empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center}.summary label{font-size:12px;color:#888;margin-top:2px}.summary .name{font-size:14px}.selfieContainer{display:flex;flex-direction:column;margin-bottom:20px}.selfieContainer button{box-shadow:none;border:1px solid rgba(0,0,0,.12)}.selfieContainer .selfie{margin:8px auto;width:120px;height:120px;border-radius:60px;border:1px solid rgba(0,0,0,.12)}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"] }]
|
|
3807
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: ScanProvider }, { type: DialogsCoreProvider }, { type: i1$2.TranslateService }]; }, propDecorators: { type: [{
|
|
3786
3808
|
type: Input
|
|
3787
3809
|
}], actions: [{
|
|
3788
3810
|
type: Output
|
|
@@ -3794,228 +3816,164 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
3794
3816
|
args: ['window:resize', ['$event']]
|
|
3795
3817
|
}] } });
|
|
3796
3818
|
|
|
3797
|
-
class
|
|
3798
|
-
constructor(
|
|
3799
|
-
|
|
3800
|
-
this.
|
|
3801
|
-
this.width = 'w-120';
|
|
3802
|
-
this.padding = 'px-32 pt-8 pb-8';
|
|
3819
|
+
class TurnDocumentComponent {
|
|
3820
|
+
constructor(dialogRef, data) {
|
|
3821
|
+
this.dialogRef = dialogRef;
|
|
3822
|
+
this.data = data;
|
|
3803
3823
|
}
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
this.padding = this.to.padding;
|
|
3811
|
-
}
|
|
3812
|
-
this.cd.detectChanges();
|
|
3824
|
+
ngOnInit() {
|
|
3825
|
+
console.log(this.data);
|
|
3826
|
+
}
|
|
3827
|
+
close() {
|
|
3828
|
+
console.log(this.dialogRef);
|
|
3829
|
+
this.dialogRef.close();
|
|
3813
3830
|
}
|
|
3814
3831
|
}
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
[ngClass]="padding"
|
|
3819
|
-
fxLayout="column"
|
|
3820
|
-
fxLayoutAlign="center center"
|
|
3821
|
-
>
|
|
3822
|
-
<ngx-avatars
|
|
3823
|
-
[name]="model[key.toString()]"
|
|
3824
|
-
[ngClass]="width"
|
|
3825
|
-
></ngx-avatars>
|
|
3826
|
-
</mat-card>
|
|
3827
|
-
`, isInline: true, styles: ["mat-card{border-radius:0;box-shadow:none!important}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i12.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i3$2.AvatarComponent, selector: "ngx-avatars", inputs: ["round", "size", "textSizeRatio", "bgColor", "fgColor", "borderColor", "style", "cornerRadius", "facebookId", "twitterId", "googleId", "instagramId", "vkontakteId", "skypeId", "gravatarId", "githubId", "src", "name", "value", "referrerpolicy", "placeholder", "initialsSize"], outputs: ["clickOnAvatar"] }] });
|
|
3828
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AvatarTypeComponent, decorators: [{
|
|
3832
|
+
TurnDocumentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TurnDocumentComponent, deps: [{ token: i1$4.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
3833
|
+
TurnDocumentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TurnDocumentComponent, selector: "app-turndocuments", ngImport: i0, template: "<div class=\"inner\" fxLayout=\"column\" fxLayoutAlign=\"center center\">\n <!-- <img\n style=\"height: 240px; margin: 34px 0px;display: none;\"\n [src]=\"'/assets/images/illustrations/' + images[type]\"\n /> -->\n <!-- <img style=\"width:60px;\" src=\"/assets/images/illustrations/door-lock.png\"> -->\n\n <mat-icon>360</mat-icon>\n <div class=\"text\">\n <ng-container *ngIf=\"data.idScan === 'BACK'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureBack\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"data.idScan === 'FRONT'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureFront\" | translate }}\n </ng-container>\n </div>\n</div>\n\n<!-- -->\n\n<footer>\n <button (click)=\"close()\" mat-raised-button>Ok</button>\n</footer>\n", styles: [":host{display:flex;flex-direction:column;flex:1;height:100%;width:100%}.inner{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:30px 20px 0}.inner mat-icon{width:60px;height:60px;font-size:60px}.inner .text{margin:20px 0}footer{display:flex;flex-direction:row;align-items:center;justify-content:center;padding-bottom:20px}footer button{min-width:200px;box-shadow:none;border:1px solid #ccc}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4$2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4$2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }] });
|
|
3834
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TurnDocumentComponent, decorators: [{
|
|
3829
3835
|
type: Component,
|
|
3830
|
-
args: [{ selector: 'app-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
>
|
|
3836
|
-
<ngx-avatars
|
|
3837
|
-
[name]="model[key.toString()]"
|
|
3838
|
-
[ngClass]="width"
|
|
3839
|
-
></ngx-avatars>
|
|
3840
|
-
</mat-card>
|
|
3841
|
-
`, styles: ["mat-card{border-radius:0;box-shadow:none!important}\n"] }]
|
|
3842
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
|
|
3836
|
+
args: [{ selector: 'app-turndocuments', template: "<div class=\"inner\" fxLayout=\"column\" fxLayoutAlign=\"center center\">\n <!-- <img\n style=\"height: 240px; margin: 34px 0px;display: none;\"\n [src]=\"'/assets/images/illustrations/' + images[type]\"\n /> -->\n <!-- <img style=\"width:60px;\" src=\"/assets/images/illustrations/door-lock.png\"> -->\n\n <mat-icon>360</mat-icon>\n <div class=\"text\">\n <ng-container *ngIf=\"data.idScan === 'BACK'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureBack\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"data.idScan === 'FRONT'\">\n Turn document and:\n {{ \"pms.dialogs.components.scanProfile.captureFront\" | translate }}\n </ng-container>\n </div>\n</div>\n\n<!-- -->\n\n<footer>\n <button (click)=\"close()\" mat-raised-button>Ok</button>\n</footer>\n", styles: [":host{display:flex;flex-direction:column;flex:1;height:100%;width:100%}.inner{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:30px 20px 0}.inner mat-icon{width:60px;height:60px;font-size:60px}.inner .text{margin:20px 0}footer{display:flex;flex-direction:row;align-items:center;justify-content:center;padding-bottom:20px}footer button{min-width:200px;box-shadow:none;border:1px solid #ccc}\n"] }]
|
|
3837
|
+
}], ctorParameters: function () { return [{ type: i1$4.MatDialogRef }, { type: undefined, decorators: [{
|
|
3838
|
+
type: Inject,
|
|
3839
|
+
args: [MAT_DIALOG_DATA]
|
|
3840
|
+
}] }]; } });
|
|
3843
3841
|
|
|
3844
|
-
class
|
|
3845
|
-
constructor(
|
|
3846
|
-
|
|
3847
|
-
this.
|
|
3842
|
+
class DialogsCoreProvider {
|
|
3843
|
+
constructor(matDialog) {
|
|
3844
|
+
this.matDialog = matDialog;
|
|
3845
|
+
this.components = {
|
|
3846
|
+
ScanProfile: { component: ScanProfileComponent },
|
|
3847
|
+
Loading: { component: LoadingComponent },
|
|
3848
|
+
ConfirmComponent: { component: ConfirmComponent },
|
|
3849
|
+
TurnDocumentComponent: { component: TurnDocumentComponent },
|
|
3850
|
+
ScanSelfie: { component: ScanSelfieComponent },
|
|
3851
|
+
};
|
|
3852
|
+
this.blank = BlankComponent;
|
|
3853
|
+
}
|
|
3854
|
+
getComponent(name) {
|
|
3855
|
+
if (!this.components[name]) {
|
|
3856
|
+
console.warn('Component missing', name, this.components);
|
|
3857
|
+
}
|
|
3858
|
+
return this.components[name].component;
|
|
3859
|
+
}
|
|
3860
|
+
open(config, withComponent = true) {
|
|
3861
|
+
// console.log(config);
|
|
3862
|
+
const panelClass = config.panelClass ? config.panelClass : config.name;
|
|
3863
|
+
const component = this.getComponent(config.name);
|
|
3864
|
+
const dialogRef = this.matDialog.open(this.blank, {
|
|
3865
|
+
panelClass,
|
|
3866
|
+
data: {
|
|
3867
|
+
data: config.data,
|
|
3868
|
+
withComponent,
|
|
3869
|
+
component,
|
|
3870
|
+
},
|
|
3871
|
+
autoFocus: false,
|
|
3872
|
+
width: config.width || '',
|
|
3873
|
+
height: config.height || '',
|
|
3874
|
+
maxWidth: config.maxWidth || '',
|
|
3875
|
+
minWidth: config.minWidth || '',
|
|
3876
|
+
maxHeight: config.maxHeight || '',
|
|
3877
|
+
minHeight: config.minHeight || '',
|
|
3878
|
+
position: config.position || {},
|
|
3879
|
+
hasBackdrop: config.hasBackdrop === undefined ? true : config.hasBackdrop,
|
|
3880
|
+
disableClose: config.disableClose === undefined ? true : config.disableClose,
|
|
3881
|
+
});
|
|
3882
|
+
return dialogRef;
|
|
3883
|
+
}
|
|
3884
|
+
scanProfile(data) {
|
|
3885
|
+
return this.open({
|
|
3886
|
+
name: 'ScanProfile',
|
|
3887
|
+
panelClass: 'ScanProfileComponent',
|
|
3888
|
+
data,
|
|
3889
|
+
});
|
|
3848
3890
|
}
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3891
|
+
// Generic loading dialog
|
|
3892
|
+
loading(title = '') {
|
|
3893
|
+
return this.open({
|
|
3894
|
+
name: 'Loading',
|
|
3895
|
+
data: { title },
|
|
3896
|
+
});
|
|
3853
3897
|
}
|
|
3854
|
-
|
|
3855
|
-
this.
|
|
3898
|
+
alert(title, text) {
|
|
3899
|
+
return this.open({
|
|
3900
|
+
name: 'ConfirmComponent',
|
|
3901
|
+
maxWidth: '600px',
|
|
3902
|
+
panelClass: 'DialogNoPadding',
|
|
3903
|
+
minWidth: '440px',
|
|
3904
|
+
data: { title, text, alert: true },
|
|
3905
|
+
});
|
|
3906
|
+
}
|
|
3907
|
+
turnDocument(idScan) {
|
|
3908
|
+
return this.open({
|
|
3909
|
+
name: 'TurnDocumentComponent',
|
|
3910
|
+
maxWidth: '400px',
|
|
3911
|
+
panelClass: 'DialogNoPadding',
|
|
3912
|
+
minWidth: '300px',
|
|
3913
|
+
data: { idScan },
|
|
3914
|
+
}).afterClosed();
|
|
3915
|
+
}
|
|
3916
|
+
// public scanMobile(data: any) {
|
|
3917
|
+
// return this.open({
|
|
3918
|
+
// name: 'ScanMobileComponent',
|
|
3919
|
+
// maxWidth: '600px',
|
|
3920
|
+
// panelClass: 'DialogNoPadding',
|
|
3921
|
+
// minWidth: '440px',
|
|
3922
|
+
// data,
|
|
3923
|
+
// });
|
|
3924
|
+
// }
|
|
3925
|
+
scanSelfie(data) {
|
|
3926
|
+
return this.open({
|
|
3927
|
+
name: 'ScanSelfie',
|
|
3928
|
+
panelClass: 'ScanProfileComponent',
|
|
3929
|
+
data,
|
|
3930
|
+
});
|
|
3856
3931
|
}
|
|
3857
3932
|
}
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
matBadgeSize="small"
|
|
3867
|
-
matBadgeColor="primary"
|
|
3868
|
-
matBadgeOverlap="false"
|
|
3869
|
-
></span>
|
|
3870
|
-
</h3>
|
|
3871
|
-
<span fxFlex></span>
|
|
3872
|
-
<div *ngIf="to.chip" class="chip">
|
|
3873
|
-
{{ to.chip | translate }}
|
|
3874
|
-
</div>
|
|
3875
|
-
</div>
|
|
3876
|
-
`, isInline: true, styles: [".chip{background:whitesmoke;border-radius:6px;padding:4px 8px;font-size:12px;color:#888;font-weight:600}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }] });
|
|
3877
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TitleTypeComponent, decorators: [{
|
|
3878
|
-
type: Component,
|
|
3879
|
-
args: [{ selector: 'app-formly-title-type', template: `
|
|
3880
|
-
<div fxLayout="row" fxLayoutAlign="start center">
|
|
3881
|
-
<h3>
|
|
3882
|
-
<span>{{ to.label }}</span>
|
|
3883
|
-
|
|
3884
|
-
<span
|
|
3885
|
-
*ngIf="opt.badge && model[opt.badge] && model[opt.badge].length > 1"
|
|
3886
|
-
matBadgeSize="small"
|
|
3887
|
-
matBadgeColor="primary"
|
|
3888
|
-
matBadgeOverlap="false"
|
|
3889
|
-
></span>
|
|
3890
|
-
</h3>
|
|
3891
|
-
<span fxFlex></span>
|
|
3892
|
-
<div *ngIf="to.chip" class="chip">
|
|
3893
|
-
{{ to.chip | translate }}
|
|
3894
|
-
</div>
|
|
3895
|
-
</div>
|
|
3896
|
-
`, styles: [".chip{background:whitesmoke;border-radius:6px;padding:4px 8px;font-size:12px;color:#888;font-weight:600}\n"] }]
|
|
3897
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
|
|
3933
|
+
DialogsCoreProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DialogsCoreProvider, deps: [{ token: i1$4.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3934
|
+
DialogsCoreProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DialogsCoreProvider, providedIn: 'root' });
|
|
3935
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DialogsCoreProvider, decorators: [{
|
|
3936
|
+
type: Injectable,
|
|
3937
|
+
args: [{
|
|
3938
|
+
providedIn: 'root',
|
|
3939
|
+
}]
|
|
3940
|
+
}], ctorParameters: function () { return [{ type: i1$4.MatDialog }]; } });
|
|
3898
3941
|
|
|
3899
|
-
class
|
|
3900
|
-
constructor(
|
|
3942
|
+
class ScanProfileComponent extends BaseComponent {
|
|
3943
|
+
constructor(dialogs, dialogRef) {
|
|
3901
3944
|
super();
|
|
3902
|
-
this.
|
|
3945
|
+
this.dialogs = dialogs;
|
|
3946
|
+
this.dialogRef = dialogRef;
|
|
3947
|
+
this.type = 'desktop';
|
|
3948
|
+
this.showDialog = false;
|
|
3903
3949
|
}
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3950
|
+
ngAfterViewInit() { }
|
|
3951
|
+
ngOnDestroy() {
|
|
3952
|
+
this.__destroy();
|
|
3953
|
+
console.log('DES');
|
|
3954
|
+
}
|
|
3955
|
+
actions(event) {
|
|
3956
|
+
console.log(event);
|
|
3957
|
+
switch (event.type) {
|
|
3958
|
+
case 'turnDocumentOver':
|
|
3959
|
+
this.dialogs.turnDocument(event.side).subscribe(() => {
|
|
3960
|
+
this.showDialog = false;
|
|
3961
|
+
});
|
|
3962
|
+
break;
|
|
3911
3963
|
}
|
|
3912
|
-
|
|
3964
|
+
}
|
|
3965
|
+
close() {
|
|
3966
|
+
this.dialogRef?.close();
|
|
3913
3967
|
}
|
|
3914
3968
|
}
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
fxLayout="column"
|
|
3920
|
-
fxLayoutAlign="center center"
|
|
3921
|
-
>
|
|
3922
|
-
<ngx-avatars
|
|
3923
|
-
class="profile-image"
|
|
3924
|
-
[src]="model[key.toString()]"
|
|
3925
|
-
[size]="150"
|
|
3926
|
-
|
|
3927
|
-
></ngx-avatars>
|
|
3928
|
-
</mat-card>
|
|
3929
|
-
`, isInline: true, styles: ["mat-card{border-radius:0;box-shadow:none!important}.profile-image{width:150px;height:150px;border-radius:50%}\n"], dependencies: [{ kind: "component", type: i12.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i3$2.AvatarComponent, selector: "ngx-avatars", inputs: ["round", "size", "textSizeRatio", "bgColor", "fgColor", "borderColor", "style", "cornerRadius", "facebookId", "twitterId", "googleId", "instagramId", "vkontakteId", "skypeId", "gravatarId", "githubId", "src", "name", "value", "referrerpolicy", "placeholder", "initialsSize"], outputs: ["clickOnAvatar"] }] });
|
|
3930
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ProfileImageTypeComponent, decorators: [{
|
|
3969
|
+
ScanProfileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanProfileComponent, deps: [{ token: DialogsCoreProvider }, { token: i1$4.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3970
|
+
ScanProfileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScanProfileComponent, selector: "app-scan-profile", inputs: { type: "type" }, usesInheritance: true, ngImport: i0, template: "<header class=\"page-header\">\n <div class=\"title\" ngClass.lt-sm=\"title-small\">Scan</div>\n\n <span fxFlex></span>\n\n <!-- <mat-slide-toggle style=\"margin:0px 20px\" [(ngModel)]=\"isDebug\"\n >Debug</mat-slide-toggle\n > -->\n\n <ng-container\n\n >\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <ngx-scan-camera-switch></ngx-scan-camera-switch>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"type === 'desktop'\">\n <!-- <div class=\"separator\"></div>\n <button mat-button (click)=\"sendMobile()\">\n <mat-icon>tablet_mac</mat-icon>\n </button> -->\n\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container>\n</header>\n\n<ngx-scan (actions)=\"actions($event)\" [showDialog]=\"showDialog\" [dialogs]=\"dialogs\"></ngx-scan>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5;overflow:hidden}.page-header{display:flex;flex-direction:row;align-items:center}.page-header button{height:100%}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: ScanComponent, selector: "ngx-scan", inputs: ["type", "dialogs", "showDialog"], outputs: ["actions"] }, { kind: "component", type: CameraSwitchComponent, selector: "ngx-scan-camera-switch" }, { kind: "directive", type: i4$2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4$2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i4$2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i5$3.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3971
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScanProfileComponent, decorators: [{
|
|
3931
3972
|
type: Component,
|
|
3932
|
-
args: [{ selector: 'app-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
fxLayoutAlign="center center"
|
|
3937
|
-
>
|
|
3938
|
-
<ngx-avatars
|
|
3939
|
-
class="profile-image"
|
|
3940
|
-
[src]="model[key.toString()]"
|
|
3941
|
-
[size]="150"
|
|
3942
|
-
|
|
3943
|
-
></ngx-avatars>
|
|
3944
|
-
</mat-card>
|
|
3945
|
-
`, styles: ["mat-card{border-radius:0;box-shadow:none!important}.profile-image{width:150px;height:150px;border-radius:50%}\n"] }]
|
|
3946
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
|
|
3947
|
-
|
|
3948
|
-
class AppFormModule {
|
|
3949
|
-
}
|
|
3950
|
-
AppFormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3951
|
-
AppFormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: AppFormModule, declarations: [TitleTypeComponent,
|
|
3952
|
-
AvatarTypeComponent,
|
|
3953
|
-
ProfileImageTypeComponent], imports: [CommonModule,
|
|
3954
|
-
FormsModule,
|
|
3955
|
-
FormlyMatDatepickerModule,
|
|
3956
|
-
FormlySelectModule,
|
|
3957
|
-
MaterialModule,
|
|
3958
|
-
AvatarModule,
|
|
3959
|
-
TranslateModule,
|
|
3960
|
-
FormlyMaterialModule, i8$1.FormlyModule], exports: [FormlyModule] });
|
|
3961
|
-
AppFormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppFormModule, imports: [CommonModule,
|
|
3962
|
-
FormsModule,
|
|
3963
|
-
FormlyMatDatepickerModule,
|
|
3964
|
-
FormlySelectModule,
|
|
3965
|
-
MaterialModule,
|
|
3966
|
-
AvatarModule,
|
|
3967
|
-
TranslateModule,
|
|
3968
|
-
FormlyMaterialModule,
|
|
3969
|
-
FormlyModule.forRoot({
|
|
3970
|
-
types: [
|
|
3971
|
-
{
|
|
3972
|
-
name: 'title',
|
|
3973
|
-
component: TitleTypeComponent,
|
|
3974
|
-
wrappers: [],
|
|
3975
|
-
},
|
|
3976
|
-
{
|
|
3977
|
-
name: 'profile-image',
|
|
3978
|
-
component: ProfileImageTypeComponent,
|
|
3979
|
-
wrappers: [],
|
|
3980
|
-
},
|
|
3981
|
-
],
|
|
3982
|
-
}), FormlyModule] });
|
|
3983
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppFormModule, decorators: [{
|
|
3984
|
-
type: NgModule,
|
|
3985
|
-
args: [{
|
|
3986
|
-
declarations: [
|
|
3987
|
-
TitleTypeComponent,
|
|
3988
|
-
AvatarTypeComponent,
|
|
3989
|
-
ProfileImageTypeComponent,
|
|
3990
|
-
],
|
|
3991
|
-
imports: [
|
|
3992
|
-
CommonModule,
|
|
3993
|
-
FormsModule,
|
|
3994
|
-
FormlyMatDatepickerModule,
|
|
3995
|
-
FormlySelectModule,
|
|
3996
|
-
MaterialModule,
|
|
3997
|
-
AvatarModule,
|
|
3998
|
-
TranslateModule,
|
|
3999
|
-
FormlyMaterialModule,
|
|
4000
|
-
FormlyModule.forRoot({
|
|
4001
|
-
types: [
|
|
4002
|
-
{
|
|
4003
|
-
name: 'title',
|
|
4004
|
-
component: TitleTypeComponent,
|
|
4005
|
-
wrappers: [],
|
|
4006
|
-
},
|
|
4007
|
-
{
|
|
4008
|
-
name: 'profile-image',
|
|
4009
|
-
component: ProfileImageTypeComponent,
|
|
4010
|
-
wrappers: [],
|
|
4011
|
-
},
|
|
4012
|
-
],
|
|
4013
|
-
}),
|
|
4014
|
-
],
|
|
4015
|
-
providers: [],
|
|
4016
|
-
exports: [FormlyModule],
|
|
4017
|
-
}]
|
|
4018
|
-
}] });
|
|
3973
|
+
args: [{ selector: 'app-scan-profile', changeDetection: ChangeDetectionStrategy.OnPush, template: "<header class=\"page-header\">\n <div class=\"title\" ngClass.lt-sm=\"title-small\">Scan</div>\n\n <span fxFlex></span>\n\n <!-- <mat-slide-toggle style=\"margin:0px 20px\" [(ngModel)]=\"isDebug\"\n >Debug</mat-slide-toggle\n > -->\n\n <ng-container\n\n >\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <ngx-scan-camera-switch></ngx-scan-camera-switch>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"type === 'desktop'\">\n <!-- <div class=\"separator\"></div>\n <button mat-button (click)=\"sendMobile()\">\n <mat-icon>tablet_mac</mat-icon>\n </button> -->\n\n <div class=\"separator\"></div>\n\n <button mat-button (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n </ng-container>\n</header>\n\n<ngx-scan (actions)=\"actions($event)\" [showDialog]=\"showDialog\" [dialogs]=\"dialogs\"></ngx-scan>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5;overflow:hidden}.page-header{display:flex;flex-direction:row;align-items:center}.page-header button{height:100%}\n", ".page-header{z-index:2000;height:64px;padding:0;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.12)}.page-header .title{padding-left:24px;line-height:64px;font-size:18px}.page-header .separator{width:1px;background-color:#0000001f;height:100%}.page-header .total{line-height:64px}.page-header .total span{font-weight:700}.page-footer{height:64px}.page-footer button{margin-left:24px;box-shadow:none!important}\n"] }]
|
|
3974
|
+
}], ctorParameters: function () { return [{ type: DialogsCoreProvider }, { type: i1$4.MatDialogRef }]; }, propDecorators: { type: [{
|
|
3975
|
+
type: Input
|
|
3976
|
+
}] } });
|
|
4019
3977
|
|
|
4020
3978
|
class DialogsModule {
|
|
4021
3979
|
}
|
|
@@ -4024,7 +3982,7 @@ DialogsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
|
|
|
4024
3982
|
BlankComponent,
|
|
4025
3983
|
LoadingComponent,
|
|
4026
3984
|
ConfirmComponent,
|
|
4027
|
-
|
|
3985
|
+
TurnDocumentComponent,
|
|
4028
3986
|
ScanSelfieComponent], imports: [QRCodeModule,
|
|
4029
3987
|
ReactiveFormsModule,
|
|
4030
3988
|
CommonModule,
|
|
@@ -4038,7 +3996,7 @@ DialogsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
|
|
|
4038
3996
|
FlexLayoutModule], exports: [ScanProfileComponent,
|
|
4039
3997
|
LoadingComponent,
|
|
4040
3998
|
BlankComponent,
|
|
4041
|
-
|
|
3999
|
+
TurnDocumentComponent,
|
|
4042
4000
|
MaterialModule,
|
|
4043
4001
|
ScanSelfieComponent] });
|
|
4044
4002
|
DialogsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DialogsModule, providers: [DialogsCoreProvider], imports: [QRCodeModule,
|
|
@@ -4060,14 +4018,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
4060
4018
|
BlankComponent,
|
|
4061
4019
|
LoadingComponent,
|
|
4062
4020
|
ConfirmComponent,
|
|
4063
|
-
|
|
4021
|
+
TurnDocumentComponent,
|
|
4064
4022
|
ScanSelfieComponent,
|
|
4065
4023
|
],
|
|
4066
4024
|
exports: [
|
|
4067
4025
|
ScanProfileComponent,
|
|
4068
4026
|
LoadingComponent,
|
|
4069
4027
|
BlankComponent,
|
|
4070
|
-
|
|
4028
|
+
TurnDocumentComponent,
|
|
4071
4029
|
MaterialModule,
|
|
4072
4030
|
ScanSelfieComponent,
|
|
4073
4031
|
],
|
|
@@ -4084,7 +4042,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
4084
4042
|
FlexModule,
|
|
4085
4043
|
FlexLayoutModule,
|
|
4086
4044
|
],
|
|
4087
|
-
providers: [DialogsCoreProvider]
|
|
4045
|
+
providers: [DialogsCoreProvider],
|
|
4088
4046
|
}]
|
|
4089
4047
|
}] });
|
|
4090
4048
|
|
|
@@ -4093,7 +4051,7 @@ class HttpErrorInterceptor {
|
|
|
4093
4051
|
this.injector = injector;
|
|
4094
4052
|
}
|
|
4095
4053
|
intercept(req, next) {
|
|
4096
|
-
console.log(req.url);
|
|
4054
|
+
//console.log(req.url);
|
|
4097
4055
|
if (req.url.indexOf('auth') >= 0 || req.url.indexOf('/assets/') >= 0) {
|
|
4098
4056
|
return next.handle(req);
|
|
4099
4057
|
}
|
|
@@ -4143,6 +4101,61 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
4143
4101
|
type: Injectable
|
|
4144
4102
|
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
4145
4103
|
|
|
4104
|
+
class webRtcProvider {
|
|
4105
|
+
constructor() {
|
|
4106
|
+
this.pc = new RTCPeerConnection();
|
|
4107
|
+
}
|
|
4108
|
+
connect(id = 1) {
|
|
4109
|
+
this.subject = webSocket('wss://localhost:3000?id=' + id);
|
|
4110
|
+
}
|
|
4111
|
+
setup() {
|
|
4112
|
+
this.connect(1);
|
|
4113
|
+
// try {
|
|
4114
|
+
// this.pc = new RTCPeerConnection({
|
|
4115
|
+
// iceServers: [
|
|
4116
|
+
// { urls: 'stun:stun.services.mozilla.com' },
|
|
4117
|
+
// { urls: 'stun:stun.l.google.com:19302' },
|
|
4118
|
+
// ],
|
|
4119
|
+
// });
|
|
4120
|
+
// } catch (error) {
|
|
4121
|
+
// console.log(error);
|
|
4122
|
+
// this.pc = new RTCPeerConnection({
|
|
4123
|
+
// iceServers: [
|
|
4124
|
+
// { urls: 'stun:stun.services.mozilla.com' },
|
|
4125
|
+
// { urls: 'stun:stun.l.google.com:19302' },
|
|
4126
|
+
// ],
|
|
4127
|
+
// });
|
|
4128
|
+
// }
|
|
4129
|
+
// this.pc.onicecandidate = (event) => {
|
|
4130
|
+
// event.candidate
|
|
4131
|
+
// ? this.sendMessage({ ice: event.candidate })
|
|
4132
|
+
// : console.log('Sent All Ice');
|
|
4133
|
+
// };
|
|
4134
|
+
// if (this.pc) {
|
|
4135
|
+
// from(this.pc.createOffer())
|
|
4136
|
+
// .pipe(switchMap((offer) => from(this.pc.setLocalDescription(offer))))
|
|
4137
|
+
// .subscribe((data: any) => {
|
|
4138
|
+
// this.sendMessage({
|
|
4139
|
+
// type: 'offer',
|
|
4140
|
+
// sdp: this.pc.localDescription,
|
|
4141
|
+
// });
|
|
4142
|
+
// });
|
|
4143
|
+
// }
|
|
4144
|
+
}
|
|
4145
|
+
sendMessage(data) {
|
|
4146
|
+
console.log(data);
|
|
4147
|
+
this.subject.next(JSON.stringify(data));
|
|
4148
|
+
}
|
|
4149
|
+
}
|
|
4150
|
+
webRtcProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: webRtcProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4151
|
+
webRtcProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: webRtcProvider, providedIn: 'root' });
|
|
4152
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: webRtcProvider, decorators: [{
|
|
4153
|
+
type: Injectable,
|
|
4154
|
+
args: [{
|
|
4155
|
+
providedIn: 'root',
|
|
4156
|
+
}]
|
|
4157
|
+
}], ctorParameters: function () { return []; } });
|
|
4158
|
+
|
|
4146
4159
|
class NgxScandocModule {
|
|
4147
4160
|
static forRoot(config) {
|
|
4148
4161
|
return {
|
|
@@ -4181,5 +4194,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
4181
4194
|
* Generated bundle index. Do not edit.
|
|
4182
4195
|
*/
|
|
4183
4196
|
|
|
4184
|
-
export { AppFormModule, AuthProvider, BlankComponent, CoreComponentsModule, CorePipesModule, DialogsCoreProvider, DialogsModule, HttpErrorInterceptor, LoadingComponent, MaterialModule, NgxScandocModule, SafeResourceUrlPipe,
|
|
4197
|
+
export { AppFormModule, AuthProvider, BlankComponent, CameraSwitchComponent, CoreComponentsModule, CorePipesModule, DialogsCoreProvider, DialogsModule, HttpErrorInterceptor, LoadingComponent, MaterialModule, NgxScandocModule, SafeResourceUrlPipe, ScanComponent, ScanFieldsProvider, ScanProfileComponent, ScanProvider, ScanSelfieComponent, TranslationProvider, TurnDocumentComponent, WebcamComponent, WebcamModule, webRtcProvider };
|
|
4185
4198
|
//# sourceMappingURL=ngx-scandoc.mjs.map
|