ngx-scandoc 19.0.4 → 19.0.6
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/components.module.d.ts +1 -1
- package/core/components/scan/scan.component.d.ts +3 -2
- package/core/components/scan-results/scan-results.component.d.ts +4 -8
- package/fesm2022/ngx-scandoc.mjs +1725 -1729
- package/fesm2022/ngx-scandoc.mjs.map +1 -1
- package/ngx-scandoc-19.0.6.tgz +0 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -1
package/fesm2022/ngx-scandoc.mjs
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, EventEmitter, Output, ViewChild, HostListener, Input, ChangeDetectionStrategy, Component, NgModule, InjectionToken,
|
|
3
|
-
import * as
|
|
2
|
+
import { Injectable, EventEmitter, Output, ViewChild, HostListener, Input, ChangeDetectionStrategy, Component, NgModule, InjectionToken, Optional, Inject, HostBinding, Pipe, ViewContainerRef } from '@angular/core';
|
|
3
|
+
import * as i2$1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { Subject, of, from,
|
|
5
|
+
import { Subject, of, from, tap, distinctUntilChanged, Observable, switchMap as switchMap$1, throwError, forkJoin } from 'rxjs';
|
|
6
6
|
import { takeUntil, map, switchMap, tap as tap$1, catchError, share, retry } from 'rxjs/operators';
|
|
7
7
|
import * as i1 from '@angular/cdk/layout';
|
|
8
8
|
import * as i2 from '@angular/cdk/platform';
|
|
9
9
|
import { PlatformModule } from '@angular/cdk/platform';
|
|
10
|
-
import * as
|
|
10
|
+
import * as i3 from '@angular/forms';
|
|
11
11
|
import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
12
|
+
import * as i4$1 from 'ngx-device-detector';
|
|
13
|
+
import { jwtDecode } from 'jwt-decode';
|
|
12
14
|
import moment from 'moment';
|
|
13
15
|
import * as i1$1 from '@angular/common/http';
|
|
14
16
|
import { HttpHeaders, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
15
|
-
import * as i4$2 from 'ngx-device-detector';
|
|
16
|
-
import { jwtDecode } from 'jwt-decode';
|
|
17
17
|
import * as i5$1 from '@angular/material/icon';
|
|
18
18
|
import { MatIconModule } from '@angular/material/icon';
|
|
19
|
-
import * as i3 from '@angular/material/button';
|
|
19
|
+
import * as i3$1 from '@angular/material/button';
|
|
20
20
|
import { MatButtonModule } from '@angular/material/button';
|
|
21
21
|
import * as i8 from '@angular/material/progress-bar';
|
|
22
22
|
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
23
|
-
import * as
|
|
24
|
-
import { MatCardModule } from '@angular/material/card';
|
|
25
|
-
import * as i4$1 from '@ngx-translate/core';
|
|
23
|
+
import * as i6 from '@ngx-translate/core';
|
|
26
24
|
import { TranslateModule } from '@ngx-translate/core';
|
|
25
|
+
import * as i4 from '@angular/material/card';
|
|
26
|
+
import { MatCardModule } from '@angular/material/card';
|
|
27
|
+
import * as i5 from '@ngx-formly/core';
|
|
28
|
+
import { FormlyModule } from '@ngx-formly/core';
|
|
27
29
|
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
28
30
|
import { MatBadgeModule } from '@angular/material/badge';
|
|
29
31
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
30
32
|
import { MatChipsModule } from '@angular/material/chips';
|
|
31
33
|
import { MatNativeDateModule } from '@angular/material/core';
|
|
32
34
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
33
|
-
import * as i1$
|
|
35
|
+
import * as i1$3 from '@angular/material/dialog';
|
|
34
36
|
import { MatDialogModule, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
35
|
-
import * as i4$
|
|
37
|
+
import * as i4$2 from '@angular/material/input';
|
|
36
38
|
import { MatInputModule } from '@angular/material/input';
|
|
37
39
|
import { MatListModule } from '@angular/material/list';
|
|
38
40
|
import { MatMenuModule } from '@angular/material/menu';
|
|
39
41
|
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
40
42
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
41
|
-
import * as i5$
|
|
43
|
+
import * as i5$2 from '@angular/material/select';
|
|
42
44
|
import { MatSelectModule } from '@angular/material/select';
|
|
43
45
|
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
44
46
|
import { MatSliderModule } from '@angular/material/slider';
|
|
45
47
|
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
46
48
|
import { MatTableModule } from '@angular/material/table';
|
|
47
49
|
import { MatTabsModule } from '@angular/material/tabs';
|
|
48
|
-
import * as i1$2 from '@ngx-formly/core';
|
|
49
|
-
import { FormlyModule } from '@ngx-formly/core';
|
|
50
50
|
import { FieldType, FormlyMaterialModule } from '@ngx-formly/material';
|
|
51
51
|
import { FormlySelectModule } from '@ngx-formly/core/select';
|
|
52
52
|
import { AvatarModule } from 'ngx-avatars';
|
|
53
53
|
import { FormlyMatDatepickerModule } from '@ngx-formly/material/datepicker';
|
|
54
|
-
import * as i1$
|
|
54
|
+
import * as i1$2 from '@angular/platform-browser';
|
|
55
55
|
import { webSocket } from 'rxjs/webSocket';
|
|
56
56
|
|
|
57
57
|
/**
|
|
@@ -709,7 +709,7 @@ class WebcamComponent extends BaseComponent {
|
|
|
709
709
|
console.warn('[VIDEO] destroyed');
|
|
710
710
|
}
|
|
711
711
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: WebcamComponent, deps: [{ token: i1.BreakpointObserver }, { token: i2.Platform }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: NgxScandocCameraProvider }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
712
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: WebcamComponent, isStandalone: false, selector: "ngx-scandoc-webcam", inputs: { imageHandler: "imageHandler", type: "type", trigger: "trigger", refresh: "refresh" }, outputs: { cameraSwitched: "cameraSwitched", videoReady: "videoReady", imageCapture: "imageCapture", initError: "initError" }, host: { listeners: { "window:resize": "onResize($event)" } }, viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true, static: true }, { propertyName: "videoRef", first: true, predicate: ["video"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"webcam-wrapper\">\n <video #video autoplay muted style=\"display: block\" playsinline></video>\n\n <div class=\"rectangle\">\n <canvas\n #canvas\n [ngStyle]=\"{ visibility: showVideo ? 'visible' : 'hidden' }\"\n [width]=\"video.offsetWidth\"\n [height]=\"video.offsetHeight\"\n ></canvas>\n </div>\n\n\n</div>\n", styles: [":host{display:flex;flex-direction:row;flex:1;transform:transale3d(0,0,0);background-color:#000;overflow:hidden}.webcam-wrapper{display:flex;overflow:hidden;flex-direction:row;flex:1;position:relative}.webcam-wrapper video{overflow:hidden;flex:1;object-fit:contain}.webcam-wrapper canvas{transform:translateZ(0);display:block;position:absolute;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:
|
|
712
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: WebcamComponent, isStandalone: false, selector: "ngx-scandoc-webcam", inputs: { imageHandler: "imageHandler", type: "type", trigger: "trigger", refresh: "refresh" }, outputs: { cameraSwitched: "cameraSwitched", videoReady: "videoReady", imageCapture: "imageCapture", initError: "initError" }, host: { listeners: { "window:resize": "onResize($event)" } }, viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true, static: true }, { propertyName: "videoRef", first: true, predicate: ["video"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"webcam-wrapper\">\n <video #video autoplay muted style=\"display: block\" playsinline></video>\n\n <div class=\"rectangle\">\n <canvas\n #canvas\n [ngStyle]=\"{ visibility: showVideo ? 'visible' : 'hidden' }\"\n [width]=\"video.offsetWidth\"\n [height]=\"video.offsetHeight\"\n ></canvas>\n </div>\n\n\n</div>\n", styles: [":host{display:flex;flex-direction:row;flex:1;transform:transale3d(0,0,0);background-color:#000;overflow:hidden}.webcam-wrapper{display:flex;overflow:hidden;flex-direction:row;flex:1;position:relative}.webcam-wrapper video{overflow:hidden;flex:1;object-fit:contain}.webcam-wrapper canvas{transform:translateZ(0);display:block;position:absolute;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: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
713
713
|
}
|
|
714
714
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: WebcamComponent, decorators: [{
|
|
715
715
|
type: Component,
|
|
@@ -765,9 +765,140 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
765
765
|
}]
|
|
766
766
|
}] });
|
|
767
767
|
|
|
768
|
+
class LayoutProvider {
|
|
769
|
+
constructor(breakpointObserver, platform) {
|
|
770
|
+
this.breakpointObserver = breakpointObserver;
|
|
771
|
+
this.platform = platform;
|
|
772
|
+
this.isMobile = false;
|
|
773
|
+
this.breakpoint$ = this.breakpointObserver
|
|
774
|
+
.observe(['(min-width: 768px)'])
|
|
775
|
+
.pipe(tap((value) => console.log(value)), distinctUntilChanged());
|
|
776
|
+
}
|
|
777
|
+
init() {
|
|
778
|
+
this.breakpoint$.subscribe((v) => {
|
|
779
|
+
this.isMobile = !v.matches || this.platform.IOS || this.platform.ANDROID;
|
|
780
|
+
document.body.className = this.isMobile ? 'mobile' : 'desktop';
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LayoutProvider, deps: [{ token: i1.BreakpointObserver }, { token: i2.Platform }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
784
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LayoutProvider, providedIn: 'root' }); }
|
|
785
|
+
}
|
|
786
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LayoutProvider, decorators: [{
|
|
787
|
+
type: Injectable,
|
|
788
|
+
args: [{
|
|
789
|
+
providedIn: 'root',
|
|
790
|
+
}]
|
|
791
|
+
}], ctorParameters: () => [{ type: i1.BreakpointObserver }, { type: i2.Platform }] });
|
|
792
|
+
|
|
768
793
|
const AUTH_CONFIG_TOKEN = new InjectionToken('configAuth');
|
|
769
794
|
const SCAN_CONFIG_TOKEN = new InjectionToken('scanConfig');
|
|
770
795
|
|
|
796
|
+
class NgxScandocAuthProvider {
|
|
797
|
+
constructor(http, injector) {
|
|
798
|
+
this.http = http;
|
|
799
|
+
this.injector = injector;
|
|
800
|
+
this.token = '';
|
|
801
|
+
this.refresh_token = '';
|
|
802
|
+
this.tokenTimestamps = {
|
|
803
|
+
Time: 0,
|
|
804
|
+
Client: 0,
|
|
805
|
+
SubClient: 0,
|
|
806
|
+
};
|
|
807
|
+
this.config = this.injector.get(AUTH_CONFIG_TOKEN);
|
|
808
|
+
}
|
|
809
|
+
setSubClient(name) {
|
|
810
|
+
this.subClient = name;
|
|
811
|
+
}
|
|
812
|
+
setConfig() { }
|
|
813
|
+
get tokenExpired() {
|
|
814
|
+
if (this.token == '' || this.tokenTimestamps.Time === 0) {
|
|
815
|
+
console.log('EXPIRED');
|
|
816
|
+
return true;
|
|
817
|
+
}
|
|
818
|
+
const { Time } = this.tokenTimestamps;
|
|
819
|
+
const tokenDate = moment(Time);
|
|
820
|
+
const isValid = moment(tokenDate).isBefore(moment().add(5, 'minutes'));
|
|
821
|
+
return !isValid;
|
|
822
|
+
}
|
|
823
|
+
resetToken() {
|
|
824
|
+
// this.token = '';
|
|
825
|
+
}
|
|
826
|
+
get accesToken() {
|
|
827
|
+
return this.tokenExpired ? this.fetchToken() : of(this.token);
|
|
828
|
+
}
|
|
829
|
+
fetchToken() {
|
|
830
|
+
if (this.token && this.refresh_token) {
|
|
831
|
+
return this.refreshToken();
|
|
832
|
+
}
|
|
833
|
+
return this.getToken();
|
|
834
|
+
}
|
|
835
|
+
refreshToken() {
|
|
836
|
+
const { path, refresh } = this.config;
|
|
837
|
+
return this.http
|
|
838
|
+
.post(`${path}${refresh}`, {
|
|
839
|
+
refresh_token: this.refresh_token,
|
|
840
|
+
})
|
|
841
|
+
.pipe(tap$1((token) => {
|
|
842
|
+
// console.log(this.token);
|
|
843
|
+
this.token = token.access_token;
|
|
844
|
+
this.updateToken();
|
|
845
|
+
// this.token = token.access_token;
|
|
846
|
+
// console.log('TOKEN', this.token);
|
|
847
|
+
// this.refresh_token = token.refresh_token;
|
|
848
|
+
// const decoded: any = jwt_decode(this.token);
|
|
849
|
+
// console.log(decoded);
|
|
850
|
+
// const { Time, Client, SubClient } = decoded;
|
|
851
|
+
// this.tokenTimestamps = { Time, Client, SubClient };
|
|
852
|
+
}), map((data) => data.access_token));
|
|
853
|
+
}
|
|
854
|
+
get user_key() {
|
|
855
|
+
return this.config.clientId;
|
|
856
|
+
}
|
|
857
|
+
get sub_client() {
|
|
858
|
+
return this.config.tokenName ? this.config.tokenName : this.subClient;
|
|
859
|
+
}
|
|
860
|
+
updateToken() {
|
|
861
|
+
const decoded = jwtDecode(this.token);
|
|
862
|
+
const { Time, Client, SubClient } = decoded;
|
|
863
|
+
this.tokenTimestamps = { Time, Client, SubClient };
|
|
864
|
+
}
|
|
865
|
+
getToken() {
|
|
866
|
+
console.log('FETCH TOKEN');
|
|
867
|
+
const { path, login, version, clientId, tokenName } = this.config;
|
|
868
|
+
if (version == 'v1') {
|
|
869
|
+
return this.http
|
|
870
|
+
.post(`${path}`, {
|
|
871
|
+
clientId: clientId,
|
|
872
|
+
token: tokenName,
|
|
873
|
+
})
|
|
874
|
+
.pipe(map((data) => data.accessToken), tap$1((token) => {
|
|
875
|
+
this.token = token;
|
|
876
|
+
const decoded = jwtDecode(this.token);
|
|
877
|
+
const { iat, exp } = decoded;
|
|
878
|
+
this.tokenTimestamps = { iat, exp, Time: 0 };
|
|
879
|
+
}));
|
|
880
|
+
}
|
|
881
|
+
return this.http
|
|
882
|
+
.post(`${path}${login}`, {
|
|
883
|
+
user_key: this.user_key,
|
|
884
|
+
sub_client: this.sub_client,
|
|
885
|
+
})
|
|
886
|
+
.pipe(tap$1((token) => {
|
|
887
|
+
this.token = token.access_token;
|
|
888
|
+
this.refresh_token = token.refresh_token;
|
|
889
|
+
this.updateToken();
|
|
890
|
+
}), map((data) => data.access_token));
|
|
891
|
+
}
|
|
892
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScandocAuthProvider, deps: [{ token: i1$1.HttpClient }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
893
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScandocAuthProvider, providedIn: 'root' }); }
|
|
894
|
+
}
|
|
895
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScandocAuthProvider, decorators: [{
|
|
896
|
+
type: Injectable,
|
|
897
|
+
args: [{
|
|
898
|
+
providedIn: 'root',
|
|
899
|
+
}]
|
|
900
|
+
}], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i0.Injector }] });
|
|
901
|
+
|
|
771
902
|
class ScanProvider {
|
|
772
903
|
constructor(http, injector) {
|
|
773
904
|
this.http = http;
|
|
@@ -1516,1664 +1647,184 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1516
1647
|
}]
|
|
1517
1648
|
}], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i0.Injector }] });
|
|
1518
1649
|
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
this.
|
|
1525
|
-
.observe(['(min-width: 768px)'])
|
|
1526
|
-
.pipe(tap((value) => console.log(value)), distinctUntilChanged());
|
|
1527
|
-
}
|
|
1528
|
-
init() {
|
|
1529
|
-
this.breakpoint$.subscribe((v) => {
|
|
1530
|
-
this.isMobile = !v.matches || this.platform.IOS || this.platform.ANDROID;
|
|
1531
|
-
document.body.className = this.isMobile ? 'mobile' : 'desktop';
|
|
1532
|
-
});
|
|
1533
|
-
}
|
|
1534
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LayoutProvider, deps: [{ token: i1.BreakpointObserver }, { token: i2.Platform }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1535
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LayoutProvider, providedIn: 'root' }); }
|
|
1536
|
-
}
|
|
1537
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LayoutProvider, decorators: [{
|
|
1538
|
-
type: Injectable,
|
|
1539
|
-
args: [{
|
|
1540
|
-
providedIn: 'root',
|
|
1541
|
-
}]
|
|
1542
|
-
}], ctorParameters: () => [{ type: i1.BreakpointObserver }, { type: i2.Platform }] });
|
|
1543
|
-
|
|
1544
|
-
class NgxScandocAuthProvider {
|
|
1545
|
-
constructor(http, injector) {
|
|
1546
|
-
this.http = http;
|
|
1650
|
+
const TRANSLATION_PROVIDER = new InjectionToken('Injection token for translation providers.');
|
|
1651
|
+
class NgxScanDocTranslationProvider {
|
|
1652
|
+
constructor(translate, injector,
|
|
1653
|
+
//@Optional() @Inject(SCAN_CONFIG_TOKEN) config: ScanConfig,
|
|
1654
|
+
providers, platformLocation) {
|
|
1655
|
+
this.translate = translate;
|
|
1547
1656
|
this.injector = injector;
|
|
1548
|
-
this.
|
|
1549
|
-
|
|
1550
|
-
this.
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
setSubClient(name) {
|
|
1558
|
-
this.subClient = name;
|
|
1559
|
-
}
|
|
1560
|
-
setConfig() { }
|
|
1561
|
-
get tokenExpired() {
|
|
1562
|
-
if (this.token == '' || this.tokenTimestamps.Time === 0) {
|
|
1563
|
-
console.log('EXPIRED');
|
|
1564
|
-
return true;
|
|
1657
|
+
this.platformLocation = platformLocation;
|
|
1658
|
+
console.log('MM', Math.random());
|
|
1659
|
+
this.customLoader = this.translate.currentLoader;
|
|
1660
|
+
//console.log('config',config)
|
|
1661
|
+
// console.log(this.translate)
|
|
1662
|
+
if (providers && providers.length > 0) {
|
|
1663
|
+
for (const provider of providers) {
|
|
1664
|
+
this.addTranslationFolder(provider.name, provider.source);
|
|
1665
|
+
}
|
|
1565
1666
|
}
|
|
1566
|
-
const { Time } = this.tokenTimestamps;
|
|
1567
|
-
const tokenDate = moment(Time);
|
|
1568
|
-
const isValid = moment(tokenDate).isBefore(moment().add(5, 'minutes'));
|
|
1569
|
-
return !isValid;
|
|
1570
1667
|
}
|
|
1571
|
-
|
|
1572
|
-
|
|
1668
|
+
path(path) {
|
|
1669
|
+
return path;
|
|
1670
|
+
// const baseHref = this.platformLocation
|
|
1671
|
+
// .getBaseHrefFromDOM()
|
|
1672
|
+
// .split('/')
|
|
1673
|
+
// .join('');
|
|
1674
|
+
// return baseHref != '' ? `/${baseHref}${path}` : path;
|
|
1573
1675
|
}
|
|
1574
|
-
|
|
1575
|
-
|
|
1676
|
+
setDefaultLang(lang) {
|
|
1677
|
+
this.defaultLang = lang;
|
|
1678
|
+
this.translate.setDefaultLang(this.defaultLang);
|
|
1576
1679
|
}
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1680
|
+
registerTranslationFolder(name = '', path = '') {
|
|
1681
|
+
console.log(name, path, this.userLang, this.defaultLang);
|
|
1682
|
+
if (!this.customLoader.providerRegistered(name)) {
|
|
1683
|
+
this.customLoader.registerProvider(name, this.path(path));
|
|
1580
1684
|
}
|
|
1581
|
-
return this.getToken();
|
|
1582
|
-
}
|
|
1583
|
-
refreshToken() {
|
|
1584
|
-
const { path, refresh } = this.config;
|
|
1585
|
-
return this.http
|
|
1586
|
-
.post(`${path}${refresh}`, {
|
|
1587
|
-
refresh_token: this.refresh_token,
|
|
1588
|
-
})
|
|
1589
|
-
.pipe(tap$1((token) => {
|
|
1590
|
-
// console.log(this.token);
|
|
1591
|
-
this.token = token.access_token;
|
|
1592
|
-
this.updateToken();
|
|
1593
|
-
// this.token = token.access_token;
|
|
1594
|
-
// console.log('TOKEN', this.token);
|
|
1595
|
-
// this.refresh_token = token.refresh_token;
|
|
1596
|
-
// const decoded: any = jwt_decode(this.token);
|
|
1597
|
-
// console.log(decoded);
|
|
1598
|
-
// const { Time, Client, SubClient } = decoded;
|
|
1599
|
-
// this.tokenTimestamps = { Time, Client, SubClient };
|
|
1600
|
-
}), map((data) => data.access_token));
|
|
1601
1685
|
}
|
|
1602
|
-
|
|
1603
|
-
|
|
1686
|
+
addTranslationFolder(name = '', path = '') {
|
|
1687
|
+
console.log(name, path, this.userLang, this.defaultLang);
|
|
1688
|
+
if (!this.customLoader.providerRegistered(name)) {
|
|
1689
|
+
this.customLoader.registerProvider(name, this.path(path));
|
|
1690
|
+
if (this.userLang) {
|
|
1691
|
+
const existCurrentLang = this.translate.currentLang ? true : false;
|
|
1692
|
+
this.loadTranslation(this.userLang, this.defaultLang, !existCurrentLang);
|
|
1693
|
+
}
|
|
1694
|
+
else {
|
|
1695
|
+
this.loadTranslation(this.defaultLang);
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1604
1698
|
}
|
|
1605
|
-
|
|
1606
|
-
|
|
1699
|
+
loadTranslation(lang, fallback, useLang = true) {
|
|
1700
|
+
this.translate.getTranslation(lang).subscribe((resp) => {
|
|
1701
|
+
this.onTranslationChanged(lang);
|
|
1702
|
+
if (useLang) {
|
|
1703
|
+
setTimeout(() => {
|
|
1704
|
+
this.translate.use(lang);
|
|
1705
|
+
}, 20);
|
|
1706
|
+
}
|
|
1707
|
+
// this.translate.reloadLang(lang)
|
|
1708
|
+
}, () => {
|
|
1709
|
+
if (fallback && fallback !== lang) {
|
|
1710
|
+
this.loadTranslation(fallback);
|
|
1711
|
+
}
|
|
1712
|
+
});
|
|
1607
1713
|
}
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1714
|
+
updateTranslation(lang, fallback) {
|
|
1715
|
+
return this.translate.getTranslation(lang).pipe(catchError(() => {
|
|
1716
|
+
if (fallback && fallback !== lang) {
|
|
1717
|
+
return this.updateTranslation(fallback);
|
|
1718
|
+
}
|
|
1719
|
+
return this.translate.use(lang);
|
|
1720
|
+
}), switchMap(() => {
|
|
1721
|
+
this.onTranslationChanged(lang);
|
|
1722
|
+
return this.translate.use(lang);
|
|
1723
|
+
}));
|
|
1612
1724
|
}
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
this.tokenTimestamps = { iat, exp, Time: 0 };
|
|
1627
|
-
}));
|
|
1725
|
+
onTranslationChanged(lang) {
|
|
1726
|
+
this.translate.onTranslationChange.next({
|
|
1727
|
+
lang,
|
|
1728
|
+
translations: this.customLoader.getFullTranslationJSON(lang),
|
|
1729
|
+
});
|
|
1730
|
+
}
|
|
1731
|
+
use(lang) {
|
|
1732
|
+
this.customLoader.init(lang);
|
|
1733
|
+
return this.updateTranslation(lang);
|
|
1734
|
+
}
|
|
1735
|
+
forms(item, namespace = null) {
|
|
1736
|
+
if (item.fieldGroup) {
|
|
1737
|
+
item.fieldGroup = item.fieldGroup.map((field) => this.forms(field));
|
|
1628
1738
|
}
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1739
|
+
const prefix = namespace ? namespace + '.' : '';
|
|
1740
|
+
if (item.props &&
|
|
1741
|
+
(item.props.label || item.props.placeholder || item.props.options)) {
|
|
1742
|
+
if (!item.expressions) {
|
|
1743
|
+
item.expressions = {};
|
|
1744
|
+
}
|
|
1745
|
+
if (item.props.label) {
|
|
1746
|
+
item.expressions['props.label'] = this.translate.stream(prefix + item.props.label);
|
|
1747
|
+
}
|
|
1748
|
+
if (item.props.placeholder) {
|
|
1749
|
+
item.expressions['props.placeholder'] = this.translate.stream(prefix + item.props.placeholder);
|
|
1750
|
+
}
|
|
1751
|
+
if (Array.isArray(item.props.options)) {
|
|
1752
|
+
item.expressions['props.options'] = item.props.options.map((m) => {
|
|
1753
|
+
// console.log(m);
|
|
1754
|
+
if (m.label) {
|
|
1755
|
+
m.label = this.translate.instant(prefix + m.label);
|
|
1756
|
+
}
|
|
1757
|
+
return m;
|
|
1758
|
+
});
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
return item;
|
|
1639
1762
|
}
|
|
1640
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
1641
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
1763
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScanDocTranslationProvider, deps: [{ token: i6.TranslateService }, { token: i0.Injector }, { token: TRANSLATION_PROVIDER, optional: true }, { token: i2$1.PlatformLocation }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1764
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScanDocTranslationProvider, providedIn: 'root' }); }
|
|
1642
1765
|
}
|
|
1643
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
1766
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScanDocTranslationProvider, decorators: [{
|
|
1644
1767
|
type: Injectable,
|
|
1645
1768
|
args: [{
|
|
1646
1769
|
providedIn: 'root',
|
|
1647
1770
|
}]
|
|
1648
|
-
}], ctorParameters: () => [{ type:
|
|
1771
|
+
}], ctorParameters: () => [{ type: i6.TranslateService }, { type: i0.Injector }, { type: undefined, decorators: [{
|
|
1772
|
+
type: Optional
|
|
1773
|
+
}, {
|
|
1774
|
+
type: Inject,
|
|
1775
|
+
args: [TRANSLATION_PROVIDER]
|
|
1776
|
+
}] }, { type: i2$1.PlatformLocation }] });
|
|
1649
1777
|
|
|
1650
|
-
class
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
if (this.wraper) {
|
|
1656
|
-
this.width = this.wraper.nativeElement.clientWidth;
|
|
1657
|
-
this.height = this.wraper.nativeElement.clientHeight;
|
|
1658
|
-
setTimeout(() => {
|
|
1659
|
-
const video = this.wraper?.nativeElement.querySelector('video');
|
|
1660
|
-
if (video) {
|
|
1661
|
-
// console.log(video.clientWidth, video.clientHeight);
|
|
1662
|
-
this.videoWidth = video.clientWidth;
|
|
1663
|
-
this.videoHeight = video.clientHeight;
|
|
1664
|
-
}
|
|
1665
|
-
this.cd.detectChanges();
|
|
1666
|
-
}, 100);
|
|
1667
|
-
this.cd.detectChanges();
|
|
1668
|
-
}
|
|
1778
|
+
class NgxScandocFieldsProvider {
|
|
1779
|
+
constructor(translate, provider) {
|
|
1780
|
+
this.translate = translate;
|
|
1781
|
+
this.provider = provider;
|
|
1782
|
+
this.selfie$ = new Subject();
|
|
1669
1783
|
}
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
this.cameraProvider = cameraProvider;
|
|
1673
|
-
this.cd = cd;
|
|
1674
|
-
this.layoutProvider = layoutProvider;
|
|
1675
|
-
this.zone = zone;
|
|
1676
|
-
this.action = new EventEmitter();
|
|
1677
|
-
this.videoOptions = {
|
|
1678
|
-
width: 1920,
|
|
1679
|
-
height: 1080,
|
|
1680
|
-
facingMode: 'environment',
|
|
1681
|
-
};
|
|
1682
|
-
this.cameraReady = false;
|
|
1683
|
-
this.scanBlastData = [
|
|
1684
|
-
{
|
|
1685
|
-
title: 'scandoc.front',
|
|
1686
|
-
description: 'scandoc.frontDescription',
|
|
1687
|
-
side: 'FRONT',
|
|
1688
|
-
},
|
|
1784
|
+
update() {
|
|
1785
|
+
return [
|
|
1689
1786
|
{
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1787
|
+
fieldGroupClassName: 'px-16',
|
|
1788
|
+
fieldGroup: [
|
|
1789
|
+
{
|
|
1790
|
+
wrappers: [],
|
|
1791
|
+
type: 'checkbox',
|
|
1792
|
+
key: 'profile',
|
|
1793
|
+
class: 'checkbox ',
|
|
1794
|
+
defaultValue: true,
|
|
1795
|
+
props: {
|
|
1796
|
+
label: 'scandoc.form.scan.document.update.profile',
|
|
1797
|
+
},
|
|
1798
|
+
},
|
|
1799
|
+
{
|
|
1800
|
+
wrappers: [],
|
|
1801
|
+
type: 'checkbox',
|
|
1802
|
+
class: 'checkbox ',
|
|
1803
|
+
key: 'document',
|
|
1804
|
+
defaultValue: true,
|
|
1805
|
+
props: {
|
|
1806
|
+
label: 'scandoc.form.scan.document.update.document',
|
|
1807
|
+
},
|
|
1808
|
+
},
|
|
1809
|
+
{
|
|
1810
|
+
wrappers: [],
|
|
1811
|
+
type: 'checkbox',
|
|
1812
|
+
class: 'checkbox ',
|
|
1813
|
+
key: 'attachment',
|
|
1814
|
+
defaultValue: true,
|
|
1815
|
+
props: {
|
|
1816
|
+
label: 'scandoc.form.scan.document.update.attachment',
|
|
1817
|
+
},
|
|
1818
|
+
},
|
|
1819
|
+
].map((item) => this.translate.forms(item)),
|
|
1694
1820
|
},
|
|
1695
1821
|
];
|
|
1696
|
-
this.error = false;
|
|
1697
|
-
this.scaning = false;
|
|
1698
|
-
this.documentTypeSelected = false;
|
|
1699
|
-
this.preview = null;
|
|
1700
|
-
this.scanDatas = [];
|
|
1701
|
-
this.trigger = new Subject();
|
|
1702
|
-
// switch to next / previous / specific webcam; true/false: forward/backwards, string: deviceId
|
|
1703
|
-
this.nextWebcam = new Subject();
|
|
1704
|
-
this.isMobile = false;
|
|
1705
1822
|
}
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
this.
|
|
1709
|
-
this.isMobile = !v.matches;
|
|
1710
|
-
setTimeout(() => {
|
|
1711
|
-
console.log('WTF');
|
|
1712
|
-
this.cd.detectChanges();
|
|
1713
|
-
}, 200);
|
|
1714
|
-
});
|
|
1715
|
-
console.log('MNOBILE', this.isMobile);
|
|
1716
|
-
});
|
|
1717
|
-
}
|
|
1718
|
-
get nextWebcamObservable() {
|
|
1719
|
-
return this.nextWebcam.asObservable();
|
|
1720
|
-
}
|
|
1721
|
-
cameraWasSwitched(deviceId) {
|
|
1722
|
-
console.log('[active device]', deviceId);
|
|
1723
|
-
// this.deviceId = deviceId;
|
|
1724
|
-
// this.cameraReady = true;
|
|
1725
|
-
// this.defaultDevice = deviceId;
|
|
1726
|
-
setTimeout(() => {
|
|
1727
|
-
this.onResize();
|
|
1728
|
-
// this.scan();
|
|
1729
|
-
}, 300);
|
|
1730
|
-
}
|
|
1731
|
-
handleInitError(error) {
|
|
1732
|
-
console.log(error);
|
|
1733
|
-
}
|
|
1734
|
-
resolutionLimit(file) {
|
|
1735
|
-
const minWidth = 1280;
|
|
1736
|
-
const minHeight = 720;
|
|
1737
|
-
return new Observable((observer) => {
|
|
1738
|
-
const img = new Image();
|
|
1739
|
-
img.src = window.URL.createObjectURL(file);
|
|
1740
|
-
img.onload = () => {
|
|
1741
|
-
const width = img.naturalWidth;
|
|
1742
|
-
const height = img.naturalHeight;
|
|
1743
|
-
let valid = false;
|
|
1744
|
-
if (width > height) {
|
|
1745
|
-
valid = width >= minWidth && height >= minHeight;
|
|
1746
|
-
}
|
|
1747
|
-
else {
|
|
1748
|
-
valid = width >= minHeight && height >= minWidth;
|
|
1749
|
-
}
|
|
1750
|
-
observer.next(valid);
|
|
1751
|
-
};
|
|
1752
|
-
img.onerror = (error) => {
|
|
1753
|
-
observer.error(error);
|
|
1754
|
-
};
|
|
1755
|
-
});
|
|
1756
|
-
}
|
|
1757
|
-
getImgBase64(num) {
|
|
1758
|
-
return this.scanBlastData[num].image.dataUrl.split(',')[1];
|
|
1759
|
-
}
|
|
1760
|
-
getBase64(file) {
|
|
1761
|
-
return new Observable((observer) => {
|
|
1762
|
-
const reader = new FileReader();
|
|
1763
|
-
reader.readAsDataURL(file);
|
|
1764
|
-
reader.onload = () => {
|
|
1765
|
-
observer.next(reader.result);
|
|
1766
|
-
};
|
|
1767
|
-
reader.onerror = (error) => {
|
|
1768
|
-
observer.error(error);
|
|
1769
|
-
};
|
|
1770
|
-
});
|
|
1771
|
-
}
|
|
1772
|
-
handleFileInput(target, event, side) {
|
|
1773
|
-
const files = target.files;
|
|
1774
|
-
this.selectedSide = side;
|
|
1775
|
-
console.log(files);
|
|
1776
|
-
const file = files.item(0);
|
|
1777
|
-
this.resolutionLimit(file)
|
|
1778
|
-
.pipe(switchMap$1((valid) => {
|
|
1779
|
-
return valid ? this.getBase64(file) : of(false);
|
|
1780
|
-
}))
|
|
1781
|
-
.subscribe((imageAsDataUrl) => {
|
|
1782
|
-
// console.log(imageAsDataUrl);
|
|
1783
|
-
event.target.value = null;
|
|
1784
|
-
if (!imageAsDataUrl) {
|
|
1785
|
-
console.warn('MIN RES');
|
|
1786
|
-
// this.dialogs.alert(
|
|
1787
|
-
// 'core.page.error',
|
|
1788
|
-
// this.translate.instant(
|
|
1789
|
-
// 'pms.dialogs.components.scanProfile.minResolution'
|
|
1790
|
-
// )
|
|
1791
|
-
// );
|
|
1792
|
-
}
|
|
1793
|
-
else {
|
|
1794
|
-
side.image = {
|
|
1795
|
-
_imageAsDataUrl: imageAsDataUrl,
|
|
1796
|
-
imageAsDataUrl: imageAsDataUrl,
|
|
1797
|
-
};
|
|
1798
|
-
if (this.selectedSide.side === 'FRONT') {
|
|
1799
|
-
this.scanBlastData[1].disabled = false;
|
|
1800
|
-
}
|
|
1801
|
-
}
|
|
1802
|
-
this.cd.detectChanges();
|
|
1803
|
-
});
|
|
1804
|
-
}
|
|
1805
|
-
cameraOff(ev) { }
|
|
1806
|
-
ngOnDestroy() { }
|
|
1807
|
-
singleScan(side) {
|
|
1808
|
-
this.scanType = side.side;
|
|
1809
|
-
this.preview = null;
|
|
1810
|
-
this.selectedSide = side;
|
|
1811
|
-
this.selectedSide.image = null;
|
|
1812
|
-
this.documentTypeSelected = true;
|
|
1813
|
-
this.scanBlastData[1].disabled = false;
|
|
1814
|
-
this.cameraProvider.$showSwitch.next(true);
|
|
1815
|
-
this.cd.detectChanges();
|
|
1816
|
-
setTimeout(() => {
|
|
1817
|
-
this.onResize();
|
|
1818
|
-
}, 10);
|
|
1819
|
-
}
|
|
1820
|
-
scanBlastFinish() {
|
|
1821
|
-
this.action.emit(this.scanBlastData);
|
|
1822
|
-
}
|
|
1823
|
-
get scanBlastCanUpload() {
|
|
1824
|
-
return this.scanBlastData[0].image ? true : false;
|
|
1825
|
-
}
|
|
1826
|
-
handleImage(webcamImage) {
|
|
1827
|
-
console.log('[received webcam image]', webcamImage);
|
|
1828
|
-
this.webcamImage = webcamImage;
|
|
1829
|
-
this.preview = webcamImage.imageAsDataUrl;
|
|
1830
|
-
this.cameraProvider.$showSwitch.next(false);
|
|
1831
|
-
this.cd.detectChanges();
|
|
1832
|
-
}
|
|
1833
|
-
continue() {
|
|
1834
|
-
this.documentTypeSelected = false;
|
|
1835
|
-
setTimeout(() => {
|
|
1836
|
-
this.selectedSide.image = this.webcamImage;
|
|
1837
|
-
if (this.selectedSide.side === 'FRONT') {
|
|
1838
|
-
this.scanBlastData[1].disabled = false;
|
|
1839
|
-
}
|
|
1840
|
-
this.cd.detectChanges();
|
|
1841
|
-
}, 200);
|
|
1842
|
-
}
|
|
1843
|
-
retry() {
|
|
1844
|
-
this.preview = false;
|
|
1845
|
-
this.cameraProvider.$showSwitch.next(true);
|
|
1846
|
-
// this.result = false;
|
|
1847
|
-
if (this.error) {
|
|
1848
|
-
this.documentTypeSelected = false;
|
|
1849
|
-
this.scanBlastData.forEach((element) => {
|
|
1850
|
-
element.image = null;
|
|
1851
|
-
});
|
|
1852
|
-
}
|
|
1853
|
-
this.error = false;
|
|
1854
|
-
}
|
|
1855
|
-
triggerSnapshot() {
|
|
1856
|
-
this.trigger.next(0);
|
|
1857
|
-
}
|
|
1858
|
-
scan() {
|
|
1859
|
-
console.log('SCAN');
|
|
1860
|
-
this.triggerSnapshot();
|
|
1861
|
-
this.scanDatas[0] = true;
|
|
1862
|
-
console.log(this.cameraProvider);
|
|
1863
|
-
this.cd.detectChanges();
|
|
1864
|
-
}
|
|
1865
|
-
rotateBase64Image(base64data) {
|
|
1866
|
-
return new Observable((observer) => {
|
|
1867
|
-
const canvas = document.createElement('canvas');
|
|
1868
|
-
const ctx = canvas.getContext('2d');
|
|
1869
|
-
var image = new Image();
|
|
1870
|
-
image.src = base64data;
|
|
1871
|
-
image.onload = () => {
|
|
1872
|
-
console.log(canvas);
|
|
1873
|
-
canvas.width = image.height;
|
|
1874
|
-
canvas.height = image.width;
|
|
1875
|
-
if (ctx) {
|
|
1876
|
-
ctx.rotate((90 * Math.PI) / 180);
|
|
1877
|
-
ctx.translate(0, -canvas.width);
|
|
1878
|
-
ctx.drawImage(image, 0, 0);
|
|
1879
|
-
observer.next(canvas.toDataURL());
|
|
1880
|
-
}
|
|
1881
|
-
else {
|
|
1882
|
-
observer.error({ type: 'generic error' });
|
|
1883
|
-
}
|
|
1884
|
-
};
|
|
1885
|
-
image.onerror = (e) => {
|
|
1886
|
-
observer.error(e);
|
|
1887
|
-
};
|
|
1888
|
-
});
|
|
1889
|
-
}
|
|
1890
|
-
singleScanRotate(side) {
|
|
1891
|
-
console.log(side);
|
|
1892
|
-
this.rotateBase64Image(side.image.imageAsDataUrl).subscribe((data) => {
|
|
1893
|
-
side.image = { imageAsDataUrl: data };
|
|
1894
|
-
this.cd.detectChanges();
|
|
1895
|
-
});
|
|
1896
|
-
}
|
|
1897
|
-
videoReady(event) {
|
|
1898
|
-
console.log('READY', event);
|
|
1899
|
-
this.cameraReady = event;
|
|
1900
|
-
}
|
|
1901
|
-
singleScanRemove(side) {
|
|
1902
|
-
side.image = null;
|
|
1903
|
-
if (side.side === 'FRONT') {
|
|
1904
|
-
this.scanBlastData[1].disabled = true;
|
|
1905
|
-
}
|
|
1906
|
-
this.cd.detectChanges();
|
|
1907
|
-
}
|
|
1908
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ManualScanComponent, deps: [{ token: NgxScandocCameraProvider }, { token: i0.ChangeDetectorRef }, { token: LayoutProvider }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1909
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ManualScanComponent, isStandalone: false, selector: "ngx-manual-scan", outputs: { action: "action" }, 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: "\n\n<ng-container *ngIf=\"!result\">\n\n<ng-container *ngIf=\"!documentTypeSelected\">\n <section\n class=\"scanBlastWraper\"\n ngClass.lt-md=\"mobile\"\n fxFlex\n fxLayout=\"column\"\n >\n <div class=\"scanBlast\" fxFlex fxLayout.lt-md=\"column\" fxLayout=\"row\">\n <mat-card\n appearance=\"outlined\"\n style=\"display: flex; flex-direction: column\"\n fxLayout=\"column\"\n *ngFor=\"let side of scanBlastData\"\n >\n <div ngClass.lt-sm=\"small\" class=\"head\">\n <div class=\"title\" fxFlex>{{ side.title | translate }}</div>\n </div>\n <div class=\"actions\" style=\"display: flex; flex-direction: row\">\n <button\n (click)=\"singleScan(side)\"\n [disabled]=\"side.disabled\"\n style=\"margin-right: 4px\"\n mat-raised-button\n >\n <div class=\"buttonWrap\">\n <mat-icon>camera</mat-icon>\n <div>\n {{ \"scandoc.scanCamera\" | translate }}\n </div>\n </div>\n </button>\n <button\n (click)=\"file.click()\"\n [disabled]=\"side.disabled\"\n style=\"margin-left: 4px\"\n mat-raised-button\n >\n <input\n accept=\"image/*\"\n type=\"file\"\n style=\"display: none\"\n (change)=\"handleFileInput($event.target, $event, side)\"\n #file\n />\n <div class=\"buttonWrap\">\n <mat-icon>file_upload</mat-icon>\n <div>\n {{ \"scandoc.useFromDisk\" | translate }}\n </div>\n </div>\n </button>\n </div>\n <div class=\"content\" style=\"display: flex\">\n <div style=\"flex: 1\" class=\"previewPlaceholder\">\n <div class=\"description\">\n <ng-container *ngIf=\"side.image\">\n <div class=\"imgWrap\">\n <div\n style=\"flex: 1\"\n class=\"image\"\n [style.background-image]=\"\n 'url(' + side.image.imageAsDataUrl + ')'\n \"\n ></div>\n\n <div\n class=\"btnActions\"\n fxLayout.lt-md=\"column\"\n fxLayout=\"row\"\n style=\"display: flex; flex-direction: row\"\n >\n <button\n (click)=\"singleScanRemove(side)\"\n class=\"mr-4 remButton flex\"\n mat-raised-button\n >\n <div class=\"buttonWrap\">\n <mat-icon>delete</mat-icon>\n <div class=\"label\">\n {{ \"scandoc.remove\" | translate }}\n </div>\n </div>\n </button>\n <button\n class=\"ml-4 rotateButton flex\"\n mat-raised-button\n (click)=\"singleScanRotate(side)\"\n >\n <div class=\"buttonWrap\">\n <mat-icon>rotate_90_degrees_cw</mat-icon>\n <div class=\"label\">\n {{ \"scandoc.rotate\" | translate }}\n </div>\n </div>\n </button>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!side.image\">\n <div class=\"empty\">\n {{ side.description | translate }}\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </mat-card>\n </div>\n <footer>\n <div\n class=\"px-8 pb-8\"\n style=\"padding: 0px 8px 8px 8px; display: flex; flex-direction: row\"\n >\n <button\n (click)=\"scanBlastFinish()\"\n [disabled]=\"!scanBlastCanUpload\"\n style=\"flex: 1\"\n mat-raised-button\n >\n {{ \"scandoc.upload\" | translate }}\n </button>\n </div>\n </footer>\n </section>\n</ng-container>\n\n<div\n style=\"position: relative; display: flex; flex-direction: column; flex: 1\"\n *ngIf=\"documentTypeSelected\"\n>\n <div\n style=\"display: flex; flex-direction: row; flex: 1\"\n #wraper\n class=\"wraper\"\n >\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 <ngx-scandoc-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main flex\"\n\n #webcam\n [trigger]=\"trigger\"\n (imageCapture)=\"handleImage($event)\"\n(videoReady)=\"videoReady($event)\"\n (cameraSwitched)=\"cameraWasSwitched($event)\"\n (initError)=\"handleInitError($event)\"\n type=\"manual\"\n\n (destroyed)=\"cameraOff($event)\"\n >\n </ngx-scandoc-webcam>\n </ng-container>\n <div\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"\n display: flex;\n flex-direction: row;\n flex: 1;\n z-index: 20;\n position: absolute;\n width: 100%;\n height: 100%;\n \"\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 <ul>\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 style=\"display: flex; flex-direction: column; flex: 1\"\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 style=\"flex: 1\"\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 <!-- <div class=\"displayInfo\" *ngIf=\"!preview && cameraReady\">\n {{ displayInfo }}\n </div>\n <div style=\"height: 26px;\">\n <div style=\"text-align: center; font-size: 18px;\" *ngIf=\"idScan && !preview && cameraReady\">\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 \"scandoc.captureFront\" | translate\n }}</ng-container>\n <ng-container *ngIf=\"scanType === 'BACK'\">{{\n \"scandoc.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 style=\"display: flex; flex-direction: row; align-items: center; flex: 1\"\n >\n <button class=\"flex mr-4\" mat-raised-button (click)=\"retry()\">\n {{ \"scandoc.retry\" | translate }}\n </button>\n\n <button\n [disabled]=\"error\"\n class=\"ml-4 flex\"\n mat-raised-button\n (click)=\"continue()\"\n >\n {{ \"scandoc.continueWithSelectedImage\" | translate }}\n </button>\n </div>\n </footer>\n</div>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5}:host.mobile .buttonWrap div{font-size:11px!important}:host.mobile .scanBlastWraper .head{height:30px!important}:host.mobile .scanBlastWraper .head .title{font-size:12px!important}:host.mobile .scanBlastWraper .scanBlast{flex-direction:column}:host.mobile .scanBlastWraper mat-card{margin:4px!important}:host.mobile .scanBlastWraper .description{flex-direction:row!important}:host.mobile .scanBlastWraper .description .imgWrap{padding:0!important}:host.mobile .scanBlastWraper .description .btnActions{position:absolute;right:0}:host.mobile .scanBlastWraper .description button{margin:0!important;position:absolute;right:16px}:host.mobile .scanBlastWraper .description button.rotateButton{top:58px}:host.mobile .scanBlastWraper .description button.remButton{top:8px}:host.mobile .scanBlastWraper .description button mat-icon{margin:0!important}:host.mobile .scanBlastWraper .description button div.label{display:none}.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}.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 .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{overflow:hidden;display:flex;flex-direction:column;flex:1}.scanBlastWraper button{text-transform:uppercase;overflow:hidden}.scanBlastWraper .buttonWrap{display:flex;flex-direction:row;align-items:center;justify-content:center}.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;display:flex;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}.result{display:flex;flex-direction:column}.result .wrap{overflow:auto;flex:1;display:flex;flex-direction:row}.result .wrap .panel{flex:1}.result .wrap form{display:flex;flex-direction:row;padding:0 16px;width:100%}.result .wrap form formly-form{flex:1}.flex{flex:1}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: WebcamComponent, selector: "ngx-scandoc-webcam", inputs: ["imageHandler", "type", "trigger", "refresh"], outputs: ["cameraSwitched", "videoReady", "imageCapture", "initError"] }, { kind: "component", type: i5.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: i5$1.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-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i8.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }] }); }
|
|
1910
|
-
}
|
|
1911
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ManualScanComponent, decorators: [{
|
|
1912
|
-
type: Component,
|
|
1913
|
-
args: [{ selector: 'ngx-manual-scan', standalone: false, template: "\n\n<ng-container *ngIf=\"!result\">\n\n<ng-container *ngIf=\"!documentTypeSelected\">\n <section\n class=\"scanBlastWraper\"\n ngClass.lt-md=\"mobile\"\n fxFlex\n fxLayout=\"column\"\n >\n <div class=\"scanBlast\" fxFlex fxLayout.lt-md=\"column\" fxLayout=\"row\">\n <mat-card\n appearance=\"outlined\"\n style=\"display: flex; flex-direction: column\"\n fxLayout=\"column\"\n *ngFor=\"let side of scanBlastData\"\n >\n <div ngClass.lt-sm=\"small\" class=\"head\">\n <div class=\"title\" fxFlex>{{ side.title | translate }}</div>\n </div>\n <div class=\"actions\" style=\"display: flex; flex-direction: row\">\n <button\n (click)=\"singleScan(side)\"\n [disabled]=\"side.disabled\"\n style=\"margin-right: 4px\"\n mat-raised-button\n >\n <div class=\"buttonWrap\">\n <mat-icon>camera</mat-icon>\n <div>\n {{ \"scandoc.scanCamera\" | translate }}\n </div>\n </div>\n </button>\n <button\n (click)=\"file.click()\"\n [disabled]=\"side.disabled\"\n style=\"margin-left: 4px\"\n mat-raised-button\n >\n <input\n accept=\"image/*\"\n type=\"file\"\n style=\"display: none\"\n (change)=\"handleFileInput($event.target, $event, side)\"\n #file\n />\n <div class=\"buttonWrap\">\n <mat-icon>file_upload</mat-icon>\n <div>\n {{ \"scandoc.useFromDisk\" | translate }}\n </div>\n </div>\n </button>\n </div>\n <div class=\"content\" style=\"display: flex\">\n <div style=\"flex: 1\" class=\"previewPlaceholder\">\n <div class=\"description\">\n <ng-container *ngIf=\"side.image\">\n <div class=\"imgWrap\">\n <div\n style=\"flex: 1\"\n class=\"image\"\n [style.background-image]=\"\n 'url(' + side.image.imageAsDataUrl + ')'\n \"\n ></div>\n\n <div\n class=\"btnActions\"\n fxLayout.lt-md=\"column\"\n fxLayout=\"row\"\n style=\"display: flex; flex-direction: row\"\n >\n <button\n (click)=\"singleScanRemove(side)\"\n class=\"mr-4 remButton flex\"\n mat-raised-button\n >\n <div class=\"buttonWrap\">\n <mat-icon>delete</mat-icon>\n <div class=\"label\">\n {{ \"scandoc.remove\" | translate }}\n </div>\n </div>\n </button>\n <button\n class=\"ml-4 rotateButton flex\"\n mat-raised-button\n (click)=\"singleScanRotate(side)\"\n >\n <div class=\"buttonWrap\">\n <mat-icon>rotate_90_degrees_cw</mat-icon>\n <div class=\"label\">\n {{ \"scandoc.rotate\" | translate }}\n </div>\n </div>\n </button>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!side.image\">\n <div class=\"empty\">\n {{ side.description | translate }}\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </mat-card>\n </div>\n <footer>\n <div\n class=\"px-8 pb-8\"\n style=\"padding: 0px 8px 8px 8px; display: flex; flex-direction: row\"\n >\n <button\n (click)=\"scanBlastFinish()\"\n [disabled]=\"!scanBlastCanUpload\"\n style=\"flex: 1\"\n mat-raised-button\n >\n {{ \"scandoc.upload\" | translate }}\n </button>\n </div>\n </footer>\n </section>\n</ng-container>\n\n<div\n style=\"position: relative; display: flex; flex-direction: column; flex: 1\"\n *ngIf=\"documentTypeSelected\"\n>\n <div\n style=\"display: flex; flex-direction: row; flex: 1\"\n #wraper\n class=\"wraper\"\n >\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 <ngx-scandoc-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main flex\"\n\n #webcam\n [trigger]=\"trigger\"\n (imageCapture)=\"handleImage($event)\"\n(videoReady)=\"videoReady($event)\"\n (cameraSwitched)=\"cameraWasSwitched($event)\"\n (initError)=\"handleInitError($event)\"\n type=\"manual\"\n\n (destroyed)=\"cameraOff($event)\"\n >\n </ngx-scandoc-webcam>\n </ng-container>\n <div\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"\n display: flex;\n flex-direction: row;\n flex: 1;\n z-index: 20;\n position: absolute;\n width: 100%;\n height: 100%;\n \"\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 <ul>\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 style=\"display: flex; flex-direction: column; flex: 1\"\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 style=\"flex: 1\"\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 <!-- <div class=\"displayInfo\" *ngIf=\"!preview && cameraReady\">\n {{ displayInfo }}\n </div>\n <div style=\"height: 26px;\">\n <div style=\"text-align: center; font-size: 18px;\" *ngIf=\"idScan && !preview && cameraReady\">\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 \"scandoc.captureFront\" | translate\n }}</ng-container>\n <ng-container *ngIf=\"scanType === 'BACK'\">{{\n \"scandoc.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 style=\"display: flex; flex-direction: row; align-items: center; flex: 1\"\n >\n <button class=\"flex mr-4\" mat-raised-button (click)=\"retry()\">\n {{ \"scandoc.retry\" | translate }}\n </button>\n\n <button\n [disabled]=\"error\"\n class=\"ml-4 flex\"\n mat-raised-button\n (click)=\"continue()\"\n >\n {{ \"scandoc.continueWithSelectedImage\" | translate }}\n </button>\n </div>\n </footer>\n</div>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5}:host.mobile .buttonWrap div{font-size:11px!important}:host.mobile .scanBlastWraper .head{height:30px!important}:host.mobile .scanBlastWraper .head .title{font-size:12px!important}:host.mobile .scanBlastWraper .scanBlast{flex-direction:column}:host.mobile .scanBlastWraper mat-card{margin:4px!important}:host.mobile .scanBlastWraper .description{flex-direction:row!important}:host.mobile .scanBlastWraper .description .imgWrap{padding:0!important}:host.mobile .scanBlastWraper .description .btnActions{position:absolute;right:0}:host.mobile .scanBlastWraper .description button{margin:0!important;position:absolute;right:16px}:host.mobile .scanBlastWraper .description button.rotateButton{top:58px}:host.mobile .scanBlastWraper .description button.remButton{top:8px}:host.mobile .scanBlastWraper .description button mat-icon{margin:0!important}:host.mobile .scanBlastWraper .description button div.label{display:none}.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}.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 .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{overflow:hidden;display:flex;flex-direction:column;flex:1}.scanBlastWraper button{text-transform:uppercase;overflow:hidden}.scanBlastWraper .buttonWrap{display:flex;flex-direction:row;align-items:center;justify-content:center}.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;display:flex;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}.result{display:flex;flex-direction:column}.result .wrap{overflow:auto;flex:1;display:flex;flex-direction:row}.result .wrap .panel{flex:1}.result .wrap form{display:flex;flex-direction:row;padding:0 16px;width:100%}.result .wrap form formly-form{flex:1}.flex{flex:1}\n"] }]
|
|
1914
|
-
}], ctorParameters: () => [{ type: NgxScandocCameraProvider }, { type: i0.ChangeDetectorRef }, { type: LayoutProvider }, { type: i0.NgZone }], propDecorators: { action: [{
|
|
1915
|
-
type: Output
|
|
1916
|
-
}], wraper: [{
|
|
1917
|
-
type: ViewChild,
|
|
1918
|
-
args: ['wraper']
|
|
1919
|
-
}], class: [{
|
|
1920
|
-
type: HostBinding,
|
|
1921
|
-
args: ['class.mobile']
|
|
1922
|
-
}], onResize: [{
|
|
1923
|
-
type: HostListener,
|
|
1924
|
-
args: ['window:resize', ['$event']]
|
|
1925
|
-
}] } });
|
|
1926
|
-
|
|
1927
|
-
class ScanComponent extends BaseComponent {
|
|
1928
|
-
get class() {
|
|
1929
|
-
return this.isMobile;
|
|
1930
|
-
}
|
|
1931
|
-
onResize() {
|
|
1932
|
-
if (this.result) {
|
|
1933
|
-
this.cd.detectChanges();
|
|
1823
|
+
document() {
|
|
1824
|
+
if (this.customFields) {
|
|
1825
|
+
return this.customFields;
|
|
1934
1826
|
}
|
|
1935
|
-
|
|
1936
|
-
constructor(cd, zone, cameraProvider, injector, layoutProvider, platform, deviceService, auth) {
|
|
1937
|
-
super();
|
|
1938
|
-
this.cd = cd;
|
|
1939
|
-
this.zone = zone;
|
|
1940
|
-
this.cameraProvider = cameraProvider;
|
|
1941
|
-
this.injector = injector;
|
|
1942
|
-
this.layoutProvider = layoutProvider;
|
|
1943
|
-
this.platform = platform;
|
|
1944
|
-
this.deviceService = deviceService;
|
|
1945
|
-
this.auth = auth;
|
|
1946
|
-
this.scanBlastData = [
|
|
1947
|
-
{
|
|
1948
|
-
title: 'pms.dialogs.components.scanProfile.front',
|
|
1949
|
-
description: 'pms.dialogs.components.scanProfile.frontDescription',
|
|
1950
|
-
side: 'FRONT',
|
|
1951
|
-
},
|
|
1952
|
-
{
|
|
1953
|
-
title: 'pms.dialogs.components.scanProfile.back',
|
|
1954
|
-
description: 'pms.dialogs.components.scanProfile.backDescription',
|
|
1955
|
-
disabled: true,
|
|
1956
|
-
side: 'BACK',
|
|
1957
|
-
},
|
|
1958
|
-
];
|
|
1959
|
-
this.type = 'desktop';
|
|
1960
|
-
this.actions = new EventEmitter();
|
|
1961
|
-
this.scanResults = new Subject();
|
|
1962
|
-
this.scanSecondSide = false;
|
|
1963
|
-
this.startTime = 0;
|
|
1964
|
-
this.scanInProgress = false;
|
|
1965
|
-
// webcam snapshot trigger
|
|
1966
|
-
this.documentTypeSelected = false;
|
|
1967
|
-
this.preview = null;
|
|
1968
|
-
this.errorCode = '1000';
|
|
1969
|
-
this.displayInfo = 'scandoc.info.position';
|
|
1970
|
-
this.verificationErrorSent = false;
|
|
1971
|
-
this.error = false;
|
|
1972
|
-
this.cameraReady = false;
|
|
1973
|
-
this.scaning = false;
|
|
1974
|
-
this.promptManual = false;
|
|
1975
|
-
this.imageHandler = new Subject();
|
|
1976
|
-
this.manualDataSet = false;
|
|
1977
|
-
this.logData = {
|
|
1978
|
-
AcceptTermsAndConditions: true,
|
|
1979
|
-
Request: null,
|
|
1980
|
-
Response: null,
|
|
1981
|
-
ExpectedOutput: null,
|
|
1982
|
-
};
|
|
1983
|
-
this.scanDatas = [];
|
|
1984
|
-
this.idScan = null;
|
|
1985
|
-
this.validation = false;
|
|
1986
|
-
this.scannedImages = [];
|
|
1987
|
-
this.scanDelay = 0;
|
|
1988
|
-
this.trigger = new Subject();
|
|
1989
|
-
// switch to next / previous / specific webcam; true/false: forward/backwards, string: deviceId
|
|
1990
|
-
this.nextWebcam = new Subject();
|
|
1991
|
-
this.imageVerified = false;
|
|
1992
|
-
this.form = new FormGroup({});
|
|
1993
|
-
this.manual = false;
|
|
1994
|
-
this.isMobile = this.platform.IOS || this.platform.ANDROID;
|
|
1995
|
-
this.showDialog = false;
|
|
1996
|
-
this.scanImageTimestamps = {
|
|
1997
|
-
time: 0,
|
|
1998
|
-
load: 0,
|
|
1999
|
-
};
|
|
2000
|
-
this.numberOfValidations = 0;
|
|
2001
|
-
this.validationDebug = [];
|
|
2002
|
-
this.blurValues = [];
|
|
2003
|
-
this.scanProvider = this.injector.get(ScanProvider);
|
|
2004
|
-
if (!this.scanProvider.config.development) {
|
|
2005
|
-
// console = {
|
|
2006
|
-
// log: (...args: any) => {},
|
|
2007
|
-
// time: (...args: any) => {},
|
|
2008
|
-
// timeEnd: (...args: any) => {},
|
|
2009
|
-
// warn: (...args: any) => {},
|
|
2010
|
-
// error: (...args: any) => {},
|
|
2011
|
-
// };
|
|
2012
|
-
}
|
|
2013
|
-
}
|
|
2014
|
-
resetLogData() {
|
|
2015
|
-
this.logData = {
|
|
2016
|
-
Request: null,
|
|
2017
|
-
Response: null,
|
|
2018
|
-
ExpectedOutput: null,
|
|
2019
|
-
AcceptTermsAndConditions: true,
|
|
2020
|
-
};
|
|
2021
|
-
}
|
|
2022
|
-
init() {
|
|
2023
|
-
this.auth.accesToken.subscribe();
|
|
2024
|
-
this.resetLogData();
|
|
2025
|
-
// this.result=true;
|
|
2026
|
-
// this.result ={};
|
|
2027
|
-
console.log('INIT SCAN');
|
|
2028
|
-
}
|
|
2029
|
-
continue() {
|
|
2030
|
-
this.documentTypeSelected = false;
|
|
2031
|
-
setTimeout(() => {
|
|
2032
|
-
this.selectedSide.image = this.webcamImage;
|
|
2033
|
-
if (this.selectedSide.side === 'FRONT') {
|
|
2034
|
-
this.scanBlastData[1].disabled = false;
|
|
2035
|
-
}
|
|
2036
|
-
this.cd.detectChanges();
|
|
2037
|
-
}, 200);
|
|
2038
|
-
}
|
|
2039
|
-
scan() {
|
|
2040
|
-
this.trigger.next(new Date().getTime());
|
|
2041
|
-
}
|
|
2042
|
-
handleImage(webcamImage) {
|
|
2043
|
-
if (this.startTime === 0) {
|
|
2044
|
-
this.startTime = Date.now();
|
|
2045
|
-
}
|
|
2046
|
-
// console.log('[received webcam image]', webcamImage);
|
|
2047
|
-
this.zone.runOutsideAngular(() => {
|
|
2048
|
-
const time = new Date().getTime();
|
|
2049
|
-
if (this.scanImageTimestamps.load > 0) {
|
|
2050
|
-
const { load } = this.scanImageTimestamps;
|
|
2051
|
-
const diff = time - load;
|
|
2052
|
-
// console.log('time:', diff);
|
|
2053
|
-
this.scanDelay = diff;
|
|
2054
|
-
}
|
|
2055
|
-
this.scanImageTimestamps.load = time;
|
|
2056
|
-
if (webcamImage.imageAsDataUrl) {
|
|
2057
|
-
this.scannedImages.push(webcamImage);
|
|
2058
|
-
this.handleLongValidationError(webcamImage, 'worker');
|
|
2059
|
-
}
|
|
2060
|
-
this.cd.detectChanges();
|
|
2061
|
-
if (this.scannedImages.length > 0 && !this.validation) {
|
|
2062
|
-
// if (this.scanProvider.config.development) {
|
|
2063
|
-
// this.scannedImages.forEach((img) => {
|
|
2064
|
-
// const consoleBackground =
|
|
2065
|
-
// "font-size:100px;background-image: url('" +
|
|
2066
|
-
// img.imageResized +
|
|
2067
|
-
// "');background-size: contain; background-repeat: no-repeat;";
|
|
2068
|
-
// console.log('%c ', consoleBackground);
|
|
2069
|
-
// });
|
|
2070
|
-
// }
|
|
2071
|
-
// this.frontImage = webcamImage.imageResized;
|
|
2072
|
-
// console.timeEnd('scan');
|
|
2073
|
-
// console.time('scan');
|
|
2074
|
-
// get last 10
|
|
2075
|
-
// console.log('CAPTURED:', this.scannedImages.length);
|
|
2076
|
-
const images = this.scannedImages.slice(-5);
|
|
2077
|
-
// set images to 0
|
|
2078
|
-
this.scannedImages = [];
|
|
2079
|
-
const imagesArray = images.map((m) => m.imageResized.split(',')[1]);
|
|
2080
|
-
this.validation = true;
|
|
2081
|
-
this.handleBurstData(imagesArray, images);
|
|
2082
|
-
}
|
|
2083
|
-
else {
|
|
2084
|
-
if (this.cameraReady) {
|
|
2085
|
-
this.scan();
|
|
2086
|
-
}
|
|
2087
|
-
}
|
|
2088
|
-
});
|
|
2089
|
-
}
|
|
2090
|
-
handleBurstData(imagesArray, images, type = 'plain') {
|
|
2091
|
-
this.__subs(this.scanProvider.burst(imagesArray, this.blurValues)).subscribe((resp) => {
|
|
2092
|
-
this.displayInfo = 'scandoc.info.c' + resp.InfoCode;
|
|
2093
|
-
// console.timeEnd('validationPOST');
|
|
2094
|
-
// console.log('AnalysisTime', resp.AnalysisTime);
|
|
2095
|
-
const { DocType, Series, Side, InfoCode, TransactionID } = resp;
|
|
2096
|
-
this.handleLongValidationError(TransactionID, images[0].imageAsDataUrl.split(',')[1]);
|
|
2097
|
-
// if (InfoCode === '1006' && this.idScan) {
|
|
2098
|
-
// this.handleLongValidationError(image);
|
|
2099
|
-
// }
|
|
2100
|
-
// console.warn(resp.Validated, this.numberOfValidations);
|
|
2101
|
-
if (resp.DetectedBlurValue) {
|
|
2102
|
-
this.blurValues.push(resp.DetectedBlurValue);
|
|
2103
|
-
}
|
|
2104
|
-
else {
|
|
2105
|
-
this.blurValues = [];
|
|
2106
|
-
}
|
|
2107
|
-
if (resp.Validated) {
|
|
2108
|
-
this.numberOfValidations++;
|
|
2109
|
-
this.validationDebug.push(resp);
|
|
2110
|
-
}
|
|
2111
|
-
else {
|
|
2112
|
-
this.numberOfValidations = 0;
|
|
2113
|
-
this.validationDebug = [];
|
|
2114
|
-
}
|
|
2115
|
-
if (resp.Validated) {
|
|
2116
|
-
this.displayInfo = '';
|
|
2117
|
-
// console.log('[SCANNED INDEX]', resp.Index);
|
|
2118
|
-
const selectedImage = images[resp.Index];
|
|
2119
|
-
// this.preview = this.webcamImage.imageAsDataUrl;
|
|
2120
|
-
this.cd.detectChanges();
|
|
2121
|
-
let image = selectedImage;
|
|
2122
|
-
console.warn(type);
|
|
2123
|
-
if (type == 'worker') {
|
|
2124
|
-
//const dataUrl = this.handleBitmapImage(selectedImage.bitmap);
|
|
2125
|
-
image = selectedImage.imageAsDataUrl;
|
|
2126
|
-
}
|
|
2127
|
-
if (InfoCode === '1007') {
|
|
2128
|
-
// For ID ask for other side
|
|
2129
|
-
if (Side === 'FRONT') {
|
|
2130
|
-
this.scanBlastData[0].image = image;
|
|
2131
|
-
}
|
|
2132
|
-
else {
|
|
2133
|
-
this.scanBlastData[1].image = image;
|
|
2134
|
-
}
|
|
2135
|
-
if (this.scanBlastData[0].image && this.scanBlastData[1].image) {
|
|
2136
|
-
// console.warn('UPLOAD');
|
|
2137
|
-
if (type == 'worker') {
|
|
2138
|
-
this.imageHandler.next({ type: 'stop' });
|
|
2139
|
-
}
|
|
2140
|
-
//console.warn('DEBUG', Side, this.validationDebug);
|
|
2141
|
-
this.scanBlastFinish();
|
|
2142
|
-
}
|
|
2143
|
-
else {
|
|
2144
|
-
this.blurValues = [];
|
|
2145
|
-
this.numberOfValidations = 0;
|
|
2146
|
-
const num = Side === 'FRONT' ? 1 : 0;
|
|
2147
|
-
this.scanSecondSide = true;
|
|
2148
|
-
this.singleScan(this.scanBlastData[num]);
|
|
2149
|
-
this.idScan = this.scanBlastData[num].side;
|
|
2150
|
-
if (!this.showDialog) {
|
|
2151
|
-
this.showDialog = true;
|
|
2152
|
-
this.cd.detectChanges();
|
|
2153
|
-
}
|
|
2154
|
-
// reset manual scan popup interval
|
|
2155
|
-
this.verificationErrorSent = false;
|
|
2156
|
-
this.startTime = Date.now();
|
|
2157
|
-
this.displayInfo = 'scandoc.info.turn';
|
|
2158
|
-
}
|
|
2159
|
-
}
|
|
2160
|
-
else {
|
|
2161
|
-
// console.warn('DEBUG', Side, this.validationDebug);
|
|
2162
|
-
this.scanBlastData[0].image = image;
|
|
2163
|
-
// console.warn('UPLOAD');
|
|
2164
|
-
if (type == 'worker') {
|
|
2165
|
-
this.imageHandler.next({ type: 'stop' });
|
|
2166
|
-
}
|
|
2167
|
-
this.scanBlastFinish();
|
|
2168
|
-
}
|
|
2169
|
-
this.scannedImages = [];
|
|
2170
|
-
// this.scanBlastData[0].image = selectedImage;
|
|
2171
|
-
//this.scanBlastFinish();
|
|
2172
|
-
}
|
|
2173
|
-
else {
|
|
2174
|
-
this.validation = false;
|
|
2175
|
-
this.scan();
|
|
2176
|
-
}
|
|
2177
|
-
});
|
|
2178
|
-
}
|
|
2179
|
-
closeDialog() {
|
|
2180
|
-
this.showDialog = false;
|
|
2181
|
-
this.validation = false;
|
|
2182
|
-
this.scan();
|
|
2183
|
-
}
|
|
2184
|
-
handleInitError(error) {
|
|
2185
|
-
console.log(error);
|
|
2186
|
-
}
|
|
2187
|
-
get scanBlastCanUpload() {
|
|
2188
|
-
return this.scanBlastData[0].image ? true : false;
|
|
2189
|
-
}
|
|
2190
|
-
manualMode(type = 'plain') {
|
|
2191
|
-
this.manual = true;
|
|
2192
|
-
this.promptManual = false;
|
|
2193
|
-
this.scanInProgress = false;
|
|
2194
|
-
this.cameraProvider.$showSwitch.next(false);
|
|
2195
|
-
this.cd.detectChanges();
|
|
2196
|
-
}
|
|
2197
|
-
handleExtractionError(data) {
|
|
2198
|
-
this.logData.ExpectedOutput = {};
|
|
2199
|
-
// if (this.logData.ExpectedOutput?._avatar) {
|
|
2200
|
-
// delete this.logData.ExpectedOutput._avatar;
|
|
2201
|
-
// }
|
|
2202
|
-
// this.scanProvider.sendLog(this.logData).subscribe();
|
|
2203
|
-
// console.log('LOG DATA', this.logData);
|
|
2204
|
-
this.__subs(this.scanProvider.sendLog(this.logData)).subscribe();
|
|
2205
|
-
}
|
|
2206
|
-
handleLongValidationError(img, type = 'plain') {
|
|
2207
|
-
// save current image after 10sec
|
|
2208
|
-
let MANUAL_INTERVAL = this.scanProvider.config.manualScanDelay;
|
|
2209
|
-
const diff = (Date.now() - this.startTime) / 1000;
|
|
2210
|
-
const showDialog = diff > MANUAL_INTERVAL;
|
|
2211
|
-
if (showDialog && !this.verificationErrorSent) {
|
|
2212
|
-
this.verificationErrorSent = true;
|
|
2213
|
-
console.warn('[HANDLE ERROR]');
|
|
2214
|
-
this.zone.run(() => {
|
|
2215
|
-
// if (!this.scanSecondSide) {
|
|
2216
|
-
if (this.scanProvider.config.manualModeEnabled) {
|
|
2217
|
-
this.promptManual = true;
|
|
2218
|
-
}
|
|
2219
|
-
// }
|
|
2220
|
-
this.startTime = Date.now();
|
|
2221
|
-
});
|
|
2222
|
-
// this.verificationErrorSent = true;
|
|
2223
|
-
// const dataUrl = this.handleBitmapImage(img.bitmap);
|
|
2224
|
-
// console.warn('SENT');
|
|
2225
|
-
// // this.displayInfo = 'Cant detect document!';
|
|
2226
|
-
// this.logData.Request = this.__subs(
|
|
2227
|
-
// this.scanProvider.sendLog({
|
|
2228
|
-
// AcceptTermsAndConditions: true,
|
|
2229
|
-
// ExpectedOutput: {},
|
|
2230
|
-
// Request: {
|
|
2231
|
-
// verification: dataUrl.split(',')[1],
|
|
2232
|
-
// },
|
|
2233
|
-
// Response: {
|
|
2234
|
-
// TransactionID: uuidv4(),
|
|
2235
|
-
// },
|
|
2236
|
-
// })
|
|
2237
|
-
// ).subscribe();
|
|
2238
|
-
}
|
|
2239
|
-
}
|
|
2240
|
-
ngAfterViewInit() {
|
|
2241
|
-
// this.result = true;
|
|
2242
|
-
this.cameraProvider.$showSwitch.next(true);
|
|
2243
|
-
this.cd.detectChanges();
|
|
2244
|
-
// this.scanResults.next({ type: 'model', data: {} });
|
|
2245
|
-
this.__subs(this.cameraProvider.webcamObservable).subscribe((resp) => {
|
|
2246
|
-
this.cameraReady = false;
|
|
2247
|
-
this.scanInProgress = false;
|
|
2248
|
-
this.scannedImages = [];
|
|
2249
|
-
});
|
|
2250
|
-
this.__subs(this.cameraProvider.selfie$).subscribe((resp) => {
|
|
2251
|
-
this.selfie();
|
|
2252
|
-
});
|
|
2253
|
-
this.autoScan();
|
|
2254
|
-
this.__subs(this.layoutProvider.breakpoint$).subscribe((v) => {
|
|
2255
|
-
this.isMobile = !v.matches || this.platform.IOS || this.platform.ANDROID;
|
|
2256
|
-
console.log('MNOBILE', this.isMobile);
|
|
2257
|
-
});
|
|
2258
|
-
// this.imageHandlerSubscription = this.imageHandler.subscribe(
|
|
2259
|
-
// (webcamImage: any) => {
|
|
2260
|
-
// // return;
|
|
2261
|
-
// if (this.startTime === 0) {
|
|
2262
|
-
// this.startTime = Date.now();
|
|
2263
|
-
// }
|
|
2264
|
-
// this.zone.runOutsideAngular(() => {
|
|
2265
|
-
// if (webcamImage.base64) {
|
|
2266
|
-
// const time = new Date().getTime();
|
|
2267
|
-
// if (this.scanImageTimestamps.load > 0) {
|
|
2268
|
-
// const { load } = this.scanImageTimestamps;
|
|
2269
|
-
// const diff = time - load;
|
|
2270
|
-
// // console.warn('TIME', diff);
|
|
2271
|
-
// this.scanDelay = diff;
|
|
2272
|
-
// }
|
|
2273
|
-
// this.scanImageTimestamps.load = time;
|
|
2274
|
-
// this.scannedImages.push(webcamImage);
|
|
2275
|
-
// this.handleLongValidationError(webcamImage, 'worker');
|
|
2276
|
-
// }
|
|
2277
|
-
// // this.cd.detectChanges();
|
|
2278
|
-
// if (this.scannedImages.length > 4 && !this.validation) {
|
|
2279
|
-
// // get last 10
|
|
2280
|
-
// console.timeEnd('validationTOTAL_UI');
|
|
2281
|
-
// console.time('validationTOTAL_UI');
|
|
2282
|
-
// const images = this.scannedImages.slice(-5);
|
|
2283
|
-
// // set images to 0
|
|
2284
|
-
// this.scannedImages = [];
|
|
2285
|
-
// console.log(images);
|
|
2286
|
-
// const imagesArray = images.map((m) => m.base64.split(',')[1]);
|
|
2287
|
-
// this.validation = true;
|
|
2288
|
-
// // this.handleBurstData(imagesArray, images, 'worker');
|
|
2289
|
-
// console.time('validationPOST');
|
|
2290
|
-
// }
|
|
2291
|
-
// this.cd.detectChanges();
|
|
2292
|
-
// });
|
|
2293
|
-
// }
|
|
2294
|
-
// );
|
|
2295
|
-
}
|
|
2296
|
-
handleBitmapImage(bitmap) {
|
|
2297
|
-
const { width, height } = bitmap;
|
|
2298
|
-
const offscreenSmall = document.createElement('canvas');
|
|
2299
|
-
offscreenSmall.width = width;
|
|
2300
|
-
offscreenSmall.height = height;
|
|
2301
|
-
const ctx = offscreenSmall.getContext('bitmaprenderer');
|
|
2302
|
-
if (ctx) {
|
|
2303
|
-
ctx.imageSmoothingEnabled = false;
|
|
2304
|
-
ctx.transferFromImageBitmap(bitmap);
|
|
2305
|
-
bitmap.close();
|
|
2306
|
-
const data = ctx.canvas.toDataURL('image/jpeg');
|
|
2307
|
-
return data;
|
|
2308
|
-
}
|
|
2309
|
-
return null;
|
|
2310
|
-
}
|
|
2311
|
-
autoScan() {
|
|
2312
|
-
const side = this.scanBlastData[0];
|
|
2313
|
-
this.idScan = null;
|
|
2314
|
-
this.singleScan(side);
|
|
2315
|
-
}
|
|
2316
|
-
singleScan(side) {
|
|
2317
|
-
this.scanType = side.side;
|
|
2318
|
-
this.preview = null;
|
|
2319
|
-
this.selectedSide = side;
|
|
2320
|
-
this.selectedSide.image = null;
|
|
2321
|
-
this.documentTypeSelected = true;
|
|
2322
|
-
this.scanBlastData[1].disabled = false;
|
|
2323
|
-
this.cd.detectChanges();
|
|
2324
|
-
}
|
|
2325
|
-
manualScanData(data) {
|
|
2326
|
-
console.log(data);
|
|
2327
|
-
this.scanBlastData = data;
|
|
2328
|
-
this.manual = false;
|
|
2329
|
-
this.manualDataSet = true;
|
|
2330
|
-
this.scanBlastFinish();
|
|
2331
|
-
}
|
|
2332
|
-
getImgBase64(num) {
|
|
2333
|
-
console.log('GET 64');
|
|
2334
|
-
// if (this.manualDataSet) {
|
|
2335
|
-
return this.scanBlastData[num].image._imageAsDataUrl.split(',')[1];
|
|
2336
|
-
// }
|
|
2337
|
-
// return this.scanBlastData[num].image.dataUrl.split(',')[1];
|
|
2338
|
-
}
|
|
2339
|
-
scanBlastFinish() {
|
|
2340
|
-
const { browser, os, device } = this.deviceService;
|
|
2341
|
-
this.zone.run(() => {
|
|
2342
|
-
this.cameraProvider.$showSwitch.next(false);
|
|
2343
|
-
});
|
|
2344
|
-
console.time('upload');
|
|
2345
|
-
if (this.type === 'mobile') {
|
|
2346
|
-
this.actions.emit({ data: this.scanBlastData });
|
|
2347
|
-
this.retake();
|
|
2348
|
-
return;
|
|
2349
|
-
}
|
|
2350
|
-
this.idScan = null;
|
|
2351
|
-
// const loading = this.dialogs.loading();
|
|
2352
|
-
this.scaning = true;
|
|
2353
|
-
this.cd.detectChanges();
|
|
2354
|
-
console.time('payload');
|
|
2355
|
-
const payload = {
|
|
2356
|
-
AcceptTermsAndConditions: true,
|
|
2357
|
-
DataFields: {
|
|
2358
|
-
DeviceInfo: {
|
|
2359
|
-
OS: os,
|
|
2360
|
-
Device: device,
|
|
2361
|
-
Browser: browser,
|
|
2362
|
-
},
|
|
2363
|
-
FrontImageType: 'base64',
|
|
2364
|
-
FrontImageCropped: false,
|
|
2365
|
-
BackImageType: 'base64',
|
|
2366
|
-
BackImageCropped: false,
|
|
2367
|
-
FrontImage: this.getImgBase64(0),
|
|
2368
|
-
BackImage: this.scanBlastData[1].image ? this.getImgBase64(1) : null,
|
|
2369
|
-
},
|
|
2370
|
-
Settings: {
|
|
2371
|
-
ShouldValidate: true,
|
|
2372
|
-
ShouldReturnDocumentImage: true,
|
|
2373
|
-
ShouldReturnFaceIfDetected: true,
|
|
2374
|
-
SkipImageSizeCheck: true,
|
|
2375
|
-
CanStoreImages: this.scanProvider.canStoreImages,
|
|
2376
|
-
},
|
|
2377
|
-
// CallBackUrl: 'http://demo:5000/report/extracted/',
|
|
2378
|
-
};
|
|
2379
|
-
this.frontImage = 'data:image/jpeg;base64,' + payload.DataFields.FrontImage;
|
|
2380
|
-
this.backImage = 'data:image/jpeg;base64,' + payload.DataFields.BackImage;
|
|
2381
|
-
if (!this.scanBlastData[1].image) {
|
|
2382
|
-
payload.Settings.IgnoreBackImage = true;
|
|
2383
|
-
}
|
|
2384
|
-
this.logData.Request = JSON.parse(JSON.stringify(payload));
|
|
2385
|
-
console.timeEnd('payload');
|
|
2386
|
-
this.__subs(this.scanProvider.blastPost(payload).pipe(catchError((e) => {
|
|
2387
|
-
if (this.manualDataSet) {
|
|
2388
|
-
// console.warn('MANUAL DATA SET',e);
|
|
2389
|
-
this.logData.Response = JSON.parse(JSON.stringify(e.error));
|
|
2390
|
-
this.handleExtractionError({});
|
|
2391
|
-
}
|
|
2392
|
-
this.zone.run(() => {
|
|
2393
|
-
this.error = true;
|
|
2394
|
-
this.preview = true;
|
|
2395
|
-
this.cd.detectChanges();
|
|
2396
|
-
});
|
|
2397
|
-
// console.log('EEE', e);
|
|
2398
|
-
return e;
|
|
2399
|
-
}))).subscribe((data) => {
|
|
2400
|
-
//console.log(data);
|
|
2401
|
-
const results = data.Data;
|
|
2402
|
-
console.timeEnd('upload');
|
|
2403
|
-
console.time('parse');
|
|
2404
|
-
// data.InfoCode = '1001';
|
|
2405
|
-
console.time('p');
|
|
2406
|
-
this.logData.Response = JSON.parse(JSON.stringify(data));
|
|
2407
|
-
console.timeEnd('p');
|
|
2408
|
-
//loading.close();
|
|
2409
|
-
this.documentTypeSelected = true;
|
|
2410
|
-
this.scaning = false;
|
|
2411
|
-
if (data.InfoCode === '1001') {
|
|
2412
|
-
this.error = true;
|
|
2413
|
-
console.log('[ERROR] 1001');
|
|
2414
|
-
this.errorCode = '1001';
|
|
2415
|
-
// this.scanSide = 0;
|
|
2416
|
-
this.preview = true;
|
|
2417
|
-
this.cd.detectChanges();
|
|
2418
|
-
return;
|
|
2419
|
-
}
|
|
2420
|
-
if (data.InfoCode === '1002') {
|
|
2421
|
-
this.error = true;
|
|
2422
|
-
console.log('[ERROR] 1002');
|
|
2423
|
-
this.errorCode = '1002';
|
|
2424
|
-
// this.scanSide = 0;
|
|
2425
|
-
this.preview = true;
|
|
2426
|
-
this.cd.detectChanges();
|
|
2427
|
-
return;
|
|
2428
|
-
}
|
|
2429
|
-
if (results && data.Metadata.length > 0 && data.InfoCode === '1000') {
|
|
2430
|
-
// console.log('Extraction time', data.AnalysisTime);
|
|
2431
|
-
// this.zone.run(() => {
|
|
2432
|
-
// console.time('parseblast');
|
|
2433
|
-
const result = this.scanProvider.parseBlast(results);
|
|
2434
|
-
// console.timeEnd('parseblast');
|
|
2435
|
-
// console.log('RES', this.result);
|
|
2436
|
-
// this.cd.detectChanges();
|
|
2437
|
-
const model = result.model;
|
|
2438
|
-
if (data.ImageData?.FaceImage) {
|
|
2439
|
-
model._avatar =
|
|
2440
|
-
'data:image/jpeg;base64,' + data.ImageData?.FaceImage;
|
|
2441
|
-
}
|
|
2442
|
-
if (data.ImageData?.Documents) {
|
|
2443
|
-
const { Documents } = data.ImageData;
|
|
2444
|
-
model.images = Documents.map((image, i) => {
|
|
2445
|
-
return { data: 'data:image/jpeg;base64,' + Documents[i] };
|
|
2446
|
-
});
|
|
2447
|
-
}
|
|
2448
|
-
this.model = model;
|
|
2449
|
-
// console.log('MODEL', this.model);
|
|
2450
|
-
this.actions.emit({
|
|
2451
|
-
type: 'scanFinish',
|
|
2452
|
-
data: {
|
|
2453
|
-
model: this.model,
|
|
2454
|
-
images: this.images,
|
|
2455
|
-
results,
|
|
2456
|
-
},
|
|
2457
|
-
});
|
|
2458
|
-
if (!this.scanProvider.config.hideResults) {
|
|
2459
|
-
this.zone.run(() => {
|
|
2460
|
-
console.log('ERR');
|
|
2461
|
-
this.result = true;
|
|
2462
|
-
// console.time('ff');
|
|
2463
|
-
this.cd.detectChanges();
|
|
2464
|
-
this.scanResults.next({ type: 'model', data: model });
|
|
2465
|
-
// this.cd.detectChanges();
|
|
2466
|
-
// });
|
|
2467
|
-
// console.timeEnd('ff');
|
|
2468
|
-
});
|
|
2469
|
-
}
|
|
2470
|
-
}
|
|
2471
|
-
else {
|
|
2472
|
-
console.log('ERROR');
|
|
2473
|
-
if (this.manualDataSet) {
|
|
2474
|
-
this.handleExtractionError(data);
|
|
2475
|
-
}
|
|
2476
|
-
// this.scanSide = 0;
|
|
2477
|
-
this.zone.run(() => {
|
|
2478
|
-
this.error = true;
|
|
2479
|
-
this.preview = true;
|
|
2480
|
-
this.cd.detectChanges();
|
|
2481
|
-
});
|
|
2482
|
-
// this.documentTypeSelected = false;
|
|
2483
|
-
// this.retry();
|
|
2484
|
-
}
|
|
2485
|
-
// this.cd.detectChanges();
|
|
2486
|
-
console.timeEnd('parse');
|
|
2487
|
-
}, (err) => {
|
|
2488
|
-
// loading.close();
|
|
2489
|
-
// this.scanSide = 0;
|
|
2490
|
-
this.error = true;
|
|
2491
|
-
this.preview = true;
|
|
2492
|
-
this.documentTypeSelected = true;
|
|
2493
|
-
this.scaning = false;
|
|
2494
|
-
});
|
|
2495
|
-
}
|
|
2496
|
-
retry() {
|
|
2497
|
-
this.preview = false;
|
|
2498
|
-
this.validation = false;
|
|
2499
|
-
this.errorCode = '1000';
|
|
2500
|
-
this.result = false;
|
|
2501
|
-
this.idScan = null;
|
|
2502
|
-
this.cameraProvider.$showSwitch.next(true);
|
|
2503
|
-
if (this.error) {
|
|
2504
|
-
this.documentTypeSelected = false;
|
|
2505
|
-
this.scanBlastData.forEach((element) => {
|
|
2506
|
-
element.image = null;
|
|
2507
|
-
});
|
|
2508
|
-
}
|
|
2509
|
-
this.error = false;
|
|
2510
|
-
this.startTime = Date.now();
|
|
2511
|
-
this.autoScan();
|
|
2512
|
-
this.scan();
|
|
2513
|
-
this.cd.detectChanges();
|
|
2514
|
-
}
|
|
2515
|
-
retake() {
|
|
2516
|
-
this.validation = false;
|
|
2517
|
-
this.preview = false;
|
|
2518
|
-
this.error = false;
|
|
2519
|
-
this.result = false;
|
|
2520
|
-
this.scanSide = 0;
|
|
2521
|
-
this.cameraProvider.$showSwitch.next(true);
|
|
2522
|
-
this.imageVerified = false;
|
|
2523
|
-
this.scanDatas = [];
|
|
2524
|
-
this.scaning = false;
|
|
2525
|
-
this.images = [];
|
|
2526
|
-
this.scanInProgress = false;
|
|
2527
|
-
this.startTime = Date.now();
|
|
2528
|
-
this.idScan = null;
|
|
2529
|
-
this.documentTypeSelected = false;
|
|
2530
|
-
this.scanBlastData.forEach((m) => {
|
|
2531
|
-
m.image = null;
|
|
2532
|
-
});
|
|
2533
|
-
this.scanSecondSide = false;
|
|
2534
|
-
this.autoScan();
|
|
2535
|
-
this.cd.detectChanges();
|
|
2536
|
-
}
|
|
2537
|
-
use() {
|
|
2538
|
-
// save images??
|
|
2539
|
-
if (this.scanProvider.config.sendLog) {
|
|
2540
|
-
this.logData.ExpectedOutput = JSON.parse(JSON.stringify(this.model));
|
|
2541
|
-
if (this.logData.ExpectedOutput?._avatar) {
|
|
2542
|
-
delete this.logData.ExpectedOutput._avatar;
|
|
2543
|
-
}
|
|
2544
|
-
this.__subs(this.scanProvider.sendLog(this.logData)).subscribe();
|
|
2545
|
-
console.log(this.logData);
|
|
2546
|
-
}
|
|
2547
|
-
this.actions.emit({
|
|
2548
|
-
type: 'scanDataClose',
|
|
2549
|
-
data: {
|
|
2550
|
-
model: this.model,
|
|
2551
|
-
images: this.images,
|
|
2552
|
-
},
|
|
2553
|
-
});
|
|
2554
|
-
}
|
|
2555
|
-
selfie() {
|
|
2556
|
-
const avatar = this.model?._avatar;
|
|
2557
|
-
this.dialogs
|
|
2558
|
-
.scanSelfie({ avatar })
|
|
2559
|
-
.afterClosed()
|
|
2560
|
-
.subscribe((resp) => {
|
|
2561
|
-
if (resp) {
|
|
2562
|
-
console.log(resp);
|
|
2563
|
-
if (this.scanProvider.enableVerification) {
|
|
2564
|
-
this.imageVerified = true;
|
|
2565
|
-
}
|
|
2566
|
-
this.scanResults.next({
|
|
2567
|
-
type: 'avatar',
|
|
2568
|
-
data: resp.imageAsDataUrl,
|
|
2569
|
-
});
|
|
2570
|
-
// this.model._avatar = resp.imageAsDataUrl;
|
|
2571
|
-
this.cd.detectChanges();
|
|
2572
|
-
}
|
|
2573
|
-
});
|
|
2574
|
-
}
|
|
2575
|
-
cameraOff(ev) {
|
|
2576
|
-
this.cameraReady = false;
|
|
2577
|
-
this.cd.detectChanges();
|
|
2578
|
-
}
|
|
2579
|
-
videoReady(event) {
|
|
2580
|
-
console.log('READY', event);
|
|
2581
|
-
this.cameraReady = event;
|
|
2582
|
-
if (this.cameraReady && !this.scanInProgress && !this.manual) {
|
|
2583
|
-
this.scanInProgress = true;
|
|
2584
|
-
setTimeout(() => {
|
|
2585
|
-
this.scan();
|
|
2586
|
-
}, 20);
|
|
2587
|
-
}
|
|
2588
|
-
}
|
|
2589
|
-
manualSet(key) {
|
|
2590
|
-
if (key) {
|
|
2591
|
-
if (this.scanProvider.config.showManualMode) {
|
|
2592
|
-
this.manualMode();
|
|
2593
|
-
}
|
|
2594
|
-
else {
|
|
2595
|
-
this.actions.emit({
|
|
2596
|
-
type: 'manualMode',
|
|
2597
|
-
data: {},
|
|
2598
|
-
});
|
|
2599
|
-
}
|
|
2600
|
-
}
|
|
2601
|
-
else {
|
|
2602
|
-
this.promptManual = false;
|
|
2603
|
-
}
|
|
2604
|
-
}
|
|
2605
|
-
ngOnDestroy() {
|
|
2606
|
-
if (this.scanTimeout) {
|
|
2607
|
-
clearTimeout(this.scanTimeout);
|
|
2608
|
-
}
|
|
2609
|
-
if (this.imageHandlerSubscription) {
|
|
2610
|
-
this.imageHandlerSubscription.unsubscribe();
|
|
2611
|
-
}
|
|
2612
|
-
console.log('DESTROXY');
|
|
2613
|
-
this.__destroy();
|
|
2614
|
-
}
|
|
2615
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: NgxScandocCameraProvider }, { token: i0.Injector }, { token: LayoutProvider }, { token: i2.Platform }, { token: i4$2.DeviceDetectorService }, { token: NgxScandocAuthProvider }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2616
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ScanComponent, isStandalone: false, selector: "ngx-scan", inputs: { type: "type", dialogs: "dialogs", refresh: "refresh", showDialog: "showDialog" }, outputs: { actions: "actions" }, host: { listeners: { "window:resize": "onResize($event)" }, properties: { "class.mobile": "this.class" } }, usesInheritance: true, ngImport: i0, template: "<ng-container\n *ngIf=\"cameraProvider.rectPosition.t > 0 && displayInfo && !result && !manual\"\n>\n <div class=\"hint\" [ngStyle]=\"{ top: cameraProvider.hintPosition + 'px' }\">\n <span class=\"text\">\n {{ displayInfo | translate }}\n </span>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"showDialog\">\n <div class=\"pageTurn\">\n <div class=\"content\">\n <div class=\"inner\">\n <mat-icon>360</mat-icon>\n <div class=\"text\">\n <ng-container *ngIf=\"idScan === 'BACK'\">\n {{ \"scandoc.turnAndCapture.back\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"idScan === 'FRONT'\">\n {{ \"scandoc.turnAndCapture.front\" | translate }}\n </ng-container>\n </div>\n </div>\n <footer>\n <button (click)=\"closeDialog()\" mat-raised-button>Ok</button>\n </footer>\n </div>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"promptManual\">\n <div class=\"manualMode\">\n <div class=\"content\">\n <div class=\"inner\">\n <mat-icon>screenshot</mat-icon>\n <div class=\"text\">\n {{ \"scandoc.manual\" | translate }}\n </div>\n </div>\n <footer>\n <button\n style=\"margin-right: 8px\"\n (click)=\"manualSet(true)\"\n mat-raised-button\n >\n {{ \"scandoc.yes\" | translate }}\n </button>\n <button\n style=\"margin-left: 8px\"\n (click)=\"manualSet(false)\"\n mat-raised-button\n >\n {{ \"scandoc.no\" | translate }}\n </button>\n </footer>\n </div>\n </div>\n</ng-container>\n<ng-container *ngIf=\"result\">\n <section>\n <!-- <ngx-scan-results\n (action)=\"selfie()\"\n [form]=\"form\"\n [data]=\"scanResults\"\n ></ngx-scan-results> -->\n\n hum\n\n <footer>\n <div class=\"actions\">\n <button class=\"mr-4\" mat-raised-button (click)=\"retake()\">\n {{ \"scandoc.reTake\" | translate }}\n </button>\n <button\n [disabled]=\"error || form.invalid\"\n class=\"ml-4\"\n mat-raised-button\n (click)=\"use()\"\n >\n {{ \"scandoc.useData\" | translate }}\n </button>\n </div>\n </footer>\n </section>\n</ng-container>\n\n<ng-container *ngIf=\"manual\">\n <section>\n <ngx-manual-scan (action)=\"manualScanData($event)\"></ngx-manual-scan>\n </section>\n</ng-container>\n<ng-container *ngIf=\"!result && documentTypeSelected && !manual\">\n <section>\n <div #wraper class=\"wraper\">\n <div class=\"loading\" *ngIf=\"(!cameraReady && !preview) || scaning\">\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n\n <ng-container *ngIf=\"!error\">\n <ngx-scandoc-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main\"\n #webcam\n type=\"document\"\n [trigger]=\"trigger\"\n [imageHandler]=\"imageHandler\"\n (imageCapture)=\"handleImage($event)\"\n (initError)=\"handleInitError($event)\"\n (destroyed)=\"cameraOff($event)\"\n (videoReady)=\"videoReady($event)\"\n [refresh]=\"refresh\"\n >\n </ngx-scandoc-webcam>\n </ng-container>\n <div\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"\n z-index: 20;\n display: flex;\n position: absolute;\n width: 100%;\n height: 100%;\n \"\n >\n <div class=\"p-16 error\" *ngIf=\"error\">\n <div>\n <div class=\"title\">\n <mat-icon>error_outline</mat-icon\n ><span class=\"ml-8\">{{\n \"scandoc.unableToDetectId\" | translate\n }}</span>\n </div>\n\n <ng-container *ngIf=\"errorCode === '1001'\">\n <div>\n {{ \"scandoc.extraction.c1001\" | translate }}\n </div>\n </ng-container>\n <ng-container *ngIf=\"errorCode === '1002'\">\n <div>\n {{ \"scandoc.extraction.c1002\" | translate }}\n </div>\n </ng-container>\n\n <ul *ngIf=\"errorCode === '1000'\">\n <li>\n {{ \"scandoc.placeIdCloseToDevice\" | translate }}\n </li>\n <li>\n {{ \"scandoc.ensureSufficientLight\" | translate }}\n </li>\n <li>\n {{ \"scandoc.holdDocumentSteady\" | translate }}\n </li>\n <li>\n {{ \"scandoc.makeSureAllEdgesOfTheIdAreVisible\" | translate }}\n </li>\n <li>\n {{\n \"scandoc.makeSureThereAreNoGlareAndShadowsOnTheId\" | translate\n }}\n </li>\n </ul>\n </div>\n </div>\n\n <div class=\"scanPreview\" *ngIf=\"!error && !scaning\">\n <!-- <div class=\"py-16\" style=\"font-size: 16px\">\n {{\n \"scandoc.ensureAllTextsAreVisible\"\n | translate\n }}\n </div> -->\n <div\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer *ngIf=\"preview\">\n <!-- <div class=\"displayInfo\" *ngIf=\"!preview && cameraReady\">\n <ng-container *ngIf=\"displayInfo\">\n {{ displayInfo | translate }}\n </ng-container>\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 {{ \"scandoc.captureBack\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"idScan === 'FRONT'\">\n Turn document and:\n {{ \"scandoc.captureFront\" | translate }}\n </ng-container>\n </div>\n </div> -->\n\n <div class=\"actions\" *ngIf=\"preview\">\n <button class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n {{ \"scandoc.retry\" | translate }}\n </button>\n\n <button\n [disabled]=\"error\"\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n {{ \"scandoc.continueWithSelectedImage\" | translate }}\n </button>\n </div>\n </footer>\n </section>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5;overflow:hidden;position:relative}:host.mobile .hint{font-size:13px}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;display:flex;flex-direction:row;align-items:center;justify-content:center;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}.manualMode{position:absolute;width:100%;height:100%;z-index:200;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.manualMode .content{margin-top:20px;background-color:#fff;border-radius:6px;max-width:300px;width:100%;display:flex;flex-direction:column;padding:30px 20px 0}.manualMode .inner{display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:14px}.manualMode .inner mat-icon{width:60px;height:60px;font-size:60px}.manualMode .inner .text{margin:20px 0}.manualMode footer{display:flex;flex-direction:row;align-items:center;justify-content:center;padding-bottom:20px}.manualMode footer button{min-width:140px;box-shadow:none;border:1px solid #ccc}.pageTurn{position:absolute;width:100%;height:100%;z-index:200;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.pageTurn .content{background-color:#fff;border-radius:6px;max-width:300px;width:100%;display:flex;flex-direction:column;padding:30px 20px 0}.pageTurn .inner{display:flex;flex-direction:column;align-items:center;justify-content:center}.pageTurn .inner mat-icon{width:60px;height:60px;font-size:60px}.pageTurn .inner .text{margin:20px 0;font-size:14px}.pageTurn footer{display:flex;flex-direction:row;align-items:center;justify-content:center;padding-bottom:20px}.pageTurn footer button{min-width:200px;box-shadow:none;border:1px solid #ccc}.hint{position:absolute;z-index:5;font-size:18px;line-height:18px;display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%}.hint .text{border-radius:3px;padding:4px 8px;background-color:#000;color:#fff;text-align:center;display:inline;-webkit-box-decoration-break:clone;box-decoration-break:clone}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: WebcamComponent, selector: "ngx-scandoc-webcam", inputs: ["imageHandler", "type", "trigger", "refresh"], outputs: ["cameraSwitched", "videoReady", "imageCapture", "initError"] }, { kind: "component", type: i5$1.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-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i8.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: ManualScanComponent, selector: "ngx-manual-scan", outputs: ["action"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2617
|
-
}
|
|
2618
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanComponent, decorators: [{
|
|
2619
|
-
type: Component,
|
|
2620
|
-
args: [{ selector: 'ngx-scan', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<ng-container\n *ngIf=\"cameraProvider.rectPosition.t > 0 && displayInfo && !result && !manual\"\n>\n <div class=\"hint\" [ngStyle]=\"{ top: cameraProvider.hintPosition + 'px' }\">\n <span class=\"text\">\n {{ displayInfo | translate }}\n </span>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"showDialog\">\n <div class=\"pageTurn\">\n <div class=\"content\">\n <div class=\"inner\">\n <mat-icon>360</mat-icon>\n <div class=\"text\">\n <ng-container *ngIf=\"idScan === 'BACK'\">\n {{ \"scandoc.turnAndCapture.back\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"idScan === 'FRONT'\">\n {{ \"scandoc.turnAndCapture.front\" | translate }}\n </ng-container>\n </div>\n </div>\n <footer>\n <button (click)=\"closeDialog()\" mat-raised-button>Ok</button>\n </footer>\n </div>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"promptManual\">\n <div class=\"manualMode\">\n <div class=\"content\">\n <div class=\"inner\">\n <mat-icon>screenshot</mat-icon>\n <div class=\"text\">\n {{ \"scandoc.manual\" | translate }}\n </div>\n </div>\n <footer>\n <button\n style=\"margin-right: 8px\"\n (click)=\"manualSet(true)\"\n mat-raised-button\n >\n {{ \"scandoc.yes\" | translate }}\n </button>\n <button\n style=\"margin-left: 8px\"\n (click)=\"manualSet(false)\"\n mat-raised-button\n >\n {{ \"scandoc.no\" | translate }}\n </button>\n </footer>\n </div>\n </div>\n</ng-container>\n<ng-container *ngIf=\"result\">\n <section>\n <!-- <ngx-scan-results\n (action)=\"selfie()\"\n [form]=\"form\"\n [data]=\"scanResults\"\n ></ngx-scan-results> -->\n\n hum\n\n <footer>\n <div class=\"actions\">\n <button class=\"mr-4\" mat-raised-button (click)=\"retake()\">\n {{ \"scandoc.reTake\" | translate }}\n </button>\n <button\n [disabled]=\"error || form.invalid\"\n class=\"ml-4\"\n mat-raised-button\n (click)=\"use()\"\n >\n {{ \"scandoc.useData\" | translate }}\n </button>\n </div>\n </footer>\n </section>\n</ng-container>\n\n<ng-container *ngIf=\"manual\">\n <section>\n <ngx-manual-scan (action)=\"manualScanData($event)\"></ngx-manual-scan>\n </section>\n</ng-container>\n<ng-container *ngIf=\"!result && documentTypeSelected && !manual\">\n <section>\n <div #wraper class=\"wraper\">\n <div class=\"loading\" *ngIf=\"(!cameraReady && !preview) || scaning\">\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n\n <ng-container *ngIf=\"!error\">\n <ngx-scandoc-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main\"\n #webcam\n type=\"document\"\n [trigger]=\"trigger\"\n [imageHandler]=\"imageHandler\"\n (imageCapture)=\"handleImage($event)\"\n (initError)=\"handleInitError($event)\"\n (destroyed)=\"cameraOff($event)\"\n (videoReady)=\"videoReady($event)\"\n [refresh]=\"refresh\"\n >\n </ngx-scandoc-webcam>\n </ng-container>\n <div\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"\n z-index: 20;\n display: flex;\n position: absolute;\n width: 100%;\n height: 100%;\n \"\n >\n <div class=\"p-16 error\" *ngIf=\"error\">\n <div>\n <div class=\"title\">\n <mat-icon>error_outline</mat-icon\n ><span class=\"ml-8\">{{\n \"scandoc.unableToDetectId\" | translate\n }}</span>\n </div>\n\n <ng-container *ngIf=\"errorCode === '1001'\">\n <div>\n {{ \"scandoc.extraction.c1001\" | translate }}\n </div>\n </ng-container>\n <ng-container *ngIf=\"errorCode === '1002'\">\n <div>\n {{ \"scandoc.extraction.c1002\" | translate }}\n </div>\n </ng-container>\n\n <ul *ngIf=\"errorCode === '1000'\">\n <li>\n {{ \"scandoc.placeIdCloseToDevice\" | translate }}\n </li>\n <li>\n {{ \"scandoc.ensureSufficientLight\" | translate }}\n </li>\n <li>\n {{ \"scandoc.holdDocumentSteady\" | translate }}\n </li>\n <li>\n {{ \"scandoc.makeSureAllEdgesOfTheIdAreVisible\" | translate }}\n </li>\n <li>\n {{\n \"scandoc.makeSureThereAreNoGlareAndShadowsOnTheId\" | translate\n }}\n </li>\n </ul>\n </div>\n </div>\n\n <div class=\"scanPreview\" *ngIf=\"!error && !scaning\">\n <!-- <div class=\"py-16\" style=\"font-size: 16px\">\n {{\n \"scandoc.ensureAllTextsAreVisible\"\n | translate\n }}\n </div> -->\n <div\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer *ngIf=\"preview\">\n <!-- <div class=\"displayInfo\" *ngIf=\"!preview && cameraReady\">\n <ng-container *ngIf=\"displayInfo\">\n {{ displayInfo | translate }}\n </ng-container>\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 {{ \"scandoc.captureBack\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"idScan === 'FRONT'\">\n Turn document and:\n {{ \"scandoc.captureFront\" | translate }}\n </ng-container>\n </div>\n </div> -->\n\n <div class=\"actions\" *ngIf=\"preview\">\n <button class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n {{ \"scandoc.retry\" | translate }}\n </button>\n\n <button\n [disabled]=\"error\"\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n {{ \"scandoc.continueWithSelectedImage\" | translate }}\n </button>\n </div>\n </footer>\n </section>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5;overflow:hidden;position:relative}:host.mobile .hint{font-size:13px}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;display:flex;flex-direction:row;align-items:center;justify-content:center;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}.manualMode{position:absolute;width:100%;height:100%;z-index:200;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.manualMode .content{margin-top:20px;background-color:#fff;border-radius:6px;max-width:300px;width:100%;display:flex;flex-direction:column;padding:30px 20px 0}.manualMode .inner{display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:14px}.manualMode .inner mat-icon{width:60px;height:60px;font-size:60px}.manualMode .inner .text{margin:20px 0}.manualMode footer{display:flex;flex-direction:row;align-items:center;justify-content:center;padding-bottom:20px}.manualMode footer button{min-width:140px;box-shadow:none;border:1px solid #ccc}.pageTurn{position:absolute;width:100%;height:100%;z-index:200;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.pageTurn .content{background-color:#fff;border-radius:6px;max-width:300px;width:100%;display:flex;flex-direction:column;padding:30px 20px 0}.pageTurn .inner{display:flex;flex-direction:column;align-items:center;justify-content:center}.pageTurn .inner mat-icon{width:60px;height:60px;font-size:60px}.pageTurn .inner .text{margin:20px 0;font-size:14px}.pageTurn footer{display:flex;flex-direction:row;align-items:center;justify-content:center;padding-bottom:20px}.pageTurn footer button{min-width:200px;box-shadow:none;border:1px solid #ccc}.hint{position:absolute;z-index:5;font-size:18px;line-height:18px;display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%}.hint .text{border-radius:3px;padding:4px 8px;background-color:#000;color:#fff;text-align:center;display:inline;-webkit-box-decoration-break:clone;box-decoration-break:clone}\n"] }]
|
|
2621
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: NgxScandocCameraProvider }, { type: i0.Injector }, { type: LayoutProvider }, { type: i2.Platform }, { type: i4$2.DeviceDetectorService }, { type: NgxScandocAuthProvider }], propDecorators: { type: [{
|
|
2622
|
-
type: Input
|
|
2623
|
-
}], dialogs: [{
|
|
2624
|
-
type: Input
|
|
2625
|
-
}], refresh: [{
|
|
2626
|
-
type: Input
|
|
2627
|
-
}], actions: [{
|
|
2628
|
-
type: Output
|
|
2629
|
-
}], showDialog: [{
|
|
2630
|
-
type: Input
|
|
2631
|
-
}], class: [{
|
|
2632
|
-
type: HostBinding,
|
|
2633
|
-
args: ['class.mobile']
|
|
2634
|
-
}], onResize: [{
|
|
2635
|
-
type: HostListener,
|
|
2636
|
-
args: ['window:resize', ['$event']]
|
|
2637
|
-
}] } });
|
|
2638
|
-
|
|
2639
|
-
class MaterialModule {
|
|
2640
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2641
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: MaterialModule, imports: [MatNativeDateModule,
|
|
2642
|
-
MatDatepickerModule,
|
|
2643
|
-
MatCardModule,
|
|
2644
|
-
MatMenuModule,
|
|
2645
|
-
MatIconModule,
|
|
2646
|
-
MatButtonModule,
|
|
2647
|
-
MatDialogModule,
|
|
2648
|
-
MatInputModule,
|
|
2649
|
-
MatSnackBarModule,
|
|
2650
|
-
MatProgressBarModule,
|
|
2651
|
-
MatTableModule,
|
|
2652
|
-
MatProgressSpinnerModule,
|
|
2653
|
-
MatPaginatorModule,
|
|
2654
|
-
MatSelectModule,
|
|
2655
|
-
MatCheckboxModule,
|
|
2656
|
-
MatChipsModule,
|
|
2657
|
-
MatBadgeModule,
|
|
2658
|
-
MatListModule,
|
|
2659
|
-
MatTabsModule,
|
|
2660
|
-
MatSliderModule,
|
|
2661
|
-
MatSlideToggleModule], exports: [MatNativeDateModule,
|
|
2662
|
-
MatDatepickerModule,
|
|
2663
|
-
MatSelectModule,
|
|
2664
|
-
MatCardModule,
|
|
2665
|
-
MatMenuModule,
|
|
2666
|
-
MatIconModule,
|
|
2667
|
-
MatButtonModule,
|
|
2668
|
-
MatDialogModule,
|
|
2669
|
-
MatInputModule,
|
|
2670
|
-
MatSnackBarModule,
|
|
2671
|
-
MatProgressBarModule,
|
|
2672
|
-
MatProgressSpinnerModule,
|
|
2673
|
-
MatTableModule,
|
|
2674
|
-
MatPaginatorModule,
|
|
2675
|
-
MatChipsModule,
|
|
2676
|
-
MatBadgeModule,
|
|
2677
|
-
MatCheckboxModule,
|
|
2678
|
-
MatListModule,
|
|
2679
|
-
MatTabsModule,
|
|
2680
|
-
MatSlideToggleModule,
|
|
2681
|
-
MatAutocompleteModule] }); }
|
|
2682
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MaterialModule, imports: [MatNativeDateModule,
|
|
2683
|
-
MatDatepickerModule,
|
|
2684
|
-
MatCardModule,
|
|
2685
|
-
MatMenuModule,
|
|
2686
|
-
MatIconModule,
|
|
2687
|
-
MatButtonModule,
|
|
2688
|
-
MatDialogModule,
|
|
2689
|
-
MatInputModule,
|
|
2690
|
-
MatSnackBarModule,
|
|
2691
|
-
MatProgressBarModule,
|
|
2692
|
-
MatTableModule,
|
|
2693
|
-
MatProgressSpinnerModule,
|
|
2694
|
-
MatPaginatorModule,
|
|
2695
|
-
MatSelectModule,
|
|
2696
|
-
MatCheckboxModule,
|
|
2697
|
-
MatChipsModule,
|
|
2698
|
-
MatBadgeModule,
|
|
2699
|
-
MatListModule,
|
|
2700
|
-
MatTabsModule,
|
|
2701
|
-
MatSliderModule,
|
|
2702
|
-
MatSlideToggleModule, MatNativeDateModule,
|
|
2703
|
-
MatDatepickerModule,
|
|
2704
|
-
MatSelectModule,
|
|
2705
|
-
MatCardModule,
|
|
2706
|
-
MatMenuModule,
|
|
2707
|
-
MatIconModule,
|
|
2708
|
-
MatButtonModule,
|
|
2709
|
-
MatDialogModule,
|
|
2710
|
-
MatInputModule,
|
|
2711
|
-
MatSnackBarModule,
|
|
2712
|
-
MatProgressBarModule,
|
|
2713
|
-
MatProgressSpinnerModule,
|
|
2714
|
-
MatTableModule,
|
|
2715
|
-
MatPaginatorModule,
|
|
2716
|
-
MatChipsModule,
|
|
2717
|
-
MatBadgeModule,
|
|
2718
|
-
MatCheckboxModule,
|
|
2719
|
-
MatListModule,
|
|
2720
|
-
MatTabsModule,
|
|
2721
|
-
MatSlideToggleModule,
|
|
2722
|
-
MatAutocompleteModule] }); }
|
|
2723
|
-
}
|
|
2724
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MaterialModule, decorators: [{
|
|
2725
|
-
type: NgModule,
|
|
2726
|
-
args: [{
|
|
2727
|
-
imports: [
|
|
2728
|
-
MatNativeDateModule,
|
|
2729
|
-
MatDatepickerModule,
|
|
2730
|
-
MatCardModule,
|
|
2731
|
-
MatMenuModule,
|
|
2732
|
-
MatIconModule,
|
|
2733
|
-
MatButtonModule,
|
|
2734
|
-
MatDialogModule,
|
|
2735
|
-
MatInputModule,
|
|
2736
|
-
MatSnackBarModule,
|
|
2737
|
-
MatProgressBarModule,
|
|
2738
|
-
MatTableModule,
|
|
2739
|
-
MatProgressSpinnerModule,
|
|
2740
|
-
MatPaginatorModule,
|
|
2741
|
-
MatSelectModule,
|
|
2742
|
-
MatCheckboxModule,
|
|
2743
|
-
MatChipsModule,
|
|
2744
|
-
MatBadgeModule,
|
|
2745
|
-
MatListModule,
|
|
2746
|
-
MatTabsModule,
|
|
2747
|
-
MatSliderModule,
|
|
2748
|
-
MatSlideToggleModule,
|
|
2749
|
-
],
|
|
2750
|
-
exports: [
|
|
2751
|
-
MatNativeDateModule,
|
|
2752
|
-
MatDatepickerModule,
|
|
2753
|
-
MatSelectModule,
|
|
2754
|
-
MatCardModule,
|
|
2755
|
-
MatMenuModule,
|
|
2756
|
-
MatIconModule,
|
|
2757
|
-
MatButtonModule,
|
|
2758
|
-
MatDialogModule,
|
|
2759
|
-
MatInputModule,
|
|
2760
|
-
MatSnackBarModule,
|
|
2761
|
-
MatProgressBarModule,
|
|
2762
|
-
MatProgressSpinnerModule,
|
|
2763
|
-
MatTableModule,
|
|
2764
|
-
MatPaginatorModule,
|
|
2765
|
-
MatChipsModule,
|
|
2766
|
-
MatBadgeModule,
|
|
2767
|
-
MatCheckboxModule,
|
|
2768
|
-
MatListModule,
|
|
2769
|
-
MatTabsModule,
|
|
2770
|
-
MatSlideToggleModule,
|
|
2771
|
-
MatAutocompleteModule,
|
|
2772
|
-
],
|
|
2773
|
-
providers: [],
|
|
2774
|
-
}]
|
|
2775
|
-
}] });
|
|
2776
|
-
|
|
2777
|
-
class AvatarTypeComponent extends FieldType {
|
|
2778
|
-
constructor(cd) {
|
|
2779
|
-
super();
|
|
2780
|
-
this.cd = cd;
|
|
2781
|
-
this.width = 'w-120';
|
|
2782
|
-
this.padding = 'px-32 pt-8 pb-8';
|
|
2783
|
-
}
|
|
2784
|
-
ngOnChange() { }
|
|
2785
|
-
selfie() { }
|
|
2786
|
-
;
|
|
2787
|
-
ngAfterViewInit() {
|
|
2788
|
-
if (this.to.width) {
|
|
2789
|
-
this.width = this.to.width;
|
|
2790
|
-
}
|
|
2791
|
-
if (this.to.padding) {
|
|
2792
|
-
this.padding = this.to.padding;
|
|
2793
|
-
}
|
|
2794
|
-
this.cd.detectChanges();
|
|
2795
|
-
}
|
|
2796
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AvatarTypeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2797
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: AvatarTypeComponent, isStandalone: false, selector: "app-formly-avatar-type", usesInheritance: true, ngImport: i0, template: `
|
|
2798
|
-
<mat-card appearance="outlined" style="margin: 4px; padding:16px">
|
|
2799
|
-
<div class="card-title">{{ 'scandoc.result.avatar' | translate }}</div>
|
|
2800
|
-
<div class="selfieContainer">
|
|
2801
|
-
<div class="selfie">
|
|
2802
|
-
<img *ngIf="model?._avatar" class="preview" [src]="model._avatar" />
|
|
2803
|
-
</div>
|
|
2804
|
-
<button (click)="selfie()" mat-raised-button>
|
|
2805
|
-
{{ 'scandoc.result.takeSelfie' | translate }}
|
|
2806
|
-
</button>
|
|
2807
|
-
</div>
|
|
2808
|
-
</mat-card>
|
|
2809
|
-
`, isInline: true, styles: ["mat-card{border-radius:0;box-shadow:none!important}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }] }); }
|
|
2810
|
-
}
|
|
2811
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AvatarTypeComponent, decorators: [{
|
|
2812
|
-
type: Component,
|
|
2813
|
-
args: [{ selector: 'app-formly-avatar-type', template: `
|
|
2814
|
-
<mat-card appearance="outlined" style="margin: 4px; padding:16px">
|
|
2815
|
-
<div class="card-title">{{ 'scandoc.result.avatar' | translate }}</div>
|
|
2816
|
-
<div class="selfieContainer">
|
|
2817
|
-
<div class="selfie">
|
|
2818
|
-
<img *ngIf="model?._avatar" class="preview" [src]="model._avatar" />
|
|
2819
|
-
</div>
|
|
2820
|
-
<button (click)="selfie()" mat-raised-button>
|
|
2821
|
-
{{ 'scandoc.result.takeSelfie' | translate }}
|
|
2822
|
-
</button>
|
|
2823
|
-
</div>
|
|
2824
|
-
</mat-card>
|
|
2825
|
-
`, standalone: false, styles: ["mat-card{border-radius:0;box-shadow:none!important}\n"] }]
|
|
2826
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
|
|
2827
|
-
|
|
2828
|
-
class TitleTypeComponent extends FieldType {
|
|
2829
|
-
constructor(cd) {
|
|
2830
|
-
super();
|
|
2831
|
-
this.cd = cd;
|
|
2832
|
-
}
|
|
2833
|
-
ngOnInit() {
|
|
2834
|
-
this.opt = {
|
|
2835
|
-
badge: this.to.badge,
|
|
2836
|
-
};
|
|
2837
|
-
}
|
|
2838
|
-
ngAfterViewInit() {
|
|
2839
|
-
this.cd.detectChanges();
|
|
2840
|
-
}
|
|
2841
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TitleTypeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2842
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: TitleTypeComponent, isStandalone: false, selector: "app-formly-title-type", usesInheritance: true, ngImport: i0, template: `
|
|
2843
|
-
<div class="card-title">
|
|
2844
|
-
{{ to.label }}
|
|
2845
|
-
</div>
|
|
2846
|
-
`, isInline: true, styles: [""] }); }
|
|
2847
|
-
}
|
|
2848
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TitleTypeComponent, decorators: [{
|
|
2849
|
-
type: Component,
|
|
2850
|
-
args: [{ selector: 'app-formly-title-type', template: `
|
|
2851
|
-
<div class="card-title">
|
|
2852
|
-
{{ to.label }}
|
|
2853
|
-
</div>
|
|
2854
|
-
`, standalone: false }]
|
|
2855
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
|
|
2856
|
-
|
|
2857
|
-
class ProfileImageTypeComponent extends FieldType {
|
|
2858
|
-
constructor(cd, cameraProvider, scanProvider) {
|
|
2859
|
-
super();
|
|
2860
|
-
this.cd = cd;
|
|
2861
|
-
this.cameraProvider = cameraProvider;
|
|
2862
|
-
this.scanProvider = scanProvider;
|
|
2863
|
-
}
|
|
2864
|
-
selfie() {
|
|
2865
|
-
this.cameraProvider.selfie$.next(true);
|
|
2866
|
-
}
|
|
2867
|
-
ngOnChange() { }
|
|
2868
|
-
ngAfterViewInit() { }
|
|
2869
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProfileImageTypeComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: NgxScandocCameraProvider }, { token: ScanProvider }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2870
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ProfileImageTypeComponent, isStandalone: false, selector: "app-formly-profile-image-type", usesInheritance: true, ngImport: i0, template: `
|
|
2871
|
-
<mat-form-field>
|
|
2872
|
-
<mat-label>{{ 'scandoc.result.avatar' | translate }} </mat-label>
|
|
2873
|
-
<input matInput style="display:none" />
|
|
2874
|
-
<div class="selfieContainer">
|
|
2875
|
-
<div class="selfie">
|
|
2876
|
-
<img *ngIf="model?._avatar" class="preview" [src]="model._avatar" />
|
|
2877
|
-
</div>
|
|
2878
|
-
<button
|
|
2879
|
-
*ngIf="scanProvider.enableVerification"
|
|
2880
|
-
(click)="selfie()"
|
|
2881
|
-
mat-raised-button
|
|
2882
|
-
>
|
|
2883
|
-
{{ 'scandoc.result.takeSelfie' | translate }}
|
|
2884
|
-
</button>
|
|
2885
|
-
</div>
|
|
2886
|
-
</mat-form-field>
|
|
2887
|
-
`, isInline: true, styles: [".selfieContainer{display:flex;flex-direction:column;align-items:center;justify-content:center}.selfieContainer button{margin-top:6px;box-shadow:none!important;border:1px solid rgba(0,0,0,.12);text-transform:uppercase;font-size:12px}.selfie{width:126px;height:126px;border-radius:70px;background:#f5f5f5;display:flex;flex-direction:column;align-items:center;justify-content:center}.selfie img{width:120px;height:120px;border-radius:60px}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4$3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$3.MatLabel, selector: "mat-label" }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i4$3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }] }); }
|
|
2888
|
-
}
|
|
2889
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProfileImageTypeComponent, decorators: [{
|
|
2890
|
-
type: Component,
|
|
2891
|
-
args: [{ selector: 'app-formly-profile-image-type', template: `
|
|
2892
|
-
<mat-form-field>
|
|
2893
|
-
<mat-label>{{ 'scandoc.result.avatar' | translate }} </mat-label>
|
|
2894
|
-
<input matInput style="display:none" />
|
|
2895
|
-
<div class="selfieContainer">
|
|
2896
|
-
<div class="selfie">
|
|
2897
|
-
<img *ngIf="model?._avatar" class="preview" [src]="model._avatar" />
|
|
2898
|
-
</div>
|
|
2899
|
-
<button
|
|
2900
|
-
*ngIf="scanProvider.enableVerification"
|
|
2901
|
-
(click)="selfie()"
|
|
2902
|
-
mat-raised-button
|
|
2903
|
-
>
|
|
2904
|
-
{{ 'scandoc.result.takeSelfie' | translate }}
|
|
2905
|
-
</button>
|
|
2906
|
-
</div>
|
|
2907
|
-
</mat-form-field>
|
|
2908
|
-
`, standalone: false, styles: [".selfieContainer{display:flex;flex-direction:column;align-items:center;justify-content:center}.selfieContainer button{margin-top:6px;box-shadow:none!important;border:1px solid rgba(0,0,0,.12);text-transform:uppercase;font-size:12px}.selfie{width:126px;height:126px;border-radius:70px;background:#f5f5f5;display:flex;flex-direction:column;align-items:center;justify-content:center}.selfie img{width:120px;height:120px;border-radius:60px}\n"] }]
|
|
2909
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: NgxScandocCameraProvider }, { type: ScanProvider }] });
|
|
2910
|
-
|
|
2911
|
-
class AppFormModule {
|
|
2912
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2913
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: AppFormModule, declarations: [TitleTypeComponent,
|
|
2914
|
-
AvatarTypeComponent,
|
|
2915
|
-
ProfileImageTypeComponent], imports: [CommonModule,
|
|
2916
|
-
FormsModule,
|
|
2917
|
-
FormlyMatDatepickerModule,
|
|
2918
|
-
FormlySelectModule,
|
|
2919
|
-
MaterialModule,
|
|
2920
|
-
AvatarModule,
|
|
2921
|
-
TranslateModule,
|
|
2922
|
-
FormlyMaterialModule, i1$2.FormlyModule], exports: [FormlyModule] }); }
|
|
2923
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppFormModule, imports: [CommonModule,
|
|
2924
|
-
FormsModule,
|
|
2925
|
-
FormlyMatDatepickerModule,
|
|
2926
|
-
FormlySelectModule,
|
|
2927
|
-
MaterialModule,
|
|
2928
|
-
AvatarModule,
|
|
2929
|
-
TranslateModule,
|
|
2930
|
-
FormlyMaterialModule,
|
|
2931
|
-
FormlyModule.forChild({
|
|
2932
|
-
types: [
|
|
2933
|
-
{
|
|
2934
|
-
name: 'title',
|
|
2935
|
-
component: TitleTypeComponent,
|
|
2936
|
-
wrappers: [],
|
|
2937
|
-
},
|
|
2938
|
-
{
|
|
2939
|
-
name: 'profile-image',
|
|
2940
|
-
component: ProfileImageTypeComponent,
|
|
2941
|
-
wrappers: [],
|
|
2942
|
-
},
|
|
2943
|
-
],
|
|
2944
|
-
}), FormlyModule] }); }
|
|
2945
|
-
}
|
|
2946
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppFormModule, decorators: [{
|
|
2947
|
-
type: NgModule,
|
|
2948
|
-
args: [{
|
|
2949
|
-
declarations: [
|
|
2950
|
-
TitleTypeComponent,
|
|
2951
|
-
AvatarTypeComponent,
|
|
2952
|
-
ProfileImageTypeComponent,
|
|
2953
|
-
],
|
|
2954
|
-
imports: [
|
|
2955
|
-
CommonModule,
|
|
2956
|
-
FormsModule,
|
|
2957
|
-
FormlyMatDatepickerModule,
|
|
2958
|
-
FormlySelectModule,
|
|
2959
|
-
MaterialModule,
|
|
2960
|
-
AvatarModule,
|
|
2961
|
-
TranslateModule,
|
|
2962
|
-
FormlyMaterialModule,
|
|
2963
|
-
FormlyModule.forChild({
|
|
2964
|
-
types: [
|
|
2965
|
-
{
|
|
2966
|
-
name: 'title',
|
|
2967
|
-
component: TitleTypeComponent,
|
|
2968
|
-
wrappers: [],
|
|
2969
|
-
},
|
|
2970
|
-
{
|
|
2971
|
-
name: 'profile-image',
|
|
2972
|
-
component: ProfileImageTypeComponent,
|
|
2973
|
-
wrappers: [],
|
|
2974
|
-
},
|
|
2975
|
-
],
|
|
2976
|
-
}),
|
|
2977
|
-
],
|
|
2978
|
-
providers: [],
|
|
2979
|
-
exports: [FormlyModule],
|
|
2980
|
-
}]
|
|
2981
|
-
}] });
|
|
2982
|
-
|
|
2983
|
-
class CameraSwitchComponent {
|
|
2984
|
-
constructor(cameraProvider) {
|
|
2985
|
-
this.cameraProvider = cameraProvider;
|
|
2986
|
-
}
|
|
2987
|
-
ngAfterViewInit() {
|
|
2988
|
-
// this.cameraProvider.setDefault();
|
|
2989
|
-
}
|
|
2990
|
-
ngOnDestroy() { }
|
|
2991
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CameraSwitchComponent, deps: [{ token: NgxScandocCameraProvider }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2992
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: CameraSwitchComponent, isStandalone: false, selector: "ngx-scan-camera-switch", ngImport: i0, template: "<mat-form-field\n style=\"font-size: 14px; margin-top: 8px\"\n class=\"w-100-p mr-16 mt-8\"\n\n>\n <mat-label> {{ \"scandoc.camera\" | translate }} </mat-label>\n <mat-select\n (selectionChange)=\"cameraProvider.selectCamera($event)\"\n [(ngModel)]=\"cameraProvider.deviceId\"\n >\n <mat-option\n *ngFor=\"let device of cameraProvider.mediaDevices\"\n [value]=\"device.deviceId\"\n >\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: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4$3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$3.MatLabel, selector: "mat-label" }, { kind: "component", type: i5$3.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i5$3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }] }); }
|
|
2993
|
-
}
|
|
2994
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CameraSwitchComponent, decorators: [{
|
|
2995
|
-
type: Component,
|
|
2996
|
-
args: [{ selector: 'ngx-scan-camera-switch', standalone: false, template: "<mat-form-field\n style=\"font-size: 14px; margin-top: 8px\"\n class=\"w-100-p mr-16 mt-8\"\n\n>\n <mat-label> {{ \"scandoc.camera\" | translate }} </mat-label>\n <mat-select\n (selectionChange)=\"cameraProvider.selectCamera($event)\"\n [(ngModel)]=\"cameraProvider.deviceId\"\n >\n <mat-option\n *ngFor=\"let device of cameraProvider.mediaDevices\"\n [value]=\"device.deviceId\"\n >\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"] }]
|
|
2997
|
-
}], ctorParameters: () => [{ type: NgxScandocCameraProvider }] });
|
|
2998
|
-
|
|
2999
|
-
const TRANSLATION_PROVIDER = new InjectionToken('Injection token for translation providers.');
|
|
3000
|
-
class NgxScanDocTranslationProvider {
|
|
3001
|
-
constructor(translate, injector,
|
|
3002
|
-
//@Optional() @Inject(SCAN_CONFIG_TOKEN) config: ScanConfig,
|
|
3003
|
-
providers, platformLocation) {
|
|
3004
|
-
this.translate = translate;
|
|
3005
|
-
this.injector = injector;
|
|
3006
|
-
this.platformLocation = platformLocation;
|
|
3007
|
-
console.log('MM', Math.random());
|
|
3008
|
-
this.customLoader = this.translate.currentLoader;
|
|
3009
|
-
//console.log('config',config)
|
|
3010
|
-
// console.log(this.translate)
|
|
3011
|
-
if (providers && providers.length > 0) {
|
|
3012
|
-
for (const provider of providers) {
|
|
3013
|
-
this.addTranslationFolder(provider.name, provider.source);
|
|
3014
|
-
}
|
|
3015
|
-
}
|
|
3016
|
-
}
|
|
3017
|
-
path(path) {
|
|
3018
|
-
return path;
|
|
3019
|
-
// const baseHref = this.platformLocation
|
|
3020
|
-
// .getBaseHrefFromDOM()
|
|
3021
|
-
// .split('/')
|
|
3022
|
-
// .join('');
|
|
3023
|
-
// return baseHref != '' ? `/${baseHref}${path}` : path;
|
|
3024
|
-
}
|
|
3025
|
-
setDefaultLang(lang) {
|
|
3026
|
-
this.defaultLang = lang;
|
|
3027
|
-
this.translate.setDefaultLang(this.defaultLang);
|
|
3028
|
-
}
|
|
3029
|
-
registerTranslationFolder(name = '', path = '') {
|
|
3030
|
-
console.log(name, path, this.userLang, this.defaultLang);
|
|
3031
|
-
if (!this.customLoader.providerRegistered(name)) {
|
|
3032
|
-
this.customLoader.registerProvider(name, this.path(path));
|
|
3033
|
-
}
|
|
3034
|
-
}
|
|
3035
|
-
addTranslationFolder(name = '', path = '') {
|
|
3036
|
-
console.log(name, path, this.userLang, this.defaultLang);
|
|
3037
|
-
if (!this.customLoader.providerRegistered(name)) {
|
|
3038
|
-
this.customLoader.registerProvider(name, this.path(path));
|
|
3039
|
-
if (this.userLang) {
|
|
3040
|
-
const existCurrentLang = this.translate.currentLang ? true : false;
|
|
3041
|
-
this.loadTranslation(this.userLang, this.defaultLang, !existCurrentLang);
|
|
3042
|
-
}
|
|
3043
|
-
else {
|
|
3044
|
-
this.loadTranslation(this.defaultLang);
|
|
3045
|
-
}
|
|
3046
|
-
}
|
|
3047
|
-
}
|
|
3048
|
-
loadTranslation(lang, fallback, useLang = true) {
|
|
3049
|
-
this.translate.getTranslation(lang).subscribe((resp) => {
|
|
3050
|
-
this.onTranslationChanged(lang);
|
|
3051
|
-
if (useLang) {
|
|
3052
|
-
setTimeout(() => {
|
|
3053
|
-
this.translate.use(lang);
|
|
3054
|
-
}, 20);
|
|
3055
|
-
}
|
|
3056
|
-
// this.translate.reloadLang(lang)
|
|
3057
|
-
}, () => {
|
|
3058
|
-
if (fallback && fallback !== lang) {
|
|
3059
|
-
this.loadTranslation(fallback);
|
|
3060
|
-
}
|
|
3061
|
-
});
|
|
3062
|
-
}
|
|
3063
|
-
updateTranslation(lang, fallback) {
|
|
3064
|
-
return this.translate.getTranslation(lang).pipe(catchError(() => {
|
|
3065
|
-
if (fallback && fallback !== lang) {
|
|
3066
|
-
return this.updateTranslation(fallback);
|
|
3067
|
-
}
|
|
3068
|
-
return this.translate.use(lang);
|
|
3069
|
-
}), switchMap(() => {
|
|
3070
|
-
this.onTranslationChanged(lang);
|
|
3071
|
-
return this.translate.use(lang);
|
|
3072
|
-
}));
|
|
3073
|
-
}
|
|
3074
|
-
onTranslationChanged(lang) {
|
|
3075
|
-
this.translate.onTranslationChange.next({
|
|
3076
|
-
lang,
|
|
3077
|
-
translations: this.customLoader.getFullTranslationJSON(lang),
|
|
3078
|
-
});
|
|
3079
|
-
}
|
|
3080
|
-
use(lang) {
|
|
3081
|
-
this.customLoader.init(lang);
|
|
3082
|
-
return this.updateTranslation(lang);
|
|
3083
|
-
}
|
|
3084
|
-
forms(item, namespace = null) {
|
|
3085
|
-
if (item.fieldGroup) {
|
|
3086
|
-
item.fieldGroup = item.fieldGroup.map((field) => this.forms(field));
|
|
3087
|
-
}
|
|
3088
|
-
const prefix = namespace ? namespace + '.' : '';
|
|
3089
|
-
if (item.props &&
|
|
3090
|
-
(item.props.label || item.props.placeholder || item.props.options)) {
|
|
3091
|
-
if (!item.expressions) {
|
|
3092
|
-
item.expressions = {};
|
|
3093
|
-
}
|
|
3094
|
-
if (item.props.label) {
|
|
3095
|
-
item.expressions['props.label'] = this.translate.stream(prefix + item.props.label);
|
|
3096
|
-
}
|
|
3097
|
-
if (item.props.placeholder) {
|
|
3098
|
-
item.expressions['props.placeholder'] = this.translate.stream(prefix + item.props.placeholder);
|
|
3099
|
-
}
|
|
3100
|
-
if (Array.isArray(item.props.options)) {
|
|
3101
|
-
item.expressions['props.options'] = item.props.options.map((m) => {
|
|
3102
|
-
// console.log(m);
|
|
3103
|
-
if (m.label) {
|
|
3104
|
-
m.label = this.translate.instant(prefix + m.label);
|
|
3105
|
-
}
|
|
3106
|
-
return m;
|
|
3107
|
-
});
|
|
3108
|
-
}
|
|
3109
|
-
}
|
|
3110
|
-
return item;
|
|
3111
|
-
}
|
|
3112
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScanDocTranslationProvider, deps: [{ token: i4$1.TranslateService }, { token: i0.Injector }, { token: TRANSLATION_PROVIDER, optional: true }, { token: i4.PlatformLocation }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3113
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScanDocTranslationProvider, providedIn: 'root' }); }
|
|
3114
|
-
}
|
|
3115
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScanDocTranslationProvider, decorators: [{
|
|
3116
|
-
type: Injectable,
|
|
3117
|
-
args: [{
|
|
3118
|
-
providedIn: 'root',
|
|
3119
|
-
}]
|
|
3120
|
-
}], ctorParameters: () => [{ type: i4$1.TranslateService }, { type: i0.Injector }, { type: undefined, decorators: [{
|
|
3121
|
-
type: Optional
|
|
3122
|
-
}, {
|
|
3123
|
-
type: Inject,
|
|
3124
|
-
args: [TRANSLATION_PROVIDER]
|
|
3125
|
-
}] }, { type: i4.PlatformLocation }] });
|
|
3126
|
-
|
|
3127
|
-
class NgxScandocFieldsProvider {
|
|
3128
|
-
constructor(translate, provider) {
|
|
3129
|
-
this.translate = translate;
|
|
3130
|
-
this.provider = provider;
|
|
3131
|
-
this.selfie$ = new Subject();
|
|
3132
|
-
}
|
|
3133
|
-
update() {
|
|
3134
|
-
return [
|
|
3135
|
-
{
|
|
3136
|
-
fieldGroupClassName: 'px-16',
|
|
3137
|
-
fieldGroup: [
|
|
3138
|
-
{
|
|
3139
|
-
wrappers: [],
|
|
3140
|
-
type: 'checkbox',
|
|
3141
|
-
key: 'profile',
|
|
3142
|
-
class: 'checkbox ',
|
|
3143
|
-
defaultValue: true,
|
|
3144
|
-
props: {
|
|
3145
|
-
label: 'scandoc.form.scan.document.update.profile',
|
|
3146
|
-
},
|
|
3147
|
-
},
|
|
3148
|
-
{
|
|
3149
|
-
wrappers: [],
|
|
3150
|
-
type: 'checkbox',
|
|
3151
|
-
class: 'checkbox ',
|
|
3152
|
-
key: 'document',
|
|
3153
|
-
defaultValue: true,
|
|
3154
|
-
props: {
|
|
3155
|
-
label: 'scandoc.form.scan.document.update.document',
|
|
3156
|
-
},
|
|
3157
|
-
},
|
|
3158
|
-
{
|
|
3159
|
-
wrappers: [],
|
|
3160
|
-
type: 'checkbox',
|
|
3161
|
-
class: 'checkbox ',
|
|
3162
|
-
key: 'attachment',
|
|
3163
|
-
defaultValue: true,
|
|
3164
|
-
props: {
|
|
3165
|
-
label: 'scandoc.form.scan.document.update.attachment',
|
|
3166
|
-
},
|
|
3167
|
-
},
|
|
3168
|
-
].map((item) => this.translate.forms(item)),
|
|
3169
|
-
},
|
|
3170
|
-
];
|
|
3171
|
-
}
|
|
3172
|
-
document() {
|
|
3173
|
-
if (this.customFields) {
|
|
3174
|
-
return this.customFields;
|
|
3175
|
-
}
|
|
3176
|
-
return [
|
|
1827
|
+
return [
|
|
3177
1828
|
{
|
|
3178
1829
|
className: 'w-100-p',
|
|
3179
1830
|
fieldGroupClassName: 'form-flex-row profile-details',
|
|
@@ -3452,72 +2103,1417 @@ class NgxScandocFieldsProvider {
|
|
|
3452
2103
|
},
|
|
3453
2104
|
],
|
|
3454
2105
|
},
|
|
3455
|
-
],
|
|
2106
|
+
],
|
|
2107
|
+
},
|
|
2108
|
+
].map((item) => this.translate.forms(item));
|
|
2109
|
+
}
|
|
2110
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScandocFieldsProvider, deps: [{ token: NgxScanDocTranslationProvider }, { token: ScanProvider }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2111
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScandocFieldsProvider, providedIn: 'root' }); }
|
|
2112
|
+
}
|
|
2113
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScandocFieldsProvider, decorators: [{
|
|
2114
|
+
type: Injectable,
|
|
2115
|
+
args: [{
|
|
2116
|
+
providedIn: 'root',
|
|
2117
|
+
}]
|
|
2118
|
+
}], ctorParameters: () => [{ type: NgxScanDocTranslationProvider }, { type: ScanProvider }] });
|
|
2119
|
+
|
|
2120
|
+
class ScanResultsDataComponent extends BaseComponent {
|
|
2121
|
+
constructor(formProvider, cd, zone) {
|
|
2122
|
+
super();
|
|
2123
|
+
this.formProvider = formProvider;
|
|
2124
|
+
this.cd = cd;
|
|
2125
|
+
this.zone = zone;
|
|
2126
|
+
this.action = new EventEmitter();
|
|
2127
|
+
}
|
|
2128
|
+
ngOnInit() {
|
|
2129
|
+
this.fields = this.formProvider.document();
|
|
2130
|
+
this.__subs(this.data).subscribe((resp) => {
|
|
2131
|
+
this.zone.run(() => {
|
|
2132
|
+
switch (resp.type) {
|
|
2133
|
+
case 'avatar':
|
|
2134
|
+
this.model._avatar = resp.data;
|
|
2135
|
+
this.form = new FormGroup({});
|
|
2136
|
+
console.log(this.model);
|
|
2137
|
+
break;
|
|
2138
|
+
case 'model':
|
|
2139
|
+
this.model = resp.data;
|
|
2140
|
+
break;
|
|
2141
|
+
}
|
|
2142
|
+
this.cd.detectChanges();
|
|
2143
|
+
});
|
|
2144
|
+
});
|
|
2145
|
+
}
|
|
2146
|
+
ngOnDestroy() {
|
|
2147
|
+
this.__destroy();
|
|
2148
|
+
}
|
|
2149
|
+
selfie() {
|
|
2150
|
+
this.action.emit({ selfie: true });
|
|
2151
|
+
}
|
|
2152
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanResultsDataComponent, deps: [{ token: NgxScandocFieldsProvider }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2153
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ScanResultsDataComponent, isStandalone: false, selector: "ngx-scan-results-data", inputs: { data: "data", images: "images", form: "form" }, outputs: { action: "action" }, usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"model\" class=\"wraper\">\n <div style=\"flex: 1\">\n <form class=\"py-0 w-100-p\" [formGroup]=\"form\">\n <formly-form fxFlex [form]=\"form\" [fields]=\"fields\" [model]=\"model\">\n </formly-form>\n </form>\n </div>\n <div style=\"flex: 1\">\n <mat-card\n appearance=\"outlined\"\n style=\"margin: 0px 4px; padding: 16px\"\n class=\"images\"\n >\n <h3>{{ \"scandoc.result.images\" | translate }}</h3>\n <ng-container *ngFor=\"let img of model.images\">\n <div fxLayout=\"column\">\n <ng-container *ngIf=\"img.side === 0\">\n <div class=\"title\">\n {{ \"scandoc.result.frontSide\" | translate }}\n </div>\n </ng-container>\n <ng-container *ngIf=\"img.side === 1\">\n <div class=\"title\">{{ \"scandoc.result.backSide\" | translate }}</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-y:auto;overflow-x:hidden}.images .title{padding:8px 0;font-weight:600}.images img{margin-bottom:16px;width:100%}.wraper{padding:4px;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: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: i4.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: i5.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
2154
|
+
}
|
|
2155
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanResultsDataComponent, decorators: [{
|
|
2156
|
+
type: Component,
|
|
2157
|
+
args: [{ selector: 'ngx-scan-results-data', standalone: false, template: "<div *ngIf=\"model\" class=\"wraper\">\n <div style=\"flex: 1\">\n <form class=\"py-0 w-100-p\" [formGroup]=\"form\">\n <formly-form fxFlex [form]=\"form\" [fields]=\"fields\" [model]=\"model\">\n </formly-form>\n </form>\n </div>\n <div style=\"flex: 1\">\n <mat-card\n appearance=\"outlined\"\n style=\"margin: 0px 4px; padding: 16px\"\n class=\"images\"\n >\n <h3>{{ \"scandoc.result.images\" | translate }}</h3>\n <ng-container *ngFor=\"let img of model.images\">\n <div fxLayout=\"column\">\n <ng-container *ngIf=\"img.side === 0\">\n <div class=\"title\">\n {{ \"scandoc.result.frontSide\" | translate }}\n </div>\n </ng-container>\n <ng-container *ngIf=\"img.side === 1\">\n <div class=\"title\">{{ \"scandoc.result.backSide\" | translate }}</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-y:auto;overflow-x:hidden}.images .title{padding:8px 0;font-weight:600}.images img{margin-bottom:16px;width:100%}.wraper{padding:4px;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"] }]
|
|
2158
|
+
}], ctorParameters: () => [{ type: NgxScandocFieldsProvider }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }], propDecorators: { data: [{
|
|
2159
|
+
type: Input
|
|
2160
|
+
}], images: [{
|
|
2161
|
+
type: Input
|
|
2162
|
+
}], form: [{
|
|
2163
|
+
type: Input
|
|
2164
|
+
}], action: [{
|
|
2165
|
+
type: Output
|
|
2166
|
+
}] } });
|
|
2167
|
+
|
|
2168
|
+
class ManualScanComponent extends BaseComponent {
|
|
2169
|
+
get class() {
|
|
2170
|
+
return this.isMobile;
|
|
2171
|
+
}
|
|
2172
|
+
onResize() {
|
|
2173
|
+
if (this.wraper) {
|
|
2174
|
+
this.width = this.wraper.nativeElement.clientWidth;
|
|
2175
|
+
this.height = this.wraper.nativeElement.clientHeight;
|
|
2176
|
+
setTimeout(() => {
|
|
2177
|
+
const video = this.wraper?.nativeElement.querySelector('video');
|
|
2178
|
+
if (video) {
|
|
2179
|
+
// console.log(video.clientWidth, video.clientHeight);
|
|
2180
|
+
this.videoWidth = video.clientWidth;
|
|
2181
|
+
this.videoHeight = video.clientHeight;
|
|
2182
|
+
}
|
|
2183
|
+
this.cd.detectChanges();
|
|
2184
|
+
}, 100);
|
|
2185
|
+
this.cd.detectChanges();
|
|
2186
|
+
}
|
|
2187
|
+
}
|
|
2188
|
+
constructor(cameraProvider, cd, layoutProvider, zone) {
|
|
2189
|
+
super();
|
|
2190
|
+
this.cameraProvider = cameraProvider;
|
|
2191
|
+
this.cd = cd;
|
|
2192
|
+
this.layoutProvider = layoutProvider;
|
|
2193
|
+
this.zone = zone;
|
|
2194
|
+
this.action = new EventEmitter();
|
|
2195
|
+
this.videoOptions = {
|
|
2196
|
+
width: 1920,
|
|
2197
|
+
height: 1080,
|
|
2198
|
+
facingMode: 'environment',
|
|
2199
|
+
};
|
|
2200
|
+
this.cameraReady = false;
|
|
2201
|
+
this.scanBlastData = [
|
|
2202
|
+
{
|
|
2203
|
+
title: 'scandoc.front',
|
|
2204
|
+
description: 'scandoc.frontDescription',
|
|
2205
|
+
side: 'FRONT',
|
|
2206
|
+
},
|
|
2207
|
+
{
|
|
2208
|
+
title: 'scandoc.back',
|
|
2209
|
+
description: 'scandoc.backDescription',
|
|
2210
|
+
disabled: true,
|
|
2211
|
+
side: 'BACK',
|
|
2212
|
+
},
|
|
2213
|
+
];
|
|
2214
|
+
this.error = false;
|
|
2215
|
+
this.scaning = false;
|
|
2216
|
+
this.documentTypeSelected = false;
|
|
2217
|
+
this.preview = null;
|
|
2218
|
+
this.scanDatas = [];
|
|
2219
|
+
this.trigger = new Subject();
|
|
2220
|
+
// switch to next / previous / specific webcam; true/false: forward/backwards, string: deviceId
|
|
2221
|
+
this.nextWebcam = new Subject();
|
|
2222
|
+
this.isMobile = false;
|
|
2223
|
+
}
|
|
2224
|
+
ngOnInit() {
|
|
2225
|
+
this.__subs(this.layoutProvider.breakpoint$).subscribe((v) => {
|
|
2226
|
+
this.zone.run(() => {
|
|
2227
|
+
this.isMobile = !v.matches;
|
|
2228
|
+
setTimeout(() => {
|
|
2229
|
+
console.log('WTF');
|
|
2230
|
+
this.cd.detectChanges();
|
|
2231
|
+
}, 200);
|
|
2232
|
+
});
|
|
2233
|
+
console.log('MNOBILE', this.isMobile);
|
|
2234
|
+
});
|
|
2235
|
+
}
|
|
2236
|
+
get nextWebcamObservable() {
|
|
2237
|
+
return this.nextWebcam.asObservable();
|
|
2238
|
+
}
|
|
2239
|
+
cameraWasSwitched(deviceId) {
|
|
2240
|
+
console.log('[active device]', deviceId);
|
|
2241
|
+
// this.deviceId = deviceId;
|
|
2242
|
+
// this.cameraReady = true;
|
|
2243
|
+
// this.defaultDevice = deviceId;
|
|
2244
|
+
setTimeout(() => {
|
|
2245
|
+
this.onResize();
|
|
2246
|
+
// this.scan();
|
|
2247
|
+
}, 300);
|
|
2248
|
+
}
|
|
2249
|
+
handleInitError(error) {
|
|
2250
|
+
console.log(error);
|
|
2251
|
+
}
|
|
2252
|
+
resolutionLimit(file) {
|
|
2253
|
+
const minWidth = 1280;
|
|
2254
|
+
const minHeight = 720;
|
|
2255
|
+
return new Observable((observer) => {
|
|
2256
|
+
const img = new Image();
|
|
2257
|
+
img.src = window.URL.createObjectURL(file);
|
|
2258
|
+
img.onload = () => {
|
|
2259
|
+
const width = img.naturalWidth;
|
|
2260
|
+
const height = img.naturalHeight;
|
|
2261
|
+
let valid = false;
|
|
2262
|
+
if (width > height) {
|
|
2263
|
+
valid = width >= minWidth && height >= minHeight;
|
|
2264
|
+
}
|
|
2265
|
+
else {
|
|
2266
|
+
valid = width >= minHeight && height >= minWidth;
|
|
2267
|
+
}
|
|
2268
|
+
observer.next(valid);
|
|
2269
|
+
};
|
|
2270
|
+
img.onerror = (error) => {
|
|
2271
|
+
observer.error(error);
|
|
2272
|
+
};
|
|
2273
|
+
});
|
|
2274
|
+
}
|
|
2275
|
+
getImgBase64(num) {
|
|
2276
|
+
return this.scanBlastData[num].image.dataUrl.split(',')[1];
|
|
2277
|
+
}
|
|
2278
|
+
getBase64(file) {
|
|
2279
|
+
return new Observable((observer) => {
|
|
2280
|
+
const reader = new FileReader();
|
|
2281
|
+
reader.readAsDataURL(file);
|
|
2282
|
+
reader.onload = () => {
|
|
2283
|
+
observer.next(reader.result);
|
|
2284
|
+
};
|
|
2285
|
+
reader.onerror = (error) => {
|
|
2286
|
+
observer.error(error);
|
|
2287
|
+
};
|
|
2288
|
+
});
|
|
2289
|
+
}
|
|
2290
|
+
handleFileInput(target, event, side) {
|
|
2291
|
+
const files = target.files;
|
|
2292
|
+
this.selectedSide = side;
|
|
2293
|
+
console.log(files);
|
|
2294
|
+
const file = files.item(0);
|
|
2295
|
+
this.resolutionLimit(file)
|
|
2296
|
+
.pipe(switchMap$1((valid) => {
|
|
2297
|
+
return valid ? this.getBase64(file) : of(false);
|
|
2298
|
+
}))
|
|
2299
|
+
.subscribe((imageAsDataUrl) => {
|
|
2300
|
+
// console.log(imageAsDataUrl);
|
|
2301
|
+
event.target.value = null;
|
|
2302
|
+
if (!imageAsDataUrl) {
|
|
2303
|
+
console.warn('MIN RES');
|
|
2304
|
+
// this.dialogs.alert(
|
|
2305
|
+
// 'core.page.error',
|
|
2306
|
+
// this.translate.instant(
|
|
2307
|
+
// 'pms.dialogs.components.scanProfile.minResolution'
|
|
2308
|
+
// )
|
|
2309
|
+
// );
|
|
2310
|
+
}
|
|
2311
|
+
else {
|
|
2312
|
+
side.image = {
|
|
2313
|
+
_imageAsDataUrl: imageAsDataUrl,
|
|
2314
|
+
imageAsDataUrl: imageAsDataUrl,
|
|
2315
|
+
};
|
|
2316
|
+
if (this.selectedSide.side === 'FRONT') {
|
|
2317
|
+
this.scanBlastData[1].disabled = false;
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2320
|
+
this.cd.detectChanges();
|
|
2321
|
+
});
|
|
2322
|
+
}
|
|
2323
|
+
cameraOff(ev) { }
|
|
2324
|
+
ngOnDestroy() { }
|
|
2325
|
+
singleScan(side) {
|
|
2326
|
+
this.scanType = side.side;
|
|
2327
|
+
this.preview = null;
|
|
2328
|
+
this.selectedSide = side;
|
|
2329
|
+
this.selectedSide.image = null;
|
|
2330
|
+
this.documentTypeSelected = true;
|
|
2331
|
+
this.scanBlastData[1].disabled = false;
|
|
2332
|
+
this.cameraProvider.$showSwitch.next(true);
|
|
2333
|
+
this.cd.detectChanges();
|
|
2334
|
+
setTimeout(() => {
|
|
2335
|
+
this.onResize();
|
|
2336
|
+
}, 10);
|
|
2337
|
+
}
|
|
2338
|
+
scanBlastFinish() {
|
|
2339
|
+
this.action.emit(this.scanBlastData);
|
|
2340
|
+
}
|
|
2341
|
+
get scanBlastCanUpload() {
|
|
2342
|
+
return this.scanBlastData[0].image ? true : false;
|
|
2343
|
+
}
|
|
2344
|
+
handleImage(webcamImage) {
|
|
2345
|
+
console.log('[received webcam image]', webcamImage);
|
|
2346
|
+
this.webcamImage = webcamImage;
|
|
2347
|
+
this.preview = webcamImage.imageAsDataUrl;
|
|
2348
|
+
this.cameraProvider.$showSwitch.next(false);
|
|
2349
|
+
this.cd.detectChanges();
|
|
2350
|
+
}
|
|
2351
|
+
continue() {
|
|
2352
|
+
this.documentTypeSelected = false;
|
|
2353
|
+
setTimeout(() => {
|
|
2354
|
+
this.selectedSide.image = this.webcamImage;
|
|
2355
|
+
if (this.selectedSide.side === 'FRONT') {
|
|
2356
|
+
this.scanBlastData[1].disabled = false;
|
|
2357
|
+
}
|
|
2358
|
+
this.cd.detectChanges();
|
|
2359
|
+
}, 200);
|
|
2360
|
+
}
|
|
2361
|
+
retry() {
|
|
2362
|
+
this.preview = false;
|
|
2363
|
+
this.cameraProvider.$showSwitch.next(true);
|
|
2364
|
+
// this.result = false;
|
|
2365
|
+
if (this.error) {
|
|
2366
|
+
this.documentTypeSelected = false;
|
|
2367
|
+
this.scanBlastData.forEach((element) => {
|
|
2368
|
+
element.image = null;
|
|
2369
|
+
});
|
|
2370
|
+
}
|
|
2371
|
+
this.error = false;
|
|
2372
|
+
}
|
|
2373
|
+
triggerSnapshot() {
|
|
2374
|
+
this.trigger.next(0);
|
|
2375
|
+
}
|
|
2376
|
+
scan() {
|
|
2377
|
+
console.log('SCAN');
|
|
2378
|
+
this.triggerSnapshot();
|
|
2379
|
+
this.scanDatas[0] = true;
|
|
2380
|
+
console.log(this.cameraProvider);
|
|
2381
|
+
this.cd.detectChanges();
|
|
2382
|
+
}
|
|
2383
|
+
rotateBase64Image(base64data) {
|
|
2384
|
+
return new Observable((observer) => {
|
|
2385
|
+
const canvas = document.createElement('canvas');
|
|
2386
|
+
const ctx = canvas.getContext('2d');
|
|
2387
|
+
var image = new Image();
|
|
2388
|
+
image.src = base64data;
|
|
2389
|
+
image.onload = () => {
|
|
2390
|
+
console.log(canvas);
|
|
2391
|
+
canvas.width = image.height;
|
|
2392
|
+
canvas.height = image.width;
|
|
2393
|
+
if (ctx) {
|
|
2394
|
+
ctx.rotate((90 * Math.PI) / 180);
|
|
2395
|
+
ctx.translate(0, -canvas.width);
|
|
2396
|
+
ctx.drawImage(image, 0, 0);
|
|
2397
|
+
observer.next(canvas.toDataURL());
|
|
2398
|
+
}
|
|
2399
|
+
else {
|
|
2400
|
+
observer.error({ type: 'generic error' });
|
|
2401
|
+
}
|
|
2402
|
+
};
|
|
2403
|
+
image.onerror = (e) => {
|
|
2404
|
+
observer.error(e);
|
|
2405
|
+
};
|
|
2406
|
+
});
|
|
2407
|
+
}
|
|
2408
|
+
singleScanRotate(side) {
|
|
2409
|
+
console.log(side);
|
|
2410
|
+
this.rotateBase64Image(side.image.imageAsDataUrl).subscribe((data) => {
|
|
2411
|
+
side.image = { imageAsDataUrl: data };
|
|
2412
|
+
this.cd.detectChanges();
|
|
2413
|
+
});
|
|
2414
|
+
}
|
|
2415
|
+
videoReady(event) {
|
|
2416
|
+
console.log('READY', event);
|
|
2417
|
+
this.cameraReady = event;
|
|
2418
|
+
}
|
|
2419
|
+
singleScanRemove(side) {
|
|
2420
|
+
side.image = null;
|
|
2421
|
+
if (side.side === 'FRONT') {
|
|
2422
|
+
this.scanBlastData[1].disabled = true;
|
|
2423
|
+
}
|
|
2424
|
+
this.cd.detectChanges();
|
|
2425
|
+
}
|
|
2426
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ManualScanComponent, deps: [{ token: NgxScandocCameraProvider }, { token: i0.ChangeDetectorRef }, { token: LayoutProvider }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2427
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ManualScanComponent, isStandalone: false, selector: "ngx-manual-scan", outputs: { action: "action" }, 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: "\n\n<ng-container *ngIf=\"!result\">\n\n<ng-container *ngIf=\"!documentTypeSelected\">\n <section\n class=\"scanBlastWraper\"\n ngClass.lt-md=\"mobile\"\n fxFlex\n fxLayout=\"column\"\n >\n <div class=\"scanBlast\" fxFlex fxLayout.lt-md=\"column\" fxLayout=\"row\">\n <mat-card\n appearance=\"outlined\"\n style=\"display: flex; flex-direction: column\"\n fxLayout=\"column\"\n *ngFor=\"let side of scanBlastData\"\n >\n <div ngClass.lt-sm=\"small\" class=\"head\">\n <div class=\"title\" fxFlex>{{ side.title | translate }}</div>\n </div>\n <div class=\"actions\" style=\"display: flex; flex-direction: row\">\n <button\n (click)=\"singleScan(side)\"\n [disabled]=\"side.disabled\"\n style=\"margin-right: 4px\"\n mat-raised-button\n >\n <div class=\"buttonWrap\">\n <mat-icon>camera</mat-icon>\n <div>\n {{ \"scandoc.scanCamera\" | translate }}\n </div>\n </div>\n </button>\n <button\n (click)=\"file.click()\"\n [disabled]=\"side.disabled\"\n style=\"margin-left: 4px\"\n mat-raised-button\n >\n <input\n accept=\"image/*\"\n type=\"file\"\n style=\"display: none\"\n (change)=\"handleFileInput($event.target, $event, side)\"\n #file\n />\n <div class=\"buttonWrap\">\n <mat-icon>file_upload</mat-icon>\n <div>\n {{ \"scandoc.useFromDisk\" | translate }}\n </div>\n </div>\n </button>\n </div>\n <div class=\"content\" style=\"display: flex\">\n <div style=\"flex: 1\" class=\"previewPlaceholder\">\n <div class=\"description\">\n <ng-container *ngIf=\"side.image\">\n <div class=\"imgWrap\">\n <div\n style=\"flex: 1\"\n class=\"image\"\n [style.background-image]=\"\n 'url(' + side.image.imageAsDataUrl + ')'\n \"\n ></div>\n\n <div\n class=\"btnActions\"\n fxLayout.lt-md=\"column\"\n fxLayout=\"row\"\n style=\"display: flex; flex-direction: row\"\n >\n <button\n (click)=\"singleScanRemove(side)\"\n class=\"mr-4 remButton flex\"\n mat-raised-button\n >\n <div class=\"buttonWrap\">\n <mat-icon>delete</mat-icon>\n <div class=\"label\">\n {{ \"scandoc.remove\" | translate }}\n </div>\n </div>\n </button>\n <button\n class=\"ml-4 rotateButton flex\"\n mat-raised-button\n (click)=\"singleScanRotate(side)\"\n >\n <div class=\"buttonWrap\">\n <mat-icon>rotate_90_degrees_cw</mat-icon>\n <div class=\"label\">\n {{ \"scandoc.rotate\" | translate }}\n </div>\n </div>\n </button>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!side.image\">\n <div class=\"empty\">\n {{ side.description | translate }}\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </mat-card>\n </div>\n <footer>\n <div\n class=\"px-8 pb-8\"\n style=\"padding: 0px 8px 8px 8px; display: flex; flex-direction: row\"\n >\n <button\n (click)=\"scanBlastFinish()\"\n [disabled]=\"!scanBlastCanUpload\"\n style=\"flex: 1\"\n mat-raised-button\n >\n {{ \"scandoc.upload\" | translate }}\n </button>\n </div>\n </footer>\n </section>\n</ng-container>\n\n<div\n style=\"position: relative; display: flex; flex-direction: column; flex: 1\"\n *ngIf=\"documentTypeSelected\"\n>\n <div\n style=\"display: flex; flex-direction: row; flex: 1\"\n #wraper\n class=\"wraper\"\n >\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 <ngx-scandoc-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main flex\"\n\n #webcam\n [trigger]=\"trigger\"\n (imageCapture)=\"handleImage($event)\"\n(videoReady)=\"videoReady($event)\"\n (cameraSwitched)=\"cameraWasSwitched($event)\"\n (initError)=\"handleInitError($event)\"\n type=\"manual\"\n\n (destroyed)=\"cameraOff($event)\"\n >\n </ngx-scandoc-webcam>\n </ng-container>\n <div\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"\n display: flex;\n flex-direction: row;\n flex: 1;\n z-index: 20;\n position: absolute;\n width: 100%;\n height: 100%;\n \"\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 <ul>\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 style=\"display: flex; flex-direction: column; flex: 1\"\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 style=\"flex: 1\"\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 <!-- <div class=\"displayInfo\" *ngIf=\"!preview && cameraReady\">\n {{ displayInfo }}\n </div>\n <div style=\"height: 26px;\">\n <div style=\"text-align: center; font-size: 18px;\" *ngIf=\"idScan && !preview && cameraReady\">\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 \"scandoc.captureFront\" | translate\n }}</ng-container>\n <ng-container *ngIf=\"scanType === 'BACK'\">{{\n \"scandoc.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 style=\"display: flex; flex-direction: row; align-items: center; flex: 1\"\n >\n <button class=\"flex mr-4\" mat-raised-button (click)=\"retry()\">\n {{ \"scandoc.retry\" | translate }}\n </button>\n\n <button\n [disabled]=\"error\"\n class=\"ml-4 flex\"\n mat-raised-button\n (click)=\"continue()\"\n >\n {{ \"scandoc.continueWithSelectedImage\" | translate }}\n </button>\n </div>\n </footer>\n</div>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5}:host.mobile .buttonWrap div{font-size:11px!important}:host.mobile .scanBlastWraper .head{height:30px!important}:host.mobile .scanBlastWraper .head .title{font-size:12px!important}:host.mobile .scanBlastWraper .scanBlast{flex-direction:column}:host.mobile .scanBlastWraper mat-card{margin:4px!important}:host.mobile .scanBlastWraper .description{flex-direction:row!important}:host.mobile .scanBlastWraper .description .imgWrap{padding:0!important}:host.mobile .scanBlastWraper .description .btnActions{position:absolute;right:0}:host.mobile .scanBlastWraper .description button{margin:0!important;position:absolute;right:16px}:host.mobile .scanBlastWraper .description button.rotateButton{top:58px}:host.mobile .scanBlastWraper .description button.remButton{top:8px}:host.mobile .scanBlastWraper .description button mat-icon{margin:0!important}:host.mobile .scanBlastWraper .description button div.label{display:none}.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}.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 .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{overflow:hidden;display:flex;flex-direction:column;flex:1}.scanBlastWraper button{text-transform:uppercase;overflow:hidden}.scanBlastWraper .buttonWrap{display:flex;flex-direction:row;align-items:center;justify-content:center}.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;display:flex;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}.result{display:flex;flex-direction:column}.result .wrap{overflow:auto;flex:1;display:flex;flex-direction:row}.result .wrap .panel{flex:1}.result .wrap form{display:flex;flex-direction:row;padding:0 16px;width:100%}.result .wrap form formly-form{flex:1}.flex{flex:1}\n"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: WebcamComponent, selector: "ngx-scandoc-webcam", inputs: ["imageHandler", "type", "trigger", "refresh"], outputs: ["cameraSwitched", "videoReady", "imageCapture", "initError"] }, { kind: "component", type: i4.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i8.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
2428
|
+
}
|
|
2429
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ManualScanComponent, decorators: [{
|
|
2430
|
+
type: Component,
|
|
2431
|
+
args: [{ selector: 'ngx-manual-scan', standalone: false, template: "\n\n<ng-container *ngIf=\"!result\">\n\n<ng-container *ngIf=\"!documentTypeSelected\">\n <section\n class=\"scanBlastWraper\"\n ngClass.lt-md=\"mobile\"\n fxFlex\n fxLayout=\"column\"\n >\n <div class=\"scanBlast\" fxFlex fxLayout.lt-md=\"column\" fxLayout=\"row\">\n <mat-card\n appearance=\"outlined\"\n style=\"display: flex; flex-direction: column\"\n fxLayout=\"column\"\n *ngFor=\"let side of scanBlastData\"\n >\n <div ngClass.lt-sm=\"small\" class=\"head\">\n <div class=\"title\" fxFlex>{{ side.title | translate }}</div>\n </div>\n <div class=\"actions\" style=\"display: flex; flex-direction: row\">\n <button\n (click)=\"singleScan(side)\"\n [disabled]=\"side.disabled\"\n style=\"margin-right: 4px\"\n mat-raised-button\n >\n <div class=\"buttonWrap\">\n <mat-icon>camera</mat-icon>\n <div>\n {{ \"scandoc.scanCamera\" | translate }}\n </div>\n </div>\n </button>\n <button\n (click)=\"file.click()\"\n [disabled]=\"side.disabled\"\n style=\"margin-left: 4px\"\n mat-raised-button\n >\n <input\n accept=\"image/*\"\n type=\"file\"\n style=\"display: none\"\n (change)=\"handleFileInput($event.target, $event, side)\"\n #file\n />\n <div class=\"buttonWrap\">\n <mat-icon>file_upload</mat-icon>\n <div>\n {{ \"scandoc.useFromDisk\" | translate }}\n </div>\n </div>\n </button>\n </div>\n <div class=\"content\" style=\"display: flex\">\n <div style=\"flex: 1\" class=\"previewPlaceholder\">\n <div class=\"description\">\n <ng-container *ngIf=\"side.image\">\n <div class=\"imgWrap\">\n <div\n style=\"flex: 1\"\n class=\"image\"\n [style.background-image]=\"\n 'url(' + side.image.imageAsDataUrl + ')'\n \"\n ></div>\n\n <div\n class=\"btnActions\"\n fxLayout.lt-md=\"column\"\n fxLayout=\"row\"\n style=\"display: flex; flex-direction: row\"\n >\n <button\n (click)=\"singleScanRemove(side)\"\n class=\"mr-4 remButton flex\"\n mat-raised-button\n >\n <div class=\"buttonWrap\">\n <mat-icon>delete</mat-icon>\n <div class=\"label\">\n {{ \"scandoc.remove\" | translate }}\n </div>\n </div>\n </button>\n <button\n class=\"ml-4 rotateButton flex\"\n mat-raised-button\n (click)=\"singleScanRotate(side)\"\n >\n <div class=\"buttonWrap\">\n <mat-icon>rotate_90_degrees_cw</mat-icon>\n <div class=\"label\">\n {{ \"scandoc.rotate\" | translate }}\n </div>\n </div>\n </button>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!side.image\">\n <div class=\"empty\">\n {{ side.description | translate }}\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </mat-card>\n </div>\n <footer>\n <div\n class=\"px-8 pb-8\"\n style=\"padding: 0px 8px 8px 8px; display: flex; flex-direction: row\"\n >\n <button\n (click)=\"scanBlastFinish()\"\n [disabled]=\"!scanBlastCanUpload\"\n style=\"flex: 1\"\n mat-raised-button\n >\n {{ \"scandoc.upload\" | translate }}\n </button>\n </div>\n </footer>\n </section>\n</ng-container>\n\n<div\n style=\"position: relative; display: flex; flex-direction: column; flex: 1\"\n *ngIf=\"documentTypeSelected\"\n>\n <div\n style=\"display: flex; flex-direction: row; flex: 1\"\n #wraper\n class=\"wraper\"\n >\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 <ngx-scandoc-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main flex\"\n\n #webcam\n [trigger]=\"trigger\"\n (imageCapture)=\"handleImage($event)\"\n(videoReady)=\"videoReady($event)\"\n (cameraSwitched)=\"cameraWasSwitched($event)\"\n (initError)=\"handleInitError($event)\"\n type=\"manual\"\n\n (destroyed)=\"cameraOff($event)\"\n >\n </ngx-scandoc-webcam>\n </ng-container>\n <div\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"\n display: flex;\n flex-direction: row;\n flex: 1;\n z-index: 20;\n position: absolute;\n width: 100%;\n height: 100%;\n \"\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 <ul>\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 style=\"display: flex; flex-direction: column; flex: 1\"\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 style=\"flex: 1\"\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 <!-- <div class=\"displayInfo\" *ngIf=\"!preview && cameraReady\">\n {{ displayInfo }}\n </div>\n <div style=\"height: 26px;\">\n <div style=\"text-align: center; font-size: 18px;\" *ngIf=\"idScan && !preview && cameraReady\">\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 \"scandoc.captureFront\" | translate\n }}</ng-container>\n <ng-container *ngIf=\"scanType === 'BACK'\">{{\n \"scandoc.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 style=\"display: flex; flex-direction: row; align-items: center; flex: 1\"\n >\n <button class=\"flex mr-4\" mat-raised-button (click)=\"retry()\">\n {{ \"scandoc.retry\" | translate }}\n </button>\n\n <button\n [disabled]=\"error\"\n class=\"ml-4 flex\"\n mat-raised-button\n (click)=\"continue()\"\n >\n {{ \"scandoc.continueWithSelectedImage\" | translate }}\n </button>\n </div>\n </footer>\n</div>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5}:host.mobile .buttonWrap div{font-size:11px!important}:host.mobile .scanBlastWraper .head{height:30px!important}:host.mobile .scanBlastWraper .head .title{font-size:12px!important}:host.mobile .scanBlastWraper .scanBlast{flex-direction:column}:host.mobile .scanBlastWraper mat-card{margin:4px!important}:host.mobile .scanBlastWraper .description{flex-direction:row!important}:host.mobile .scanBlastWraper .description .imgWrap{padding:0!important}:host.mobile .scanBlastWraper .description .btnActions{position:absolute;right:0}:host.mobile .scanBlastWraper .description button{margin:0!important;position:absolute;right:16px}:host.mobile .scanBlastWraper .description button.rotateButton{top:58px}:host.mobile .scanBlastWraper .description button.remButton{top:8px}:host.mobile .scanBlastWraper .description button mat-icon{margin:0!important}:host.mobile .scanBlastWraper .description button div.label{display:none}.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}.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 .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{overflow:hidden;display:flex;flex-direction:column;flex:1}.scanBlastWraper button{text-transform:uppercase;overflow:hidden}.scanBlastWraper .buttonWrap{display:flex;flex-direction:row;align-items:center;justify-content:center}.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;display:flex;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}.result{display:flex;flex-direction:column}.result .wrap{overflow:auto;flex:1;display:flex;flex-direction:row}.result .wrap .panel{flex:1}.result .wrap form{display:flex;flex-direction:row;padding:0 16px;width:100%}.result .wrap form formly-form{flex:1}.flex{flex:1}\n"] }]
|
|
2432
|
+
}], ctorParameters: () => [{ type: NgxScandocCameraProvider }, { type: i0.ChangeDetectorRef }, { type: LayoutProvider }, { type: i0.NgZone }], propDecorators: { action: [{
|
|
2433
|
+
type: Output
|
|
2434
|
+
}], wraper: [{
|
|
2435
|
+
type: ViewChild,
|
|
2436
|
+
args: ['wraper']
|
|
2437
|
+
}], class: [{
|
|
2438
|
+
type: HostBinding,
|
|
2439
|
+
args: ['class.mobile']
|
|
2440
|
+
}], onResize: [{
|
|
2441
|
+
type: HostListener,
|
|
2442
|
+
args: ['window:resize', ['$event']]
|
|
2443
|
+
}] } });
|
|
2444
|
+
|
|
2445
|
+
class ScanComponent extends BaseComponent {
|
|
2446
|
+
get class() {
|
|
2447
|
+
return this.isMobile;
|
|
2448
|
+
}
|
|
2449
|
+
onResize() {
|
|
2450
|
+
if (this.result) {
|
|
2451
|
+
this.cd.detectChanges();
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
constructor(cd, zone, cameraProvider, injector, layoutProvider, platform, deviceService, auth, // private api: ServerProvider
|
|
2455
|
+
scanProvider) {
|
|
2456
|
+
super();
|
|
2457
|
+
this.cd = cd;
|
|
2458
|
+
this.zone = zone;
|
|
2459
|
+
this.cameraProvider = cameraProvider;
|
|
2460
|
+
this.injector = injector;
|
|
2461
|
+
this.layoutProvider = layoutProvider;
|
|
2462
|
+
this.platform = platform;
|
|
2463
|
+
this.deviceService = deviceService;
|
|
2464
|
+
this.auth = auth;
|
|
2465
|
+
this.scanProvider = scanProvider;
|
|
2466
|
+
this.scanBlastData = [
|
|
2467
|
+
{
|
|
2468
|
+
title: 'pms.dialogs.components.scanProfile.front',
|
|
2469
|
+
description: 'pms.dialogs.components.scanProfile.frontDescription',
|
|
2470
|
+
side: 'FRONT',
|
|
2471
|
+
},
|
|
2472
|
+
{
|
|
2473
|
+
title: 'pms.dialogs.components.scanProfile.back',
|
|
2474
|
+
description: 'pms.dialogs.components.scanProfile.backDescription',
|
|
2475
|
+
disabled: true,
|
|
2476
|
+
side: 'BACK',
|
|
2477
|
+
},
|
|
2478
|
+
];
|
|
2479
|
+
this.type = 'desktop';
|
|
2480
|
+
this.actions = new EventEmitter();
|
|
2481
|
+
this.scanResults = new Subject();
|
|
2482
|
+
this.scanSecondSide = false;
|
|
2483
|
+
this.startTime = 0;
|
|
2484
|
+
this.scanInProgress = false;
|
|
2485
|
+
// webcam snapshot trigger
|
|
2486
|
+
this.documentTypeSelected = false;
|
|
2487
|
+
this.preview = null;
|
|
2488
|
+
this.errorCode = '1000';
|
|
2489
|
+
this.displayInfo = 'scandoc.info.position';
|
|
2490
|
+
this.verificationErrorSent = false;
|
|
2491
|
+
this.error = false;
|
|
2492
|
+
this.cameraReady = false;
|
|
2493
|
+
this.scaning = false;
|
|
2494
|
+
this.promptManual = false;
|
|
2495
|
+
this.imageHandler = new Subject();
|
|
2496
|
+
this.manualDataSet = false;
|
|
2497
|
+
this.logData = {
|
|
2498
|
+
AcceptTermsAndConditions: true,
|
|
2499
|
+
Request: null,
|
|
2500
|
+
Response: null,
|
|
2501
|
+
ExpectedOutput: null,
|
|
2502
|
+
};
|
|
2503
|
+
this.scanDatas = [];
|
|
2504
|
+
this.idScan = null;
|
|
2505
|
+
this.validation = false;
|
|
2506
|
+
this.scannedImages = [];
|
|
2507
|
+
this.scanDelay = 0;
|
|
2508
|
+
this.trigger = new Subject();
|
|
2509
|
+
// switch to next / previous / specific webcam; true/false: forward/backwards, string: deviceId
|
|
2510
|
+
this.nextWebcam = new Subject();
|
|
2511
|
+
this.imageVerified = false;
|
|
2512
|
+
this.form = new FormGroup({});
|
|
2513
|
+
this.manual = false;
|
|
2514
|
+
this.isMobile = this.platform.IOS || this.platform.ANDROID;
|
|
2515
|
+
this.showDialog = false;
|
|
2516
|
+
this.scanImageTimestamps = {
|
|
2517
|
+
time: 0,
|
|
2518
|
+
load: 0,
|
|
2519
|
+
};
|
|
2520
|
+
this.numberOfValidations = 0;
|
|
2521
|
+
this.validationDebug = [];
|
|
2522
|
+
this.blurValues = [];
|
|
2523
|
+
if (!this.scanProvider.config.development) {
|
|
2524
|
+
// console = {
|
|
2525
|
+
// log: (...args: any) => {},
|
|
2526
|
+
// time: (...args: any) => {},
|
|
2527
|
+
// timeEnd: (...args: any) => {},
|
|
2528
|
+
// warn: (...args: any) => {},
|
|
2529
|
+
// error: (...args: any) => {},
|
|
2530
|
+
// };
|
|
2531
|
+
}
|
|
2532
|
+
}
|
|
2533
|
+
resetLogData() {
|
|
2534
|
+
this.logData = {
|
|
2535
|
+
Request: null,
|
|
2536
|
+
Response: null,
|
|
2537
|
+
ExpectedOutput: null,
|
|
2538
|
+
AcceptTermsAndConditions: true,
|
|
2539
|
+
};
|
|
2540
|
+
}
|
|
2541
|
+
init() {
|
|
2542
|
+
this.auth.accesToken.subscribe();
|
|
2543
|
+
this.resetLogData();
|
|
2544
|
+
// this.result=true;
|
|
2545
|
+
// this.result ={};
|
|
2546
|
+
console.log('INIT SCAN');
|
|
2547
|
+
}
|
|
2548
|
+
continue() {
|
|
2549
|
+
this.documentTypeSelected = false;
|
|
2550
|
+
setTimeout(() => {
|
|
2551
|
+
this.selectedSide.image = this.webcamImage;
|
|
2552
|
+
if (this.selectedSide.side === 'FRONT') {
|
|
2553
|
+
this.scanBlastData[1].disabled = false;
|
|
2554
|
+
}
|
|
2555
|
+
this.cd.detectChanges();
|
|
2556
|
+
}, 200);
|
|
2557
|
+
}
|
|
2558
|
+
scan() {
|
|
2559
|
+
this.trigger.next(new Date().getTime());
|
|
2560
|
+
}
|
|
2561
|
+
handleImage(webcamImage) {
|
|
2562
|
+
if (this.startTime === 0) {
|
|
2563
|
+
this.startTime = Date.now();
|
|
2564
|
+
}
|
|
2565
|
+
// console.log('[received webcam image]', webcamImage);
|
|
2566
|
+
this.zone.runOutsideAngular(() => {
|
|
2567
|
+
const time = new Date().getTime();
|
|
2568
|
+
if (this.scanImageTimestamps.load > 0) {
|
|
2569
|
+
const { load } = this.scanImageTimestamps;
|
|
2570
|
+
const diff = time - load;
|
|
2571
|
+
// console.log('time:', diff);
|
|
2572
|
+
this.scanDelay = diff;
|
|
2573
|
+
}
|
|
2574
|
+
this.scanImageTimestamps.load = time;
|
|
2575
|
+
if (webcamImage.imageAsDataUrl) {
|
|
2576
|
+
this.scannedImages.push(webcamImage);
|
|
2577
|
+
this.handleLongValidationError(webcamImage, 'worker');
|
|
2578
|
+
}
|
|
2579
|
+
this.cd.detectChanges();
|
|
2580
|
+
if (this.scannedImages.length > 0 && !this.validation) {
|
|
2581
|
+
// if (this.scanProvider.config.development) {
|
|
2582
|
+
// this.scannedImages.forEach((img) => {
|
|
2583
|
+
// const consoleBackground =
|
|
2584
|
+
// "font-size:100px;background-image: url('" +
|
|
2585
|
+
// img.imageResized +
|
|
2586
|
+
// "');background-size: contain; background-repeat: no-repeat;";
|
|
2587
|
+
// console.log('%c ', consoleBackground);
|
|
2588
|
+
// });
|
|
2589
|
+
// }
|
|
2590
|
+
// this.frontImage = webcamImage.imageResized;
|
|
2591
|
+
// console.timeEnd('scan');
|
|
2592
|
+
// console.time('scan');
|
|
2593
|
+
// get last 10
|
|
2594
|
+
// console.log('CAPTURED:', this.scannedImages.length);
|
|
2595
|
+
const images = this.scannedImages.slice(-5);
|
|
2596
|
+
// set images to 0
|
|
2597
|
+
this.scannedImages = [];
|
|
2598
|
+
const imagesArray = images.map((m) => m.imageResized.split(',')[1]);
|
|
2599
|
+
this.validation = true;
|
|
2600
|
+
this.handleBurstData(imagesArray, images);
|
|
2601
|
+
}
|
|
2602
|
+
else {
|
|
2603
|
+
if (this.cameraReady) {
|
|
2604
|
+
this.scan();
|
|
2605
|
+
}
|
|
2606
|
+
}
|
|
2607
|
+
});
|
|
2608
|
+
}
|
|
2609
|
+
handleBurstData(imagesArray, images, type = 'plain') {
|
|
2610
|
+
this.__subs(this.scanProvider.burst(imagesArray, this.blurValues)).subscribe((resp) => {
|
|
2611
|
+
this.displayInfo = 'scandoc.info.c' + resp.InfoCode;
|
|
2612
|
+
// console.timeEnd('validationPOST');
|
|
2613
|
+
// console.log('AnalysisTime', resp.AnalysisTime);
|
|
2614
|
+
const { DocType, Series, Side, InfoCode, TransactionID } = resp;
|
|
2615
|
+
this.handleLongValidationError(TransactionID, images[0].imageAsDataUrl.split(',')[1]);
|
|
2616
|
+
// if (InfoCode === '1006' && this.idScan) {
|
|
2617
|
+
// this.handleLongValidationError(image);
|
|
2618
|
+
// }
|
|
2619
|
+
// console.warn(resp.Validated, this.numberOfValidations);
|
|
2620
|
+
if (resp.DetectedBlurValue) {
|
|
2621
|
+
this.blurValues.push(resp.DetectedBlurValue);
|
|
2622
|
+
}
|
|
2623
|
+
else {
|
|
2624
|
+
this.blurValues = [];
|
|
2625
|
+
}
|
|
2626
|
+
if (resp.Validated) {
|
|
2627
|
+
this.numberOfValidations++;
|
|
2628
|
+
this.validationDebug.push(resp);
|
|
2629
|
+
}
|
|
2630
|
+
else {
|
|
2631
|
+
this.numberOfValidations = 0;
|
|
2632
|
+
this.validationDebug = [];
|
|
2633
|
+
}
|
|
2634
|
+
if (resp.Validated) {
|
|
2635
|
+
this.displayInfo = '';
|
|
2636
|
+
// console.log('[SCANNED INDEX]', resp.Index);
|
|
2637
|
+
const selectedImage = images[resp.Index];
|
|
2638
|
+
// this.preview = this.webcamImage.imageAsDataUrl;
|
|
2639
|
+
this.cd.detectChanges();
|
|
2640
|
+
let image = selectedImage;
|
|
2641
|
+
console.warn(type);
|
|
2642
|
+
if (type == 'worker') {
|
|
2643
|
+
//const dataUrl = this.handleBitmapImage(selectedImage.bitmap);
|
|
2644
|
+
image = selectedImage.imageAsDataUrl;
|
|
2645
|
+
}
|
|
2646
|
+
if (InfoCode === '1007') {
|
|
2647
|
+
// For ID ask for other side
|
|
2648
|
+
if (Side === 'FRONT') {
|
|
2649
|
+
this.scanBlastData[0].image = image;
|
|
2650
|
+
}
|
|
2651
|
+
else {
|
|
2652
|
+
this.scanBlastData[1].image = image;
|
|
2653
|
+
}
|
|
2654
|
+
if (this.scanBlastData[0].image && this.scanBlastData[1].image) {
|
|
2655
|
+
// console.warn('UPLOAD');
|
|
2656
|
+
if (type == 'worker') {
|
|
2657
|
+
this.imageHandler.next({ type: 'stop' });
|
|
2658
|
+
}
|
|
2659
|
+
//console.warn('DEBUG', Side, this.validationDebug);
|
|
2660
|
+
this.scanBlastFinish();
|
|
2661
|
+
}
|
|
2662
|
+
else {
|
|
2663
|
+
this.blurValues = [];
|
|
2664
|
+
this.numberOfValidations = 0;
|
|
2665
|
+
const num = Side === 'FRONT' ? 1 : 0;
|
|
2666
|
+
this.scanSecondSide = true;
|
|
2667
|
+
this.singleScan(this.scanBlastData[num]);
|
|
2668
|
+
this.idScan = this.scanBlastData[num].side;
|
|
2669
|
+
if (!this.showDialog) {
|
|
2670
|
+
this.showDialog = true;
|
|
2671
|
+
this.cd.detectChanges();
|
|
2672
|
+
}
|
|
2673
|
+
// reset manual scan popup interval
|
|
2674
|
+
this.verificationErrorSent = false;
|
|
2675
|
+
this.startTime = Date.now();
|
|
2676
|
+
this.displayInfo = 'scandoc.info.turn';
|
|
2677
|
+
}
|
|
2678
|
+
}
|
|
2679
|
+
else {
|
|
2680
|
+
// console.warn('DEBUG', Side, this.validationDebug);
|
|
2681
|
+
this.scanBlastData[0].image = image;
|
|
2682
|
+
// console.warn('UPLOAD');
|
|
2683
|
+
if (type == 'worker') {
|
|
2684
|
+
this.imageHandler.next({ type: 'stop' });
|
|
2685
|
+
}
|
|
2686
|
+
this.scanBlastFinish();
|
|
2687
|
+
}
|
|
2688
|
+
this.scannedImages = [];
|
|
2689
|
+
// this.scanBlastData[0].image = selectedImage;
|
|
2690
|
+
//this.scanBlastFinish();
|
|
2691
|
+
}
|
|
2692
|
+
else {
|
|
2693
|
+
this.validation = false;
|
|
2694
|
+
this.scan();
|
|
2695
|
+
}
|
|
2696
|
+
});
|
|
2697
|
+
}
|
|
2698
|
+
closeDialog() {
|
|
2699
|
+
this.showDialog = false;
|
|
2700
|
+
this.validation = false;
|
|
2701
|
+
this.scan();
|
|
2702
|
+
}
|
|
2703
|
+
handleInitError(error) {
|
|
2704
|
+
console.log(error);
|
|
2705
|
+
}
|
|
2706
|
+
get scanBlastCanUpload() {
|
|
2707
|
+
return this.scanBlastData[0].image ? true : false;
|
|
2708
|
+
}
|
|
2709
|
+
manualMode(type = 'plain') {
|
|
2710
|
+
this.manual = true;
|
|
2711
|
+
this.promptManual = false;
|
|
2712
|
+
this.scanInProgress = false;
|
|
2713
|
+
this.cameraProvider.$showSwitch.next(false);
|
|
2714
|
+
this.cd.detectChanges();
|
|
2715
|
+
}
|
|
2716
|
+
handleExtractionError(data) {
|
|
2717
|
+
this.logData.ExpectedOutput = {};
|
|
2718
|
+
// if (this.logData.ExpectedOutput?._avatar) {
|
|
2719
|
+
// delete this.logData.ExpectedOutput._avatar;
|
|
2720
|
+
// }
|
|
2721
|
+
// this.scanProvider.sendLog(this.logData).subscribe();
|
|
2722
|
+
// console.log('LOG DATA', this.logData);
|
|
2723
|
+
this.__subs(this.scanProvider.sendLog(this.logData)).subscribe();
|
|
2724
|
+
}
|
|
2725
|
+
handleLongValidationError(img, type = 'plain') {
|
|
2726
|
+
// save current image after 10sec
|
|
2727
|
+
let MANUAL_INTERVAL = this.scanProvider.config.manualScanDelay;
|
|
2728
|
+
const diff = (Date.now() - this.startTime) / 1000;
|
|
2729
|
+
const showDialog = diff > MANUAL_INTERVAL;
|
|
2730
|
+
if (showDialog && !this.verificationErrorSent) {
|
|
2731
|
+
this.verificationErrorSent = true;
|
|
2732
|
+
console.warn('[HANDLE ERROR]');
|
|
2733
|
+
this.zone.run(() => {
|
|
2734
|
+
// if (!this.scanSecondSide) {
|
|
2735
|
+
if (this.scanProvider.config.manualModeEnabled) {
|
|
2736
|
+
this.promptManual = true;
|
|
2737
|
+
}
|
|
2738
|
+
// }
|
|
2739
|
+
this.startTime = Date.now();
|
|
2740
|
+
});
|
|
2741
|
+
// this.verificationErrorSent = true;
|
|
2742
|
+
// const dataUrl = this.handleBitmapImage(img.bitmap);
|
|
2743
|
+
// console.warn('SENT');
|
|
2744
|
+
// // this.displayInfo = 'Cant detect document!';
|
|
2745
|
+
// this.logData.Request = this.__subs(
|
|
2746
|
+
// this.scanProvider.sendLog({
|
|
2747
|
+
// AcceptTermsAndConditions: true,
|
|
2748
|
+
// ExpectedOutput: {},
|
|
2749
|
+
// Request: {
|
|
2750
|
+
// verification: dataUrl.split(',')[1],
|
|
2751
|
+
// },
|
|
2752
|
+
// Response: {
|
|
2753
|
+
// TransactionID: uuidv4(),
|
|
2754
|
+
// },
|
|
2755
|
+
// })
|
|
2756
|
+
// ).subscribe();
|
|
2757
|
+
}
|
|
2758
|
+
}
|
|
2759
|
+
ngAfterViewInit() {
|
|
2760
|
+
// this.result = true;
|
|
2761
|
+
this.cameraProvider.$showSwitch.next(true);
|
|
2762
|
+
this.cd.detectChanges();
|
|
2763
|
+
// this.scanResults.next({ type: 'model', data: {} });
|
|
2764
|
+
this.__subs(this.cameraProvider.webcamObservable).subscribe((resp) => {
|
|
2765
|
+
this.cameraReady = false;
|
|
2766
|
+
this.scanInProgress = false;
|
|
2767
|
+
this.scannedImages = [];
|
|
2768
|
+
});
|
|
2769
|
+
this.__subs(this.cameraProvider.selfie$).subscribe((resp) => {
|
|
2770
|
+
this.selfie();
|
|
2771
|
+
});
|
|
2772
|
+
this.autoScan();
|
|
2773
|
+
this.__subs(this.layoutProvider.breakpoint$).subscribe((v) => {
|
|
2774
|
+
this.isMobile = !v.matches || this.platform.IOS || this.platform.ANDROID;
|
|
2775
|
+
console.log('MNOBILE', this.isMobile);
|
|
2776
|
+
});
|
|
2777
|
+
// this.imageHandlerSubscription = this.imageHandler.subscribe(
|
|
2778
|
+
// (webcamImage: any) => {
|
|
2779
|
+
// // return;
|
|
2780
|
+
// if (this.startTime === 0) {
|
|
2781
|
+
// this.startTime = Date.now();
|
|
2782
|
+
// }
|
|
2783
|
+
// this.zone.runOutsideAngular(() => {
|
|
2784
|
+
// if (webcamImage.base64) {
|
|
2785
|
+
// const time = new Date().getTime();
|
|
2786
|
+
// if (this.scanImageTimestamps.load > 0) {
|
|
2787
|
+
// const { load } = this.scanImageTimestamps;
|
|
2788
|
+
// const diff = time - load;
|
|
2789
|
+
// // console.warn('TIME', diff);
|
|
2790
|
+
// this.scanDelay = diff;
|
|
2791
|
+
// }
|
|
2792
|
+
// this.scanImageTimestamps.load = time;
|
|
2793
|
+
// this.scannedImages.push(webcamImage);
|
|
2794
|
+
// this.handleLongValidationError(webcamImage, 'worker');
|
|
2795
|
+
// }
|
|
2796
|
+
// // this.cd.detectChanges();
|
|
2797
|
+
// if (this.scannedImages.length > 4 && !this.validation) {
|
|
2798
|
+
// // get last 10
|
|
2799
|
+
// console.timeEnd('validationTOTAL_UI');
|
|
2800
|
+
// console.time('validationTOTAL_UI');
|
|
2801
|
+
// const images = this.scannedImages.slice(-5);
|
|
2802
|
+
// // set images to 0
|
|
2803
|
+
// this.scannedImages = [];
|
|
2804
|
+
// console.log(images);
|
|
2805
|
+
// const imagesArray = images.map((m) => m.base64.split(',')[1]);
|
|
2806
|
+
// this.validation = true;
|
|
2807
|
+
// // this.handleBurstData(imagesArray, images, 'worker');
|
|
2808
|
+
// console.time('validationPOST');
|
|
2809
|
+
// }
|
|
2810
|
+
// this.cd.detectChanges();
|
|
2811
|
+
// });
|
|
2812
|
+
// }
|
|
2813
|
+
// );
|
|
2814
|
+
}
|
|
2815
|
+
handleBitmapImage(bitmap) {
|
|
2816
|
+
const { width, height } = bitmap;
|
|
2817
|
+
const offscreenSmall = document.createElement('canvas');
|
|
2818
|
+
offscreenSmall.width = width;
|
|
2819
|
+
offscreenSmall.height = height;
|
|
2820
|
+
const ctx = offscreenSmall.getContext('bitmaprenderer');
|
|
2821
|
+
if (ctx) {
|
|
2822
|
+
ctx.imageSmoothingEnabled = false;
|
|
2823
|
+
ctx.transferFromImageBitmap(bitmap);
|
|
2824
|
+
bitmap.close();
|
|
2825
|
+
const data = ctx.canvas.toDataURL('image/jpeg');
|
|
2826
|
+
return data;
|
|
2827
|
+
}
|
|
2828
|
+
return null;
|
|
2829
|
+
}
|
|
2830
|
+
autoScan() {
|
|
2831
|
+
const side = this.scanBlastData[0];
|
|
2832
|
+
this.idScan = null;
|
|
2833
|
+
this.singleScan(side);
|
|
2834
|
+
}
|
|
2835
|
+
singleScan(side) {
|
|
2836
|
+
this.scanType = side.side;
|
|
2837
|
+
this.preview = null;
|
|
2838
|
+
this.selectedSide = side;
|
|
2839
|
+
this.selectedSide.image = null;
|
|
2840
|
+
this.documentTypeSelected = true;
|
|
2841
|
+
this.scanBlastData[1].disabled = false;
|
|
2842
|
+
this.cd.detectChanges();
|
|
2843
|
+
}
|
|
2844
|
+
manualScanData(data) {
|
|
2845
|
+
console.log(data);
|
|
2846
|
+
this.scanBlastData = data;
|
|
2847
|
+
this.manual = false;
|
|
2848
|
+
this.manualDataSet = true;
|
|
2849
|
+
this.scanBlastFinish();
|
|
2850
|
+
}
|
|
2851
|
+
getImgBase64(num) {
|
|
2852
|
+
console.log('GET 64');
|
|
2853
|
+
// if (this.manualDataSet) {
|
|
2854
|
+
return this.scanBlastData[num].image._imageAsDataUrl.split(',')[1];
|
|
2855
|
+
// }
|
|
2856
|
+
// return this.scanBlastData[num].image.dataUrl.split(',')[1];
|
|
2857
|
+
}
|
|
2858
|
+
scanBlastFinish() {
|
|
2859
|
+
const { browser, os, device } = this.deviceService;
|
|
2860
|
+
this.zone.run(() => {
|
|
2861
|
+
this.cameraProvider.$showSwitch.next(false);
|
|
2862
|
+
});
|
|
2863
|
+
console.time('upload');
|
|
2864
|
+
if (this.type === 'mobile') {
|
|
2865
|
+
this.actions.emit({ data: this.scanBlastData });
|
|
2866
|
+
this.retake();
|
|
2867
|
+
return;
|
|
2868
|
+
}
|
|
2869
|
+
this.idScan = null;
|
|
2870
|
+
// const loading = this.dialogs.loading();
|
|
2871
|
+
this.scaning = true;
|
|
2872
|
+
this.cd.detectChanges();
|
|
2873
|
+
console.time('payload');
|
|
2874
|
+
const payload = {
|
|
2875
|
+
AcceptTermsAndConditions: true,
|
|
2876
|
+
DataFields: {
|
|
2877
|
+
DeviceInfo: {
|
|
2878
|
+
OS: os,
|
|
2879
|
+
Device: device,
|
|
2880
|
+
Browser: browser,
|
|
2881
|
+
},
|
|
2882
|
+
FrontImageType: 'base64',
|
|
2883
|
+
FrontImageCropped: false,
|
|
2884
|
+
BackImageType: 'base64',
|
|
2885
|
+
BackImageCropped: false,
|
|
2886
|
+
FrontImage: this.getImgBase64(0),
|
|
2887
|
+
BackImage: this.scanBlastData[1].image ? this.getImgBase64(1) : null,
|
|
2888
|
+
},
|
|
2889
|
+
Settings: {
|
|
2890
|
+
ShouldValidate: true,
|
|
2891
|
+
ShouldReturnDocumentImage: true,
|
|
2892
|
+
ShouldReturnFaceIfDetected: true,
|
|
2893
|
+
SkipImageSizeCheck: true,
|
|
2894
|
+
CanStoreImages: this.scanProvider.canStoreImages,
|
|
2895
|
+
},
|
|
2896
|
+
// CallBackUrl: 'http://demo:5000/report/extracted/',
|
|
2897
|
+
};
|
|
2898
|
+
this.frontImage = 'data:image/jpeg;base64,' + payload.DataFields.FrontImage;
|
|
2899
|
+
this.backImage = 'data:image/jpeg;base64,' + payload.DataFields.BackImage;
|
|
2900
|
+
if (!this.scanBlastData[1].image) {
|
|
2901
|
+
payload.Settings.IgnoreBackImage = true;
|
|
2902
|
+
}
|
|
2903
|
+
this.logData.Request = JSON.parse(JSON.stringify(payload));
|
|
2904
|
+
console.timeEnd('payload');
|
|
2905
|
+
this.__subs(this.scanProvider.blastPost(payload).pipe(catchError((e) => {
|
|
2906
|
+
if (this.manualDataSet) {
|
|
2907
|
+
// console.warn('MANUAL DATA SET',e);
|
|
2908
|
+
this.logData.Response = JSON.parse(JSON.stringify(e.error));
|
|
2909
|
+
this.handleExtractionError({});
|
|
2910
|
+
}
|
|
2911
|
+
this.zone.run(() => {
|
|
2912
|
+
this.error = true;
|
|
2913
|
+
this.preview = true;
|
|
2914
|
+
this.cd.detectChanges();
|
|
2915
|
+
});
|
|
2916
|
+
// console.log('EEE', e);
|
|
2917
|
+
return e;
|
|
2918
|
+
}))).subscribe((data) => {
|
|
2919
|
+
//console.log(data);
|
|
2920
|
+
const results = data.Data;
|
|
2921
|
+
console.timeEnd('upload');
|
|
2922
|
+
console.time('parse');
|
|
2923
|
+
// data.InfoCode = '1001';
|
|
2924
|
+
console.time('p');
|
|
2925
|
+
this.logData.Response = JSON.parse(JSON.stringify(data));
|
|
2926
|
+
console.timeEnd('p');
|
|
2927
|
+
//loading.close();
|
|
2928
|
+
this.documentTypeSelected = true;
|
|
2929
|
+
this.scaning = false;
|
|
2930
|
+
if (data.InfoCode === '1001') {
|
|
2931
|
+
this.error = true;
|
|
2932
|
+
console.log('[ERROR] 1001');
|
|
2933
|
+
this.errorCode = '1001';
|
|
2934
|
+
// this.scanSide = 0;
|
|
2935
|
+
this.preview = true;
|
|
2936
|
+
this.cd.detectChanges();
|
|
2937
|
+
return;
|
|
2938
|
+
}
|
|
2939
|
+
if (data.InfoCode === '1002') {
|
|
2940
|
+
this.error = true;
|
|
2941
|
+
console.log('[ERROR] 1002');
|
|
2942
|
+
this.errorCode = '1002';
|
|
2943
|
+
// this.scanSide = 0;
|
|
2944
|
+
this.preview = true;
|
|
2945
|
+
this.cd.detectChanges();
|
|
2946
|
+
return;
|
|
2947
|
+
}
|
|
2948
|
+
if (results && data.Metadata.length > 0 && data.InfoCode === '1000') {
|
|
2949
|
+
// console.log('Extraction time', data.AnalysisTime);
|
|
2950
|
+
// this.zone.run(() => {
|
|
2951
|
+
// console.time('parseblast');
|
|
2952
|
+
const result = this.scanProvider.parseBlast(results);
|
|
2953
|
+
// console.timeEnd('parseblast');
|
|
2954
|
+
// console.log('RES', this.result);
|
|
2955
|
+
// this.cd.detectChanges();
|
|
2956
|
+
const model = result.model;
|
|
2957
|
+
if (data.ImageData?.FaceImage) {
|
|
2958
|
+
model._avatar =
|
|
2959
|
+
'data:image/jpeg;base64,' + data.ImageData?.FaceImage;
|
|
2960
|
+
}
|
|
2961
|
+
if (data.ImageData?.Documents) {
|
|
2962
|
+
const { Documents } = data.ImageData;
|
|
2963
|
+
model.images = Documents.map((image, i) => {
|
|
2964
|
+
return { data: 'data:image/jpeg;base64,' + Documents[i] };
|
|
2965
|
+
});
|
|
2966
|
+
}
|
|
2967
|
+
this.model = model;
|
|
2968
|
+
// console.log('MODEL', this.model);
|
|
2969
|
+
this.actions.emit({
|
|
2970
|
+
type: 'scanFinish',
|
|
2971
|
+
data: {
|
|
2972
|
+
model: this.model,
|
|
2973
|
+
images: this.images,
|
|
2974
|
+
results,
|
|
2975
|
+
},
|
|
2976
|
+
});
|
|
2977
|
+
if (!this.scanProvider.config.hideResults) {
|
|
2978
|
+
this.zone.run(() => {
|
|
2979
|
+
console.log('ERR');
|
|
2980
|
+
this.result = true;
|
|
2981
|
+
// console.time('ff');
|
|
2982
|
+
this.cd.detectChanges();
|
|
2983
|
+
this.scanResults.next({ type: 'model', data: model });
|
|
2984
|
+
// this.cd.detectChanges();
|
|
2985
|
+
// });
|
|
2986
|
+
// console.timeEnd('ff');
|
|
2987
|
+
});
|
|
2988
|
+
}
|
|
2989
|
+
}
|
|
2990
|
+
else {
|
|
2991
|
+
console.log('ERROR');
|
|
2992
|
+
if (this.manualDataSet) {
|
|
2993
|
+
this.handleExtractionError(data);
|
|
2994
|
+
}
|
|
2995
|
+
// this.scanSide = 0;
|
|
2996
|
+
this.zone.run(() => {
|
|
2997
|
+
this.error = true;
|
|
2998
|
+
this.preview = true;
|
|
2999
|
+
this.cd.detectChanges();
|
|
3000
|
+
});
|
|
3001
|
+
// this.documentTypeSelected = false;
|
|
3002
|
+
// this.retry();
|
|
3003
|
+
}
|
|
3004
|
+
// this.cd.detectChanges();
|
|
3005
|
+
console.timeEnd('parse');
|
|
3006
|
+
}, (err) => {
|
|
3007
|
+
// loading.close();
|
|
3008
|
+
// this.scanSide = 0;
|
|
3009
|
+
this.error = true;
|
|
3010
|
+
this.preview = true;
|
|
3011
|
+
this.documentTypeSelected = true;
|
|
3012
|
+
this.scaning = false;
|
|
3013
|
+
});
|
|
3014
|
+
}
|
|
3015
|
+
retry() {
|
|
3016
|
+
this.preview = false;
|
|
3017
|
+
this.validation = false;
|
|
3018
|
+
this.errorCode = '1000';
|
|
3019
|
+
this.result = false;
|
|
3020
|
+
this.idScan = null;
|
|
3021
|
+
this.cameraProvider.$showSwitch.next(true);
|
|
3022
|
+
if (this.error) {
|
|
3023
|
+
this.documentTypeSelected = false;
|
|
3024
|
+
this.scanBlastData.forEach((element) => {
|
|
3025
|
+
element.image = null;
|
|
3026
|
+
});
|
|
3027
|
+
}
|
|
3028
|
+
this.error = false;
|
|
3029
|
+
this.startTime = Date.now();
|
|
3030
|
+
this.autoScan();
|
|
3031
|
+
this.scan();
|
|
3032
|
+
this.cd.detectChanges();
|
|
3033
|
+
}
|
|
3034
|
+
retake() {
|
|
3035
|
+
this.validation = false;
|
|
3036
|
+
this.preview = false;
|
|
3037
|
+
this.error = false;
|
|
3038
|
+
this.result = false;
|
|
3039
|
+
this.scanSide = 0;
|
|
3040
|
+
this.cameraProvider.$showSwitch.next(true);
|
|
3041
|
+
this.imageVerified = false;
|
|
3042
|
+
this.scanDatas = [];
|
|
3043
|
+
this.scaning = false;
|
|
3044
|
+
this.images = [];
|
|
3045
|
+
this.scanInProgress = false;
|
|
3046
|
+
this.startTime = Date.now();
|
|
3047
|
+
this.idScan = null;
|
|
3048
|
+
this.documentTypeSelected = false;
|
|
3049
|
+
this.scanBlastData.forEach((m) => {
|
|
3050
|
+
m.image = null;
|
|
3051
|
+
});
|
|
3052
|
+
this.scanSecondSide = false;
|
|
3053
|
+
this.autoScan();
|
|
3054
|
+
this.cd.detectChanges();
|
|
3055
|
+
}
|
|
3056
|
+
use() {
|
|
3057
|
+
// save images??
|
|
3058
|
+
if (this.scanProvider.config.sendLog) {
|
|
3059
|
+
this.logData.ExpectedOutput = JSON.parse(JSON.stringify(this.model));
|
|
3060
|
+
if (this.logData.ExpectedOutput?._avatar) {
|
|
3061
|
+
delete this.logData.ExpectedOutput._avatar;
|
|
3062
|
+
}
|
|
3063
|
+
this.__subs(this.scanProvider.sendLog(this.logData)).subscribe();
|
|
3064
|
+
console.log(this.logData);
|
|
3065
|
+
}
|
|
3066
|
+
this.actions.emit({
|
|
3067
|
+
type: 'scanDataClose',
|
|
3068
|
+
data: {
|
|
3069
|
+
model: this.model,
|
|
3070
|
+
images: this.images,
|
|
3456
3071
|
},
|
|
3457
|
-
|
|
3072
|
+
});
|
|
3073
|
+
}
|
|
3074
|
+
selfie() {
|
|
3075
|
+
const avatar = this.model?._avatar;
|
|
3076
|
+
this.dialogs
|
|
3077
|
+
.scanSelfie({ avatar })
|
|
3078
|
+
.afterClosed()
|
|
3079
|
+
.subscribe((resp) => {
|
|
3080
|
+
if (resp) {
|
|
3081
|
+
console.log(resp);
|
|
3082
|
+
if (this.scanProvider.enableVerification) {
|
|
3083
|
+
this.imageVerified = true;
|
|
3084
|
+
}
|
|
3085
|
+
this.scanResults.next({
|
|
3086
|
+
type: 'avatar',
|
|
3087
|
+
data: resp.imageAsDataUrl,
|
|
3088
|
+
});
|
|
3089
|
+
// this.model._avatar = resp.imageAsDataUrl;
|
|
3090
|
+
this.cd.detectChanges();
|
|
3091
|
+
}
|
|
3092
|
+
});
|
|
3093
|
+
}
|
|
3094
|
+
cameraOff(ev) {
|
|
3095
|
+
this.cameraReady = false;
|
|
3096
|
+
this.cd.detectChanges();
|
|
3097
|
+
}
|
|
3098
|
+
videoReady(event) {
|
|
3099
|
+
console.log('READY', event);
|
|
3100
|
+
this.cameraReady = event;
|
|
3101
|
+
if (this.cameraReady && !this.scanInProgress && !this.manual) {
|
|
3102
|
+
this.scanInProgress = true;
|
|
3103
|
+
setTimeout(() => {
|
|
3104
|
+
this.scan();
|
|
3105
|
+
}, 20);
|
|
3106
|
+
}
|
|
3107
|
+
}
|
|
3108
|
+
manualSet(key) {
|
|
3109
|
+
if (key) {
|
|
3110
|
+
if (this.scanProvider.config.showManualMode) {
|
|
3111
|
+
this.manualMode();
|
|
3112
|
+
}
|
|
3113
|
+
else {
|
|
3114
|
+
this.actions.emit({
|
|
3115
|
+
type: 'manualMode',
|
|
3116
|
+
data: {},
|
|
3117
|
+
});
|
|
3118
|
+
}
|
|
3119
|
+
}
|
|
3120
|
+
else {
|
|
3121
|
+
this.promptManual = false;
|
|
3122
|
+
}
|
|
3123
|
+
}
|
|
3124
|
+
ngOnDestroy() {
|
|
3125
|
+
if (this.scanTimeout) {
|
|
3126
|
+
clearTimeout(this.scanTimeout);
|
|
3127
|
+
}
|
|
3128
|
+
if (this.imageHandlerSubscription) {
|
|
3129
|
+
this.imageHandlerSubscription.unsubscribe();
|
|
3130
|
+
}
|
|
3131
|
+
console.log('DESTROXY');
|
|
3132
|
+
this.__destroy();
|
|
3133
|
+
}
|
|
3134
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: NgxScandocCameraProvider }, { token: i0.Injector }, { token: LayoutProvider }, { token: i2.Platform }, { token: i4$1.DeviceDetectorService }, { token: NgxScandocAuthProvider }, { token: ScanProvider }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3135
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ScanComponent, isStandalone: false, selector: "ngx-scan", inputs: { type: "type", dialogs: "dialogs", refresh: "refresh", showDialog: "showDialog" }, outputs: { actions: "actions" }, host: { listeners: { "window:resize": "onResize($event)" }, properties: { "class.mobile": "this.class" } }, usesInheritance: true, ngImport: i0, template: "<ng-container\n *ngIf=\"cameraProvider.rectPosition.t > 0 && displayInfo && !result && !manual\"\n>\n <div class=\"hint\" [ngStyle]=\"{ top: cameraProvider.hintPosition + 'px' }\">\n <span class=\"text\">\n {{ displayInfo | translate }}\n </span>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"showDialog\">\n <div class=\"pageTurn\">\n <div class=\"content\">\n <div class=\"inner\">\n <mat-icon>360</mat-icon>\n <div class=\"text\">\n <ng-container *ngIf=\"idScan === 'BACK'\">\n {{ \"scandoc.turnAndCapture.back\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"idScan === 'FRONT'\">\n {{ \"scandoc.turnAndCapture.front\" | translate }}\n </ng-container>\n </div>\n </div>\n <footer>\n <button (click)=\"closeDialog()\" mat-raised-button>Ok</button>\n </footer>\n </div>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"promptManual\">\n <div class=\"manualMode\">\n <div class=\"content\">\n <div class=\"inner\">\n <mat-icon>screenshot</mat-icon>\n <div class=\"text\">\n {{ \"scandoc.manual\" | translate }}\n </div>\n </div>\n <footer>\n <button\n style=\"margin-right: 8px\"\n (click)=\"manualSet(true)\"\n mat-raised-button\n >\n {{ \"scandoc.yes\" | translate }}\n </button>\n <button\n style=\"margin-left: 8px\"\n (click)=\"manualSet(false)\"\n mat-raised-button\n >\n {{ \"scandoc.no\" | translate }}\n </button>\n </footer>\n </div>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"result\">\n <section>\n <ngx-scan-results-data\n (action)=\"selfie()\"\n [form]=\"form\"\n [data]=\"scanResults\"\n >\n </ngx-scan-results-data>\n j\n\n <footer>\n <div class=\"actions\">\n <button class=\"mr-4\" mat-raised-button (click)=\"retake()\">\n {{ \"scandoc.reTake\" | translate }}\n </button>\n <button\n [disabled]=\"error || form.invalid\"\n class=\"ml-4\"\n mat-raised-button\n (click)=\"use()\"\n >\n {{ \"scandoc.useData\" | translate }}\n </button>\n </div>\n </footer>\n </section>\n</ng-container>\n\n<ng-container *ngIf=\"manual\">\n <section>\n <ngx-manual-scan (action)=\"manualScanData($event)\"></ngx-manual-scan>\n </section>\n</ng-container>\n<ng-container *ngIf=\"!result && documentTypeSelected && !manual\">\n <section>\n <div #wraper class=\"wraper\">\n <div class=\"loading\" *ngIf=\"(!cameraReady && !preview) || scaning\">\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n\n <ng-container *ngIf=\"!error\">\n <ngx-scandoc-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main\"\n #webcam\n type=\"document\"\n [trigger]=\"trigger\"\n [imageHandler]=\"imageHandler\"\n (imageCapture)=\"handleImage($event)\"\n (initError)=\"handleInitError($event)\"\n (destroyed)=\"cameraOff($event)\"\n (videoReady)=\"videoReady($event)\"\n [refresh]=\"refresh\"\n >\n </ngx-scandoc-webcam>\n </ng-container>\n <div\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"\n z-index: 20;\n display: flex;\n position: absolute;\n width: 100%;\n height: 100%;\n \"\n >\n <div class=\"p-16 error\" *ngIf=\"error\">\n <div>\n <div class=\"title\">\n <mat-icon>error_outline</mat-icon\n ><span class=\"ml-8\">{{\n \"scandoc.unableToDetectId\" | translate\n }}</span>\n </div>\n\n <ng-container *ngIf=\"errorCode === '1001'\">\n <div>\n {{ \"scandoc.extraction.c1001\" | translate }}\n </div>\n </ng-container>\n <ng-container *ngIf=\"errorCode === '1002'\">\n <div>\n {{ \"scandoc.extraction.c1002\" | translate }}\n </div>\n </ng-container>\n\n <ul *ngIf=\"errorCode === '1000'\">\n <li>\n {{ \"scandoc.placeIdCloseToDevice\" | translate }}\n </li>\n <li>\n {{ \"scandoc.ensureSufficientLight\" | translate }}\n </li>\n <li>\n {{ \"scandoc.holdDocumentSteady\" | translate }}\n </li>\n <li>\n {{ \"scandoc.makeSureAllEdgesOfTheIdAreVisible\" | translate }}\n </li>\n <li>\n {{\n \"scandoc.makeSureThereAreNoGlareAndShadowsOnTheId\" | translate\n }}\n </li>\n </ul>\n </div>\n </div>\n\n <div class=\"scanPreview\" *ngIf=\"!error && !scaning\">\n <!-- <div class=\"py-16\" style=\"font-size: 16px\">\n {{\n \"scandoc.ensureAllTextsAreVisible\"\n | translate\n }}\n </div> -->\n <div\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer *ngIf=\"preview\">\n <!-- <div class=\"displayInfo\" *ngIf=\"!preview && cameraReady\">\n <ng-container *ngIf=\"displayInfo\">\n {{ displayInfo | translate }}\n </ng-container>\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 {{ \"scandoc.captureBack\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"idScan === 'FRONT'\">\n Turn document and:\n {{ \"scandoc.captureFront\" | translate }}\n </ng-container>\n </div>\n </div> -->\n\n <div class=\"actions\" *ngIf=\"preview\">\n <button class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n {{ \"scandoc.retry\" | translate }}\n </button>\n\n <button\n [disabled]=\"error\"\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n {{ \"scandoc.continueWithSelectedImage\" | translate }}\n </button>\n </div>\n </footer>\n </section>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5;overflow:hidden;position:relative}:host.mobile .hint{font-size:13px}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;display:flex;flex-direction:row;align-items:center;justify-content:center;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}.manualMode{position:absolute;width:100%;height:100%;z-index:200;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.manualMode .content{margin-top:20px;background-color:#fff;border-radius:6px;max-width:300px;width:100%;display:flex;flex-direction:column;padding:30px 20px 0}.manualMode .inner{display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:14px}.manualMode .inner mat-icon{width:60px;height:60px;font-size:60px}.manualMode .inner .text{margin:20px 0}.manualMode footer{display:flex;flex-direction:row;align-items:center;justify-content:center;padding-bottom:20px}.manualMode footer button{min-width:140px;box-shadow:none;border:1px solid #ccc}.pageTurn{position:absolute;width:100%;height:100%;z-index:200;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.pageTurn .content{background-color:#fff;border-radius:6px;max-width:300px;width:100%;display:flex;flex-direction:column;padding:30px 20px 0}.pageTurn .inner{display:flex;flex-direction:column;align-items:center;justify-content:center}.pageTurn .inner mat-icon{width:60px;height:60px;font-size:60px}.pageTurn .inner .text{margin:20px 0;font-size:14px}.pageTurn footer{display:flex;flex-direction:row;align-items:center;justify-content:center;padding-bottom:20px}.pageTurn footer button{min-width:200px;box-shadow:none;border:1px solid #ccc}.hint{position:absolute;z-index:5;font-size:18px;line-height:18px;display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%}.hint .text{border-radius:3px;padding:4px 8px;background-color:#000;color:#fff;text-align:center;display:inline;-webkit-box-decoration-break:clone;box-decoration-break:clone}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: WebcamComponent, selector: "ngx-scandoc-webcam", inputs: ["imageHandler", "type", "trigger", "refresh"], outputs: ["cameraSwitched", "videoReady", "imageCapture", "initError"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i8.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: ScanResultsDataComponent, selector: "ngx-scan-results-data", inputs: ["data", "images", "form"], outputs: ["action"] }, { kind: "component", type: ManualScanComponent, selector: "ngx-manual-scan", outputs: ["action"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3136
|
+
}
|
|
3137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanComponent, decorators: [{
|
|
3138
|
+
type: Component,
|
|
3139
|
+
args: [{ selector: 'ngx-scan', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<ng-container\n *ngIf=\"cameraProvider.rectPosition.t > 0 && displayInfo && !result && !manual\"\n>\n <div class=\"hint\" [ngStyle]=\"{ top: cameraProvider.hintPosition + 'px' }\">\n <span class=\"text\">\n {{ displayInfo | translate }}\n </span>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"showDialog\">\n <div class=\"pageTurn\">\n <div class=\"content\">\n <div class=\"inner\">\n <mat-icon>360</mat-icon>\n <div class=\"text\">\n <ng-container *ngIf=\"idScan === 'BACK'\">\n {{ \"scandoc.turnAndCapture.back\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"idScan === 'FRONT'\">\n {{ \"scandoc.turnAndCapture.front\" | translate }}\n </ng-container>\n </div>\n </div>\n <footer>\n <button (click)=\"closeDialog()\" mat-raised-button>Ok</button>\n </footer>\n </div>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"promptManual\">\n <div class=\"manualMode\">\n <div class=\"content\">\n <div class=\"inner\">\n <mat-icon>screenshot</mat-icon>\n <div class=\"text\">\n {{ \"scandoc.manual\" | translate }}\n </div>\n </div>\n <footer>\n <button\n style=\"margin-right: 8px\"\n (click)=\"manualSet(true)\"\n mat-raised-button\n >\n {{ \"scandoc.yes\" | translate }}\n </button>\n <button\n style=\"margin-left: 8px\"\n (click)=\"manualSet(false)\"\n mat-raised-button\n >\n {{ \"scandoc.no\" | translate }}\n </button>\n </footer>\n </div>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"result\">\n <section>\n <ngx-scan-results-data\n (action)=\"selfie()\"\n [form]=\"form\"\n [data]=\"scanResults\"\n >\n </ngx-scan-results-data>\n j\n\n <footer>\n <div class=\"actions\">\n <button class=\"mr-4\" mat-raised-button (click)=\"retake()\">\n {{ \"scandoc.reTake\" | translate }}\n </button>\n <button\n [disabled]=\"error || form.invalid\"\n class=\"ml-4\"\n mat-raised-button\n (click)=\"use()\"\n >\n {{ \"scandoc.useData\" | translate }}\n </button>\n </div>\n </footer>\n </section>\n</ng-container>\n\n<ng-container *ngIf=\"manual\">\n <section>\n <ngx-manual-scan (action)=\"manualScanData($event)\"></ngx-manual-scan>\n </section>\n</ng-container>\n<ng-container *ngIf=\"!result && documentTypeSelected && !manual\">\n <section>\n <div #wraper class=\"wraper\">\n <div class=\"loading\" *ngIf=\"(!cameraReady && !preview) || scaning\">\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n\n <ng-container *ngIf=\"!error\">\n <ngx-scandoc-webcam\n *ngIf=\"!preview && !scaning\"\n class=\"main\"\n #webcam\n type=\"document\"\n [trigger]=\"trigger\"\n [imageHandler]=\"imageHandler\"\n (imageCapture)=\"handleImage($event)\"\n (initError)=\"handleInitError($event)\"\n (destroyed)=\"cameraOff($event)\"\n (videoReady)=\"videoReady($event)\"\n [refresh]=\"refresh\"\n >\n </ngx-scandoc-webcam>\n </ng-container>\n <div\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"\n z-index: 20;\n display: flex;\n position: absolute;\n width: 100%;\n height: 100%;\n \"\n >\n <div class=\"p-16 error\" *ngIf=\"error\">\n <div>\n <div class=\"title\">\n <mat-icon>error_outline</mat-icon\n ><span class=\"ml-8\">{{\n \"scandoc.unableToDetectId\" | translate\n }}</span>\n </div>\n\n <ng-container *ngIf=\"errorCode === '1001'\">\n <div>\n {{ \"scandoc.extraction.c1001\" | translate }}\n </div>\n </ng-container>\n <ng-container *ngIf=\"errorCode === '1002'\">\n <div>\n {{ \"scandoc.extraction.c1002\" | translate }}\n </div>\n </ng-container>\n\n <ul *ngIf=\"errorCode === '1000'\">\n <li>\n {{ \"scandoc.placeIdCloseToDevice\" | translate }}\n </li>\n <li>\n {{ \"scandoc.ensureSufficientLight\" | translate }}\n </li>\n <li>\n {{ \"scandoc.holdDocumentSteady\" | translate }}\n </li>\n <li>\n {{ \"scandoc.makeSureAllEdgesOfTheIdAreVisible\" | translate }}\n </li>\n <li>\n {{\n \"scandoc.makeSureThereAreNoGlareAndShadowsOnTheId\" | translate\n }}\n </li>\n </ul>\n </div>\n </div>\n\n <div class=\"scanPreview\" *ngIf=\"!error && !scaning\">\n <!-- <div class=\"py-16\" style=\"font-size: 16px\">\n {{\n \"scandoc.ensureAllTextsAreVisible\"\n | translate\n }}\n </div> -->\n <div\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer *ngIf=\"preview\">\n <!-- <div class=\"displayInfo\" *ngIf=\"!preview && cameraReady\">\n <ng-container *ngIf=\"displayInfo\">\n {{ displayInfo | translate }}\n </ng-container>\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 {{ \"scandoc.captureBack\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"idScan === 'FRONT'\">\n Turn document and:\n {{ \"scandoc.captureFront\" | translate }}\n </ng-container>\n </div>\n </div> -->\n\n <div class=\"actions\" *ngIf=\"preview\">\n <button class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n {{ \"scandoc.retry\" | translate }}\n </button>\n\n <button\n [disabled]=\"error\"\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n {{ \"scandoc.continueWithSelectedImage\" | translate }}\n </button>\n </div>\n </footer>\n </section>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5;overflow:hidden;position:relative}:host.mobile .hint{font-size:13px}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;display:flex;flex-direction:row;align-items:center;justify-content:center;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}.manualMode{position:absolute;width:100%;height:100%;z-index:200;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.manualMode .content{margin-top:20px;background-color:#fff;border-radius:6px;max-width:300px;width:100%;display:flex;flex-direction:column;padding:30px 20px 0}.manualMode .inner{display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:14px}.manualMode .inner mat-icon{width:60px;height:60px;font-size:60px}.manualMode .inner .text{margin:20px 0}.manualMode footer{display:flex;flex-direction:row;align-items:center;justify-content:center;padding-bottom:20px}.manualMode footer button{min-width:140px;box-shadow:none;border:1px solid #ccc}.pageTurn{position:absolute;width:100%;height:100%;z-index:200;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.pageTurn .content{background-color:#fff;border-radius:6px;max-width:300px;width:100%;display:flex;flex-direction:column;padding:30px 20px 0}.pageTurn .inner{display:flex;flex-direction:column;align-items:center;justify-content:center}.pageTurn .inner mat-icon{width:60px;height:60px;font-size:60px}.pageTurn .inner .text{margin:20px 0;font-size:14px}.pageTurn footer{display:flex;flex-direction:row;align-items:center;justify-content:center;padding-bottom:20px}.pageTurn footer button{min-width:200px;box-shadow:none;border:1px solid #ccc}.hint{position:absolute;z-index:5;font-size:18px;line-height:18px;display:flex;flex-direction:row;align-items:center;justify-content:center;width:100%}.hint .text{border-radius:3px;padding:4px 8px;background-color:#000;color:#fff;text-align:center;display:inline;-webkit-box-decoration-break:clone;box-decoration-break:clone}\n"] }]
|
|
3140
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: NgxScandocCameraProvider }, { type: i0.Injector }, { type: LayoutProvider }, { type: i2.Platform }, { type: i4$1.DeviceDetectorService }, { type: NgxScandocAuthProvider }, { type: ScanProvider }], propDecorators: { type: [{
|
|
3141
|
+
type: Input
|
|
3142
|
+
}], dialogs: [{
|
|
3143
|
+
type: Input
|
|
3144
|
+
}], refresh: [{
|
|
3145
|
+
type: Input
|
|
3146
|
+
}], actions: [{
|
|
3147
|
+
type: Output
|
|
3148
|
+
}], showDialog: [{
|
|
3149
|
+
type: Input
|
|
3150
|
+
}], class: [{
|
|
3151
|
+
type: HostBinding,
|
|
3152
|
+
args: ['class.mobile']
|
|
3153
|
+
}], onResize: [{
|
|
3154
|
+
type: HostListener,
|
|
3155
|
+
args: ['window:resize', ['$event']]
|
|
3156
|
+
}] } });
|
|
3157
|
+
|
|
3158
|
+
class MaterialModule {
|
|
3159
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3160
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: MaterialModule, imports: [MatNativeDateModule,
|
|
3161
|
+
MatDatepickerModule,
|
|
3162
|
+
MatCardModule,
|
|
3163
|
+
MatMenuModule,
|
|
3164
|
+
MatIconModule,
|
|
3165
|
+
MatButtonModule,
|
|
3166
|
+
MatDialogModule,
|
|
3167
|
+
MatInputModule,
|
|
3168
|
+
MatSnackBarModule,
|
|
3169
|
+
MatProgressBarModule,
|
|
3170
|
+
MatTableModule,
|
|
3171
|
+
MatProgressSpinnerModule,
|
|
3172
|
+
MatPaginatorModule,
|
|
3173
|
+
MatSelectModule,
|
|
3174
|
+
MatCheckboxModule,
|
|
3175
|
+
MatChipsModule,
|
|
3176
|
+
MatBadgeModule,
|
|
3177
|
+
MatListModule,
|
|
3178
|
+
MatTabsModule,
|
|
3179
|
+
MatSliderModule,
|
|
3180
|
+
MatSlideToggleModule], exports: [MatNativeDateModule,
|
|
3181
|
+
MatDatepickerModule,
|
|
3182
|
+
MatSelectModule,
|
|
3183
|
+
MatCardModule,
|
|
3184
|
+
MatMenuModule,
|
|
3185
|
+
MatIconModule,
|
|
3186
|
+
MatButtonModule,
|
|
3187
|
+
MatDialogModule,
|
|
3188
|
+
MatInputModule,
|
|
3189
|
+
MatSnackBarModule,
|
|
3190
|
+
MatProgressBarModule,
|
|
3191
|
+
MatProgressSpinnerModule,
|
|
3192
|
+
MatTableModule,
|
|
3193
|
+
MatPaginatorModule,
|
|
3194
|
+
MatChipsModule,
|
|
3195
|
+
MatBadgeModule,
|
|
3196
|
+
MatCheckboxModule,
|
|
3197
|
+
MatListModule,
|
|
3198
|
+
MatTabsModule,
|
|
3199
|
+
MatSlideToggleModule,
|
|
3200
|
+
MatAutocompleteModule] }); }
|
|
3201
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MaterialModule, imports: [MatNativeDateModule,
|
|
3202
|
+
MatDatepickerModule,
|
|
3203
|
+
MatCardModule,
|
|
3204
|
+
MatMenuModule,
|
|
3205
|
+
MatIconModule,
|
|
3206
|
+
MatButtonModule,
|
|
3207
|
+
MatDialogModule,
|
|
3208
|
+
MatInputModule,
|
|
3209
|
+
MatSnackBarModule,
|
|
3210
|
+
MatProgressBarModule,
|
|
3211
|
+
MatTableModule,
|
|
3212
|
+
MatProgressSpinnerModule,
|
|
3213
|
+
MatPaginatorModule,
|
|
3214
|
+
MatSelectModule,
|
|
3215
|
+
MatCheckboxModule,
|
|
3216
|
+
MatChipsModule,
|
|
3217
|
+
MatBadgeModule,
|
|
3218
|
+
MatListModule,
|
|
3219
|
+
MatTabsModule,
|
|
3220
|
+
MatSliderModule,
|
|
3221
|
+
MatSlideToggleModule, MatNativeDateModule,
|
|
3222
|
+
MatDatepickerModule,
|
|
3223
|
+
MatSelectModule,
|
|
3224
|
+
MatCardModule,
|
|
3225
|
+
MatMenuModule,
|
|
3226
|
+
MatIconModule,
|
|
3227
|
+
MatButtonModule,
|
|
3228
|
+
MatDialogModule,
|
|
3229
|
+
MatInputModule,
|
|
3230
|
+
MatSnackBarModule,
|
|
3231
|
+
MatProgressBarModule,
|
|
3232
|
+
MatProgressSpinnerModule,
|
|
3233
|
+
MatTableModule,
|
|
3234
|
+
MatPaginatorModule,
|
|
3235
|
+
MatChipsModule,
|
|
3236
|
+
MatBadgeModule,
|
|
3237
|
+
MatCheckboxModule,
|
|
3238
|
+
MatListModule,
|
|
3239
|
+
MatTabsModule,
|
|
3240
|
+
MatSlideToggleModule,
|
|
3241
|
+
MatAutocompleteModule] }); }
|
|
3242
|
+
}
|
|
3243
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MaterialModule, decorators: [{
|
|
3244
|
+
type: NgModule,
|
|
3245
|
+
args: [{
|
|
3246
|
+
imports: [
|
|
3247
|
+
MatNativeDateModule,
|
|
3248
|
+
MatDatepickerModule,
|
|
3249
|
+
MatCardModule,
|
|
3250
|
+
MatMenuModule,
|
|
3251
|
+
MatIconModule,
|
|
3252
|
+
MatButtonModule,
|
|
3253
|
+
MatDialogModule,
|
|
3254
|
+
MatInputModule,
|
|
3255
|
+
MatSnackBarModule,
|
|
3256
|
+
MatProgressBarModule,
|
|
3257
|
+
MatTableModule,
|
|
3258
|
+
MatProgressSpinnerModule,
|
|
3259
|
+
MatPaginatorModule,
|
|
3260
|
+
MatSelectModule,
|
|
3261
|
+
MatCheckboxModule,
|
|
3262
|
+
MatChipsModule,
|
|
3263
|
+
MatBadgeModule,
|
|
3264
|
+
MatListModule,
|
|
3265
|
+
MatTabsModule,
|
|
3266
|
+
MatSliderModule,
|
|
3267
|
+
MatSlideToggleModule,
|
|
3268
|
+
],
|
|
3269
|
+
exports: [
|
|
3270
|
+
MatNativeDateModule,
|
|
3271
|
+
MatDatepickerModule,
|
|
3272
|
+
MatSelectModule,
|
|
3273
|
+
MatCardModule,
|
|
3274
|
+
MatMenuModule,
|
|
3275
|
+
MatIconModule,
|
|
3276
|
+
MatButtonModule,
|
|
3277
|
+
MatDialogModule,
|
|
3278
|
+
MatInputModule,
|
|
3279
|
+
MatSnackBarModule,
|
|
3280
|
+
MatProgressBarModule,
|
|
3281
|
+
MatProgressSpinnerModule,
|
|
3282
|
+
MatTableModule,
|
|
3283
|
+
MatPaginatorModule,
|
|
3284
|
+
MatChipsModule,
|
|
3285
|
+
MatBadgeModule,
|
|
3286
|
+
MatCheckboxModule,
|
|
3287
|
+
MatListModule,
|
|
3288
|
+
MatTabsModule,
|
|
3289
|
+
MatSlideToggleModule,
|
|
3290
|
+
MatAutocompleteModule,
|
|
3291
|
+
],
|
|
3292
|
+
providers: [],
|
|
3293
|
+
}]
|
|
3294
|
+
}] });
|
|
3295
|
+
|
|
3296
|
+
class AvatarTypeComponent extends FieldType {
|
|
3297
|
+
constructor(cd) {
|
|
3298
|
+
super();
|
|
3299
|
+
this.cd = cd;
|
|
3300
|
+
this.width = 'w-120';
|
|
3301
|
+
this.padding = 'px-32 pt-8 pb-8';
|
|
3458
3302
|
}
|
|
3459
|
-
|
|
3460
|
-
|
|
3303
|
+
ngOnChange() { }
|
|
3304
|
+
selfie() { }
|
|
3305
|
+
;
|
|
3306
|
+
ngAfterViewInit() {
|
|
3307
|
+
if (this.to.width) {
|
|
3308
|
+
this.width = this.to.width;
|
|
3309
|
+
}
|
|
3310
|
+
if (this.to.padding) {
|
|
3311
|
+
this.padding = this.to.padding;
|
|
3312
|
+
}
|
|
3313
|
+
this.cd.detectChanges();
|
|
3314
|
+
}
|
|
3315
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AvatarTypeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3316
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: AvatarTypeComponent, isStandalone: false, selector: "app-formly-avatar-type", usesInheritance: true, ngImport: i0, template: `
|
|
3317
|
+
<mat-card appearance="outlined" style="margin: 4px; padding:16px">
|
|
3318
|
+
<div class="card-title">{{ 'scandoc.result.avatar' | translate }}</div>
|
|
3319
|
+
<div class="selfieContainer">
|
|
3320
|
+
<div class="selfie">
|
|
3321
|
+
<img *ngIf="model?._avatar" class="preview" [src]="model._avatar" />
|
|
3322
|
+
</div>
|
|
3323
|
+
<button (click)="selfie()" mat-raised-button>
|
|
3324
|
+
{{ 'scandoc.result.takeSelfie' | translate }}
|
|
3325
|
+
</button>
|
|
3326
|
+
</div>
|
|
3327
|
+
</mat-card>
|
|
3328
|
+
`, isInline: true, styles: ["mat-card{border-radius:0;box-shadow:none!important}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
3461
3329
|
}
|
|
3462
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
3463
|
-
type:
|
|
3464
|
-
args: [{
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3330
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AvatarTypeComponent, decorators: [{
|
|
3331
|
+
type: Component,
|
|
3332
|
+
args: [{ selector: 'app-formly-avatar-type', template: `
|
|
3333
|
+
<mat-card appearance="outlined" style="margin: 4px; padding:16px">
|
|
3334
|
+
<div class="card-title">{{ 'scandoc.result.avatar' | translate }}</div>
|
|
3335
|
+
<div class="selfieContainer">
|
|
3336
|
+
<div class="selfie">
|
|
3337
|
+
<img *ngIf="model?._avatar" class="preview" [src]="model._avatar" />
|
|
3338
|
+
</div>
|
|
3339
|
+
<button (click)="selfie()" mat-raised-button>
|
|
3340
|
+
{{ 'scandoc.result.takeSelfie' | translate }}
|
|
3341
|
+
</button>
|
|
3342
|
+
</div>
|
|
3343
|
+
</mat-card>
|
|
3344
|
+
`, standalone: false, styles: ["mat-card{border-radius:0;box-shadow:none!important}\n"] }]
|
|
3345
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
|
|
3468
3346
|
|
|
3469
|
-
class
|
|
3470
|
-
constructor(
|
|
3347
|
+
class TitleTypeComponent extends FieldType {
|
|
3348
|
+
constructor(cd) {
|
|
3471
3349
|
super();
|
|
3472
|
-
this.cameraProvider = cameraProvider;
|
|
3473
|
-
this.formProvider = formProvider;
|
|
3474
|
-
this.provider = provider;
|
|
3475
3350
|
this.cd = cd;
|
|
3476
|
-
this.zone = zone;
|
|
3477
|
-
this.action = new EventEmitter();
|
|
3478
3351
|
}
|
|
3479
3352
|
ngOnInit() {
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
this.__subs(this.data).subscribe((resp) => {
|
|
3484
|
-
this.zone.run(() => {
|
|
3485
|
-
switch (resp.type) {
|
|
3486
|
-
case 'avatar':
|
|
3487
|
-
this.model._avatar = resp.data;
|
|
3488
|
-
this.form = new FormGroup({});
|
|
3489
|
-
console.log(this.model);
|
|
3490
|
-
break;
|
|
3491
|
-
case 'model':
|
|
3492
|
-
this.model = resp.data;
|
|
3493
|
-
break;
|
|
3494
|
-
}
|
|
3495
|
-
console.timeEnd('results');
|
|
3496
|
-
this.cd.detectChanges();
|
|
3497
|
-
});
|
|
3498
|
-
});
|
|
3353
|
+
this.opt = {
|
|
3354
|
+
badge: this.to.badge,
|
|
3355
|
+
};
|
|
3499
3356
|
}
|
|
3500
|
-
|
|
3501
|
-
this.
|
|
3357
|
+
ngAfterViewInit() {
|
|
3358
|
+
this.cd.detectChanges();
|
|
3359
|
+
}
|
|
3360
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TitleTypeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3361
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: TitleTypeComponent, isStandalone: false, selector: "app-formly-title-type", usesInheritance: true, ngImport: i0, template: `
|
|
3362
|
+
<div class="card-title">
|
|
3363
|
+
{{ to.label }}
|
|
3364
|
+
</div>
|
|
3365
|
+
`, isInline: true, styles: [""] }); }
|
|
3366
|
+
}
|
|
3367
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TitleTypeComponent, decorators: [{
|
|
3368
|
+
type: Component,
|
|
3369
|
+
args: [{ selector: 'app-formly-title-type', template: `
|
|
3370
|
+
<div class="card-title">
|
|
3371
|
+
{{ to.label }}
|
|
3372
|
+
</div>
|
|
3373
|
+
`, standalone: false }]
|
|
3374
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
|
|
3375
|
+
|
|
3376
|
+
class ProfileImageTypeComponent extends FieldType {
|
|
3377
|
+
constructor(cd, cameraProvider, scanProvider) {
|
|
3378
|
+
super();
|
|
3379
|
+
this.cd = cd;
|
|
3380
|
+
this.cameraProvider = cameraProvider;
|
|
3381
|
+
this.scanProvider = scanProvider;
|
|
3502
3382
|
}
|
|
3503
3383
|
selfie() {
|
|
3504
|
-
this.
|
|
3384
|
+
this.cameraProvider.selfie$.next(true);
|
|
3385
|
+
}
|
|
3386
|
+
ngOnChange() { }
|
|
3387
|
+
ngAfterViewInit() { }
|
|
3388
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProfileImageTypeComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: NgxScandocCameraProvider }, { token: ScanProvider }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3389
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ProfileImageTypeComponent, isStandalone: false, selector: "app-formly-profile-image-type", usesInheritance: true, ngImport: i0, template: `
|
|
3390
|
+
<mat-form-field>
|
|
3391
|
+
<mat-label>{{ 'scandoc.result.avatar' | translate }} </mat-label>
|
|
3392
|
+
<input matInput style="display:none" />
|
|
3393
|
+
<div class="selfieContainer">
|
|
3394
|
+
<div class="selfie">
|
|
3395
|
+
<img *ngIf="model?._avatar" class="preview" [src]="model._avatar" />
|
|
3396
|
+
</div>
|
|
3397
|
+
<button
|
|
3398
|
+
*ngIf="scanProvider.enableVerification"
|
|
3399
|
+
(click)="selfie()"
|
|
3400
|
+
mat-raised-button
|
|
3401
|
+
>
|
|
3402
|
+
{{ 'scandoc.result.takeSelfie' | translate }}
|
|
3403
|
+
</button>
|
|
3404
|
+
</div>
|
|
3405
|
+
</mat-form-field>
|
|
3406
|
+
`, isInline: true, styles: [".selfieContainer{display:flex;flex-direction:column;align-items:center;justify-content:center}.selfieContainer button{margin-top:6px;box-shadow:none!important;border:1px solid rgba(0,0,0,.12);text-transform:uppercase;font-size:12px}.selfie{width:126px;height:126px;border-radius:70px;background:#f5f5f5;display:flex;flex-direction:column;align-items:center;justify-content:center}.selfie img{width:120px;height:120px;border-radius:60px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$2.MatLabel, selector: "mat-label" }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i4$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
3407
|
+
}
|
|
3408
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProfileImageTypeComponent, decorators: [{
|
|
3409
|
+
type: Component,
|
|
3410
|
+
args: [{ selector: 'app-formly-profile-image-type', template: `
|
|
3411
|
+
<mat-form-field>
|
|
3412
|
+
<mat-label>{{ 'scandoc.result.avatar' | translate }} </mat-label>
|
|
3413
|
+
<input matInput style="display:none" />
|
|
3414
|
+
<div class="selfieContainer">
|
|
3415
|
+
<div class="selfie">
|
|
3416
|
+
<img *ngIf="model?._avatar" class="preview" [src]="model._avatar" />
|
|
3417
|
+
</div>
|
|
3418
|
+
<button
|
|
3419
|
+
*ngIf="scanProvider.enableVerification"
|
|
3420
|
+
(click)="selfie()"
|
|
3421
|
+
mat-raised-button
|
|
3422
|
+
>
|
|
3423
|
+
{{ 'scandoc.result.takeSelfie' | translate }}
|
|
3424
|
+
</button>
|
|
3425
|
+
</div>
|
|
3426
|
+
</mat-form-field>
|
|
3427
|
+
`, standalone: false, styles: [".selfieContainer{display:flex;flex-direction:column;align-items:center;justify-content:center}.selfieContainer button{margin-top:6px;box-shadow:none!important;border:1px solid rgba(0,0,0,.12);text-transform:uppercase;font-size:12px}.selfie{width:126px;height:126px;border-radius:70px;background:#f5f5f5;display:flex;flex-direction:column;align-items:center;justify-content:center}.selfie img{width:120px;height:120px;border-radius:60px}\n"] }]
|
|
3428
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: NgxScandocCameraProvider }, { type: ScanProvider }] });
|
|
3429
|
+
|
|
3430
|
+
class AppFormModule {
|
|
3431
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3432
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: AppFormModule, declarations: [TitleTypeComponent,
|
|
3433
|
+
AvatarTypeComponent,
|
|
3434
|
+
ProfileImageTypeComponent], imports: [CommonModule,
|
|
3435
|
+
FormsModule,
|
|
3436
|
+
FormlyMatDatepickerModule,
|
|
3437
|
+
FormlySelectModule,
|
|
3438
|
+
MaterialModule,
|
|
3439
|
+
AvatarModule,
|
|
3440
|
+
TranslateModule,
|
|
3441
|
+
FormlyMaterialModule, i5.FormlyModule], exports: [FormlyModule] }); }
|
|
3442
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppFormModule, imports: [CommonModule,
|
|
3443
|
+
FormsModule,
|
|
3444
|
+
FormlyMatDatepickerModule,
|
|
3445
|
+
FormlySelectModule,
|
|
3446
|
+
MaterialModule,
|
|
3447
|
+
AvatarModule,
|
|
3448
|
+
TranslateModule,
|
|
3449
|
+
FormlyMaterialModule,
|
|
3450
|
+
FormlyModule.forChild({
|
|
3451
|
+
types: [
|
|
3452
|
+
{
|
|
3453
|
+
name: 'title',
|
|
3454
|
+
component: TitleTypeComponent,
|
|
3455
|
+
wrappers: [],
|
|
3456
|
+
},
|
|
3457
|
+
{
|
|
3458
|
+
name: 'profile-image',
|
|
3459
|
+
component: ProfileImageTypeComponent,
|
|
3460
|
+
wrappers: [],
|
|
3461
|
+
},
|
|
3462
|
+
],
|
|
3463
|
+
}), FormlyModule] }); }
|
|
3464
|
+
}
|
|
3465
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppFormModule, decorators: [{
|
|
3466
|
+
type: NgModule,
|
|
3467
|
+
args: [{
|
|
3468
|
+
declarations: [
|
|
3469
|
+
TitleTypeComponent,
|
|
3470
|
+
AvatarTypeComponent,
|
|
3471
|
+
ProfileImageTypeComponent,
|
|
3472
|
+
],
|
|
3473
|
+
imports: [
|
|
3474
|
+
CommonModule,
|
|
3475
|
+
FormsModule,
|
|
3476
|
+
FormlyMatDatepickerModule,
|
|
3477
|
+
FormlySelectModule,
|
|
3478
|
+
MaterialModule,
|
|
3479
|
+
AvatarModule,
|
|
3480
|
+
TranslateModule,
|
|
3481
|
+
FormlyMaterialModule,
|
|
3482
|
+
FormlyModule.forChild({
|
|
3483
|
+
types: [
|
|
3484
|
+
{
|
|
3485
|
+
name: 'title',
|
|
3486
|
+
component: TitleTypeComponent,
|
|
3487
|
+
wrappers: [],
|
|
3488
|
+
},
|
|
3489
|
+
{
|
|
3490
|
+
name: 'profile-image',
|
|
3491
|
+
component: ProfileImageTypeComponent,
|
|
3492
|
+
wrappers: [],
|
|
3493
|
+
},
|
|
3494
|
+
],
|
|
3495
|
+
}),
|
|
3496
|
+
],
|
|
3497
|
+
providers: [],
|
|
3498
|
+
exports: [FormlyModule],
|
|
3499
|
+
}]
|
|
3500
|
+
}] });
|
|
3501
|
+
|
|
3502
|
+
class CameraSwitchComponent {
|
|
3503
|
+
constructor(cameraProvider) {
|
|
3504
|
+
this.cameraProvider = cameraProvider;
|
|
3505
3505
|
}
|
|
3506
|
-
|
|
3507
|
-
|
|
3506
|
+
ngAfterViewInit() {
|
|
3507
|
+
// this.cameraProvider.setDefault();
|
|
3508
|
+
}
|
|
3509
|
+
ngOnDestroy() { }
|
|
3510
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CameraSwitchComponent, deps: [{ token: NgxScandocCameraProvider }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3511
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: CameraSwitchComponent, isStandalone: false, selector: "ngx-scan-camera-switch", ngImport: i0, template: "<mat-form-field\n style=\"font-size: 14px; margin-top: 8px\"\n class=\"w-100-p mr-16 mt-8\"\n\n>\n <mat-label> {{ \"scandoc.camera\" | translate }} </mat-label>\n <mat-select\n (selectionChange)=\"cameraProvider.selectCamera($event)\"\n [(ngModel)]=\"cameraProvider.deviceId\"\n >\n <mat-option\n *ngFor=\"let device of cameraProvider.mediaDevices\"\n [value]=\"device.deviceId\"\n >\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: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$2.MatLabel, selector: "mat-label" }, { kind: "component", type: i5$2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i5$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
3508
3512
|
}
|
|
3509
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type:
|
|
3513
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CameraSwitchComponent, decorators: [{
|
|
3510
3514
|
type: Component,
|
|
3511
|
-
args: [{ selector: 'ngx-scan-
|
|
3512
|
-
}], ctorParameters: () => [{ type: NgxScandocCameraProvider }
|
|
3513
|
-
type: Input
|
|
3514
|
-
}], images: [{
|
|
3515
|
-
type: Input
|
|
3516
|
-
}], form: [{
|
|
3517
|
-
type: Input
|
|
3518
|
-
}], action: [{
|
|
3519
|
-
type: Output
|
|
3520
|
-
}] } });
|
|
3515
|
+
args: [{ selector: 'ngx-scan-camera-switch', standalone: false, template: "<mat-form-field\n style=\"font-size: 14px; margin-top: 8px\"\n class=\"w-100-p mr-16 mt-8\"\n\n>\n <mat-label> {{ \"scandoc.camera\" | translate }} </mat-label>\n <mat-select\n (selectionChange)=\"cameraProvider.selectCamera($event)\"\n [(ngModel)]=\"cameraProvider.deviceId\"\n >\n <mat-option\n *ngFor=\"let device of cameraProvider.mediaDevices\"\n [value]=\"device.deviceId\"\n >\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"] }]
|
|
3516
|
+
}], ctorParameters: () => [{ type: NgxScandocCameraProvider }] });
|
|
3521
3517
|
|
|
3522
3518
|
//import { NgxScandocCameraProvider } from '../../providers/camera.provider';
|
|
3523
3519
|
class CoreComponentsModule {
|
|
@@ -3529,7 +3525,7 @@ class CoreComponentsModule {
|
|
|
3529
3525
|
}
|
|
3530
3526
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CoreComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3531
3527
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: CoreComponentsModule, declarations: [ScanComponent,
|
|
3532
|
-
|
|
3528
|
+
ScanResultsDataComponent,
|
|
3533
3529
|
CameraSwitchComponent,
|
|
3534
3530
|
ManualScanComponent], imports: [CommonModule,
|
|
3535
3531
|
FormsModule,
|
|
@@ -3539,7 +3535,7 @@ class CoreComponentsModule {
|
|
|
3539
3535
|
ScanComponent,
|
|
3540
3536
|
CameraSwitchComponent,
|
|
3541
3537
|
ManualScanComponent,
|
|
3542
|
-
|
|
3538
|
+
ScanResultsDataComponent] }); }
|
|
3543
3539
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CoreComponentsModule, imports: [CommonModule,
|
|
3544
3540
|
FormsModule,
|
|
3545
3541
|
TranslateModule,
|
|
@@ -3562,7 +3558,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3562
3558
|
],
|
|
3563
3559
|
declarations: [
|
|
3564
3560
|
ScanComponent,
|
|
3565
|
-
|
|
3561
|
+
ScanResultsDataComponent,
|
|
3566
3562
|
CameraSwitchComponent,
|
|
3567
3563
|
ManualScanComponent,
|
|
3568
3564
|
],
|
|
@@ -3571,7 +3567,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3571
3567
|
ScanComponent,
|
|
3572
3568
|
CameraSwitchComponent,
|
|
3573
3569
|
ManualScanComponent,
|
|
3574
|
-
|
|
3570
|
+
ScanResultsDataComponent,
|
|
3575
3571
|
],
|
|
3576
3572
|
providers: [],
|
|
3577
3573
|
}]
|
|
@@ -3586,7 +3582,7 @@ class SafeResourceUrlPipe {
|
|
|
3586
3582
|
// return this.sanitizer.bypassSecurityTrustStyle(style);
|
|
3587
3583
|
// return this.sanitizer.bypassSecurityTrustXxx(style); - see docs
|
|
3588
3584
|
}
|
|
3589
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SafeResourceUrlPipe, deps: [{ token: i1$
|
|
3585
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SafeResourceUrlPipe, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
3590
3586
|
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: SafeResourceUrlPipe, isStandalone: false, name: "safeResourceUrl" }); }
|
|
3591
3587
|
}
|
|
3592
3588
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SafeResourceUrlPipe, decorators: [{
|
|
@@ -3595,7 +3591,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3595
3591
|
name: 'safeResourceUrl',
|
|
3596
3592
|
standalone: false
|
|
3597
3593
|
}]
|
|
3598
|
-
}], ctorParameters: () => [{ type: i1$
|
|
3594
|
+
}], ctorParameters: () => [{ type: i1$2.DomSanitizer }] });
|
|
3599
3595
|
|
|
3600
3596
|
class CorePipesModule {
|
|
3601
3597
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CorePipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
@@ -3667,13 +3663,13 @@ class ScanProfileComponent extends BaseComponent {
|
|
|
3667
3663
|
close() {
|
|
3668
3664
|
this.dialogRef?.close();
|
|
3669
3665
|
}
|
|
3670
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanProfileComponent, deps: [{ token: NgxScandocCameraProvider }, { token: ScanProvider }, { token: i1$
|
|
3671
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ScanProfileComponent, isStandalone: false, selector: "ngx-scandoc-profile", inputs: { type: "type" }, host: { listeners: { "touchmove": "handleTouchMove($event)" } }, usesInheritance: true, ngImport: i0, template: "<header class=\"page-header\">\n <div class=\"title\">\n {{ \"scandoc.title\" | translate }}\n </div>\n\n <span style=\"flex: 1\"></span>\n\n <ng-container *ngIf=\"cameraProvider.$showSwitch | async\">\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <ngx-scan-camera-switch></ngx-scan-camera-switch>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"type === 'desktop'\">\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\n (actions)=\"actions($event)\"\n [showDialog]=\"showDialog\"\n [dialogs]=\"dialogs\"\n></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%}@media only screen and (max-width: 768px){header .title{font-size:12px!important;line-height:18px!important}}\n", ".page-header{z-index:2000;height:64px;padding:0;overflow:hidden;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:
|
|
3666
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanProfileComponent, deps: [{ token: NgxScandocCameraProvider }, { token: ScanProvider }, { token: i1$3.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3667
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ScanProfileComponent, isStandalone: false, selector: "ngx-scandoc-profile", inputs: { type: "type" }, host: { listeners: { "touchmove": "handleTouchMove($event)" } }, usesInheritance: true, ngImport: i0, template: "<header class=\"page-header\">\n <div class=\"title\">\n {{ \"scandoc.title\" | translate }}\n </div>\n\n <span style=\"flex: 1\"></span>\n\n <ng-container *ngIf=\"cameraProvider.$showSwitch | async\">\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <ngx-scan-camera-switch></ngx-scan-camera-switch>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"type === 'desktop'\">\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\n (actions)=\"actions($event)\"\n [showDialog]=\"showDialog\"\n [dialogs]=\"dialogs\"\n></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%}@media only screen and (max-width: 768px){header .title{font-size:12px!important;line-height:18px!important}}\n", ".page-header{z-index:2000;height:64px;padding:0;overflow:hidden;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: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: ScanComponent, selector: "ngx-scan", inputs: ["type", "dialogs", "refresh", "showDialog"], outputs: ["actions"] }, { kind: "component", type: CameraSwitchComponent, selector: "ngx-scan-camera-switch" }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3672
3668
|
}
|
|
3673
3669
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanProfileComponent, decorators: [{
|
|
3674
3670
|
type: Component,
|
|
3675
3671
|
args: [{ selector: 'ngx-scandoc-profile', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<header class=\"page-header\">\n <div class=\"title\">\n {{ \"scandoc.title\" | translate }}\n </div>\n\n <span style=\"flex: 1\"></span>\n\n <ng-container *ngIf=\"cameraProvider.$showSwitch | async\">\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <ngx-scan-camera-switch></ngx-scan-camera-switch>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"type === 'desktop'\">\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\n (actions)=\"actions($event)\"\n [showDialog]=\"showDialog\"\n [dialogs]=\"dialogs\"\n></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%}@media only screen and (max-width: 768px){header .title{font-size:12px!important;line-height:18px!important}}\n", ".page-header{z-index:2000;height:64px;padding:0;overflow:hidden;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"] }]
|
|
3676
|
-
}], ctorParameters: () => [{ type: NgxScandocCameraProvider }, { type: ScanProvider }, { type: i1$
|
|
3672
|
+
}], ctorParameters: () => [{ type: NgxScandocCameraProvider }, { type: ScanProvider }, { type: i1$3.MatDialogRef }, { type: undefined, decorators: [{
|
|
3677
3673
|
type: Inject,
|
|
3678
3674
|
args: [MAT_DIALOG_DATA]
|
|
3679
3675
|
}] }], propDecorators: { type: [{
|
|
@@ -3711,13 +3707,13 @@ class BlankComponent {
|
|
|
3711
3707
|
this.init();
|
|
3712
3708
|
}
|
|
3713
3709
|
}
|
|
3714
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: BlankComponent, deps: [{ token: i1$
|
|
3710
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: BlankComponent, deps: [{ token: i1$3.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3715
3711
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: BlankComponent, isStandalone: false, selector: "ngx-scandoc-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"] }); }
|
|
3716
3712
|
}
|
|
3717
3713
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: BlankComponent, decorators: [{
|
|
3718
3714
|
type: Component,
|
|
3719
3715
|
args: [{ selector: 'ngx-scandoc-blank', standalone: false, template: "<ng-template #body></ng-template>\n", styles: [":host{display:flex;flex:1;flex-direction:column;overflow:hidden;height:100%}\n"] }]
|
|
3720
|
-
}], ctorParameters: () => [{ type: i1$
|
|
3716
|
+
}], ctorParameters: () => [{ type: i1$3.MatDialogRef }, { type: undefined, decorators: [{
|
|
3721
3717
|
type: Inject,
|
|
3722
3718
|
args: [MAT_DIALOG_DATA]
|
|
3723
3719
|
}] }, { type: i0.ChangeDetectorRef }], propDecorators: { body: [{
|
|
@@ -3761,13 +3757,13 @@ class ConfirmComponent {
|
|
|
3761
3757
|
this.dialogRef.close(key);
|
|
3762
3758
|
}
|
|
3763
3759
|
close() { }
|
|
3764
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ConfirmComponent, deps: [{ token: i1$
|
|
3765
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ConfirmComponent, isStandalone: false, selector: "ngx-scandoc-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 <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 <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 || \"scandoc.cancel\" | translate }}\n </button>\n\n <button\n *ngIf=\"data.no && !options?.hideNoButton\"\n (click)=\"action('no')\"\n mat-raised-button\n >\n {{ data.no }}\n </button>\n <button\n *ngIf=\"!data.hideOkButton && !options?.hideOkButton\"\n (click)=\"action(true)\"\n mat-raised-button\n >\n <ng-container *ngIf=\"!data.alert\">\n {{ data.ok || \"scandoc.confirm\" | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"data.alert\">\n {{ data.ok || \"scandoc.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;padding:0 20px}.actions button{min-width:120px;margin-right:16px;text-transform:uppercase;box-shadow:none;border:1px solid rgba(0,0,0,.12)}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;overflow:hidden;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:
|
|
3760
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ConfirmComponent, deps: [{ token: i1$3.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3761
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ConfirmComponent, isStandalone: false, selector: "ngx-scandoc-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 <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 <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 || \"scandoc.cancel\" | translate }}\n </button>\n\n <button\n *ngIf=\"data.no && !options?.hideNoButton\"\n (click)=\"action('no')\"\n mat-raised-button\n >\n {{ data.no }}\n </button>\n <button\n *ngIf=\"!data.hideOkButton && !options?.hideOkButton\"\n (click)=\"action(true)\"\n mat-raised-button\n >\n <ng-container *ngIf=\"!data.alert\">\n {{ data.ok || \"scandoc.confirm\" | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"data.alert\">\n {{ data.ok || \"scandoc.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;padding:0 20px}.actions button{min-width:120px;margin-right:16px;text-transform:uppercase;box-shadow:none;border:1px solid rgba(0,0,0,.12)}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;overflow:hidden;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: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
3766
3762
|
}
|
|
3767
3763
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ConfirmComponent, decorators: [{
|
|
3768
3764
|
type: Component,
|
|
3769
3765
|
args: [{ selector: 'ngx-scandoc-confirm', standalone: false, template: "<header class=\"page-header\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\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 <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 || \"scandoc.cancel\" | translate }}\n </button>\n\n <button\n *ngIf=\"data.no && !options?.hideNoButton\"\n (click)=\"action('no')\"\n mat-raised-button\n >\n {{ data.no }}\n </button>\n <button\n *ngIf=\"!data.hideOkButton && !options?.hideOkButton\"\n (click)=\"action(true)\"\n mat-raised-button\n >\n <ng-container *ngIf=\"!data.alert\">\n {{ data.ok || \"scandoc.confirm\" | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"data.alert\">\n {{ data.ok || \"scandoc.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;padding:0 20px}.actions button{min-width:120px;margin-right:16px;text-transform:uppercase;box-shadow:none;border:1px solid rgba(0,0,0,.12)}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;overflow:hidden;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"] }]
|
|
3770
|
-
}], ctorParameters: () => [{ type: i1$
|
|
3766
|
+
}], ctorParameters: () => [{ type: i1$3.MatDialogRef }, { type: undefined, decorators: [{
|
|
3771
3767
|
type: Inject,
|
|
3772
3768
|
args: [MAT_DIALOG_DATA]
|
|
3773
3769
|
}] }], propDecorators: { onEnterPress: [{
|
|
@@ -3846,13 +3842,13 @@ class ScanSelfieComponent extends BaseComponent {
|
|
|
3846
3842
|
close() {
|
|
3847
3843
|
this.dialogRef.close(null);
|
|
3848
3844
|
}
|
|
3849
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanSelfieComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$
|
|
3850
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ScanSelfieComponent, isStandalone: false, selector: "ngx-scandoc-selfie", outputs: { actions: "actions" }, usesInheritance: true, ngImport: i0, template: "<header class=\"page-header\">\n <div class=\"title\">\n {{ \"scandoc.result.takeSelfie\" | translate }}\n </div>\n\n <span style=\"flex: 1\"></span>\n\n <ng-container *ngIf=\"cameraProvider.$showSwitchSelfie | async\">\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <ngx-scan-camera-switch></ngx-scan-camera-switch>\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</header>\n\n\n<div class=\"flex-column flex\">\n <div #wraper class=\"wraper flex flex-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>\n <ngx-scandoc-webcam\n *ngIf=\"!preview\"\n class=\"main flex\"\n #webcam\n [trigger]=\"trigger\"\n (imageCapture)=\"handleImage($event)\"\n (initError)=\"handleInitError($event)\"\n (videoReady)=\"videoReady($event)\"\n type=\"selfie\"\n >\n </ngx-scandoc-webcam>\n </ng-container>\n <div\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"\n z-index: 20;\n position: absolute;\n width: 100%;\n height: 100%;\n flex: 1;\n display: flex;\n flex-direction: row;\n \"\n >\n <div\n class=\"scanPreview\"\n style=\"display: flex; flex-direction: column; flex: 1\"\n >\n <div\n style=\"flex: 1\"\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer class=\"p-8 flex-row\">\n <button\n [disabled]=\"!cameraReady\"\n class=\"w-100-p\"\n *ngIf=\"!preview\"\n mat-raised-button\n (click)=\"scan()\"\n >\n <ng-container> {{ \"scandoc.result.takeSelfie\" | translate }} </ng-container>\n </button>\n\n <div\n class=\"w-100-p flex-row flex\"\n *ngIf=\"preview\"\n style=\"align-items: center\"\n >\n <button style=\"flex: 1\" class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n {{ \"scandoc.retry\" | translate }}\n </button>\n\n <button\n style=\"flex: 1\"\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n {{ \"scandoc.continueWithSelectedImage\" | translate }}\n </button>\n </div>\n </footer>\n</div>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5}.flex{flex:1}.flex-column{display:flex;flex-direction:column}.flex-row{display:flex;flex-direction:row}.wraper{position:relative;overflow:hidden}h3{color:#459ae5;font-size:16px}.preview{width:100%;border-radius:1%}.subhead{height:55px;padding-top:8px}footer button{box-shadow:none!important;height:45px;min-height:45px;border:1px solid rgba(0,0,0,.12);text-transform:uppercase}.error .title{font-size:22px}.error ul{font-size:18px}.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}.page-header{display:flex;flex-direction:row;align-items:center}.page-header button{height:100%}@media only screen and (max-width: 768px){header .title{font-size:12px!important;line-height:18px!important}}\n", ".page-header{z-index:2000;height:64px;padding:0;overflow:hidden;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:
|
|
3845
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanSelfieComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$3.MatDialogRef }, { token: NgxScandocCameraProvider }, { token: ScanProvider }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3846
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ScanSelfieComponent, isStandalone: false, selector: "ngx-scandoc-selfie", outputs: { actions: "actions" }, usesInheritance: true, ngImport: i0, template: "<header class=\"page-header\">\n <div class=\"title\">\n {{ \"scandoc.result.takeSelfie\" | translate }}\n </div>\n\n <span style=\"flex: 1\"></span>\n\n <ng-container *ngIf=\"cameraProvider.$showSwitchSelfie | async\">\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <ngx-scan-camera-switch></ngx-scan-camera-switch>\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</header>\n\n\n<div class=\"flex-column flex\">\n <div #wraper class=\"wraper flex flex-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>\n <ngx-scandoc-webcam\n *ngIf=\"!preview\"\n class=\"main flex\"\n #webcam\n [trigger]=\"trigger\"\n (imageCapture)=\"handleImage($event)\"\n (initError)=\"handleInitError($event)\"\n (videoReady)=\"videoReady($event)\"\n type=\"selfie\"\n >\n </ngx-scandoc-webcam>\n </ng-container>\n <div\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"\n z-index: 20;\n position: absolute;\n width: 100%;\n height: 100%;\n flex: 1;\n display: flex;\n flex-direction: row;\n \"\n >\n <div\n class=\"scanPreview\"\n style=\"display: flex; flex-direction: column; flex: 1\"\n >\n <div\n style=\"flex: 1\"\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer class=\"p-8 flex-row\">\n <button\n [disabled]=\"!cameraReady\"\n class=\"w-100-p\"\n *ngIf=\"!preview\"\n mat-raised-button\n (click)=\"scan()\"\n >\n <ng-container> {{ \"scandoc.result.takeSelfie\" | translate }} </ng-container>\n </button>\n\n <div\n class=\"w-100-p flex-row flex\"\n *ngIf=\"preview\"\n style=\"align-items: center\"\n >\n <button style=\"flex: 1\" class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n {{ \"scandoc.retry\" | translate }}\n </button>\n\n <button\n style=\"flex: 1\"\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n {{ \"scandoc.continueWithSelectedImage\" | translate }}\n </button>\n </div>\n </footer>\n</div>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5}.flex{flex:1}.flex-column{display:flex;flex-direction:column}.flex-row{display:flex;flex-direction:row}.wraper{position:relative;overflow:hidden}h3{color:#459ae5;font-size:16px}.preview{width:100%;border-radius:1%}.subhead{height:55px;padding-top:8px}footer button{box-shadow:none!important;height:45px;min-height:45px;border:1px solid rgba(0,0,0,.12);text-transform:uppercase}.error .title{font-size:22px}.error ul{font-size:18px}.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}.page-header{display:flex;flex-direction:row;align-items:center}.page-header button{height:100%}@media only screen and (max-width: 768px){header .title{font-size:12px!important;line-height:18px!important}}\n", ".page-header{z-index:2000;height:64px;padding:0;overflow:hidden;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: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i8.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: WebcamComponent, selector: "ngx-scandoc-webcam", inputs: ["imageHandler", "type", "trigger", "refresh"], outputs: ["cameraSwitched", "videoReady", "imageCapture", "initError"] }, { kind: "component", type: CameraSwitchComponent, selector: "ngx-scan-camera-switch" }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3851
3847
|
}
|
|
3852
3848
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanSelfieComponent, decorators: [{
|
|
3853
3849
|
type: Component,
|
|
3854
3850
|
args: [{ selector: 'ngx-scandoc-selfie', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<header class=\"page-header\">\n <div class=\"title\">\n {{ \"scandoc.result.takeSelfie\" | translate }}\n </div>\n\n <span style=\"flex: 1\"></span>\n\n <ng-container *ngIf=\"cameraProvider.$showSwitchSelfie | async\">\n <div class=\"separator\"></div>\n <div style=\"padding: 0px 16px\">\n <ngx-scan-camera-switch></ngx-scan-camera-switch>\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</header>\n\n\n<div class=\"flex-column flex\">\n <div #wraper class=\"wraper flex flex-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>\n <ngx-scandoc-webcam\n *ngIf=\"!preview\"\n class=\"main flex\"\n #webcam\n [trigger]=\"trigger\"\n (imageCapture)=\"handleImage($event)\"\n (initError)=\"handleInitError($event)\"\n (videoReady)=\"videoReady($event)\"\n type=\"selfie\"\n >\n </ngx-scandoc-webcam>\n </ng-container>\n <div\n class=\"previewData\"\n *ngIf=\"preview\"\n style=\"\n z-index: 20;\n position: absolute;\n width: 100%;\n height: 100%;\n flex: 1;\n display: flex;\n flex-direction: row;\n \"\n >\n <div\n class=\"scanPreview\"\n style=\"display: flex; flex-direction: column; flex: 1\"\n >\n <div\n style=\"flex: 1\"\n class=\"image\"\n [style.background-image]=\"'url(' + preview + ')'\"\n ></div>\n </div>\n </div>\n </div>\n\n <footer class=\"p-8 flex-row\">\n <button\n [disabled]=\"!cameraReady\"\n class=\"w-100-p\"\n *ngIf=\"!preview\"\n mat-raised-button\n (click)=\"scan()\"\n >\n <ng-container> {{ \"scandoc.result.takeSelfie\" | translate }} </ng-container>\n </button>\n\n <div\n class=\"w-100-p flex-row flex\"\n *ngIf=\"preview\"\n style=\"align-items: center\"\n >\n <button style=\"flex: 1\" class=\"mr-4\" mat-raised-button (click)=\"retry()\">\n {{ \"scandoc.retry\" | translate }}\n </button>\n\n <button\n style=\"flex: 1\"\n class=\"ml-4\"\n mat-raised-button\n (click)=\"continue()\"\n >\n {{ \"scandoc.continueWithSelectedImage\" | translate }}\n </button>\n </div>\n </footer>\n</div>\n", styles: [":host{display:flex;flex-direction:column!important;flex:1;background-color:#f5f5f5}.flex{flex:1}.flex-column{display:flex;flex-direction:column}.flex-row{display:flex;flex-direction:row}.wraper{position:relative;overflow:hidden}h3{color:#459ae5;font-size:16px}.preview{width:100%;border-radius:1%}.subhead{height:55px;padding-top:8px}footer button{box-shadow:none!important;height:45px;min-height:45px;border:1px solid rgba(0,0,0,.12);text-transform:uppercase}.error .title{font-size:22px}.error ul{font-size:18px}.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}.page-header{display:flex;flex-direction:row;align-items:center}.page-header button{height:100%}@media only screen and (max-width: 768px){header .title{font-size:12px!important;line-height:18px!important}}\n", ".page-header{z-index:2000;height:64px;padding:0;overflow:hidden;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"] }]
|
|
3855
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$
|
|
3851
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$3.MatDialogRef }, { type: NgxScandocCameraProvider }, { type: ScanProvider }], propDecorators: { actions: [{
|
|
3856
3852
|
type: Output
|
|
3857
3853
|
}] } });
|
|
3858
3854
|
|
|
@@ -3868,13 +3864,13 @@ class TurnDocumentComponent {
|
|
|
3868
3864
|
console.log(this.dialogRef);
|
|
3869
3865
|
this.dialogRef.close();
|
|
3870
3866
|
}
|
|
3871
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TurnDocumentComponent, deps: [{ token: i1$
|
|
3872
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: TurnDocumentComponent, isStandalone: false, selector: "ngx-scandoc-turn-document", 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 {{ \"scandoc.turnAndCapture.back\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"data.idScan === 'FRONT'\">\n {{ \"scandoc.turnAndCapture.front\" | 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:
|
|
3867
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TurnDocumentComponent, deps: [{ token: i1$3.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3868
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: TurnDocumentComponent, isStandalone: false, selector: "ngx-scandoc-turn-document", 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 {{ \"scandoc.turnAndCapture.back\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"data.idScan === 'FRONT'\">\n {{ \"scandoc.turnAndCapture.front\" | 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: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
3873
3869
|
}
|
|
3874
3870
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TurnDocumentComponent, decorators: [{
|
|
3875
3871
|
type: Component,
|
|
3876
3872
|
args: [{ selector: 'ngx-scandoc-turn-document', standalone: false, 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 {{ \"scandoc.turnAndCapture.back\" | translate }}\n </ng-container>\n <ng-container *ngIf=\"data.idScan === 'FRONT'\">\n {{ \"scandoc.turnAndCapture.front\" | 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"] }]
|
|
3877
|
-
}], ctorParameters: () => [{ type: i1$
|
|
3873
|
+
}], ctorParameters: () => [{ type: i1$3.MatDialogRef }, { type: undefined, decorators: [{
|
|
3878
3874
|
type: Inject,
|
|
3879
3875
|
args: [MAT_DIALOG_DATA]
|
|
3880
3876
|
}] }] });
|
|
@@ -3891,13 +3887,13 @@ class PromptManualComponent {
|
|
|
3891
3887
|
console.log(this.dialogRef);
|
|
3892
3888
|
this.dialogRef.close(key);
|
|
3893
3889
|
}
|
|
3894
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PromptManualComponent, deps: [{ token: i1$
|
|
3895
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: PromptManualComponent, isStandalone: false, selector: "ngx-scandoc-prompt-manual", 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>screenshot_keyboard</mat-icon>\n <div class=\"text\">\n {{ \"scandoc.manual\" | translate }}\n </div>\n</div>\n\n<!-- -->\n\n<footer>\n <button style=\"margin-right: 8px\" (click)=\"close(true)\" mat-raised-button>\n {{ \"scandoc.yes\" | translate }}\n </button>\n <button style=\"margin-left: 8px\" (click)=\"close(false)\" mat-raised-button>\n {{ \"scandoc.no\" | translate }}\n </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:10px}footer button{max-width:120px;box-shadow:none;border:1px solid #ccc;flex:1}\n"], dependencies: [{ kind: "component", type: i5$1.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-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "pipe", type:
|
|
3890
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PromptManualComponent, deps: [{ token: i1$3.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3891
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: PromptManualComponent, isStandalone: false, selector: "ngx-scandoc-prompt-manual", 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>screenshot_keyboard</mat-icon>\n <div class=\"text\">\n {{ \"scandoc.manual\" | translate }}\n </div>\n</div>\n\n<!-- -->\n\n<footer>\n <button style=\"margin-right: 8px\" (click)=\"close(true)\" mat-raised-button>\n {{ \"scandoc.yes\" | translate }}\n </button>\n <button style=\"margin-left: 8px\" (click)=\"close(false)\" mat-raised-button>\n {{ \"scandoc.no\" | translate }}\n </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:10px}footer button{max-width:120px;box-shadow:none;border:1px solid #ccc;flex:1}\n"], dependencies: [{ kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
|
3896
3892
|
}
|
|
3897
3893
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PromptManualComponent, decorators: [{
|
|
3898
3894
|
type: Component,
|
|
3899
3895
|
args: [{ selector: 'ngx-scandoc-prompt-manual', standalone: false, 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>screenshot_keyboard</mat-icon>\n <div class=\"text\">\n {{ \"scandoc.manual\" | translate }}\n </div>\n</div>\n\n<!-- -->\n\n<footer>\n <button style=\"margin-right: 8px\" (click)=\"close(true)\" mat-raised-button>\n {{ \"scandoc.yes\" | translate }}\n </button>\n <button style=\"margin-left: 8px\" (click)=\"close(false)\" mat-raised-button>\n {{ \"scandoc.no\" | translate }}\n </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:10px}footer button{max-width:120px;box-shadow:none;border:1px solid #ccc;flex:1}\n"] }]
|
|
3900
|
-
}], ctorParameters: () => [{ type: i1$
|
|
3896
|
+
}], ctorParameters: () => [{ type: i1$3.MatDialogRef }, { type: undefined, decorators: [{
|
|
3901
3897
|
type: Inject,
|
|
3902
3898
|
args: [MAT_DIALOG_DATA]
|
|
3903
3899
|
}] }] });
|
|
@@ -4003,7 +3999,7 @@ class NgxScandocDialogsCoreProvider {
|
|
|
4003
3999
|
data,
|
|
4004
4000
|
});
|
|
4005
4001
|
}
|
|
4006
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScandocDialogsCoreProvider, deps: [{ token: i1$
|
|
4002
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScandocDialogsCoreProvider, deps: [{ token: i1$3.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4007
4003
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScandocDialogsCoreProvider, providedIn: 'root' }); }
|
|
4008
4004
|
}
|
|
4009
4005
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScandocDialogsCoreProvider, decorators: [{
|
|
@@ -4011,7 +4007,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4011
4007
|
args: [{
|
|
4012
4008
|
providedIn: 'root',
|
|
4013
4009
|
}]
|
|
4014
|
-
}], ctorParameters: () => [{ type: i1$
|
|
4010
|
+
}], ctorParameters: () => [{ type: i1$3.MatDialog }] });
|
|
4015
4011
|
|
|
4016
4012
|
//import { NgxScandocCameraProvider } from '../providers/camera.provider';
|
|
4017
4013
|
//import { NgxScandocCameraProvider } from '../providers/camera.provider';
|
|
@@ -4483,5 +4479,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4483
4479
|
* Generated bundle index. Do not edit.
|
|
4484
4480
|
*/
|
|
4485
4481
|
|
|
4486
|
-
export { AUTH_CONFIG_TOKEN, AppFormModule, BlankComponent, CameraSwitchComponent, CoreComponentsModule, CorePipesModule, DialogsModule, HttpErrorInterceptor, LoadingComponent, ManualScanComponent, MaterialModule, NgxScanDocTranslationProvider, NgxScandocAuthProvider, NgxScandocDialogsCoreProvider, NgxScandocFieldsProvider, NgxScandocModule, PromptManualComponent, SCAN_CONFIG_TOKEN, SafeResourceUrlPipe, ScanComponent, ScanProfileComponent, ScanProvider,
|
|
4482
|
+
export { AUTH_CONFIG_TOKEN, AppFormModule, BlankComponent, CameraSwitchComponent, CoreComponentsModule, CorePipesModule, DialogsModule, HttpErrorInterceptor, LoadingComponent, ManualScanComponent, MaterialModule, NgxScanDocTranslationProvider, NgxScandocAuthProvider, NgxScandocDialogsCoreProvider, NgxScandocFieldsProvider, NgxScandocModule, PromptManualComponent, SCAN_CONFIG_TOKEN, SafeResourceUrlPipe, ScanComponent, ScanProfileComponent, ScanProvider, ScanResultsDataComponent, ScanSelfieComponent, TranslateLoaderProvider, TurnDocumentComponent, WebcamComponent, WebcamImage, WebcamModule, webRtcProvider };
|
|
4487
4483
|
//# sourceMappingURL=ngx-scandoc.mjs.map
|