@ekyc_qoobiss/qbs-ect-cmp 3.6.64 → 3.6.66

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.
Files changed (28) hide show
  1. package/dist/cjs/{TranslationUtils-fbb2c39c.js → TranslationUtils-eeb71e60.js} +15 -10
  2. package/dist/cjs/agreement-check_17.cjs.entry.js +136 -90
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/qbs-ect-cmp.cjs.js +1 -1
  5. package/dist/cjs/random-actions.cjs.entry.js +1 -1
  6. package/dist/collection/components/common/how-to-info/how-to-info.js +25 -25
  7. package/dist/collection/components/common/id-capture/id-capture.js +0 -6
  8. package/dist/collection/components/flow/process-id/process-id.js +50 -42
  9. package/dist/collection/components/flow/user-liveness/user-liveness.js +47 -38
  10. package/dist/collection/components/identification-component/identification-component.js +25 -0
  11. package/dist/collection/models/FlowStatus.js +15 -11
  12. package/dist/esm/{TranslationUtils-32c06882.js → TranslationUtils-21a568f6.js} +15 -10
  13. package/dist/esm/agreement-check_17.entry.js +136 -90
  14. package/dist/esm/loader.js +1 -1
  15. package/dist/esm/qbs-ect-cmp.js +1 -1
  16. package/dist/esm/random-actions.entry.js +1 -1
  17. package/dist/qbs-ect-cmp/p-2735b5f4.js +1 -0
  18. package/dist/qbs-ect-cmp/{p-fc771dd3.entry.js → p-4fef4884.entry.js} +1 -1
  19. package/dist/qbs-ect-cmp/{p-98a9c331.entry.js → p-87851dcb.entry.js} +2 -2
  20. package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
  21. package/dist/types/components/common/how-to-info/how-to-info.d.ts +3 -2
  22. package/dist/types/components/flow/process-id/process-id.d.ts +3 -1
  23. package/dist/types/components/flow/user-liveness/user-liveness.d.ts +3 -2
  24. package/dist/types/components.d.ts +0 -1
  25. package/dist/types/models/CaptureFlow.d.ts +0 -1
  26. package/dist/types/models/FlowStatus.d.ts +15 -10
  27. package/package.json +1 -1
  28. package/dist/qbs-ect-cmp/p-601c9197.js +0 -1
@@ -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-32c06882.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-21a568f6.js';
3
3
 
4
4
  const agreementCheckCss = "";
5
5
 
@@ -4791,46 +4791,64 @@ const ErrorEnd = class {
4791
4791
  };
4792
4792
  ErrorEnd.style = errorEndCss;
4793
4793
 
4794
+ var IDPose;
4795
+ (function (IDPose) {
4796
+ IDPose[IDPose["Straight"] = 0] = "Straight";
4797
+ IDPose[IDPose["Tilted"] = 1] = "Tilted";
4798
+ IDPose[IDPose["Rotate"] = 2] = "Rotate";
4799
+ IDPose[IDPose["BackStraight"] = 3] = "BackStraight";
4800
+ IDPose[IDPose["BackTilted"] = 4] = "BackTilted";
4801
+ })(IDPose || (IDPose = {}));
4802
+
4794
4803
  const howToInfoCss = "";
4795
4804
 
4796
4805
  const HowToInfo = class {
4797
- constructor(hostRef) { registerInstance(this, hostRef); this.eventHowToInfoDone = createEvent(this, "howToInfoDone", 7); this.apiErrorEvent = createEvent(this, "apiError", 7); this.topTitle = undefined; this.subTitle = undefined; this.imagePath = undefined; this.buttonText = undefined; this.buttonEnabled = undefined; }
4806
+ constructor(hostRef) { registerInstance(this, hostRef); this.apiErrorEvent = createEvent(this, "apiError", 7); this.showVideo = undefined; this.topTitle = undefined; this.subTitle = undefined; this.imagePath = undefined; this.buttonText = undefined; this.buttonEnabled = undefined; this.demoVideo = undefined; }
4798
4807
  async componentDidLoad() {
4799
4808
  await BaseComponent.initialize(this.currentStep);
4800
4809
  }
4801
4810
  async disconnectedCallback() {
4802
4811
  await BaseComponent.finalize(this.currentStep);
4803
4812
  }
4804
- buttonClick() {
4813
+ async buttonClick() {
4805
4814
  this.buttonEnabled = false;
4806
- this.eventHowToInfoDone.emit();
4815
+ state.flowStatus = await ApiCall.instance.GetNextFlowState();
4807
4816
  }
4808
4817
  async componentWillLoad() {
4818
+ this.showVideo = false;
4809
4819
  this.translations = await Translations.getValues();
4810
4820
  this.subTitle = '';
4811
4821
  this.buttonEnabled = true;
4812
4822
  this.topTitle = this.translations.HowToValues.IdTitile;
4813
4823
  this.imagePath = 'https://ekyc.blob.core.windows.net/$web/howto_id.png';
4814
4824
  this.buttonText = this.translations.HowToValues.IdButton;
4815
- if (state.flowStatus == FlowStatus.IDFRONT) {
4825
+ if (state.flowStatus == FlowStatus.IDFRONTHOWTO) {
4816
4826
  this.currentStep = FlowSteps.CiFrontHowTo;
4817
4827
  this.subTitle = this.translations.HowToValues.IdSubTitileFace;
4818
4828
  }
4819
- else if (state.flowStatus == FlowStatus.IDBACK) {
4829
+ else if (state.flowStatus == FlowStatus.IDBACKHOWTO) {
4830
+ this.showVideo = true;
4820
4831
  this.currentStep = FlowSteps.CiBackHowTo;
4821
- this.subTitle = this.translations.HowToValues.IdSubTitileBack;
4832
+ this.subTitle = '';
4833
+ this.topTitle = this.translations.IdCaptureValues.TitleBack;
4834
+ this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Rotate];
4835
+ this.demoVideo.play();
4836
+ await delay(this.translations.GlobalValues.VideoLenght);
4837
+ await this.buttonClick();
4822
4838
  }
4823
- if (state.flowStatus == FlowStatus.LIVENESS) {
4839
+ else if (state.flowStatus == FlowStatus.LIVENESSHOWTO) {
4824
4840
  this.currentStep = FlowSteps.SelfieHowTo;
4825
4841
  this.topTitle = this.translations.HowToValues.SelfieTitile;
4826
4842
  this.subTitle = this.translations.HowToValues.SelfieSubTitile;
4827
4843
  this.imagePath = 'https://ekyc.blob.core.windows.net/$web/howto_selfie.png';
4828
4844
  this.buttonText = this.translations.HowToValues.SelfieButton;
4829
4845
  }
4846
+ else if (state.flowStatus == FlowStatus.LIVENESSGESTUREHOWTO) {
4847
+ await this.buttonClick();
4848
+ }
4830
4849
  }
4831
4850
  render() {
4832
- let sub = this.subTitle != '' ? h("p", { class: "font-size-2" }, this.subTitle) : null;
4833
- return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", { class: "div-ci align-center" }, h("img", { src: this.imagePath })), h("div", { class: "text-center" }, h("h1", null, this.topTitle), sub), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
4851
+ return (h("div", { class: "container" }, h("div", { class: "row", hidden: state.flowStatus == FlowStatus.LIVENESSGESTUREHOWTO }, h("div", { class: "div-ci align-center", hidden: this.showVideo }, h("img", { src: this.imagePath })), h("div", { hidden: this.showVideo == false }, h("video", { id: "howTo", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { class: "text-center" }, h("h1", null, this.topTitle), h("p", { class: "font-size-2", hidden: this.subTitle == '' }, this.subTitle)), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick(), hidden: this.showVideo == true }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
4834
4852
  }
4835
4853
  };
4836
4854
  HowToInfo.style = howToInfoCss;
@@ -4977,15 +4995,6 @@ class Cameras {
4977
4995
  }
4978
4996
  }
4979
4997
 
4980
- var IDPose;
4981
- (function (IDPose) {
4982
- IDPose[IDPose["Straight"] = 0] = "Straight";
4983
- IDPose[IDPose["Tilted"] = 1] = "Tilted";
4984
- IDPose[IDPose["Rotate"] = 2] = "Rotate";
4985
- IDPose[IDPose["BackStraight"] = 3] = "BackStraight";
4986
- IDPose[IDPose["BackTilted"] = 4] = "BackTilted";
4987
- })(IDPose || (IDPose = {}));
4988
-
4989
4998
  const idCaptureCss = ".logo{max-height:450px;max-width:450px}.canvas-on-video{max-width:100%;max-height:100%;position:absolute;z-index:2;transform:scale(-1, 1)}";
4990
4999
 
4991
5000
  const IdCapture = class {
@@ -5044,12 +5053,6 @@ const IdCapture = class {
5044
5053
  console.log('id-capture | componentDidLoad');
5045
5054
  this.initVariables();
5046
5055
  await BaseComponent.logStep(this.flowStep, FlowMoments.Initialized);
5047
- if (state.flowStatus == FlowStatus.IDBACK) {
5048
- this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Rotate];
5049
- this.demoVideo.play();
5050
- await delay(this.translations.GlobalValues.VideoLenght);
5051
- this.titleMesage = this.translations.IdCaptureValues.TitleBack;
5052
- }
5053
5056
  this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[this.pose];
5054
5057
  this.demoVideo.play();
5055
5058
  await delay(this.translations.GlobalValues.VideoLenght);
@@ -5204,7 +5207,7 @@ function v4(options, buf, offset) {
5204
5207
  }
5205
5208
 
5206
5209
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
5207
- const version$1 = "3.6.64";
5210
+ const version$1 = "3.6.66";
5208
5211
  const description = "Person Identification Component";
5209
5212
  const main = "./dist/index.cjs.js";
5210
5213
  const module = "./dist/index.js";
@@ -5534,26 +5537,51 @@ const IdentificationComponent = class {
5534
5537
  else if (state.flowStatus == FlowStatus.CODEERROR) {
5535
5538
  currentBlock = h("sms-code-validation", null);
5536
5539
  }
5540
+ else if (state.flowStatus == FlowStatus.IDFRONTHOWTO) {
5541
+ if (state.debug)
5542
+ console.log('identification-component | render | IDFRONTHOWTO');
5543
+ currentBlock = h("how-to-info", null);
5544
+ }
5537
5545
  else if (state.flowStatus == FlowStatus.IDFRONT) {
5538
5546
  if (state.debug)
5539
5547
  console.log('identification-component | render | IDFRONT');
5540
5548
  currentBlock = h("process-id", { id: "processIdFront", mode: "front" });
5541
5549
  }
5550
+ else if (state.flowStatus == FlowStatus.IDBACKHOWTO) {
5551
+ if (state.debug)
5552
+ console.log('identification-component | render | IDBACKHOWTO');
5553
+ currentBlock = h("how-to-info", null);
5554
+ }
5542
5555
  else if (state.flowStatus == FlowStatus.IDBACK) {
5543
5556
  if (state.debug)
5544
5557
  console.log('identification-component | render | IDBACK');
5545
5558
  currentBlock = h("process-id", { id: "processIdBack", mode: "back" });
5546
5559
  }
5560
+ else if (state.flowStatus == FlowStatus.IDTILTHOWTO) {
5561
+ if (state.debug)
5562
+ console.log('identification-component | render | IDTILTHOWTO');
5563
+ currentBlock = h("how-to-info", null);
5564
+ }
5547
5565
  else if (state.flowStatus == FlowStatus.IDTILT) {
5548
5566
  if (state.debug)
5549
5567
  console.log('identification-component | render | TILT');
5550
5568
  currentBlock = h("process-id", { id: "processIdTilt", mode: "tilt" });
5551
5569
  }
5570
+ else if (state.flowStatus == FlowStatus.LIVENESSHOWTO) {
5571
+ if (state.debug)
5572
+ console.log('identification-component | render | LIVENESSHOWTO');
5573
+ currentBlock = h("how-to-info", null);
5574
+ }
5552
5575
  else if (state.flowStatus == FlowStatus.LIVENESS) {
5553
5576
  if (state.debug)
5554
5577
  console.log('identification-component | render | LIVENESS');
5555
5578
  currentBlock = h("user-liveness", { id: "userLiveness", mode: "selfie" });
5556
5579
  }
5580
+ else if (state.flowStatus == FlowStatus.LIVENESSGESTUREHOWTO) {
5581
+ if (state.debug)
5582
+ console.log('identification-component | render | LIVENESSGESTUREHOWTO');
5583
+ currentBlock = h("how-to-info", null);
5584
+ }
5557
5585
  else if (state.flowStatus == FlowStatus.LIVENESSGESTURE) {
5558
5586
  if (state.debug)
5559
5587
  console.log('identification-component | render | LIVENESSGESTURE');
@@ -8642,45 +8670,33 @@ const ProcessId = class {
8642
8670
  if (this.mode == 'front') {
8643
8671
  this.currentStep = FlowSteps.CiFront;
8644
8672
  this.flow = {
8645
- capture: {
8646
- fileName: 'idImage.png',
8647
- recName: 'idVideo.',
8648
- photoType: CaptureUploadTypes.IdFront,
8649
- recType: CaptureUploadTypes.IdFrontVideo,
8650
- },
8651
- howToDone: false,
8673
+ fileName: 'idImage.png',
8674
+ recName: 'idVideo.',
8675
+ photoType: CaptureUploadTypes.IdFront,
8676
+ recType: CaptureUploadTypes.IdFrontVideo,
8652
8677
  };
8653
8678
  }
8654
8679
  else if (this.mode == 'back') {
8655
8680
  this.currentStep = FlowSteps.CiBack;
8656
8681
  this.flow = {
8657
- capture: {
8658
- fileName: 'idBackImage.png',
8659
- recName: 'idBackVideo.',
8660
- photoType: CaptureUploadTypes.IdBack,
8661
- recType: CaptureUploadTypes.IdBackVideo,
8662
- },
8663
- howToDone: false,
8682
+ fileName: 'idBackImage.png',
8683
+ recName: 'idBackVideo.',
8684
+ photoType: CaptureUploadTypes.IdBack,
8685
+ recType: CaptureUploadTypes.IdBackVideo,
8664
8686
  };
8665
8687
  }
8666
8688
  else if (this.mode == 'tilt') {
8667
8689
  this.currentStep = FlowSteps.CiTilt;
8668
8690
  this.flow = {
8669
- capture: {
8670
- fileName: 'idTiltImage.png',
8671
- recName: 'idTiltVideo.',
8672
- photoType: CaptureUploadTypes.None,
8673
- recType: CaptureUploadTypes.TiltVideo,
8674
- },
8675
- howToDone: false,
8691
+ fileName: 'idTiltImage.png',
8692
+ recName: 'idTiltVideo.',
8693
+ photoType: CaptureUploadTypes.None,
8694
+ recType: CaptureUploadTypes.TiltVideo,
8676
8695
  };
8677
8696
  }
8678
8697
  if (state.debug)
8679
8698
  console.log('process-id | initFlow');
8680
8699
  }
8681
- howToDone() {
8682
- this.flow.howToDone = true;
8683
- }
8684
8700
  timeElapsed() {
8685
8701
  this.errorReason = 'Timeout';
8686
8702
  this.showTimeout = true;
@@ -8707,8 +8723,8 @@ const ProcessId = class {
8707
8723
  return;
8708
8724
  }
8709
8725
  try {
8710
- let frontCapture = new File([idPhoto], this.flow.capture.fileName, { type: 'image/png' });
8711
- var uploadResult = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.capture.photoType, frontCapture);
8726
+ let frontCapture = new File([idPhoto], this.flow.fileName, { type: 'image/png' });
8727
+ var uploadResult = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.photoType, frontCapture);
8712
8728
  if (state.debug)
8713
8729
  console.log('process-id | captureIdImage | uploadResult: ' + uploadResult);
8714
8730
  if (uploadResult.isValid) {
@@ -8739,8 +8755,8 @@ const ProcessId = class {
8739
8755
  return;
8740
8756
  }
8741
8757
  let mimeType = idRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
8742
- let captureRec = new File([idRecording], this.flow.capture.recName + mimeType.extension, { type: mimeType.type });
8743
- var uploadResult = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.capture.recType, captureRec);
8758
+ let captureRec = new File([idRecording], this.flow.recName + mimeType.extension, { type: mimeType.type });
8759
+ var uploadResult = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.recType, captureRec);
8744
8760
  if (state.debug)
8745
8761
  console.log('process-id | capturedIdRecording | uploadResult: ' + uploadResult);
8746
8762
  if (uploadResult.saved) {
@@ -8751,6 +8767,32 @@ const ProcessId = class {
8751
8767
  }
8752
8768
  this.recordingResultCount = 0;
8753
8769
  }
8770
+ async verificationFinished() {
8771
+ if (state.debug)
8772
+ console.log('process-id | verificationFinished');
8773
+ this.verificationReceived = Date.now();
8774
+ let initialStatus = state.flowStatus;
8775
+ let statusChanged = false;
8776
+ while (Date.now() - this.verificationReceived < 25000 && !statusChanged) {
8777
+ await delay(2000);
8778
+ statusChanged = initialStatus != state.flowStatus;
8779
+ }
8780
+ if (!statusChanged) {
8781
+ let currentStatus = await ApiCall.instance.GetFlowState();
8782
+ if (currentStatus != state.flowStatus) {
8783
+ state.flowStatus = currentStatus;
8784
+ }
8785
+ else {
8786
+ this.triggerUploadFailedFlow();
8787
+ }
8788
+ }
8789
+ if (state.debug)
8790
+ console.log('process-id | verificationFinished | waitingFinished ');
8791
+ }
8792
+ triggerUploadFailedFlow() {
8793
+ this.errorReason = 'Upload Failed';
8794
+ this.showInvalid = true;
8795
+ }
8754
8796
  async componentDidLoad() {
8755
8797
  if (state.debug)
8756
8798
  console.log('process-id | componentDidLoad');
@@ -8779,16 +8821,10 @@ const ProcessId = class {
8779
8821
  render() {
8780
8822
  let error = h("capture-error", { type: "ID", reason: this.errorReason });
8781
8823
  let capture = h("id-capture", null);
8782
- let howTo = h("how-to-info", null);
8783
8824
  if (this.showInvalid || this.showTimeout) {
8784
8825
  return error;
8785
8826
  }
8786
- if (state.flowStatus != FlowStatus.IDTILT && this.flow.howToDone) {
8787
- return howTo;
8788
- }
8789
- else {
8790
- return capture;
8791
- }
8827
+ return capture;
8792
8828
  }
8793
8829
  };
8794
8830
  ProcessId.style = processIdCss;
@@ -9018,38 +9054,28 @@ const UserLiveness = class {
9018
9054
  this.showError = undefined;
9019
9055
  this.showTimeout = undefined;
9020
9056
  this.flow = undefined;
9021
- this.howToDone = false;
9022
9057
  }
9023
9058
  async componentDidLoad() { }
9024
9059
  componentWillLoad() {
9025
9060
  if (this.mode == 'selfie') {
9026
9061
  this.currentStep = FlowSteps.Selfie;
9027
9062
  this.flow = {
9028
- capture: {
9029
- fileName: 'selfie.png',
9030
- recName: 'selfieVideo.',
9031
- photoType: CaptureUploadTypes.Selfie,
9032
- recType: CaptureUploadTypes.SelfieVideo,
9033
- },
9034
- howToDone: false,
9063
+ fileName: 'selfie.png',
9064
+ recName: 'selfieVideo.',
9065
+ photoType: CaptureUploadTypes.Selfie,
9066
+ recType: CaptureUploadTypes.SelfieVideo,
9035
9067
  };
9036
9068
  }
9037
9069
  else if (this.mode == 'selfieGesture') {
9038
9070
  this.currentStep = FlowSteps.SelfieTilt;
9039
9071
  this.flow = {
9040
- capture: {
9041
- fileName: '',
9042
- recName: 'selfieTiltVideo.',
9043
- photoType: CaptureUploadTypes.None,
9044
- recType: CaptureUploadTypes.SelfieGestureVideo,
9045
- },
9046
- howToDone: false,
9072
+ fileName: '',
9073
+ recName: 'selfieTiltVideo.',
9074
+ photoType: CaptureUploadTypes.None,
9075
+ recType: CaptureUploadTypes.SelfieGestureVideo,
9047
9076
  };
9048
9077
  }
9049
9078
  }
9050
- howToDoneEvent() {
9051
- this.howToDone = true;
9052
- }
9053
9079
  timeElapsed() {
9054
9080
  this.errorReason = 'Timeout';
9055
9081
  this.showTimeout = true;
@@ -9072,8 +9098,8 @@ const UserLiveness = class {
9072
9098
  return;
9073
9099
  }
9074
9100
  try {
9075
- var uploadPhoto = new File([selfiePhoto], this.flow.capture.fileName, { type: 'image/png' });
9076
- let photoUploaded = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.capture.photoType, uploadPhoto);
9101
+ var uploadPhoto = new File([selfiePhoto], this.flow.fileName, { type: 'image/png' });
9102
+ let photoUploaded = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.photoType, uploadPhoto);
9077
9103
  if (photoUploaded.isValid) {
9078
9104
  state.flowStatus = FlowStatus[photoUploaded.state];
9079
9105
  }
@@ -9099,8 +9125,8 @@ const UserLiveness = class {
9099
9125
  }
9100
9126
  let mimeType = selfieRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
9101
9127
  try {
9102
- let uploadRec = new File([selfieRecording], this.flow.capture.recName + mimeType.extension, { type: mimeType.type });
9103
- let uplodDone = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.capture.recType, uploadRec);
9128
+ let uploadRec = new File([selfieRecording], this.flow.recName + mimeType.extension, { type: mimeType.type });
9129
+ let uplodDone = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.recType, uploadRec);
9104
9130
  if (uplodDone.saved) {
9105
9131
  state.flowStatus = FlowStatus[uplodDone.state];
9106
9132
  }
@@ -9118,6 +9144,32 @@ const UserLiveness = class {
9118
9144
  }
9119
9145
  }
9120
9146
  }
9147
+ async verificationFinished() {
9148
+ if (state.debug)
9149
+ console.log('user-liveness | verificationFinished');
9150
+ this.verificationReceived = Date.now();
9151
+ let initialStatus = state.flowStatus;
9152
+ let statusChanged = false;
9153
+ while (Date.now() - this.verificationReceived < 25000 && !statusChanged) {
9154
+ await delay(2000);
9155
+ statusChanged = initialStatus != state.flowStatus;
9156
+ }
9157
+ if (!statusChanged) {
9158
+ let currentStatus = await ApiCall.instance.GetFlowState();
9159
+ if (currentStatus != state.flowStatus) {
9160
+ state.flowStatus = currentStatus;
9161
+ }
9162
+ else {
9163
+ this.triggerUploadFailedFlow();
9164
+ }
9165
+ }
9166
+ if (state.debug)
9167
+ console.log('user-liveness | verificationFinished | waitingFinished ');
9168
+ }
9169
+ triggerUploadFailedFlow() {
9170
+ this.errorReason = 'Upload Failed';
9171
+ this.showError = true;
9172
+ }
9121
9173
  async disconnectedCallback() {
9122
9174
  await BaseComponent.finalize(this.currentStep);
9123
9175
  }
@@ -9126,18 +9178,12 @@ const UserLiveness = class {
9126
9178
  this.showError = true;
9127
9179
  }
9128
9180
  render() {
9129
- let howTo = h("how-to-info", null);
9130
9181
  let capture = h("selfie-capture", null);
9131
9182
  let error = h("capture-error", { type: "LIVENESS", reason: this.errorReason });
9132
9183
  if (this.showError || this.showTimeout) {
9133
9184
  return error;
9134
9185
  }
9135
- if (this.howToDone) {
9136
- return capture;
9137
- }
9138
- else {
9139
- return howTo;
9140
- }
9186
+ return capture;
9141
9187
  }
9142
9188
  };
9143
9189
  UserLiveness.style = userLivenessCss;
@@ -11,7 +11,7 @@ const patchEsm = () => {
11
11
  const defineCustomElements = (win, options) => {
12
12
  if (typeof window === 'undefined') return Promise.resolve();
13
13
  return patchEsm().then(() => {
14
- return bootstrapLazy([["loader-dots",[[1,"loader-dots"]]],["random-actions",[[0,"random-actions"]]],["agreement-check_17",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"lang_iso":[1537],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"],[9,"scroll","handleScroll"]]],[0,"process-id",{"mode":[1],"showTimeout":[32],"showInvalid":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"mode":[1],"showError":[32],"showTimeout":[32],"flow":[32],"howToDone":[32]},[[0,"howToInfoDone","howToDoneEvent"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"]]],[0,"agreement-info",{"agreementsChecked":[32],"termsChecked":[32],"openAgreements":[32],"openTerms":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"landing-validation",{"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],"code":[32],"canSend":[32]}],[0,"sms-send",{"buttonText":[32],"title":[32],"details":[32],"phoneNumber":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-capture",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32],"scrollClass":[32]}],[0,"capture-error",{"type":[1],"reason":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"how-to-info",{"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
14
+ return bootstrapLazy([["loader-dots",[[1,"loader-dots"]]],["random-actions",[[0,"random-actions"]]],["agreement-check_17",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"lang_iso":[1537],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"],[9,"scroll","handleScroll"]]],[0,"process-id",{"mode":[1],"showTimeout":[32],"showInvalid":[32],"flow":[32]},[[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"user-liveness",{"mode":[1],"showError":[32],"showTimeout":[32],"flow":[32]},[[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",{"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"how-to-info",{"showVideo":[32],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32],"demoVideo":[32]}],[0,"landing-validation",{"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],"code":[32],"canSend":[32]}],[0,"sms-send",{"buttonText":[32],"title":[32],"details":[32],"phoneNumber":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-capture",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32],"scrollClass":[32]}],[0,"capture-error",{"type":[1],"reason":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
15
15
  });
16
16
  };
17
17
 
@@ -14,5 +14,5 @@ const patchBrowser = () => {
14
14
  };
15
15
 
16
16
  patchBrowser().then(options => {
17
- return bootstrapLazy([["loader-dots",[[1,"loader-dots"]]],["random-actions",[[0,"random-actions"]]],["agreement-check_17",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"lang_iso":[1537],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"],[9,"scroll","handleScroll"]]],[0,"process-id",{"mode":[1],"showTimeout":[32],"showInvalid":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"mode":[1],"showError":[32],"showTimeout":[32],"flow":[32],"howToDone":[32]},[[0,"howToInfoDone","howToDoneEvent"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"]]],[0,"agreement-info",{"agreementsChecked":[32],"termsChecked":[32],"openAgreements":[32],"openTerms":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"landing-validation",{"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],"code":[32],"canSend":[32]}],[0,"sms-send",{"buttonText":[32],"title":[32],"details":[32],"phoneNumber":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-capture",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32],"scrollClass":[32]}],[0,"capture-error",{"type":[1],"reason":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"how-to-info",{"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
17
+ return bootstrapLazy([["loader-dots",[[1,"loader-dots"]]],["random-actions",[[0,"random-actions"]]],["agreement-check_17",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"lang_iso":[1537],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"],[9,"scroll","handleScroll"]]],[0,"process-id",{"mode":[1],"showTimeout":[32],"showInvalid":[32],"flow":[32]},[[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"user-liveness",{"mode":[1],"showError":[32],"showTimeout":[32],"flow":[32]},[[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",{"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"how-to-info",{"showVideo":[32],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32],"demoVideo":[32]}],[0,"landing-validation",{"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],"code":[32],"canSend":[32]}],[0,"sms-send",{"buttonText":[32],"title":[32],"details":[32],"phoneNumber":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-capture",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32],"scrollClass":[32]}],[0,"capture-error",{"type":[1],"reason":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
18
18
  });
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h } from './index-cf54a432.js';
2
- import { T as Translations } from './TranslationUtils-32c06882.js';
2
+ import { T as Translations } from './TranslationUtils-21a568f6.js';
3
3
 
4
4
  const randomActionsCss = "";
5
5
 
@@ -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.IDFRONTHOWTO=6]="IDFRONTHOWTO",t[t.IDFRONT=7]="IDFRONT",t[t.IDBACKHOWTO=8]="IDBACKHOWTO",t[t.IDBACK=9]="IDBACK",t[t.IDTILTHOWTO=10]="IDTILTHOWTO",t[t.IDTILT=11]="IDTILT",t[t.LIVENESSHOWTO=12]="LIVENESSHOWTO",t[t.LIVENESS=13]="LIVENESS",t[t.LIVENESSGESTUREHOWTO=14]="LIVENESSGESTUREHOWTO",t[t.LIVENESSGESTURE=15]="LIVENESSGESTURE",t[t.COMPLETE=16]="COMPLETE",t[t.ERROREND=17]="ERROREND",t[t.CAMERAERROR=18]="CAMERAERROR",t[t.ABORTED=19]="ABORTED",t[t.NONE=20]="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 l{}l.FlowStatusKey="qbs-ect-flowstatus",l.RequestIdKey="qbs-ect-requestid",l.TokenKey="qbs-ect-token",l.InitialisedKey="qbs-ect-initialised",l.HasIdBackKey="qbs-ect-has-id-back",l.AgreementValidationKey="qbs-ect-agreement-validation",l.PhoneValidationKey="qbs-ect-phone-validation",l.RefreshDoneKey="qbs-ect-refresh-done";class d{constructor(){this.uriEnv="/",this.uriEnv=["QA","DEMO"].includes(h.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:h,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))))},l="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)}),d=(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:l,get:r,set:c,on:d,onChange:(e,i)=>{const s=d("set",((t,s)=>{t===e&&i(s)})),n=d("reset",(()=>i(a(t)[e])));return()=>{s(),n()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(d("set",e.set)),e.get&&t.push(d("get",e.get)),e.reset&&t.push(d("reset",e.reset)),e.dispose&&t.push(d("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",logSteps:!1},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 p,w;u("environment",(t=>{h.debug="QA"==t})),u("flowStatus",(t=>{sessionStorage.setItem(l.FlowStatusKey,o[t])})),u("token",(t=>{sessionStorage.setItem(l.TokenKey,t)})),u("requestId",(t=>{sessionStorage.setItem(l.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"}(p||(p={})),function(t){t[t.Initialized="initialized"]="Initialized",t[t.Finalized="finalized"]="Finalized",t[t.None="none"]="None"}(w||(w={}));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 d}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(h.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+h.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(h.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+h.token}});return await this.http(n)}catch(i){this.AddLog("Error in post ",i);var a=new Request(h.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+h.token}});return await this.http(a)}}}async get(t,e=!0){var i=new Request(h.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+h.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(h.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+h.token}});return await this.http(s)}catch(e){this.AddLog("Error in get ",e);var n=new Request(h.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+h.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){h.debug&&console.log("Calling identity request with store:"+JSON.stringify(h));let i={requestId:h.requestId,clientDeviceInfo:JSON.stringify(t),redirectId:h.redirectId,phoneNumber:h.phoneNumber,version:e,demoMode:"DEMO"==h.environment},s=await this.post(this.urls.IdentityInsert,JSON.stringify(i));return""==h.requestId&&(h.requestId=s.requestId),h.phoneNumber=s.phoneNumber,h.flowStatus=o[s.state],h.logSteps=s.logSteps,h.debug=s.debug,!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 h.debug&&console.log(`apicall | uploadfileforrequestb64 | ${n}`),n}async GetAgreement(t){return(await this.get(this.urls.GetAgreement+"?type="+t+"&requestId="+h.requestId)).htmlText}async GenerateAgreement(t){let e={requestId:h.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:h.requestId,link:t,phoneNumber:e};return(await this.post(this.urls.SendLink,JSON.stringify(i))).sent}async AddLog(t,e){try{let i={requestId:h.requestId,action:o[h.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){if(0==h.logSteps)return;let i={requestId:h.requestId,redirectId:h.redirectId,step:p[t],moment:w[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:h.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:h.requestId,cameraIsAccessible:t}));return o[e.state]}async GetNextFlowState(){let t=await this.get(this.urls.NextFlowState+"?requestId="+h.requestId);return o[t.state]}async GetFlowState(){let t=await this.get(this.urls.CurrentFlowState+"?requestId="+h.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(h.langIso&&""!=h.langIso)return h.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,w as F,r as I,i as O,l as S,b as T,p as a,o as b,c,h as s}
@@ -1 +1 @@
1
- import{r as t,h as s}from"./p-8942656c.js";import{T as i}from"./p-601c9197.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}
1
+ import{r as t,h as s}from"./p-8942656c.js";import{T as i}from"./p-2735b5f4.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}