ngx-scandoc 19.0.4 → 19.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, EventEmitter, Output, ViewChild, HostListener, Input, ChangeDetectionStrategy, Component, NgModule, InjectionToken, HostBinding, Optional, Inject, Pipe, ViewContainerRef } from '@angular/core';
2
+ import { Injectable, EventEmitter, Output, ViewChild, HostListener, Input, ChangeDetectionStrategy, Component, NgModule, InjectionToken, Optional, Inject, HostBinding, Pipe, ViewContainerRef } from '@angular/core';
3
3
  import * as i4 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import { Subject, of, from, Observable, tap, distinctUntilChanged, switchMap as switchMap$1, throwError, forkJoin } from 'rxjs';
@@ -7,7 +7,7 @@ import { takeUntil, map, switchMap, tap as tap$1, catchError, share, retry } fro
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 i5$2 from '@angular/forms';
10
+ import * as i5 from '@angular/forms';
11
11
  import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
12
12
  import moment from 'moment';
13
13
  import * as i1$1 from '@angular/common/http';
@@ -20,17 +20,19 @@ import * as i3 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 i5 from '@angular/material/card';
24
- import { MatCardModule } from '@angular/material/card';
25
23
  import * as i4$1 from '@ngx-translate/core';
26
24
  import { TranslateModule } from '@ngx-translate/core';
25
+ import * as i6 from '@angular/material/card';
26
+ import { MatCardModule } from '@angular/material/card';
27
+ import * as i7 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$4 from '@angular/material/dialog';
35
+ import * as i1$3 from '@angular/material/dialog';
34
36
  import { MatDialogModule, MAT_DIALOG_DATA } from '@angular/material/dialog';
35
37
  import * as i4$3 from '@angular/material/input';
36
38
  import { MatInputModule } from '@angular/material/input';
@@ -38,20 +40,18 @@ 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$3 from '@angular/material/select';
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$3 from '@angular/platform-browser';
54
+ import * as i1$2 from '@angular/platform-browser';
55
55
  import { webSocket } from 'rxjs/webSocket';
56
56
 
57
57
  /**
@@ -1647,1531 +1647,182 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
1647
1647
  }]
1648
1648
  }], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i0.Injector }] });
1649
1649
 
1650
- class ManualScanComponent extends BaseComponent {
1651
- get class() {
1652
- return this.isMobile;
1653
- }
1654
- onResize() {
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();
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;
1656
+ this.injector = injector;
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
+ }
1668
1666
  }
1669
1667
  }
1670
- constructor(cameraProvider, cd, layoutProvider, zone) {
1671
- super();
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
- },
1689
- {
1690
- title: 'scandoc.back',
1691
- description: 'scandoc.backDescription',
1692
- disabled: true,
1693
- side: 'BACK',
1694
- },
1695
- ];
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
- }
1706
- ngOnInit() {
1707
- this.__subs(this.layoutProvider.breakpoint$).subscribe((v) => {
1708
- this.zone.run(() => {
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
- });
1668
+ path(path) {
1669
+ return path;
1670
+ // const baseHref = this.platformLocation
1671
+ // .getBaseHrefFromDOM()
1672
+ // .split('/')
1673
+ // .join('');
1674
+ // return baseHref != '' ? `/${baseHref}${path}` : path;
1717
1675
  }
1718
- get nextWebcamObservable() {
1719
- return this.nextWebcam.asObservable();
1676
+ setDefaultLang(lang) {
1677
+ this.defaultLang = lang;
1678
+ this.translate.setDefaultLang(this.defaultLang);
1720
1679
  }
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);
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));
1684
+ }
1730
1685
  }
1731
- handleInitError(error) {
1732
- console.log(error);
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
+ }
1733
1698
  }
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
- };
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
+ }
1755
1712
  });
1756
1713
  }
1757
- getImgBase64(num) {
1758
- return this.scanBlastData[num].image.dataUrl.split(',')[1];
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
+ }));
1759
1724
  }
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
- };
1725
+ onTranslationChanged(lang) {
1726
+ this.translate.onTranslationChange.next({
1727
+ lang,
1728
+ translations: this.customLoader.getFullTranslationJSON(lang),
1770
1729
  });
1771
1730
  }
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
- // );
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));
1738
+ }
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 = {};
1792
1744
  }
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
- }
1745
+ if (item.props.label) {
1746
+ item.expressions['props.label'] = this.translate.stream(prefix + item.props.label);
1801
1747
  }
1802
- this.cd.detectChanges();
1803
- });
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;
1804
1762
  }
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" }] }); }
1763
+ 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 }); }
1764
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScanDocTranslationProvider, providedIn: 'root' }); }
1910
1765
  }
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
- }] } });
1766
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScanDocTranslationProvider, decorators: [{
1767
+ type: Injectable,
1768
+ args: [{
1769
+ providedIn: 'root',
1770
+ }]
1771
+ }], ctorParameters: () => [{ type: i4$1.TranslateService }, { type: i0.Injector }, { type: undefined, decorators: [{
1772
+ type: Optional
1773
+ }, {
1774
+ type: Inject,
1775
+ args: [TRANSLATION_PROVIDER]
1776
+ }] }, { type: i4.PlatformLocation }] });
1926
1777
 
1927
- class ScanComponent extends BaseComponent {
1928
- get class() {
1929
- return this.isMobile;
1930
- }
1931
- onResize() {
1932
- if (this.result) {
1933
- this.cd.detectChanges();
1934
- }
1778
+ class NgxScandocFieldsProvider {
1779
+ constructor(translate, provider) {
1780
+ this.translate = translate;
1781
+ this.provider = provider;
1782
+ this.selfie$ = new Subject();
1935
1783
  }
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
- },
1784
+ update() {
1785
+ return [
1952
1786
  {
1953
- title: 'pms.dialogs.components.scanProfile.back',
1954
- description: 'pms.dialogs.components.scanProfile.backDescription',
1955
- disabled: true,
1956
- side: 'BACK',
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)),
1957
1820
  },
1958
1821
  ];
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
1822
  }
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;
1823
+ document() {
1824
+ if (this.customFields) {
1825
+ return this.customFields;
3175
1826
  }
3176
1827
  return [
3177
1828
  {
@@ -3452,72 +2103,1421 @@ 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 ScanResultsComponent extends BaseComponent {
2121
+ constructor(cameraProvider, formProvider, provider, cd, zone) {
2122
+ super();
2123
+ this.cameraProvider = cameraProvider;
2124
+ this.formProvider = formProvider;
2125
+ this.provider = provider;
2126
+ this.cd = cd;
2127
+ this.zone = zone;
2128
+ this.action = new EventEmitter();
2129
+ }
2130
+ ngOnInit() {
2131
+ console.time('fields');
2132
+ this.fields = this.formProvider.document();
2133
+ console.timeEnd('fields');
2134
+ this.__subs(this.data).subscribe((resp) => {
2135
+ this.zone.run(() => {
2136
+ switch (resp.type) {
2137
+ case 'avatar':
2138
+ this.model._avatar = resp.data;
2139
+ this.form = new FormGroup({});
2140
+ console.log(this.model);
2141
+ break;
2142
+ case 'model':
2143
+ this.model = resp.data;
2144
+ break;
2145
+ }
2146
+ console.timeEnd('results');
2147
+ this.cd.detectChanges();
2148
+ });
2149
+ });
2150
+ }
2151
+ ngOnDestroy() {
2152
+ this.__destroy();
2153
+ }
2154
+ selfie() {
2155
+ this.action.emit({ selfie: true });
2156
+ }
2157
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanResultsComponent, deps: [{ token: NgxScandocCameraProvider }, { token: NgxScandocFieldsProvider }, { token: ScanProvider }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
2158
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ScanResultsComponent, 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\n\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 appearance=\"outlined\" style=\"margin:0px 4px; padding: 16px\" class=\"images\">\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: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: i6.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: i7.LegacyFormlyForm, selector: "formly-form" }, { kind: "directive", type: i5.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }] }); }
2159
+ }
2160
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanResultsComponent, decorators: [{
2161
+ type: Component,
2162
+ args: [{ selector: 'ngx-scan-results-data', standalone: false, template: "<div *ngIf=\"model\" class=\"wraper\">\n <div style=\"flex: 1\">\n\n\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 appearance=\"outlined\" style=\"margin:0px 4px; padding: 16px\" class=\"images\">\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"] }]
2163
+ }], ctorParameters: () => [{ type: NgxScandocCameraProvider }, { type: NgxScandocFieldsProvider }, { type: ScanProvider }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }], propDecorators: { data: [{
2164
+ type: Input
2165
+ }], images: [{
2166
+ type: Input
2167
+ }], form: [{
2168
+ type: Input
2169
+ }], action: [{
2170
+ type: Output
2171
+ }] } });
2172
+
2173
+ class ManualScanComponent extends BaseComponent {
2174
+ get class() {
2175
+ return this.isMobile;
2176
+ }
2177
+ onResize() {
2178
+ if (this.wraper) {
2179
+ this.width = this.wraper.nativeElement.clientWidth;
2180
+ this.height = this.wraper.nativeElement.clientHeight;
2181
+ setTimeout(() => {
2182
+ const video = this.wraper?.nativeElement.querySelector('video');
2183
+ if (video) {
2184
+ // console.log(video.clientWidth, video.clientHeight);
2185
+ this.videoWidth = video.clientWidth;
2186
+ this.videoHeight = video.clientHeight;
2187
+ }
2188
+ this.cd.detectChanges();
2189
+ }, 100);
2190
+ this.cd.detectChanges();
2191
+ }
2192
+ }
2193
+ constructor(cameraProvider, cd, layoutProvider, zone) {
2194
+ super();
2195
+ this.cameraProvider = cameraProvider;
2196
+ this.cd = cd;
2197
+ this.layoutProvider = layoutProvider;
2198
+ this.zone = zone;
2199
+ this.action = new EventEmitter();
2200
+ this.videoOptions = {
2201
+ width: 1920,
2202
+ height: 1080,
2203
+ facingMode: 'environment',
2204
+ };
2205
+ this.cameraReady = false;
2206
+ this.scanBlastData = [
2207
+ {
2208
+ title: 'scandoc.front',
2209
+ description: 'scandoc.frontDescription',
2210
+ side: 'FRONT',
2211
+ },
2212
+ {
2213
+ title: 'scandoc.back',
2214
+ description: 'scandoc.backDescription',
2215
+ disabled: true,
2216
+ side: 'BACK',
2217
+ },
2218
+ ];
2219
+ this.error = false;
2220
+ this.scaning = false;
2221
+ this.documentTypeSelected = false;
2222
+ this.preview = null;
2223
+ this.scanDatas = [];
2224
+ this.trigger = new Subject();
2225
+ // switch to next / previous / specific webcam; true/false: forward/backwards, string: deviceId
2226
+ this.nextWebcam = new Subject();
2227
+ this.isMobile = false;
2228
+ }
2229
+ ngOnInit() {
2230
+ this.__subs(this.layoutProvider.breakpoint$).subscribe((v) => {
2231
+ this.zone.run(() => {
2232
+ this.isMobile = !v.matches;
2233
+ setTimeout(() => {
2234
+ console.log('WTF');
2235
+ this.cd.detectChanges();
2236
+ }, 200);
2237
+ });
2238
+ console.log('MNOBILE', this.isMobile);
2239
+ });
2240
+ }
2241
+ get nextWebcamObservable() {
2242
+ return this.nextWebcam.asObservable();
2243
+ }
2244
+ cameraWasSwitched(deviceId) {
2245
+ console.log('[active device]', deviceId);
2246
+ // this.deviceId = deviceId;
2247
+ // this.cameraReady = true;
2248
+ // this.defaultDevice = deviceId;
2249
+ setTimeout(() => {
2250
+ this.onResize();
2251
+ // this.scan();
2252
+ }, 300);
2253
+ }
2254
+ handleInitError(error) {
2255
+ console.log(error);
2256
+ }
2257
+ resolutionLimit(file) {
2258
+ const minWidth = 1280;
2259
+ const minHeight = 720;
2260
+ return new Observable((observer) => {
2261
+ const img = new Image();
2262
+ img.src = window.URL.createObjectURL(file);
2263
+ img.onload = () => {
2264
+ const width = img.naturalWidth;
2265
+ const height = img.naturalHeight;
2266
+ let valid = false;
2267
+ if (width > height) {
2268
+ valid = width >= minWidth && height >= minHeight;
2269
+ }
2270
+ else {
2271
+ valid = width >= minHeight && height >= minWidth;
2272
+ }
2273
+ observer.next(valid);
2274
+ };
2275
+ img.onerror = (error) => {
2276
+ observer.error(error);
2277
+ };
2278
+ });
2279
+ }
2280
+ getImgBase64(num) {
2281
+ return this.scanBlastData[num].image.dataUrl.split(',')[1];
2282
+ }
2283
+ getBase64(file) {
2284
+ return new Observable((observer) => {
2285
+ const reader = new FileReader();
2286
+ reader.readAsDataURL(file);
2287
+ reader.onload = () => {
2288
+ observer.next(reader.result);
2289
+ };
2290
+ reader.onerror = (error) => {
2291
+ observer.error(error);
2292
+ };
2293
+ });
2294
+ }
2295
+ handleFileInput(target, event, side) {
2296
+ const files = target.files;
2297
+ this.selectedSide = side;
2298
+ console.log(files);
2299
+ const file = files.item(0);
2300
+ this.resolutionLimit(file)
2301
+ .pipe(switchMap$1((valid) => {
2302
+ return valid ? this.getBase64(file) : of(false);
2303
+ }))
2304
+ .subscribe((imageAsDataUrl) => {
2305
+ // console.log(imageAsDataUrl);
2306
+ event.target.value = null;
2307
+ if (!imageAsDataUrl) {
2308
+ console.warn('MIN RES');
2309
+ // this.dialogs.alert(
2310
+ // 'core.page.error',
2311
+ // this.translate.instant(
2312
+ // 'pms.dialogs.components.scanProfile.minResolution'
2313
+ // )
2314
+ // );
2315
+ }
2316
+ else {
2317
+ side.image = {
2318
+ _imageAsDataUrl: imageAsDataUrl,
2319
+ imageAsDataUrl: imageAsDataUrl,
2320
+ };
2321
+ if (this.selectedSide.side === 'FRONT') {
2322
+ this.scanBlastData[1].disabled = false;
2323
+ }
2324
+ }
2325
+ this.cd.detectChanges();
2326
+ });
2327
+ }
2328
+ cameraOff(ev) { }
2329
+ ngOnDestroy() { }
2330
+ singleScan(side) {
2331
+ this.scanType = side.side;
2332
+ this.preview = null;
2333
+ this.selectedSide = side;
2334
+ this.selectedSide.image = null;
2335
+ this.documentTypeSelected = true;
2336
+ this.scanBlastData[1].disabled = false;
2337
+ this.cameraProvider.$showSwitch.next(true);
2338
+ this.cd.detectChanges();
2339
+ setTimeout(() => {
2340
+ this.onResize();
2341
+ }, 10);
2342
+ }
2343
+ scanBlastFinish() {
2344
+ this.action.emit(this.scanBlastData);
2345
+ }
2346
+ get scanBlastCanUpload() {
2347
+ return this.scanBlastData[0].image ? true : false;
2348
+ }
2349
+ handleImage(webcamImage) {
2350
+ console.log('[received webcam image]', webcamImage);
2351
+ this.webcamImage = webcamImage;
2352
+ this.preview = webcamImage.imageAsDataUrl;
2353
+ this.cameraProvider.$showSwitch.next(false);
2354
+ this.cd.detectChanges();
2355
+ }
2356
+ continue() {
2357
+ this.documentTypeSelected = false;
2358
+ setTimeout(() => {
2359
+ this.selectedSide.image = this.webcamImage;
2360
+ if (this.selectedSide.side === 'FRONT') {
2361
+ this.scanBlastData[1].disabled = false;
2362
+ }
2363
+ this.cd.detectChanges();
2364
+ }, 200);
2365
+ }
2366
+ retry() {
2367
+ this.preview = false;
2368
+ this.cameraProvider.$showSwitch.next(true);
2369
+ // this.result = false;
2370
+ if (this.error) {
2371
+ this.documentTypeSelected = false;
2372
+ this.scanBlastData.forEach((element) => {
2373
+ element.image = null;
2374
+ });
2375
+ }
2376
+ this.error = false;
2377
+ }
2378
+ triggerSnapshot() {
2379
+ this.trigger.next(0);
2380
+ }
2381
+ scan() {
2382
+ console.log('SCAN');
2383
+ this.triggerSnapshot();
2384
+ this.scanDatas[0] = true;
2385
+ console.log(this.cameraProvider);
2386
+ this.cd.detectChanges();
2387
+ }
2388
+ rotateBase64Image(base64data) {
2389
+ return new Observable((observer) => {
2390
+ const canvas = document.createElement('canvas');
2391
+ const ctx = canvas.getContext('2d');
2392
+ var image = new Image();
2393
+ image.src = base64data;
2394
+ image.onload = () => {
2395
+ console.log(canvas);
2396
+ canvas.width = image.height;
2397
+ canvas.height = image.width;
2398
+ if (ctx) {
2399
+ ctx.rotate((90 * Math.PI) / 180);
2400
+ ctx.translate(0, -canvas.width);
2401
+ ctx.drawImage(image, 0, 0);
2402
+ observer.next(canvas.toDataURL());
2403
+ }
2404
+ else {
2405
+ observer.error({ type: 'generic error' });
2406
+ }
2407
+ };
2408
+ image.onerror = (e) => {
2409
+ observer.error(e);
2410
+ };
2411
+ });
2412
+ }
2413
+ singleScanRotate(side) {
2414
+ console.log(side);
2415
+ this.rotateBase64Image(side.image.imageAsDataUrl).subscribe((data) => {
2416
+ side.image = { imageAsDataUrl: data };
2417
+ this.cd.detectChanges();
2418
+ });
2419
+ }
2420
+ videoReady(event) {
2421
+ console.log('READY', event);
2422
+ this.cameraReady = event;
2423
+ }
2424
+ singleScanRemove(side) {
2425
+ side.image = null;
2426
+ if (side.side === 'FRONT') {
2427
+ this.scanBlastData[1].disabled = true;
2428
+ }
2429
+ this.cd.detectChanges();
2430
+ }
2431
+ 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 }); }
2432
+ 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: i6.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" }] }); }
2433
+ }
2434
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ManualScanComponent, decorators: [{
2435
+ type: Component,
2436
+ 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"] }]
2437
+ }], ctorParameters: () => [{ type: NgxScandocCameraProvider }, { type: i0.ChangeDetectorRef }, { type: LayoutProvider }, { type: i0.NgZone }], propDecorators: { action: [{
2438
+ type: Output
2439
+ }], wraper: [{
2440
+ type: ViewChild,
2441
+ args: ['wraper']
2442
+ }], class: [{
2443
+ type: HostBinding,
2444
+ args: ['class.mobile']
2445
+ }], onResize: [{
2446
+ type: HostListener,
2447
+ args: ['window:resize', ['$event']]
2448
+ }] } });
2449
+
2450
+ class ScanComponent extends BaseComponent {
2451
+ get class() {
2452
+ return this.isMobile;
2453
+ }
2454
+ onResize() {
2455
+ if (this.result) {
2456
+ this.cd.detectChanges();
2457
+ }
2458
+ }
2459
+ constructor(cd, zone, cameraProvider, injector, layoutProvider, platform, deviceService, auth) {
2460
+ super();
2461
+ this.cd = cd;
2462
+ this.zone = zone;
2463
+ this.cameraProvider = cameraProvider;
2464
+ this.injector = injector;
2465
+ this.layoutProvider = layoutProvider;
2466
+ this.platform = platform;
2467
+ this.deviceService = deviceService;
2468
+ this.auth = auth;
2469
+ this.scanBlastData = [
2470
+ {
2471
+ title: 'pms.dialogs.components.scanProfile.front',
2472
+ description: 'pms.dialogs.components.scanProfile.frontDescription',
2473
+ side: 'FRONT',
2474
+ },
2475
+ {
2476
+ title: 'pms.dialogs.components.scanProfile.back',
2477
+ description: 'pms.dialogs.components.scanProfile.backDescription',
2478
+ disabled: true,
2479
+ side: 'BACK',
2480
+ },
2481
+ ];
2482
+ this.type = 'desktop';
2483
+ this.actions = new EventEmitter();
2484
+ this.scanResults = new Subject();
2485
+ this.scanSecondSide = false;
2486
+ this.startTime = 0;
2487
+ this.scanInProgress = false;
2488
+ // webcam snapshot trigger
2489
+ this.documentTypeSelected = false;
2490
+ this.preview = null;
2491
+ this.errorCode = '1000';
2492
+ this.displayInfo = 'scandoc.info.position';
2493
+ this.verificationErrorSent = false;
2494
+ this.error = false;
2495
+ this.cameraReady = false;
2496
+ this.scaning = false;
2497
+ this.promptManual = false;
2498
+ this.imageHandler = new Subject();
2499
+ this.manualDataSet = false;
2500
+ this.logData = {
2501
+ AcceptTermsAndConditions: true,
2502
+ Request: null,
2503
+ Response: null,
2504
+ ExpectedOutput: null,
2505
+ };
2506
+ this.scanDatas = [];
2507
+ this.idScan = null;
2508
+ this.validation = false;
2509
+ this.scannedImages = [];
2510
+ this.scanDelay = 0;
2511
+ this.trigger = new Subject();
2512
+ // switch to next / previous / specific webcam; true/false: forward/backwards, string: deviceId
2513
+ this.nextWebcam = new Subject();
2514
+ this.imageVerified = false;
2515
+ this.form = new FormGroup({});
2516
+ this.manual = false;
2517
+ this.isMobile = this.platform.IOS || this.platform.ANDROID;
2518
+ this.showDialog = false;
2519
+ this.scanImageTimestamps = {
2520
+ time: 0,
2521
+ load: 0,
2522
+ };
2523
+ this.numberOfValidations = 0;
2524
+ this.validationDebug = [];
2525
+ this.blurValues = [];
2526
+ this.scanProvider = this.injector.get(ScanProvider);
2527
+ if (!this.scanProvider.config.development) {
2528
+ // console = {
2529
+ // log: (...args: any) => {},
2530
+ // time: (...args: any) => {},
2531
+ // timeEnd: (...args: any) => {},
2532
+ // warn: (...args: any) => {},
2533
+ // error: (...args: any) => {},
2534
+ // };
2535
+ }
2536
+ }
2537
+ resetLogData() {
2538
+ this.logData = {
2539
+ Request: null,
2540
+ Response: null,
2541
+ ExpectedOutput: null,
2542
+ AcceptTermsAndConditions: true,
2543
+ };
2544
+ }
2545
+ init() {
2546
+ this.auth.accesToken.subscribe();
2547
+ this.resetLogData();
2548
+ // this.result=true;
2549
+ // this.result ={};
2550
+ console.log('INIT SCAN');
2551
+ }
2552
+ continue() {
2553
+ this.documentTypeSelected = false;
2554
+ setTimeout(() => {
2555
+ this.selectedSide.image = this.webcamImage;
2556
+ if (this.selectedSide.side === 'FRONT') {
2557
+ this.scanBlastData[1].disabled = false;
2558
+ }
2559
+ this.cd.detectChanges();
2560
+ }, 200);
2561
+ }
2562
+ scan() {
2563
+ this.trigger.next(new Date().getTime());
2564
+ }
2565
+ handleImage(webcamImage) {
2566
+ if (this.startTime === 0) {
2567
+ this.startTime = Date.now();
2568
+ }
2569
+ // console.log('[received webcam image]', webcamImage);
2570
+ this.zone.runOutsideAngular(() => {
2571
+ const time = new Date().getTime();
2572
+ if (this.scanImageTimestamps.load > 0) {
2573
+ const { load } = this.scanImageTimestamps;
2574
+ const diff = time - load;
2575
+ // console.log('time:', diff);
2576
+ this.scanDelay = diff;
2577
+ }
2578
+ this.scanImageTimestamps.load = time;
2579
+ if (webcamImage.imageAsDataUrl) {
2580
+ this.scannedImages.push(webcamImage);
2581
+ this.handleLongValidationError(webcamImage, 'worker');
2582
+ }
2583
+ this.cd.detectChanges();
2584
+ if (this.scannedImages.length > 0 && !this.validation) {
2585
+ // if (this.scanProvider.config.development) {
2586
+ // this.scannedImages.forEach((img) => {
2587
+ // const consoleBackground =
2588
+ // "font-size:100px;background-image: url('" +
2589
+ // img.imageResized +
2590
+ // "');background-size: contain; background-repeat: no-repeat;";
2591
+ // console.log('%c ', consoleBackground);
2592
+ // });
2593
+ // }
2594
+ // this.frontImage = webcamImage.imageResized;
2595
+ // console.timeEnd('scan');
2596
+ // console.time('scan');
2597
+ // get last 10
2598
+ // console.log('CAPTURED:', this.scannedImages.length);
2599
+ const images = this.scannedImages.slice(-5);
2600
+ // set images to 0
2601
+ this.scannedImages = [];
2602
+ const imagesArray = images.map((m) => m.imageResized.split(',')[1]);
2603
+ this.validation = true;
2604
+ this.handleBurstData(imagesArray, images);
2605
+ }
2606
+ else {
2607
+ if (this.cameraReady) {
2608
+ this.scan();
2609
+ }
2610
+ }
2611
+ });
2612
+ }
2613
+ handleBurstData(imagesArray, images, type = 'plain') {
2614
+ this.__subs(this.scanProvider.burst(imagesArray, this.blurValues)).subscribe((resp) => {
2615
+ this.displayInfo = 'scandoc.info.c' + resp.InfoCode;
2616
+ // console.timeEnd('validationPOST');
2617
+ // console.log('AnalysisTime', resp.AnalysisTime);
2618
+ const { DocType, Series, Side, InfoCode, TransactionID } = resp;
2619
+ this.handleLongValidationError(TransactionID, images[0].imageAsDataUrl.split(',')[1]);
2620
+ // if (InfoCode === '1006' && this.idScan) {
2621
+ // this.handleLongValidationError(image);
2622
+ // }
2623
+ // console.warn(resp.Validated, this.numberOfValidations);
2624
+ if (resp.DetectedBlurValue) {
2625
+ this.blurValues.push(resp.DetectedBlurValue);
2626
+ }
2627
+ else {
2628
+ this.blurValues = [];
2629
+ }
2630
+ if (resp.Validated) {
2631
+ this.numberOfValidations++;
2632
+ this.validationDebug.push(resp);
2633
+ }
2634
+ else {
2635
+ this.numberOfValidations = 0;
2636
+ this.validationDebug = [];
2637
+ }
2638
+ if (resp.Validated) {
2639
+ this.displayInfo = '';
2640
+ // console.log('[SCANNED INDEX]', resp.Index);
2641
+ const selectedImage = images[resp.Index];
2642
+ // this.preview = this.webcamImage.imageAsDataUrl;
2643
+ this.cd.detectChanges();
2644
+ let image = selectedImage;
2645
+ console.warn(type);
2646
+ if (type == 'worker') {
2647
+ //const dataUrl = this.handleBitmapImage(selectedImage.bitmap);
2648
+ image = selectedImage.imageAsDataUrl;
2649
+ }
2650
+ if (InfoCode === '1007') {
2651
+ // For ID ask for other side
2652
+ if (Side === 'FRONT') {
2653
+ this.scanBlastData[0].image = image;
2654
+ }
2655
+ else {
2656
+ this.scanBlastData[1].image = image;
2657
+ }
2658
+ if (this.scanBlastData[0].image && this.scanBlastData[1].image) {
2659
+ // console.warn('UPLOAD');
2660
+ if (type == 'worker') {
2661
+ this.imageHandler.next({ type: 'stop' });
2662
+ }
2663
+ //console.warn('DEBUG', Side, this.validationDebug);
2664
+ this.scanBlastFinish();
2665
+ }
2666
+ else {
2667
+ this.blurValues = [];
2668
+ this.numberOfValidations = 0;
2669
+ const num = Side === 'FRONT' ? 1 : 0;
2670
+ this.scanSecondSide = true;
2671
+ this.singleScan(this.scanBlastData[num]);
2672
+ this.idScan = this.scanBlastData[num].side;
2673
+ if (!this.showDialog) {
2674
+ this.showDialog = true;
2675
+ this.cd.detectChanges();
2676
+ }
2677
+ // reset manual scan popup interval
2678
+ this.verificationErrorSent = false;
2679
+ this.startTime = Date.now();
2680
+ this.displayInfo = 'scandoc.info.turn';
2681
+ }
2682
+ }
2683
+ else {
2684
+ // console.warn('DEBUG', Side, this.validationDebug);
2685
+ this.scanBlastData[0].image = image;
2686
+ // console.warn('UPLOAD');
2687
+ if (type == 'worker') {
2688
+ this.imageHandler.next({ type: 'stop' });
2689
+ }
2690
+ this.scanBlastFinish();
2691
+ }
2692
+ this.scannedImages = [];
2693
+ // this.scanBlastData[0].image = selectedImage;
2694
+ //this.scanBlastFinish();
2695
+ }
2696
+ else {
2697
+ this.validation = false;
2698
+ this.scan();
2699
+ }
2700
+ });
2701
+ }
2702
+ closeDialog() {
2703
+ this.showDialog = false;
2704
+ this.validation = false;
2705
+ this.scan();
2706
+ }
2707
+ handleInitError(error) {
2708
+ console.log(error);
2709
+ }
2710
+ get scanBlastCanUpload() {
2711
+ return this.scanBlastData[0].image ? true : false;
2712
+ }
2713
+ manualMode(type = 'plain') {
2714
+ this.manual = true;
2715
+ this.promptManual = false;
2716
+ this.scanInProgress = false;
2717
+ this.cameraProvider.$showSwitch.next(false);
2718
+ this.cd.detectChanges();
2719
+ }
2720
+ handleExtractionError(data) {
2721
+ this.logData.ExpectedOutput = {};
2722
+ // if (this.logData.ExpectedOutput?._avatar) {
2723
+ // delete this.logData.ExpectedOutput._avatar;
2724
+ // }
2725
+ // this.scanProvider.sendLog(this.logData).subscribe();
2726
+ // console.log('LOG DATA', this.logData);
2727
+ this.__subs(this.scanProvider.sendLog(this.logData)).subscribe();
2728
+ }
2729
+ handleLongValidationError(img, type = 'plain') {
2730
+ // save current image after 10sec
2731
+ let MANUAL_INTERVAL = this.scanProvider.config.manualScanDelay;
2732
+ const diff = (Date.now() - this.startTime) / 1000;
2733
+ const showDialog = diff > MANUAL_INTERVAL;
2734
+ if (showDialog && !this.verificationErrorSent) {
2735
+ this.verificationErrorSent = true;
2736
+ console.warn('[HANDLE ERROR]');
2737
+ this.zone.run(() => {
2738
+ // if (!this.scanSecondSide) {
2739
+ if (this.scanProvider.config.manualModeEnabled) {
2740
+ this.promptManual = true;
2741
+ }
2742
+ // }
2743
+ this.startTime = Date.now();
2744
+ });
2745
+ // this.verificationErrorSent = true;
2746
+ // const dataUrl = this.handleBitmapImage(img.bitmap);
2747
+ // console.warn('SENT');
2748
+ // // this.displayInfo = 'Cant detect document!';
2749
+ // this.logData.Request = this.__subs(
2750
+ // this.scanProvider.sendLog({
2751
+ // AcceptTermsAndConditions: true,
2752
+ // ExpectedOutput: {},
2753
+ // Request: {
2754
+ // verification: dataUrl.split(',')[1],
2755
+ // },
2756
+ // Response: {
2757
+ // TransactionID: uuidv4(),
2758
+ // },
2759
+ // })
2760
+ // ).subscribe();
2761
+ }
2762
+ }
2763
+ ngAfterViewInit() {
2764
+ // this.result = true;
2765
+ this.cameraProvider.$showSwitch.next(true);
2766
+ this.cd.detectChanges();
2767
+ // this.scanResults.next({ type: 'model', data: {} });
2768
+ this.__subs(this.cameraProvider.webcamObservable).subscribe((resp) => {
2769
+ this.cameraReady = false;
2770
+ this.scanInProgress = false;
2771
+ this.scannedImages = [];
2772
+ });
2773
+ this.__subs(this.cameraProvider.selfie$).subscribe((resp) => {
2774
+ this.selfie();
2775
+ });
2776
+ this.autoScan();
2777
+ this.__subs(this.layoutProvider.breakpoint$).subscribe((v) => {
2778
+ this.isMobile = !v.matches || this.platform.IOS || this.platform.ANDROID;
2779
+ console.log('MNOBILE', this.isMobile);
2780
+ });
2781
+ // this.imageHandlerSubscription = this.imageHandler.subscribe(
2782
+ // (webcamImage: any) => {
2783
+ // // return;
2784
+ // if (this.startTime === 0) {
2785
+ // this.startTime = Date.now();
2786
+ // }
2787
+ // this.zone.runOutsideAngular(() => {
2788
+ // if (webcamImage.base64) {
2789
+ // const time = new Date().getTime();
2790
+ // if (this.scanImageTimestamps.load > 0) {
2791
+ // const { load } = this.scanImageTimestamps;
2792
+ // const diff = time - load;
2793
+ // // console.warn('TIME', diff);
2794
+ // this.scanDelay = diff;
2795
+ // }
2796
+ // this.scanImageTimestamps.load = time;
2797
+ // this.scannedImages.push(webcamImage);
2798
+ // this.handleLongValidationError(webcamImage, 'worker');
2799
+ // }
2800
+ // // this.cd.detectChanges();
2801
+ // if (this.scannedImages.length > 4 && !this.validation) {
2802
+ // // get last 10
2803
+ // console.timeEnd('validationTOTAL_UI');
2804
+ // console.time('validationTOTAL_UI');
2805
+ // const images = this.scannedImages.slice(-5);
2806
+ // // set images to 0
2807
+ // this.scannedImages = [];
2808
+ // console.log(images);
2809
+ // const imagesArray = images.map((m) => m.base64.split(',')[1]);
2810
+ // this.validation = true;
2811
+ // // this.handleBurstData(imagesArray, images, 'worker');
2812
+ // console.time('validationPOST');
2813
+ // }
2814
+ // this.cd.detectChanges();
2815
+ // });
2816
+ // }
2817
+ // );
2818
+ }
2819
+ handleBitmapImage(bitmap) {
2820
+ const { width, height } = bitmap;
2821
+ const offscreenSmall = document.createElement('canvas');
2822
+ offscreenSmall.width = width;
2823
+ offscreenSmall.height = height;
2824
+ const ctx = offscreenSmall.getContext('bitmaprenderer');
2825
+ if (ctx) {
2826
+ ctx.imageSmoothingEnabled = false;
2827
+ ctx.transferFromImageBitmap(bitmap);
2828
+ bitmap.close();
2829
+ const data = ctx.canvas.toDataURL('image/jpeg');
2830
+ return data;
2831
+ }
2832
+ return null;
2833
+ }
2834
+ autoScan() {
2835
+ const side = this.scanBlastData[0];
2836
+ this.idScan = null;
2837
+ this.singleScan(side);
2838
+ }
2839
+ singleScan(side) {
2840
+ this.scanType = side.side;
2841
+ this.preview = null;
2842
+ this.selectedSide = side;
2843
+ this.selectedSide.image = null;
2844
+ this.documentTypeSelected = true;
2845
+ this.scanBlastData[1].disabled = false;
2846
+ this.cd.detectChanges();
2847
+ }
2848
+ manualScanData(data) {
2849
+ console.log(data);
2850
+ this.scanBlastData = data;
2851
+ this.manual = false;
2852
+ this.manualDataSet = true;
2853
+ this.scanBlastFinish();
2854
+ }
2855
+ getImgBase64(num) {
2856
+ console.log('GET 64');
2857
+ // if (this.manualDataSet) {
2858
+ return this.scanBlastData[num].image._imageAsDataUrl.split(',')[1];
2859
+ // }
2860
+ // return this.scanBlastData[num].image.dataUrl.split(',')[1];
2861
+ }
2862
+ scanBlastFinish() {
2863
+ const { browser, os, device } = this.deviceService;
2864
+ this.zone.run(() => {
2865
+ this.cameraProvider.$showSwitch.next(false);
2866
+ });
2867
+ console.time('upload');
2868
+ if (this.type === 'mobile') {
2869
+ this.actions.emit({ data: this.scanBlastData });
2870
+ this.retake();
2871
+ return;
2872
+ }
2873
+ this.idScan = null;
2874
+ // const loading = this.dialogs.loading();
2875
+ this.scaning = true;
2876
+ this.cd.detectChanges();
2877
+ console.time('payload');
2878
+ const payload = {
2879
+ AcceptTermsAndConditions: true,
2880
+ DataFields: {
2881
+ DeviceInfo: {
2882
+ OS: os,
2883
+ Device: device,
2884
+ Browser: browser,
2885
+ },
2886
+ FrontImageType: 'base64',
2887
+ FrontImageCropped: false,
2888
+ BackImageType: 'base64',
2889
+ BackImageCropped: false,
2890
+ FrontImage: this.getImgBase64(0),
2891
+ BackImage: this.scanBlastData[1].image ? this.getImgBase64(1) : null,
2892
+ },
2893
+ Settings: {
2894
+ ShouldValidate: true,
2895
+ ShouldReturnDocumentImage: true,
2896
+ ShouldReturnFaceIfDetected: true,
2897
+ SkipImageSizeCheck: true,
2898
+ CanStoreImages: this.scanProvider.canStoreImages,
2899
+ },
2900
+ // CallBackUrl: 'http://demo:5000/report/extracted/',
2901
+ };
2902
+ this.frontImage = 'data:image/jpeg;base64,' + payload.DataFields.FrontImage;
2903
+ this.backImage = 'data:image/jpeg;base64,' + payload.DataFields.BackImage;
2904
+ if (!this.scanBlastData[1].image) {
2905
+ payload.Settings.IgnoreBackImage = true;
2906
+ }
2907
+ this.logData.Request = JSON.parse(JSON.stringify(payload));
2908
+ console.timeEnd('payload');
2909
+ this.__subs(this.scanProvider.blastPost(payload).pipe(catchError((e) => {
2910
+ if (this.manualDataSet) {
2911
+ // console.warn('MANUAL DATA SET',e);
2912
+ this.logData.Response = JSON.parse(JSON.stringify(e.error));
2913
+ this.handleExtractionError({});
2914
+ }
2915
+ this.zone.run(() => {
2916
+ this.error = true;
2917
+ this.preview = true;
2918
+ this.cd.detectChanges();
2919
+ });
2920
+ // console.log('EEE', e);
2921
+ return e;
2922
+ }))).subscribe((data) => {
2923
+ //console.log(data);
2924
+ const results = data.Data;
2925
+ console.timeEnd('upload');
2926
+ console.time('parse');
2927
+ // data.InfoCode = '1001';
2928
+ console.time('p');
2929
+ this.logData.Response = JSON.parse(JSON.stringify(data));
2930
+ console.timeEnd('p');
2931
+ //loading.close();
2932
+ this.documentTypeSelected = true;
2933
+ this.scaning = false;
2934
+ if (data.InfoCode === '1001') {
2935
+ this.error = true;
2936
+ console.log('[ERROR] 1001');
2937
+ this.errorCode = '1001';
2938
+ // this.scanSide = 0;
2939
+ this.preview = true;
2940
+ this.cd.detectChanges();
2941
+ return;
2942
+ }
2943
+ if (data.InfoCode === '1002') {
2944
+ this.error = true;
2945
+ console.log('[ERROR] 1002');
2946
+ this.errorCode = '1002';
2947
+ // this.scanSide = 0;
2948
+ this.preview = true;
2949
+ this.cd.detectChanges();
2950
+ return;
2951
+ }
2952
+ if (results && data.Metadata.length > 0 && data.InfoCode === '1000') {
2953
+ // console.log('Extraction time', data.AnalysisTime);
2954
+ // this.zone.run(() => {
2955
+ // console.time('parseblast');
2956
+ const result = this.scanProvider.parseBlast(results);
2957
+ // console.timeEnd('parseblast');
2958
+ // console.log('RES', this.result);
2959
+ // this.cd.detectChanges();
2960
+ const model = result.model;
2961
+ if (data.ImageData?.FaceImage) {
2962
+ model._avatar =
2963
+ 'data:image/jpeg;base64,' + data.ImageData?.FaceImage;
2964
+ }
2965
+ if (data.ImageData?.Documents) {
2966
+ const { Documents } = data.ImageData;
2967
+ model.images = Documents.map((image, i) => {
2968
+ return { data: 'data:image/jpeg;base64,' + Documents[i] };
2969
+ });
2970
+ }
2971
+ this.model = model;
2972
+ // console.log('MODEL', this.model);
2973
+ this.actions.emit({
2974
+ type: 'scanFinish',
2975
+ data: {
2976
+ model: this.model,
2977
+ images: this.images,
2978
+ results,
2979
+ },
2980
+ });
2981
+ if (!this.scanProvider.config.hideResults) {
2982
+ this.zone.run(() => {
2983
+ console.log('ERR');
2984
+ this.result = true;
2985
+ // console.time('ff');
2986
+ this.cd.detectChanges();
2987
+ this.scanResults.next({ type: 'model', data: model });
2988
+ // this.cd.detectChanges();
2989
+ // });
2990
+ // console.timeEnd('ff');
2991
+ });
2992
+ }
2993
+ }
2994
+ else {
2995
+ console.log('ERROR');
2996
+ if (this.manualDataSet) {
2997
+ this.handleExtractionError(data);
2998
+ }
2999
+ // this.scanSide = 0;
3000
+ this.zone.run(() => {
3001
+ this.error = true;
3002
+ this.preview = true;
3003
+ this.cd.detectChanges();
3004
+ });
3005
+ // this.documentTypeSelected = false;
3006
+ // this.retry();
3007
+ }
3008
+ // this.cd.detectChanges();
3009
+ console.timeEnd('parse');
3010
+ }, (err) => {
3011
+ // loading.close();
3012
+ // this.scanSide = 0;
3013
+ this.error = true;
3014
+ this.preview = true;
3015
+ this.documentTypeSelected = true;
3016
+ this.scaning = false;
3017
+ });
3018
+ }
3019
+ retry() {
3020
+ this.preview = false;
3021
+ this.validation = false;
3022
+ this.errorCode = '1000';
3023
+ this.result = false;
3024
+ this.idScan = null;
3025
+ this.cameraProvider.$showSwitch.next(true);
3026
+ if (this.error) {
3027
+ this.documentTypeSelected = false;
3028
+ this.scanBlastData.forEach((element) => {
3029
+ element.image = null;
3030
+ });
3031
+ }
3032
+ this.error = false;
3033
+ this.startTime = Date.now();
3034
+ this.autoScan();
3035
+ this.scan();
3036
+ this.cd.detectChanges();
3037
+ }
3038
+ retake() {
3039
+ this.validation = false;
3040
+ this.preview = false;
3041
+ this.error = false;
3042
+ this.result = false;
3043
+ this.scanSide = 0;
3044
+ this.cameraProvider.$showSwitch.next(true);
3045
+ this.imageVerified = false;
3046
+ this.scanDatas = [];
3047
+ this.scaning = false;
3048
+ this.images = [];
3049
+ this.scanInProgress = false;
3050
+ this.startTime = Date.now();
3051
+ this.idScan = null;
3052
+ this.documentTypeSelected = false;
3053
+ this.scanBlastData.forEach((m) => {
3054
+ m.image = null;
3055
+ });
3056
+ this.scanSecondSide = false;
3057
+ this.autoScan();
3058
+ this.cd.detectChanges();
3059
+ }
3060
+ use() {
3061
+ // save images??
3062
+ if (this.scanProvider.config.sendLog) {
3063
+ this.logData.ExpectedOutput = JSON.parse(JSON.stringify(this.model));
3064
+ if (this.logData.ExpectedOutput?._avatar) {
3065
+ delete this.logData.ExpectedOutput._avatar;
3066
+ }
3067
+ this.__subs(this.scanProvider.sendLog(this.logData)).subscribe();
3068
+ console.log(this.logData);
3069
+ }
3070
+ this.actions.emit({
3071
+ type: 'scanDataClose',
3072
+ data: {
3073
+ model: this.model,
3074
+ images: this.images,
3456
3075
  },
3457
- ].map((item) => this.translate.forms(item));
3076
+ });
3077
+ }
3078
+ selfie() {
3079
+ const avatar = this.model?._avatar;
3080
+ this.dialogs
3081
+ .scanSelfie({ avatar })
3082
+ .afterClosed()
3083
+ .subscribe((resp) => {
3084
+ if (resp) {
3085
+ console.log(resp);
3086
+ if (this.scanProvider.enableVerification) {
3087
+ this.imageVerified = true;
3088
+ }
3089
+ this.scanResults.next({
3090
+ type: 'avatar',
3091
+ data: resp.imageAsDataUrl,
3092
+ });
3093
+ // this.model._avatar = resp.imageAsDataUrl;
3094
+ this.cd.detectChanges();
3095
+ }
3096
+ });
3097
+ }
3098
+ cameraOff(ev) {
3099
+ this.cameraReady = false;
3100
+ this.cd.detectChanges();
3101
+ }
3102
+ videoReady(event) {
3103
+ console.log('READY', event);
3104
+ this.cameraReady = event;
3105
+ if (this.cameraReady && !this.scanInProgress && !this.manual) {
3106
+ this.scanInProgress = true;
3107
+ setTimeout(() => {
3108
+ this.scan();
3109
+ }, 20);
3110
+ }
3111
+ }
3112
+ manualSet(key) {
3113
+ if (key) {
3114
+ if (this.scanProvider.config.showManualMode) {
3115
+ this.manualMode();
3116
+ }
3117
+ else {
3118
+ this.actions.emit({
3119
+ type: 'manualMode',
3120
+ data: {},
3121
+ });
3122
+ }
3123
+ }
3124
+ else {
3125
+ this.promptManual = false;
3126
+ }
3127
+ }
3128
+ ngOnDestroy() {
3129
+ if (this.scanTimeout) {
3130
+ clearTimeout(this.scanTimeout);
3131
+ }
3132
+ if (this.imageHandlerSubscription) {
3133
+ this.imageHandlerSubscription.unsubscribe();
3134
+ }
3135
+ console.log('DESTROXY');
3136
+ this.__destroy();
3137
+ }
3138
+ 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 }); }
3139
+ 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-data\n (action)=\"selfie()\"\n [form]=\"form\"\n [data]=\"scanResults\"\n ></ngx-scan-results-data>\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: ScanResultsComponent, selector: "ngx-scan-results-data", inputs: ["data", "images", "form"], outputs: ["action"] }, { kind: "component", type: ManualScanComponent, selector: "ngx-manual-scan", outputs: ["action"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3140
+ }
3141
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanComponent, decorators: [{
3142
+ type: Component,
3143
+ 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-data\n (action)=\"selfie()\"\n [form]=\"form\"\n [data]=\"scanResults\"\n ></ngx-scan-results-data>\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"] }]
3144
+ }], 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: [{
3145
+ type: Input
3146
+ }], dialogs: [{
3147
+ type: Input
3148
+ }], refresh: [{
3149
+ type: Input
3150
+ }], actions: [{
3151
+ type: Output
3152
+ }], showDialog: [{
3153
+ type: Input
3154
+ }], class: [{
3155
+ type: HostBinding,
3156
+ args: ['class.mobile']
3157
+ }], onResize: [{
3158
+ type: HostListener,
3159
+ args: ['window:resize', ['$event']]
3160
+ }] } });
3161
+
3162
+ class MaterialModule {
3163
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3164
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: MaterialModule, imports: [MatNativeDateModule,
3165
+ MatDatepickerModule,
3166
+ MatCardModule,
3167
+ MatMenuModule,
3168
+ MatIconModule,
3169
+ MatButtonModule,
3170
+ MatDialogModule,
3171
+ MatInputModule,
3172
+ MatSnackBarModule,
3173
+ MatProgressBarModule,
3174
+ MatTableModule,
3175
+ MatProgressSpinnerModule,
3176
+ MatPaginatorModule,
3177
+ MatSelectModule,
3178
+ MatCheckboxModule,
3179
+ MatChipsModule,
3180
+ MatBadgeModule,
3181
+ MatListModule,
3182
+ MatTabsModule,
3183
+ MatSliderModule,
3184
+ MatSlideToggleModule], exports: [MatNativeDateModule,
3185
+ MatDatepickerModule,
3186
+ MatSelectModule,
3187
+ MatCardModule,
3188
+ MatMenuModule,
3189
+ MatIconModule,
3190
+ MatButtonModule,
3191
+ MatDialogModule,
3192
+ MatInputModule,
3193
+ MatSnackBarModule,
3194
+ MatProgressBarModule,
3195
+ MatProgressSpinnerModule,
3196
+ MatTableModule,
3197
+ MatPaginatorModule,
3198
+ MatChipsModule,
3199
+ MatBadgeModule,
3200
+ MatCheckboxModule,
3201
+ MatListModule,
3202
+ MatTabsModule,
3203
+ MatSlideToggleModule,
3204
+ MatAutocompleteModule] }); }
3205
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MaterialModule, imports: [MatNativeDateModule,
3206
+ MatDatepickerModule,
3207
+ MatCardModule,
3208
+ MatMenuModule,
3209
+ MatIconModule,
3210
+ MatButtonModule,
3211
+ MatDialogModule,
3212
+ MatInputModule,
3213
+ MatSnackBarModule,
3214
+ MatProgressBarModule,
3215
+ MatTableModule,
3216
+ MatProgressSpinnerModule,
3217
+ MatPaginatorModule,
3218
+ MatSelectModule,
3219
+ MatCheckboxModule,
3220
+ MatChipsModule,
3221
+ MatBadgeModule,
3222
+ MatListModule,
3223
+ MatTabsModule,
3224
+ MatSliderModule,
3225
+ MatSlideToggleModule, MatNativeDateModule,
3226
+ MatDatepickerModule,
3227
+ MatSelectModule,
3228
+ MatCardModule,
3229
+ MatMenuModule,
3230
+ MatIconModule,
3231
+ MatButtonModule,
3232
+ MatDialogModule,
3233
+ MatInputModule,
3234
+ MatSnackBarModule,
3235
+ MatProgressBarModule,
3236
+ MatProgressSpinnerModule,
3237
+ MatTableModule,
3238
+ MatPaginatorModule,
3239
+ MatChipsModule,
3240
+ MatBadgeModule,
3241
+ MatCheckboxModule,
3242
+ MatListModule,
3243
+ MatTabsModule,
3244
+ MatSlideToggleModule,
3245
+ MatAutocompleteModule] }); }
3246
+ }
3247
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MaterialModule, decorators: [{
3248
+ type: NgModule,
3249
+ args: [{
3250
+ imports: [
3251
+ MatNativeDateModule,
3252
+ MatDatepickerModule,
3253
+ MatCardModule,
3254
+ MatMenuModule,
3255
+ MatIconModule,
3256
+ MatButtonModule,
3257
+ MatDialogModule,
3258
+ MatInputModule,
3259
+ MatSnackBarModule,
3260
+ MatProgressBarModule,
3261
+ MatTableModule,
3262
+ MatProgressSpinnerModule,
3263
+ MatPaginatorModule,
3264
+ MatSelectModule,
3265
+ MatCheckboxModule,
3266
+ MatChipsModule,
3267
+ MatBadgeModule,
3268
+ MatListModule,
3269
+ MatTabsModule,
3270
+ MatSliderModule,
3271
+ MatSlideToggleModule,
3272
+ ],
3273
+ exports: [
3274
+ MatNativeDateModule,
3275
+ MatDatepickerModule,
3276
+ MatSelectModule,
3277
+ MatCardModule,
3278
+ MatMenuModule,
3279
+ MatIconModule,
3280
+ MatButtonModule,
3281
+ MatDialogModule,
3282
+ MatInputModule,
3283
+ MatSnackBarModule,
3284
+ MatProgressBarModule,
3285
+ MatProgressSpinnerModule,
3286
+ MatTableModule,
3287
+ MatPaginatorModule,
3288
+ MatChipsModule,
3289
+ MatBadgeModule,
3290
+ MatCheckboxModule,
3291
+ MatListModule,
3292
+ MatTabsModule,
3293
+ MatSlideToggleModule,
3294
+ MatAutocompleteModule,
3295
+ ],
3296
+ providers: [],
3297
+ }]
3298
+ }] });
3299
+
3300
+ class AvatarTypeComponent extends FieldType {
3301
+ constructor(cd) {
3302
+ super();
3303
+ this.cd = cd;
3304
+ this.width = 'w-120';
3305
+ this.padding = 'px-32 pt-8 pb-8';
3458
3306
  }
3459
- 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 }); }
3460
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScandocFieldsProvider, providedIn: 'root' }); }
3307
+ ngOnChange() { }
3308
+ selfie() { }
3309
+ ;
3310
+ ngAfterViewInit() {
3311
+ if (this.to.width) {
3312
+ this.width = this.to.width;
3313
+ }
3314
+ if (this.to.padding) {
3315
+ this.padding = this.to.padding;
3316
+ }
3317
+ this.cd.detectChanges();
3318
+ }
3319
+ 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 }); }
3320
+ 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: `
3321
+ <mat-card appearance="outlined" style="margin: 4px; padding:16px">
3322
+ <div class="card-title">{{ 'scandoc.result.avatar' | translate }}</div>
3323
+ <div class="selfieContainer">
3324
+ <div class="selfie">
3325
+ <img *ngIf="model?._avatar" class="preview" [src]="model._avatar" />
3326
+ </div>
3327
+ <button (click)="selfie()" mat-raised-button>
3328
+ {{ 'scandoc.result.takeSelfie' | translate }}
3329
+ </button>
3330
+ </div>
3331
+ </mat-card>
3332
+ `, 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: i6.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" }] }); }
3461
3333
  }
3462
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScandocFieldsProvider, decorators: [{
3463
- type: Injectable,
3464
- args: [{
3465
- providedIn: 'root',
3466
- }]
3467
- }], ctorParameters: () => [{ type: NgxScanDocTranslationProvider }, { type: ScanProvider }] });
3334
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AvatarTypeComponent, decorators: [{
3335
+ type: Component,
3336
+ args: [{ selector: 'app-formly-avatar-type', template: `
3337
+ <mat-card appearance="outlined" style="margin: 4px; padding:16px">
3338
+ <div class="card-title">{{ 'scandoc.result.avatar' | translate }}</div>
3339
+ <div class="selfieContainer">
3340
+ <div class="selfie">
3341
+ <img *ngIf="model?._avatar" class="preview" [src]="model._avatar" />
3342
+ </div>
3343
+ <button (click)="selfie()" mat-raised-button>
3344
+ {{ 'scandoc.result.takeSelfie' | translate }}
3345
+ </button>
3346
+ </div>
3347
+ </mat-card>
3348
+ `, standalone: false, styles: ["mat-card{border-radius:0;box-shadow:none!important}\n"] }]
3349
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
3468
3350
 
3469
- class ScanResultsComponent extends BaseComponent {
3470
- constructor(cameraProvider, formProvider, provider, cd, zone) {
3351
+ class TitleTypeComponent extends FieldType {
3352
+ constructor(cd) {
3471
3353
  super();
3472
- this.cameraProvider = cameraProvider;
3473
- this.formProvider = formProvider;
3474
- this.provider = provider;
3475
3354
  this.cd = cd;
3476
- this.zone = zone;
3477
- this.action = new EventEmitter();
3478
3355
  }
3479
3356
  ngOnInit() {
3480
- console.time('fields');
3481
- this.fields = this.formProvider.document();
3482
- console.timeEnd('fields');
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
- });
3357
+ this.opt = {
3358
+ badge: this.to.badge,
3359
+ };
3499
3360
  }
3500
- ngOnDestroy() {
3501
- this.__destroy();
3361
+ ngAfterViewInit() {
3362
+ this.cd.detectChanges();
3363
+ }
3364
+ 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 }); }
3365
+ 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: `
3366
+ <div class="card-title">
3367
+ {{ to.label }}
3368
+ </div>
3369
+ `, isInline: true, styles: [""] }); }
3370
+ }
3371
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TitleTypeComponent, decorators: [{
3372
+ type: Component,
3373
+ args: [{ selector: 'app-formly-title-type', template: `
3374
+ <div class="card-title">
3375
+ {{ to.label }}
3376
+ </div>
3377
+ `, standalone: false }]
3378
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
3379
+
3380
+ class ProfileImageTypeComponent extends FieldType {
3381
+ constructor(cd, cameraProvider, scanProvider) {
3382
+ super();
3383
+ this.cd = cd;
3384
+ this.cameraProvider = cameraProvider;
3385
+ this.scanProvider = scanProvider;
3502
3386
  }
3503
3387
  selfie() {
3504
- this.action.emit({ selfie: true });
3388
+ this.cameraProvider.selfie$.next(true);
3505
3389
  }
3506
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanResultsComponent, deps: [{ token: NgxScandocCameraProvider }, { token: NgxScandocFieldsProvider }, { token: ScanProvider }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
3507
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ScanResultsComponent, isStandalone: false, selector: "ngx-scan-results", 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\n\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 appearance=\"outlined\" style=\"margin:0px 4px; padding: 16px\" class=\"images\">\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: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: i5.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: i1$2.LegacyFormlyForm, selector: "formly-form" }, { kind: "directive", type: i5$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }] }); }
3390
+ ngOnChange() { }
3391
+ ngAfterViewInit() { }
3392
+ 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 }); }
3393
+ 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: `
3394
+ <mat-form-field>
3395
+ <mat-label>{{ 'scandoc.result.avatar' | translate }} </mat-label>
3396
+ <input matInput style="display:none" />
3397
+ <div class="selfieContainer">
3398
+ <div class="selfie">
3399
+ <img *ngIf="model?._avatar" class="preview" [src]="model._avatar" />
3400
+ </div>
3401
+ <button
3402
+ *ngIf="scanProvider.enableVerification"
3403
+ (click)="selfie()"
3404
+ mat-raised-button
3405
+ >
3406
+ {{ 'scandoc.result.takeSelfie' | translate }}
3407
+ </button>
3408
+ </div>
3409
+ </mat-form-field>
3410
+ `, 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" }] }); }
3508
3411
  }
3509
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanResultsComponent, decorators: [{
3412
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ProfileImageTypeComponent, decorators: [{
3510
3413
  type: Component,
3511
- args: [{ selector: 'ngx-scan-results', standalone: false, template: "<div *ngIf=\"model\" class=\"wraper\">\n <div style=\"flex: 1\">\n\n\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 appearance=\"outlined\" style=\"margin:0px 4px; padding: 16px\" class=\"images\">\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"] }]
3512
- }], ctorParameters: () => [{ type: NgxScandocCameraProvider }, { type: NgxScandocFieldsProvider }, { type: ScanProvider }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }], propDecorators: { data: [{
3513
- type: Input
3514
- }], images: [{
3515
- type: Input
3516
- }], form: [{
3517
- type: Input
3518
- }], action: [{
3519
- type: Output
3520
- }] } });
3414
+ args: [{ selector: 'app-formly-profile-image-type', template: `
3415
+ <mat-form-field>
3416
+ <mat-label>{{ 'scandoc.result.avatar' | translate }} </mat-label>
3417
+ <input matInput style="display:none" />
3418
+ <div class="selfieContainer">
3419
+ <div class="selfie">
3420
+ <img *ngIf="model?._avatar" class="preview" [src]="model._avatar" />
3421
+ </div>
3422
+ <button
3423
+ *ngIf="scanProvider.enableVerification"
3424
+ (click)="selfie()"
3425
+ mat-raised-button
3426
+ >
3427
+ {{ 'scandoc.result.takeSelfie' | translate }}
3428
+ </button>
3429
+ </div>
3430
+ </mat-form-field>
3431
+ `, 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"] }]
3432
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: NgxScandocCameraProvider }, { type: ScanProvider }] });
3433
+
3434
+ class AppFormModule {
3435
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3436
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: AppFormModule, declarations: [TitleTypeComponent,
3437
+ AvatarTypeComponent,
3438
+ ProfileImageTypeComponent], imports: [CommonModule,
3439
+ FormsModule,
3440
+ FormlyMatDatepickerModule,
3441
+ FormlySelectModule,
3442
+ MaterialModule,
3443
+ AvatarModule,
3444
+ TranslateModule,
3445
+ FormlyMaterialModule, i7.FormlyModule], exports: [FormlyModule] }); }
3446
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppFormModule, imports: [CommonModule,
3447
+ FormsModule,
3448
+ FormlyMatDatepickerModule,
3449
+ FormlySelectModule,
3450
+ MaterialModule,
3451
+ AvatarModule,
3452
+ TranslateModule,
3453
+ FormlyMaterialModule,
3454
+ FormlyModule.forChild({
3455
+ types: [
3456
+ {
3457
+ name: 'title',
3458
+ component: TitleTypeComponent,
3459
+ wrappers: [],
3460
+ },
3461
+ {
3462
+ name: 'profile-image',
3463
+ component: ProfileImageTypeComponent,
3464
+ wrappers: [],
3465
+ },
3466
+ ],
3467
+ }), FormlyModule] }); }
3468
+ }
3469
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppFormModule, decorators: [{
3470
+ type: NgModule,
3471
+ args: [{
3472
+ declarations: [
3473
+ TitleTypeComponent,
3474
+ AvatarTypeComponent,
3475
+ ProfileImageTypeComponent,
3476
+ ],
3477
+ imports: [
3478
+ CommonModule,
3479
+ FormsModule,
3480
+ FormlyMatDatepickerModule,
3481
+ FormlySelectModule,
3482
+ MaterialModule,
3483
+ AvatarModule,
3484
+ TranslateModule,
3485
+ FormlyMaterialModule,
3486
+ FormlyModule.forChild({
3487
+ types: [
3488
+ {
3489
+ name: 'title',
3490
+ component: TitleTypeComponent,
3491
+ wrappers: [],
3492
+ },
3493
+ {
3494
+ name: 'profile-image',
3495
+ component: ProfileImageTypeComponent,
3496
+ wrappers: [],
3497
+ },
3498
+ ],
3499
+ }),
3500
+ ],
3501
+ providers: [],
3502
+ exports: [FormlyModule],
3503
+ }]
3504
+ }] });
3505
+
3506
+ class CameraSwitchComponent {
3507
+ constructor(cameraProvider) {
3508
+ this.cameraProvider = cameraProvider;
3509
+ }
3510
+ ngAfterViewInit() {
3511
+ // this.cameraProvider.setDefault();
3512
+ }
3513
+ ngOnDestroy() { }
3514
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CameraSwitchComponent, deps: [{ token: NgxScandocCameraProvider }], target: i0.ɵɵFactoryTarget.Component }); }
3515
+ 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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.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$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: i4$1.TranslatePipe, name: "translate" }] }); }
3516
+ }
3517
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CameraSwitchComponent, decorators: [{
3518
+ type: Component,
3519
+ 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"] }]
3520
+ }], ctorParameters: () => [{ type: NgxScandocCameraProvider }] });
3521
3521
 
3522
3522
  //import { NgxScandocCameraProvider } from '../../providers/camera.provider';
3523
3523
  class CoreComponentsModule {
@@ -3586,7 +3586,7 @@ class SafeResourceUrlPipe {
3586
3586
  // return this.sanitizer.bypassSecurityTrustStyle(style);
3587
3587
  // return this.sanitizer.bypassSecurityTrustXxx(style); - see docs
3588
3588
  }
3589
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SafeResourceUrlPipe, deps: [{ token: i1$3.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe }); }
3589
+ 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
3590
  static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: SafeResourceUrlPipe, isStandalone: false, name: "safeResourceUrl" }); }
3591
3591
  }
3592
3592
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SafeResourceUrlPipe, decorators: [{
@@ -3595,7 +3595,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
3595
3595
  name: 'safeResourceUrl',
3596
3596
  standalone: false
3597
3597
  }]
3598
- }], ctorParameters: () => [{ type: i1$3.DomSanitizer }] });
3598
+ }], ctorParameters: () => [{ type: i1$2.DomSanitizer }] });
3599
3599
 
3600
3600
  class CorePipesModule {
3601
3601
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CorePipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
@@ -3667,13 +3667,13 @@ class ScanProfileComponent extends BaseComponent {
3667
3667
  close() {
3668
3668
  this.dialogRef?.close();
3669
3669
  }
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$4.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
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$3.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
3671
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: i4.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.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: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3672
3672
  }
3673
3673
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanProfileComponent, decorators: [{
3674
3674
  type: Component,
3675
3675
  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$4.MatDialogRef }, { type: undefined, decorators: [{
3676
+ }], ctorParameters: () => [{ type: NgxScandocCameraProvider }, { type: ScanProvider }, { type: i1$3.MatDialogRef }, { type: undefined, decorators: [{
3677
3677
  type: Inject,
3678
3678
  args: [MAT_DIALOG_DATA]
3679
3679
  }] }], propDecorators: { type: [{
@@ -3711,13 +3711,13 @@ class BlankComponent {
3711
3711
  this.init();
3712
3712
  }
3713
3713
  }
3714
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: BlankComponent, deps: [{ token: i1$4.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
3714
+ 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
3715
  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
3716
  }
3717
3717
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: BlankComponent, decorators: [{
3718
3718
  type: Component,
3719
3719
  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$4.MatDialogRef }, { type: undefined, decorators: [{
3720
+ }], ctorParameters: () => [{ type: i1$3.MatDialogRef }, { type: undefined, decorators: [{
3721
3721
  type: Inject,
3722
3722
  args: [MAT_DIALOG_DATA]
3723
3723
  }] }, { type: i0.ChangeDetectorRef }], propDecorators: { body: [{
@@ -3761,13 +3761,13 @@ class ConfirmComponent {
3761
3761
  this.dialogRef.close(key);
3762
3762
  }
3763
3763
  close() { }
3764
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ConfirmComponent, deps: [{ token: i1$4.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
3764
+ 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 }); }
3765
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: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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" }] }); }
3766
3766
  }
3767
3767
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ConfirmComponent, decorators: [{
3768
3768
  type: Component,
3769
3769
  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$4.MatDialogRef }, { type: undefined, decorators: [{
3770
+ }], ctorParameters: () => [{ type: i1$3.MatDialogRef }, { type: undefined, decorators: [{
3771
3771
  type: Inject,
3772
3772
  args: [MAT_DIALOG_DATA]
3773
3773
  }] }], propDecorators: { onEnterPress: [{
@@ -3846,13 +3846,13 @@ class ScanSelfieComponent extends BaseComponent {
3846
3846
  close() {
3847
3847
  this.dialogRef.close(null);
3848
3848
  }
3849
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanSelfieComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$4.MatDialogRef }, { token: NgxScandocCameraProvider }, { token: ScanProvider }], target: i0.ɵɵFactoryTarget.Component }); }
3849
+ 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 }); }
3850
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: i4.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.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: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i4$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3851
3851
  }
3852
3852
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ScanSelfieComponent, decorators: [{
3853
3853
  type: Component,
3854
3854
  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$4.MatDialogRef }, { type: NgxScandocCameraProvider }, { type: ScanProvider }], propDecorators: { actions: [{
3855
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$3.MatDialogRef }, { type: NgxScandocCameraProvider }, { type: ScanProvider }], propDecorators: { actions: [{
3856
3856
  type: Output
3857
3857
  }] } });
3858
3858
 
@@ -3868,13 +3868,13 @@ class TurnDocumentComponent {
3868
3868
  console.log(this.dialogRef);
3869
3869
  this.dialogRef.close();
3870
3870
  }
3871
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TurnDocumentComponent, deps: [{ token: i1$4.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
3871
+ 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 }); }
3872
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: i4.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.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" }] }); }
3873
3873
  }
3874
3874
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TurnDocumentComponent, decorators: [{
3875
3875
  type: Component,
3876
3876
  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$4.MatDialogRef }, { type: undefined, decorators: [{
3877
+ }], ctorParameters: () => [{ type: i1$3.MatDialogRef }, { type: undefined, decorators: [{
3878
3878
  type: Inject,
3879
3879
  args: [MAT_DIALOG_DATA]
3880
3880
  }] }] });
@@ -3891,13 +3891,13 @@ class PromptManualComponent {
3891
3891
  console.log(this.dialogRef);
3892
3892
  this.dialogRef.close(key);
3893
3893
  }
3894
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PromptManualComponent, deps: [{ token: i1$4.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
3894
+ 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 }); }
3895
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: i4$1.TranslatePipe, name: "translate" }] }); }
3896
3896
  }
3897
3897
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PromptManualComponent, decorators: [{
3898
3898
  type: Component,
3899
3899
  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$4.MatDialogRef }, { type: undefined, decorators: [{
3900
+ }], ctorParameters: () => [{ type: i1$3.MatDialogRef }, { type: undefined, decorators: [{
3901
3901
  type: Inject,
3902
3902
  args: [MAT_DIALOG_DATA]
3903
3903
  }] }] });
@@ -4003,7 +4003,7 @@ class NgxScandocDialogsCoreProvider {
4003
4003
  data,
4004
4004
  });
4005
4005
  }
4006
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScandocDialogsCoreProvider, deps: [{ token: i1$4.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable }); }
4006
+ 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
4007
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScandocDialogsCoreProvider, providedIn: 'root' }); }
4008
4008
  }
4009
4009
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxScandocDialogsCoreProvider, decorators: [{
@@ -4011,7 +4011,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
4011
4011
  args: [{
4012
4012
  providedIn: 'root',
4013
4013
  }]
4014
- }], ctorParameters: () => [{ type: i1$4.MatDialog }] });
4014
+ }], ctorParameters: () => [{ type: i1$3.MatDialog }] });
4015
4015
 
4016
4016
  //import { NgxScandocCameraProvider } from '../providers/camera.provider';
4017
4017
  //import { NgxScandocCameraProvider } from '../providers/camera.provider';