idmission-web-sdk 2.3.80 → 2.3.82
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/components/submission/SubmissionProvider.d.ts +2 -0
- package/dist/components/submission/SubmissionProvider.d.ts.map +1 -1
- package/dist/components/submission/types.d.ts +2 -0
- package/dist/components/submission/types.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureCapture.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureContext.d.ts +7 -2
- package/dist/components/video_signature_capture/VideoSignatureContext.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureGuides.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignaturePad.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts +1 -1
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts.map +1 -1
- package/dist/sdk2.cjs.development.js +173 -69
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +173 -69
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +173 -69
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +4 -4
package/dist/sdk2.esm.js
CHANGED
|
@@ -205,7 +205,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
205
205
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
206
206
|
};
|
|
207
207
|
|
|
208
|
-
var webSdkVersion = '2.3.
|
|
208
|
+
var webSdkVersion = '2.3.82';
|
|
209
209
|
|
|
210
210
|
function getPlatform() {
|
|
211
211
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -1145,6 +1145,12 @@ var SubmissionContext = /*#__PURE__*/createContext({
|
|
|
1145
1145
|
setIdCaptureVideoUrl: function setIdCaptureVideoUrl() {
|
|
1146
1146
|
return null;
|
|
1147
1147
|
},
|
|
1148
|
+
setSignatureStartTimestamp: function setSignatureStartTimestamp() {
|
|
1149
|
+
return null;
|
|
1150
|
+
},
|
|
1151
|
+
setSignatureEndTimestamp: function setSignatureEndTimestamp() {
|
|
1152
|
+
return null;
|
|
1153
|
+
},
|
|
1148
1154
|
setIdCaptureVideoIdFrontImage: function setIdCaptureVideoIdFrontImage() {
|
|
1149
1155
|
return null;
|
|
1150
1156
|
},
|
|
@@ -1309,44 +1315,50 @@ var SubmissionProvider = function SubmissionProvider(_a) {
|
|
|
1309
1315
|
signatureVideoUrl = _16[0],
|
|
1310
1316
|
setSignatureVideoUrl = _16[1];
|
|
1311
1317
|
var _17 = useState(null),
|
|
1312
|
-
|
|
1313
|
-
|
|
1318
|
+
signatureStartTimestamp = _17[0],
|
|
1319
|
+
setSignatureStartTimestamp = _17[1];
|
|
1314
1320
|
var _18 = useState(null),
|
|
1315
|
-
|
|
1316
|
-
|
|
1321
|
+
signatureEndTimestamp = _18[0],
|
|
1322
|
+
setSignatureEndTimestamp = _18[1];
|
|
1317
1323
|
var _19 = useState(null),
|
|
1318
|
-
|
|
1319
|
-
|
|
1324
|
+
idCaptureVideoUrl = _19[0],
|
|
1325
|
+
setIdCaptureVideoUrl = _19[1];
|
|
1320
1326
|
var _20 = useState(null),
|
|
1321
|
-
|
|
1322
|
-
|
|
1327
|
+
idCaptureVideoIdFrontImage = _20[0],
|
|
1328
|
+
setIdCaptureVideoIdFrontImage = _20[1];
|
|
1323
1329
|
var _21 = useState(null),
|
|
1324
|
-
|
|
1325
|
-
|
|
1330
|
+
idCaptureVideoIdBackImage = _21[0],
|
|
1331
|
+
setIdCaptureVideoIdBackImage = _21[1];
|
|
1326
1332
|
var _22 = useState(null),
|
|
1327
|
-
|
|
1328
|
-
|
|
1333
|
+
idCaptureVideoAudioUrl = _22[0],
|
|
1334
|
+
setIdCaptureVideoAudioUrl = _22[1];
|
|
1329
1335
|
var _23 = useState(null),
|
|
1330
|
-
|
|
1331
|
-
|
|
1336
|
+
idCaptureVideoAudioStartsAt = _23[0],
|
|
1337
|
+
setIdCaptureVideoAudioStartsAt = _23[1];
|
|
1332
1338
|
var _24 = useState(null),
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
var _25 = useState(
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
var _26 = useState(
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
var _27 = useState(
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
var _28 = useState(
|
|
1345
|
-
|
|
1346
|
-
|
|
1339
|
+
expectedAudioText = _24[0],
|
|
1340
|
+
setExpectedAudioText = _24[1];
|
|
1341
|
+
var _25 = useState(null),
|
|
1342
|
+
additionalDocuments = _25[0],
|
|
1343
|
+
setAdditionalDocuments = _25[1];
|
|
1344
|
+
var _26 = useState(null),
|
|
1345
|
+
geolocationResult = _26[0],
|
|
1346
|
+
setGeolocationResult = _26[1];
|
|
1347
|
+
var _27 = useState(0),
|
|
1348
|
+
geolocationAttempts = _27[0],
|
|
1349
|
+
setGeolocationAttempts = _27[1];
|
|
1350
|
+
var _28 = useState(false),
|
|
1351
|
+
geolocationBlocked = _28[0],
|
|
1352
|
+
setGeolocationBlocked = _28[1];
|
|
1347
1353
|
var _29 = useState([]),
|
|
1348
|
-
|
|
1349
|
-
|
|
1354
|
+
idFrontCaptureAttempts = _29[0],
|
|
1355
|
+
setIdFrontCaptureAttempts = _29[1];
|
|
1356
|
+
var _30 = useState([]),
|
|
1357
|
+
idBackCaptureAttempts = _30[0],
|
|
1358
|
+
setIdBackCaptureAttempts = _30[1];
|
|
1359
|
+
var _31 = useState([]),
|
|
1360
|
+
selfieCaptureAttempts = _31[0],
|
|
1361
|
+
setSelfieCaptureAttempts = _31[1];
|
|
1350
1362
|
var logIdFrontCaptureAttempt = useCallback(function (attempt) {
|
|
1351
1363
|
setIdFrontCaptureAttempts(function (attempts) {
|
|
1352
1364
|
return __spreadArray(__spreadArray([], attempts, true), [attempt], false);
|
|
@@ -1623,6 +1635,12 @@ var SubmissionProvider = function SubmissionProvider(_a) {
|
|
|
1623
1635
|
submissionRequest.customerData.signatureData.signatureVideo = documents.signatureVideo;
|
|
1624
1636
|
}
|
|
1625
1637
|
}
|
|
1638
|
+
if (signatureStartTimestamp) {
|
|
1639
|
+
submissionRequest.customerData.signatureStartTimestamp = signatureStartTimestamp;
|
|
1640
|
+
}
|
|
1641
|
+
if (signatureEndTimestamp) {
|
|
1642
|
+
submissionRequest.customerData.signatureEndTimestamp = signatureEndTimestamp;
|
|
1643
|
+
}
|
|
1626
1644
|
if (additionalDocuments) {
|
|
1627
1645
|
submissionRequest.customerData.additionalDocuments = additionalDocuments.map(function (d) {
|
|
1628
1646
|
return _assign(_assign({}, d), {
|
|
@@ -1665,7 +1683,7 @@ var SubmissionProvider = function SubmissionProvider(_a) {
|
|
|
1665
1683
|
}
|
|
1666
1684
|
});
|
|
1667
1685
|
});
|
|
1668
|
-
}, [additionalDocuments, bypassAgeValidation, bypassNameMatching, cardData, clientRequestID, companyId, customerDataMatchConfig, deduplicationEnabled, deduplicationSynchronous, documentServiceUrl, enrollmentId, expectedAudioText, geolocationResult, idBackCaptureAttempts, idBackImage, idBackImageRequired, idBackIrImage, idBackUvImage, idCaptureVideoAudioStartsAt, idCaptureVideoAudioUrl, idCaptureVideoIdBackImage, idCaptureVideoIdFrontImage, idCaptureVideoUrl, idCardForFaceMatch, idData, idFrontCaptureAttempts, idFrontImage, idFrontIrImage, idFrontUvImage, idImageResolutionCheck, jobId, manualReviewRequired, needImmediateResponse, passportImage, personalData, selfieCaptureAttempts, selfieImage, signatureData, signatureVideoUrl, uploadDocument, verifyIdWithExternalDatabases, webhooksClientTraceId, webhooksEnabled, webhooksFireOnReview, webhooksFireOnReviewURL, webhooksSendInputImages, webhooksSendProcessedImages, webhooksStripSpecialCharacters, webhooksURL]);
|
|
1686
|
+
}, [additionalDocuments, bypassAgeValidation, bypassNameMatching, cardData, clientRequestID, companyId, customerDataMatchConfig, deduplicationEnabled, deduplicationSynchronous, documentServiceUrl, enrollmentId, expectedAudioText, geolocationResult, idBackCaptureAttempts, idBackImage, idBackImageRequired, idBackIrImage, idBackUvImage, idCaptureVideoAudioStartsAt, idCaptureVideoAudioUrl, idCaptureVideoIdBackImage, idCaptureVideoIdFrontImage, idCaptureVideoUrl, idCardForFaceMatch, idData, idFrontCaptureAttempts, idFrontImage, idFrontIrImage, idFrontUvImage, idImageResolutionCheck, jobId, manualReviewRequired, needImmediateResponse, passportImage, personalData, selfieCaptureAttempts, selfieImage, signatureData, signatureEndTimestamp, signatureStartTimestamp, signatureVideoUrl, uploadDocument, verifyIdWithExternalDatabases, webhooksClientTraceId, webhooksEnabled, webhooksFireOnReview, webhooksFireOnReviewURL, webhooksSendInputImages, webhooksSendProcessedImages, webhooksStripSpecialCharacters, webhooksURL]);
|
|
1669
1687
|
var defaultOnSubmit = useCallback(function () {
|
|
1670
1688
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
1671
1689
|
var submissionResponse_1, payload, host, endpoint, response, statusMessage, submissionResponse_2, e_1, err;
|
|
@@ -1962,6 +1980,8 @@ var SubmissionProvider = function SubmissionProvider(_a) {
|
|
|
1962
1980
|
setSelfieImage: setSelfieImage,
|
|
1963
1981
|
setSignatureData: setSignatureData,
|
|
1964
1982
|
setSignatureVideoUrl: setSignatureVideoUrl,
|
|
1983
|
+
setSignatureStartTimestamp: setSignatureStartTimestamp,
|
|
1984
|
+
setSignatureEndTimestamp: setSignatureEndTimestamp,
|
|
1965
1985
|
setIdCaptureVideoUrl: setIdCaptureVideoUrl,
|
|
1966
1986
|
setIdCaptureVideoIdFrontImage: setIdCaptureVideoIdFrontImage,
|
|
1967
1987
|
setIdCaptureVideoIdBackImage: setIdCaptureVideoIdBackImage,
|
|
@@ -13838,7 +13858,6 @@ var videoSignatureInitialState = {
|
|
|
13838
13858
|
clearRecordedData: function clearRecordedData() {
|
|
13839
13859
|
return null;
|
|
13840
13860
|
},
|
|
13841
|
-
isRecording: false,
|
|
13842
13861
|
signaturePad: {
|
|
13843
13862
|
current: null
|
|
13844
13863
|
},
|
|
@@ -13861,7 +13880,7 @@ var useVideoSignatureStore = create()(devtools(function (set, get) {
|
|
|
13861
13880
|
if (!camera) throw new Error('Camera not found');
|
|
13862
13881
|
// set our flag and clear whatever we have recorded so far.
|
|
13863
13882
|
set({
|
|
13864
|
-
|
|
13883
|
+
recordingStartedAt: performance.now()
|
|
13865
13884
|
});
|
|
13866
13885
|
signatureChunks = [];
|
|
13867
13886
|
// start recording video and audio
|
|
@@ -13875,27 +13894,51 @@ var useVideoSignatureStore = create()(devtools(function (set, get) {
|
|
|
13875
13894
|
videoBitsPerSecond: 270000,
|
|
13876
13895
|
audioBitsPerSecond: 32000
|
|
13877
13896
|
});
|
|
13897
|
+
var hasFirstChunk = false;
|
|
13878
13898
|
signatureRecorder.ondataavailable = function (event) {
|
|
13879
13899
|
signatureChunks.push(event.data);
|
|
13900
|
+
if (!hasFirstChunk) {
|
|
13901
|
+
hasFirstChunk = true;
|
|
13902
|
+
set({
|
|
13903
|
+
firstChunkReceivedAt: performance.now(),
|
|
13904
|
+
lastChunkReceivedAt: performance.now()
|
|
13905
|
+
});
|
|
13906
|
+
} else {
|
|
13907
|
+
set({
|
|
13908
|
+
lastChunkReceivedAt: performance.now()
|
|
13909
|
+
});
|
|
13910
|
+
}
|
|
13880
13911
|
};
|
|
13881
13912
|
signatureRecorder.start(100);
|
|
13882
13913
|
},
|
|
13883
13914
|
stopRecording: function stopRecording(signatureData, imageUrl) {
|
|
13884
13915
|
set({
|
|
13885
|
-
|
|
13916
|
+
firstChunkReceivedAt: undefined,
|
|
13917
|
+
recordingStoppedAt: performance.now()
|
|
13918
|
+
});
|
|
13919
|
+
waitForOneMoreChunk().then(function () {
|
|
13920
|
+
if (!signatureRecorder) return;
|
|
13921
|
+
signatureRecorder.stop();
|
|
13922
|
+
signatureRecorder.onstop = function () {
|
|
13923
|
+
var blob = new Blob(signatureChunks, {
|
|
13924
|
+
type: 'video/mp4'
|
|
13925
|
+
});
|
|
13926
|
+
signatureChunks = [];
|
|
13927
|
+
signatureRecorder = null;
|
|
13928
|
+
if (!signatureData) return;
|
|
13929
|
+
var _a = get(),
|
|
13930
|
+
onSignatureVideoCaptured = _a.onSignatureVideoCaptured,
|
|
13931
|
+
recordingStartedAt = _a.recordingStartedAt,
|
|
13932
|
+
signatureStartedAt = _a.signatureStartedAt,
|
|
13933
|
+
signatureEndedAt = _a.signatureEndedAt,
|
|
13934
|
+
lastChunkReceivedAt = _a.lastChunkReceivedAt;
|
|
13935
|
+
var endMs = Math.min(signatureEndedAt !== null && signatureEndedAt !== void 0 ? signatureEndedAt : Infinity, lastChunkReceivedAt !== null && lastChunkReceivedAt !== void 0 ? lastChunkReceivedAt : Infinity);
|
|
13936
|
+
var signatureStartTimestamp = signatureStartedAt && recordingStartedAt ? formatTimestamp(Math.max(0, signatureStartedAt - recordingStartedAt - 500)) : undefined;
|
|
13937
|
+
var signatureEndTimestamp = endMs !== Infinity && recordingStartedAt ? formatTimestamp(Math.min(endMs - recordingStartedAt + 500, lastChunkReceivedAt !== null && lastChunkReceivedAt !== void 0 ? lastChunkReceivedAt : Infinity)) : undefined;
|
|
13938
|
+
onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, signatureStartTimestamp, signatureEndTimestamp);
|
|
13939
|
+
};
|
|
13940
|
+
useVideoRecorderStore.getState().stopRecording();
|
|
13886
13941
|
});
|
|
13887
|
-
if (!signatureRecorder) return;
|
|
13888
|
-
signatureRecorder.stop();
|
|
13889
|
-
signatureRecorder.onstop = function () {
|
|
13890
|
-
var blob = new Blob(signatureChunks, {
|
|
13891
|
-
type: 'video/mp4'
|
|
13892
|
-
});
|
|
13893
|
-
signatureChunks = [];
|
|
13894
|
-
signatureRecorder = null;
|
|
13895
|
-
if (!signatureData) return;
|
|
13896
|
-
get().onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null);
|
|
13897
|
-
};
|
|
13898
|
-
useVideoRecorderStore.getState().stopRecording();
|
|
13899
13942
|
},
|
|
13900
13943
|
clearRecordedData: function clearRecordedData() {
|
|
13901
13944
|
signatureChunks = [];
|
|
@@ -13904,13 +13947,42 @@ var useVideoSignatureStore = create()(devtools(function (set, get) {
|
|
|
13904
13947
|
signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.stop();
|
|
13905
13948
|
signatureRecorder = null;
|
|
13906
13949
|
set({
|
|
13907
|
-
|
|
13950
|
+
recordingStartedAt: undefined,
|
|
13951
|
+
recordingStoppedAt: undefined,
|
|
13952
|
+
firstChunkReceivedAt: undefined,
|
|
13953
|
+
lastChunkReceivedAt: undefined,
|
|
13908
13954
|
signaturePadEmpty: true,
|
|
13909
|
-
signatureValid: false
|
|
13955
|
+
signatureValid: false,
|
|
13956
|
+
signatureStartedAt: undefined,
|
|
13957
|
+
signatureEndedAt: undefined
|
|
13910
13958
|
});
|
|
13911
13959
|
}
|
|
13912
13960
|
});
|
|
13913
13961
|
}));
|
|
13962
|
+
function waitForOneMoreChunk(timeoutMs) {
|
|
13963
|
+
if (timeoutMs === void 0) {
|
|
13964
|
+
timeoutMs = 3000;
|
|
13965
|
+
}
|
|
13966
|
+
var start = performance.now();
|
|
13967
|
+
return new Promise(function (resolve) {
|
|
13968
|
+
var initialLastChunkReceivedAt = useVideoSignatureStore.getState().lastChunkReceivedAt;
|
|
13969
|
+
if (!initialLastChunkReceivedAt) return resolve();
|
|
13970
|
+
function gotAChunk() {
|
|
13971
|
+
var lastChunkReceivedAt = useVideoSignatureStore.getState().lastChunkReceivedAt;
|
|
13972
|
+
return performance.now() - start > timeoutMs || !lastChunkReceivedAt || !initialLastChunkReceivedAt || lastChunkReceivedAt > initialLastChunkReceivedAt;
|
|
13973
|
+
}
|
|
13974
|
+
setTimeout(function () {
|
|
13975
|
+
if (gotAChunk()) return resolve(); // check immediately
|
|
13976
|
+
// otherwise, check every 100ms
|
|
13977
|
+
var interval = setInterval(function () {
|
|
13978
|
+
if (gotAChunk()) {
|
|
13979
|
+
clearInterval(interval);
|
|
13980
|
+
resolve();
|
|
13981
|
+
}
|
|
13982
|
+
}, 100);
|
|
13983
|
+
}, 0);
|
|
13984
|
+
});
|
|
13985
|
+
}
|
|
13914
13986
|
function VideoSignatureContextProvider(_a) {
|
|
13915
13987
|
var _this = this;
|
|
13916
13988
|
var _b, _c;
|
|
@@ -13929,7 +14001,14 @@ function VideoSignatureContextProvider(_a) {
|
|
|
13929
14001
|
// clear recorded data when the component is mounted
|
|
13930
14002
|
useVideoSignatureStore.getState().clearRecordedData();
|
|
13931
14003
|
}, []);
|
|
13932
|
-
var
|
|
14004
|
+
var _e = useVideoSignatureStore(useShallow(function (state) {
|
|
14005
|
+
return {
|
|
14006
|
+
recordingStartedAt: state.recordingStartedAt,
|
|
14007
|
+
recordingStoppedAt: state.recordingStoppedAt
|
|
14008
|
+
};
|
|
14009
|
+
})),
|
|
14010
|
+
recordingStartedAt = _e.recordingStartedAt,
|
|
14011
|
+
recordingStoppedAt = _e.recordingStoppedAt;
|
|
13933
14012
|
useFrameLoop(useCallback(function () {
|
|
13934
14013
|
return __awaiter(_this, void 0, void 0, function () {
|
|
13935
14014
|
var signaturePad, ctx, _a, w, h, isPortrait, rect;
|
|
@@ -13956,7 +14035,7 @@ function VideoSignatureContextProvider(_a) {
|
|
|
13956
14035
|
});
|
|
13957
14036
|
});
|
|
13958
14037
|
}, [videoRef]), {
|
|
13959
|
-
autoStart:
|
|
14038
|
+
autoStart: !!recordingStartedAt && !recordingStoppedAt,
|
|
13960
14039
|
throttleMs: 1000 / 24
|
|
13961
14040
|
});
|
|
13962
14041
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, children, /*#__PURE__*/React__default.createElement(InvisibleCanvas, {
|
|
@@ -13965,6 +14044,17 @@ function VideoSignatureContextProvider(_a) {
|
|
|
13965
14044
|
height: (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.videoHeight
|
|
13966
14045
|
}));
|
|
13967
14046
|
}
|
|
14047
|
+
function formatTimestamp(durationMs) {
|
|
14048
|
+
// should be in the format of 00:00:00:00 (hh:mm:ss:cs)
|
|
14049
|
+
var hours = Math.floor(durationMs / 3600000);
|
|
14050
|
+
var minutes = Math.floor(durationMs % 3600000 / 60000);
|
|
14051
|
+
var seconds = Math.floor(durationMs % 60000 / 1000);
|
|
14052
|
+
var milliseconds = durationMs % 1000;
|
|
14053
|
+
// Convert milliseconds to centiseconds (1/100th of a second)
|
|
14054
|
+
var centiseconds = Math.floor(milliseconds / 10);
|
|
14055
|
+
var csString = centiseconds.toString().padStart(2, '0');
|
|
14056
|
+
return "".concat(hours.toString().padStart(2, '0'), ":") + "".concat(minutes.toString().padStart(2, '0'), ":") + "".concat(seconds.toString().padStart(2, '0'), ":") + "".concat(csString);
|
|
14057
|
+
}
|
|
13968
14058
|
|
|
13969
14059
|
function VideoSignaturePad(_a) {
|
|
13970
14060
|
var onAcceptBtnClicked = _a.onAcceptBtnClicked,
|
|
@@ -14026,8 +14116,11 @@ function VideoSignaturePad(_a) {
|
|
|
14026
14116
|
ref: signaturePad,
|
|
14027
14117
|
canvasProps: canvasProps,
|
|
14028
14118
|
onBegin: function onBegin() {
|
|
14029
|
-
return useVideoSignatureStore.setState({
|
|
14030
|
-
|
|
14119
|
+
return useVideoSignatureStore.setState(function (s) {
|
|
14120
|
+
return {
|
|
14121
|
+
signaturePadEmpty: false,
|
|
14122
|
+
signatureStartedAt: s.signatureStartedAt || performance.now()
|
|
14123
|
+
};
|
|
14031
14124
|
});
|
|
14032
14125
|
},
|
|
14033
14126
|
onEnd: function onEnd() {
|
|
@@ -14037,7 +14130,8 @@ function VideoSignaturePad(_a) {
|
|
|
14037
14130
|
return point;
|
|
14038
14131
|
});
|
|
14039
14132
|
useVideoSignatureStore.setState({
|
|
14040
|
-
signatureValid: points.length >= minSignaturePadPoints
|
|
14133
|
+
signatureValid: points.length >= minSignaturePadPoints,
|
|
14134
|
+
signatureEndedAt: performance.now()
|
|
14041
14135
|
});
|
|
14042
14136
|
}
|
|
14043
14137
|
}), !headTrackingSatisfied && !!verbiage.headTrackingUnsatisfiedText ? ( /*#__PURE__*/React__default.createElement(SignaturePadContentContainer, {
|
|
@@ -14102,13 +14196,14 @@ function VideoSignatureGuides(_a) {
|
|
|
14102
14196
|
mode = _g[0],
|
|
14103
14197
|
setMode = _g[1];
|
|
14104
14198
|
useEffect(function () {
|
|
14105
|
-
|
|
14106
|
-
if (guideToDisplay) setMode(guideToDisplay);
|
|
14107
|
-
}, 2000);
|
|
14108
|
-
return function () {
|
|
14109
|
-
return clearTimeout(delayedTransition);
|
|
14110
|
-
};
|
|
14199
|
+
if (guideToDisplay) setMode(guideToDisplay);
|
|
14111
14200
|
}, [guideToDisplay]);
|
|
14201
|
+
var firstChunkReceivedAt = useVideoSignatureStore(useShallow(function (state) {
|
|
14202
|
+
return {
|
|
14203
|
+
firstChunkReceivedAt: state.firstChunkReceivedAt
|
|
14204
|
+
};
|
|
14205
|
+
})).firstChunkReceivedAt;
|
|
14206
|
+
var signaturePadDisabled = requestedAction !== 'CAPTURE_SIGNATURE' || !firstChunkReceivedAt;
|
|
14112
14207
|
return /*#__PURE__*/React__default.createElement(Container$3, {
|
|
14113
14208
|
className: classNames.container
|
|
14114
14209
|
}, /*#__PURE__*/React__default.createElement(Inner$1, {
|
|
@@ -14132,7 +14227,7 @@ function VideoSignatureGuides(_a) {
|
|
|
14132
14227
|
}, /*#__PURE__*/React__default.createElement(VideoSignaturePad, {
|
|
14133
14228
|
onAcceptBtnClicked: onAcceptBtnClicked,
|
|
14134
14229
|
onClearBtnClicked: onClearBtnClicked,
|
|
14135
|
-
disabled:
|
|
14230
|
+
disabled: signaturePadDisabled,
|
|
14136
14231
|
headTrackingSatisfied: headTrackingSatisfied,
|
|
14137
14232
|
minSignaturePadPoints: minSignaturePadPoints,
|
|
14138
14233
|
classNames: classNames,
|
|
@@ -14144,9 +14239,9 @@ var Container$3 = styled.div(templateObject_1$a || (templateObject_1$a = __makeT
|
|
|
14144
14239
|
return (_a = props.theme) === null || _a === void 0 ? void 0 : _a.fontFamily;
|
|
14145
14240
|
});
|
|
14146
14241
|
var Inner$1 = styled.div(templateObject_2$9 || (templateObject_2$9 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n max-height: 1280px;\n display: flex;\n margin: auto;\n align-items: center;\n flex-direction: column;\n"], ["\n width: 100%;\n height: 100%;\n max-height: 1280px;\n display: flex;\n margin: auto;\n align-items: center;\n flex-direction: column;\n"])));
|
|
14147
|
-
var FaceGuideContainer$1 = styled.div(templateObject_3$8 || (templateObject_3$8 = __makeTemplateObject(["\n position: relative;\n height: 50%;\n transition: opacity 500ms ease-in-out;\n transition-delay:
|
|
14242
|
+
var FaceGuideContainer$1 = styled.div(templateObject_3$8 || (templateObject_3$8 = __makeTemplateObject(["\n position: relative;\n height: 50%;\n transition: opacity 500ms ease-in-out;\n transition-delay: 500ms;\n"], ["\n position: relative;\n height: 50%;\n transition: opacity 500ms ease-in-out;\n transition-delay: 500ms;\n"])));
|
|
14148
14243
|
var StyledSelfieCaptureAnimatedMask = styled(SelfieCaptureAnimatedMaskWithStatus)(templateObject_4$4 || (templateObject_4$4 = __makeTemplateObject(["\n max-width: 100%;\n height: 100%;\n"], ["\n max-width: 100%;\n height: 100%;\n"])));
|
|
14149
|
-
var SignaturePadContainer = styled.div(templateObject_5$3 || (templateObject_5$3 = __makeTemplateObject(["\n position: relative;\n max-width: 100%;\n height: 50%;\n aspect-ratio: 2;\n transition: opacity 500ms ease-in-out;\n transition-delay:
|
|
14244
|
+
var SignaturePadContainer = styled.div(templateObject_5$3 || (templateObject_5$3 = __makeTemplateObject(["\n position: relative;\n max-width: 100%;\n height: 50%;\n aspect-ratio: 2;\n transition: opacity 500ms ease-in-out;\n transition-delay: 500ms;\n"], ["\n position: relative;\n max-width: 100%;\n height: 50%;\n aspect-ratio: 2;\n transition: opacity 500ms ease-in-out;\n transition-delay: 500ms;\n"])));
|
|
14150
14245
|
var templateObject_1$a, templateObject_2$9, templateObject_3$8, templateObject_4$4, templateObject_5$3;
|
|
14151
14246
|
|
|
14152
14247
|
var DEFAULT_MIN_SIGNATURE_PAD_POINTS = 10;
|
|
@@ -14189,9 +14284,14 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
14189
14284
|
onHeadTrackingPredictionMade = _o.onPredictionMade,
|
|
14190
14285
|
startHeadTracking = _o.start,
|
|
14191
14286
|
stopHeadTracking = _o.stop;
|
|
14192
|
-
var _p = useVideoSignatureStore()
|
|
14287
|
+
var _p = useVideoSignatureStore(useShallow(function (state) {
|
|
14288
|
+
return {
|
|
14289
|
+
clearRecordedData: state.clearRecordedData,
|
|
14290
|
+
firstChunkReceivedAt: state.firstChunkReceivedAt
|
|
14291
|
+
};
|
|
14292
|
+
})),
|
|
14193
14293
|
clearRecordedData = _p.clearRecordedData,
|
|
14194
|
-
|
|
14294
|
+
firstChunkReceivedAt = _p.firstChunkReceivedAt;
|
|
14195
14295
|
useEffect(function () {
|
|
14196
14296
|
useVideoSignatureStore.setState({
|
|
14197
14297
|
onSignatureVideoCaptured: onSignatureVideoCaptured
|
|
@@ -14275,7 +14375,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
14275
14375
|
face: lastFace,
|
|
14276
14376
|
scaling: debugScalingDetails,
|
|
14277
14377
|
color: headTrackingSatisfied ? 'green' : 'red'
|
|
14278
|
-
}))), /*#__PURE__*/React__default.createElement(DebugStatsPane, null, "Video: ", videoWidth, "x", videoHeight, /*#__PURE__*/React__default.createElement("br", null), "Recording: ",
|
|
14378
|
+
}))), /*#__PURE__*/React__default.createElement(DebugStatsPane, null, "Video: ", videoWidth, "x", videoHeight, /*#__PURE__*/React__default.createElement("br", null), "Recording: ", firstChunkReceivedAt ? 'true' : 'false'))), /*#__PURE__*/React__default.createElement(ExitCaptureButton, {
|
|
14279
14379
|
onClick: onExit,
|
|
14280
14380
|
className: classNames.exitCaptureBtn
|
|
14281
14381
|
}));
|
|
@@ -14606,6 +14706,8 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
14606
14706
|
setSelfieImage = _u.setSelfieImage,
|
|
14607
14707
|
setSignatureData = _u.setSignatureData,
|
|
14608
14708
|
setSignatureVideoUrl = _u.setSignatureVideoUrl,
|
|
14709
|
+
setSignatureStartTimestamp = _u.setSignatureStartTimestamp,
|
|
14710
|
+
setSignatureEndTimestamp = _u.setSignatureEndTimestamp,
|
|
14609
14711
|
logSelfieCaptureAttempt = _u.logSelfieCaptureAttempt,
|
|
14610
14712
|
uploadDocument = _u.uploadDocument;
|
|
14611
14713
|
var cameraAccessDenied = useCameraStore(useShallow(function (state) {
|
|
@@ -14665,12 +14767,14 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
14665
14767
|
filetype: 'image/jpeg'
|
|
14666
14768
|
}).then(onSelfieCaptured);
|
|
14667
14769
|
}, [logCaptureMetadata, onSelfieCaptured, setSelfieImage, uploadDocument]);
|
|
14668
|
-
var onSignatureCaptureCompleted = useCallback(function (videoData, signatureData, signatureImageData) {
|
|
14770
|
+
var onSignatureCaptureCompleted = useCallback(function (videoData, signatureData, signatureImageData, signatureStartTimestamp, signatureEndTimestamp) {
|
|
14669
14771
|
setSignatureData(signatureData);
|
|
14670
14772
|
setSignatureVideoUrl(URL.createObjectURL(videoData));
|
|
14773
|
+
if (signatureStartTimestamp) setSignatureStartTimestamp(signatureStartTimestamp);
|
|
14774
|
+
if (signatureEndTimestamp) setSignatureEndTimestamp(signatureEndTimestamp);
|
|
14671
14775
|
setCaptureState('SUCCESS');
|
|
14672
|
-
onVideoCaptured === null || onVideoCaptured === void 0 ? void 0 : onVideoCaptured(videoData, signatureData, signatureImageData);
|
|
14673
|
-
}, [onVideoCaptured, setSignatureData, setSignatureVideoUrl]);
|
|
14776
|
+
onVideoCaptured === null || onVideoCaptured === void 0 ? void 0 : onVideoCaptured(videoData, signatureData, signatureImageData, signatureStartTimestamp, signatureEndTimestamp);
|
|
14777
|
+
}, [onVideoCaptured, setSignatureData, setSignatureEndTimestamp, setSignatureStartTimestamp, setSignatureVideoUrl]);
|
|
14674
14778
|
var _x = useState(true),
|
|
14675
14779
|
showLoadingOverlay = _x[0],
|
|
14676
14780
|
setShowLoadingOverlay = _x[1];
|