@ekyc_qoobiss/qbs-ect-cmp 3.6.47 → 3.6.49
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-4d5cefa6.js → TranslationUtils-22bb2d54.js} +7 -6
- package/dist/cjs/agreement-check_17.cjs.entry.js +13 -18
- package/dist/cjs/random-actions.cjs.entry.js +1 -1
- package/dist/collection/components/common/id-capture/id-capture.js +1 -1
- package/dist/collection/components/controls/camera/camera.js +4 -1
- package/dist/collection/components/flow/landing-validation/landing-validation.js +1 -7
- package/dist/collection/components/identification-component/identification-component.js +8 -8
- package/dist/collection/helpers/ApiCall.js +4 -3
- package/dist/collection/helpers/textValues.js +3 -3
- package/dist/esm/{TranslationUtils-0241074c.js → TranslationUtils-f13d895b.js} +7 -6
- package/dist/esm/agreement-check_17.entry.js +13 -18
- package/dist/esm/random-actions.entry.js +1 -1
- package/dist/qbs-ect-cmp/{p-70598bcb.entry.js → p-5ecc31ff.entry.js} +1 -1
- package/dist/qbs-ect-cmp/p-8dcaf6b9.js +1 -0
- package/dist/qbs-ect-cmp/{p-a0c579e7.entry.js → p-be72f5b6.entry.js} +2 -2
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/package.json +1 -1
- package/dist/qbs-ect-cmp/p-c10b126f.js +0 -1
|
@@ -255,7 +255,7 @@ SessionKeys.RefreshDoneKey = 'qbs-ect-refresh-done';
|
|
|
255
255
|
class ApiUrls {
|
|
256
256
|
constructor() {
|
|
257
257
|
this.uriEnv = '/';
|
|
258
|
-
this.uriEnv = state.environment
|
|
258
|
+
this.uriEnv = ['QA', 'DEMO'].includes(state.environment) ? '/dev_' : '/';
|
|
259
259
|
this.OtpSend = this.uriEnv + 'validation/otp/send';
|
|
260
260
|
this.OtpCheck = this.uriEnv + 'validation/otp/check';
|
|
261
261
|
this.IdentityInsert = this.uriEnv + 'validation/identity/insert';
|
|
@@ -269,8 +269,8 @@ class ApiUrls {
|
|
|
269
269
|
this.AbortRequest = this.uriEnv + 'validation/identity/abort';
|
|
270
270
|
this.Translations = this.uriEnv + 'validation/translations/get';
|
|
271
271
|
this.StartFlow = this.uriEnv + 'validation/flowstate/startflow';
|
|
272
|
-
this.NextFlowState = this.uriEnv + 'validation/flowstate/
|
|
273
|
-
this.CurrentFlowState = this.uriEnv + 'validation/flowstate/
|
|
272
|
+
this.NextFlowState = this.uriEnv + 'validation/flowstate/nextstate';
|
|
273
|
+
this.CurrentFlowState = this.uriEnv + 'validation/flowstate/currentstate';
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
|
|
@@ -486,6 +486,7 @@ class ApiCall {
|
|
|
486
486
|
redirectId: state.redirectId,
|
|
487
487
|
phoneNumber: state.phoneNumber,
|
|
488
488
|
version: version,
|
|
489
|
+
demoMode: state.environment == 'DEMO',
|
|
489
490
|
};
|
|
490
491
|
let jsonResp = await this.post(this.urls.IdentityInsert, JSON.stringify(data));
|
|
491
492
|
if (state.requestId == '') {
|
|
@@ -552,15 +553,15 @@ class ApiCall {
|
|
|
552
553
|
return result;
|
|
553
554
|
}
|
|
554
555
|
async LandingValidationStartFlow(cameraIsAccessible) {
|
|
555
|
-
let result = await this.post(this.urls.StartFlow, JSON.stringify({
|
|
556
|
+
let result = await this.post(this.urls.StartFlow, JSON.stringify({ requestId: state.requestId, cameraIsAccessible: cameraIsAccessible }));
|
|
556
557
|
return exports.FlowStatus[result.state];
|
|
557
558
|
}
|
|
558
559
|
async GetNextFlowState() {
|
|
559
|
-
let result = await this.get(this.urls.
|
|
560
|
+
let result = await this.get(this.urls.NextFlowState + '?requestId=' + state.requestId);
|
|
560
561
|
return exports.FlowStatus[result.state];
|
|
561
562
|
}
|
|
562
563
|
async GetFlowState() {
|
|
563
|
-
let result = await this.get(this.urls.CurrentFlowState + '?
|
|
564
|
+
let result = await this.get(this.urls.CurrentFlowState + '?requestId=' + state.requestId);
|
|
564
565
|
return exports.FlowStatus[result.state];
|
|
565
566
|
}
|
|
566
567
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-41696e0e.js');
|
|
6
|
-
const TranslationUtils = require('./TranslationUtils-
|
|
6
|
+
const TranslationUtils = require('./TranslationUtils-22bb2d54.js');
|
|
7
7
|
|
|
8
8
|
const agreementCheckCss = "";
|
|
9
9
|
|
|
@@ -4616,7 +4616,8 @@ const Camera = class {
|
|
|
4616
4616
|
return (index.h("div", { class: "camera" }, index.h("video", { id: "video", loop: true, autoplay: true, playsinline: true, muted: true, class: cameraVideoClass, ref: el => (this.cameraVideo = el) }), index.h("canvas", { id: "output", class: cameraCanvasClass, ref: el => (this.cameraCanvas = el) })));
|
|
4617
4617
|
}
|
|
4618
4618
|
startStream() {
|
|
4619
|
-
|
|
4619
|
+
let verificationMode = [TranslationUtils.FlowStatus.IDTILT, TranslationUtils.FlowStatus.LIVENESSGESTURE].includes(TranslationUtils.state.flowStatus) ? VerificationMode.Tilt : VerificationMode.Full;
|
|
4620
|
+
const stream = Stream.getNewInstance(verificationMode);
|
|
4620
4621
|
stream.updateHtmlElements(this.cameraVideo, this.cameraCanvas, this.component);
|
|
4621
4622
|
if (this.captureMode == 'selfie') {
|
|
4622
4623
|
stream.setFaceDetection(true);
|
|
@@ -4996,8 +4997,8 @@ const IdCapture = class {
|
|
|
4996
4997
|
}
|
|
4997
4998
|
}
|
|
4998
4999
|
async componentDidLoad() {
|
|
4999
|
-
await BaseComponent.logStep(this.flowStep, TranslationUtils.FlowMoments.Initialized);
|
|
5000
5000
|
this.initVariables();
|
|
5001
|
+
await BaseComponent.logStep(this.flowStep, TranslationUtils.FlowMoments.Initialized);
|
|
5001
5002
|
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDBACK) {
|
|
5002
5003
|
this.demoVideo.src = TranslationUtils.IdCaptureValues.IDPoseDemoMapping[IDPose.Rotate];
|
|
5003
5004
|
this.demoVideo.play();
|
|
@@ -5148,7 +5149,7 @@ function v4(options, buf, offset) {
|
|
|
5148
5149
|
}
|
|
5149
5150
|
|
|
5150
5151
|
const name = "@ekyc_qoobiss/qbs-ect-cmp";
|
|
5151
|
-
const version$1 = "3.6.
|
|
5152
|
+
const version$1 = "3.6.49";
|
|
5152
5153
|
const description = "Person Identification Component";
|
|
5153
5154
|
const main = "./dist/index.cjs.js";
|
|
5154
5155
|
const module$1 = "./dist/index.js";
|
|
@@ -5364,7 +5365,6 @@ const IdentificationComponent = class {
|
|
|
5364
5365
|
this.lang_iso = undefined;
|
|
5365
5366
|
this.errorMessage = undefined;
|
|
5366
5367
|
this.errorTitle = undefined;
|
|
5367
|
-
TranslationUtils.ApiCall.getInstance();
|
|
5368
5368
|
}
|
|
5369
5369
|
async componentWillLoad() {
|
|
5370
5370
|
Events.init(window);
|
|
@@ -5373,6 +5373,7 @@ const IdentificationComponent = class {
|
|
|
5373
5373
|
if (this.env && this.env != '') {
|
|
5374
5374
|
TranslationUtils.state.environment = this.env;
|
|
5375
5375
|
}
|
|
5376
|
+
TranslationUtils.ApiCall.getInstance();
|
|
5376
5377
|
if (TranslationUtils.state.debug)
|
|
5377
5378
|
this.logInit = getLogMessage(this.order_id, this.redirect_id, this.token);
|
|
5378
5379
|
if (this.token) {
|
|
@@ -5386,6 +5387,9 @@ const IdentificationComponent = class {
|
|
|
5386
5387
|
if (TranslationUtils.state.debug)
|
|
5387
5388
|
console.log('Store Token set with session value: ' + TranslationUtils.state.token);
|
|
5388
5389
|
}
|
|
5390
|
+
if (!TranslationUtils.state.token) {
|
|
5391
|
+
await delay(2000);
|
|
5392
|
+
}
|
|
5389
5393
|
if (this.redirect_id) {
|
|
5390
5394
|
TranslationUtils.state.redirectId = this.redirect_id;
|
|
5391
5395
|
}
|
|
@@ -5423,9 +5427,6 @@ const IdentificationComponent = class {
|
|
|
5423
5427
|
return;
|
|
5424
5428
|
}
|
|
5425
5429
|
this.initialised = true;
|
|
5426
|
-
if (TranslationUtils.state.environment == 'DEMO') {
|
|
5427
|
-
return;
|
|
5428
|
-
}
|
|
5429
5430
|
if (!TranslationUtils.state.device) {
|
|
5430
5431
|
TranslationUtils.state.device = new DeviceDetection().getDevice();
|
|
5431
5432
|
}
|
|
@@ -5439,7 +5440,7 @@ const IdentificationComponent = class {
|
|
|
5439
5440
|
}
|
|
5440
5441
|
catch (_a) { }
|
|
5441
5442
|
try {
|
|
5442
|
-
if (!TranslationUtils.state.device.isMobile && TranslationUtils.state.redirectId == '') {
|
|
5443
|
+
if (!TranslationUtils.state.device.isMobile && TranslationUtils.state.redirectId == '' && TranslationUtils.state.environment != 'DEMO') {
|
|
5443
5444
|
TranslationUtils.state.redirectId = v4();
|
|
5444
5445
|
this.redirect_id = TranslationUtils.state.redirectId;
|
|
5445
5446
|
}
|
|
@@ -5478,10 +5479,10 @@ const IdentificationComponent = class {
|
|
|
5478
5479
|
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.CODEERROR) {
|
|
5479
5480
|
currentBlock = index.h("sms-code-validation", null);
|
|
5480
5481
|
}
|
|
5481
|
-
if (
|
|
5482
|
+
if ([TranslationUtils.FlowStatus.IDFRONT, TranslationUtils.FlowStatus.IDBACK, TranslationUtils.FlowStatus.IDTILT].includes(TranslationUtils.state.flowStatus)) {
|
|
5482
5483
|
currentBlock = index.h("process-id", null);
|
|
5483
5484
|
}
|
|
5484
|
-
if (
|
|
5485
|
+
if ([TranslationUtils.FlowStatus.LIVENESS, TranslationUtils.FlowStatus.LIVENESSGESTURE].includes(TranslationUtils.state.flowStatus)) {
|
|
5485
5486
|
currentBlock = index.h("user-liveness", null);
|
|
5486
5487
|
}
|
|
5487
5488
|
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.COMPLETE) {
|
|
@@ -5520,9 +5521,7 @@ const LandingValidation = class {
|
|
|
5520
5521
|
await this.initRequest();
|
|
5521
5522
|
}
|
|
5522
5523
|
async componentDidLoad() {
|
|
5523
|
-
|
|
5524
|
-
await BaseComponent.initialize(TranslationUtils.FlowSteps.Landing);
|
|
5525
|
-
}
|
|
5524
|
+
await BaseComponent.initialize(TranslationUtils.FlowSteps.Landing);
|
|
5526
5525
|
}
|
|
5527
5526
|
async initRequest() {
|
|
5528
5527
|
this.warningText = this.translations.LandingValues.Warning;
|
|
@@ -5530,10 +5529,6 @@ const LandingValidation = class {
|
|
|
5530
5529
|
async startFlow() {
|
|
5531
5530
|
if (!this.buttonDisabled) {
|
|
5532
5531
|
this.buttonDisabled = true;
|
|
5533
|
-
if (TranslationUtils.state.environment === 'DEMO') {
|
|
5534
|
-
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus.COMPLETE;
|
|
5535
|
-
return;
|
|
5536
|
-
}
|
|
5537
5532
|
var cameraIsAccessible = await Cameras.InitCameras(TranslationUtils.state.device);
|
|
5538
5533
|
if (!cameraIsAccessible) {
|
|
5539
5534
|
if (TranslationUtils.state.device.mobileOS == MobileOS.iOS)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-41696e0e.js');
|
|
6
|
-
const TranslationUtils = require('./TranslationUtils-
|
|
6
|
+
const TranslationUtils = require('./TranslationUtils-22bb2d54.js');
|
|
7
7
|
|
|
8
8
|
const randomActionsCss = "";
|
|
9
9
|
|
|
@@ -62,8 +62,8 @@ export class IdCapture {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
async componentDidLoad() {
|
|
65
|
-
await BaseComponent.logStep(this.flowStep, FlowMoments.Initialized);
|
|
66
65
|
this.initVariables();
|
|
66
|
+
await BaseComponent.logStep(this.flowStep, FlowMoments.Initialized);
|
|
67
67
|
if (store.flowStatus == FlowStatus.IDBACK) {
|
|
68
68
|
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Rotate];
|
|
69
69
|
this.demoVideo.play();
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Stream } from '../../../helpers/Stream';
|
|
2
2
|
import { h } from '@stencil/core';
|
|
3
3
|
import store from '../../../helpers/store';
|
|
4
|
+
import { FlowStatus } from '../../../models/FlowStatus';
|
|
5
|
+
import { VerificationMode } from '../../../models/IVerificationMode';
|
|
4
6
|
// import { PipelineResult } from '../../../libs/FaceDetector/PipelineResult';
|
|
5
7
|
export class Camera {
|
|
6
8
|
constructor() {
|
|
@@ -46,7 +48,8 @@ export class Camera {
|
|
|
46
48
|
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) })));
|
|
47
49
|
}
|
|
48
50
|
startStream() {
|
|
49
|
-
|
|
51
|
+
let verificationMode = [FlowStatus.IDTILT, FlowStatus.LIVENESSGESTURE].includes(store.flowStatus) ? VerificationMode.Tilt : VerificationMode.Full;
|
|
52
|
+
const stream = Stream.getNewInstance(verificationMode);
|
|
50
53
|
stream.updateHtmlElements(this.cameraVideo, this.cameraCanvas, this.component);
|
|
51
54
|
if (this.captureMode == 'selfie') {
|
|
52
55
|
stream.setFaceDetection(true);
|
|
@@ -26,9 +26,7 @@ export class LandingValidation {
|
|
|
26
26
|
await this.initRequest();
|
|
27
27
|
}
|
|
28
28
|
async componentDidLoad() {
|
|
29
|
-
|
|
30
|
-
await BaseComponent.initialize(FlowSteps.Landing);
|
|
31
|
-
}
|
|
29
|
+
await BaseComponent.initialize(FlowSteps.Landing);
|
|
32
30
|
}
|
|
33
31
|
async initRequest() {
|
|
34
32
|
this.warningText = this.translations.LandingValues.Warning;
|
|
@@ -36,10 +34,6 @@ export class LandingValidation {
|
|
|
36
34
|
async startFlow() {
|
|
37
35
|
if (!this.buttonDisabled) {
|
|
38
36
|
this.buttonDisabled = true;
|
|
39
|
-
if (store.environment === 'DEMO') {
|
|
40
|
-
store.flowStatus = FlowStatus.COMPLETE;
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
37
|
var cameraIsAccessible = await Cameras.InitCameras(store.device);
|
|
44
38
|
if (!cameraIsAccessible) {
|
|
45
39
|
if (store.device.mobileOS == MobileOS.iOS)
|
|
@@ -6,7 +6,7 @@ import { FlowStatus } from '../../models/FlowStatus';
|
|
|
6
6
|
import Events from '../../helpers/Events';
|
|
7
7
|
import * as uuid from 'uuid';
|
|
8
8
|
import packageJson from '../../../package.json';
|
|
9
|
-
import { getLogMessage } from '../../utils/utils';
|
|
9
|
+
import { delay, getLogMessage } from '../../utils/utils';
|
|
10
10
|
import { Browser } from '../../models/IDevice';
|
|
11
11
|
import { FlowMoments, FlowSteps } from '../../models/FlowSteps';
|
|
12
12
|
// @ts-ignore
|
|
@@ -75,7 +75,6 @@ export class IdentificationComponent {
|
|
|
75
75
|
this.lang_iso = undefined;
|
|
76
76
|
this.errorMessage = undefined;
|
|
77
77
|
this.errorTitle = undefined;
|
|
78
|
-
ApiCall.getInstance();
|
|
79
78
|
}
|
|
80
79
|
async componentWillLoad() {
|
|
81
80
|
Events.init(window);
|
|
@@ -84,6 +83,7 @@ export class IdentificationComponent {
|
|
|
84
83
|
if (this.env && this.env != '') {
|
|
85
84
|
store.environment = this.env;
|
|
86
85
|
}
|
|
86
|
+
ApiCall.getInstance();
|
|
87
87
|
if (store.debug)
|
|
88
88
|
this.logInit = getLogMessage(this.order_id, this.redirect_id, this.token);
|
|
89
89
|
if (this.token) {
|
|
@@ -97,6 +97,9 @@ export class IdentificationComponent {
|
|
|
97
97
|
if (store.debug)
|
|
98
98
|
console.log('Store Token set with session value: ' + store.token);
|
|
99
99
|
}
|
|
100
|
+
if (!store.token) {
|
|
101
|
+
await delay(2000);
|
|
102
|
+
}
|
|
100
103
|
if (this.redirect_id) {
|
|
101
104
|
store.redirectId = this.redirect_id;
|
|
102
105
|
}
|
|
@@ -134,9 +137,6 @@ export class IdentificationComponent {
|
|
|
134
137
|
return;
|
|
135
138
|
}
|
|
136
139
|
this.initialised = true;
|
|
137
|
-
if (store.environment == 'DEMO') {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
140
|
if (!store.device) {
|
|
141
141
|
store.device = new DeviceDetection().getDevice();
|
|
142
142
|
}
|
|
@@ -150,7 +150,7 @@ export class IdentificationComponent {
|
|
|
150
150
|
}
|
|
151
151
|
catch (_a) { }
|
|
152
152
|
try {
|
|
153
|
-
if (!store.device.isMobile && store.redirectId == '') {
|
|
153
|
+
if (!store.device.isMobile && store.redirectId == '' && store.environment != 'DEMO') {
|
|
154
154
|
store.redirectId = uuid.v4();
|
|
155
155
|
this.redirect_id = store.redirectId;
|
|
156
156
|
}
|
|
@@ -189,10 +189,10 @@ export class IdentificationComponent {
|
|
|
189
189
|
if (store.flowStatus == FlowStatus.CODEERROR) {
|
|
190
190
|
currentBlock = h("sms-code-validation", null);
|
|
191
191
|
}
|
|
192
|
-
if (
|
|
192
|
+
if ([FlowStatus.IDFRONT, FlowStatus.IDBACK, FlowStatus.IDTILT].includes(store.flowStatus)) {
|
|
193
193
|
currentBlock = h("process-id", null);
|
|
194
194
|
}
|
|
195
|
-
if (
|
|
195
|
+
if ([FlowStatus.LIVENESS, FlowStatus.LIVENESSGESTURE].includes(store.flowStatus)) {
|
|
196
196
|
currentBlock = h("user-liveness", null);
|
|
197
197
|
}
|
|
198
198
|
if (store.flowStatus == FlowStatus.COMPLETE) {
|
|
@@ -156,6 +156,7 @@ export class ApiCall {
|
|
|
156
156
|
redirectId: store.redirectId,
|
|
157
157
|
phoneNumber: store.phoneNumber,
|
|
158
158
|
version: version,
|
|
159
|
+
demoMode: store.environment == 'DEMO',
|
|
159
160
|
};
|
|
160
161
|
let jsonResp = await this.post(this.urls.IdentityInsert, JSON.stringify(data));
|
|
161
162
|
if (store.requestId == '') {
|
|
@@ -222,15 +223,15 @@ export class ApiCall {
|
|
|
222
223
|
return result;
|
|
223
224
|
}
|
|
224
225
|
async LandingValidationStartFlow(cameraIsAccessible) {
|
|
225
|
-
let result = await this.post(this.urls.StartFlow, JSON.stringify({
|
|
226
|
+
let result = await this.post(this.urls.StartFlow, JSON.stringify({ requestId: store.requestId, cameraIsAccessible: cameraIsAccessible }));
|
|
226
227
|
return FlowStatus[result.state];
|
|
227
228
|
}
|
|
228
229
|
async GetNextFlowState() {
|
|
229
|
-
let result = await this.get(this.urls.
|
|
230
|
+
let result = await this.get(this.urls.NextFlowState + '?requestId=' + store.requestId);
|
|
230
231
|
return FlowStatus[result.state];
|
|
231
232
|
}
|
|
232
233
|
async GetFlowState() {
|
|
233
|
-
let result = await this.get(this.urls.CurrentFlowState + '?
|
|
234
|
+
let result = await this.get(this.urls.CurrentFlowState + '?requestId=' + store.requestId);
|
|
234
235
|
return FlowStatus[result.state];
|
|
235
236
|
}
|
|
236
237
|
}
|
|
@@ -32,7 +32,7 @@ SessionKeys.RefreshDoneKey = 'qbs-ect-refresh-done';
|
|
|
32
32
|
export class ApiUrls {
|
|
33
33
|
constructor() {
|
|
34
34
|
this.uriEnv = '/';
|
|
35
|
-
this.uriEnv = store.environment
|
|
35
|
+
this.uriEnv = ['QA', 'DEMO'].includes(store.environment) ? '/dev_' : '/';
|
|
36
36
|
this.OtpSend = this.uriEnv + 'validation/otp/send';
|
|
37
37
|
this.OtpCheck = this.uriEnv + 'validation/otp/check';
|
|
38
38
|
this.IdentityInsert = this.uriEnv + 'validation/identity/insert';
|
|
@@ -46,7 +46,7 @@ export class ApiUrls {
|
|
|
46
46
|
this.AbortRequest = this.uriEnv + 'validation/identity/abort';
|
|
47
47
|
this.Translations = this.uriEnv + 'validation/translations/get';
|
|
48
48
|
this.StartFlow = this.uriEnv + 'validation/flowstate/startflow';
|
|
49
|
-
this.NextFlowState = this.uriEnv + 'validation/flowstate/
|
|
50
|
-
this.CurrentFlowState = this.uriEnv + 'validation/flowstate/
|
|
49
|
+
this.NextFlowState = this.uriEnv + 'validation/flowstate/nextstate';
|
|
50
|
+
this.CurrentFlowState = this.uriEnv + 'validation/flowstate/currentstate';
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -253,7 +253,7 @@ SessionKeys.RefreshDoneKey = 'qbs-ect-refresh-done';
|
|
|
253
253
|
class ApiUrls {
|
|
254
254
|
constructor() {
|
|
255
255
|
this.uriEnv = '/';
|
|
256
|
-
this.uriEnv = state.environment
|
|
256
|
+
this.uriEnv = ['QA', 'DEMO'].includes(state.environment) ? '/dev_' : '/';
|
|
257
257
|
this.OtpSend = this.uriEnv + 'validation/otp/send';
|
|
258
258
|
this.OtpCheck = this.uriEnv + 'validation/otp/check';
|
|
259
259
|
this.IdentityInsert = this.uriEnv + 'validation/identity/insert';
|
|
@@ -267,8 +267,8 @@ class ApiUrls {
|
|
|
267
267
|
this.AbortRequest = this.uriEnv + 'validation/identity/abort';
|
|
268
268
|
this.Translations = this.uriEnv + 'validation/translations/get';
|
|
269
269
|
this.StartFlow = this.uriEnv + 'validation/flowstate/startflow';
|
|
270
|
-
this.NextFlowState = this.uriEnv + 'validation/flowstate/
|
|
271
|
-
this.CurrentFlowState = this.uriEnv + 'validation/flowstate/
|
|
270
|
+
this.NextFlowState = this.uriEnv + 'validation/flowstate/nextstate';
|
|
271
|
+
this.CurrentFlowState = this.uriEnv + 'validation/flowstate/currentstate';
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
|
|
@@ -484,6 +484,7 @@ class ApiCall {
|
|
|
484
484
|
redirectId: state.redirectId,
|
|
485
485
|
phoneNumber: state.phoneNumber,
|
|
486
486
|
version: version,
|
|
487
|
+
demoMode: state.environment == 'DEMO',
|
|
487
488
|
};
|
|
488
489
|
let jsonResp = await this.post(this.urls.IdentityInsert, JSON.stringify(data));
|
|
489
490
|
if (state.requestId == '') {
|
|
@@ -550,15 +551,15 @@ class ApiCall {
|
|
|
550
551
|
return result;
|
|
551
552
|
}
|
|
552
553
|
async LandingValidationStartFlow(cameraIsAccessible) {
|
|
553
|
-
let result = await this.post(this.urls.StartFlow, JSON.stringify({
|
|
554
|
+
let result = await this.post(this.urls.StartFlow, JSON.stringify({ requestId: state.requestId, cameraIsAccessible: cameraIsAccessible }));
|
|
554
555
|
return FlowStatus[result.state];
|
|
555
556
|
}
|
|
556
557
|
async GetNextFlowState() {
|
|
557
|
-
let result = await this.get(this.urls.
|
|
558
|
+
let result = await this.get(this.urls.NextFlowState + '?requestId=' + state.requestId);
|
|
558
559
|
return FlowStatus[result.state];
|
|
559
560
|
}
|
|
560
561
|
async GetFlowState() {
|
|
561
|
-
let result = await this.get(this.urls.CurrentFlowState + '?
|
|
562
|
+
let result = await this.get(this.urls.CurrentFlowState + '?requestId=' + state.requestId);
|
|
562
563
|
return FlowStatus[result.state];
|
|
563
564
|
}
|
|
564
565
|
}
|
|
@@ -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, T as Translations, F as FlowMoments, a as FlowSteps, s as state, S as SessionKeys, b as FlowStatus, I as IdCaptureValues, O as OrderStatuses, c as SelfieCaptureValues } from './TranslationUtils-
|
|
2
|
+
import { A as ApiCall, T as Translations, F as FlowMoments, a as FlowSteps, s as state, S as SessionKeys, b as FlowStatus, I as IdCaptureValues, O as OrderStatuses, c as SelfieCaptureValues } from './TranslationUtils-f13d895b.js';
|
|
3
3
|
|
|
4
4
|
const agreementCheckCss = "";
|
|
5
5
|
|
|
@@ -4612,7 +4612,8 @@ const Camera = class {
|
|
|
4612
4612
|
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) })));
|
|
4613
4613
|
}
|
|
4614
4614
|
startStream() {
|
|
4615
|
-
|
|
4615
|
+
let verificationMode = [FlowStatus.IDTILT, FlowStatus.LIVENESSGESTURE].includes(state.flowStatus) ? VerificationMode.Tilt : VerificationMode.Full;
|
|
4616
|
+
const stream = Stream.getNewInstance(verificationMode);
|
|
4616
4617
|
stream.updateHtmlElements(this.cameraVideo, this.cameraCanvas, this.component);
|
|
4617
4618
|
if (this.captureMode == 'selfie') {
|
|
4618
4619
|
stream.setFaceDetection(true);
|
|
@@ -4992,8 +4993,8 @@ const IdCapture = class {
|
|
|
4992
4993
|
}
|
|
4993
4994
|
}
|
|
4994
4995
|
async componentDidLoad() {
|
|
4995
|
-
await BaseComponent.logStep(this.flowStep, FlowMoments.Initialized);
|
|
4996
4996
|
this.initVariables();
|
|
4997
|
+
await BaseComponent.logStep(this.flowStep, FlowMoments.Initialized);
|
|
4997
4998
|
if (state.flowStatus == FlowStatus.IDBACK) {
|
|
4998
4999
|
this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Rotate];
|
|
4999
5000
|
this.demoVideo.play();
|
|
@@ -5144,7 +5145,7 @@ function v4(options, buf, offset) {
|
|
|
5144
5145
|
}
|
|
5145
5146
|
|
|
5146
5147
|
const name = "@ekyc_qoobiss/qbs-ect-cmp";
|
|
5147
|
-
const version$1 = "3.6.
|
|
5148
|
+
const version$1 = "3.6.49";
|
|
5148
5149
|
const description = "Person Identification Component";
|
|
5149
5150
|
const main = "./dist/index.cjs.js";
|
|
5150
5151
|
const module = "./dist/index.js";
|
|
@@ -5360,7 +5361,6 @@ const IdentificationComponent = class {
|
|
|
5360
5361
|
this.lang_iso = undefined;
|
|
5361
5362
|
this.errorMessage = undefined;
|
|
5362
5363
|
this.errorTitle = undefined;
|
|
5363
|
-
ApiCall.getInstance();
|
|
5364
5364
|
}
|
|
5365
5365
|
async componentWillLoad() {
|
|
5366
5366
|
Events.init(window);
|
|
@@ -5369,6 +5369,7 @@ const IdentificationComponent = class {
|
|
|
5369
5369
|
if (this.env && this.env != '') {
|
|
5370
5370
|
state.environment = this.env;
|
|
5371
5371
|
}
|
|
5372
|
+
ApiCall.getInstance();
|
|
5372
5373
|
if (state.debug)
|
|
5373
5374
|
this.logInit = getLogMessage(this.order_id, this.redirect_id, this.token);
|
|
5374
5375
|
if (this.token) {
|
|
@@ -5382,6 +5383,9 @@ const IdentificationComponent = class {
|
|
|
5382
5383
|
if (state.debug)
|
|
5383
5384
|
console.log('Store Token set with session value: ' + state.token);
|
|
5384
5385
|
}
|
|
5386
|
+
if (!state.token) {
|
|
5387
|
+
await delay(2000);
|
|
5388
|
+
}
|
|
5385
5389
|
if (this.redirect_id) {
|
|
5386
5390
|
state.redirectId = this.redirect_id;
|
|
5387
5391
|
}
|
|
@@ -5419,9 +5423,6 @@ const IdentificationComponent = class {
|
|
|
5419
5423
|
return;
|
|
5420
5424
|
}
|
|
5421
5425
|
this.initialised = true;
|
|
5422
|
-
if (state.environment == 'DEMO') {
|
|
5423
|
-
return;
|
|
5424
|
-
}
|
|
5425
5426
|
if (!state.device) {
|
|
5426
5427
|
state.device = new DeviceDetection().getDevice();
|
|
5427
5428
|
}
|
|
@@ -5435,7 +5436,7 @@ const IdentificationComponent = class {
|
|
|
5435
5436
|
}
|
|
5436
5437
|
catch (_a) { }
|
|
5437
5438
|
try {
|
|
5438
|
-
if (!state.device.isMobile && state.redirectId == '') {
|
|
5439
|
+
if (!state.device.isMobile && state.redirectId == '' && state.environment != 'DEMO') {
|
|
5439
5440
|
state.redirectId = v4();
|
|
5440
5441
|
this.redirect_id = state.redirectId;
|
|
5441
5442
|
}
|
|
@@ -5474,10 +5475,10 @@ const IdentificationComponent = class {
|
|
|
5474
5475
|
if (state.flowStatus == FlowStatus.CODEERROR) {
|
|
5475
5476
|
currentBlock = h("sms-code-validation", null);
|
|
5476
5477
|
}
|
|
5477
|
-
if (
|
|
5478
|
+
if ([FlowStatus.IDFRONT, FlowStatus.IDBACK, FlowStatus.IDTILT].includes(state.flowStatus)) {
|
|
5478
5479
|
currentBlock = h("process-id", null);
|
|
5479
5480
|
}
|
|
5480
|
-
if (
|
|
5481
|
+
if ([FlowStatus.LIVENESS, FlowStatus.LIVENESSGESTURE].includes(state.flowStatus)) {
|
|
5481
5482
|
currentBlock = h("user-liveness", null);
|
|
5482
5483
|
}
|
|
5483
5484
|
if (state.flowStatus == FlowStatus.COMPLETE) {
|
|
@@ -5516,9 +5517,7 @@ const LandingValidation = class {
|
|
|
5516
5517
|
await this.initRequest();
|
|
5517
5518
|
}
|
|
5518
5519
|
async componentDidLoad() {
|
|
5519
|
-
|
|
5520
|
-
await BaseComponent.initialize(FlowSteps.Landing);
|
|
5521
|
-
}
|
|
5520
|
+
await BaseComponent.initialize(FlowSteps.Landing);
|
|
5522
5521
|
}
|
|
5523
5522
|
async initRequest() {
|
|
5524
5523
|
this.warningText = this.translations.LandingValues.Warning;
|
|
@@ -5526,10 +5525,6 @@ const LandingValidation = class {
|
|
|
5526
5525
|
async startFlow() {
|
|
5527
5526
|
if (!this.buttonDisabled) {
|
|
5528
5527
|
this.buttonDisabled = true;
|
|
5529
|
-
if (state.environment === 'DEMO') {
|
|
5530
|
-
state.flowStatus = FlowStatus.COMPLETE;
|
|
5531
|
-
return;
|
|
5532
|
-
}
|
|
5533
5528
|
var cameraIsAccessible = await Cameras.InitCameras(state.device);
|
|
5534
5529
|
if (!cameraIsAccessible) {
|
|
5535
5530
|
if (state.device.mobileOS == MobileOS.iOS)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as s}from"./p-8942656c.js";import{T as i}from"./p-
|
|
1
|
+
import{r as t,h as s}from"./p-8942656c.js";import{T as i}from"./p-8dcaf6b9.js";const o=class{constructor(s){t(this,s)}async componentWillLoad(){this.translations=await i.getValues()}buttonClick(){}render(){return s("div",{class:"container"},s("div",{class:"row"},s("div",{class:"text-center"},s("h1",null,this.topTitle)),s("div",{class:"pos-relative show-bottom"},s("div",{class:"btn-buletin"},s("button",{class:"main-button",onClick:()=>this.buttonClick()},this.buttonText),s("p",{class:"main-text font-size-18 text-right mb-0"},this.translations.GlobalValues.FooterText)))))}};o.style="";export{o as random_actions}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t,f as e}from"./p-8942656c.js";var i;!function(t){t[t.Capturing=0]="Capturing",t[t.FinishedCapturing=1]="FinishedCapturing",t[t.Waiting=2]="Waiting",t[t.NotFound=3]="NotFound",t[t.Aborted=4]="Aborted"}(i||(i={}));const s=t=>!("isConnected"in t)||t.isConnected,n=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys())t.set(e,t.get(e).filter(s))})(...e)}),2e3)}})(),a=t=>"function"==typeof t?t():t;var o;!function(t){t[t.LANDING=0]="LANDING",t[t.MOBILE=1]="MOBILE",t[t.AGREEMENT=2]="AGREEMENT",t[t.PHONE=3]="PHONE",t[t.CODE=4]="CODE",t[t.CODEERROR=5]="CODEERROR",t[t.IDFRONT=6]="IDFRONT",t[t.IDBACK=7]="IDBACK",t[t.IDTILT=8]="IDTILT",t[t.LIVENESS=9]="LIVENESS",t[t.LIVENESSGESTURE=10]="LIVENESSGESTURE",t[t.COMPLETE=11]="COMPLETE",t[t.ERROREND=12]="ERROREND",t[t.CAMERAERROR=13]="CAMERAERROR",t[t.ABORTED=14]="ABORTED",t[t.NONE=15]="NONE"}(o||(o={}));class r{}r.IDPoseDemoMapping={0:"https://ekyc.blob.core.windows.net/$web/animations/id/id_front.mp4",1:"https://ekyc.blob.core.windows.net/$web/animations/id/id_front_tilt.mp4",2:"https://ekyc.blob.core.windows.net/$web/animations/id/id_rotate.mp4",3:"https://ekyc.blob.core.windows.net/$web/animations/id/id_back.mp4",4:"https://ekyc.blob.core.windows.net/$web/animations/id/id_back_tilt.mp4"};class c{}c.FacePoseDemoMapping={0:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_rotate_left.mp4",1:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_rotate_right.mp4",2:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_tilt_back.mp4",3:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_tilt_front.mp4",4:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_main.mp4"};class d{}d.FlowStatusKey="qbs-ect-flowstatus",d.RequestIdKey="qbs-ect-requestid",d.TokenKey="qbs-ect-token",d.InitialisedKey="qbs-ect-initialised",d.HasIdBackKey="qbs-ect-has-id-back",d.AgreementValidationKey="qbs-ect-agreement-validation",d.PhoneValidationKey="qbs-ect-phone-validation",d.RefreshDoneKey="qbs-ect-refresh-done";class h{constructor(){this.uriEnv="/",this.uriEnv=["QA","DEMO"].includes(l.environment)?"/dev_":"/",this.OtpSend=this.uriEnv+"validation/otp/send",this.OtpCheck=this.uriEnv+"validation/otp/check",this.IdentityInsert=this.uriEnv+"validation/identity/insert",this.UploadCapture=this.uriEnv+"validation/upload/capture",this.GetAgreement=this.uriEnv+"validation/agreement/content",this.GenerateAgreement=this.uriEnv+"validation/agreement/generate",this.SendLink=this.uriEnv+"validation/otp/sendlink",this.GetStatus=this.uriEnv+"validation/identity/status",this.AddLog=this.uriEnv+"validation/logs/add",this.AddStep=this.uriEnv+"validation/logs/step",this.AbortRequest=this.uriEnv+"validation/identity/abort",this.Translations=this.uriEnv+"validation/translations/get",this.StartFlow=this.uriEnv+"validation/flowstate/startflow",this.NextFlowState=this.uriEnv+"validation/flowstate/nextstate",this.CurrentFlowState=this.uriEnv+"validation/flowstate/currentstate"}}const{state:l,onChange:u}=(()=>{const i=((t,e=((t,e)=>t!==e))=>{const i=a(t);let s=new Map(Object.entries(null!=i?i:{}));const n={dispose:[],get:[],set:[],reset:[]},o=()=>{var e;s=new Map(Object.entries(null!==(e=a(t))&&void 0!==e?e:{})),n.reset.forEach((t=>t()))},r=t=>(n.get.forEach((e=>e(t))),s.get(t)),c=(t,i)=>{const a=s.get(t);e(i,a,t)&&(s.set(t,i),n.set.forEach((e=>e(t,i,a))))},d="undefined"==typeof Proxy?{}:new Proxy(i,{get:(t,e)=>r(e),ownKeys:()=>Array.from(s.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>s.has(e),set:(t,e,i)=>(c(e,i),!0)}),h=(t,e)=>(n[t].push(e),()=>{((t,e)=>{const i=t.indexOf(e);i>=0&&(t[i]=t[t.length-1],t.length--)})(n[t],e)});return{state:d,get:r,set:c,on:h,onChange:(e,i)=>{const s=h("set",((t,s)=>{t===e&&i(s)})),n=h("reset",(()=>i(a(t)[e])));return()=>{s(),n()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(h("set",e.set)),e.get&&t.push(h("get",e.get)),e.reset&&t.push(h("reset",e.reset)),e.dispose&&t.push(h("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{n.dispose.forEach((t=>t())),o()},reset:o,forceUpdate:t=>{const e=s.get(t);n.set.forEach((i=>i(t,e,e)))}}})({flowStatus:o.NONE,environment:"PROD",debug:!1,requestId:"",redirectId:"",token:"",cameraIds:[],cameraId:"",phoneNumber:"",apiBaseUrl:"https://apiro.id-kyc.com",device:null,langIso:"ro"},void 0);return i.use((()=>{if("function"!=typeof t)return{};const i=new Map;return{dispose:()=>i.clear(),get:e=>{const s=t();s&&((t,e,i)=>{const s=t.get(e);s?s.includes(i)||s.push(i):t.set(e,[i])})(i,e,s)},set:t=>{const s=i.get(t);s&&i.set(t,s.filter(e)),n(i)},reset:()=>{i.forEach((t=>t.forEach(e))),n(i)}}})()),i})();var w,p;u("environment",(t=>{l.debug="QA"==t})),u("flowStatus",(t=>{sessionStorage.setItem(d.FlowStatusKey,o[t])})),u("token",(t=>{sessionStorage.setItem(d.TokenKey,t)})),u("requestId",(t=>{sessionStorage.setItem(d.RequestIdKey,t)})),function(t){t[t.ComponentLoaded="component-loaded"]="ComponentLoaded",t[t.MobileRedirect="mobile-redirect"]="MobileRedirect",t[t.Landing="landing"]="Landing",t[t.Agreements="agreements"]="Agreements",t[t.OtpSend="otp-send"]="OtpSend",t[t.OtpCheck="otp-check"]="OtpCheck",t[t.CiFront="ci-front"]="CiFront",t[t.CiFrontHowTo="ci-front-how-to"]="CiFrontHowTo",t[t.CiFrontCapture="ci-front-capture"]="CiFrontCapture",t[t.CiBack="ci-back"]="CiBack",t[t.CiBackHowTo="ci-back-how-to"]="CiBackHowTo",t[t.CiBackCapture="ci-back-capture"]="CiBackCapture",t[t.CiTilt="ci-tilt"]="CiTilt",t[t.CiError="ci-error"]="CiError",t[t.SelfieHowTo="selfie-how-to"]="SelfieHowTo",t[t.SelfieTilt="selfie-tilt"]="SelfieTilt",t[t.SelfieCapture="selfie-capture"]="SelfieCapture",t[t.Selfie="selfie"]="Selfie",t[t.SelfieError="selfie-error"]="SelfieError",t[t.End="end"]="End",t[t.CameraError="camera-error"]="CameraError",t[t.Default="default"]="Default"}(w||(w={})),function(t){t[t.Initialized="initialized"]="Initialized",t[t.Finalized="finalized"]="Finalized",t[t.None="none"]="None"}(p||(p={}));class f{static getInstance(){return f.instance||(f.instance=new f),f.instance}constructor(){this.serviceErrors=["Service Unavailable","Unauthorized"],this.toBase64=t=>new Promise(((e,i)=>{const s=new FileReader;s.readAsDataURL(t),s.onload=()=>e(s.result),s.onerror=t=>i(t)})),this.urls=new h}async http(t){const e=await fetch(t);if(!e.ok)throw new Error(e.statusText);try{return await e.json()}catch(t){throw new Error("No json found in response "+t)}}async post(t,e,i=!0){var s=new Request(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});try{return await this.http(s)}catch(s){if(!i||this.serviceErrors.includes(s.message))throw s;this.AddLog("Error in post ",s);try{var n=new Request(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(n)}catch(i){this.AddLog("Error in post ",i);var a=new Request(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(a)}}}async get(t,e=!0){var i=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});try{return await this.http(i)}catch(i){if(!e||this.serviceErrors.includes(i.message))throw i;this.AddLog("Error in get ",i);try{var s=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(s)}catch(e){this.AddLog("Error in get ",e);var n=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(n)}}}async SendOTPCode(t,e){let i={requestId:t,phone:e};return await this.post(this.urls.OtpSend,JSON.stringify(i))}async CheckOTPCode(t,e){let i={requestId:t,otp:e};return await this.post(this.urls.OtpCheck,JSON.stringify(i))}async AddIdentificationRequest(t,e){l.debug&&console.log("Calling identity request with store:"+JSON.stringify(l));let i={requestId:l.requestId,clientDeviceInfo:JSON.stringify(t),redirectId:l.redirectId,phoneNumber:l.phoneNumber,version:e,demoMode:"DEMO"==l.environment},s=await this.post(this.urls.IdentityInsert,JSON.stringify(i));return""==l.requestId&&(l.requestId=s.requestId),l.phoneNumber=s.phoneNumber,l.flowStatus=o[s.state],!0}async UploadFileForRequestB64(t,e,i){let s={requestId:t,type:e,data:await this.toBase64(i)},n=await this.post(this.urls.UploadCapture,JSON.stringify(s));return l.flowStatus=o[n.state],!(e in["IdFront","IdBack","Selfie"])||n.isValid}async GetAgreement(t){return(await this.get(this.urls.GetAgreement+"?type="+t+"&requestId="+l.requestId)).htmlText}async GenerateAgreement(t){let e={requestId:l.requestId,documentType:t};return(await this.post(this.urls.GenerateAgreement,JSON.stringify(e))).generation}async GetStatus(t){let e=await this.get(this.urls.GetStatus+"?orderId="+t);return i[e.status]}async SendLink(t,e){let i={requestId:l.requestId,link:t,phoneNumber:e};return(await this.post(this.urls.SendLink,JSON.stringify(i))).sent}async AddLog(t,e){try{let i={requestId:l.requestId,action:o[l.flowStatus],message:JSON.stringify({error:t,context:e})};return(await this.post(this.urls.AddLog,JSON.stringify(i),!1)).saved}catch(t){}}async AddStep(t,e){let i={requestId:l.requestId,redirectId:l.redirectId,step:w[t],moment:p[e],timestamp:(new Date).toISOString()};return(await this.post(this.urls.AddStep,JSON.stringify(i))).saved}async AbortRequest(){return await this.post(this.urls.AbortRequest,JSON.stringify({requestId:l.requestId}))}async GetTranslations(t){return await this.get(this.urls.Translations+"?langIso="+t)}async LandingValidationStartFlow(t){let e=await this.post(this.urls.StartFlow,JSON.stringify({requestId:l.requestId,cameraIsAccessible:t}));return o[e.state]}async GetNextFlowState(){let t=await this.get(this.urls.NextFlowState+"?requestId="+l.requestId);return o[t.state]}async GetFlowState(){let t=await this.get(this.urls.CurrentFlowState+"?requestId="+l.requestId);return o[t.state]}}const b=new class{async getValues(){return this.values||(this.values=await this.fetchTranslations()),this.values}getLocale(t=document.body){if(l.langIso&&""!=l.langIso)return l.langIso;{const e=t.closest("[lang]");return e?e.lang:"ro"}}async fetchTranslations(){const t=this.getLocale();try{const e=(new f).GetTranslations(t);if(e)return e}catch(e){return console.error(`Error loading locale: ${t}`,e),null}}};export{f as A,p as F,r as I,i as O,d as S,b as T,w as a,o as b,c,l as s}
|