@ekyc_qoobiss/qbs-ect-cmp 3.6.40 → 3.6.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{TranslationUtils-bfe4477a.js → TranslationUtils-dd73945b.js} +31 -43
- package/dist/cjs/{agreement-check_19.cjs.entry.js → agreement-check_17.cjs.entry.js} +247 -821
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/qbs-ect-cmp.cjs.js +1 -1
- package/dist/cjs/random-actions.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -3
- package/dist/collection/components/common/how-to-info/how-to-info.js +11 -34
- package/dist/collection/components/common/id-capture/id-capture.js +39 -19
- package/dist/collection/components/common/selfie-capture/selfie-capture.js +26 -27
- package/dist/collection/components/controls/camera/camera.js +1 -3
- package/dist/collection/components/flow/agreement-info/agreement-info.js +4 -5
- package/dist/collection/components/flow/landing-validation/landing-validation.js +11 -19
- package/dist/collection/components/flow/mobile-redirect/mobile-redirect.js +1 -1
- package/dist/collection/components/flow/process-id/process-id.js +47 -161
- package/dist/collection/components/flow/sms-code-validation/sms-code-validation.js +7 -56
- package/dist/collection/components/flow/sms-send/sms-send.css +0 -0
- package/dist/collection/components/flow/sms-send/sms-send.js +91 -0
- package/dist/collection/components/flow/user-liveness/user-liveness.js +45 -118
- package/dist/collection/components/identification-component/identification-component.js +14 -41
- package/dist/collection/helpers/ApiCall.js +14 -15
- package/dist/collection/helpers/ML5.js +1 -1
- package/dist/collection/helpers/store.js +0 -18
- package/dist/collection/helpers/textValues.js +2 -0
- package/dist/collection/models/CaptureFlow.js +0 -16
- package/dist/collection/models/FlowStatus.js +16 -10
- package/dist/esm/{TranslationUtils-7e68bc94.js → TranslationUtils-741a728a.js} +31 -43
- package/dist/esm/{agreement-check_19.entry.js → agreement-check_17.entry.js} +247 -819
- package/dist/esm/loader.js +1 -1
- package/dist/esm/qbs-ect-cmp.js +1 -1
- package/dist/esm/random-actions.entry.js +1 -1
- package/dist/qbs-ect-cmp/p-87c689d6.js +1 -0
- package/dist/qbs-ect-cmp/{p-d1d9feaf.entry.js → p-a130edd5.entry.js} +1 -1
- package/dist/qbs-ect-cmp/{p-df2ea91b.entry.js → p-b3fa0a37.entry.js} +2 -2
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/components/common/how-to-info/how-to-info.d.ts +0 -1
- package/dist/types/components/common/id-capture/id-capture.d.ts +5 -1
- package/dist/types/components/common/selfie-capture/selfie-capture.d.ts +3 -2
- package/dist/types/components/flow/process-id/process-id.d.ts +0 -3
- package/dist/types/components/flow/sms-code-validation/sms-code-validation.d.ts +0 -3
- package/dist/types/components/flow/sms-send/sms-send.d.ts +17 -0
- package/dist/types/components/flow/user-liveness/user-liveness.d.ts +2 -6
- package/dist/types/components/identification-component/identification-component.d.ts +1 -2
- package/dist/types/components.d.ts +18 -62
- package/dist/types/helpers/ApiCall.d.ts +9 -3
- package/dist/types/helpers/textValues.d.ts +2 -0
- package/dist/types/models/CaptureFlow.d.ts +2 -19
- package/dist/types/models/FlowStatus.d.ts +18 -10
- package/dist/types/models/IAbortResult.d.ts +1 -0
- package/dist/types/models/IAddRequest.d.ts +1 -1
- package/dist/types/models/IEctStore.d.ts +0 -6
- package/dist/types/models/IOtpCheck.d.ts +1 -0
- package/dist/types/models/IOtpSend.d.ts +1 -0
- package/dist/types/models/IUploadFile.d.ts +1 -0
- package/package.json +1 -1
- package/dist/collection/components/common/id-back-capture/id-back-capture.css +0 -35
- package/dist/collection/components/common/id-back-capture/id-back-capture.js +0 -219
- package/dist/collection/components/common/id-tilt/id-tilt.css +0 -35
- package/dist/collection/components/common/id-tilt/id-tilt.js +0 -220
- package/dist/collection/components/common/selfie-tilt/selfie-tilt.css +0 -7
- package/dist/collection/components/common/selfie-tilt/selfie-tilt.js +0 -221
- package/dist/qbs-ect-cmp/p-d35256e9.js +0 -1
- package/dist/types/components/common/id-back-capture/id-back-capture.d.ts +0 -28
- package/dist/types/components/common/id-tilt/id-tilt.d.ts +0 -28
- package/dist/types/components/common/selfie-tilt/selfie-tilt.d.ts +0 -31
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import { h } from '@stencil/core';
|
|
2
|
-
import { Cameras } from '../../../helpers/Cameras';
|
|
3
|
-
import { Stream } from '../../../helpers/Stream';
|
|
4
|
-
import { SelfieCaptureValues } from '../../../helpers/textValues';
|
|
5
|
-
import { FaceML5Detector } from '../../../libs/FaceML5Detector/FaceML5Detector';
|
|
6
|
-
import { delay } from '../../../utils/utils';
|
|
7
|
-
import store from '../../../helpers/store';
|
|
8
|
-
import { BaseComponent } from '../../base-component';
|
|
9
|
-
import { FlowMoments, FlowSteps } from '../../../models/FlowSteps';
|
|
10
|
-
import { VerificationMode } from '../../../models/IVerificationMode';
|
|
11
|
-
import { Translations } from '../../../helpers/TranslationUtils';
|
|
12
|
-
export class SelfieTilt {
|
|
13
|
-
// @State() private animationPath: string;
|
|
14
|
-
constructor() {
|
|
15
|
-
this.photoIsReady = photos => {
|
|
16
|
-
//this.closeCamera();
|
|
17
|
-
this.eventPhotoCapture.emit(photos);
|
|
18
|
-
};
|
|
19
|
-
this.videoStarted = undefined;
|
|
20
|
-
this.captureTaken = undefined;
|
|
21
|
-
this.verified = undefined;
|
|
22
|
-
this.titleMesage = undefined;
|
|
23
|
-
this.demoEnded = undefined;
|
|
24
|
-
this.demoVideo = undefined;
|
|
25
|
-
this.uploadingLink = undefined;
|
|
26
|
-
this.captureHeight = undefined;
|
|
27
|
-
this.captureWidth = undefined;
|
|
28
|
-
this.captureTaken = false;
|
|
29
|
-
this.verified = false;
|
|
30
|
-
this.cameras = new Cameras();
|
|
31
|
-
this.demoEnded = false;
|
|
32
|
-
this.uploadingLink = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_selfie.mp4';
|
|
33
|
-
this.baseComponent = new BaseComponent(FlowSteps.SelfieTilt);
|
|
34
|
-
}
|
|
35
|
-
eventVideoStarted(event) {
|
|
36
|
-
this.videoStarted = true;
|
|
37
|
-
var cameraSize = event.detail;
|
|
38
|
-
var height = Math.round((cameraSize.width * 16) / 9);
|
|
39
|
-
this.captureHeight = height - Math.round((window.screen.height - height) / 2);
|
|
40
|
-
this.captureWidth = Math.round((this.captureHeight * 9) / 16);
|
|
41
|
-
}
|
|
42
|
-
async componentWillLoad() {
|
|
43
|
-
this.translations = await Translations.getValues();
|
|
44
|
-
this.titleMesage = this.translations.SelfieCaptureValues.Title;
|
|
45
|
-
//this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
|
|
46
|
-
if (!navigator.mediaDevices) {
|
|
47
|
-
this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
async componentDidLoad() {
|
|
51
|
-
this.mainStream = Stream.getNewInstance(VerificationMode.Tilt);
|
|
52
|
-
await this.baseComponent.logStep(FlowSteps.SelfieTilt, FlowMoments.Initialized);
|
|
53
|
-
this.titleMesage = this.translations.SelfieCaptureValues.FacePoseMapping[this.mainStream.facePose];
|
|
54
|
-
this.demoEnded = false;
|
|
55
|
-
this.demoVideo.src = SelfieCaptureValues.FacePoseDemoMapping[this.mainStream.facePose];
|
|
56
|
-
this.demoVideo.play();
|
|
57
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
58
|
-
this.demoEnded = true;
|
|
59
|
-
this.openCamera();
|
|
60
|
-
}
|
|
61
|
-
async openCamera() {
|
|
62
|
-
const constraints = this.cameras.GetConstraints('', store.device, true);
|
|
63
|
-
setTimeout(() => {
|
|
64
|
-
navigator.mediaDevices
|
|
65
|
-
.getUserMedia(constraints)
|
|
66
|
-
.then(stream => {
|
|
67
|
-
this.mainStream.initStream(stream);
|
|
68
|
-
})
|
|
69
|
-
.catch(e => {
|
|
70
|
-
this.closeCamera();
|
|
71
|
-
this.apiErrorEvent.emit(e);
|
|
72
|
-
});
|
|
73
|
-
}, 100);
|
|
74
|
-
}
|
|
75
|
-
closeCamera() {
|
|
76
|
-
if (this.mainStream) {
|
|
77
|
-
this.mainStream.dropStream();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
disconnectedCallback() {
|
|
81
|
-
this.closeCamera();
|
|
82
|
-
Stream.instance = null;
|
|
83
|
-
FaceML5Detector.instance = null;
|
|
84
|
-
}
|
|
85
|
-
async takePhoto() {
|
|
86
|
-
if (this.captureTaken)
|
|
87
|
-
return;
|
|
88
|
-
this.captureTaken = true;
|
|
89
|
-
let res = this.mainStream.takePhoto();
|
|
90
|
-
this.photoIsReady(res);
|
|
91
|
-
await this.baseComponent.logStep(FlowSteps.SelfieTilt, FlowMoments.Finalized);
|
|
92
|
-
}
|
|
93
|
-
async verificationFinished() {
|
|
94
|
-
if (this.verified)
|
|
95
|
-
return;
|
|
96
|
-
this.verified = true;
|
|
97
|
-
this.titleMesage = this.translations.SelfieCaptureValues.Loading;
|
|
98
|
-
this.closeCamera();
|
|
99
|
-
this.demoEnded = false;
|
|
100
|
-
var loops = 0;
|
|
101
|
-
this.demoVideo.src = this.uploadingLink;
|
|
102
|
-
this.demoVideo.loop = false;
|
|
103
|
-
while (loops < 7) {
|
|
104
|
-
loops++;
|
|
105
|
-
this.demoVideo.play();
|
|
106
|
-
await delay(this.translations.GlobalValues.VideoLenght);
|
|
107
|
-
}
|
|
108
|
-
this.eventTimeElapsed.emit();
|
|
109
|
-
}
|
|
110
|
-
render() {
|
|
111
|
-
let cameraStyle;
|
|
112
|
-
if (store.device.isMobile && this.videoStarted) {
|
|
113
|
-
cameraStyle = {
|
|
114
|
-
'width': this.captureWidth + 'px',
|
|
115
|
-
'height': this.captureHeight + 'px',
|
|
116
|
-
'overflow': 'hidden',
|
|
117
|
-
'borderRadius': '10px',
|
|
118
|
-
'text-align': 'center',
|
|
119
|
-
'margin': 'auto',
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
|
|
123
|
-
//let videoClass = this.device.isMobile ? '' : 'video-demo';
|
|
124
|
-
let bgDemo = this.verified ? 'container' : 'container bg-black';
|
|
125
|
-
return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.demoEnded }, h("video", { id: "howtoSelfie", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.demoEnded == false }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("camera-comp", { "capture-mode": "selfie" }))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))));
|
|
126
|
-
}
|
|
127
|
-
static get is() { return "selfie-tilt"; }
|
|
128
|
-
static get originalStyleUrls() {
|
|
129
|
-
return {
|
|
130
|
-
"$": ["selfie-tilt.css"]
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
static get styleUrls() {
|
|
134
|
-
return {
|
|
135
|
-
"$": ["selfie-tilt.css"]
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
static get states() {
|
|
139
|
-
return {
|
|
140
|
-
"videoStarted": {},
|
|
141
|
-
"captureTaken": {},
|
|
142
|
-
"verified": {},
|
|
143
|
-
"titleMesage": {},
|
|
144
|
-
"demoEnded": {},
|
|
145
|
-
"demoVideo": {},
|
|
146
|
-
"uploadingLink": {},
|
|
147
|
-
"captureHeight": {},
|
|
148
|
-
"captureWidth": {}
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
static get events() {
|
|
152
|
-
return [{
|
|
153
|
-
"method": "eventPhotoCapture",
|
|
154
|
-
"name": "photoSelfieTiltCapture",
|
|
155
|
-
"bubbles": true,
|
|
156
|
-
"cancelable": true,
|
|
157
|
-
"composed": true,
|
|
158
|
-
"docs": {
|
|
159
|
-
"tags": [],
|
|
160
|
-
"text": ""
|
|
161
|
-
},
|
|
162
|
-
"complexType": {
|
|
163
|
-
"original": "any",
|
|
164
|
-
"resolved": "any",
|
|
165
|
-
"references": {}
|
|
166
|
-
}
|
|
167
|
-
}, {
|
|
168
|
-
"method": "apiErrorEvent",
|
|
169
|
-
"name": "apiError",
|
|
170
|
-
"bubbles": true,
|
|
171
|
-
"cancelable": true,
|
|
172
|
-
"composed": true,
|
|
173
|
-
"docs": {
|
|
174
|
-
"tags": [],
|
|
175
|
-
"text": ""
|
|
176
|
-
},
|
|
177
|
-
"complexType": {
|
|
178
|
-
"original": "any",
|
|
179
|
-
"resolved": "any",
|
|
180
|
-
"references": {}
|
|
181
|
-
}
|
|
182
|
-
}, {
|
|
183
|
-
"method": "eventTimeElapsed",
|
|
184
|
-
"name": "timeElapsed",
|
|
185
|
-
"bubbles": true,
|
|
186
|
-
"cancelable": true,
|
|
187
|
-
"composed": true,
|
|
188
|
-
"docs": {
|
|
189
|
-
"tags": [],
|
|
190
|
-
"text": ""
|
|
191
|
-
},
|
|
192
|
-
"complexType": {
|
|
193
|
-
"original": "any",
|
|
194
|
-
"resolved": "any",
|
|
195
|
-
"references": {}
|
|
196
|
-
}
|
|
197
|
-
}];
|
|
198
|
-
}
|
|
199
|
-
static get elementRef() { return "component"; }
|
|
200
|
-
static get listeners() {
|
|
201
|
-
return [{
|
|
202
|
-
"name": "videoStarted",
|
|
203
|
-
"method": "eventVideoStarted",
|
|
204
|
-
"target": undefined,
|
|
205
|
-
"capture": false,
|
|
206
|
-
"passive": false
|
|
207
|
-
}, {
|
|
208
|
-
"name": "takePhoto",
|
|
209
|
-
"method": "takePhoto",
|
|
210
|
-
"target": undefined,
|
|
211
|
-
"capture": false,
|
|
212
|
-
"passive": false
|
|
213
|
-
}, {
|
|
214
|
-
"name": "verificationFinished",
|
|
215
|
-
"method": "verificationFinished",
|
|
216
|
-
"target": undefined,
|
|
217
|
-
"capture": false,
|
|
218
|
-
"passive": false
|
|
219
|
-
}];
|
|
220
|
-
}
|
|
221
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
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 n=t=>!("isConnected"in t)||t.isConnected,s=(()=>{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(n))})(...e)}),2e3)}})(),a=t=>"function"==typeof t?t():t;var o;!function(t){t[t.LANDING=0]="LANDING",t[t.AGREEMENT=1]="AGREEMENT",t[t.PHONE=2]="PHONE",t[t.CODE=3]="CODE",t[t.CODEERROR=4]="CODEERROR",t[t.ID=5]="ID",t[t.LIVENESS=6]="LIVENESS",t[t.COMPLETE=7]="COMPLETE",t[t.ERROREND=8]="ERROREND",t[t.CAMERAERROR=9]="CAMERAERROR",t[t.NONE=10]="NONE"}(o||(o={}));class r{}r.IDPoseDemoMapping={0:"https://ekyc.blob.core.windows.net/$web/animations/id/id_front.mp4",1:"https://ekyc.blob.core.windows.net/$web/animations/id/id_front_tilt.mp4",2:"https://ekyc.blob.core.windows.net/$web/animations/id/id_rotate.mp4",3:"https://ekyc.blob.core.windows.net/$web/animations/id/id_back.mp4",4:"https://ekyc.blob.core.windows.net/$web/animations/id/id_back_tilt.mp4"};class c{}c.FacePoseDemoMapping={0:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_rotate_left.mp4",1:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_rotate_right.mp4",2:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_tilt_back.mp4",3:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_tilt_front.mp4",4:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_main.mp4"};class d{}d.FlowStatusKey="qbs-ect-flowstatus",d.RequestIdKey="qbs-ect-requestid",d.TokenKey="qbs-ect-token",d.InitialisedKey="qbs-ect-initialised",d.HasIdBackKey="qbs-ect-has-id-back",d.AgreementValidationKey="qbs-ect-agreement-validation",d.PhoneValidationKey="qbs-ect-phone-validation",d.RefreshDoneKey="qbs-ect-refresh-done";class h{constructor(){this.uriEnv="/",this.uriEnv="QA"==l.environment?"/dev_":"/",this.OtpSend=this.uriEnv+"validation/otp/send",this.OtpCheck=this.uriEnv+"validation/otp/check",this.IdentityInsert=this.uriEnv+"validation/identity/insert",this.UploadCapture=this.uriEnv+"validation/upload/capture",this.GetAgreement=this.uriEnv+"validation/agreement/content",this.GenerateAgreement=this.uriEnv+"validation/agreement/generate",this.SendLink=this.uriEnv+"validation/otp/sendlink",this.GetStatus=this.uriEnv+"validation/identity/status",this.AddLog=this.uriEnv+"validation/logs/add",this.AddStep=this.uriEnv+"validation/logs/step",this.AbortRequest=this.uriEnv+"validation/identity/abort",this.Translations=this.uriEnv+"validation/translations/get"}}const{state:l,onChange:u}=(()=>{const i=((t,e=((t,e)=>t!==e))=>{const i=a(t);let n=new Map(Object.entries(null!=i?i:{}));const s={dispose:[],get:[],set:[],reset:[]},o=()=>{var e;n=new Map(Object.entries(null!==(e=a(t))&&void 0!==e?e:{})),s.reset.forEach((t=>t()))},r=t=>(s.get.forEach((e=>e(t))),n.get(t)),c=(t,i)=>{const a=n.get(t);e(i,a,t)&&(n.set(t,i),s.set.forEach((e=>e(t,i,a))))},d="undefined"==typeof Proxy?{}:new Proxy(i,{get:(t,e)=>r(e),ownKeys:()=>Array.from(n.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>n.has(e),set:(t,e,i)=>(c(e,i),!0)}),h=(t,e)=>(s[t].push(e),()=>{((t,e)=>{const i=t.indexOf(e);i>=0&&(t[i]=t[t.length-1],t.length--)})(s[t],e)});return{state:d,get:r,set:c,on:h,onChange:(e,i)=>{const n=h("set",((t,n)=>{t===e&&i(n)})),s=h("reset",(()=>i(a(t)[e])));return()=>{n(),s()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(h("set",e.set)),e.get&&t.push(h("get",e.get)),e.reset&&t.push(h("reset",e.reset)),e.dispose&&t.push(h("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{s.dispose.forEach((t=>t())),o()},reset:o,forceUpdate:t=>{const e=n.get(t);s.set.forEach((i=>i(t,e,e)))}}})({flowStatus:o.NONE,environment:"PROD",debug:!1,requestId:"",redirectId:"",initialised:!1,token:"",cameraIds:[],cameraId:"",hasIdBack:!1,hasSelfieGesture:!1,hasIdTilt:!1,agreementsValidation:!0,phoneValidation:!0,phoneNumber:"",apiBaseUrl:"https://apiro.id-kyc.com",device:null,langIso:"ro"},void 0);return i.use((()=>{if("function"!=typeof t)return{};const i=new Map;return{dispose:()=>i.clear(),get:e=>{const n=t();n&&((t,e,i)=>{const n=t.get(e);n?n.includes(i)||n.push(i):t.set(e,[i])})(i,e,n)},set:t=>{const n=i.get(t);n&&i.set(t,n.filter(e)),s(i)},reset:()=>{i.forEach((t=>t.forEach(e))),s(i)}}})()),i})();var p,w;u("environment",(t=>{l.debug="QA"==t})),u("flowStatus",(t=>{sessionStorage.setItem(d.FlowStatusKey,o[t])})),u("token",(t=>{sessionStorage.setItem(d.TokenKey,t)})),u("requestId",(t=>{sessionStorage.setItem(d.RequestIdKey,t)})),u("initialised",(t=>{sessionStorage.setItem(d.InitialisedKey,String(t))})),u("hasIdBack",(t=>{sessionStorage.setItem(d.HasIdBackKey,String(t))})),u("agreementsValidation",(t=>{sessionStorage.setItem(d.AgreementValidationKey,String(t))})),u("phoneValidation",(t=>{sessionStorage.setItem(d.PhoneValidationKey,String(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"}(p||(p={})),function(t){t[t.Initialized="initialized"]="Initialized",t[t.Finalized="finalized"]="Finalized",t[t.None="none"]="None"}(w||(w={}));class b{constructor(){this.serviceErrors=["Service Unavailable","Unauthorized"],this.toBase64=t=>new Promise(((e,i)=>{const n=new FileReader;n.readAsDataURL(t),n.onload=()=>e(n.result),n.onerror=t=>i(t)})),this.urls=new h}async http(t){const e=await fetch(t);if(!e.ok)throw new Error(e.statusText);try{return await e.json()}catch(t){throw new Error("No json found in response "+t)}}async post(t,e,i=!0){var n=new Request(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});try{return await this.http(n)}catch(n){if(!i||this.serviceErrors.includes(n.message))throw n;this.AddLog("Error in post ",n);try{var s=new Request(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(s)}catch(i){this.AddLog("Error in post ",i);var a=new Request(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(a)}}}async get(t,e=!0){var i=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});try{return await this.http(i)}catch(i){if(!e||this.serviceErrors.includes(i.message))throw i;this.AddLog("Error in get ",i);try{var n=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(n)}catch(e){this.AddLog("Error in get ",e);var s=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(s)}}}async SendOTPCode(t,e){let i={requestId:t,phone:e};return(await this.post(this.urls.OtpSend,JSON.stringify(i))).sent}async CheckOTPCode(t,e){let i={requestId:t,otp:e};return(await this.post(this.urls.OtpCheck,JSON.stringify(i))).valid}async AddIdentificationRequest(t,e){l.debug&&console.log("Calling identity request with store:"+JSON.stringify(l));let i={requestId:l.requestId,clientDeviceInfo:JSON.stringify(t),redirectId:l.redirectId,phoneNumber:l.phoneNumber,version:e},n=await this.post(this.urls.IdentityInsert,JSON.stringify(i));return""==l.requestId&&(l.requestId=n.requestId),l.hasIdBack=n.hasIdBack,l.hasIdTilt=n.hasIdTilt,l.hasSelfieGesture=n.hasSelfieGesture,l.agreementsValidation=n.agreementsValidation,l.phoneValidation=n.phoneValidation,l.phoneNumber=n.phoneNumber,!0}async UploadFileForRequestB64(t,e,i){let n={requestId:t,type:e,data:await this.toBase64(i)},s=await this.post(this.urls.UploadCapture,JSON.stringify(n));return l.hasIdBack||"IdFront"!=e?l.hasIdBack&&"IdBack"==e?s.isValid:"Selfie"!=e||s.isValid:s.isValid}async GetAgreement(t){return(await this.get(this.urls.GetAgreement+"?type="+t+"&requestId="+l.requestId)).htmlText}async GenerateAgreement(t){let e={requestId:l.requestId,documentType:t};return(await this.post(this.urls.GenerateAgreement,JSON.stringify(e))).generation}async GetStatus(t){let e=await this.get(this.urls.GetStatus+"?orderId="+t);return i[e.status]}async SendLink(t,e){let i={requestId:l.requestId,link:t,phoneNumber:e};return(await this.post(this.urls.SendLink,JSON.stringify(i))).sent}async AddLog(t,e){try{let i={requestId:l.requestId,action:o[l.flowStatus],message:JSON.stringify({error:t,context:e})};return(await this.post(this.urls.AddLog,JSON.stringify(i),!1)).saved}catch(t){}}async AddStep(t,e){let i={requestId:l.requestId,redirectId:l.redirectId,step: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:l.requestId}))).saved}async GetTranslations(t){return await this.get(this.urls.Translations+"?langIso="+t)}}const m=new class{async getValues(){return this.values||(this.values=await this.fetchTranslations()),this.values}getLocale(t=document.body){if(l.langIso&&""!=l.langIso)return l.langIso;{const e=t.closest("[lang]");return e?e.lang:"ro"}}async fetchTranslations(){const t=this.getLocale();try{const e=(new b).GetTranslations(t);if(e)return e}catch(e){return console.error(`Error loading locale: ${t}`,e),null}}};export{b as A,w as F,r as I,i as O,d as S,m as T,p as a,o as b,c,l as s}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
-
export declare class IdBackCapture {
|
|
3
|
-
private baseComponent;
|
|
4
|
-
private translations;
|
|
5
|
-
component: HTMLElement;
|
|
6
|
-
private videoStarted;
|
|
7
|
-
private cameraSize;
|
|
8
|
-
private captureTaken;
|
|
9
|
-
private verified;
|
|
10
|
-
private titleMesage;
|
|
11
|
-
eventPhotoCapture: EventEmitter;
|
|
12
|
-
apiErrorEvent: EventEmitter<any>;
|
|
13
|
-
eventTimeElapsed: EventEmitter;
|
|
14
|
-
private cameras;
|
|
15
|
-
private showDemo;
|
|
16
|
-
private demoVideo;
|
|
17
|
-
constructor();
|
|
18
|
-
eventVideoStarted(event: any): void;
|
|
19
|
-
componentWillLoad(): Promise<void>;
|
|
20
|
-
componentDidLoad(): Promise<void>;
|
|
21
|
-
openCamera(): Promise<void>;
|
|
22
|
-
closeCamera(): void;
|
|
23
|
-
disconnectedCallback(): void;
|
|
24
|
-
verificationFinished(): Promise<void>;
|
|
25
|
-
takePhoto(): Promise<void>;
|
|
26
|
-
photoIsReady: (photos: any) => void;
|
|
27
|
-
render(): any;
|
|
28
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
-
export declare class IdTilt {
|
|
3
|
-
private baseComponent;
|
|
4
|
-
private translations;
|
|
5
|
-
component: HTMLElement;
|
|
6
|
-
private videoStarted;
|
|
7
|
-
private cameraSize;
|
|
8
|
-
private captureTaken;
|
|
9
|
-
private verified;
|
|
10
|
-
private titleMesage;
|
|
11
|
-
private showDemo;
|
|
12
|
-
private demoVideo;
|
|
13
|
-
eventPhotoCapture: EventEmitter;
|
|
14
|
-
apiErrorEvent: EventEmitter<any>;
|
|
15
|
-
eventTimeElapsed: EventEmitter;
|
|
16
|
-
private cameras;
|
|
17
|
-
constructor();
|
|
18
|
-
eventVideoStarted(event: any): void;
|
|
19
|
-
componentWillLoad(): Promise<void>;
|
|
20
|
-
componentDidLoad(): Promise<void>;
|
|
21
|
-
openCamera(): Promise<void>;
|
|
22
|
-
closeCamera(): void;
|
|
23
|
-
disconnectedCallback(): void;
|
|
24
|
-
takePhoto(): Promise<void>;
|
|
25
|
-
verificationFinished(): Promise<void>;
|
|
26
|
-
photoIsReady: (photos: any) => void;
|
|
27
|
-
render(): any;
|
|
28
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
-
export declare class SelfieTilt {
|
|
3
|
-
private baseComponent;
|
|
4
|
-
private translations;
|
|
5
|
-
component: HTMLElement;
|
|
6
|
-
private videoStarted;
|
|
7
|
-
private captureTaken;
|
|
8
|
-
private verified;
|
|
9
|
-
private titleMesage;
|
|
10
|
-
private demoEnded;
|
|
11
|
-
private demoVideo;
|
|
12
|
-
private uploadingLink;
|
|
13
|
-
private captureHeight;
|
|
14
|
-
private captureWidth;
|
|
15
|
-
eventPhotoCapture: EventEmitter;
|
|
16
|
-
apiErrorEvent: EventEmitter<any>;
|
|
17
|
-
eventTimeElapsed: EventEmitter;
|
|
18
|
-
private cameras;
|
|
19
|
-
private mainStream;
|
|
20
|
-
constructor();
|
|
21
|
-
eventVideoStarted(event: any): void;
|
|
22
|
-
componentWillLoad(): Promise<void>;
|
|
23
|
-
componentDidLoad(): Promise<void>;
|
|
24
|
-
openCamera(): Promise<void>;
|
|
25
|
-
closeCamera(): void;
|
|
26
|
-
disconnectedCallback(): void;
|
|
27
|
-
takePhoto(): Promise<void>;
|
|
28
|
-
verificationFinished(): Promise<void>;
|
|
29
|
-
photoIsReady: (photos: any) => void;
|
|
30
|
-
render(): any;
|
|
31
|
-
}
|