@ekyc_qoobiss/qbs-ect-cmp 3.6.39 → 3.6.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{TranslationUtils-bfe4477a.js → TranslationUtils-dd73945b.js} +31 -43
- package/dist/cjs/{agreement-check_19.cjs.entry.js → agreement-check_17.cjs.entry.js} +245 -882
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/qbs-ect-cmp.cjs.js +1 -1
- package/dist/cjs/random-actions.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -3
- package/dist/collection/components/common/how-to-info/how-to-info.js +11 -34
- package/dist/collection/components/common/id-capture/id-capture.js +39 -19
- package/dist/collection/components/common/selfie-capture/selfie-capture.js +26 -27
- package/dist/collection/components/controls/camera/camera.js +1 -62
- package/dist/collection/components/flow/agreement-info/agreement-info.js +4 -5
- package/dist/collection/components/flow/landing-validation/landing-validation.js +11 -19
- package/dist/collection/components/flow/mobile-redirect/mobile-redirect.js +1 -1
- package/dist/collection/components/flow/process-id/process-id.js +47 -161
- package/dist/collection/components/flow/sms-code-validation/sms-code-validation.js +7 -56
- package/dist/collection/components/flow/sms-send/sms-send.css +0 -0
- package/dist/collection/components/flow/sms-send/sms-send.js +91 -0
- package/dist/collection/components/flow/user-liveness/user-liveness.js +45 -118
- package/dist/collection/components/identification-component/identification-component.js +14 -41
- package/dist/collection/helpers/ApiCall.js +14 -15
- package/dist/collection/helpers/ML5.js +1 -1
- package/dist/collection/helpers/Stream.js +1 -47
- package/dist/collection/helpers/store.js +0 -18
- package/dist/collection/helpers/textValues.js +2 -0
- package/dist/collection/models/CaptureFlow.js +0 -16
- package/dist/collection/models/FlowStatus.js +16 -10
- package/dist/esm/{TranslationUtils-7e68bc94.js → TranslationUtils-741a728a.js} +31 -43
- package/dist/esm/{agreement-check_19.entry.js → agreement-check_17.entry.js} +245 -880
- package/dist/esm/loader.js +1 -1
- package/dist/esm/qbs-ect-cmp.js +1 -1
- package/dist/esm/random-actions.entry.js +1 -1
- package/dist/qbs-ect-cmp/p-87c689d6.js +1 -0
- package/dist/qbs-ect-cmp/{p-d1d9feaf.entry.js → p-a130edd5.entry.js} +1 -1
- package/dist/qbs-ect-cmp/{p-4e3b735b.entry.js → p-b3fa0a37.entry.js} +2 -2
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/components/common/how-to-info/how-to-info.d.ts +0 -1
- package/dist/types/components/common/id-capture/id-capture.d.ts +5 -1
- package/dist/types/components/common/selfie-capture/selfie-capture.d.ts +3 -2
- package/dist/types/components/controls/camera/camera.d.ts +0 -7
- package/dist/types/components/flow/process-id/process-id.d.ts +0 -3
- package/dist/types/components/flow/sms-code-validation/sms-code-validation.d.ts +0 -3
- package/dist/types/components/flow/sms-send/sms-send.d.ts +17 -0
- package/dist/types/components/flow/user-liveness/user-liveness.d.ts +2 -6
- package/dist/types/components/identification-component/identification-component.d.ts +1 -2
- package/dist/types/components.d.ts +18 -65
- package/dist/types/helpers/ApiCall.d.ts +9 -3
- package/dist/types/helpers/Stream.d.ts +0 -11
- package/dist/types/helpers/textValues.d.ts +2 -0
- package/dist/types/models/CaptureFlow.d.ts +2 -19
- package/dist/types/models/FlowStatus.d.ts +18 -10
- package/dist/types/models/IAbortResult.d.ts +1 -0
- package/dist/types/models/IAddRequest.d.ts +1 -1
- package/dist/types/models/IEctStore.d.ts +0 -6
- package/dist/types/models/IOtpCheck.d.ts +1 -0
- package/dist/types/models/IOtpSend.d.ts +1 -0
- package/dist/types/models/IUploadFile.d.ts +1 -0
- package/package.json +1 -1
- package/dist/collection/components/common/id-back-capture/id-back-capture.css +0 -35
- package/dist/collection/components/common/id-back-capture/id-back-capture.js +0 -219
- package/dist/collection/components/common/id-tilt/id-tilt.css +0 -35
- package/dist/collection/components/common/id-tilt/id-tilt.js +0 -220
- package/dist/collection/components/common/selfie-tilt/selfie-tilt.css +0 -7
- package/dist/collection/components/common/selfie-tilt/selfie-tilt.js +0 -221
- package/dist/qbs-ect-cmp/p-d35256e9.js +0 -1
- package/dist/types/components/common/id-back-capture/id-back-capture.d.ts +0 -28
- package/dist/types/components/common/id-tilt/id-tilt.d.ts +0 -28
- package/dist/types/components/common/selfie-tilt/selfie-tilt.d.ts +0 -31
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-cf54a432.js';
|
|
2
|
-
import { A as ApiCall, s as state, F as FlowMoments, a as FlowSteps, T as Translations,
|
|
2
|
+
import { A as ApiCall, s as state, F as FlowMoments, a as FlowSteps, T as Translations, S as SessionKeys, b as FlowStatus, I as IdCaptureValues, O as OrderStatuses, c as SelfieCaptureValues } from './TranslationUtils-741a728a.js';
|
|
3
3
|
|
|
4
4
|
var MobileOS;
|
|
5
5
|
(function (MobileOS) {
|
|
@@ -290,11 +290,11 @@ const AgreementInfo = class {
|
|
|
290
290
|
}
|
|
291
291
|
async buttonClick() {
|
|
292
292
|
if (this.agreementsChecked && this.termsChecked) {
|
|
293
|
-
|
|
294
|
-
state.flowStatus =
|
|
293
|
+
try {
|
|
294
|
+
state.flowStatus = await this.baseComponent.apiCall.GetNextFlowState();
|
|
295
295
|
}
|
|
296
|
-
|
|
297
|
-
|
|
296
|
+
catch (e) {
|
|
297
|
+
this.apiErrorEvent.emit(e);
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
300
|
}
|
|
@@ -1625,7 +1625,7 @@ class ML5 {
|
|
|
1625
1625
|
}
|
|
1626
1626
|
async init() {
|
|
1627
1627
|
return new Promise(async (resolve) => {
|
|
1628
|
-
const modelPath = state.
|
|
1628
|
+
const modelPath = state.apiBaseUrl.includes("apimd") ? 'https://ekyc.blob.core.windows.net/$web/md/model.json' : 'https://ekyc.blob.core.windows.net/$web/model.json';
|
|
1629
1629
|
this.classifier = await ml5.imageClassifier(modelPath, this.loaded);
|
|
1630
1630
|
this.faceapi = await ml5.faceApi({ withLandmarks: true, withDescriptors: false }, this.loaded);
|
|
1631
1631
|
//warmup
|
|
@@ -4516,24 +4516,12 @@ class Stream {
|
|
|
4516
4516
|
this.idDetection = val;
|
|
4517
4517
|
this.faceDetection = !val;
|
|
4518
4518
|
}
|
|
4519
|
-
// public setProbabilityThreshold(val: number): void {
|
|
4520
|
-
// Detector.getInstance().setProbabilityThreshold(val);
|
|
4521
|
-
// }
|
|
4522
|
-
setCallbackChangeTitle(fun) {
|
|
4523
|
-
this.callbackChangeTitle = fun;
|
|
4524
|
-
}
|
|
4525
4519
|
setCallbackVideoStarted(fun) {
|
|
4526
4520
|
this.callbackVideoStarted = fun;
|
|
4527
4521
|
}
|
|
4528
|
-
setCallbackErrors(fun) {
|
|
4529
|
-
this.callbackErrors = fun;
|
|
4530
|
-
}
|
|
4531
4522
|
setCallbackAutoCapturing(fun) {
|
|
4532
4523
|
this.callbackAutoCapturing = fun;
|
|
4533
4524
|
}
|
|
4534
|
-
// public setCallbackFaceDetectionErrors(fun: (e: PipelineResult) => void): void {
|
|
4535
|
-
// this.callbackFaceDetectionErrors = fun;
|
|
4536
|
-
// }
|
|
4537
4525
|
setCallbackRecordingReady(fun) {
|
|
4538
4526
|
this.callbackRecordingReady = fun;
|
|
4539
4527
|
}
|
|
@@ -4547,13 +4535,6 @@ class Stream {
|
|
|
4547
4535
|
this.streamPaused = false;
|
|
4548
4536
|
this.recordedChunks = [];
|
|
4549
4537
|
this.videoSize = { width: 0, height: 0 };
|
|
4550
|
-
this.pauseStream = () => {
|
|
4551
|
-
this.streamPaused = true;
|
|
4552
|
-
this.mediaRecorder.pause();
|
|
4553
|
-
this.videoElement.pause();
|
|
4554
|
-
// this.dropMask();
|
|
4555
|
-
// if (this.faceDetection) Detector.getInstance().stopDetector();
|
|
4556
|
-
};
|
|
4557
4538
|
this.initFacePose();
|
|
4558
4539
|
this.idML5Detector = IDML5Detector.getInstance(this, state.device.isMobile);
|
|
4559
4540
|
this.faceML5Detector = FaceML5Detector.getInstance(this, state.device.isMobile);
|
|
@@ -4565,9 +4546,6 @@ class Stream {
|
|
|
4565
4546
|
}
|
|
4566
4547
|
return Stream.instance;
|
|
4567
4548
|
}
|
|
4568
|
-
// public returnErrors(errors: PipelineResult) {
|
|
4569
|
-
// this.callbackFaceDetectionErrors(errors);
|
|
4570
|
-
// }
|
|
4571
4549
|
autoCapturing() {
|
|
4572
4550
|
this.callbackAutoCapturing();
|
|
4573
4551
|
}
|
|
@@ -4583,7 +4561,6 @@ class Stream {
|
|
|
4583
4561
|
this.idML5Detector.updateHtmlElements(this.videoElement, this.canvasElement, component);
|
|
4584
4562
|
this.faceML5Detector.updateHtmlElements(this.videoElement, this.canvasElement, component);
|
|
4585
4563
|
}
|
|
4586
|
-
static orientationChange() { }
|
|
4587
4564
|
startStream(stream) {
|
|
4588
4565
|
if (this.stream)
|
|
4589
4566
|
this.stream.getTracks().forEach((track) => track.stop());
|
|
@@ -4615,13 +4592,6 @@ class Stream {
|
|
|
4615
4592
|
this.startStream(stream);
|
|
4616
4593
|
this.recordStream();
|
|
4617
4594
|
}
|
|
4618
|
-
async resumeStream() {
|
|
4619
|
-
this.streamPaused = false;
|
|
4620
|
-
this.mediaRecorder.resume();
|
|
4621
|
-
await this.videoElement.play();
|
|
4622
|
-
// this.drawMask();
|
|
4623
|
-
// if (this.faceDetection) await Detector.getInstance().startDetector();
|
|
4624
|
-
}
|
|
4625
4595
|
recordStream() {
|
|
4626
4596
|
if (this.mediaRecorder && this.mediaRecorder.state == 'recording')
|
|
4627
4597
|
return;
|
|
@@ -4661,7 +4631,6 @@ class Stream {
|
|
|
4661
4631
|
if (this.mediaRecorder && this.mediaRecorder.state != 'inactive') {
|
|
4662
4632
|
this.mediaRecorder.stop();
|
|
4663
4633
|
}
|
|
4664
|
-
// if (this.faceDetection) Detector.getInstance().stopDetector();
|
|
4665
4634
|
}
|
|
4666
4635
|
streamStopped() {
|
|
4667
4636
|
return !(this.stream && this.stream.getTracks && this.stream.getTracks().length > 0);
|
|
@@ -4684,15 +4653,13 @@ class Stream {
|
|
|
4684
4653
|
}
|
|
4685
4654
|
catch (e) {
|
|
4686
4655
|
resolve(frame);
|
|
4687
|
-
this.
|
|
4656
|
+
this.timeElapsed();
|
|
4688
4657
|
}
|
|
4689
4658
|
}
|
|
4690
4659
|
else {
|
|
4691
4660
|
resolve(frame);
|
|
4692
4661
|
}
|
|
4693
4662
|
}, ImageFormat.PNG, 1);
|
|
4694
|
-
//let outCanvContext = this.canvasElement.getContext('2d');
|
|
4695
|
-
//outCanvContext.drawImage(this.videoElement, 0, 0, this.canvasElement.width, this.canvasElement.height);
|
|
4696
4663
|
});
|
|
4697
4664
|
}
|
|
4698
4665
|
async startIdDetection() {
|
|
@@ -4708,22 +4675,9 @@ class Stream {
|
|
|
4708
4675
|
initFacePose() {
|
|
4709
4676
|
this.facePose = FacePosePick.randomEnum(FacePose);
|
|
4710
4677
|
}
|
|
4711
|
-
requestFacePose() {
|
|
4712
|
-
// var pose = FacePose.TiltLeft;
|
|
4713
|
-
this.callbackChangeTitle(this.facePose);
|
|
4714
|
-
return this.facePose;
|
|
4715
|
-
}
|
|
4716
|
-
changeFacePose() {
|
|
4717
|
-
this.callbackChangeTitle(null);
|
|
4718
|
-
}
|
|
4719
|
-
changeIDPose(pose) {
|
|
4720
|
-
this.callbackChangeTitle(pose);
|
|
4721
|
-
}
|
|
4722
4678
|
}
|
|
4723
4679
|
Stream.mp4MimeType = { type: 'video/mp4', codec: 'codecs:h264', extension: 'mp4', mime: 'video/mp4;codecs:h264' };
|
|
4724
|
-
Stream.webmMimeType = { type: 'video/webm', codec: 'codecs=vp8', extension: 'webm', mime: 'video/webm;codecs=vp8' };
|
|
4725
|
-
window.addEventListener('resize', Stream.orientationChange, false);
|
|
4726
|
-
window.addEventListener('orientationchange', Stream.orientationChange, false);
|
|
4680
|
+
Stream.webmMimeType = { type: 'video/webm', codec: 'codecs=vp8', extension: 'webm', mime: 'video/webm;codecs=vp8' };
|
|
4727
4681
|
|
|
4728
4682
|
const cameraCss = ".camera{width:100%;height:100%;color:white;display:flex;align-items:center;justify-content:center;position:relative}.cameraCanvas,.cameraCanvasSelfie,.cameraCanvasSelfieDesk{z-index:3;max-width:100%;max-height:100%;border-radius:10px}.cameraCanvasSelfie,.cameraCanvasSelfieDesk{transform:scale(-1, 1);-webkit-transform:scale(-1, 1)}.cameraVideo,.cameraVideoSelfie,.cameraVideoSelfieDesk{z-index:2;position:absolute;max-width:100%;max-height:100%;border-radius:10px}.cameraVideoSelfie,.cameraVideoSelfieDesk{transform:scale(-1, 1);-webkit-transform:scale(-1, 1)}.cameraMobile{position:fixed;top:0;left:0;background:black}";
|
|
4729
4683
|
|
|
@@ -4731,23 +4685,11 @@ const Camera = class {
|
|
|
4731
4685
|
constructor(hostRef) {
|
|
4732
4686
|
registerInstance(this, hostRef);
|
|
4733
4687
|
this.eventVideoStarted = createEvent(this, "videoStarted", 7);
|
|
4734
|
-
this.eventCloseCamera = createEvent(this, "closeCamera", 7);
|
|
4735
|
-
this.errorCameraEvent = createEvent(this, "errorCamera", 7);
|
|
4736
4688
|
this.eventTakePhoto = createEvent(this, "takePhoto", 7);
|
|
4737
4689
|
this.eventRecordingSelfieReady = createEvent(this, "recordingSelfieCapture", 7);
|
|
4738
4690
|
this.eventRecordingIdReady = createEvent(this, "recordingIdCapture", 7);
|
|
4739
4691
|
this.eventTimeElapsed = createEvent(this, "timeElapsed", 7);
|
|
4740
|
-
this.eventChangeTitle = createEvent(this, "changeTitle", 7);
|
|
4741
4692
|
this.verificationFinished = createEvent(this, "verificationFinished", 7);
|
|
4742
|
-
this.callbackErrors = (error, isError) => {
|
|
4743
|
-
if (isError) {
|
|
4744
|
-
this.errorCameraEvent.emit(error);
|
|
4745
|
-
this.eventCloseCamera.emit();
|
|
4746
|
-
}
|
|
4747
|
-
else {
|
|
4748
|
-
this.errorCameraEvent.emit(error);
|
|
4749
|
-
}
|
|
4750
|
-
};
|
|
4751
4693
|
this.callbackAutoCapturing = () => {
|
|
4752
4694
|
this.eventTakePhoto.emit();
|
|
4753
4695
|
};
|
|
@@ -4763,9 +4705,6 @@ const Camera = class {
|
|
|
4763
4705
|
this.callbackTimeElapsed = () => {
|
|
4764
4706
|
this.eventTimeElapsed.emit();
|
|
4765
4707
|
};
|
|
4766
|
-
this.callbackChangeTitle = (message) => {
|
|
4767
|
-
this.eventChangeTitle.emit(message);
|
|
4768
|
-
};
|
|
4769
4708
|
this.callbackVideoStarted = () => {
|
|
4770
4709
|
this.eventVideoStarted.emit(this.component.getBoundingClientRect());
|
|
4771
4710
|
};
|
|
@@ -4793,8 +4732,7 @@ const Camera = class {
|
|
|
4793
4732
|
return (h("div", { class: "camera" }, h("video", { id: "video", loop: true, autoplay: true, playsinline: true, muted: true, class: cameraVideoClass, ref: el => (this.cameraVideo = el) }), h("canvas", { id: "output", class: cameraCanvasClass, ref: el => (this.cameraCanvas = el) })));
|
|
4794
4733
|
}
|
|
4795
4734
|
startStream() {
|
|
4796
|
-
|
|
4797
|
-
const stream = Stream.getNewInstance(captureMode);
|
|
4735
|
+
const stream = Stream.instance;
|
|
4798
4736
|
stream.updateHtmlElements(this.cameraVideo, this.cameraCanvas, this.component);
|
|
4799
4737
|
if (this.captureMode == 'selfie') {
|
|
4800
4738
|
stream.setFaceDetection(true);
|
|
@@ -4808,9 +4746,7 @@ const Camera = class {
|
|
|
4808
4746
|
stream.setCallbackRecordingReady(this.callbackIdRecordingReady);
|
|
4809
4747
|
// stream.setShowMask(false);
|
|
4810
4748
|
}
|
|
4811
|
-
stream.setCallbackErrors(this.callbackErrors);
|
|
4812
4749
|
stream.setCallbackAutoCapturing(this.callbackAutoCapturing);
|
|
4813
|
-
stream.setCallbackChangeTitle(this.callbackChangeTitle);
|
|
4814
4750
|
stream.setCallbackVideoStarted(this.callbackVideoStarted);
|
|
4815
4751
|
stream.setCallbackTimeElapsed(this.callbackTimeElapsed);
|
|
4816
4752
|
stream.setVerificationFinished(this.callbackVerificationFinished);
|
|
@@ -4959,7 +4895,7 @@ ErrorEnd.style = errorEndCss;
|
|
|
4959
4895
|
const howToInfoCss = "";
|
|
4960
4896
|
|
|
4961
4897
|
const HowToInfo = class {
|
|
4962
|
-
constructor(hostRef) { registerInstance(this, hostRef); this.eventHowToInfoDone = createEvent(this, "howToInfoDone", 7); this.apiErrorEvent = createEvent(this, "apiError", 7); this.
|
|
4898
|
+
constructor(hostRef) { registerInstance(this, hostRef); this.eventHowToInfoDone = createEvent(this, "howToInfoDone", 7); this.apiErrorEvent = createEvent(this, "apiError", 7); this.topTitle = undefined; this.subTitle = undefined; this.imagePath = undefined; this.buttonText = undefined; this.buttonEnabled = undefined; }
|
|
4963
4899
|
async componentDidLoad() {
|
|
4964
4900
|
await this.baseComponent.initialize();
|
|
4965
4901
|
}
|
|
@@ -4974,18 +4910,16 @@ const HowToInfo = class {
|
|
|
4974
4910
|
this.translations = await Translations.getValues();
|
|
4975
4911
|
this.subTitle = '';
|
|
4976
4912
|
this.buttonEnabled = true;
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
this.subTitle = this.translations.HowToValues.IdSubTitileBack;
|
|
4988
|
-
}
|
|
4913
|
+
this.topTitle = this.translations.HowToValues.IdTitile;
|
|
4914
|
+
this.imagePath = 'https://ekyc.blob.core.windows.net/$web/howto_id.png';
|
|
4915
|
+
this.buttonText = this.translations.HowToValues.IdButton;
|
|
4916
|
+
if (state.flowStatus == FlowStatus.IDFRONT) {
|
|
4917
|
+
this.baseComponent = new BaseComponent(FlowSteps.CiFrontHowTo);
|
|
4918
|
+
this.subTitle = this.translations.HowToValues.IdSubTitileFace;
|
|
4919
|
+
}
|
|
4920
|
+
else if (state.flowStatus == FlowStatus.IDBACK) {
|
|
4921
|
+
this.baseComponent = new BaseComponent(FlowSteps.CiBackHowTo);
|
|
4922
|
+
this.subTitle = this.translations.HowToValues.IdSubTitileBack;
|
|
4989
4923
|
}
|
|
4990
4924
|
if (state.flowStatus == FlowStatus.LIVENESS) {
|
|
4991
4925
|
this.baseComponent = new BaseComponent(FlowSteps.SelfieHowTo);
|
|
@@ -5140,128 +5074,6 @@ var IDPose;
|
|
|
5140
5074
|
IDPose[IDPose["BackTilted"] = 4] = "BackTilted";
|
|
5141
5075
|
})(IDPose || (IDPose = {}));
|
|
5142
5076
|
|
|
5143
|
-
const idBackCaptureCss = ".logo{max-height:450px;max-width:450px}.canvas-on-video{max-width:100%;max-height:100%;position:absolute;z-index:2;transform:scale(-1, 1)}";
|
|
5144
|
-
|
|
5145
|
-
const IdBackCapture = class {
|
|
5146
|
-
// @State() private animationPath: string;
|
|
5147
|
-
constructor(hostRef) {
|
|
5148
|
-
registerInstance(this, hostRef);
|
|
5149
|
-
this.eventPhotoCapture = createEvent(this, "photoIdBackCapture", 7);
|
|
5150
|
-
this.apiErrorEvent = createEvent(this, "apiError", 7);
|
|
5151
|
-
this.eventTimeElapsed = createEvent(this, "timeElapsed", 7);
|
|
5152
|
-
this.photoIsReady = photos => {
|
|
5153
|
-
//this.closeCamera();
|
|
5154
|
-
this.eventPhotoCapture.emit(photos);
|
|
5155
|
-
};
|
|
5156
|
-
this.videoStarted = undefined;
|
|
5157
|
-
this.cameraSize = undefined;
|
|
5158
|
-
this.captureTaken = undefined;
|
|
5159
|
-
this.verified = undefined;
|
|
5160
|
-
this.titleMesage = undefined;
|
|
5161
|
-
this.showDemo = undefined;
|
|
5162
|
-
this.demoVideo = undefined;
|
|
5163
|
-
this.captureTaken = false;
|
|
5164
|
-
this.verified = false;
|
|
5165
|
-
this.cameras = new Cameras();
|
|
5166
|
-
this.showDemo = true;
|
|
5167
|
-
this.baseComponent = new BaseComponent(FlowSteps.CiBackCapture);
|
|
5168
|
-
}
|
|
5169
|
-
eventVideoStarted(event) {
|
|
5170
|
-
this.videoStarted = true;
|
|
5171
|
-
this.cameraSize = event.detail;
|
|
5172
|
-
}
|
|
5173
|
-
async componentWillLoad() {
|
|
5174
|
-
this.translations = await Translations.getValues();
|
|
5175
|
-
//this.videoDemoStyle = this.device.isMobile ? { width: window.screen.width + 'px', height: window.screen.height + 'px', 'object-fit': 'fill' } : {};
|
|
5176
|
-
if (!navigator.mediaDevices) {
|
|
5177
|
-
this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
|
|
5178
|
-
}
|
|
5179
|
-
}
|
|
5180
|
-
async componentDidLoad() {
|
|
5181
|
-
await this.baseComponent.logStep(FlowSteps.CiBackCapture, FlowMoments.Initialized);
|
|
5182
|
-
this.titleMesage = this.translations.IdCaptureValues.TtileRotate;
|
|
5183
|
-
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Rotate];
|
|
5184
|
-
this.demoVideo.play();
|
|
5185
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
5186
|
-
this.titleMesage = this.translations.IdCaptureValues.TitleBack;
|
|
5187
|
-
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.BackStraight];
|
|
5188
|
-
this.demoVideo.play();
|
|
5189
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
5190
|
-
this.showDemo = false;
|
|
5191
|
-
this.openCamera();
|
|
5192
|
-
}
|
|
5193
|
-
async openCamera() {
|
|
5194
|
-
const constraints = this.cameras.GetConstraints(state.cameraId, state.device);
|
|
5195
|
-
setTimeout(() => {
|
|
5196
|
-
navigator.mediaDevices
|
|
5197
|
-
.getUserMedia(constraints)
|
|
5198
|
-
.then(stream => {
|
|
5199
|
-
const superStream = Stream.getNewInstance(VerificationMode.Full);
|
|
5200
|
-
superStream.initStream(stream);
|
|
5201
|
-
})
|
|
5202
|
-
.catch(e => {
|
|
5203
|
-
this.closeCamera();
|
|
5204
|
-
this.apiErrorEvent.emit(e);
|
|
5205
|
-
});
|
|
5206
|
-
}, 100);
|
|
5207
|
-
}
|
|
5208
|
-
closeCamera() {
|
|
5209
|
-
if (Stream.instance) {
|
|
5210
|
-
Stream.instance.dropStream();
|
|
5211
|
-
}
|
|
5212
|
-
}
|
|
5213
|
-
disconnectedCallback() {
|
|
5214
|
-
this.closeCamera();
|
|
5215
|
-
Stream.instance = null;
|
|
5216
|
-
IDML5Detector.instance = null;
|
|
5217
|
-
FaceML5Detector.instance = null;
|
|
5218
|
-
}
|
|
5219
|
-
async verificationFinished() {
|
|
5220
|
-
if (this.verified)
|
|
5221
|
-
return;
|
|
5222
|
-
this.verified = true;
|
|
5223
|
-
this.titleMesage = this.translations.IdCaptureValues.Loading;
|
|
5224
|
-
this.closeCamera();
|
|
5225
|
-
this.showDemo = true;
|
|
5226
|
-
var loops = 0;
|
|
5227
|
-
this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
|
|
5228
|
-
this.demoVideo.loop = false;
|
|
5229
|
-
while (loops < 7) {
|
|
5230
|
-
loops++;
|
|
5231
|
-
this.demoVideo.play();
|
|
5232
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
5233
|
-
}
|
|
5234
|
-
this.eventTimeElapsed.emit();
|
|
5235
|
-
}
|
|
5236
|
-
async takePhoto() {
|
|
5237
|
-
if (this.captureTaken)
|
|
5238
|
-
return;
|
|
5239
|
-
this.captureTaken = true;
|
|
5240
|
-
if (Stream.instance) {
|
|
5241
|
-
let res = await Stream.instance.takePhoto();
|
|
5242
|
-
this.photoIsReady(res);
|
|
5243
|
-
}
|
|
5244
|
-
else {
|
|
5245
|
-
this.eventTimeElapsed.emit();
|
|
5246
|
-
}
|
|
5247
|
-
await this.baseComponent.logStep(FlowSteps.CiBackCapture, FlowMoments.Finalized);
|
|
5248
|
-
}
|
|
5249
|
-
render() {
|
|
5250
|
-
let cameraStyle;
|
|
5251
|
-
let cameraStyleInner;
|
|
5252
|
-
if (this.videoStarted) {
|
|
5253
|
-
cameraStyle = { width: Math.round(this.cameraSize.width) + 'px', height: Math.round((this.cameraSize.width * 9) / 16) + 'px', overflow: 'hidden', borderRadius: '10px' };
|
|
5254
|
-
cameraStyleInner = { marginTop: Math.round((this.cameraSize.height - (this.cameraSize.width * 9) / 16) / 2) * -1 + 'px' };
|
|
5255
|
-
}
|
|
5256
|
-
let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
|
|
5257
|
-
//let videoClass = this.device.isMobile ? '' : 'video-demo';
|
|
5258
|
-
let bgDemo = this.verified ? 'container' : 'container bg-black';
|
|
5259
|
-
return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.showDemo == false }, h("video", { id: "howtoBack", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.showDemo }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("div", { style: cameraStyleInner }, h("camera-comp", { "capture-mode": "id" })))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))));
|
|
5260
|
-
}
|
|
5261
|
-
get component() { return getElement(this); }
|
|
5262
|
-
};
|
|
5263
|
-
IdBackCapture.style = idBackCaptureCss;
|
|
5264
|
-
|
|
5265
5077
|
const idCaptureCss = ".logo{max-height:450px;max-width:450px}.canvas-on-video{max-width:100%;max-height:100%;position:absolute;z-index:2;transform:scale(-1, 1)}";
|
|
5266
5078
|
|
|
5267
5079
|
const IdCapture = class {
|
|
@@ -5271,8 +5083,7 @@ const IdCapture = class {
|
|
|
5271
5083
|
this.eventPhotoCapture = createEvent(this, "photoIdCapture", 7);
|
|
5272
5084
|
this.apiErrorEvent = createEvent(this, "apiError", 7);
|
|
5273
5085
|
this.eventTimeElapsed = createEvent(this, "timeElapsed", 7);
|
|
5274
|
-
this.photoIsReady = photos => {
|
|
5275
|
-
//this.closeCamera();
|
|
5086
|
+
this.photoIsReady = (photos) => {
|
|
5276
5087
|
this.eventPhotoCapture.emit(photos);
|
|
5277
5088
|
};
|
|
5278
5089
|
this.videoStarted = undefined;
|
|
@@ -5286,7 +5097,6 @@ const IdCapture = class {
|
|
|
5286
5097
|
this.verified = false;
|
|
5287
5098
|
this.cameras = new Cameras();
|
|
5288
5099
|
this.showDemo = true;
|
|
5289
|
-
this.baseComponent = new BaseComponent(FlowSteps.CiFrontCapture);
|
|
5290
5100
|
}
|
|
5291
5101
|
eventVideoStarted(event) {
|
|
5292
5102
|
this.videoStarted = true;
|
|
@@ -5294,138 +5104,41 @@ const IdCapture = class {
|
|
|
5294
5104
|
}
|
|
5295
5105
|
async componentWillLoad() {
|
|
5296
5106
|
this.translations = await Translations.getValues();
|
|
5297
|
-
this.titleMesage = this.translations.IdCaptureValues.Title;
|
|
5298
|
-
//this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
|
|
5299
5107
|
if (!navigator.mediaDevices) {
|
|
5300
5108
|
this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
|
|
5301
5109
|
}
|
|
5110
|
+
this.baseComponent = new BaseComponent(this.flowStep);
|
|
5302
5111
|
}
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
this.openCamera();
|
|
5310
|
-
}
|
|
5311
|
-
async openCamera() {
|
|
5312
|
-
const constraints = this.cameras.GetConstraints(state.cameraId, state.device);
|
|
5313
|
-
setTimeout(() => {
|
|
5314
|
-
navigator.mediaDevices
|
|
5315
|
-
.getUserMedia(constraints)
|
|
5316
|
-
.then(stream => {
|
|
5317
|
-
const superStream = Stream.getNewInstance(VerificationMode.Full);
|
|
5318
|
-
superStream.initStream(stream);
|
|
5319
|
-
})
|
|
5320
|
-
.catch(e => {
|
|
5321
|
-
this.closeCamera();
|
|
5322
|
-
this.apiErrorEvent.emit(e);
|
|
5323
|
-
});
|
|
5324
|
-
}, 100);
|
|
5325
|
-
}
|
|
5326
|
-
closeCamera() {
|
|
5327
|
-
if (Stream.instance) {
|
|
5328
|
-
Stream.instance.dropStream();
|
|
5112
|
+
initVariables() {
|
|
5113
|
+
if (state.flowStatus == FlowStatus.IDFRONT) {
|
|
5114
|
+
this.pose = IDPose.Straight;
|
|
5115
|
+
this.flowStep = FlowSteps.CiFrontCapture;
|
|
5116
|
+
this.titleMesage = this.translations.IdCaptureValues.Title;
|
|
5117
|
+
this.verificationMode = VerificationMode.Full;
|
|
5329
5118
|
}
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
FaceML5Detector.instance = null;
|
|
5336
|
-
}
|
|
5337
|
-
async takePhoto() {
|
|
5338
|
-
if (this.captureTaken)
|
|
5339
|
-
return;
|
|
5340
|
-
this.captureTaken = true;
|
|
5341
|
-
if (Stream.instance) {
|
|
5342
|
-
let res = await Stream.instance.takePhoto();
|
|
5343
|
-
this.photoIsReady(res);
|
|
5119
|
+
else if (state.flowStatus == FlowStatus.IDBACK) {
|
|
5120
|
+
this.pose = IDPose.BackStraight;
|
|
5121
|
+
this.flowStep = FlowSteps.CiBackCapture;
|
|
5122
|
+
this.titleMesage = this.translations.IdCaptureValues.TtileRotate;
|
|
5123
|
+
this.verificationMode = VerificationMode.Full;
|
|
5344
5124
|
}
|
|
5345
|
-
else {
|
|
5346
|
-
this.
|
|
5125
|
+
else if (state.flowStatus == FlowStatus.IDTILT) {
|
|
5126
|
+
this.titleMesage = this.translations.IdCaptureValues.IDPoseMapping;
|
|
5127
|
+
this.pose = IDPose.Tilted;
|
|
5128
|
+
this.flowStep = FlowSteps.CiTilt;
|
|
5129
|
+
this.verificationMode = VerificationMode.Tilt;
|
|
5347
5130
|
}
|
|
5348
|
-
await this.baseComponent.logStep(FlowSteps.CiFrontCapture, FlowMoments.Finalized);
|
|
5349
5131
|
}
|
|
5350
|
-
async
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
this.closeCamera();
|
|
5356
|
-
this.showDemo = true;
|
|
5357
|
-
var loops = 0;
|
|
5358
|
-
this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
|
|
5359
|
-
this.demoVideo.loop = false;
|
|
5360
|
-
while (loops < 7) {
|
|
5361
|
-
loops++;
|
|
5132
|
+
async componentDidLoad() {
|
|
5133
|
+
await this.baseComponent.logStep(this.flowStep, FlowMoments.Initialized);
|
|
5134
|
+
this.initVariables();
|
|
5135
|
+
if (state.flowStatus == FlowStatus.IDBACK) {
|
|
5136
|
+
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Rotate];
|
|
5362
5137
|
this.demoVideo.play();
|
|
5363
5138
|
await delay(this.translations.GlobalValues.VideoLenght);
|
|
5139
|
+
this.titleMesage = this.translations.IdCaptureValues.TitleBack;
|
|
5364
5140
|
}
|
|
5365
|
-
this.
|
|
5366
|
-
}
|
|
5367
|
-
render() {
|
|
5368
|
-
let cameraStyle;
|
|
5369
|
-
let cameraStyleInner;
|
|
5370
|
-
if (this.videoStarted) {
|
|
5371
|
-
cameraStyle = {
|
|
5372
|
-
width: Math.round(this.cameraSize.width) + 'px',
|
|
5373
|
-
height: Math.round((this.cameraSize.width * 9) / 16) + 'px',
|
|
5374
|
-
overflow: 'hidden',
|
|
5375
|
-
borderRadius: '10px',
|
|
5376
|
-
};
|
|
5377
|
-
cameraStyleInner = { marginTop: Math.round((this.cameraSize.height - (this.cameraSize.width * 9) / 16) / 2) * -1 + 'px' };
|
|
5378
|
-
}
|
|
5379
|
-
let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
|
|
5380
|
-
//let videoClass = this.device.isMobile ? '' : 'video-demo';
|
|
5381
|
-
let bgDemo = this.verified ? 'container' : 'container bg-black';
|
|
5382
|
-
return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.showDemo == false }, h("video", { id: "howtoFront", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.showDemo }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("div", { style: cameraStyleInner }, h("camera-comp", { "capture-mode": "id" })))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))));
|
|
5383
|
-
}
|
|
5384
|
-
get component() { return getElement(this); }
|
|
5385
|
-
};
|
|
5386
|
-
IdCapture.style = idCaptureCss;
|
|
5387
|
-
|
|
5388
|
-
const idTiltCss = ".logo{max-height:450px;max-width:450px}.canvas-on-video{max-width:100%;max-height:100%;position:absolute;z-index:2;transform:scale(-1, 1)}";
|
|
5389
|
-
|
|
5390
|
-
const IdTilt = class {
|
|
5391
|
-
// @State() private animationPath: string;
|
|
5392
|
-
constructor(hostRef) {
|
|
5393
|
-
registerInstance(this, hostRef);
|
|
5394
|
-
this.eventPhotoCapture = createEvent(this, "photoTiltCapture", 7);
|
|
5395
|
-
this.apiErrorEvent = createEvent(this, "apiError", 7);
|
|
5396
|
-
this.eventTimeElapsed = createEvent(this, "timeElapsed", 7);
|
|
5397
|
-
this.photoIsReady = photos => {
|
|
5398
|
-
//this.closeCamera();
|
|
5399
|
-
this.eventPhotoCapture.emit(photos);
|
|
5400
|
-
};
|
|
5401
|
-
this.videoStarted = undefined;
|
|
5402
|
-
this.cameraSize = undefined;
|
|
5403
|
-
this.captureTaken = undefined;
|
|
5404
|
-
this.verified = undefined;
|
|
5405
|
-
this.titleMesage = undefined;
|
|
5406
|
-
this.showDemo = undefined;
|
|
5407
|
-
this.demoVideo = undefined;
|
|
5408
|
-
this.captureTaken = false;
|
|
5409
|
-
this.verified = false;
|
|
5410
|
-
this.cameras = new Cameras();
|
|
5411
|
-
this.showDemo = true;
|
|
5412
|
-
this.baseComponent = new BaseComponent(FlowSteps.CiTilt);
|
|
5413
|
-
}
|
|
5414
|
-
eventVideoStarted(event) {
|
|
5415
|
-
this.videoStarted = true;
|
|
5416
|
-
this.cameraSize = event.detail;
|
|
5417
|
-
}
|
|
5418
|
-
async componentWillLoad() {
|
|
5419
|
-
this.translations = await Translations.getValues();
|
|
5420
|
-
this.titleMesage = this.translations.IdCaptureValues.IDPoseMapping;
|
|
5421
|
-
//this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
|
|
5422
|
-
if (!navigator.mediaDevices) {
|
|
5423
|
-
this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
|
|
5424
|
-
}
|
|
5425
|
-
}
|
|
5426
|
-
async componentDidLoad() {
|
|
5427
|
-
await this.baseComponent.logStep(FlowSteps.CiTilt, FlowMoments.Initialized);
|
|
5428
|
-
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Tilted];
|
|
5141
|
+
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[this.pose];
|
|
5429
5142
|
this.demoVideo.play();
|
|
5430
5143
|
await delay(this.translations.GlobalValues.VideoLenght);
|
|
5431
5144
|
this.showDemo = false;
|
|
@@ -5437,7 +5150,7 @@ const IdTilt = class {
|
|
|
5437
5150
|
navigator.mediaDevices
|
|
5438
5151
|
.getUserMedia(constraints)
|
|
5439
5152
|
.then(stream => {
|
|
5440
|
-
const superStream = Stream.getNewInstance(
|
|
5153
|
+
const superStream = Stream.getNewInstance(this.verificationMode);
|
|
5441
5154
|
superStream.initStream(stream);
|
|
5442
5155
|
})
|
|
5443
5156
|
.catch(e => {
|
|
@@ -5468,7 +5181,7 @@ const IdTilt = class {
|
|
|
5468
5181
|
else {
|
|
5469
5182
|
this.eventTimeElapsed.emit();
|
|
5470
5183
|
}
|
|
5471
|
-
await this.baseComponent.logStep(
|
|
5184
|
+
await this.baseComponent.logStep(this.flowStep, FlowMoments.Finalized);
|
|
5472
5185
|
}
|
|
5473
5186
|
async verificationFinished() {
|
|
5474
5187
|
if (this.verified)
|
|
@@ -5476,15 +5189,11 @@ const IdTilt = class {
|
|
|
5476
5189
|
this.verified = true;
|
|
5477
5190
|
this.titleMesage = this.translations.IdCaptureValues.Loading;
|
|
5478
5191
|
this.closeCamera();
|
|
5479
|
-
this.showDemo = true;
|
|
5480
|
-
var loops = 0;
|
|
5481
5192
|
this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
|
|
5482
|
-
this.demoVideo.loop =
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
5487
|
-
}
|
|
5193
|
+
this.demoVideo.loop = true;
|
|
5194
|
+
this.showDemo = true;
|
|
5195
|
+
this.demoVideo.play();
|
|
5196
|
+
await delay(10000);
|
|
5488
5197
|
this.eventTimeElapsed.emit();
|
|
5489
5198
|
}
|
|
5490
5199
|
render() {
|
|
@@ -5500,13 +5209,12 @@ const IdTilt = class {
|
|
|
5500
5209
|
cameraStyleInner = { marginTop: Math.round((this.cameraSize.height - (this.cameraSize.width * 9) / 16) / 2) * -1 + 'px' };
|
|
5501
5210
|
}
|
|
5502
5211
|
let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
|
|
5503
|
-
//let videoClass = this.device.isMobile ? '' : 'video-demo';
|
|
5504
5212
|
let bgDemo = this.verified ? 'container' : 'container bg-black';
|
|
5505
|
-
return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.showDemo == false }, h("video", { id: "
|
|
5213
|
+
return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.showDemo == false }, h("video", { id: "howTo", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.showDemo }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("div", { style: cameraStyleInner }, h("camera-comp", { "capture-mode": "id" })))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))));
|
|
5506
5214
|
}
|
|
5507
5215
|
get component() { return getElement(this); }
|
|
5508
5216
|
};
|
|
5509
|
-
|
|
5217
|
+
IdCapture.style = idCaptureCss;
|
|
5510
5218
|
|
|
5511
5219
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
5512
5220
|
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
@@ -5574,7 +5282,7 @@ function v4(options, buf, offset) {
|
|
|
5574
5282
|
}
|
|
5575
5283
|
|
|
5576
5284
|
const name = "@ekyc_qoobiss/qbs-ect-cmp";
|
|
5577
|
-
const version$1 = "3.6.
|
|
5285
|
+
const version$1 = "3.6.41";
|
|
5578
5286
|
const description = "Person Identification Component";
|
|
5579
5287
|
const main = "./dist/index.cjs.js";
|
|
5580
5288
|
const module = "./dist/index.js";
|
|
@@ -5696,6 +5404,7 @@ const IdentificationComponent = class {
|
|
|
5696
5404
|
registerInstance(this, hostRef);
|
|
5697
5405
|
this.logInit = {};
|
|
5698
5406
|
this.flowStatusToSet = FlowStatus.NONE;
|
|
5407
|
+
this.initialised = false;
|
|
5699
5408
|
this.token = undefined;
|
|
5700
5409
|
this.order_id = undefined;
|
|
5701
5410
|
this.api_url = undefined;
|
|
@@ -5703,7 +5412,6 @@ const IdentificationComponent = class {
|
|
|
5703
5412
|
this.redirect_id = undefined;
|
|
5704
5413
|
this.phone_number = undefined;
|
|
5705
5414
|
this.lang_iso = undefined;
|
|
5706
|
-
this.idSide = '';
|
|
5707
5415
|
this.errorMessage = undefined;
|
|
5708
5416
|
this.errorTitle = undefined;
|
|
5709
5417
|
}
|
|
@@ -5738,33 +5446,14 @@ const IdentificationComponent = class {
|
|
|
5738
5446
|
if (this.lang_iso && this.lang_iso != '') {
|
|
5739
5447
|
state.langIso = this.lang_iso;
|
|
5740
5448
|
}
|
|
5741
|
-
var ini = sessionStorage.getItem(SessionKeys.InitialisedKey);
|
|
5742
|
-
if (ini && ini.toLowerCase() == 'true') {
|
|
5743
|
-
state.initialised = true;
|
|
5744
|
-
}
|
|
5745
|
-
var hasIdBk = sessionStorage.getItem(SessionKeys.HasIdBackKey);
|
|
5746
|
-
if (hasIdBk && hasIdBk.toLowerCase() == 'true') {
|
|
5747
|
-
state.hasIdBack = true;
|
|
5748
|
-
}
|
|
5749
|
-
var agrVal = sessionStorage.getItem(SessionKeys.AgreementValidationKey);
|
|
5750
|
-
if (agrVal && agrVal.toLowerCase() == 'true') {
|
|
5751
|
-
state.agreementsValidation = true;
|
|
5752
|
-
}
|
|
5753
|
-
var phoneVal = sessionStorage.getItem(SessionKeys.PhoneValidationKey);
|
|
5754
|
-
if (phoneVal && phoneVal.toLowerCase() == 'true') {
|
|
5755
|
-
state.phoneValidation = true;
|
|
5756
|
-
}
|
|
5757
5449
|
const savedRequest = sessionStorage.getItem(SessionKeys.RequestIdKey);
|
|
5450
|
+
if (savedRequest && savedRequest != '' && savedRequest != this.order_id && state.debug) {
|
|
5451
|
+
console.log('Session RequestId: ' + savedRequest + ' has different value than property one: ' + this.order_id);
|
|
5452
|
+
}
|
|
5758
5453
|
if (this.order_id && this.order_id != '') {
|
|
5759
5454
|
state.requestId = this.order_id;
|
|
5760
5455
|
if (state.debug)
|
|
5761
5456
|
console.log('Current RequestId has value: ' + this.order_id);
|
|
5762
|
-
if (savedRequest && savedRequest != '' && savedRequest != this.order_id) {
|
|
5763
|
-
if (state.debug)
|
|
5764
|
-
console.log('Session RequestId: ' + savedRequest + ' has different value than property one: ' + this.order_id);
|
|
5765
|
-
this.flowStatusToSet = FlowStatus.LANDING;
|
|
5766
|
-
state.initialised = false;
|
|
5767
|
-
}
|
|
5768
5457
|
}
|
|
5769
5458
|
else if (savedRequest) {
|
|
5770
5459
|
if (state.debug)
|
|
@@ -5786,17 +5475,12 @@ const IdentificationComponent = class {
|
|
|
5786
5475
|
await this.initializeRequest();
|
|
5787
5476
|
state.flowStatus = this.flowStatusToSet;
|
|
5788
5477
|
}
|
|
5789
|
-
componentWillRender() {
|
|
5790
|
-
if (this.idSide == '') {
|
|
5791
|
-
this.idSide = state.hasIdBack ? 'front' : '';
|
|
5792
|
-
}
|
|
5793
|
-
}
|
|
5794
5478
|
async initializeRequest() {
|
|
5795
|
-
if (
|
|
5479
|
+
if (this.initialised) {
|
|
5796
5480
|
return;
|
|
5797
5481
|
}
|
|
5482
|
+
this.initialised = true;
|
|
5798
5483
|
if (state.environment == 'DEMO') {
|
|
5799
|
-
state.initialised = true;
|
|
5800
5484
|
return;
|
|
5801
5485
|
}
|
|
5802
5486
|
if (state.device.browser == Browser.Mi) {
|
|
@@ -5814,7 +5498,7 @@ const IdentificationComponent = class {
|
|
|
5814
5498
|
this.redirect_id = state.redirectId;
|
|
5815
5499
|
}
|
|
5816
5500
|
if (state.token != '' && (state.requestId != '' || state.redirectId != '')) {
|
|
5817
|
-
|
|
5501
|
+
await this.baseComponent.apiCall.AddIdentificationRequest(state.device, packageJson.version);
|
|
5818
5502
|
if (!this.order_id || this.order_id == '') {
|
|
5819
5503
|
this.order_id = state.requestId;
|
|
5820
5504
|
}
|
|
@@ -5830,19 +5514,17 @@ const IdentificationComponent = class {
|
|
|
5830
5514
|
}
|
|
5831
5515
|
render() {
|
|
5832
5516
|
let currentBlock = (h("div", { class: "container" }, h("div", { class: "row" }, h("div", { class: "div-ci align-center" }, h("img", { src: loaderSvg })))));
|
|
5833
|
-
if (state.
|
|
5834
|
-
|
|
5835
|
-
currentBlock = h("landing-validation", null);
|
|
5836
|
-
}
|
|
5517
|
+
if (state.flowStatus == FlowStatus.LANDING) {
|
|
5518
|
+
currentBlock = h("landing-validation", null);
|
|
5837
5519
|
}
|
|
5838
|
-
|
|
5520
|
+
if (state.flowStatus == FlowStatus.MOBILE) {
|
|
5839
5521
|
currentBlock = h("mobile-redirect", null);
|
|
5840
5522
|
}
|
|
5841
5523
|
if (state.flowStatus == FlowStatus.AGREEMENT) {
|
|
5842
5524
|
currentBlock = h("agreement-info", null);
|
|
5843
5525
|
}
|
|
5844
5526
|
if (state.flowStatus == FlowStatus.PHONE) {
|
|
5845
|
-
currentBlock = h("sms-
|
|
5527
|
+
currentBlock = h("sms-send", null);
|
|
5846
5528
|
}
|
|
5847
5529
|
if (state.flowStatus == FlowStatus.CODE) {
|
|
5848
5530
|
currentBlock = h("sms-code-validation", null);
|
|
@@ -5850,11 +5532,11 @@ const IdentificationComponent = class {
|
|
|
5850
5532
|
if (state.flowStatus == FlowStatus.CODEERROR) {
|
|
5851
5533
|
currentBlock = h("sms-code-validation", null);
|
|
5852
5534
|
}
|
|
5853
|
-
if (state.flowStatus
|
|
5535
|
+
if (state.flowStatus in [FlowStatus.IDFRONT, FlowStatus.IDBACK, FlowStatus.IDTILT]) {
|
|
5854
5536
|
currentBlock = h("process-id", null);
|
|
5855
5537
|
}
|
|
5856
|
-
if (state.flowStatus
|
|
5857
|
-
currentBlock = h("user-liveness",
|
|
5538
|
+
if (state.flowStatus in [FlowStatus.LIVENESS, FlowStatus.LIVENESSGESTURE]) {
|
|
5539
|
+
currentBlock = h("user-liveness", null);
|
|
5858
5540
|
}
|
|
5859
5541
|
if (state.flowStatus == FlowStatus.COMPLETE) {
|
|
5860
5542
|
currentBlock = h("end-redirect", null);
|
|
@@ -5905,33 +5587,25 @@ const LandingValidation = class {
|
|
|
5905
5587
|
}
|
|
5906
5588
|
}
|
|
5907
5589
|
async initRequest() {
|
|
5908
|
-
|
|
5909
|
-
this.warningText = this.translations.LandingValues.WarningMd;
|
|
5910
|
-
}
|
|
5911
|
-
else {
|
|
5912
|
-
this.warningText = this.translations.LandingValues.Warning;
|
|
5913
|
-
}
|
|
5590
|
+
this.warningText = this.translations.LandingValues.Warning;
|
|
5914
5591
|
}
|
|
5915
5592
|
async startFlow() {
|
|
5916
|
-
if (
|
|
5593
|
+
if (!this.buttonDisabled) {
|
|
5917
5594
|
this.buttonDisabled = true;
|
|
5918
5595
|
if (state.environment === 'DEMO') {
|
|
5919
5596
|
state.flowStatus = FlowStatus.COMPLETE;
|
|
5920
5597
|
return;
|
|
5921
5598
|
}
|
|
5922
|
-
|
|
5599
|
+
var cameraIsAccessible = await Cameras.InitCameras(state.device);
|
|
5600
|
+
if (!cameraIsAccessible) {
|
|
5923
5601
|
if (state.device.mobileOS == MobileOS.iOS)
|
|
5924
5602
|
sessionStorage.setItem(SessionKeys.RefreshDoneKey, 'false');
|
|
5925
|
-
state.flowStatus = FlowStatus.CAMERAERROR;
|
|
5926
|
-
}
|
|
5927
|
-
else if (state.agreementsValidation) {
|
|
5928
|
-
state.flowStatus = FlowStatus.AGREEMENT;
|
|
5929
5603
|
}
|
|
5930
|
-
|
|
5931
|
-
state.flowStatus =
|
|
5604
|
+
try {
|
|
5605
|
+
state.flowStatus = await this.baseComponent.apiCall.LandingValidationStartFlow(cameraIsAccessible);
|
|
5932
5606
|
}
|
|
5933
|
-
|
|
5934
|
-
|
|
5607
|
+
catch (e) {
|
|
5608
|
+
this.apiErrorEvent.emit(e);
|
|
5935
5609
|
}
|
|
5936
5610
|
}
|
|
5937
5611
|
}
|
|
@@ -5941,9 +5615,9 @@ const LandingValidation = class {
|
|
|
5941
5615
|
async leaveFlow() {
|
|
5942
5616
|
if (this.buttonDisabled)
|
|
5943
5617
|
return;
|
|
5944
|
-
state.initialised = false;
|
|
5945
5618
|
try {
|
|
5946
|
-
await this.baseComponent.apiCall.AbortRequest();
|
|
5619
|
+
let abortResult = await this.baseComponent.apiCall.AbortRequest();
|
|
5620
|
+
state.flowStatus = FlowStatus[abortResult.state];
|
|
5947
5621
|
Events.flowAborted();
|
|
5948
5622
|
}
|
|
5949
5623
|
catch (e) {
|
|
@@ -5952,7 +5626,7 @@ const LandingValidation = class {
|
|
|
5952
5626
|
}
|
|
5953
5627
|
}
|
|
5954
5628
|
render() {
|
|
5955
|
-
return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", null, h("h1", { class: "text-center" }, this.translations.LandingValues.Title), h("div", { class: "d-flex space-between align-center" }, h("p", { class: "main-text font-size-2" }, this.translations.LandingValues.Description), h("div", { class: "img-info" }, h("div", { class: "i-effect" }), h("img", { src: infoSvg })))), h("div", { class: "info-container" }, h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idSvg })), h("h3", null, this.translations.LandingValues.IdInfo)), h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: deviceSvg })), h("h3", null, this.translations.LandingValues.DeviceInfo)), h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: validationSvg })), h("h3", null, this.translations.LandingValues.SmsInfo))), h("div", { class: "terms-container" }, h("h3", { class: "font-size-2 mb-1 text-center" }, this.warningText)), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", type: "button", disabled:
|
|
5629
|
+
return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", null, h("h1", { class: "text-center" }, this.translations.LandingValues.Title), h("div", { class: "d-flex space-between align-center" }, h("p", { class: "main-text font-size-2" }, this.translations.LandingValues.Description), h("div", { class: "img-info" }, h("div", { class: "i-effect" }), h("img", { src: infoSvg })))), h("div", { class: "info-container" }, h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idSvg })), h("h3", null, this.translations.LandingValues.IdInfo)), h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: deviceSvg })), h("h3", null, this.translations.LandingValues.DeviceInfo)), h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: validationSvg })), h("h3", null, this.translations.LandingValues.SmsInfo))), h("div", { class: "terms-container" }, h("h3", { class: "font-size-2 mb-1 text-center" }, this.warningText)), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", type: "button", disabled: this.buttonDisabled, onClick: () => this.startFlow() }, this.translations.LandingValues.Button), h("p", { class: "main-text font-size-2 link-text mb-0", onClick: () => this.leaveFlow() }, this.translations.LandingValues.ButtonLeave), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
5956
5630
|
}
|
|
5957
5631
|
};
|
|
5958
5632
|
LandingValidation.style = landingValidationCss;
|
|
@@ -8856,7 +8530,7 @@ const MobileRedirect = class {
|
|
|
8856
8530
|
this.infoTextTop = this.translations.MobileRedirectValues.InfoTop;
|
|
8857
8531
|
this.infoTextBottom = this.translations.MobileRedirectValues.InfoBottom;
|
|
8858
8532
|
let envUri = state.environment == 'QA' ? 'test' : 'ect';
|
|
8859
|
-
let baseUri = state.
|
|
8533
|
+
let baseUri = state.apiBaseUrl.includes("apimd") ? 'https://onmd.id-kyc.com/' : 'https://onro.id-kyc.com/';
|
|
8860
8534
|
this.redirectLink = baseUri + envUri + '/mobileredirect?redirectId=' + state.redirectId;
|
|
8861
8535
|
if (state.phoneNumber && state.phoneNumber != '') {
|
|
8862
8536
|
this.contact = state.phoneNumber;
|
|
@@ -8939,23 +8613,7 @@ var CaptureUploadTypes;
|
|
|
8939
8613
|
CaptureUploadTypes["SelfieGestureVideo"] = "SelfieGestureVideo";
|
|
8940
8614
|
CaptureUploadTypes["TiltVideo"] = "TiltVideo";
|
|
8941
8615
|
CaptureUploadTypes["None"] = "None";
|
|
8942
|
-
})(CaptureUploadTypes || (CaptureUploadTypes = {}));
|
|
8943
|
-
var IdCaptureFlowStatus;
|
|
8944
|
-
(function (IdCaptureFlowStatus) {
|
|
8945
|
-
IdCaptureFlowStatus[IdCaptureFlowStatus["HowToFront"] = 0] = "HowToFront";
|
|
8946
|
-
IdCaptureFlowStatus[IdCaptureFlowStatus["IdFront"] = 1] = "IdFront";
|
|
8947
|
-
IdCaptureFlowStatus[IdCaptureFlowStatus["HowToBack"] = 2] = "HowToBack";
|
|
8948
|
-
IdCaptureFlowStatus[IdCaptureFlowStatus["IdBack"] = 3] = "IdBack";
|
|
8949
|
-
IdCaptureFlowStatus[IdCaptureFlowStatus["Tilt"] = 4] = "Tilt";
|
|
8950
|
-
IdCaptureFlowStatus[IdCaptureFlowStatus["End"] = 5] = "End";
|
|
8951
|
-
})(IdCaptureFlowStatus || (IdCaptureFlowStatus = {}));
|
|
8952
|
-
var SelfieFlowStatus;
|
|
8953
|
-
(function (SelfieFlowStatus) {
|
|
8954
|
-
SelfieFlowStatus[SelfieFlowStatus["HowToSelfie"] = 0] = "HowToSelfie";
|
|
8955
|
-
SelfieFlowStatus[SelfieFlowStatus["Selfie"] = 1] = "Selfie";
|
|
8956
|
-
SelfieFlowStatus[SelfieFlowStatus["Gesture"] = 2] = "Gesture";
|
|
8957
|
-
SelfieFlowStatus[SelfieFlowStatus["End"] = 3] = "End";
|
|
8958
|
-
})(SelfieFlowStatus || (SelfieFlowStatus = {}));
|
|
8616
|
+
})(CaptureUploadTypes || (CaptureUploadTypes = {}));
|
|
8959
8617
|
|
|
8960
8618
|
const processIdCss = "";
|
|
8961
8619
|
|
|
@@ -8964,7 +8622,6 @@ const ProcessId = class {
|
|
|
8964
8622
|
registerInstance(this, hostRef);
|
|
8965
8623
|
this.apiErrorEvent = createEvent(this, "apiError", 7);
|
|
8966
8624
|
this.recordingResultCount = 0;
|
|
8967
|
-
this.captureStep = undefined;
|
|
8968
8625
|
this.showTimeout = undefined;
|
|
8969
8626
|
this.showInvalid = undefined;
|
|
8970
8627
|
this.flow = undefined;
|
|
@@ -8976,47 +8633,42 @@ const ProcessId = class {
|
|
|
8976
8633
|
this.initFlow();
|
|
8977
8634
|
}
|
|
8978
8635
|
initFlow() {
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
|
|
8994
|
-
|
|
8995
|
-
|
|
8996
|
-
|
|
8997
|
-
|
|
8998
|
-
|
|
8636
|
+
if (state.flowStatus == FlowStatus.IDFRONT) {
|
|
8637
|
+
this.flow = {
|
|
8638
|
+
capture: {
|
|
8639
|
+
fileName: 'idImage.png',
|
|
8640
|
+
recName: 'idVideo.',
|
|
8641
|
+
photoType: CaptureUploadTypes.IdFront,
|
|
8642
|
+
recType: CaptureUploadTypes.IdFrontVideo,
|
|
8643
|
+
},
|
|
8644
|
+
howToDone: false,
|
|
8645
|
+
};
|
|
8646
|
+
}
|
|
8647
|
+
else if (state.flowStatus == FlowStatus.IDBACK) {
|
|
8648
|
+
this.flow = {
|
|
8649
|
+
capture: {
|
|
8650
|
+
fileName: 'idBackImage.png',
|
|
8651
|
+
recName: 'idBackVideo.',
|
|
8652
|
+
photoType: CaptureUploadTypes.IdBack,
|
|
8653
|
+
recType: CaptureUploadTypes.IdBackVideo,
|
|
8654
|
+
},
|
|
8655
|
+
howToDone: false,
|
|
8999
8656
|
};
|
|
9000
8657
|
}
|
|
9001
|
-
if (state.
|
|
9002
|
-
this.flow
|
|
9003
|
-
|
|
9004
|
-
|
|
9005
|
-
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
|
|
8658
|
+
else if (state.flowStatus == FlowStatus.IDTILT) {
|
|
8659
|
+
this.flow = {
|
|
8660
|
+
capture: {
|
|
8661
|
+
fileName: 'idTiltImage.png',
|
|
8662
|
+
recName: 'idTiltVideo.',
|
|
8663
|
+
photoType: CaptureUploadTypes.None,
|
|
8664
|
+
recType: CaptureUploadTypes.TiltVideo,
|
|
8665
|
+
},
|
|
8666
|
+
howToDone: false,
|
|
9009
8667
|
};
|
|
9010
8668
|
}
|
|
9011
|
-
this.captureStep = IdCaptureFlowStatus.HowToFront;
|
|
9012
8669
|
}
|
|
9013
8670
|
howToDone() {
|
|
9014
|
-
|
|
9015
|
-
this.captureStep = IdCaptureFlowStatus.IdFront;
|
|
9016
|
-
}
|
|
9017
|
-
if (this.captureStep == IdCaptureFlowStatus.HowToBack) {
|
|
9018
|
-
this.captureStep = IdCaptureFlowStatus.IdBack;
|
|
9019
|
-
}
|
|
8671
|
+
this.flow.howToDone = true;
|
|
9020
8672
|
}
|
|
9021
8673
|
timeElapsed() {
|
|
9022
8674
|
this.showTimeout = true;
|
|
@@ -9037,25 +8689,11 @@ const ProcessId = class {
|
|
|
9037
8689
|
return;
|
|
9038
8690
|
}
|
|
9039
8691
|
try {
|
|
9040
|
-
let frontCapture = new File([idPhoto], this.flow.
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
this.apiErrorEvent.emit(e);
|
|
9046
|
-
}
|
|
9047
|
-
}
|
|
9048
|
-
async captureIdBackImage(event) {
|
|
9049
|
-
let idPhoto = event.detail;
|
|
9050
|
-
if (idPhoto.size == 0) {
|
|
9051
|
-
await this.baseComponent.apiCall.AddLog({ message: 'Empty id photo', blobData: idPhoto }, getLogMessage());
|
|
9052
|
-
this.triggerErrorFlow();
|
|
9053
|
-
return;
|
|
9054
|
-
}
|
|
9055
|
-
try {
|
|
9056
|
-
let backCapture = new File([idPhoto], this.flow.back.fileName, { type: 'image/png' });
|
|
9057
|
-
this.flow.back.photoDone = await this.uploadPhotos(this.flow.back.photoType, backCapture);
|
|
9058
|
-
await this.endFlow();
|
|
8692
|
+
let frontCapture = new File([idPhoto], this.flow.capture.fileName, { type: 'image/png' });
|
|
8693
|
+
let uploadPhotoDone = await this.uploadPhotos(this.flow.capture.photoType, frontCapture);
|
|
8694
|
+
if (!uploadPhotoDone) {
|
|
8695
|
+
this.triggerErrorFlow();
|
|
8696
|
+
}
|
|
9059
8697
|
}
|
|
9060
8698
|
catch (e) {
|
|
9061
8699
|
this.apiErrorEvent.emit(e);
|
|
@@ -9073,22 +8711,11 @@ const ProcessId = class {
|
|
|
9073
8711
|
return;
|
|
9074
8712
|
}
|
|
9075
8713
|
let mimeType = idRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
else if (this.captureStep == IdCaptureFlowStatus.IdBack) {
|
|
9081
|
-
let backRec = new File([idRecording], this.flow.back.recName + mimeType.extension, { type: mimeType.type });
|
|
9082
|
-
this.flow.back.recordingDone = await this.uploadRecording(this.flow.back.recType, backRec);
|
|
9083
|
-
}
|
|
9084
|
-
else if (this.captureStep == IdCaptureFlowStatus.Tilt) {
|
|
9085
|
-
let tiltRec = new File([idRecording], this.flow.tilt.recName + mimeType.extension, { type: mimeType.type });
|
|
9086
|
-
this.flow.tilt.recordingDone = await this.uploadRecording(this.flow.tilt.recType, tiltRec);
|
|
9087
|
-
}
|
|
9088
|
-
else {
|
|
9089
|
-
this.triggerErrorFlow(true);
|
|
8714
|
+
let captureRec = new File([idRecording], this.flow.capture.recName + mimeType.extension, { type: mimeType.type });
|
|
8715
|
+
let recordingUploaded = await this.uploadRecording(this.flow.capture.recType, captureRec);
|
|
8716
|
+
if (!recordingUploaded) {
|
|
8717
|
+
this.triggerErrorFlow();
|
|
9090
8718
|
}
|
|
9091
|
-
await this.endFlow();
|
|
9092
8719
|
this.recordingResultCount = 0;
|
|
9093
8720
|
}
|
|
9094
8721
|
async componentDidLoad() {
|
|
@@ -9121,72 +8748,9 @@ const ProcessId = class {
|
|
|
9121
8748
|
}
|
|
9122
8749
|
return false;
|
|
9123
8750
|
}
|
|
9124
|
-
triggerErrorFlow(
|
|
9125
|
-
if (this.captureStep == IdCaptureFlowStatus.IdBack) {
|
|
9126
|
-
restart = true;
|
|
9127
|
-
}
|
|
9128
|
-
if (restart) {
|
|
9129
|
-
this.initFlow();
|
|
9130
|
-
this.showInvalid = true;
|
|
9131
|
-
return;
|
|
9132
|
-
}
|
|
9133
|
-
if (this.captureStep == IdCaptureFlowStatus.IdFront) {
|
|
9134
|
-
this.flow.front.photoDone = false;
|
|
9135
|
-
this.flow.front.recordingDone = false;
|
|
9136
|
-
}
|
|
9137
|
-
if (this.captureStep == IdCaptureFlowStatus.IdBack) {
|
|
9138
|
-
this.flow.back.photoDone = false;
|
|
9139
|
-
this.flow.back.recordingDone = false;
|
|
9140
|
-
}
|
|
9141
|
-
if (this.captureStep == IdCaptureFlowStatus.Tilt) {
|
|
9142
|
-
this.flow.tilt.photoDone = true;
|
|
9143
|
-
this.flow.tilt.recordingDone = false;
|
|
9144
|
-
}
|
|
8751
|
+
triggerErrorFlow() {
|
|
9145
8752
|
this.showInvalid = true;
|
|
9146
8753
|
}
|
|
9147
|
-
async endFlow() {
|
|
9148
|
-
if (this.captureStep == IdCaptureFlowStatus.IdFront) {
|
|
9149
|
-
if (this.flow.front.photoDone && this.flow.front.recordingDone) {
|
|
9150
|
-
if (state.hasIdBack) {
|
|
9151
|
-
this.captureStep = IdCaptureFlowStatus.IdBack;
|
|
9152
|
-
}
|
|
9153
|
-
else if (state.hasIdTilt) {
|
|
9154
|
-
this.captureStep = IdCaptureFlowStatus.Tilt;
|
|
9155
|
-
}
|
|
9156
|
-
else {
|
|
9157
|
-
this.captureStep = IdCaptureFlowStatus.End;
|
|
9158
|
-
}
|
|
9159
|
-
}
|
|
9160
|
-
else {
|
|
9161
|
-
return;
|
|
9162
|
-
}
|
|
9163
|
-
}
|
|
9164
|
-
if (this.captureStep == IdCaptureFlowStatus.IdBack && state.hasIdBack) {
|
|
9165
|
-
if (this.flow.back.photoDone && this.flow.back.recordingDone) {
|
|
9166
|
-
if (state.hasIdTilt) {
|
|
9167
|
-
this.captureStep = IdCaptureFlowStatus.Tilt;
|
|
9168
|
-
}
|
|
9169
|
-
else {
|
|
9170
|
-
this.captureStep = IdCaptureFlowStatus.End;
|
|
9171
|
-
}
|
|
9172
|
-
}
|
|
9173
|
-
else {
|
|
9174
|
-
return;
|
|
9175
|
-
}
|
|
9176
|
-
}
|
|
9177
|
-
if (this.captureStep == IdCaptureFlowStatus.Tilt && state.hasIdTilt) {
|
|
9178
|
-
if (this.flow.tilt.photoDone && this.flow.tilt.recordingDone) {
|
|
9179
|
-
this.captureStep = IdCaptureFlowStatus.End;
|
|
9180
|
-
}
|
|
9181
|
-
else {
|
|
9182
|
-
return;
|
|
9183
|
-
}
|
|
9184
|
-
}
|
|
9185
|
-
if (this.captureStep != IdCaptureFlowStatus.End) {
|
|
9186
|
-
return;
|
|
9187
|
-
}
|
|
9188
|
-
state.flowStatus = FlowStatus.LIVENESS;
|
|
9189
|
-
}
|
|
9190
8754
|
async disconnectedCallback() {
|
|
9191
8755
|
await this.baseComponent.finalize();
|
|
9192
8756
|
}
|
|
@@ -9202,30 +8766,17 @@ const ProcessId = class {
|
|
|
9202
8766
|
}
|
|
9203
8767
|
render() {
|
|
9204
8768
|
let error = h("capture-error", { type: "ID" });
|
|
9205
|
-
let
|
|
9206
|
-
let
|
|
9207
|
-
let tiltCapture = h("id-tilt", null);
|
|
9208
|
-
let howToFront = h("how-to-info", { idSide: "front" });
|
|
9209
|
-
let howToBack = h("how-to-info", { idSide: "back" });
|
|
8769
|
+
let capture = h("id-capture", null);
|
|
8770
|
+
let howTo = h("how-to-info", null);
|
|
9210
8771
|
if (this.showInvalid || this.showTimeout) {
|
|
9211
8772
|
return error;
|
|
9212
8773
|
}
|
|
9213
|
-
if (
|
|
9214
|
-
return
|
|
9215
|
-
}
|
|
9216
|
-
if (this.captureStep == IdCaptureFlowStatus.HowToBack) {
|
|
9217
|
-
return howToBack;
|
|
9218
|
-
}
|
|
9219
|
-
if (this.captureStep == IdCaptureFlowStatus.IdFront) {
|
|
9220
|
-
return frontCapture;
|
|
9221
|
-
}
|
|
9222
|
-
if (this.captureStep == IdCaptureFlowStatus.IdBack) {
|
|
9223
|
-
return secondCapture;
|
|
8774
|
+
if (state.flowStatus != FlowStatus.IDTILT && this.flow.howToDone) {
|
|
8775
|
+
return howTo;
|
|
9224
8776
|
}
|
|
9225
|
-
|
|
9226
|
-
return
|
|
8777
|
+
else {
|
|
8778
|
+
return capture;
|
|
9227
8779
|
}
|
|
9228
|
-
return h("div", null);
|
|
9229
8780
|
}
|
|
9230
8781
|
};
|
|
9231
8782
|
ProcessId.style = processIdCss;
|
|
@@ -9233,31 +8784,23 @@ ProcessId.style = processIdCss;
|
|
|
9233
8784
|
const selfieCaptureCss = "";
|
|
9234
8785
|
|
|
9235
8786
|
const SelfieCapture = class {
|
|
9236
|
-
// @State() private animationPath: string;
|
|
9237
8787
|
constructor(hostRef) {
|
|
9238
8788
|
registerInstance(this, hostRef);
|
|
9239
8789
|
this.eventPhotoCapture = createEvent(this, "photoSelfieCapture", 7);
|
|
9240
8790
|
this.apiErrorEvent = createEvent(this, "apiError", 7);
|
|
9241
8791
|
this.eventTimeElapsed = createEvent(this, "timeElapsed", 7);
|
|
9242
|
-
this.photoIsReady = photos => {
|
|
9243
|
-
//this.closeCamera();
|
|
9244
|
-
this.eventPhotoCapture.emit(photos);
|
|
9245
|
-
};
|
|
9246
8792
|
this.videoStarted = undefined;
|
|
9247
8793
|
this.captureTaken = undefined;
|
|
9248
8794
|
this.verified = undefined;
|
|
9249
8795
|
this.titleMesage = undefined;
|
|
9250
8796
|
this.demoEnded = undefined;
|
|
9251
8797
|
this.demoVideo = undefined;
|
|
9252
|
-
this.uploadingLink = undefined;
|
|
9253
8798
|
this.captureHeight = undefined;
|
|
9254
8799
|
this.captureWidth = undefined;
|
|
9255
8800
|
this.captureTaken = false;
|
|
9256
8801
|
this.verified = false;
|
|
9257
8802
|
this.cameras = new Cameras();
|
|
9258
8803
|
this.demoEnded = false;
|
|
9259
|
-
this.uploadingLink = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_selfie.mp4';
|
|
9260
|
-
this.baseComponent = new BaseComponent(FlowSteps.SelfieCapture);
|
|
9261
8804
|
}
|
|
9262
8805
|
eventVideoStarted(event) {
|
|
9263
8806
|
this.videoStarted = true;
|
|
@@ -9275,8 +8818,20 @@ const SelfieCapture = class {
|
|
|
9275
8818
|
}
|
|
9276
8819
|
}
|
|
9277
8820
|
async componentDidLoad() {
|
|
9278
|
-
|
|
9279
|
-
|
|
8821
|
+
if (state.flowStatus == FlowStatus.LIVENESS) {
|
|
8822
|
+
this.verificationMode = VerificationMode.Full;
|
|
8823
|
+
this.currentStep = FlowSteps.SelfieCapture;
|
|
8824
|
+
this.mainStream = Stream.getNewInstance(this.verificationMode);
|
|
8825
|
+
this.demoVideo.src = SelfieCaptureValues.FacePoseDemoMapping[FacePose.Main];
|
|
8826
|
+
}
|
|
8827
|
+
else if (state.flowStatus == FlowStatus.LIVENESSGESTURE) {
|
|
8828
|
+
this.verificationMode = VerificationMode.Tilt;
|
|
8829
|
+
this.currentStep = FlowSteps.SelfieTilt;
|
|
8830
|
+
this.mainStream = Stream.getNewInstance(this.verificationMode);
|
|
8831
|
+
this.demoVideo.src = SelfieCaptureValues.FacePoseDemoMapping[this.mainStream.facePose];
|
|
8832
|
+
}
|
|
8833
|
+
this.baseComponent = new BaseComponent(this.currentStep);
|
|
8834
|
+
await this.baseComponent.logStep(this.currentStep, FlowMoments.Initialized);
|
|
9280
8835
|
this.demoVideo.play();
|
|
9281
8836
|
await delay(this.translations.GlobalValues.VideoLenght);
|
|
9282
8837
|
this.demoEnded = true;
|
|
@@ -9288,8 +8843,7 @@ const SelfieCapture = class {
|
|
|
9288
8843
|
navigator.mediaDevices
|
|
9289
8844
|
.getUserMedia(constraints)
|
|
9290
8845
|
.then(stream => {
|
|
9291
|
-
|
|
9292
|
-
superStream.initStream(stream);
|
|
8846
|
+
this.mainStream.initStream(stream);
|
|
9293
8847
|
})
|
|
9294
8848
|
.catch(e => {
|
|
9295
8849
|
this.closeCamera();
|
|
@@ -9298,8 +8852,8 @@ const SelfieCapture = class {
|
|
|
9298
8852
|
}, 100);
|
|
9299
8853
|
}
|
|
9300
8854
|
closeCamera() {
|
|
9301
|
-
if (
|
|
9302
|
-
|
|
8855
|
+
if (this.mainStream) {
|
|
8856
|
+
this.mainStream.dropStream();
|
|
9303
8857
|
}
|
|
9304
8858
|
}
|
|
9305
8859
|
disconnectedCallback() {
|
|
@@ -9311,14 +8865,14 @@ const SelfieCapture = class {
|
|
|
9311
8865
|
if (this.captureTaken)
|
|
9312
8866
|
return;
|
|
9313
8867
|
this.captureTaken = true;
|
|
9314
|
-
if (
|
|
9315
|
-
let res = await
|
|
9316
|
-
this.
|
|
8868
|
+
if (this.mainStream) {
|
|
8869
|
+
let res = await this.mainStream.takePhoto();
|
|
8870
|
+
this.eventPhotoCapture.emit(res);
|
|
9317
8871
|
}
|
|
9318
8872
|
else {
|
|
9319
8873
|
this.eventTimeElapsed.emit();
|
|
9320
8874
|
}
|
|
9321
|
-
await this.baseComponent.logStep(
|
|
8875
|
+
await this.baseComponent.logStep(this.currentStep, FlowMoments.Finalized);
|
|
9322
8876
|
}
|
|
9323
8877
|
async verificationFinished() {
|
|
9324
8878
|
if (this.verified)
|
|
@@ -9327,14 +8881,10 @@ const SelfieCapture = class {
|
|
|
9327
8881
|
this.titleMesage = this.translations.SelfieCaptureValues.Loading;
|
|
9328
8882
|
this.closeCamera();
|
|
9329
8883
|
this.demoEnded = false;
|
|
9330
|
-
|
|
9331
|
-
this.demoVideo.
|
|
9332
|
-
this.demoVideo.
|
|
9333
|
-
|
|
9334
|
-
loops++;
|
|
9335
|
-
this.demoVideo.play();
|
|
9336
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
9337
|
-
}
|
|
8884
|
+
this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_selfie.mp4';
|
|
8885
|
+
this.demoVideo.loop = true;
|
|
8886
|
+
this.demoVideo.play();
|
|
8887
|
+
await delay(10000);
|
|
9338
8888
|
this.eventTimeElapsed.emit();
|
|
9339
8889
|
}
|
|
9340
8890
|
render() {
|
|
@@ -9358,169 +8908,79 @@ const SelfieCapture = class {
|
|
|
9358
8908
|
};
|
|
9359
8909
|
SelfieCapture.style = selfieCaptureCss;
|
|
9360
8910
|
|
|
9361
|
-
const
|
|
8911
|
+
const smsCodeValidationCss = "";
|
|
9362
8912
|
|
|
9363
|
-
const
|
|
9364
|
-
// @State() private animationPath: string;
|
|
8913
|
+
const SmsCodeValidation = class {
|
|
9365
8914
|
constructor(hostRef) {
|
|
9366
8915
|
registerInstance(this, hostRef);
|
|
9367
|
-
this.eventPhotoCapture = createEvent(this, "photoSelfieTiltCapture", 7);
|
|
9368
8916
|
this.apiErrorEvent = createEvent(this, "apiError", 7);
|
|
9369
|
-
this.
|
|
9370
|
-
this.
|
|
9371
|
-
|
|
9372
|
-
|
|
9373
|
-
|
|
9374
|
-
this.
|
|
9375
|
-
this.
|
|
9376
|
-
this.verified = undefined;
|
|
9377
|
-
this.titleMesage = undefined;
|
|
9378
|
-
this.demoEnded = undefined;
|
|
9379
|
-
this.demoVideo = undefined;
|
|
9380
|
-
this.uploadingLink = undefined;
|
|
9381
|
-
this.captureHeight = undefined;
|
|
9382
|
-
this.captureWidth = undefined;
|
|
9383
|
-
this.captureTaken = false;
|
|
9384
|
-
this.verified = false;
|
|
9385
|
-
this.cameras = new Cameras();
|
|
9386
|
-
this.demoEnded = false;
|
|
9387
|
-
this.uploadingLink = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_selfie.mp4';
|
|
9388
|
-
this.baseComponent = new BaseComponent(FlowSteps.SelfieTilt);
|
|
9389
|
-
}
|
|
9390
|
-
eventVideoStarted(event) {
|
|
9391
|
-
this.videoStarted = true;
|
|
9392
|
-
var cameraSize = event.detail;
|
|
9393
|
-
var height = Math.round((cameraSize.width * 16) / 9);
|
|
9394
|
-
this.captureHeight = height - Math.round((window.screen.height - height) / 2);
|
|
9395
|
-
this.captureWidth = Math.round((this.captureHeight * 9) / 16);
|
|
8917
|
+
this.title = undefined;
|
|
8918
|
+
this.details = undefined;
|
|
8919
|
+
this.buttonText = undefined;
|
|
8920
|
+
this.code = undefined;
|
|
8921
|
+
this.canSend = false;
|
|
8922
|
+
this.baseComponent = new BaseComponent(FlowSteps.OtpCheck);
|
|
8923
|
+
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
9396
8924
|
}
|
|
9397
|
-
async
|
|
9398
|
-
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
|
|
8925
|
+
async doAction() {
|
|
8926
|
+
try {
|
|
8927
|
+
this.canSend = false;
|
|
8928
|
+
var codeChecked = await this.baseComponent.apiCall.CheckOTPCode(state.requestId, this.code);
|
|
8929
|
+
state.flowStatus = FlowStatus[codeChecked.status];
|
|
9403
8930
|
}
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
this.mainStream = Stream.getNewInstance(VerificationMode.Tilt);
|
|
9407
|
-
await this.baseComponent.logStep(FlowSteps.SelfieTilt, FlowMoments.Initialized);
|
|
9408
|
-
this.titleMesage = this.translations.SelfieCaptureValues.FacePoseMapping[this.mainStream.facePose];
|
|
9409
|
-
this.demoEnded = false;
|
|
9410
|
-
this.demoVideo.src = SelfieCaptureValues.FacePoseDemoMapping[this.mainStream.facePose];
|
|
9411
|
-
this.demoVideo.play();
|
|
9412
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
9413
|
-
this.demoEnded = true;
|
|
9414
|
-
this.openCamera();
|
|
9415
|
-
}
|
|
9416
|
-
async openCamera() {
|
|
9417
|
-
const constraints = this.cameras.GetConstraints('', state.device, true);
|
|
9418
|
-
setTimeout(() => {
|
|
9419
|
-
navigator.mediaDevices
|
|
9420
|
-
.getUserMedia(constraints)
|
|
9421
|
-
.then(stream => {
|
|
9422
|
-
this.mainStream.initStream(stream);
|
|
9423
|
-
})
|
|
9424
|
-
.catch(e => {
|
|
9425
|
-
this.closeCamera();
|
|
9426
|
-
this.apiErrorEvent.emit(e);
|
|
9427
|
-
});
|
|
9428
|
-
}, 100);
|
|
9429
|
-
}
|
|
9430
|
-
closeCamera() {
|
|
9431
|
-
if (this.mainStream) {
|
|
9432
|
-
this.mainStream.dropStream();
|
|
8931
|
+
catch (e) {
|
|
8932
|
+
this.apiErrorEvent.emit(e);
|
|
9433
8933
|
}
|
|
9434
8934
|
}
|
|
9435
|
-
disconnectedCallback() {
|
|
9436
|
-
this.
|
|
9437
|
-
Stream.instance = null;
|
|
9438
|
-
FaceML5Detector.instance = null;
|
|
8935
|
+
async disconnectedCallback() {
|
|
8936
|
+
await this.baseComponent.finalize();
|
|
9439
8937
|
}
|
|
9440
|
-
async
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
this.
|
|
9444
|
-
|
|
9445
|
-
this.photoIsReady(res);
|
|
9446
|
-
await this.baseComponent.logStep(FlowSteps.SelfieTilt, FlowMoments.Finalized);
|
|
8938
|
+
async componentWillRender() {
|
|
8939
|
+
this.translations = await Translations.getValues();
|
|
8940
|
+
this.title = this.translations.CodeValidationValues.Title;
|
|
8941
|
+
this.details = this.translations.CodeValidationValues.Description;
|
|
8942
|
+
this.buttonText = this.translations.CodeValidationValues.Button;
|
|
9447
8943
|
}
|
|
9448
|
-
async
|
|
9449
|
-
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
|
|
9453
|
-
this.
|
|
9454
|
-
this.
|
|
9455
|
-
|
|
9456
|
-
this.
|
|
9457
|
-
|
|
9458
|
-
while (loops < 7) {
|
|
9459
|
-
loops++;
|
|
9460
|
-
this.demoVideo.play();
|
|
9461
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
9462
|
-
}
|
|
9463
|
-
this.eventTimeElapsed.emit();
|
|
8944
|
+
async componentDidLoad() {
|
|
8945
|
+
await this.baseComponent.initialize();
|
|
8946
|
+
}
|
|
8947
|
+
handleChangeCode(ev) {
|
|
8948
|
+
let value = ev.target ? ev.target.value : '';
|
|
8949
|
+
this.code = value;
|
|
8950
|
+
if (this.code.length > 4)
|
|
8951
|
+
this.code = this.code.substring(0, 4);
|
|
8952
|
+
this.canSend = this.code.length == 4;
|
|
8953
|
+
ev.target.value = this.code;
|
|
9464
8954
|
}
|
|
9465
8955
|
render() {
|
|
9466
|
-
let
|
|
9467
|
-
if (state.
|
|
9468
|
-
|
|
9469
|
-
'width': this.captureWidth + 'px',
|
|
9470
|
-
'height': this.captureHeight + 'px',
|
|
9471
|
-
'overflow': 'hidden',
|
|
9472
|
-
'borderRadius': '10px',
|
|
9473
|
-
'text-align': 'center',
|
|
9474
|
-
'margin': 'auto',
|
|
9475
|
-
};
|
|
8956
|
+
let errorBlock;
|
|
8957
|
+
if (state.flowStatus == FlowStatus.CODEERROR) {
|
|
8958
|
+
errorBlock = h("p", { class: "main-text font-size-18 mt-15 color-red text-center" }, this.translations.CodeValidationValues.Error);
|
|
9476
8959
|
}
|
|
9477
|
-
|
|
9478
|
-
//let videoClass = this.device.isMobile ? '' : 'video-demo';
|
|
9479
|
-
let bgDemo = this.verified ? 'container' : 'container bg-black';
|
|
9480
|
-
return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.demoEnded }, h("video", { id: "howtoSelfie", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.demoEnded == false }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("camera-comp", { "capture-mode": "selfie" }))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))));
|
|
8960
|
+
return (h("div", { class: "container" }, h("div", { class: "row row-validare" }, h("div", null, h("h1", { class: "text-center" }, this.title), errorBlock == null ? h("p", { class: "main-text font-size-2 mt-15 mb-20 text-center" }, this.details) : errorBlock), h("div", { class: "input-container mb-15" }, h("input", { type: "text", id: "codeInput", class: "main-input", onInput: ev => this.handleChangeCode(ev), value: this.code })), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { id: "action", disabled: !this.canSend, class: "main-button", onClick: () => this.doAction() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
9481
8961
|
}
|
|
9482
|
-
get component() { return getElement(this); }
|
|
9483
8962
|
};
|
|
9484
|
-
|
|
8963
|
+
SmsCodeValidation.style = smsCodeValidationCss;
|
|
9485
8964
|
|
|
9486
|
-
const
|
|
8965
|
+
const smsSendCss = "";
|
|
9487
8966
|
|
|
9488
|
-
const
|
|
8967
|
+
const SmsSend = class {
|
|
9489
8968
|
constructor(hostRef) {
|
|
9490
8969
|
registerInstance(this, hostRef);
|
|
9491
8970
|
this.apiErrorEvent = createEvent(this, "apiError", 7);
|
|
9492
|
-
this.title = undefined;
|
|
9493
|
-
this.details = undefined;
|
|
9494
8971
|
this.buttonText = undefined;
|
|
9495
8972
|
this.phoneNumber = undefined;
|
|
9496
|
-
this.code = undefined;
|
|
9497
8973
|
this.prefilledPhone = false;
|
|
9498
8974
|
this.canSend = false;
|
|
9499
|
-
|
|
9500
|
-
this.baseComponent = new BaseComponent(FlowSteps.OtpSend);
|
|
9501
|
-
}
|
|
9502
|
-
if (state.flowStatus == FlowStatus.CODE) {
|
|
9503
|
-
this.baseComponent = new BaseComponent(FlowSteps.OtpCheck);
|
|
9504
|
-
}
|
|
8975
|
+
this.baseComponent = new BaseComponent(FlowSteps.OtpSend);
|
|
9505
8976
|
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
9506
8977
|
}
|
|
9507
8978
|
async doAction() {
|
|
9508
8979
|
try {
|
|
9509
8980
|
this.canSend = false;
|
|
9510
|
-
|
|
9511
|
-
|
|
9512
|
-
|
|
9513
|
-
state.flowStatus = FlowStatus.ID;
|
|
9514
|
-
}
|
|
9515
|
-
else {
|
|
9516
|
-
state.flowStatus = FlowStatus.CODEERROR;
|
|
9517
|
-
}
|
|
9518
|
-
}
|
|
9519
|
-
if (state.flowStatus == FlowStatus.PHONE) {
|
|
9520
|
-
var codeSent = await this.baseComponent.apiCall.SendOTPCode(state.requestId, this.phoneNumber);
|
|
9521
|
-
if (codeSent === true) {
|
|
9522
|
-
state.flowStatus = FlowStatus.CODE;
|
|
9523
|
-
}
|
|
8981
|
+
var codeSent = await this.baseComponent.apiCall.SendOTPCode(state.requestId, this.phoneNumber);
|
|
8982
|
+
if (codeSent.sent === true) {
|
|
8983
|
+
state.flowStatus = FlowStatus[codeSent.status];
|
|
9524
8984
|
}
|
|
9525
8985
|
}
|
|
9526
8986
|
catch (e) {
|
|
@@ -9532,20 +8992,11 @@ const SmsCodeValidation = class {
|
|
|
9532
8992
|
}
|
|
9533
8993
|
async componentWillRender() {
|
|
9534
8994
|
this.translations = await Translations.getValues();
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
this.
|
|
9538
|
-
this.
|
|
9539
|
-
|
|
9540
|
-
this.phoneNumber = state.phoneNumber;
|
|
9541
|
-
this.prefilledPhone = true;
|
|
9542
|
-
this.canSend = true;
|
|
9543
|
-
}
|
|
9544
|
-
}
|
|
9545
|
-
if (state.flowStatus == FlowStatus.CODE || state.flowStatus == FlowStatus.CODEERROR) {
|
|
9546
|
-
this.title = this.translations.CodeValidationValues.Title;
|
|
9547
|
-
this.details = this.translations.CodeValidationValues.Description;
|
|
9548
|
-
this.buttonText = this.translations.CodeValidationValues.Button;
|
|
8995
|
+
this.buttonText = this.translations.PhoneValidationValues.Button;
|
|
8996
|
+
if (state.phoneNumber && state.phoneNumber != '') {
|
|
8997
|
+
this.phoneNumber = state.phoneNumber;
|
|
8998
|
+
this.prefilledPhone = true;
|
|
8999
|
+
this.canSend = true;
|
|
9549
9000
|
}
|
|
9550
9001
|
}
|
|
9551
9002
|
async componentDidLoad() {
|
|
@@ -9559,30 +9010,11 @@ const SmsCodeValidation = class {
|
|
|
9559
9010
|
this.canSend = this.phoneNumber.length == 10;
|
|
9560
9011
|
ev.target.value = this.phoneNumber;
|
|
9561
9012
|
}
|
|
9562
|
-
handleChangeCode(ev) {
|
|
9563
|
-
let value = ev.target ? ev.target.value : '';
|
|
9564
|
-
this.code = value;
|
|
9565
|
-
if (this.code.length > 4)
|
|
9566
|
-
this.code = this.code.substring(0, 4);
|
|
9567
|
-
this.canSend = this.code.length == 4;
|
|
9568
|
-
ev.target.value = this.code;
|
|
9569
|
-
}
|
|
9570
9013
|
render() {
|
|
9571
|
-
|
|
9572
|
-
let errorBlock;
|
|
9573
|
-
if (state.flowStatus == FlowStatus.CODEERROR) {
|
|
9574
|
-
errorBlock = h("p", { class: "main-text font-size-18 mt-15 color-red text-center" }, this.translations.CodeValidationValues.Error);
|
|
9575
|
-
}
|
|
9576
|
-
if (state.flowStatus == FlowStatus.PHONE) {
|
|
9577
|
-
inputBlock = (h("div", { class: "input-container mb-15" }, h("label", { class: "font-size-18 mb-1" }, h("b", null, this.translations.PhoneValidationValues.Label)), h("input", { type: "tel", id: "phoneInput", class: "main-input", disabled: this.prefilledPhone, onInput: ev => this.handleChangePhone(ev), value: this.phoneNumber })));
|
|
9578
|
-
}
|
|
9579
|
-
else {
|
|
9580
|
-
inputBlock = (h("div", { class: "input-container mb-15" }, h("input", { type: "text", id: "codeInput", class: "main-input", onInput: ev => this.handleChangeCode(ev), value: this.code })));
|
|
9581
|
-
}
|
|
9582
|
-
return (h("div", { class: "container" }, h("div", { class: "row row-validare" }, h("div", null, h("h1", { class: "text-center" }, this.title), errorBlock == null ? h("p", { class: "main-text font-size-2 mt-15 mb-20 text-center" }, this.details) : errorBlock), inputBlock, h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { id: "action", disabled: !this.canSend, class: "main-button", onClick: () => this.doAction() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
9014
|
+
return (h("div", { class: "container" }, h("div", { class: "row row-validare" }, h("div", { class: "input-container mb-15" }, h("label", { class: "font-size-18 mb-1" }, h("b", null, this.translations.PhoneValidationValues.Label)), h("input", { type: "tel", id: "phoneInput", class: "main-input", disabled: this.prefilledPhone, onInput: ev => this.handleChangePhone(ev), value: this.phoneNumber })), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { id: "action", disabled: !this.canSend, class: "main-button", onClick: () => this.doAction() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
9583
9015
|
}
|
|
9584
9016
|
};
|
|
9585
|
-
|
|
9017
|
+
SmsSend.style = smsSendCss;
|
|
9586
9018
|
|
|
9587
9019
|
const userLivenessCss = "";
|
|
9588
9020
|
|
|
@@ -9593,57 +9025,51 @@ const UserLiveness = class {
|
|
|
9593
9025
|
this.recordingResultCount = 0;
|
|
9594
9026
|
this.recordingRetryCount = 0;
|
|
9595
9027
|
this.showError = undefined;
|
|
9596
|
-
this.captureStep = undefined;
|
|
9597
9028
|
this.flow = undefined;
|
|
9598
|
-
this.
|
|
9599
|
-
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
9029
|
+
this.howToDone = false;
|
|
9600
9030
|
}
|
|
9601
9031
|
async componentDidLoad() {
|
|
9602
9032
|
await this.baseComponent.initialize();
|
|
9603
9033
|
}
|
|
9604
9034
|
componentWillLoad() {
|
|
9605
|
-
|
|
9606
|
-
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
tilt: null,
|
|
9616
|
-
};
|
|
9617
|
-
if (state.hasSelfieGesture) {
|
|
9618
|
-
this.flow.tilt = {
|
|
9619
|
-
photoDone: true,
|
|
9620
|
-
recordingDone: false,
|
|
9621
|
-
fileName: '',
|
|
9622
|
-
recName: 'selfieTiltVideo.',
|
|
9623
|
-
photoType: CaptureUploadTypes.None,
|
|
9624
|
-
recType: CaptureUploadTypes.SelfieGestureVideo,
|
|
9035
|
+
if (state.flowStatus == FlowStatus.LIVENESS) {
|
|
9036
|
+
this.baseComponent = new BaseComponent(FlowSteps.Selfie);
|
|
9037
|
+
this.flow = {
|
|
9038
|
+
capture: {
|
|
9039
|
+
fileName: 'selfie.png',
|
|
9040
|
+
recName: 'selfieVideo.',
|
|
9041
|
+
photoType: CaptureUploadTypes.Selfie,
|
|
9042
|
+
recType: CaptureUploadTypes.SelfieVideo,
|
|
9043
|
+
},
|
|
9044
|
+
howToDone: false,
|
|
9625
9045
|
};
|
|
9626
9046
|
}
|
|
9627
|
-
|
|
9047
|
+
else if (state.flowStatus == FlowStatus.LIVENESSGESTURE) {
|
|
9048
|
+
this.baseComponent = new BaseComponent(FlowSteps.SelfieTilt);
|
|
9049
|
+
this.flow = {
|
|
9050
|
+
capture: {
|
|
9051
|
+
fileName: '',
|
|
9052
|
+
recName: 'selfieTiltVideo.',
|
|
9053
|
+
photoType: CaptureUploadTypes.None,
|
|
9054
|
+
recType: CaptureUploadTypes.SelfieGestureVideo,
|
|
9055
|
+
},
|
|
9056
|
+
howToDone: false,
|
|
9057
|
+
};
|
|
9058
|
+
}
|
|
9059
|
+
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
9628
9060
|
}
|
|
9629
|
-
|
|
9630
|
-
this.
|
|
9061
|
+
howToDoneEvent() {
|
|
9062
|
+
this.howToDone = true;
|
|
9631
9063
|
}
|
|
9632
9064
|
timeElapsed() {
|
|
9633
9065
|
this.showError = true;
|
|
9634
9066
|
}
|
|
9635
9067
|
captureErrorDone() {
|
|
9636
9068
|
this.showError = false;
|
|
9637
|
-
if (this.captureStep == SelfieFlowStatus.Selfie) {
|
|
9638
|
-
this.flow.front.photoDone = false;
|
|
9639
|
-
this.flow.front.recordingDone = false;
|
|
9640
|
-
}
|
|
9641
|
-
if (this.captureStep == SelfieFlowStatus.Gesture) {
|
|
9642
|
-
this.flow.tilt.photoDone = false;
|
|
9643
|
-
this.flow.tilt.recordingDone = false;
|
|
9644
|
-
}
|
|
9645
9069
|
}
|
|
9646
9070
|
async captureSelfieImage(event) {
|
|
9071
|
+
if (state.flowStatus == FlowStatus.LIVENESSGESTURE)
|
|
9072
|
+
return;
|
|
9647
9073
|
let selfiePhoto = event.detail;
|
|
9648
9074
|
if (selfiePhoto.size == 0) {
|
|
9649
9075
|
await this.baseComponent.apiCall.AddLog({ message: 'Empty selfie', blobData: selfiePhoto }, getLogMessage());
|
|
@@ -9651,8 +9077,11 @@ const UserLiveness = class {
|
|
|
9651
9077
|
return;
|
|
9652
9078
|
}
|
|
9653
9079
|
try {
|
|
9654
|
-
var uploadPhoto = new File([selfiePhoto], this.flow.
|
|
9655
|
-
await this.
|
|
9080
|
+
var uploadPhoto = new File([selfiePhoto], this.flow.capture.fileName, { type: 'image/png' });
|
|
9081
|
+
let photoUploaded = await this.baseComponent.apiCall.UploadFileForRequestB64(state.requestId, this.flow.capture.photoType, uploadPhoto);
|
|
9082
|
+
if (!photoUploaded) {
|
|
9083
|
+
this.triggerErrorFlow();
|
|
9084
|
+
}
|
|
9656
9085
|
}
|
|
9657
9086
|
catch (e) {
|
|
9658
9087
|
this.apiErrorEvent.emit(e);
|
|
@@ -9672,18 +9101,11 @@ const UserLiveness = class {
|
|
|
9672
9101
|
}
|
|
9673
9102
|
let mimeType = selfieRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
|
|
9674
9103
|
try {
|
|
9675
|
-
|
|
9676
|
-
|
|
9677
|
-
|
|
9678
|
-
}
|
|
9679
|
-
else if (this.captureStep == SelfieFlowStatus.Gesture) {
|
|
9680
|
-
let uploadRec = new File([selfieRecording], this.flow.tilt.recName + mimeType.extension, { type: mimeType.type });
|
|
9681
|
-
this.flow.tilt.recordingDone = await this.uploadRecording(uploadRec, this.flow.tilt.recType);
|
|
9682
|
-
}
|
|
9683
|
-
else {
|
|
9104
|
+
let uploadRec = new File([selfieRecording], this.flow.capture.recName + mimeType.extension, { type: mimeType.type });
|
|
9105
|
+
let uplodDone = await this.baseComponent.apiCall.UploadFileForRequestB64(state.requestId, this.flow.capture.recType, uploadRec);
|
|
9106
|
+
if (!uplodDone) {
|
|
9684
9107
|
this.triggerErrorFlow();
|
|
9685
9108
|
}
|
|
9686
|
-
this.endFlow();
|
|
9687
9109
|
}
|
|
9688
9110
|
catch (e) {
|
|
9689
9111
|
if (this.recordingRetryCount < 3) {
|
|
@@ -9695,84 +9117,27 @@ const UserLiveness = class {
|
|
|
9695
9117
|
}
|
|
9696
9118
|
}
|
|
9697
9119
|
}
|
|
9698
|
-
async verificationFinished(_event) {
|
|
9699
|
-
this.endFlow();
|
|
9700
|
-
}
|
|
9701
9120
|
async disconnectedCallback() {
|
|
9702
9121
|
await this.baseComponent.finalize();
|
|
9703
9122
|
}
|
|
9704
|
-
async uploadPhoto(photoFile, photoType) {
|
|
9705
|
-
if (this.flow.front.photoDone) {
|
|
9706
|
-
return;
|
|
9707
|
-
}
|
|
9708
|
-
this.flow.front.photoDone = await this.baseComponent.apiCall.UploadFileForRequestB64(state.requestId, photoType, photoFile);
|
|
9709
|
-
if (this.flow.front.photoDone) {
|
|
9710
|
-
this.endFlow();
|
|
9711
|
-
}
|
|
9712
|
-
else {
|
|
9713
|
-
this.triggerErrorFlow();
|
|
9714
|
-
}
|
|
9715
|
-
}
|
|
9716
|
-
async uploadRecording(uploadRec, recType) {
|
|
9717
|
-
let uplodDone = await this.baseComponent.apiCall.UploadFileForRequestB64(state.requestId, recType, uploadRec);
|
|
9718
|
-
if (uplodDone) {
|
|
9719
|
-
return true;
|
|
9720
|
-
}
|
|
9721
|
-
else {
|
|
9722
|
-
this.triggerErrorFlow();
|
|
9723
|
-
}
|
|
9724
|
-
return false;
|
|
9725
|
-
}
|
|
9726
9123
|
triggerErrorFlow() {
|
|
9727
9124
|
this.showError = true;
|
|
9728
9125
|
}
|
|
9729
|
-
endFlow() {
|
|
9730
|
-
if (this.captureStep == SelfieFlowStatus.Selfie) {
|
|
9731
|
-
if (this.flow.front.photoDone && this.flow.front.recordingDone) {
|
|
9732
|
-
if (state.hasSelfieGesture) {
|
|
9733
|
-
this.captureStep = SelfieFlowStatus.Gesture;
|
|
9734
|
-
}
|
|
9735
|
-
else {
|
|
9736
|
-
this.captureStep = SelfieFlowStatus.End;
|
|
9737
|
-
}
|
|
9738
|
-
}
|
|
9739
|
-
else {
|
|
9740
|
-
return;
|
|
9741
|
-
}
|
|
9742
|
-
}
|
|
9743
|
-
if (this.captureStep == SelfieFlowStatus.Gesture) {
|
|
9744
|
-
if (this.flow.tilt.photoDone && this.flow.tilt.recordingDone) {
|
|
9745
|
-
this.captureStep = SelfieFlowStatus.End;
|
|
9746
|
-
}
|
|
9747
|
-
else {
|
|
9748
|
-
return;
|
|
9749
|
-
}
|
|
9750
|
-
}
|
|
9751
|
-
if (this.captureStep != SelfieFlowStatus.End) {
|
|
9752
|
-
return;
|
|
9753
|
-
}
|
|
9754
|
-
state.flowStatus = FlowStatus.COMPLETE;
|
|
9755
|
-
}
|
|
9756
9126
|
render() {
|
|
9757
|
-
let howTo = h("how-to-info",
|
|
9758
|
-
let capture = h("selfie-capture",
|
|
9759
|
-
let tilt = h("selfie-tilt", { id: "camera" });
|
|
9127
|
+
let howTo = h("how-to-info", null);
|
|
9128
|
+
let capture = h("selfie-capture", null);
|
|
9760
9129
|
let error = h("capture-error", { type: "LIVENESS" });
|
|
9761
9130
|
if (this.showError) {
|
|
9762
9131
|
return error;
|
|
9763
9132
|
}
|
|
9764
|
-
if (this.
|
|
9765
|
-
return howTo;
|
|
9766
|
-
}
|
|
9767
|
-
if (this.captureStep == SelfieFlowStatus.Selfie) {
|
|
9133
|
+
if (this.howToDone) {
|
|
9768
9134
|
return capture;
|
|
9769
9135
|
}
|
|
9770
|
-
|
|
9771
|
-
return
|
|
9136
|
+
else {
|
|
9137
|
+
return howTo;
|
|
9772
9138
|
}
|
|
9773
|
-
return h("div", null);
|
|
9774
9139
|
}
|
|
9775
9140
|
};
|
|
9776
9141
|
UserLiveness.style = userLivenessCss;
|
|
9777
9142
|
|
|
9778
|
-
export { AgreementCheck as agreement_check, AgreementInfo as agreement_info, Camera as camera_comp, CameraError as camera_error, CaptureError as capture_error, EndRedirect as end_redirect, ErrorEnd as error_end, HowToInfo as how_to_info,
|
|
9143
|
+
export { AgreementCheck as agreement_check, AgreementInfo as agreement_info, Camera as camera_comp, CameraError as camera_error, CaptureError as capture_error, EndRedirect as end_redirect, ErrorEnd as error_end, HowToInfo as how_to_info, IdCapture as id_capture, IdentificationComponent as identification_component, LandingValidation as landing_validation, MobileRedirect as mobile_redirect, ProcessId as process_id, SelfieCapture as selfie_capture, SmsCodeValidation as sms_code_validation, SmsSend as sms_send, UserLiveness as user_liveness };
|