@authme/identity-verification 2.8.55 → 2.8.59
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/README.md +34 -0
- package/assets/locale/zh_Hant_TW.json +1 -1
- package/assets/styles/_base.scss +759 -0
- package/assets/styles/_liveness.scss +324 -0
- package/assets/styles/_ocr.scss +2422 -0
- package/assets/styles/_theme.scss +144 -0
- package/assets/styles/style.css +20 -1
- package/assets/styles/style.scss +11 -0
- package/index.cjs.js +192 -20
- package/index.esm.js +193 -22
- package/package.json +1 -1
- package/src/index.d.ts +1 -0
- package/src/lib/support.d.ts +27 -0
- package/src/lib/v2/ui/modal.d.ts +1 -1
- package/src/lib/validate-config.d.ts +11 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@use 'base';
|
|
2
|
+
@use 'ocr';
|
|
3
|
+
@use 'liveness';
|
|
4
|
+
@use 'theme';
|
|
5
|
+
|
|
6
|
+
:root {
|
|
7
|
+
--authme-close-icon-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAYCAYAAAAPtVbGAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADoSURBVHgB7ZTNDYJAEIUf0ogNgB4ogDoIMfFGF2AXHDmgdcCdi9CAneBONIZs1t23xoMmfAnhJzv7ZdiZAVb+guxQlHJ9KybUP+R5kc5Aox7TaJ9gug49CAFmVBKzi5N+HIebVSILojgJECBlRAsB1P10busGrkyEaRw6RqQLLm1dmfYzShgRK7BKbCIfgRCAIMuLSq0snwGdKoyUFQghCLSMtj4CYQOWjdrW9m6BymR5BvK78MiG7iOnxHDIR58+ckreVRHbR06Jq0x9ROEnAl+RbUBSZaqL/AYk0LN98BKpGNOAXPk97mOkwoggZdKjAAAAAElFTkSuQmCC');
|
|
8
|
+
--authme-back-icon-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAD7SURBVHgB3ZU9EoIwEIVXuQA3MCWl3EA7y3ACh5voSeQIWFI53sCSztYypR2+jHGGwYT8NvpmdhIW+B4hP0v061pQgDjnazQXhECUbdsK07NL8tQIniOYCkpiMIFLHfH1t7l3nH+RAX6wvec0gqqq9iFwKesIJHwYhmaUcoZbDWLhswYp4EYDDbwGvKEAfRlgtTA09xRwKd0qEio+WlGEsmmi7/tnURQdujt6L8sNrmX+SgHKdEnAHoCe0eWxJpnpBmBCY5Ij35GHrBtNTbrcxUylGkx6TY5yOotiTHwOOxZi4lVwQky8K5rGpJyrCaElk6E5yT7gW/prvQCHpnbdSHXj/AAAAABJRU5ErkJggg==');
|
|
9
|
+
--authme-camera-icon-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAXCAYAAAAV1F8QAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADFSURBVHgB7VbRDYIwFLzHAnYERmADZQM3ECdgBd1AJ1A30AlgBDaQDXSDei+pCSGRSqT+0EuOl5Jr773+XAUeWGtLlrVHVovIfkggGDZZsVRkQz4/yAyZkTnNaowFTQx5dzS/6qTTeem6G92pZ/IL95+FooKLkxM0PdGNogO+AM/ZsSx7v1PHXAWVjo1A4NkP8pq4dYtw0FtaJPgTolE0ikbRaC5GmkMZwiHVj3TSscX0caEDaFJv31FesGwwPfS2jvoUeAEf2F2Th2w/vQAAAABJRU5ErkJggg==');
|
|
10
|
+
--authme-check-icon-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTQ4IDI0QzQ4IDM3LjI1NDggMzcuMjU0OCA0OCAyNCA0OEMxMC43NDUyIDQ4IDAgMzcuMjU0OCAwIDI0QzAgMTAuNzQ1MiAxMC43NDUyIDAgMjQgMEMzNy4yNTQ4IDAgNDggMTAuNzQ1MiA0OCAyNFoiIGZpbGw9IiMwMEMxQjYiLz4KPHBhdGggZD0iTTE5Ljk5MzQgMjguODQ0MUwxNC43ODA5IDIzLjYzMTZMMTMuMDA1OSAyNS4zOTQxTDE5Ljk5MzQgMzIuMzgxNkwzNC45OTM0IDE3LjM4MTZMMzMuMjMwOSAxNS42MTkxTDE5Ljk5MzQgMjguODQ0MVoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=');
|
|
11
|
+
}
|
package/index.cjs.js
CHANGED
|
@@ -70,6 +70,13 @@ require('core-js/modules/es.uint8-array.set-from-hex.js');
|
|
|
70
70
|
require('core-js/modules/es.uint8-array.to-base64.js');
|
|
71
71
|
require('core-js/modules/es.uint8-array.to-hex.js');
|
|
72
72
|
require('core-js/modules/es.iterator.some.js');
|
|
73
|
+
require('core-js/modules/es.set.difference.v2.js');
|
|
74
|
+
require('core-js/modules/es.set.intersection.v2.js');
|
|
75
|
+
require('core-js/modules/es.set.is-disjoint-from.v2.js');
|
|
76
|
+
require('core-js/modules/es.set.is-subset-of.v2.js');
|
|
77
|
+
require('core-js/modules/es.set.is-superset-of.v2.js');
|
|
78
|
+
require('core-js/modules/es.set.symmetric-difference.v2.js');
|
|
79
|
+
require('core-js/modules/es.set.union.v2.js');
|
|
73
80
|
|
|
74
81
|
function _objectWithoutPropertiesLoose(r, e) {
|
|
75
82
|
if (null == r) return {};
|
|
@@ -28851,7 +28858,8 @@ const renderBasicUI = userConfig => {
|
|
|
28851
28858
|
const closeIcon = document.createElement('div');
|
|
28852
28859
|
closeIcon.classList.add('video-container__close');
|
|
28853
28860
|
// closeIcon.src = Icon.CloseIcon;
|
|
28854
|
-
closeIcon.
|
|
28861
|
+
closeIcon.textContent = '';
|
|
28862
|
+
closeIcon.insertAdjacentHTML('beforeend', `<svg width="64" height="64" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"><circle cx="32" cy="32" r="32" fill="#808080" fill-opacity="${uiThemeConfig.ekycCloseButton.backgroundOpacity}"/><path d="M24 24L40 40M40 24L24 40" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" stroke-opacity="${uiThemeConfig.ekycCloseButton.contentOpacity}"/></svg>`);
|
|
28855
28863
|
if (!userConfig.showCloseButton) {
|
|
28856
28864
|
closeIcon.classList.add('authme-hide');
|
|
28857
28865
|
}
|
|
@@ -29332,8 +29340,13 @@ const modal = arg => {
|
|
|
29332
29340
|
domTitle.innerText = arg.title;
|
|
29333
29341
|
domSubtitle.innerText = arg.subtitle;
|
|
29334
29342
|
domImage.src = arg.image;
|
|
29335
|
-
|
|
29336
|
-
|
|
29343
|
+
if (arg.content instanceof HTMLElement) {
|
|
29344
|
+
domContent.appendChild(arg.content);
|
|
29345
|
+
} else {
|
|
29346
|
+
domContent.innerHTML = arg.content;
|
|
29347
|
+
}
|
|
29348
|
+
domClose.textContent = '';
|
|
29349
|
+
domClose.insertAdjacentHTML('beforeend', `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M19.1943 6.41714C19.6393 5.97216 19.6393 5.2507 19.1943 4.80571C18.7493 4.36073 18.0278 4.36073 17.5829 4.80571L12 10.3886L6.41714 4.80572C5.97216 4.36073 5.2507 4.36073 4.80571 4.80571C4.36073 5.2507 4.36073 5.97216 4.80571 6.41714L10.3886 12L4.80571 17.5829C4.36073 18.0278 4.36073 18.7493 4.80571 19.1943C5.2507 19.6393 5.97216 19.6393 6.41714 19.1943L12 13.6114L17.5829 19.1943C18.0278 19.6393 18.7493 19.6393 19.1943 19.1943C19.6393 18.7493 19.6393 18.0278 19.1943 17.5829L13.6114 12L19.1943 6.41714Z" fill="${uiThemeConfig.nonEkycCloseButton.contentColor}" fill-opacity="${uiThemeConfig.nonEkycCloseButton.contentOpacity}" /></svg>`);
|
|
29337
29350
|
domConfirm.innerText = arg.confirm;
|
|
29338
29351
|
domClose.addEventListener('click', async () => {
|
|
29339
29352
|
if (arg.onClose) {
|
|
@@ -29621,15 +29634,18 @@ async function startLiveness(config) {
|
|
|
29621
29634
|
// Start
|
|
29622
29635
|
const step1 = rxjs.defer(() => {
|
|
29623
29636
|
return new Promise((resolve, reject) => {
|
|
29637
|
+
const hintList = document.createElement('ul');
|
|
29638
|
+
['sdk.liveness.detection.infopageHint.face', 'sdk.liveness.detection.infopageHint.environment'].forEach(key => {
|
|
29639
|
+
const li = document.createElement('li');
|
|
29640
|
+
li.textContent = translateService.translate(key);
|
|
29641
|
+
hintList.appendChild(li);
|
|
29642
|
+
});
|
|
29624
29643
|
modal({
|
|
29625
29644
|
header: translateService.translate('sdk.liveness.detection.header'),
|
|
29626
29645
|
title: translateService.translate('sdk.liveness.detection.subtitle'),
|
|
29627
29646
|
subtitle: translateService.translate('sdk.liveness.detection.content'),
|
|
29628
29647
|
image: LIVENESS_GUIDE_IMG,
|
|
29629
|
-
content:
|
|
29630
|
-
<li>${translateService.translate('sdk.liveness.detection.infopageHint.face')}</li>
|
|
29631
|
-
<li>${translateService.translate('sdk.liveness.detection.infopageHint.environment')}</li>
|
|
29632
|
-
</ul>`,
|
|
29648
|
+
content: hintList,
|
|
29633
29649
|
confirm: translateService.translate('sdk.general.start'),
|
|
29634
29650
|
onClose: () => {
|
|
29635
29651
|
sendStatusAction$2(core.StatusAction.BtnClose);
|
|
@@ -30003,10 +30019,11 @@ const renderOCRUI = config => {
|
|
|
30003
30019
|
successBlockDom.classList.add('block');
|
|
30004
30020
|
const successDom = document.createElement('div');
|
|
30005
30021
|
// successDom.classList.add('img');
|
|
30006
|
-
successDom.
|
|
30022
|
+
successDom.textContent = '';
|
|
30023
|
+
successDom.insertAdjacentHTML('beforeend', `<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
30007
30024
|
<path d="M48 24C48 37.2548 37.2548 48 24 48C10.7452 48 0 37.2548 0 24C0 10.7452 10.7452 0 24 0C37.2548 0 48 10.7452 48 24Z" fill="${uiThemeConfig.uploadCompleteView.backgroundColor}" fill-opacity="${uiThemeConfig.fraudIntroStepTitle.backgroundOpacity}"/>
|
|
30008
30025
|
<path d="M19.9938 28.8441L14.7813 23.6316L13.0063 25.3941L19.9938 32.3816L34.9938 17.3816L33.2313 15.6191L19.9938 28.8441Z" fill="white"/>
|
|
30009
|
-
</svg
|
|
30026
|
+
</svg>`);
|
|
30010
30027
|
const successText = document.createElement('div');
|
|
30011
30028
|
util.uiThemeText(successText, uiThemeConfig.bodyOne);
|
|
30012
30029
|
successText.textContent = translateService.translate('sdk.general.done');
|
|
@@ -31727,7 +31744,8 @@ const fraudScanIntroPage = arg => {
|
|
|
31727
31744
|
domImage2.src = arg.image2 || fraudScanIntroPageStep2;
|
|
31728
31745
|
domBody2.innerText = arg.body2;
|
|
31729
31746
|
domBody3.innerText = arg.body3;
|
|
31730
|
-
domClose.
|
|
31747
|
+
domClose.textContent = '';
|
|
31748
|
+
domClose.insertAdjacentHTML('beforeend', `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M19.1943 6.41714C19.6393 5.97216 19.6393 5.2507 19.1943 4.80571C18.7493 4.36073 18.0278 4.36073 17.5829 4.80571L12 10.3886L6.41714 4.80572C5.97216 4.36073 5.2507 4.36073 4.80571 4.80571C4.36073 5.2507 4.36073 5.97216 4.80571 6.41714L10.3886 12L4.80571 17.5829C4.36073 18.0278 4.36073 18.7493 4.80571 19.1943C5.2507 19.6393 5.97216 19.6393 6.41714 19.1943L12 13.6114L17.5829 19.1943C18.0278 19.6393 18.7493 19.6393 19.1943 19.1943C19.6393 18.7493 19.6393 18.0278 19.1943 17.5829L13.6114 12L19.1943 6.41714Z" fill="${uiThemeConfig.nonEkycCloseButton.contentColor}" fill-opacity="${uiThemeConfig.nonEkycCloseButton.contentOpacity}" /></svg>`);
|
|
31731
31749
|
domConfirm.innerText = arg.confirm;
|
|
31732
31750
|
util.uiThemeButton(domConfirm, uiThemeConfig.majorButton);
|
|
31733
31751
|
// domBack.addEventListener('click', async () => {
|
|
@@ -31941,7 +31959,7 @@ const ocrResultModal = arg => {
|
|
|
31941
31959
|
domDropMenuLi.classList.add('active');
|
|
31942
31960
|
}
|
|
31943
31961
|
domDropMenuLi.setAttribute('data-value', selection.value);
|
|
31944
|
-
domDropMenuLi.
|
|
31962
|
+
domDropMenuLi.textContent = selection.name;
|
|
31945
31963
|
domDropMenuUl.appendChild(domDropMenuLi);
|
|
31946
31964
|
});
|
|
31947
31965
|
domDropMenu.appendChild(domDropMenuTitle);
|
|
@@ -32203,18 +32221,19 @@ const ocrResultModal = arg => {
|
|
|
32203
32221
|
util.uiThemeText(domSubtitle, uiThemeConfig.resultBody);
|
|
32204
32222
|
domTitle.innerText = arg.title;
|
|
32205
32223
|
domSubtitle.innerText = arg.subtitle;
|
|
32206
|
-
domHint.
|
|
32224
|
+
domHint.textContent = arg.hintText;
|
|
32207
32225
|
domCountDownContainer.style.color = uiThemeConfig.resultPageCountdown.textColor;
|
|
32208
32226
|
domCountDownContainer.style.fontSize = `${uiThemeConfig.resultPageCountdown.fontSize}px`;
|
|
32209
32227
|
domCountDownContainer.style.fontWeight = util.fontWeight[uiThemeConfig.resultPageCountdown.textWeight];
|
|
32210
|
-
domCountDownContainer.innerHTML = `${arg.countDown1Text} <span class="video-container__ocrResultModal-countdown" style="color: ${uiThemeConfig.resultPageCountdown.timeTextColor};font-size:${uiThemeConfig.resultPageCountdown.timeFontSize}px;font-weight:${util.fontWeight[uiThemeConfig.resultPageCountdown.timeTextWeight]}"> ${formatTime(timer)} </span> ${arg.countDown2Text}`;
|
|
32228
|
+
domCountDownContainer.innerHTML = `${arg.countDown1Text} <span class="video-container__ocrResultModal-countdown" style="color: ${util.safeColor(uiThemeConfig.resultPageCountdown.timeTextColor)};font-size:${util.safeFontSize(uiThemeConfig.resultPageCountdown.timeFontSize)}px;font-weight:${util.safeFontWeight(util.fontWeight[uiThemeConfig.resultPageCountdown.timeTextWeight])}"> ${formatTime(timer)} </span> ${arg.countDown2Text}`;
|
|
32211
32229
|
domConfirm.innerText = arg.confirmText;
|
|
32212
|
-
domClose.
|
|
32230
|
+
domClose.textContent = '';
|
|
32231
|
+
domClose.insertAdjacentHTML('beforeend', `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M19.1943 6.41714C19.6393 5.97216 19.6393 5.2507 19.1943 4.80571C18.7493 4.36073 18.0278 4.36073 17.5829 4.80571L12 10.3886L6.41714 4.80572C5.97216 4.36073 5.2507 4.36073 4.80571 4.80571C4.36073 5.2507 4.36073 5.97216 4.80571 6.41714L10.3886 12L4.80571 17.5829C4.36073 18.0278 4.36073 18.7493 4.80571 19.1943C5.2507 19.6393 5.97216 19.6393 6.41714 19.1943L12 13.6114L17.5829 19.1943C18.0278 19.6393 18.7493 19.6393 19.1943 19.1943C19.6393 18.7493 19.6393 18.0278 19.1943 17.5829L13.6114 12L19.1943 6.41714Z" fill="${util.safeColor(uiThemeConfig.nonEkycCloseButton.contentColor)}" fill-opacity="${util.safeOpacity(uiThemeConfig.nonEkycCloseButton.contentOpacity)}" /></svg>`);
|
|
32213
32232
|
const countdownInterval = setInterval(() => {
|
|
32214
32233
|
timer -= 1;
|
|
32215
32234
|
const countdownEl = domModal.querySelector('.video-container__ocrResultModal-countdown');
|
|
32216
32235
|
if (countdownEl) {
|
|
32217
|
-
countdownEl.
|
|
32236
|
+
countdownEl.textContent = formatTime(timer);
|
|
32218
32237
|
}
|
|
32219
32238
|
if (timer <= 0) {
|
|
32220
32239
|
clearInterval(countdownInterval);
|
|
@@ -33697,7 +33716,7 @@ async function startOCR(config) {
|
|
|
33697
33716
|
container: uiComponentBasic.videoContainer
|
|
33698
33717
|
});
|
|
33699
33718
|
let hint = true;
|
|
33700
|
-
cameraHint.
|
|
33719
|
+
cameraHint.textContent = translateService.translate('sdk.general.verify.error.switchCamera');
|
|
33701
33720
|
cameraSwitchContainer.addEventListener('click', async () => {
|
|
33702
33721
|
if (hint) {
|
|
33703
33722
|
setTimeout(() => {
|
|
@@ -33773,7 +33792,8 @@ async function startOCR(config) {
|
|
|
33773
33792
|
<path d="M15.0559 0.844991C14.0954 0.299519 12.8746 0.635956 12.3291 1.59644C11.7837 2.55693 12.1201 3.77775 13.0806 4.32322L14.0683 2.58411L15.0559 0.844991ZM24.3237 38.8301C25.1047 39.6112 26.371 39.6112 27.1521 38.8301L39.88 26.1022C40.6611 25.3212 40.6611 24.0548 39.88 23.2738C39.099 22.4927 37.8326 22.4927 37.0516 23.2738L25.7379 34.5875L14.4242 23.2738C13.6431 22.4927 12.3768 22.4927 11.5957 23.2738C10.8147 24.0548 10.8147 25.3212 11.5957 26.1022L24.3237 38.8301ZM14.0683 2.58411L13.0806 4.32322C19.6901 8.07682 22.2819 12.7684 23.3088 18.1847C23.836 20.9652 23.9531 23.9667 23.9286 27.2094C23.9163 28.8287 23.8693 30.4812 23.8246 32.1902C23.78 33.8911 23.7379 35.6411 23.7379 37.4159L25.7379 37.4159L27.7379 37.4159C27.7379 35.6988 27.7786 33.9955 27.8232 32.2949C27.8675 30.6023 27.9159 28.9052 27.9285 27.2397C27.9537 23.9128 27.8388 20.6044 27.2388 17.4396C26.0113 10.9653 22.7684 5.225 15.0559 0.844991L14.0683 2.58411Z" fill="#4AD396"/>
|
|
33774
33793
|
</svg>`
|
|
33775
33794
|
};
|
|
33776
|
-
container.
|
|
33795
|
+
container.textContent = '';
|
|
33796
|
+
container.insertAdjacentHTML('beforeend', svgContent[direction]);
|
|
33777
33797
|
return container;
|
|
33778
33798
|
};
|
|
33779
33799
|
switch (stage) {
|
|
@@ -33887,7 +33907,7 @@ const renderExtraUI = config => {
|
|
|
33887
33907
|
config.videoContainer.appendChild(titleTextPanel);
|
|
33888
33908
|
config.videoContainer.appendChild(cardborderContainer);
|
|
33889
33909
|
// Set init text
|
|
33890
|
-
titleText.
|
|
33910
|
+
titleText.textContent = translateService.translate('extra.title');
|
|
33891
33911
|
// Picture
|
|
33892
33912
|
const confirmContainer = document.createElement('div');
|
|
33893
33913
|
confirmContainer.classList.add('confirm_container');
|
|
@@ -36907,6 +36927,11 @@ const [, setFeature] = featureUseState;
|
|
|
36907
36927
|
const [, setStatusEvent] = eventUseState;
|
|
36908
36928
|
const [, setStatusView] = viewUseState;
|
|
36909
36929
|
|
|
36930
|
+
function escapeHtml(str) {
|
|
36931
|
+
const div = document.createElement('div');
|
|
36932
|
+
div.textContent = str;
|
|
36933
|
+
return div.innerHTML;
|
|
36934
|
+
}
|
|
36910
36935
|
function renderCardTypeAndCountryConfig(config) {
|
|
36911
36936
|
eventListenerService.start();
|
|
36912
36937
|
setFeature(core.Feature.SelectCardTypeAndCountry);
|
|
@@ -37058,7 +37083,7 @@ function renderCardTypeAndCountryConfig(config) {
|
|
|
37058
37083
|
dom.addEventListener('click', handleCardTypeClick);
|
|
37059
37084
|
dom.innerHTML = `
|
|
37060
37085
|
<div class="card-in-frame">
|
|
37061
|
-
<label class="card-label ${item.cardType.toLowerCase()}">${item.display}</label>
|
|
37086
|
+
<label class="card-label ${item.cardType.toLowerCase()}">${escapeHtml(item.display)}</label>
|
|
37062
37087
|
<i class="card-icon"></i>
|
|
37063
37088
|
</div>
|
|
37064
37089
|
`;
|
|
@@ -37091,6 +37116,23 @@ function renderCardTypeAndCountryConfig(config) {
|
|
|
37091
37116
|
});
|
|
37092
37117
|
}
|
|
37093
37118
|
|
|
37119
|
+
const VALID_COUNTRY_CODES = new Set(Object.values(idRecognition.CountryCode));
|
|
37120
|
+
/**
|
|
37121
|
+
* Defense-in-depth check for the public `getCardTypeAndCountry` API.
|
|
37122
|
+
*
|
|
37123
|
+
* The `supportCountries` value is interpolated into translation keys like
|
|
37124
|
+
* `sdk.general.country.${country}`. TypeScript's `CountryCode` enum does not
|
|
37125
|
+
* enforce values at runtime, so a misconfigured integrator could pass an
|
|
37126
|
+
* arbitrary string. Reject anything outside the SDK's known country list at
|
|
37127
|
+
* the entry point.
|
|
37128
|
+
*/
|
|
37129
|
+
function validateSupportCountries(countries) {
|
|
37130
|
+
const invalid = countries.filter(c => !VALID_COUNTRY_CODES.has(c));
|
|
37131
|
+
if (invalid.length > 0) {
|
|
37132
|
+
throw new Error(`Invalid country code in supportCountries: ${invalid.join(', ')}`);
|
|
37133
|
+
}
|
|
37134
|
+
}
|
|
37135
|
+
|
|
37094
37136
|
const _excluded = ["canvas", "loadingLottie"];
|
|
37095
37137
|
function identityVerificationFeatureIdentityVerification() {
|
|
37096
37138
|
return 'identity-verification-feature-identity-verification';
|
|
@@ -37190,6 +37232,9 @@ class AuthmeIdentityVerification extends engine.AuthmeFunctionModule {
|
|
|
37190
37232
|
}
|
|
37191
37233
|
async getCardTypeAndCountry(userConfig) {
|
|
37192
37234
|
var _userConfig$supportCo, _userConfig$supportCa;
|
|
37235
|
+
if (userConfig.supportCountries) {
|
|
37236
|
+
validateSupportCountries(userConfig.supportCountries);
|
|
37237
|
+
}
|
|
37193
37238
|
const defaultCountries = [idRecognition.CountryCode.TWN, idRecognition.CountryCode.JPN, idRecognition.CountryCode.ZAF, idRecognition.CountryCode.USA, idRecognition.CountryCode.CHN, idRecognition.CountryCode.PHL, idRecognition.CountryCode.GBR, idRecognition.CountryCode.KOR, idRecognition.CountryCode.HKG, idRecognition.CountryCode.FRA, idRecognition.CountryCode.ESP, idRecognition.CountryCode.MEX, idRecognition.CountryCode.ITA, idRecognition.CountryCode.IND, idRecognition.CountryCode.COL, idRecognition.CountryCode.RUS, idRecognition.CountryCode.DEU, idRecognition.CountryCode.TUR, idRecognition.CountryCode.CAN, idRecognition.CountryCode.AUS, idRecognition.CountryCode.IDN, idRecognition.CountryCode.MYS, idRecognition.CountryCode.EGY, idRecognition.CountryCode.SAU, idRecognition.CountryCode.NLD, idRecognition.CountryCode.SGP];
|
|
37194
37239
|
const defaultCountry = userConfig.defaultCountry !== undefined && defaultCountries.includes(userConfig.defaultCountry) ? userConfig.defaultCountry : defaultCountries[0];
|
|
37195
37240
|
const supportCountries = (_userConfig$supportCo = userConfig.supportCountries) != null ? _userConfig$supportCo : defaultCountries;
|
|
@@ -37360,8 +37405,134 @@ class AuthmeIdentityVerification extends engine.AuthmeFunctionModule {
|
|
|
37360
37405
|
}
|
|
37361
37406
|
}
|
|
37362
37407
|
|
|
37408
|
+
const MIN_IOS_MAJOR = 16;
|
|
37409
|
+
const MIN_IOS_MINOR_FOR_16 = 4;
|
|
37410
|
+
const MIN_ANDROID_MAJOR = 9;
|
|
37411
|
+
const IN_APP_WEBVIEW_PATTERNS = [{
|
|
37412
|
+
key: 'line',
|
|
37413
|
+
pattern: /\bLine\//i
|
|
37414
|
+
}, {
|
|
37415
|
+
key: 'messenger',
|
|
37416
|
+
pattern: /\bMessenger\b/i
|
|
37417
|
+
}, {
|
|
37418
|
+
key: 'fb',
|
|
37419
|
+
pattern: /\bFBAN|FBAV|FB_IAB\b/i
|
|
37420
|
+
}, {
|
|
37421
|
+
key: 'instagram',
|
|
37422
|
+
pattern: /\bInstagram\b/i
|
|
37423
|
+
}, {
|
|
37424
|
+
key: 'wechat',
|
|
37425
|
+
pattern: /MicroMessenger|WeChat/i
|
|
37426
|
+
}];
|
|
37427
|
+
function detectWebAssembly() {
|
|
37428
|
+
return typeof WebAssembly !== 'undefined';
|
|
37429
|
+
}
|
|
37430
|
+
function detectWebAssemblySimd() {
|
|
37431
|
+
if (!detectWebAssembly()) return false;
|
|
37432
|
+
// Mirrors libs/engine/src/lib/engine.ts isSimdSupported(); kept independent
|
|
37433
|
+
// so callers don't have to load the engine bundle just to introspect.
|
|
37434
|
+
try {
|
|
37435
|
+
if (/iPad|iPhone|iPod/.test(navigator.userAgent)) {
|
|
37436
|
+
return false;
|
|
37437
|
+
}
|
|
37438
|
+
return WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 9, 1, 7, 0, 65, 0, 253, 15, 26, 11]));
|
|
37439
|
+
} catch (_unused) {
|
|
37440
|
+
return false;
|
|
37441
|
+
}
|
|
37442
|
+
}
|
|
37443
|
+
function detectMediaDevices() {
|
|
37444
|
+
var _navigator$mediaDevic;
|
|
37445
|
+
return typeof navigator !== 'undefined' && 'mediaDevices' in navigator && typeof ((_navigator$mediaDevic = navigator.mediaDevices) == null ? void 0 : _navigator$mediaDevic.getUserMedia) === 'function';
|
|
37446
|
+
}
|
|
37447
|
+
function detectSecureContext() {
|
|
37448
|
+
var _window$location;
|
|
37449
|
+
if (typeof window === 'undefined') return false;
|
|
37450
|
+
if (typeof window.isSecureContext === 'boolean') {
|
|
37451
|
+
return window.isSecureContext;
|
|
37452
|
+
}
|
|
37453
|
+
return ((_window$location = window.location) == null ? void 0 : _window$location.protocol) === 'https:';
|
|
37454
|
+
}
|
|
37455
|
+
function detectInAppWebView() {
|
|
37456
|
+
var _navigator$userAgent;
|
|
37457
|
+
const ua = (_navigator$userAgent = navigator.userAgent) != null ? _navigator$userAgent : '';
|
|
37458
|
+
for (const {
|
|
37459
|
+
key,
|
|
37460
|
+
pattern
|
|
37461
|
+
} of IN_APP_WEBVIEW_PATTERNS) {
|
|
37462
|
+
if (pattern.test(ua)) return key;
|
|
37463
|
+
}
|
|
37464
|
+
return 'none';
|
|
37465
|
+
}
|
|
37466
|
+
function parseIosVersion() {
|
|
37467
|
+
const m = navigator.userAgent.match(/OS (\d+)[._](\d+)(?:[._](\d+))?/);
|
|
37468
|
+
if (!m) return null;
|
|
37469
|
+
return {
|
|
37470
|
+
major: Number(m[1]),
|
|
37471
|
+
minor: Number(m[2])
|
|
37472
|
+
};
|
|
37473
|
+
}
|
|
37474
|
+
function parseAndroidMajor() {
|
|
37475
|
+
const m = navigator.userAgent.match(/Android\s+(\d+)/i);
|
|
37476
|
+
if (!m) return null;
|
|
37477
|
+
return Number(m[1]);
|
|
37478
|
+
}
|
|
37479
|
+
function detectHardwareConcurrency() {
|
|
37480
|
+
if (typeof navigator === 'undefined') return null;
|
|
37481
|
+
const v = navigator.hardwareConcurrency;
|
|
37482
|
+
return typeof v === 'number' && v > 0 ? v : null;
|
|
37483
|
+
}
|
|
37484
|
+
function detectDeviceMemory() {
|
|
37485
|
+
if (typeof navigator === 'undefined') return null;
|
|
37486
|
+
const v = navigator.deviceMemory;
|
|
37487
|
+
return typeof v === 'number' && v > 0 ? v : null;
|
|
37488
|
+
}
|
|
37489
|
+
/**
|
|
37490
|
+
* Synchronous pre-flight check that the current browser/device can run the
|
|
37491
|
+
* eKYC SDK. Returns a binary `supported` flag plus the reasons it failed
|
|
37492
|
+
* (when applicable) and a snapshot of the detected environment.
|
|
37493
|
+
*
|
|
37494
|
+
* The check is UA + feature detection only — it does not request the camera,
|
|
37495
|
+
* load the engine, or make network requests. Typical execution time < 5 ms.
|
|
37496
|
+
*/
|
|
37497
|
+
function isSupported() {
|
|
37498
|
+
const info = {
|
|
37499
|
+
device: util.getDeviceInfo(),
|
|
37500
|
+
system: util.getSystemInfo(),
|
|
37501
|
+
webAssembly: detectWebAssembly(),
|
|
37502
|
+
webAssemblySimd: detectWebAssemblySimd(),
|
|
37503
|
+
mediaDevices: detectMediaDevices(),
|
|
37504
|
+
secureContext: detectSecureContext(),
|
|
37505
|
+
inAppWebView: detectInAppWebView(),
|
|
37506
|
+
hardwareConcurrency: detectHardwareConcurrency(),
|
|
37507
|
+
deviceMemory: detectDeviceMemory()
|
|
37508
|
+
};
|
|
37509
|
+
const reasons = [];
|
|
37510
|
+
if (!info.webAssembly) reasons.push('NO_WEBASSEMBLY');
|
|
37511
|
+
if (!info.mediaDevices) reasons.push('NO_MEDIA_DEVICES');
|
|
37512
|
+
if (util.isMobileOrTablet() && !info.secureContext) {
|
|
37513
|
+
// Camera APIs require a secure context on mobile; localhost is always
|
|
37514
|
+
// treated as secure by the platform, so this fires for true plaintext only.
|
|
37515
|
+
reasons.push('INSECURE_CONTEXT');
|
|
37516
|
+
}
|
|
37517
|
+
if (info.inAppWebView !== 'none') reasons.push('IN_APP_WEBVIEW');
|
|
37518
|
+
const ios = parseIosVersion();
|
|
37519
|
+
if (ios) {
|
|
37520
|
+
const tooOld = ios.major < MIN_IOS_MAJOR || ios.major === MIN_IOS_MAJOR && ios.minor < MIN_IOS_MINOR_FOR_16;
|
|
37521
|
+
if (tooOld) reasons.push('OLD_IOS');
|
|
37522
|
+
}
|
|
37523
|
+
const android = parseAndroidMajor();
|
|
37524
|
+
if (android !== null && android < MIN_ANDROID_MAJOR) {
|
|
37525
|
+
reasons.push('OLD_ANDROID');
|
|
37526
|
+
}
|
|
37527
|
+
return {
|
|
37528
|
+
supported: reasons.length === 0,
|
|
37529
|
+
reasons,
|
|
37530
|
+
info
|
|
37531
|
+
};
|
|
37532
|
+
}
|
|
37533
|
+
|
|
37363
37534
|
var name = "authme/sdk";
|
|
37364
|
-
var version$1 = "2.8.
|
|
37535
|
+
var version$1 = "2.8.59";
|
|
37365
37536
|
var packageInfo = {
|
|
37366
37537
|
name: name,
|
|
37367
37538
|
version: version$1};
|
|
@@ -37390,6 +37561,7 @@ exports.defaultIdentityVerificationConfig = defaultIdentityVerificationConfig;
|
|
|
37390
37561
|
exports.defaultLivenessConfig = defaultLivenessConfig;
|
|
37391
37562
|
exports.fraudScanIntroPageStep1 = fraudScanIntroPageStep1;
|
|
37392
37563
|
exports.identityVerificationFeatureIdentityVerification = identityVerificationFeatureIdentityVerification;
|
|
37564
|
+
exports.isSupported = isSupported;
|
|
37393
37565
|
exports.renderExtraUI = renderExtraUI;
|
|
37394
37566
|
exports.scan = scan;
|
|
37395
37567
|
exports.startExtra = startExtra;
|