@ekyc_qoobiss/qbs-ect-cmp 2.1.11 → 2.1.13

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.
@@ -5171,120 +5171,6 @@ 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;
5278
- return true;
5279
- }
5280
- catch (e) {
5281
- console.log(e);
5282
- if (e.message.includes('Permission denied') || e.name.includes('NotAllowedError')) ;
5283
- }
5284
- return false;
5285
- }
5286
- }
5287
-
5288
5174
  const cameraErrorCss = "";
5289
5175
 
5290
5176
  const CameraError = class {
@@ -5311,27 +5197,18 @@ const CameraError = class {
5311
5197
  catch (e) {
5312
5198
  this.apiErrorEvent.emit(e);
5313
5199
  }
5314
- this.demoVideo.src = CameraErrorValues.HowToLink;
5315
- this.demoVideo.play();
5200
+ if (!this.device.isIos) {
5201
+ this.demoVideo.src = CameraErrorValues.HowToLink;
5202
+ this.demoVideo.loop = true;
5203
+ this.demoVideo.play();
5204
+ }
5316
5205
  }
5317
5206
  async buttonClick() {
5318
5207
  this.buttonDisabled = true;
5319
- if (!(await Cameras.InitCameras(this.device))) {
5320
- this.buttonDisabled = false;
5321
- return;
5322
- }
5323
- if (state.agreementsValidation) {
5324
- state.flowStatus = FlowStatus.AGREEMENT;
5325
- }
5326
- else if (state.phoneValidation) {
5327
- state.flowStatus = FlowStatus.PHONE;
5328
- }
5329
- else {
5330
- state.flowStatus = FlowStatus.ID;
5331
- }
5208
+ state.flowStatus = FlowStatus.LANDING;
5332
5209
  }
5333
5210
  render() {
5334
- 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("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))))));
5211
+ 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))))));
5335
5212
  }
5336
5213
  };
5337
5214
  CameraError.style = cameraErrorCss;
@@ -5518,6 +5395,122 @@ const HowToInfo = class {
5518
5395
  };
5519
5396
  HowToInfo.style = howToInfoCss;
5520
5397
 
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
+
5521
5514
  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)}";
5522
5515
 
5523
5516
  const IdBackCapture = class {
@@ -6168,7 +6161,7 @@ function v4(options, buf, offset) {
6168
6161
  }
6169
6162
 
6170
6163
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
6171
- const version$1 = "2.1.11";
6164
+ const version$1 = "2.1.13";
6172
6165
  const description = "Person Identification Component";
6173
6166
  const main = "./dist/index.cjs.js";
6174
6167
  const module$1 = "./dist/index.js";
@@ -6517,9 +6510,11 @@ const LandingValidation = class {
6517
6510
  this.apiErrorEvent = index.createEvent(this, "apiError", 7);
6518
6511
  this.device = undefined;
6519
6512
  this.warningText = undefined;
6513
+ this.buttonDisabled = undefined;
6520
6514
  }
6521
6515
  async componentWillLoad() {
6522
6516
  this.apiCall = new ApiCall();
6517
+ this.buttonDisabled = false;
6523
6518
  await this.initRequest();
6524
6519
  }
6525
6520
  async componentDidLoad() {
@@ -6542,6 +6537,7 @@ const LandingValidation = class {
6542
6537
  }
6543
6538
  async startFlow() {
6544
6539
  if (state.initialised) {
6540
+ this.buttonDisabled = true;
6545
6541
  if (!(await Cameras.InitCameras(this.device))) {
6546
6542
  state.flowStatus = FlowStatus.CAMERAERROR;
6547
6543
  return;
@@ -6558,6 +6554,8 @@ const LandingValidation = class {
6558
6554
  }
6559
6555
  }
6560
6556
  async leaveFlow() {
6557
+ if (this.buttonDisabled)
6558
+ return;
6561
6559
  state.initialised = false;
6562
6560
  try {
6563
6561
  await this.apiCall.AbortRequest();
@@ -6569,7 +6567,7 @@ const LandingValidation = class {
6569
6567
  }
6570
6568
  }
6571
6569
  render() {
6572
- return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", null, index.h("h1", { class: "text-center" }, LandingValues.Title), index.h("div", { class: "d-flex space-between align-center" }, index.h("p", { class: "main-text font-size-2" }, LandingValues.Description), index.h("div", { class: "img-info" }, index.h("div", { class: "i-effect" }), index.h("img", { src: infoSvg })))), index.h("div", { class: "info-container" }, index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: idSvg })), index.h("h3", null, LandingValues.IdInfo)), index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: deviceSvg })), index.h("h3", null, LandingValues.DeviceInfo)), index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: validationSvg })), index.h("h3", null, LandingValues.SmsInfo))), index.h("div", { class: "terms-container" }, index.h("h3", { class: "font-size-2 mb-1 text-center" }, this.warningText)), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", type: "button", disabled: !state.initialised, onClick: () => this.startFlow() }, LandingValues.Button), index.h("p", { class: "main-text font-size-2 link-text mb-0", onClick: () => this.leaveFlow() }, LandingValues.ButtonLeave), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, LandingValues.FooterText))))));
6570
+ return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", null, index.h("h1", { class: "text-center" }, LandingValues.Title), index.h("div", { class: "d-flex space-between align-center" }, index.h("p", { class: "main-text font-size-2" }, LandingValues.Description), index.h("div", { class: "img-info" }, index.h("div", { class: "i-effect" }), index.h("img", { src: infoSvg })))), index.h("div", { class: "info-container" }, index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: idSvg })), index.h("h3", null, LandingValues.IdInfo)), index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: deviceSvg })), index.h("h3", null, LandingValues.DeviceInfo)), index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: validationSvg })), index.h("h3", null, LandingValues.SmsInfo))), index.h("div", { class: "terms-container" }, index.h("h3", { class: "font-size-2 mb-1 text-center" }, this.warningText)), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", type: "button", disabled: !state.initialised && this.buttonDisabled, onClick: () => this.startFlow() }, LandingValues.Button), index.h("p", { class: "main-text font-size-2 link-text mb-0", onClick: () => this.leaveFlow() }, LandingValues.ButtonLeave), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, LandingValues.FooterText))))));
6573
6571
  }
6574
6572
  };
6575
6573
  LandingValidation.style = landingValidationCss;
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["agreement-check_18.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"idSide":[32],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"]]],[0,"id-double-side",{"device":[16],"showTimeout":[32],"showInvalid":[32],"showHowTo":[32],"front":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"photoIdBackCapture","captureIdBackImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"id-single-side",{"device":[16],"showTimeout":[32],"showHowTo":[32],"idFlow":[32]},[[0,"captureErrorDone","captureErrorDone"],[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"photoIdCapture","captureIdImage"],[0,"verificationFinished","verificationFinished"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"device":[16],"showError":[32],"showHowTo":[32],"selfieFlow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-info",{"agreementsChecked":[32],"termsChecked":[32],"openAgreements":[32],"openTerms":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{"device":[16],"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"landing-validation",{"device":[16],"warningText":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32],"prefilledPhone":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"phoneNumber":[32],"code":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-back-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"verificationFinished","verificationFinished"],[0,"takePhoto","takePhoto"]]],[0,"selfie-capture",{"device":[16],"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"uploadingLink":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32]}],[0,"id-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"capture-error",{"type":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"how-to-info",{"idSide":[1,"id-side"],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"device":[16],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
17
+ return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["agreement-check_18.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"idSide":[32],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"]]],[0,"id-double-side",{"device":[16],"showTimeout":[32],"showInvalid":[32],"showHowTo":[32],"front":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"photoIdBackCapture","captureIdBackImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"id-single-side",{"device":[16],"showTimeout":[32],"showHowTo":[32],"idFlow":[32]},[[0,"captureErrorDone","captureErrorDone"],[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"photoIdCapture","captureIdImage"],[0,"verificationFinished","verificationFinished"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"device":[16],"showError":[32],"showHowTo":[32],"selfieFlow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-info",{"agreementsChecked":[32],"termsChecked":[32],"openAgreements":[32],"openTerms":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{"device":[16],"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"landing-validation",{"device":[16],"warningText":[32],"buttonDisabled":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32],"prefilledPhone":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"phoneNumber":[32],"code":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-back-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"verificationFinished","verificationFinished"],[0,"takePhoto","takePhoto"]]],[0,"selfie-capture",{"device":[16],"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"uploadingLink":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32]}],[0,"id-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"capture-error",{"type":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"how-to-info",{"idSide":[1,"id-side"],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"device":[16],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -17,7 +17,7 @@ const patchBrowser = () => {
17
17
  };
18
18
 
19
19
  patchBrowser().then(options => {
20
- return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["agreement-check_18.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"idSide":[32],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"]]],[0,"id-double-side",{"device":[16],"showTimeout":[32],"showInvalid":[32],"showHowTo":[32],"front":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"photoIdBackCapture","captureIdBackImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"id-single-side",{"device":[16],"showTimeout":[32],"showHowTo":[32],"idFlow":[32]},[[0,"captureErrorDone","captureErrorDone"],[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"photoIdCapture","captureIdImage"],[0,"verificationFinished","verificationFinished"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"device":[16],"showError":[32],"showHowTo":[32],"selfieFlow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-info",{"agreementsChecked":[32],"termsChecked":[32],"openAgreements":[32],"openTerms":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{"device":[16],"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"landing-validation",{"device":[16],"warningText":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32],"prefilledPhone":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"phoneNumber":[32],"code":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-back-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"verificationFinished","verificationFinished"],[0,"takePhoto","takePhoto"]]],[0,"selfie-capture",{"device":[16],"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"uploadingLink":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32]}],[0,"id-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"capture-error",{"type":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"how-to-info",{"idSide":[1,"id-side"],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"device":[16],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
20
+ return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["agreement-check_18.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"idSide":[32],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"]]],[0,"id-double-side",{"device":[16],"showTimeout":[32],"showInvalid":[32],"showHowTo":[32],"front":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"photoIdBackCapture","captureIdBackImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"id-single-side",{"device":[16],"showTimeout":[32],"showHowTo":[32],"idFlow":[32]},[[0,"captureErrorDone","captureErrorDone"],[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"photoIdCapture","captureIdImage"],[0,"verificationFinished","verificationFinished"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"device":[16],"showError":[32],"showHowTo":[32],"selfieFlow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-info",{"agreementsChecked":[32],"termsChecked":[32],"openAgreements":[32],"openTerms":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{"device":[16],"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"landing-validation",{"device":[16],"warningText":[32],"buttonDisabled":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32],"prefilledPhone":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"phoneNumber":[32],"code":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-back-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"verificationFinished","verificationFinished"],[0,"takePhoto","takePhoto"]]],[0,"selfie-capture",{"device":[16],"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"uploadingLink":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32]}],[0,"id-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"capture-error",{"type":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"how-to-info",{"idSide":[1,"id-side"],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"device":[16],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
21
21
  });
22
22
 
23
23
  exports.setNonce = index.setNonce;
@@ -2,7 +2,6 @@ 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';
6
5
  import { ApiCall } from '../../../helpers/ApiCall';
7
6
  import { FlowSteps } from '../../../models/FlowSteps';
8
7
  export class CameraError {
@@ -27,27 +26,18 @@ export class CameraError {
27
26
  catch (e) {
28
27
  this.apiErrorEvent.emit(e);
29
28
  }
30
- this.demoVideo.src = CameraErrorValues.HowToLink;
31
- this.demoVideo.play();
29
+ if (!this.device.isIos) {
30
+ this.demoVideo.src = CameraErrorValues.HowToLink;
31
+ this.demoVideo.loop = true;
32
+ this.demoVideo.play();
33
+ }
32
34
  }
33
35
  async buttonClick() {
34
36
  this.buttonDisabled = true;
35
- if (!(await Cameras.InitCameras(this.device))) {
36
- this.buttonDisabled = false;
37
- return;
38
- }
39
- if (store.agreementsValidation) {
40
- store.flowStatus = FlowStatus.AGREEMENT;
41
- }
42
- else if (store.phoneValidation) {
43
- store.flowStatus = FlowStatus.PHONE;
44
- }
45
- else {
46
- store.flowStatus = FlowStatus.ID;
47
- }
37
+ store.flowStatus = FlowStatus.LANDING;
48
38
  }
49
39
  render() {
50
- 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("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))))));
40
+ 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))))));
51
41
  }
52
42
  static get is() { return "camera-error"; }
53
43
  static get originalStyleUrls() {
@@ -15,9 +15,11 @@ export class LandingValidation {
15
15
  constructor() {
16
16
  this.device = undefined;
17
17
  this.warningText = undefined;
18
+ this.buttonDisabled = undefined;
18
19
  }
19
20
  async componentWillLoad() {
20
21
  this.apiCall = new ApiCall();
22
+ this.buttonDisabled = false;
21
23
  await this.initRequest();
22
24
  }
23
25
  async componentDidLoad() {
@@ -40,6 +42,7 @@ export class LandingValidation {
40
42
  }
41
43
  async startFlow() {
42
44
  if (store.initialised) {
45
+ this.buttonDisabled = true;
43
46
  if (!(await Cameras.InitCameras(this.device))) {
44
47
  store.flowStatus = FlowStatus.CAMERAERROR;
45
48
  return;
@@ -56,6 +59,8 @@ export class LandingValidation {
56
59
  }
57
60
  }
58
61
  async leaveFlow() {
62
+ if (this.buttonDisabled)
63
+ return;
59
64
  store.initialised = false;
60
65
  try {
61
66
  await this.apiCall.AbortRequest();
@@ -67,7 +72,7 @@ export class LandingValidation {
67
72
  }
68
73
  }
69
74
  render() {
70
- return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", null, h("h1", { class: "text-center" }, LandingValues.Title), h("div", { class: "d-flex space-between align-center" }, h("p", { class: "main-text font-size-2" }, LandingValues.Description), h("div", { class: "img-info" }, h("div", { class: "i-effect" }), h("img", { src: info })))), h("div", { class: "info-container" }, h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idSvg })), h("h3", null, LandingValues.IdInfo)), h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idDevice })), h("h3", null, LandingValues.DeviceInfo)), h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idValidation })), h("h3", null, 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: !store.initialised, onClick: () => this.startFlow() }, LandingValues.Button), h("p", { class: "main-text font-size-2 link-text mb-0", onClick: () => this.leaveFlow() }, LandingValues.ButtonLeave), h("p", { class: "main-text font-size-18 text-right mb-0" }, LandingValues.FooterText))))));
75
+ return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", null, h("h1", { class: "text-center" }, LandingValues.Title), h("div", { class: "d-flex space-between align-center" }, h("p", { class: "main-text font-size-2" }, LandingValues.Description), h("div", { class: "img-info" }, h("div", { class: "i-effect" }), h("img", { src: info })))), h("div", { class: "info-container" }, h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idSvg })), h("h3", null, LandingValues.IdInfo)), h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idDevice })), h("h3", null, LandingValues.DeviceInfo)), h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idValidation })), h("h3", null, 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: !store.initialised && this.buttonDisabled, onClick: () => this.startFlow() }, LandingValues.Button), h("p", { class: "main-text font-size-2 link-text mb-0", onClick: () => this.leaveFlow() }, LandingValues.ButtonLeave), h("p", { class: "main-text font-size-18 text-right mb-0" }, LandingValues.FooterText))))));
71
76
  }
72
77
  static get is() { return "landing-validation"; }
73
78
  static get originalStyleUrls() {
@@ -106,7 +111,8 @@ export class LandingValidation {
106
111
  }
107
112
  static get states() {
108
113
  return {
109
- "warningText": {}
114
+ "warningText": {},
115
+ "buttonDisabled": {}
110
116
  };
111
117
  }
112
118
  static get events() {
@@ -102,14 +102,15 @@ export class Cameras {
102
102
  let cameras = await cam.GetCameras(device);
103
103
  var recommCamera = cam.GetRecommendedCamera(cameras);
104
104
  store.cameraIds = cameras.map(camera => camera.deviceId);
105
- store.cameraId = recommCamera;
105
+ store.cameraId = recommCamera.deviceId;
106
106
  return true;
107
107
  }
108
108
  catch (e) {
109
109
  console.log(e);
110
110
  if (e.message.includes('Permission denied') || e.name.includes('NotAllowedError')) {
111
+ return false;
111
112
  }
113
+ throw e;
112
114
  }
113
- return false;
114
115
  }
115
116
  }