vesant-sdk 2.0.0-dev.93ecc12 → 2.0.0-dev.9a74cc1
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/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/react.js +61 -19
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +61 -19
- package/dist/react.mjs.map +1 -1
- package/dist/webhooks/index.d.mts +11 -3
- package/dist/webhooks/index.d.ts +11 -3
- package/package.json +1 -1
package/dist/react.mjs
CHANGED
|
@@ -887,10 +887,10 @@ var Upload = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0i
|
|
|
887
887
|
// src/kyc/FaceCaptureModal.tsx
|
|
888
888
|
var MOBILE_UA = /Mobi|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
|
|
889
889
|
var LIVENESS_MESSAGES = [
|
|
890
|
-
"
|
|
891
|
-
"
|
|
892
|
-
"
|
|
893
|
-
"
|
|
890
|
+
"Position your face inside the circle",
|
|
891
|
+
"Make sure your face is well lit",
|
|
892
|
+
"Remove glasses or hats if possible",
|
|
893
|
+
"Look straight at the camera, then tap Capture"
|
|
894
894
|
];
|
|
895
895
|
function headerSubtitle(stageKind) {
|
|
896
896
|
switch (stageKind) {
|
|
@@ -899,7 +899,7 @@ function headerSubtitle(stageKind) {
|
|
|
899
899
|
case "accepted":
|
|
900
900
|
return "All set";
|
|
901
901
|
case "declined":
|
|
902
|
-
return "Verification didn't match
|
|
902
|
+
return "Verification didn't match, try once more";
|
|
903
903
|
case "max_attempts":
|
|
904
904
|
return "We couldn't verify you";
|
|
905
905
|
default:
|
|
@@ -1005,6 +1005,15 @@ function FaceCaptureModal({
|
|
|
1005
1005
|
setStage({ kind: "submitting" });
|
|
1006
1006
|
let settled = false;
|
|
1007
1007
|
const ref = session.reference;
|
|
1008
|
+
const baselineAttempts = attempts;
|
|
1009
|
+
const isFreshPollResult = (r) => {
|
|
1010
|
+
if (r.status === "accepted") return true;
|
|
1011
|
+
if (r.status === "declined") {
|
|
1012
|
+
const derivedAttempts = maxAttempts - (r.data?.retries_remaining ?? 0);
|
|
1013
|
+
return derivedAttempts > baselineAttempts;
|
|
1014
|
+
}
|
|
1015
|
+
return false;
|
|
1016
|
+
};
|
|
1008
1017
|
try {
|
|
1009
1018
|
const postPromise = (async () => {
|
|
1010
1019
|
try {
|
|
@@ -1025,7 +1034,7 @@ function FaceCaptureModal({
|
|
|
1025
1034
|
if (settled || cancelledRef.current) return null;
|
|
1026
1035
|
try {
|
|
1027
1036
|
const r = await client.getReuseKycSessionStatus(ref);
|
|
1028
|
-
if (r
|
|
1037
|
+
if (isFreshPollResult(r)) return r;
|
|
1029
1038
|
} catch {
|
|
1030
1039
|
}
|
|
1031
1040
|
if (settled || cancelledRef.current) return null;
|
|
@@ -1176,6 +1185,7 @@ var keyframes = `
|
|
|
1176
1185
|
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
|
|
1177
1186
|
@keyframes zoomIn { from { transform: scale(.96); opacity: 0 } to { transform: scale(1); opacity: 1 } }
|
|
1178
1187
|
@keyframes spin { to { transform: rotate(360deg) } }
|
|
1188
|
+
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .5 } }
|
|
1179
1189
|
`;
|
|
1180
1190
|
var overlayStyle = {
|
|
1181
1191
|
position: "fixed",
|
|
@@ -1423,7 +1433,7 @@ function LiveCamera({ onCapture, onCancel, message }) {
|
|
|
1423
1433
|
autoPlay: true,
|
|
1424
1434
|
style: videoStyle
|
|
1425
1435
|
}
|
|
1426
|
-
), /* @__PURE__ */ React.createElement("div", { style:
|
|
1436
|
+
), /* @__PURE__ */ React.createElement("div", { style: faceOverlayContainerStyle, "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("div", { style: faceRingWrapStyle }, /* @__PURE__ */ React.createElement("div", { style: faceDashedRingStyle }), /* @__PURE__ */ React.createElement("div", { style: faceCircleStyle }))), message && /* @__PURE__ */ React.createElement("div", { style: liveMessagePillContainerStyle }, /* @__PURE__ */ React.createElement("div", { style: liveMessagePillStyle }, /* @__PURE__ */ React.createElement("span", { style: liveMessagePillTextStyle }, message))), !ready && /* @__PURE__ */ React.createElement("div", { style: videoLoadingStyle }, "Starting camera\u2026")), /* @__PURE__ */ React.createElement("div", { style: buttonsContainerStyle }, /* @__PURE__ */ React.createElement(
|
|
1427
1437
|
"button",
|
|
1428
1438
|
{
|
|
1429
1439
|
style: ready ? primaryButtonStyle : { ...primaryButtonStyle, opacity: 0.5, cursor: "not-allowed" },
|
|
@@ -1449,13 +1459,32 @@ var videoStyle = {
|
|
|
1449
1459
|
transform: "scaleX(-1)"
|
|
1450
1460
|
// mirror so the preview matches the user's POV
|
|
1451
1461
|
};
|
|
1452
|
-
var
|
|
1462
|
+
var faceOverlayContainerStyle = {
|
|
1453
1463
|
position: "absolute",
|
|
1454
1464
|
inset: 0,
|
|
1455
1465
|
pointerEvents: "none",
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1466
|
+
display: "flex",
|
|
1467
|
+
alignItems: "center",
|
|
1468
|
+
justifyContent: "center"
|
|
1469
|
+
};
|
|
1470
|
+
var faceRingWrapStyle = {
|
|
1471
|
+
position: "relative",
|
|
1472
|
+
width: "72%",
|
|
1473
|
+
aspectRatio: "1 / 1"
|
|
1474
|
+
};
|
|
1475
|
+
var faceDashedRingStyle = {
|
|
1476
|
+
position: "absolute",
|
|
1477
|
+
inset: -6,
|
|
1478
|
+
borderRadius: "50%",
|
|
1479
|
+
border: "6px dashed rgba(255, 255, 255, 0.4)",
|
|
1480
|
+
animation: "spin 10s linear infinite"
|
|
1481
|
+
};
|
|
1482
|
+
var faceCircleStyle = {
|
|
1483
|
+
position: "absolute",
|
|
1484
|
+
inset: 0,
|
|
1485
|
+
borderRadius: "50%",
|
|
1486
|
+
border: "4px solid #00bc7d",
|
|
1487
|
+
boxShadow: "0 0 0 1000px rgba(0, 0, 0, 0.5)"
|
|
1459
1488
|
};
|
|
1460
1489
|
var videoLoadingStyle = {
|
|
1461
1490
|
position: "absolute",
|
|
@@ -1467,16 +1496,29 @@ var videoLoadingStyle = {
|
|
|
1467
1496
|
fontSize: 14,
|
|
1468
1497
|
fontWeight: 500
|
|
1469
1498
|
};
|
|
1470
|
-
var
|
|
1471
|
-
|
|
1499
|
+
var liveMessagePillContainerStyle = {
|
|
1500
|
+
position: "absolute",
|
|
1501
|
+
top: 12,
|
|
1502
|
+
left: "50%",
|
|
1503
|
+
transform: "translateX(-50%)",
|
|
1504
|
+
maxWidth: "84%",
|
|
1505
|
+
pointerEvents: "none"
|
|
1506
|
+
};
|
|
1507
|
+
var liveMessagePillStyle = {
|
|
1508
|
+
background: "rgba(0, 0, 0, 0.7)",
|
|
1509
|
+
backdropFilter: "blur(6px)",
|
|
1510
|
+
border: "1px solid rgba(255, 255, 255, 0.2)",
|
|
1511
|
+
borderRadius: 999,
|
|
1512
|
+
padding: "6px 12px",
|
|
1472
1513
|
textAlign: "center",
|
|
1473
|
-
|
|
1514
|
+
boxShadow: "0 10px 25px -5px rgba(0,0,0,.3)"
|
|
1515
|
+
};
|
|
1516
|
+
var liveMessagePillTextStyle = {
|
|
1517
|
+
margin: 0,
|
|
1518
|
+
fontSize: 12,
|
|
1474
1519
|
fontWeight: 500,
|
|
1475
|
-
color: "#
|
|
1476
|
-
|
|
1477
|
-
border: "1px solid rgba(0, 188, 125, 0.25)",
|
|
1478
|
-
borderRadius: 8,
|
|
1479
|
-
padding: "8px 12px"
|
|
1520
|
+
color: "#ffffff",
|
|
1521
|
+
animation: "pulse 2s ease-in-out infinite"
|
|
1480
1522
|
};
|
|
1481
1523
|
var FaceCaptureModal_default = FaceCaptureModal;
|
|
1482
1524
|
|