@ekyc_qoobiss/qbs-ect-cmp 3.6.77 → 3.6.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { 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-93e9abe8.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-57159270.js';
3
3
 
4
4
  const agreementCheckCss = "";
5
5
 
@@ -1481,7 +1481,7 @@ class ML5 {
1481
1481
  }
1482
1482
  async init() {
1483
1483
  return new Promise(async (resolve) => {
1484
- 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';
1484
+ const modelPath = state.modelsPath;
1485
1485
  this.classifier = await ml5.imageClassifier(modelPath, this.loaded);
1486
1486
  this.faceapi = await ml5.faceApi({ withLandmarks: true, withDescriptors: false }, this.loaded);
1487
1487
  //warmup
@@ -1524,6 +1524,12 @@ const getLogMessage = (param_req_id = '', param_redirect_id = '', param_token =
1524
1524
  };
1525
1525
  };
1526
1526
 
1527
+ var VerificationMode;
1528
+ (function (VerificationMode) {
1529
+ VerificationMode[VerificationMode["Full"] = 0] = "Full";
1530
+ VerificationMode[VerificationMode["Tilt"] = 1] = "Tilt";
1531
+ })(VerificationMode || (VerificationMode = {}));
1532
+
1527
1533
  class IDML5Detector {
1528
1534
  static getInstance(stream, isMobile) {
1529
1535
  if (!IDML5Detector.instance) {
@@ -1544,9 +1550,13 @@ class IDML5Detector {
1544
1550
  this.canvasElement = canvasElement;
1545
1551
  // this.component = component;
1546
1552
  }
1547
- initDetector() {
1553
+ initDetector(mode) {
1548
1554
  this.initTime = Date.now();
1549
1555
  this.continue = true;
1556
+ if (mode == VerificationMode.Full)
1557
+ this.targetedLabel = 'full';
1558
+ else
1559
+ this.targetedLabel = 'tilted';
1550
1560
  // this.width = this.videoElement.videoWidth;
1551
1561
  // this.height = this.videoElement.videoHeight;
1552
1562
  this.drawFrame('white');
@@ -1574,14 +1584,14 @@ class IDML5Detector {
1574
1584
  this.stream.timeElapsed();
1575
1585
  return;
1576
1586
  }
1577
- if (results[0].label == 'full' && results[0].confidence > 0.9 && !this.checked) {
1587
+ if (results[0].label == this.targetedLabel && results[0].confidence > 0.9 && !this.checked) {
1578
1588
  this.checked = true;
1579
1589
  if (state.debug)
1580
1590
  console.log('idml5detector | gotResults | autoCapturing');
1581
1591
  this.stream.autoCapturing();
1582
1592
  await this.drawFrame('green');
1583
1593
  }
1584
- if (results[0].label == 'tilted' && results[0].confidence > 0.8 && !this.checked) {
1594
+ if (results[0].label == this.targetedLabel && this.targetedLabel == 'tilted' && results[0].confidence > 0.8 && !this.checked) {
1585
1595
  this.checked = true;
1586
1596
  await this.drawFrame('green');
1587
1597
  }
@@ -1705,12 +1715,6 @@ const faceWhiteSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUwIiBoZWlnaHQ9
1705
1715
 
1706
1716
  const faceGreenSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUwIiBoZWlnaHQ9IjIyNC45OTk5OTk5OTk5OTk5NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIHZlcnNpb249IjEuMSIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQogPGc+DQogIDx0aXRsZT5MYXllciAxPC90aXRsZT4NCiAgPGcgc3Ryb2tlPSJudWxsIiBpZD0iTGF5ZXIgMSI+DQogICA8cGF0aCBzdHJva2U9IiM0Y2E1ODUiIGlkPSJzdmdfMSIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZmlsbD0ibm9uZSIgZD0ibTc0LjI3NzY1LDYuOTI3NjFjLTExLjM3NTk3LC0wLjAxNzEzIC0zMy41NjU1MSw1LjEwNDMzIC00Ni44MTMxNiwxOS40OTQ4MWMtNi43NDE0Myw3LjMyMjkyIC0xOC4xMjI2OSwyMy4wNjk2NyAtMTkuMjY3NTgsNTkuNjEzNjljLTAuNTE5MDYsMTYuNTY5MjEgNS4wNDUyNCw2MC42MjUzMyAxMC4yNDAwNiw3Ni40Njc3NWMzLjYzMTMsMTEuMDc0NjggMjcuNDgyMTUsNDMuOTMzNDkgNDQuNDkwNiw1My42ODI1MWM0LjgwNzkxLDIuNzU1NDYgMTEuMjk2NjgsMi42ODI1MSAxMi40MjI1NSwyLjY4MjUxYzEuMTg4NzYsLTAuMDg0NTcgNy4zMzAyNiwwLjA3Mjk0IDEyLjEzNzY1LC0yLjY4MjUxYzE3LjAwODQ2LC05Ljc0OTAyIDQwLjQwMjA4LC00Mi43Njg1MSA0NC40OTA2LC01My42ODI1MWM0LjQwMDM4LC0xMS43NDQ5MSAxMC43NTk2NSwtNTkuODk4NTQgMTAuMjQwMDYsLTc2LjQ2Nzc1Yy0xLjE0NDg5LC0zNi41NDQwMiAtMTIuNTI2MTUsLTUyLjI5MDc3IC0xOS4yNjc1OCwtNTkuNjEzNjljLTEzLjI0NzY1LC0xNC4zOTA0OCAtMzUuMzA2NjMsLTE5LjUyOTMzIC00Ni43NzgyNywtMTkuNDk0ODFjLTAuNzQ2ODgsMC4wMDIyMiAtMS44OTQ5NCwwIC0xLjg5NDk0LDB6IiBzdHJva2Utd2lkdGg9IjciLz4NCiAgPC9nPg0KIDwvZz4NCjwvc3ZnPg0K';
1707
1717
 
1708
- var VerificationMode;
1709
- (function (VerificationMode) {
1710
- VerificationMode[VerificationMode["Full"] = 0] = "Full";
1711
- VerificationMode[VerificationMode["Tilt"] = 1] = "Tilt";
1712
- })(VerificationMode || (VerificationMode = {}));
1713
-
1714
1718
  class FaceML5Detector {
1715
1719
  static getInstance(stream, isMobile) {
1716
1720
  if (!FaceML5Detector.instance) {
@@ -4414,7 +4418,7 @@ class Stream {
4414
4418
  this.recordedChunks = [];
4415
4419
  this.videoSize = { width: 0, height: 0 };
4416
4420
  if (state.debug)
4417
- console.log(`stream | constructor`);
4421
+ console.log('stream | constructor');
4418
4422
  this.initFacePose();
4419
4423
  this.idML5Detector = IDML5Detector.getInstance(this, state.device.isMobile);
4420
4424
  this.faceML5Detector = FaceML5Detector.getInstance(this, state.device.isMobile);
@@ -4426,23 +4430,23 @@ class Stream {
4426
4430
  if (!Stream.instance) {
4427
4431
  Stream.instance = new Stream(mode);
4428
4432
  if (state.debug)
4429
- console.log(`stream | getNewInstance | new instance`);
4433
+ console.log('stream | getNewInstance | new instance');
4430
4434
  }
4431
4435
  return Stream.instance;
4432
4436
  }
4433
4437
  autoCapturing() {
4434
4438
  if (state.debug)
4435
- console.log(`stream | autoCapturing`);
4439
+ console.log('stream | autoCapturing');
4436
4440
  this.callbackAutoCapturing();
4437
4441
  }
4438
4442
  timeElapsed() {
4439
4443
  if (state.debug)
4440
- console.log(`stream | timeElapsed`);
4444
+ console.log('stream | timeElapsed');
4441
4445
  this.callbackTimeElapsed();
4442
4446
  }
4443
4447
  verificationReady() {
4444
4448
  if (state.debug)
4445
- console.log(`stream | verificationReady`);
4449
+ console.log('stream | verificationReady');
4446
4450
  this.verificationFinished();
4447
4451
  }
4448
4452
  updateHtmlElements(videoElement, canvasElement, component) {
@@ -4453,7 +4457,7 @@ class Stream {
4453
4457
  }
4454
4458
  startStream(stream) {
4455
4459
  if (state.debug)
4456
- console.log(`stream | startStream`);
4460
+ console.log('stream | startStream');
4457
4461
  if (this.stream)
4458
4462
  this.stream.getTracks().forEach((track) => track.stop());
4459
4463
  this.stream = stream;
@@ -4486,7 +4490,7 @@ class Stream {
4486
4490
  }
4487
4491
  recordStream() {
4488
4492
  if (state.debug)
4489
- console.log(`stream | recordStream`);
4493
+ console.log('stream | recordStream');
4490
4494
  if (this.mediaRecorder && this.mediaRecorder.state == 'recording')
4491
4495
  return;
4492
4496
  var options = { mimeType: Stream.webmMimeType.mime, videoBitsPerSecond: 1500000 };
@@ -4498,12 +4502,12 @@ class Stream {
4498
4502
  this.mediaRecorder = new MediaRecorder(this.stream, options);
4499
4503
  this.mediaRecorder.ondataavailable = event => {
4500
4504
  if (state.debug)
4501
- console.log(`stream | recordStream | ondataavailable`);
4505
+ console.log('stream | recordStream | ondataavailable');
4502
4506
  this.recordedChunks.push(event.data);
4503
4507
  };
4504
4508
  this.mediaRecorder.onstop = _e => {
4505
4509
  if (state.debug)
4506
- console.log(`stream | recordStream | onstop`);
4510
+ console.log('stream | recordStream | onstop');
4507
4511
  var rec = new Blob(this.recordedChunks, {
4508
4512
  type: options.mimeType.split(';')[0],
4509
4513
  });
@@ -4535,7 +4539,7 @@ class Stream {
4535
4539
  }
4536
4540
  async takePhoto() {
4537
4541
  if (state.debug)
4538
- console.log(`stream | takePhoto`);
4542
+ console.log('stream | takePhoto');
4539
4543
  const canvas = document.createElement('canvas');
4540
4544
  canvas.style.visibility = 'hidden';
4541
4545
  canvas.width = this.videoElement.videoWidth;
@@ -4544,7 +4548,7 @@ class Stream {
4544
4548
  }
4545
4549
  getFrame(canvas) {
4546
4550
  if (state.debug)
4547
- console.log(`stream | getFrame`);
4551
+ console.log('stream | getFrame');
4548
4552
  return new Promise(resolve => {
4549
4553
  const context = canvas.getContext('2d');
4550
4554
  context.drawImage(this.videoElement, 0, 0, canvas.width, canvas.height);
@@ -4552,7 +4556,7 @@ class Stream {
4552
4556
  if (frame.type === ImageFormat.JPEG && !state.device.isAppleDevice) {
4553
4557
  try {
4554
4558
  if (state.debug)
4555
- console.log(`stream | getFrame | addExifInImg`);
4559
+ console.log('stream | getFrame | addExifInImg');
4556
4560
  addExifInImg(frame, this.stream.getTracks()[0], this.videoSize).then(updatedFrame => resolve(updatedFrame));
4557
4561
  }
4558
4562
  catch (e) {
@@ -4562,7 +4566,7 @@ class Stream {
4562
4566
  }
4563
4567
  else {
4564
4568
  if (state.debug)
4565
- console.log(`stream | getFrame | resolve`);
4569
+ console.log('stream | getFrame | resolve');
4566
4570
  resolve(frame);
4567
4571
  }
4568
4572
  }, ImageFormat.PNG, 1);
@@ -4571,7 +4575,7 @@ class Stream {
4571
4575
  async startIdDetection() {
4572
4576
  if (this.streamPaused)
4573
4577
  return;
4574
- this.idML5Detector.initDetector();
4578
+ this.idML5Detector.initDetector(this.verificationMode);
4575
4579
  }
4576
4580
  async startFaceDetection() {
4577
4581
  if (this.streamPaused)
@@ -5052,7 +5056,7 @@ const IdCapture = class {
5052
5056
  }
5053
5057
  async componentWillLoad() {
5054
5058
  if (state.debug)
5055
- console.log(`id-capture | componentWillLoad`);
5059
+ console.log('id-capture | componentWillLoad');
5056
5060
  this.translations = await Translations.getValues();
5057
5061
  if (!navigator.mediaDevices) {
5058
5062
  this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
@@ -5060,26 +5064,29 @@ const IdCapture = class {
5060
5064
  }
5061
5065
  initVariables() {
5062
5066
  if (state.debug)
5063
- console.log(`id-capture | initVariables`);
5067
+ console.log('id-capture | initVariables');
5064
5068
  if (state.flowStatus == FlowStatus.IDFRONT) {
5065
5069
  this.pose = IDPose.Straight;
5066
5070
  this.flowStep = FlowSteps.CiFrontCapture;
5067
5071
  this.titleMesage = this.translations.IdCaptureValues.Title;
5072
+ this.verificationMode = VerificationMode.Full;
5068
5073
  }
5069
5074
  else if (state.flowStatus == FlowStatus.IDBACK) {
5070
5075
  this.pose = IDPose.BackStraight;
5071
5076
  this.flowStep = FlowSteps.CiBackCapture;
5072
5077
  this.titleMesage = this.translations.IdCaptureValues.TtileRotate;
5078
+ this.verificationMode = VerificationMode.Full;
5073
5079
  }
5074
5080
  else if (state.flowStatus == FlowStatus.IDTILT) {
5075
5081
  this.titleMesage = this.translations.IdCaptureValues.IDPoseMapping;
5076
5082
  this.pose = IDPose.Tilted;
5077
5083
  this.flowStep = FlowSteps.CiTilt;
5084
+ this.verificationMode = VerificationMode.Tilt;
5078
5085
  }
5079
5086
  }
5080
5087
  async componentDidLoad() {
5081
5088
  if (state.debug)
5082
- console.log(`id-capture | componentDidLoad`);
5089
+ console.log('id-capture | componentDidLoad');
5083
5090
  this.initVariables();
5084
5091
  await BaseComponent.logStep(this.flowStep, FlowMoments.Initialized);
5085
5092
  this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[this.pose];
@@ -5090,7 +5097,7 @@ const IdCapture = class {
5090
5097
  }
5091
5098
  async openCamera() {
5092
5099
  if (state.debug)
5093
- console.log(`id-capture | openCamera`);
5100
+ console.log('id-capture | openCamera');
5094
5101
  if (!state.cameraId) {
5095
5102
  await Cameras.InitCameras(state.device);
5096
5103
  }
@@ -5100,8 +5107,8 @@ const IdCapture = class {
5100
5107
  .getUserMedia(constraints)
5101
5108
  .then(stream => {
5102
5109
  if (state.debug)
5103
- console.log(`id-capture | openCamera | streamObtained`);
5104
- const superStream = Stream.getNewInstance(null);
5110
+ console.log('id-capture | openCamera | streamObtained');
5111
+ const superStream = Stream.getNewInstance(this.verificationMode);
5105
5112
  superStream.initStream(stream);
5106
5113
  })
5107
5114
  .catch(e => {
@@ -5112,7 +5119,7 @@ const IdCapture = class {
5112
5119
  }
5113
5120
  closeCamera() {
5114
5121
  if (state.debug)
5115
- console.log(`id-capture | closeCamera`);
5122
+ console.log('id-capture | closeCamera');
5116
5123
  if (Stream.instance) {
5117
5124
  Stream.instance.dropStream();
5118
5125
  }
@@ -5123,23 +5130,23 @@ const IdCapture = class {
5123
5130
  IDML5Detector.instance = null;
5124
5131
  FaceML5Detector.instance = null;
5125
5132
  if (state.debug)
5126
- console.log(`id-capture | disconnectedCallback`);
5133
+ console.log('id-capture | disconnectedCallback');
5127
5134
  }
5128
5135
  async takePhoto() {
5129
5136
  if (state.debug)
5130
- console.log(`id-capture | takePhoto`);
5137
+ console.log('id-capture | takePhoto');
5131
5138
  if (this.captureTaken)
5132
5139
  return;
5133
5140
  this.captureTaken = true;
5134
5141
  if (state.debug)
5135
- console.log(`id-capture | takePhoto | sendingPhoto`);
5142
+ console.log('id-capture | takePhoto | sendingPhoto');
5136
5143
  let res = await Stream.instance.takePhoto();
5137
5144
  this.eventPhotoCapture.emit(res);
5138
5145
  await BaseComponent.logStep(this.flowStep, FlowMoments.Finalized);
5139
5146
  }
5140
5147
  async verificationFinished() {
5141
5148
  if (state.debug)
5142
- console.log(`id-capture | verificationFinished`);
5149
+ console.log('id-capture | verificationFinished');
5143
5150
  if (this.verified)
5144
5151
  return;
5145
5152
  this.verified = true;
@@ -5236,7 +5243,7 @@ function v4(options, buf, offset) {
5236
5243
  }
5237
5244
 
5238
5245
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
5239
- const version$1 = "3.6.77";
5246
+ const version$1 = "3.6.79";
5240
5247
  const description = "Person Identification Component";
5241
5248
  const main = "./dist/index.cjs.js";
5242
5249
  const module = "./dist/index.js";
@@ -5536,12 +5543,12 @@ const IdentificationComponent = class {
5536
5543
  if (!this.order_id || this.order_id == '') {
5537
5544
  this.order_id = state.requestId;
5538
5545
  }
5546
+ ML5.getInstance();
5539
5547
  }
5540
5548
  }
5541
5549
  catch (e) {
5542
5550
  this.apiErrorEmitter(e, 'Request Initialisation RequestId:' + state.requestId + ' RedirectId:' + state.redirectId);
5543
5551
  }
5544
- ML5.getInstance();
5545
5552
  }
5546
5553
  disconnectedCallback() {
5547
5554
  Events.flowEvent(FlowSteps.ComponentLoaded, FlowMoments.Finalized);
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h } from './index-cf54a432.js';
2
- import { T as Translations } from './TranslationUtils-93e9abe8.js';
2
+ import { T as Translations } from './TranslationUtils-57159270.js';
3
3
 
4
4
  const randomActionsCss = "";
5
5