@ekyc_qoobiss/qbs-ect-cmp 2.1.13 → 2.1.14
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/agreement-check_18.cjs.entry.js +133 -120
- package/dist/collection/components/common/camera-error/camera-error.js +16 -1
- package/dist/collection/components/flow/landing-validation/landing-validation.js +1 -2
- package/dist/esm/agreement-check_18.entry.js +133 -120
- package/dist/qbs-ect-cmp/{p-f5655e72.entry.js → p-0166a7f2.entry.js} +1 -1
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/package.json +1 -1
|
@@ -5171,6 +5171,122 @@ const Camera = class {
|
|
|
5171
5171
|
};
|
|
5172
5172
|
Camera.style = cameraCss;
|
|
5173
5173
|
|
|
5174
|
+
class Cameras {
|
|
5175
|
+
async GetCameras(deviceInfo) {
|
|
5176
|
+
var allDevices = [];
|
|
5177
|
+
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
5178
|
+
const videoDevices = devices.filter(device => device.kind === 'videoinput');
|
|
5179
|
+
for (const device of videoDevices) {
|
|
5180
|
+
const updatedConstraints = this.GetConstraints(device.deviceId, deviceInfo);
|
|
5181
|
+
const stream = await navigator.mediaDevices.getUserMedia(updatedConstraints);
|
|
5182
|
+
stream.getVideoTracks().forEach(track => {
|
|
5183
|
+
if (deviceInfo.isFirefox) {
|
|
5184
|
+
const settings = track.getSettings();
|
|
5185
|
+
let facingMode = settings.facingMode && settings.facingMode.length > 0 ? settings.facingMode[0] : '';
|
|
5186
|
+
facingMode = facingMode === 'e' ? 'environment' : facingMode;
|
|
5187
|
+
allDevices.push({
|
|
5188
|
+
deviceId: device.deviceId,
|
|
5189
|
+
name: device.label,
|
|
5190
|
+
height: settings.height,
|
|
5191
|
+
width: settings.width,
|
|
5192
|
+
frameRate: Number(settings.frameRate.max),
|
|
5193
|
+
torch: false,
|
|
5194
|
+
recommended: false,
|
|
5195
|
+
facingMode: facingMode,
|
|
5196
|
+
});
|
|
5197
|
+
}
|
|
5198
|
+
else {
|
|
5199
|
+
const capabilities = track.getCapabilities();
|
|
5200
|
+
let facingMode = capabilities.facingMode && capabilities.facingMode.length > 0 ? capabilities.facingMode[0] : '';
|
|
5201
|
+
facingMode = facingMode === 'e' ? 'environment' : facingMode;
|
|
5202
|
+
allDevices.push({
|
|
5203
|
+
deviceId: device.deviceId,
|
|
5204
|
+
name: device.label,
|
|
5205
|
+
height: capabilities.height.max,
|
|
5206
|
+
width: capabilities.width.max,
|
|
5207
|
+
frameRate: Number(capabilities.frameRate.max),
|
|
5208
|
+
torch: capabilities.torch,
|
|
5209
|
+
recommended: false,
|
|
5210
|
+
facingMode: facingMode,
|
|
5211
|
+
});
|
|
5212
|
+
}
|
|
5213
|
+
});
|
|
5214
|
+
stream.getTracks().forEach(track => {
|
|
5215
|
+
track.stop();
|
|
5216
|
+
});
|
|
5217
|
+
}
|
|
5218
|
+
if (allDevices.length > 0) {
|
|
5219
|
+
allDevices = allDevices.sort((a, b) => b.frameRate - a.frameRate);
|
|
5220
|
+
var firstOption = allDevices.find(i => i.name.indexOf('0,') != -1 && i.facingMode === 'environment');
|
|
5221
|
+
if (firstOption) {
|
|
5222
|
+
allDevices[allDevices.indexOf(firstOption)].recommended = true;
|
|
5223
|
+
}
|
|
5224
|
+
else {
|
|
5225
|
+
var firstEnv = allDevices.find(i => i.facingMode === 'environment');
|
|
5226
|
+
if (firstEnv) {
|
|
5227
|
+
allDevices[allDevices.indexOf(firstEnv)].recommended = true;
|
|
5228
|
+
}
|
|
5229
|
+
}
|
|
5230
|
+
}
|
|
5231
|
+
return allDevices;
|
|
5232
|
+
}
|
|
5233
|
+
GetConstraints(selectedDeviceId, device, portrait = false) {
|
|
5234
|
+
let constraints = {
|
|
5235
|
+
audio: false,
|
|
5236
|
+
video: {
|
|
5237
|
+
frameRate: 30,
|
|
5238
|
+
},
|
|
5239
|
+
};
|
|
5240
|
+
if (selectedDeviceId) {
|
|
5241
|
+
constraints.video.deviceId = {
|
|
5242
|
+
exact: selectedDeviceId,
|
|
5243
|
+
};
|
|
5244
|
+
}
|
|
5245
|
+
if (device.isWin) {
|
|
5246
|
+
constraints.video.width = { ideal: 1280 };
|
|
5247
|
+
}
|
|
5248
|
+
else {
|
|
5249
|
+
if (portrait) {
|
|
5250
|
+
constraints.video.facingMode = 'user';
|
|
5251
|
+
constraints.video.width = { ideal: 1280 };
|
|
5252
|
+
constraints.video.height = { ideal: 720 };
|
|
5253
|
+
}
|
|
5254
|
+
else {
|
|
5255
|
+
constraints.video.facingMode = 'environment';
|
|
5256
|
+
constraints.video.width = { ideal: 1280 };
|
|
5257
|
+
constraints.video.aspectRatio = 1;
|
|
5258
|
+
}
|
|
5259
|
+
}
|
|
5260
|
+
return constraints;
|
|
5261
|
+
}
|
|
5262
|
+
GetRecommendedCamera(cameras) {
|
|
5263
|
+
if (cameras && cameras.length > 0) {
|
|
5264
|
+
var recommDevice = cameras.find(c => c.recommended);
|
|
5265
|
+
if (recommDevice) {
|
|
5266
|
+
return recommDevice;
|
|
5267
|
+
}
|
|
5268
|
+
}
|
|
5269
|
+
return null;
|
|
5270
|
+
}
|
|
5271
|
+
static async InitCameras(device) {
|
|
5272
|
+
try {
|
|
5273
|
+
let cam = new Cameras();
|
|
5274
|
+
let cameras = await cam.GetCameras(device);
|
|
5275
|
+
var recommCamera = cam.GetRecommendedCamera(cameras);
|
|
5276
|
+
state.cameraIds = cameras.map(camera => camera.deviceId);
|
|
5277
|
+
state.cameraId = recommCamera.deviceId;
|
|
5278
|
+
return true;
|
|
5279
|
+
}
|
|
5280
|
+
catch (e) {
|
|
5281
|
+
console.log(e);
|
|
5282
|
+
if (e.message.includes('Permission denied') || e.name.includes('NotAllowedError')) {
|
|
5283
|
+
return false;
|
|
5284
|
+
}
|
|
5285
|
+
throw e;
|
|
5286
|
+
}
|
|
5287
|
+
}
|
|
5288
|
+
}
|
|
5289
|
+
|
|
5174
5290
|
const cameraErrorCss = "";
|
|
5175
5291
|
|
|
5176
5292
|
const CameraError = class {
|
|
@@ -5205,7 +5321,21 @@ const CameraError = class {
|
|
|
5205
5321
|
}
|
|
5206
5322
|
async buttonClick() {
|
|
5207
5323
|
this.buttonDisabled = true;
|
|
5208
|
-
|
|
5324
|
+
if (this.device.isIos) {
|
|
5325
|
+
window.location.reload();
|
|
5326
|
+
}
|
|
5327
|
+
if (!(await Cameras.InitCameras(this.device))) {
|
|
5328
|
+
this.buttonDisabled = false;
|
|
5329
|
+
}
|
|
5330
|
+
else if (state.agreementsValidation) {
|
|
5331
|
+
state.flowStatus = FlowStatus.AGREEMENT;
|
|
5332
|
+
}
|
|
5333
|
+
else if (state.phoneValidation) {
|
|
5334
|
+
state.flowStatus = FlowStatus.PHONE;
|
|
5335
|
+
}
|
|
5336
|
+
else {
|
|
5337
|
+
state.flowStatus = FlowStatus.ID;
|
|
5338
|
+
}
|
|
5209
5339
|
}
|
|
5210
5340
|
render() {
|
|
5211
5341
|
return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("h1", { class: "color-red" }, this.title), index.h("div", null, index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.description)), index.h("div", { hidden: this.device.isIos }, index.h("video", { id: "howtoPermissions", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", type: "button", disabled: this.buttonDisabled, onClick: () => this.buttonClick() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, CameraErrorValues.FooterText))))));
|
|
@@ -5395,122 +5525,6 @@ const HowToInfo = class {
|
|
|
5395
5525
|
};
|
|
5396
5526
|
HowToInfo.style = howToInfoCss;
|
|
5397
5527
|
|
|
5398
|
-
class Cameras {
|
|
5399
|
-
async GetCameras(deviceInfo) {
|
|
5400
|
-
var allDevices = [];
|
|
5401
|
-
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
5402
|
-
const videoDevices = devices.filter(device => device.kind === 'videoinput');
|
|
5403
|
-
for (const device of videoDevices) {
|
|
5404
|
-
const updatedConstraints = this.GetConstraints(device.deviceId, deviceInfo);
|
|
5405
|
-
const stream = await navigator.mediaDevices.getUserMedia(updatedConstraints);
|
|
5406
|
-
stream.getVideoTracks().forEach(track => {
|
|
5407
|
-
if (deviceInfo.isFirefox) {
|
|
5408
|
-
const settings = track.getSettings();
|
|
5409
|
-
let facingMode = settings.facingMode && settings.facingMode.length > 0 ? settings.facingMode[0] : '';
|
|
5410
|
-
facingMode = facingMode === 'e' ? 'environment' : facingMode;
|
|
5411
|
-
allDevices.push({
|
|
5412
|
-
deviceId: device.deviceId,
|
|
5413
|
-
name: device.label,
|
|
5414
|
-
height: settings.height,
|
|
5415
|
-
width: settings.width,
|
|
5416
|
-
frameRate: Number(settings.frameRate.max),
|
|
5417
|
-
torch: false,
|
|
5418
|
-
recommended: false,
|
|
5419
|
-
facingMode: facingMode,
|
|
5420
|
-
});
|
|
5421
|
-
}
|
|
5422
|
-
else {
|
|
5423
|
-
const capabilities = track.getCapabilities();
|
|
5424
|
-
let facingMode = capabilities.facingMode && capabilities.facingMode.length > 0 ? capabilities.facingMode[0] : '';
|
|
5425
|
-
facingMode = facingMode === 'e' ? 'environment' : facingMode;
|
|
5426
|
-
allDevices.push({
|
|
5427
|
-
deviceId: device.deviceId,
|
|
5428
|
-
name: device.label,
|
|
5429
|
-
height: capabilities.height.max,
|
|
5430
|
-
width: capabilities.width.max,
|
|
5431
|
-
frameRate: Number(capabilities.frameRate.max),
|
|
5432
|
-
torch: capabilities.torch,
|
|
5433
|
-
recommended: false,
|
|
5434
|
-
facingMode: facingMode,
|
|
5435
|
-
});
|
|
5436
|
-
}
|
|
5437
|
-
});
|
|
5438
|
-
stream.getTracks().forEach(track => {
|
|
5439
|
-
track.stop();
|
|
5440
|
-
});
|
|
5441
|
-
}
|
|
5442
|
-
if (allDevices.length > 0) {
|
|
5443
|
-
allDevices = allDevices.sort((a, b) => b.frameRate - a.frameRate);
|
|
5444
|
-
var firstOption = allDevices.find(i => i.name.indexOf('0,') != -1 && i.facingMode === 'environment');
|
|
5445
|
-
if (firstOption) {
|
|
5446
|
-
allDevices[allDevices.indexOf(firstOption)].recommended = true;
|
|
5447
|
-
}
|
|
5448
|
-
else {
|
|
5449
|
-
var firstEnv = allDevices.find(i => i.facingMode === 'environment');
|
|
5450
|
-
if (firstEnv) {
|
|
5451
|
-
allDevices[allDevices.indexOf(firstEnv)].recommended = true;
|
|
5452
|
-
}
|
|
5453
|
-
}
|
|
5454
|
-
}
|
|
5455
|
-
return allDevices;
|
|
5456
|
-
}
|
|
5457
|
-
GetConstraints(selectedDeviceId, device, portrait = false) {
|
|
5458
|
-
let constraints = {
|
|
5459
|
-
audio: false,
|
|
5460
|
-
video: {
|
|
5461
|
-
frameRate: 30,
|
|
5462
|
-
},
|
|
5463
|
-
};
|
|
5464
|
-
if (selectedDeviceId) {
|
|
5465
|
-
constraints.video.deviceId = {
|
|
5466
|
-
exact: selectedDeviceId,
|
|
5467
|
-
};
|
|
5468
|
-
}
|
|
5469
|
-
if (device.isWin) {
|
|
5470
|
-
constraints.video.width = { ideal: 1280 };
|
|
5471
|
-
}
|
|
5472
|
-
else {
|
|
5473
|
-
if (portrait) {
|
|
5474
|
-
constraints.video.facingMode = 'user';
|
|
5475
|
-
constraints.video.width = { ideal: 1280 };
|
|
5476
|
-
constraints.video.height = { ideal: 720 };
|
|
5477
|
-
}
|
|
5478
|
-
else {
|
|
5479
|
-
constraints.video.facingMode = 'environment';
|
|
5480
|
-
constraints.video.width = { ideal: 1280 };
|
|
5481
|
-
constraints.video.aspectRatio = 1;
|
|
5482
|
-
}
|
|
5483
|
-
}
|
|
5484
|
-
return constraints;
|
|
5485
|
-
}
|
|
5486
|
-
GetRecommendedCamera(cameras) {
|
|
5487
|
-
if (cameras && cameras.length > 0) {
|
|
5488
|
-
var recommDevice = cameras.find(c => c.recommended);
|
|
5489
|
-
if (recommDevice) {
|
|
5490
|
-
return recommDevice;
|
|
5491
|
-
}
|
|
5492
|
-
}
|
|
5493
|
-
return null;
|
|
5494
|
-
}
|
|
5495
|
-
static async InitCameras(device) {
|
|
5496
|
-
try {
|
|
5497
|
-
let cam = new Cameras();
|
|
5498
|
-
let cameras = await cam.GetCameras(device);
|
|
5499
|
-
var recommCamera = cam.GetRecommendedCamera(cameras);
|
|
5500
|
-
state.cameraIds = cameras.map(camera => camera.deviceId);
|
|
5501
|
-
state.cameraId = recommCamera.deviceId;
|
|
5502
|
-
return true;
|
|
5503
|
-
}
|
|
5504
|
-
catch (e) {
|
|
5505
|
-
console.log(e);
|
|
5506
|
-
if (e.message.includes('Permission denied') || e.name.includes('NotAllowedError')) {
|
|
5507
|
-
return false;
|
|
5508
|
-
}
|
|
5509
|
-
throw e;
|
|
5510
|
-
}
|
|
5511
|
-
}
|
|
5512
|
-
}
|
|
5513
|
-
|
|
5514
5528
|
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)}";
|
|
5515
5529
|
|
|
5516
5530
|
const IdBackCapture = class {
|
|
@@ -6161,7 +6175,7 @@ function v4(options, buf, offset) {
|
|
|
6161
6175
|
}
|
|
6162
6176
|
|
|
6163
6177
|
const name = "@ekyc_qoobiss/qbs-ect-cmp";
|
|
6164
|
-
const version$1 = "2.1.
|
|
6178
|
+
const version$1 = "2.1.14";
|
|
6165
6179
|
const description = "Person Identification Component";
|
|
6166
6180
|
const main = "./dist/index.cjs.js";
|
|
6167
6181
|
const module$1 = "./dist/index.js";
|
|
@@ -6540,9 +6554,8 @@ const LandingValidation = class {
|
|
|
6540
6554
|
this.buttonDisabled = true;
|
|
6541
6555
|
if (!(await Cameras.InitCameras(this.device))) {
|
|
6542
6556
|
state.flowStatus = FlowStatus.CAMERAERROR;
|
|
6543
|
-
return;
|
|
6544
6557
|
}
|
|
6545
|
-
if (state.agreementsValidation) {
|
|
6558
|
+
else if (state.agreementsValidation) {
|
|
6546
6559
|
state.flowStatus = FlowStatus.AGREEMENT;
|
|
6547
6560
|
}
|
|
6548
6561
|
else if (state.phoneValidation) {
|
|
@@ -2,6 +2,7 @@ import { h } from '@stencil/core';
|
|
|
2
2
|
import { CameraErrorValues } from '../../../helpers/textValues';
|
|
3
3
|
import store from '../../../helpers/store';
|
|
4
4
|
import { FlowStatus } from '../../../models/FlowStatus';
|
|
5
|
+
import { Cameras } from '../../../helpers/Cameras';
|
|
5
6
|
import { ApiCall } from '../../../helpers/ApiCall';
|
|
6
7
|
import { FlowSteps } from '../../../models/FlowSteps';
|
|
7
8
|
export class CameraError {
|
|
@@ -34,7 +35,21 @@ export class CameraError {
|
|
|
34
35
|
}
|
|
35
36
|
async buttonClick() {
|
|
36
37
|
this.buttonDisabled = true;
|
|
37
|
-
|
|
38
|
+
if (this.device.isIos) {
|
|
39
|
+
window.location.reload();
|
|
40
|
+
}
|
|
41
|
+
if (!(await Cameras.InitCameras(this.device))) {
|
|
42
|
+
this.buttonDisabled = false;
|
|
43
|
+
}
|
|
44
|
+
else if (store.agreementsValidation) {
|
|
45
|
+
store.flowStatus = FlowStatus.AGREEMENT;
|
|
46
|
+
}
|
|
47
|
+
else if (store.phoneValidation) {
|
|
48
|
+
store.flowStatus = FlowStatus.PHONE;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
store.flowStatus = FlowStatus.ID;
|
|
52
|
+
}
|
|
38
53
|
}
|
|
39
54
|
render() {
|
|
40
55
|
return (h("div", { class: "container" }, h("div", { class: "row" }, h("h1", { class: "color-red" }, this.title), h("div", null, h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.description)), h("div", { hidden: this.device.isIos }, h("video", { id: "howtoPermissions", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", type: "button", disabled: this.buttonDisabled, onClick: () => this.buttonClick() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, CameraErrorValues.FooterText))))));
|
|
@@ -45,9 +45,8 @@ export class LandingValidation {
|
|
|
45
45
|
this.buttonDisabled = true;
|
|
46
46
|
if (!(await Cameras.InitCameras(this.device))) {
|
|
47
47
|
store.flowStatus = FlowStatus.CAMERAERROR;
|
|
48
|
-
return;
|
|
49
48
|
}
|
|
50
|
-
if (store.agreementsValidation) {
|
|
49
|
+
else if (store.agreementsValidation) {
|
|
51
50
|
store.flowStatus = FlowStatus.AGREEMENT;
|
|
52
51
|
}
|
|
53
52
|
else if (store.phoneValidation) {
|
|
@@ -5167,6 +5167,122 @@ const Camera = class {
|
|
|
5167
5167
|
};
|
|
5168
5168
|
Camera.style = cameraCss;
|
|
5169
5169
|
|
|
5170
|
+
class Cameras {
|
|
5171
|
+
async GetCameras(deviceInfo) {
|
|
5172
|
+
var allDevices = [];
|
|
5173
|
+
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
5174
|
+
const videoDevices = devices.filter(device => device.kind === 'videoinput');
|
|
5175
|
+
for (const device of videoDevices) {
|
|
5176
|
+
const updatedConstraints = this.GetConstraints(device.deviceId, deviceInfo);
|
|
5177
|
+
const stream = await navigator.mediaDevices.getUserMedia(updatedConstraints);
|
|
5178
|
+
stream.getVideoTracks().forEach(track => {
|
|
5179
|
+
if (deviceInfo.isFirefox) {
|
|
5180
|
+
const settings = track.getSettings();
|
|
5181
|
+
let facingMode = settings.facingMode && settings.facingMode.length > 0 ? settings.facingMode[0] : '';
|
|
5182
|
+
facingMode = facingMode === 'e' ? 'environment' : facingMode;
|
|
5183
|
+
allDevices.push({
|
|
5184
|
+
deviceId: device.deviceId,
|
|
5185
|
+
name: device.label,
|
|
5186
|
+
height: settings.height,
|
|
5187
|
+
width: settings.width,
|
|
5188
|
+
frameRate: Number(settings.frameRate.max),
|
|
5189
|
+
torch: false,
|
|
5190
|
+
recommended: false,
|
|
5191
|
+
facingMode: facingMode,
|
|
5192
|
+
});
|
|
5193
|
+
}
|
|
5194
|
+
else {
|
|
5195
|
+
const capabilities = track.getCapabilities();
|
|
5196
|
+
let facingMode = capabilities.facingMode && capabilities.facingMode.length > 0 ? capabilities.facingMode[0] : '';
|
|
5197
|
+
facingMode = facingMode === 'e' ? 'environment' : facingMode;
|
|
5198
|
+
allDevices.push({
|
|
5199
|
+
deviceId: device.deviceId,
|
|
5200
|
+
name: device.label,
|
|
5201
|
+
height: capabilities.height.max,
|
|
5202
|
+
width: capabilities.width.max,
|
|
5203
|
+
frameRate: Number(capabilities.frameRate.max),
|
|
5204
|
+
torch: capabilities.torch,
|
|
5205
|
+
recommended: false,
|
|
5206
|
+
facingMode: facingMode,
|
|
5207
|
+
});
|
|
5208
|
+
}
|
|
5209
|
+
});
|
|
5210
|
+
stream.getTracks().forEach(track => {
|
|
5211
|
+
track.stop();
|
|
5212
|
+
});
|
|
5213
|
+
}
|
|
5214
|
+
if (allDevices.length > 0) {
|
|
5215
|
+
allDevices = allDevices.sort((a, b) => b.frameRate - a.frameRate);
|
|
5216
|
+
var firstOption = allDevices.find(i => i.name.indexOf('0,') != -1 && i.facingMode === 'environment');
|
|
5217
|
+
if (firstOption) {
|
|
5218
|
+
allDevices[allDevices.indexOf(firstOption)].recommended = true;
|
|
5219
|
+
}
|
|
5220
|
+
else {
|
|
5221
|
+
var firstEnv = allDevices.find(i => i.facingMode === 'environment');
|
|
5222
|
+
if (firstEnv) {
|
|
5223
|
+
allDevices[allDevices.indexOf(firstEnv)].recommended = true;
|
|
5224
|
+
}
|
|
5225
|
+
}
|
|
5226
|
+
}
|
|
5227
|
+
return allDevices;
|
|
5228
|
+
}
|
|
5229
|
+
GetConstraints(selectedDeviceId, device, portrait = false) {
|
|
5230
|
+
let constraints = {
|
|
5231
|
+
audio: false,
|
|
5232
|
+
video: {
|
|
5233
|
+
frameRate: 30,
|
|
5234
|
+
},
|
|
5235
|
+
};
|
|
5236
|
+
if (selectedDeviceId) {
|
|
5237
|
+
constraints.video.deviceId = {
|
|
5238
|
+
exact: selectedDeviceId,
|
|
5239
|
+
};
|
|
5240
|
+
}
|
|
5241
|
+
if (device.isWin) {
|
|
5242
|
+
constraints.video.width = { ideal: 1280 };
|
|
5243
|
+
}
|
|
5244
|
+
else {
|
|
5245
|
+
if (portrait) {
|
|
5246
|
+
constraints.video.facingMode = 'user';
|
|
5247
|
+
constraints.video.width = { ideal: 1280 };
|
|
5248
|
+
constraints.video.height = { ideal: 720 };
|
|
5249
|
+
}
|
|
5250
|
+
else {
|
|
5251
|
+
constraints.video.facingMode = 'environment';
|
|
5252
|
+
constraints.video.width = { ideal: 1280 };
|
|
5253
|
+
constraints.video.aspectRatio = 1;
|
|
5254
|
+
}
|
|
5255
|
+
}
|
|
5256
|
+
return constraints;
|
|
5257
|
+
}
|
|
5258
|
+
GetRecommendedCamera(cameras) {
|
|
5259
|
+
if (cameras && cameras.length > 0) {
|
|
5260
|
+
var recommDevice = cameras.find(c => c.recommended);
|
|
5261
|
+
if (recommDevice) {
|
|
5262
|
+
return recommDevice;
|
|
5263
|
+
}
|
|
5264
|
+
}
|
|
5265
|
+
return null;
|
|
5266
|
+
}
|
|
5267
|
+
static async InitCameras(device) {
|
|
5268
|
+
try {
|
|
5269
|
+
let cam = new Cameras();
|
|
5270
|
+
let cameras = await cam.GetCameras(device);
|
|
5271
|
+
var recommCamera = cam.GetRecommendedCamera(cameras);
|
|
5272
|
+
state.cameraIds = cameras.map(camera => camera.deviceId);
|
|
5273
|
+
state.cameraId = recommCamera.deviceId;
|
|
5274
|
+
return true;
|
|
5275
|
+
}
|
|
5276
|
+
catch (e) {
|
|
5277
|
+
console.log(e);
|
|
5278
|
+
if (e.message.includes('Permission denied') || e.name.includes('NotAllowedError')) {
|
|
5279
|
+
return false;
|
|
5280
|
+
}
|
|
5281
|
+
throw e;
|
|
5282
|
+
}
|
|
5283
|
+
}
|
|
5284
|
+
}
|
|
5285
|
+
|
|
5170
5286
|
const cameraErrorCss = "";
|
|
5171
5287
|
|
|
5172
5288
|
const CameraError = class {
|
|
@@ -5201,7 +5317,21 @@ const CameraError = class {
|
|
|
5201
5317
|
}
|
|
5202
5318
|
async buttonClick() {
|
|
5203
5319
|
this.buttonDisabled = true;
|
|
5204
|
-
|
|
5320
|
+
if (this.device.isIos) {
|
|
5321
|
+
window.location.reload();
|
|
5322
|
+
}
|
|
5323
|
+
if (!(await Cameras.InitCameras(this.device))) {
|
|
5324
|
+
this.buttonDisabled = false;
|
|
5325
|
+
}
|
|
5326
|
+
else if (state.agreementsValidation) {
|
|
5327
|
+
state.flowStatus = FlowStatus.AGREEMENT;
|
|
5328
|
+
}
|
|
5329
|
+
else if (state.phoneValidation) {
|
|
5330
|
+
state.flowStatus = FlowStatus.PHONE;
|
|
5331
|
+
}
|
|
5332
|
+
else {
|
|
5333
|
+
state.flowStatus = FlowStatus.ID;
|
|
5334
|
+
}
|
|
5205
5335
|
}
|
|
5206
5336
|
render() {
|
|
5207
5337
|
return (h("div", { class: "container" }, h("div", { class: "row" }, h("h1", { class: "color-red" }, this.title), h("div", null, h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.description)), h("div", { hidden: this.device.isIos }, h("video", { id: "howtoPermissions", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", type: "button", disabled: this.buttonDisabled, onClick: () => this.buttonClick() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, CameraErrorValues.FooterText))))));
|
|
@@ -5391,122 +5521,6 @@ const HowToInfo = class {
|
|
|
5391
5521
|
};
|
|
5392
5522
|
HowToInfo.style = howToInfoCss;
|
|
5393
5523
|
|
|
5394
|
-
class Cameras {
|
|
5395
|
-
async GetCameras(deviceInfo) {
|
|
5396
|
-
var allDevices = [];
|
|
5397
|
-
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
5398
|
-
const videoDevices = devices.filter(device => device.kind === 'videoinput');
|
|
5399
|
-
for (const device of videoDevices) {
|
|
5400
|
-
const updatedConstraints = this.GetConstraints(device.deviceId, deviceInfo);
|
|
5401
|
-
const stream = await navigator.mediaDevices.getUserMedia(updatedConstraints);
|
|
5402
|
-
stream.getVideoTracks().forEach(track => {
|
|
5403
|
-
if (deviceInfo.isFirefox) {
|
|
5404
|
-
const settings = track.getSettings();
|
|
5405
|
-
let facingMode = settings.facingMode && settings.facingMode.length > 0 ? settings.facingMode[0] : '';
|
|
5406
|
-
facingMode = facingMode === 'e' ? 'environment' : facingMode;
|
|
5407
|
-
allDevices.push({
|
|
5408
|
-
deviceId: device.deviceId,
|
|
5409
|
-
name: device.label,
|
|
5410
|
-
height: settings.height,
|
|
5411
|
-
width: settings.width,
|
|
5412
|
-
frameRate: Number(settings.frameRate.max),
|
|
5413
|
-
torch: false,
|
|
5414
|
-
recommended: false,
|
|
5415
|
-
facingMode: facingMode,
|
|
5416
|
-
});
|
|
5417
|
-
}
|
|
5418
|
-
else {
|
|
5419
|
-
const capabilities = track.getCapabilities();
|
|
5420
|
-
let facingMode = capabilities.facingMode && capabilities.facingMode.length > 0 ? capabilities.facingMode[0] : '';
|
|
5421
|
-
facingMode = facingMode === 'e' ? 'environment' : facingMode;
|
|
5422
|
-
allDevices.push({
|
|
5423
|
-
deviceId: device.deviceId,
|
|
5424
|
-
name: device.label,
|
|
5425
|
-
height: capabilities.height.max,
|
|
5426
|
-
width: capabilities.width.max,
|
|
5427
|
-
frameRate: Number(capabilities.frameRate.max),
|
|
5428
|
-
torch: capabilities.torch,
|
|
5429
|
-
recommended: false,
|
|
5430
|
-
facingMode: facingMode,
|
|
5431
|
-
});
|
|
5432
|
-
}
|
|
5433
|
-
});
|
|
5434
|
-
stream.getTracks().forEach(track => {
|
|
5435
|
-
track.stop();
|
|
5436
|
-
});
|
|
5437
|
-
}
|
|
5438
|
-
if (allDevices.length > 0) {
|
|
5439
|
-
allDevices = allDevices.sort((a, b) => b.frameRate - a.frameRate);
|
|
5440
|
-
var firstOption = allDevices.find(i => i.name.indexOf('0,') != -1 && i.facingMode === 'environment');
|
|
5441
|
-
if (firstOption) {
|
|
5442
|
-
allDevices[allDevices.indexOf(firstOption)].recommended = true;
|
|
5443
|
-
}
|
|
5444
|
-
else {
|
|
5445
|
-
var firstEnv = allDevices.find(i => i.facingMode === 'environment');
|
|
5446
|
-
if (firstEnv) {
|
|
5447
|
-
allDevices[allDevices.indexOf(firstEnv)].recommended = true;
|
|
5448
|
-
}
|
|
5449
|
-
}
|
|
5450
|
-
}
|
|
5451
|
-
return allDevices;
|
|
5452
|
-
}
|
|
5453
|
-
GetConstraints(selectedDeviceId, device, portrait = false) {
|
|
5454
|
-
let constraints = {
|
|
5455
|
-
audio: false,
|
|
5456
|
-
video: {
|
|
5457
|
-
frameRate: 30,
|
|
5458
|
-
},
|
|
5459
|
-
};
|
|
5460
|
-
if (selectedDeviceId) {
|
|
5461
|
-
constraints.video.deviceId = {
|
|
5462
|
-
exact: selectedDeviceId,
|
|
5463
|
-
};
|
|
5464
|
-
}
|
|
5465
|
-
if (device.isWin) {
|
|
5466
|
-
constraints.video.width = { ideal: 1280 };
|
|
5467
|
-
}
|
|
5468
|
-
else {
|
|
5469
|
-
if (portrait) {
|
|
5470
|
-
constraints.video.facingMode = 'user';
|
|
5471
|
-
constraints.video.width = { ideal: 1280 };
|
|
5472
|
-
constraints.video.height = { ideal: 720 };
|
|
5473
|
-
}
|
|
5474
|
-
else {
|
|
5475
|
-
constraints.video.facingMode = 'environment';
|
|
5476
|
-
constraints.video.width = { ideal: 1280 };
|
|
5477
|
-
constraints.video.aspectRatio = 1;
|
|
5478
|
-
}
|
|
5479
|
-
}
|
|
5480
|
-
return constraints;
|
|
5481
|
-
}
|
|
5482
|
-
GetRecommendedCamera(cameras) {
|
|
5483
|
-
if (cameras && cameras.length > 0) {
|
|
5484
|
-
var recommDevice = cameras.find(c => c.recommended);
|
|
5485
|
-
if (recommDevice) {
|
|
5486
|
-
return recommDevice;
|
|
5487
|
-
}
|
|
5488
|
-
}
|
|
5489
|
-
return null;
|
|
5490
|
-
}
|
|
5491
|
-
static async InitCameras(device) {
|
|
5492
|
-
try {
|
|
5493
|
-
let cam = new Cameras();
|
|
5494
|
-
let cameras = await cam.GetCameras(device);
|
|
5495
|
-
var recommCamera = cam.GetRecommendedCamera(cameras);
|
|
5496
|
-
state.cameraIds = cameras.map(camera => camera.deviceId);
|
|
5497
|
-
state.cameraId = recommCamera.deviceId;
|
|
5498
|
-
return true;
|
|
5499
|
-
}
|
|
5500
|
-
catch (e) {
|
|
5501
|
-
console.log(e);
|
|
5502
|
-
if (e.message.includes('Permission denied') || e.name.includes('NotAllowedError')) {
|
|
5503
|
-
return false;
|
|
5504
|
-
}
|
|
5505
|
-
throw e;
|
|
5506
|
-
}
|
|
5507
|
-
}
|
|
5508
|
-
}
|
|
5509
|
-
|
|
5510
5524
|
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)}";
|
|
5511
5525
|
|
|
5512
5526
|
const IdBackCapture = class {
|
|
@@ -6157,7 +6171,7 @@ function v4(options, buf, offset) {
|
|
|
6157
6171
|
}
|
|
6158
6172
|
|
|
6159
6173
|
const name = "@ekyc_qoobiss/qbs-ect-cmp";
|
|
6160
|
-
const version$1 = "2.1.
|
|
6174
|
+
const version$1 = "2.1.14";
|
|
6161
6175
|
const description = "Person Identification Component";
|
|
6162
6176
|
const main = "./dist/index.cjs.js";
|
|
6163
6177
|
const module = "./dist/index.js";
|
|
@@ -6536,9 +6550,8 @@ const LandingValidation = class {
|
|
|
6536
6550
|
this.buttonDisabled = true;
|
|
6537
6551
|
if (!(await Cameras.InitCameras(this.device))) {
|
|
6538
6552
|
state.flowStatus = FlowStatus.CAMERAERROR;
|
|
6539
|
-
return;
|
|
6540
6553
|
}
|
|
6541
|
-
if (state.agreementsValidation) {
|
|
6554
|
+
else if (state.agreementsValidation) {
|
|
6542
6555
|
state.flowStatus = FlowStatus.AGREEMENT;
|
|
6543
6556
|
}
|
|
6544
6557
|
else if (state.phoneValidation) {
|