@everymatrix/player-kyc-verification 1.93.13 → 1.93.15
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/loader.cjs.js +1 -1
- package/dist/cjs/player-kyc-verification.cjs.entry.js +125 -83
- package/dist/cjs/player-kyc-verification.cjs.js +1 -1
- package/dist/collection/components/player-kyc-verification/player-kyc-verification.css +29 -0
- package/dist/collection/components/player-kyc-verification/player-kyc-verification.js +129 -83
- package/dist/esm/loader.js +1 -1
- package/dist/esm/player-kyc-verification.entry.js +125 -83
- package/dist/esm/player-kyc-verification.js +1 -1
- package/dist/player-kyc-verification/player-kyc-verification.entry.js +1 -1
- package/dist/player-kyc-verification/player-kyc-verification.esm.js +1 -1
- package/dist/types/components/player-kyc-verification/player-kyc-verification.d.ts +24 -19
- package/package.json +1 -1
|
@@ -8,13 +8,86 @@ export class PlayerKycVerificationWidget {
|
|
|
8
8
|
this.MAX_UPLOAD_SIZE = 50000000;
|
|
9
9
|
this.userAgent = window.navigator.userAgent;
|
|
10
10
|
this.isMobile = isMobile(this.userAgent);
|
|
11
|
+
this.getKYCCustomerStatus = () => {
|
|
12
|
+
try {
|
|
13
|
+
this.isKYCLoading = true;
|
|
14
|
+
let url = new URL(`${this.endpoint}/v2/player/${this.userId}/verification/GetKYCCustomerStatus?language=${this.language}`);
|
|
15
|
+
const options = {
|
|
16
|
+
method: 'POST',
|
|
17
|
+
headers: {
|
|
18
|
+
'X-SessionId': this.session,
|
|
19
|
+
'Content-Type': 'application/json'
|
|
20
|
+
},
|
|
21
|
+
body: JSON.stringify({})
|
|
22
|
+
};
|
|
23
|
+
fetch(url.href, options)
|
|
24
|
+
.then((res) => {
|
|
25
|
+
if (res.status === 200) {
|
|
26
|
+
return res.json();
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
throw new Error('HTTP status ' + res.status);
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
.then((data) => {
|
|
33
|
+
var _a;
|
|
34
|
+
this.verificationType = data.verifications;
|
|
35
|
+
if (((_a = this.verificationType) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
36
|
+
if (this.hideKycDescription === 'true') {
|
|
37
|
+
this.hasAllDocumentsUploaded = this.verificationType.every((kycElement) => {
|
|
38
|
+
var _a;
|
|
39
|
+
if ((kycElement === null || kycElement === void 0 ? void 0 : kycElement.documents.length) === 0)
|
|
40
|
+
return;
|
|
41
|
+
return (_a = kycElement === null || kycElement === void 0 ? void 0 : kycElement.documents) === null || _a === void 0 ? void 0 : _a.some((document) => document.status === 'Uploaded');
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
this.verificationsGeneralStatus = this.getGeneralVerificationStatus(this.verificationType);
|
|
45
|
+
if (Array.isArray(this.verificationType)) {
|
|
46
|
+
this.handleVerificationShuftiMessage(this.verificationType);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
this.isKYCLoading = false;
|
|
50
|
+
})
|
|
51
|
+
.catch((err) => {
|
|
52
|
+
// Handle any errors
|
|
53
|
+
this.isKYCLoading = false;
|
|
54
|
+
console.error(err);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
console.error('Error fetching verification types:', error);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
this.handleShuftiMessage = (event) => {
|
|
62
|
+
const data = event.data;
|
|
63
|
+
const status = data.event || data.verification_status;
|
|
64
|
+
if (status) {
|
|
65
|
+
const DELAY_KYC_API = 5500;
|
|
66
|
+
const DELAY_IFRAME_SHUFTI_LOADING = 500;
|
|
67
|
+
switch (status) {
|
|
68
|
+
case 'verification.declined':
|
|
69
|
+
case 'verification.accepted':
|
|
70
|
+
// Use for delayed iframe render UI and then trigger loading
|
|
71
|
+
setTimeout(() => {
|
|
72
|
+
this.isKYCLoading = true;
|
|
73
|
+
}, DELAY_IFRAME_SHUFTI_LOADING);
|
|
74
|
+
// Use for delayed BE handle the content take around 5 sec and FE re-call again
|
|
75
|
+
setTimeout(() => {
|
|
76
|
+
this.getKYCCustomerStatus();
|
|
77
|
+
}, DELAY_KYC_API);
|
|
78
|
+
break;
|
|
79
|
+
default:
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
11
84
|
this.handleToggleScreen = () => {
|
|
12
85
|
this.toggleScreen(this.isMobile);
|
|
13
86
|
};
|
|
14
87
|
this.hideVulnerabilityCheck = 'false';
|
|
15
88
|
this.userId = '';
|
|
16
89
|
this.session = '';
|
|
17
|
-
this.language =
|
|
90
|
+
this.language = 'en';
|
|
18
91
|
this.endpoint = '';
|
|
19
92
|
this.translationUrl = '';
|
|
20
93
|
this.clientStyling = '';
|
|
@@ -28,6 +101,7 @@ export class PlayerKycVerificationWidget {
|
|
|
28
101
|
this.hasAllDocumentsUploaded = false;
|
|
29
102
|
this.verificationsGeneralStatus = undefined;
|
|
30
103
|
this.isLoading = false;
|
|
104
|
+
this.isKYCLoading = false;
|
|
31
105
|
this.selectedFile = null;
|
|
32
106
|
this.uploadingStatus = undefined;
|
|
33
107
|
this.uploadSizeExceeded = false;
|
|
@@ -70,61 +144,33 @@ export class PlayerKycVerificationWidget {
|
|
|
70
144
|
if (window.innerWidth > 700) {
|
|
71
145
|
this.expandedOnDesktop = true;
|
|
72
146
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
fetch(url.href, options)
|
|
84
|
-
.then((res) => {
|
|
85
|
-
if (res.status === 200) {
|
|
86
|
-
return res.json();
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
throw new Error("HTTP status " + res.status);
|
|
90
|
-
}
|
|
91
|
-
})
|
|
92
|
-
.then((data) => {
|
|
93
|
-
var _a;
|
|
94
|
-
this.verificationType = data.verifications;
|
|
95
|
-
if (this.hideKycDescription === "true" && ((_a = this.verificationType) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
96
|
-
this.hasAllDocumentsUploaded = this.verificationType.every((kycElement) => {
|
|
97
|
-
var _a;
|
|
98
|
-
if ((kycElement === null || kycElement === void 0 ? void 0 : kycElement.documents.length) === 0)
|
|
99
|
-
return;
|
|
100
|
-
return (_a = kycElement === null || kycElement === void 0 ? void 0 : kycElement.documents) === null || _a === void 0 ? void 0 : _a.some((document) => document.status === "Uploaded");
|
|
101
|
-
});
|
|
102
|
-
this.verificationsGeneralStatus = this.getGeneralVerificationStatus(this.verificationType);
|
|
103
|
-
}
|
|
104
|
-
})
|
|
105
|
-
.catch((err) => {
|
|
106
|
-
// Handle any errors
|
|
107
|
-
console.error(err);
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
catch (error) {
|
|
111
|
-
console.error('Error fetching verification types:', error);
|
|
147
|
+
this.getKYCCustomerStatus();
|
|
148
|
+
}
|
|
149
|
+
removeVerificationShuftiMessage() {
|
|
150
|
+
window.removeEventListener('message', this.handleShuftiMessage);
|
|
151
|
+
}
|
|
152
|
+
handleVerificationShuftiMessage(verifications) {
|
|
153
|
+
const isActionNeeded = verifications.find((val) => { var _a; return val.vendorName === 'ShuftiPro' && ((_a = val.flowInfo) === null || _a === void 0 ? void 0 : _a.actionNeeded) === true; });
|
|
154
|
+
this.removeVerificationShuftiMessage();
|
|
155
|
+
if (isActionNeeded) {
|
|
156
|
+
window.addEventListener('message', this.handleShuftiMessage);
|
|
112
157
|
}
|
|
113
158
|
}
|
|
114
159
|
getGeneralVerificationStatus(verifications) {
|
|
115
|
-
const statuses = verifications === null || verifications === void 0 ? void 0 : verifications.map(docType => docType.status.toLowerCase());
|
|
116
|
-
if (statuses.includes(
|
|
117
|
-
return
|
|
118
|
-
if (statuses.includes(
|
|
119
|
-
return
|
|
120
|
-
if (statuses.includes(
|
|
121
|
-
return
|
|
122
|
-
if (statuses.every(status => status ===
|
|
123
|
-
return
|
|
124
|
-
return
|
|
160
|
+
const statuses = verifications === null || verifications === void 0 ? void 0 : verifications.map((docType) => docType.status.toLowerCase());
|
|
161
|
+
if (statuses.includes('failed'))
|
|
162
|
+
return 'Failed';
|
|
163
|
+
if (statuses.includes('expired'))
|
|
164
|
+
return 'Expired';
|
|
165
|
+
if (statuses.includes('inprogress'))
|
|
166
|
+
return 'InProgress';
|
|
167
|
+
if (statuses.every((status) => status === 'verified'))
|
|
168
|
+
return 'Verified';
|
|
169
|
+
return 'Unknown';
|
|
125
170
|
}
|
|
126
171
|
disconnectedCallback() {
|
|
127
172
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
173
|
+
this.removeVerificationShuftiMessage();
|
|
128
174
|
}
|
|
129
175
|
handleOptionChange(event, verificationTypeId) {
|
|
130
176
|
const target = event.target;
|
|
@@ -168,7 +214,7 @@ export class PlayerKycVerificationWidget {
|
|
|
168
214
|
}
|
|
169
215
|
checkFileSize(file) {
|
|
170
216
|
let size = 0;
|
|
171
|
-
Object.keys(file).forEach(element => {
|
|
217
|
+
Object.keys(file).forEach((element) => {
|
|
172
218
|
size += file[element].size;
|
|
173
219
|
});
|
|
174
220
|
return size <= this.MAX_UPLOAD_SIZE;
|
|
@@ -187,23 +233,24 @@ export class PlayerKycVerificationWidget {
|
|
|
187
233
|
method: 'POST',
|
|
188
234
|
headers: {
|
|
189
235
|
'Content-Type': 'application/json',
|
|
190
|
-
'X-SessionId': this.session
|
|
236
|
+
'X-SessionId': this.session
|
|
191
237
|
},
|
|
192
|
-
body: JSON.stringify({ DocumentCode: documentType })
|
|
238
|
+
body: JSON.stringify({ DocumentCode: documentType })
|
|
193
239
|
};
|
|
194
240
|
fetch(`${this.endpoint}/v1/player/${this.userId}/verification/GetKYCVerificationDocumentUploadUrl`, uploadOptions)
|
|
195
|
-
.then(response => {
|
|
241
|
+
.then((response) => {
|
|
196
242
|
if (response.ok) {
|
|
197
243
|
this.uploadingStatus = translate('uploading', this.language);
|
|
198
244
|
this.handleDocumentsStatus(verificationTypeId, this.uploadingStatus, documentType);
|
|
199
245
|
return response.json();
|
|
200
246
|
}
|
|
201
|
-
})
|
|
247
|
+
})
|
|
248
|
+
.then((data) => {
|
|
202
249
|
if (data.ResponseCode == 'Success') {
|
|
203
250
|
const formData = new FormData();
|
|
204
251
|
formData.append(documentType, this.selectedFile[0]);
|
|
205
|
-
fetch(data.Url, { method:
|
|
206
|
-
.then(res => {
|
|
252
|
+
fetch(data.Url, { method: 'POST', body: formData })
|
|
253
|
+
.then((res) => {
|
|
207
254
|
if (res.ok) {
|
|
208
255
|
if (this.selectedFile.length > 1) {
|
|
209
256
|
this.uploadingStatus = translate('successUploadMultipleFiles', this.language);
|
|
@@ -218,7 +265,8 @@ export class PlayerKycVerificationWidget {
|
|
|
218
265
|
this.handleDocumentsStatus(verificationTypeId, this.uploadingStatus, documentType);
|
|
219
266
|
console.error('File upload error:', res.status);
|
|
220
267
|
}
|
|
221
|
-
})
|
|
268
|
+
})
|
|
269
|
+
.catch((error) => {
|
|
222
270
|
console.error('File upload error:', error);
|
|
223
271
|
});
|
|
224
272
|
}
|
|
@@ -227,7 +275,7 @@ export class PlayerKycVerificationWidget {
|
|
|
227
275
|
this.handleDocumentsStatus(verificationTypeId, this.uploadingStatus, documentType);
|
|
228
276
|
}
|
|
229
277
|
})
|
|
230
|
-
.catch(error => {
|
|
278
|
+
.catch((error) => {
|
|
231
279
|
console.error('File upload error:', error);
|
|
232
280
|
});
|
|
233
281
|
}
|
|
@@ -251,7 +299,7 @@ export class PlayerKycVerificationWidget {
|
|
|
251
299
|
resolve(true);
|
|
252
300
|
}
|
|
253
301
|
})
|
|
254
|
-
.catch(error => {
|
|
302
|
+
.catch((error) => {
|
|
255
303
|
reject(error);
|
|
256
304
|
});
|
|
257
305
|
});
|
|
@@ -265,7 +313,7 @@ export class PlayerKycVerificationWidget {
|
|
|
265
313
|
var _a, _b;
|
|
266
314
|
let result;
|
|
267
315
|
(_a = verificationType === null || verificationType === void 0 ? void 0 : verificationType.documents) === null || _a === void 0 ? void 0 : _a.forEach((item) => {
|
|
268
|
-
if (item.status ==
|
|
316
|
+
if (item.status == 'Requested') {
|
|
269
317
|
result = result !== null && result !== void 0 ? result : item.code;
|
|
270
318
|
}
|
|
271
319
|
});
|
|
@@ -277,14 +325,14 @@ export class PlayerKycVerificationWidget {
|
|
|
277
325
|
renderDescription(status) {
|
|
278
326
|
const shouldHideDescription = this.hideKycDescription === 'true' && this.hasAllDocumentsUploaded;
|
|
279
327
|
switch (status) {
|
|
280
|
-
case
|
|
281
|
-
return h("div", { class: "widget-description-verified" }, translate(
|
|
282
|
-
case
|
|
283
|
-
return h("div", { class: "widget-description-failed" }, translate(
|
|
328
|
+
case 'Verified':
|
|
329
|
+
return h("div", { class: "widget-description-verified" }, translate('kycVerifiedDescription', this.language));
|
|
330
|
+
case 'Failed':
|
|
331
|
+
return h("div", { class: "widget-description-failed" }, translate('kycFailedDescription', this.language));
|
|
284
332
|
default:
|
|
285
333
|
if (shouldHideDescription)
|
|
286
334
|
return null;
|
|
287
|
-
return h("div", { class: "widget-description" }, translate(
|
|
335
|
+
return h("div", { class: "widget-description" }, translate('kycDescription', this.language));
|
|
288
336
|
}
|
|
289
337
|
}
|
|
290
338
|
renderVerificationTypeBox(verificationType) {
|
|
@@ -298,20 +346,20 @@ export class PlayerKycVerificationWidget {
|
|
|
298
346
|
let status = verificationType.status;
|
|
299
347
|
let documents = verificationType.documents;
|
|
300
348
|
let flowInfo = verificationType.flowInfo;
|
|
349
|
+
const vendorName = verificationType.vendorName;
|
|
350
|
+
const isShuftiButNotInProgress = vendorName === 'ShuftiPro' && status !== 'InProgress';
|
|
301
351
|
const isVerified = status === 'Verified';
|
|
302
352
|
const isFailedOrExpired = status === 'Failed' || status === 'Expired';
|
|
303
|
-
const isVulnerabilityCheck = name ===
|
|
304
|
-
|
|
353
|
+
const isVulnerabilityCheck = name === 'VulnerabilityCheck';
|
|
354
|
+
const isHiddenVulnerability = isVerified && isVulnerabilityCheck && this.hideVulnerabilityCheck === 'true';
|
|
355
|
+
if (isHiddenVulnerability || isShuftiButNotInProgress) {
|
|
305
356
|
return null;
|
|
306
357
|
}
|
|
307
|
-
return (h("div", { class: `verification-box ${expanded ? 'expanded' : ''} ${isFailedOrExpired ? 'failed' : ''} ${isVerified ? 'success' : ''}` }, h("div", { class: `box box-header ${expanded ? 'expanded' : ''}`, onClick: () => { var _a; return this.toggleVerificationType(verificationType.type, (_a = verificationType.flowInfo) === null || _a === void 0 ? void 0 : _a.type); } }, h("div", { class: "box-icon" }, isVerified ? (h("div", null, this.verifiedIcon ? (h("img", { class: "CustomVerifiedIcon", src: this.verifiedIcon, alt: "" })) : (h("svg", { width: "100", height: "100", viewBox: "0 0 100 100", xmlns: "http://www.w3.org/2000/svg" }, h("circle", { cx: "50", cy: "50", r: "40", fill: "#388D79" }), h("circle", { cx: "50", cy: "50", r: "34", fill: "none", stroke: "#fff", "stroke-width": "12px" }), h("polyline", { points: "30,50 45,63 70,35", fill: "none", stroke: "#fff", "stroke-width": "8px" }))))) :
|
|
308
|
-
(h("div", { class: "box box-content" }, h("div", { id: "__avs-wrapper" })))));
|
|
358
|
+
return (h("div", { class: `verification-box ${expanded ? 'expanded' : ''} ${isFailedOrExpired ? 'failed' : ''} ${isVerified ? 'success' : ''}` }, h("div", { class: `box box-header ${expanded ? 'expanded' : ''}`, onClick: () => { var _a; return this.toggleVerificationType(verificationType.type, (_a = verificationType.flowInfo) === null || _a === void 0 ? void 0 : _a.type); } }, h("div", { class: "box-icon" }, isVerified ? (h("div", null, this.verifiedIcon ? (h("img", { class: "CustomVerifiedIcon", src: this.verifiedIcon, alt: "" })) : (h("svg", { width: "100", height: "100", viewBox: "0 0 100 100", xmlns: "http://www.w3.org/2000/svg" }, h("circle", { cx: "50", cy: "50", r: "40", fill: "#388D79" }), h("circle", { cx: "50", cy: "50", r: "34", fill: "none", stroke: "#fff", "stroke-width": "12px" }), h("polyline", { points: "30,50 45,63 70,35", fill: "none", stroke: "#fff", "stroke-width": "8px" }))))) : isFailedOrExpired ? (h("div", null, this.failedIcon ? (h("img", { class: "CustomFailedIcon", src: this.failedIcon, alt: "" })) : (h("svg", { width: "100", height: "100", viewBox: "0 0 100 100", xmlns: "http://www.w3.org/2000/svg" }, h("circle", { cx: "50", cy: "50", r: "40", fill: "red" }), h("line", { x1: "30", y1: "30", x2: "70", y2: "70", stroke: "#fff", "stroke-width": "10px" }), h("line", { x1: "30", y1: "70", x2: "70", y2: "30", stroke: "#fff", "stroke-width": "10px" }))))) : (h("div", null, this.defaultIcon ? (h("img", { class: "CustomDefaultIcon", src: this.defaultIcon, alt: "" })) : (h("svg", { width: "800px", height: "800px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M4 4V20C4 21.1046 4.89543 22 6 22L18 22C19.1046 22 20 21.1046 20 20V8.34162C20 7.8034 19.7831 7.28789 19.3982 6.91161L14.9579 2.56999C14.5842 2.20459 14.0824 2 13.5597 2L6 2C4.89543 2 4 2.89543 4 4Z", stroke: "#000000", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M9 13H15", stroke: "#000000", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M9 17H12", stroke: "#000000", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M14 2V6C14 7.10457 14.8954 8 16 8H20", stroke: "#000000", "stroke-width": "2", "stroke-linejoin": "round" })))))), h("div", { class: "box-title" }, translate(name, this.language)), h("div", { class: "chevron-icon" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: expanded ? 'M6 15l6-6 6 6' : 'M6 9l6 6 6-6' })))), expanded ? (this.renderExpandedContent(verificationType, optionChosen, status, documents, flowInfo, isVerified, isFailedOrExpired)) : (h("div", { class: "box box-content" }, h("div", { id: "__avs-wrapper" })))));
|
|
309
359
|
}
|
|
310
360
|
renderDocumentsActions(selectedDocument, optionChosen, verificationType) {
|
|
311
|
-
return (h("div", null, this.isStatusUploaded(selectedDocument) ? (h("div", { class: "upload-status" }, translate('uploaded', this.language))) :
|
|
312
|
-
(selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.statusUploaded) ? (h("div", { class: "upload-status" }, selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.statusUploaded)) : (h("div", { class: "documents-action" }, h("div", { class: "sample-file" }, (selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.sampleType) === "FileDownload" ? (h("button", { class: "download-button", onClick: () => this.downloadPDF(selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.sampleUrl) }, h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M12 0C5.372 0 0 5.372 0 12C0 18.628 5.372 24 12 24C18.628 24 24 18.628 24 12C24 5.372 18.628 0 12 0ZM12 22C6.485 22 2 17.515 2 12C2 6.485 6.485 2 12 2C17.515 2 22 6.485 22 12C22 17.515 17.515 22 12 22Z", fill: "var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))" }), h("path", { d: "M17 11H14V6H10V11H7L12 16L17 11ZM7 17V19H17V17H7Z", fill: "var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))" })), h("span", null, translate('download', this.language)))) : null), h("div", { class: "upload-button" }, optionChosen ? (h("label", null, h("input", { type: "file", accept: "*", onChange: ($event) => this.handleFileSelection($event.target.files, optionChosen, verificationType.type), style: { display: 'none' } }), h("svg", { width: "100", height: "100", xmlns: "http://www.w3.org/2000/svg" }, h("circle", { cx: "50", cy: "50", r: "40", fill: "var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))" }), h("line", { x1: "30", y1: "50", x2: "70", y2: "50", stroke: "white", "stroke-width": "6" }), h("line", { x1: "50", y1: "30", x2: "50", y2: "70", stroke: "white", "stroke-width": "6" })))) : null)))));
|
|
361
|
+
return (h("div", null, this.isStatusUploaded(selectedDocument) ? (h("div", { class: "upload-status" }, translate('uploaded', this.language))) : (selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.statusUploaded) ? (h("div", { class: "upload-status" }, selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.statusUploaded)) : (h("div", { class: "documents-action" }, h("div", { class: "sample-file" }, (selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.sampleType) === 'FileDownload' ? (h("button", { class: "download-button", onClick: () => this.downloadPDF(selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.sampleUrl) }, h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M12 0C5.372 0 0 5.372 0 12C0 18.628 5.372 24 12 24C18.628 24 24 18.628 24 12C24 5.372 18.628 0 12 0ZM12 22C6.485 22 2 17.515 2 12C2 6.485 6.485 2 12 2C17.515 2 22 6.485 22 12C22 17.515 17.515 22 12 22Z", fill: "var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))" }), h("path", { d: "M17 11H14V6H10V11H7L12 16L17 11ZM7 17V19H17V17H7Z", fill: "var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))" })), h("span", null, translate('download', this.language)))) : null), h("div", { class: "upload-button" }, optionChosen ? (h("label", null, h("input", { type: "file", accept: "*", onChange: ($event) => this.handleFileSelection($event.target.files, optionChosen, verificationType.type), style: { display: 'none' } }), h("svg", { width: "100", height: "100", xmlns: "http://www.w3.org/2000/svg" }, h("circle", { cx: "50", cy: "50", r: "40", fill: "var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))" }), h("line", { x1: "30", y1: "50", x2: "70", y2: "50", stroke: "white", "stroke-width": "6" }), h("line", { x1: "50", y1: "30", x2: "50", y2: "70", stroke: "white", "stroke-width": "6" })))) : null)))));
|
|
313
362
|
}
|
|
314
|
-
;
|
|
315
363
|
renderExpandedContent(verificationType, optionChosen, status, documents, flowInfo, isVerified, isFailedOrExpired) {
|
|
316
364
|
if ((flowInfo === null || flowInfo === void 0 ? void 0 : flowInfo.type) === 'Widget') {
|
|
317
365
|
return (h("div", null, h("hr", { style: { margin: '5px' } }), h("iframe", { src: flowInfo.url, frameborder: "0", height: "400px", width: "100%", allowfullScreen: true, allow: "camera *;microphone *" })));
|
|
@@ -328,12 +376,14 @@ export class PlayerKycVerificationWidget {
|
|
|
328
376
|
// console.error('Error importing script:', error);
|
|
329
377
|
// });
|
|
330
378
|
}
|
|
331
|
-
else if ((flowInfo === null || flowInfo === void 0 ? void 0 : flowInfo.type) === 'Redirect' && verificationType.vendorName !==
|
|
379
|
+
else if ((flowInfo === null || flowInfo === void 0 ? void 0 : flowInfo.type) === 'Redirect' && verificationType.vendorName !== 'Manual' && status !== 'Verified') {
|
|
332
380
|
const iframeSize = verificationType.vendorName === 'ShuftiPro' ? '650px' : '400px';
|
|
333
381
|
return (h("div", null, h("hr", { style: { margin: '5px' } }), h("iframe", { src: flowInfo.url, frameborder: "0", height: iframeSize, width: "100%", allowfullScreen: true, allow: "camera *;microphone *" })));
|
|
334
382
|
}
|
|
335
383
|
else {
|
|
336
|
-
return (h("div", { class: "box box-content" }, h(Fragment, null, isVerified ? (h("div", { class: "verification-status" }, translate('verificationComplete', this.language))) : isFailedOrExpired ? (h("div", { class: "verification-status" }, status === 'Failed'
|
|
384
|
+
return (h("div", { class: "box box-content" }, h(Fragment, null, isVerified ? (h("div", { class: "verification-status" }, translate('verificationComplete', this.language))) : isFailedOrExpired ? (h("div", { class: "verification-status" }, status === 'Failed'
|
|
385
|
+
? translate('verificationFailed', this.language)
|
|
386
|
+
: translate('verificationExpired', this.language))) : documents.length > 0 ? (h("div", { class: "documents-dropdown" }, h("select", { class: "nice-select", onChange: (event) => this.handleOptionChange(event, verificationType.type) }, documents.map((doc) => (h("option", { selected: doc.code == optionChosen, value: doc.code }, translate(doc.type, this.language))))), this.renderDocumentsActions(documents.find((e) => e.code === optionChosen), optionChosen, verificationType))) : null)));
|
|
337
387
|
}
|
|
338
388
|
}
|
|
339
389
|
render() {
|
|
@@ -341,13 +391,7 @@ export class PlayerKycVerificationWidget {
|
|
|
341
391
|
return (h("div", null, h("p", null, translate('loading', this.language))));
|
|
342
392
|
}
|
|
343
393
|
else {
|
|
344
|
-
return (h("div", { class: "ModalContainer", ref: el => this.stylingContainer = el }, h("div", { class: "player-kyc-verification-widget" },
|
|
345
|
-
h("div", { class: "MenuReturnButton", onClick: this.handleToggleScreen }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, h("defs", null), h("g", { transform: "translate(-20 -158)" }, h("g", { transform: "translate(20 158)" }, h("path", { class: "aaa", d: "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z", transform: "translate(15 15) rotate(180)" })))), h("h2", null, translate('kycTitle', this.language)))
|
|
346
|
-
:
|
|
347
|
-
h("h2", null, translate('kycTitle', this.language))), this.verificationType.length === 0 ?
|
|
348
|
-
h("div", { class: "no-verification-description", style: { padding: '24px', fontSize: '18px' } }, translate('noVerificationRequired', this.language))
|
|
349
|
-
:
|
|
350
|
-
h(Fragment, null, this.hideKycDescription === "true" ? this.renderDescription(this.verificationsGeneralStatus) : h("div", { class: "widget-description" }, " ", translate("kycDescription", this.language)), h("div", { class: "verification-types" }, this.verificationType.map((verificationType) => verificationType ? this.renderVerificationTypeBox(verificationType) : null))))));
|
|
394
|
+
return (h("div", { class: "ModalContainer", ref: (el) => (this.stylingContainer = el) }, h("div", { class: "player-kyc-verification-widget" }, this.isMobile ? (h("div", { class: "MenuReturnButton", onClick: this.handleToggleScreen }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, h("defs", null), h("g", { transform: "translate(-20 -158)" }, h("g", { transform: "translate(20 158)" }, h("path", { class: "aaa", d: "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z", transform: "translate(15 15) rotate(180)" })))), h("h2", null, translate('kycTitle', this.language)))) : (h("h2", null, translate('kycTitle', this.language))), this.isKYCLoading ? (h("div", { class: "ModalLoader" })) : this.verificationType.length === 0 ? (h("div", { class: "no-verification-description", style: { padding: '24px', fontSize: '18px' } }, translate('noVerificationRequired', this.language))) : (h(Fragment, null, this.hideKycDescription === 'true' ? (this.renderDescription(this.verificationsGeneralStatus)) : (h("div", { class: "widget-description" }, " ", translate('kycDescription', this.language))), h("div", { class: "verification-types" }, this.verificationType.map((verificationType) => verificationType ? this.renderVerificationTypeBox(verificationType) : null)))))));
|
|
351
395
|
}
|
|
352
396
|
}
|
|
353
397
|
static get is() { return "player-kyc-verification"; }
|
|
@@ -433,7 +477,8 @@ export class PlayerKycVerificationWidget {
|
|
|
433
477
|
"text": "The language"
|
|
434
478
|
},
|
|
435
479
|
"attribute": "language",
|
|
436
|
-
"reflect": false
|
|
480
|
+
"reflect": false,
|
|
481
|
+
"defaultValue": "'en'"
|
|
437
482
|
},
|
|
438
483
|
"endpoint": {
|
|
439
484
|
"type": "string",
|
|
@@ -604,6 +649,7 @@ export class PlayerKycVerificationWidget {
|
|
|
604
649
|
"hasAllDocumentsUploaded": {},
|
|
605
650
|
"verificationsGeneralStatus": {},
|
|
606
651
|
"isLoading": {},
|
|
652
|
+
"isKYCLoading": {},
|
|
607
653
|
"selectedFile": {},
|
|
608
654
|
"uploadingStatus": {},
|
|
609
655
|
"uploadSizeExceeded": {},
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["player-kyc-verification",[[1,"player-kyc-verification",{"hideVulnerabilityCheck":[1,"hide-vulnerability-check"],"userId":[1,"user-id"],"session":[1],"language":[1],"endpoint":[1],"translationUrl":[1,"translation-url"],"clientStyling":[1,"client-styling"],"verifiedIcon":[1,"verified-icon"],"failedIcon":[1,"failed-icon"],"defaultIcon":[1,"default-icon"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"hideKycDescription":[1,"hide-kyc-description"],"verificationType":[32],"hasAllDocumentsUploaded":[32],"verificationsGeneralStatus":[32],"isLoading":[32],"selectedFile":[32],"uploadingStatus":[32],"uploadSizeExceeded":[32],"expandedOnDesktop":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
|
|
8
|
+
return bootstrapLazy([["player-kyc-verification",[[1,"player-kyc-verification",{"hideVulnerabilityCheck":[1,"hide-vulnerability-check"],"userId":[1,"user-id"],"session":[1],"language":[1],"endpoint":[1],"translationUrl":[1,"translation-url"],"clientStyling":[1,"client-styling"],"verifiedIcon":[1,"verified-icon"],"failedIcon":[1,"failed-icon"],"defaultIcon":[1,"default-icon"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"hideKycDescription":[1,"hide-kyc-description"],"verificationType":[32],"hasAllDocumentsUploaded":[32],"verificationsGeneralStatus":[32],"isLoading":[32],"isKYCLoading":[32],"selectedFile":[32],"uploadingStatus":[32],"uploadSizeExceeded":[32],"expandedOnDesktop":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|