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
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
212
212
|
};
|
|
213
213
|
|
|
214
|
-
var webSdkVersion = '2.3.
|
|
214
|
+
var webSdkVersion = '2.3.82';
|
|
215
215
|
|
|
216
216
|
function getPlatform() {
|
|
217
217
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -2125,6 +2125,12 @@
|
|
|
2125
2125
|
setIdCaptureVideoUrl: function setIdCaptureVideoUrl() {
|
|
2126
2126
|
return null;
|
|
2127
2127
|
},
|
|
2128
|
+
setSignatureStartTimestamp: function setSignatureStartTimestamp() {
|
|
2129
|
+
return null;
|
|
2130
|
+
},
|
|
2131
|
+
setSignatureEndTimestamp: function setSignatureEndTimestamp() {
|
|
2132
|
+
return null;
|
|
2133
|
+
},
|
|
2128
2134
|
setIdCaptureVideoIdFrontImage: function setIdCaptureVideoIdFrontImage() {
|
|
2129
2135
|
return null;
|
|
2130
2136
|
},
|
|
@@ -2289,44 +2295,50 @@
|
|
|
2289
2295
|
signatureVideoUrl = _16[0],
|
|
2290
2296
|
setSignatureVideoUrl = _16[1];
|
|
2291
2297
|
var _17 = React.useState(null),
|
|
2292
|
-
|
|
2293
|
-
|
|
2298
|
+
signatureStartTimestamp = _17[0],
|
|
2299
|
+
setSignatureStartTimestamp = _17[1];
|
|
2294
2300
|
var _18 = React.useState(null),
|
|
2295
|
-
|
|
2296
|
-
|
|
2301
|
+
signatureEndTimestamp = _18[0],
|
|
2302
|
+
setSignatureEndTimestamp = _18[1];
|
|
2297
2303
|
var _19 = React.useState(null),
|
|
2298
|
-
|
|
2299
|
-
|
|
2304
|
+
idCaptureVideoUrl = _19[0],
|
|
2305
|
+
setIdCaptureVideoUrl = _19[1];
|
|
2300
2306
|
var _20 = React.useState(null),
|
|
2301
|
-
|
|
2302
|
-
|
|
2307
|
+
idCaptureVideoIdFrontImage = _20[0],
|
|
2308
|
+
setIdCaptureVideoIdFrontImage = _20[1];
|
|
2303
2309
|
var _21 = React.useState(null),
|
|
2304
|
-
|
|
2305
|
-
|
|
2310
|
+
idCaptureVideoIdBackImage = _21[0],
|
|
2311
|
+
setIdCaptureVideoIdBackImage = _21[1];
|
|
2306
2312
|
var _22 = React.useState(null),
|
|
2307
|
-
|
|
2308
|
-
|
|
2313
|
+
idCaptureVideoAudioUrl = _22[0],
|
|
2314
|
+
setIdCaptureVideoAudioUrl = _22[1];
|
|
2309
2315
|
var _23 = React.useState(null),
|
|
2310
|
-
|
|
2311
|
-
|
|
2316
|
+
idCaptureVideoAudioStartsAt = _23[0],
|
|
2317
|
+
setIdCaptureVideoAudioStartsAt = _23[1];
|
|
2312
2318
|
var _24 = React.useState(null),
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
var _25 = React.useState(
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
var _26 = React.useState(
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
var _27 = React.useState(
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
var _28 = React.useState(
|
|
2325
|
-
|
|
2326
|
-
|
|
2319
|
+
expectedAudioText = _24[0],
|
|
2320
|
+
setExpectedAudioText = _24[1];
|
|
2321
|
+
var _25 = React.useState(null),
|
|
2322
|
+
additionalDocuments = _25[0],
|
|
2323
|
+
setAdditionalDocuments = _25[1];
|
|
2324
|
+
var _26 = React.useState(null),
|
|
2325
|
+
geolocationResult = _26[0],
|
|
2326
|
+
setGeolocationResult = _26[1];
|
|
2327
|
+
var _27 = React.useState(0),
|
|
2328
|
+
geolocationAttempts = _27[0],
|
|
2329
|
+
setGeolocationAttempts = _27[1];
|
|
2330
|
+
var _28 = React.useState(false),
|
|
2331
|
+
geolocationBlocked = _28[0],
|
|
2332
|
+
setGeolocationBlocked = _28[1];
|
|
2327
2333
|
var _29 = React.useState([]),
|
|
2328
|
-
|
|
2329
|
-
|
|
2334
|
+
idFrontCaptureAttempts = _29[0],
|
|
2335
|
+
setIdFrontCaptureAttempts = _29[1];
|
|
2336
|
+
var _30 = React.useState([]),
|
|
2337
|
+
idBackCaptureAttempts = _30[0],
|
|
2338
|
+
setIdBackCaptureAttempts = _30[1];
|
|
2339
|
+
var _31 = React.useState([]),
|
|
2340
|
+
selfieCaptureAttempts = _31[0],
|
|
2341
|
+
setSelfieCaptureAttempts = _31[1];
|
|
2330
2342
|
var logIdFrontCaptureAttempt = React.useCallback(function (attempt) {
|
|
2331
2343
|
setIdFrontCaptureAttempts(function (attempts) {
|
|
2332
2344
|
return __spreadArray(__spreadArray([], attempts, true), [attempt], false);
|
|
@@ -2603,6 +2615,12 @@
|
|
|
2603
2615
|
submissionRequest.customerData.signatureData.signatureVideo = documents.signatureVideo;
|
|
2604
2616
|
}
|
|
2605
2617
|
}
|
|
2618
|
+
if (signatureStartTimestamp) {
|
|
2619
|
+
submissionRequest.customerData.signatureStartTimestamp = signatureStartTimestamp;
|
|
2620
|
+
}
|
|
2621
|
+
if (signatureEndTimestamp) {
|
|
2622
|
+
submissionRequest.customerData.signatureEndTimestamp = signatureEndTimestamp;
|
|
2623
|
+
}
|
|
2606
2624
|
if (additionalDocuments) {
|
|
2607
2625
|
submissionRequest.customerData.additionalDocuments = additionalDocuments.map(function (d) {
|
|
2608
2626
|
return _assign(_assign({}, d), {
|
|
@@ -2645,7 +2663,7 @@
|
|
|
2645
2663
|
}
|
|
2646
2664
|
});
|
|
2647
2665
|
});
|
|
2648
|
-
}, [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]);
|
|
2666
|
+
}, [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]);
|
|
2649
2667
|
var defaultOnSubmit = React.useCallback(function () {
|
|
2650
2668
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
2651
2669
|
var submissionResponse_1, payload, host, endpoint, response, statusMessage, submissionResponse_2, e_1, err;
|
|
@@ -2942,6 +2960,8 @@
|
|
|
2942
2960
|
setSelfieImage: setSelfieImage,
|
|
2943
2961
|
setSignatureData: setSignatureData,
|
|
2944
2962
|
setSignatureVideoUrl: setSignatureVideoUrl,
|
|
2963
|
+
setSignatureStartTimestamp: setSignatureStartTimestamp,
|
|
2964
|
+
setSignatureEndTimestamp: setSignatureEndTimestamp,
|
|
2945
2965
|
setIdCaptureVideoUrl: setIdCaptureVideoUrl,
|
|
2946
2966
|
setIdCaptureVideoIdFrontImage: setIdCaptureVideoIdFrontImage,
|
|
2947
2967
|
setIdCaptureVideoIdBackImage: setIdCaptureVideoIdBackImage,
|
|
@@ -23743,7 +23763,6 @@
|
|
|
23743
23763
|
clearRecordedData: function clearRecordedData() {
|
|
23744
23764
|
return null;
|
|
23745
23765
|
},
|
|
23746
|
-
isRecording: false,
|
|
23747
23766
|
signaturePad: {
|
|
23748
23767
|
current: null
|
|
23749
23768
|
},
|
|
@@ -23766,7 +23785,7 @@
|
|
|
23766
23785
|
if (!camera) throw new Error('Camera not found');
|
|
23767
23786
|
// set our flag and clear whatever we have recorded so far.
|
|
23768
23787
|
set({
|
|
23769
|
-
|
|
23788
|
+
recordingStartedAt: performance.now()
|
|
23770
23789
|
});
|
|
23771
23790
|
signatureChunks = [];
|
|
23772
23791
|
// start recording video and audio
|
|
@@ -23780,27 +23799,51 @@
|
|
|
23780
23799
|
videoBitsPerSecond: 270000,
|
|
23781
23800
|
audioBitsPerSecond: 32000
|
|
23782
23801
|
});
|
|
23802
|
+
var hasFirstChunk = false;
|
|
23783
23803
|
signatureRecorder.ondataavailable = function (event) {
|
|
23784
23804
|
signatureChunks.push(event.data);
|
|
23805
|
+
if (!hasFirstChunk) {
|
|
23806
|
+
hasFirstChunk = true;
|
|
23807
|
+
set({
|
|
23808
|
+
firstChunkReceivedAt: performance.now(),
|
|
23809
|
+
lastChunkReceivedAt: performance.now()
|
|
23810
|
+
});
|
|
23811
|
+
} else {
|
|
23812
|
+
set({
|
|
23813
|
+
lastChunkReceivedAt: performance.now()
|
|
23814
|
+
});
|
|
23815
|
+
}
|
|
23785
23816
|
};
|
|
23786
23817
|
signatureRecorder.start(100);
|
|
23787
23818
|
},
|
|
23788
23819
|
stopRecording: function stopRecording(signatureData, imageUrl) {
|
|
23789
23820
|
set({
|
|
23790
|
-
|
|
23821
|
+
firstChunkReceivedAt: undefined,
|
|
23822
|
+
recordingStoppedAt: performance.now()
|
|
23823
|
+
});
|
|
23824
|
+
waitForOneMoreChunk().then(function () {
|
|
23825
|
+
if (!signatureRecorder) return;
|
|
23826
|
+
signatureRecorder.stop();
|
|
23827
|
+
signatureRecorder.onstop = function () {
|
|
23828
|
+
var blob = new Blob(signatureChunks, {
|
|
23829
|
+
type: 'video/mp4'
|
|
23830
|
+
});
|
|
23831
|
+
signatureChunks = [];
|
|
23832
|
+
signatureRecorder = null;
|
|
23833
|
+
if (!signatureData) return;
|
|
23834
|
+
var _a = get(),
|
|
23835
|
+
onSignatureVideoCaptured = _a.onSignatureVideoCaptured,
|
|
23836
|
+
recordingStartedAt = _a.recordingStartedAt,
|
|
23837
|
+
signatureStartedAt = _a.signatureStartedAt,
|
|
23838
|
+
signatureEndedAt = _a.signatureEndedAt,
|
|
23839
|
+
lastChunkReceivedAt = _a.lastChunkReceivedAt;
|
|
23840
|
+
var endMs = Math.min(signatureEndedAt !== null && signatureEndedAt !== void 0 ? signatureEndedAt : Infinity, lastChunkReceivedAt !== null && lastChunkReceivedAt !== void 0 ? lastChunkReceivedAt : Infinity);
|
|
23841
|
+
var signatureStartTimestamp = signatureStartedAt && recordingStartedAt ? formatTimestamp(Math.max(0, signatureStartedAt - recordingStartedAt - 500)) : undefined;
|
|
23842
|
+
var signatureEndTimestamp = endMs !== Infinity && recordingStartedAt ? formatTimestamp(Math.min(endMs - recordingStartedAt + 500, lastChunkReceivedAt !== null && lastChunkReceivedAt !== void 0 ? lastChunkReceivedAt : Infinity)) : undefined;
|
|
23843
|
+
onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, signatureStartTimestamp, signatureEndTimestamp);
|
|
23844
|
+
};
|
|
23845
|
+
useVideoRecorderStore.getState().stopRecording();
|
|
23791
23846
|
});
|
|
23792
|
-
if (!signatureRecorder) return;
|
|
23793
|
-
signatureRecorder.stop();
|
|
23794
|
-
signatureRecorder.onstop = function () {
|
|
23795
|
-
var blob = new Blob(signatureChunks, {
|
|
23796
|
-
type: 'video/mp4'
|
|
23797
|
-
});
|
|
23798
|
-
signatureChunks = [];
|
|
23799
|
-
signatureRecorder = null;
|
|
23800
|
-
if (!signatureData) return;
|
|
23801
|
-
get().onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null);
|
|
23802
|
-
};
|
|
23803
|
-
useVideoRecorderStore.getState().stopRecording();
|
|
23804
23847
|
},
|
|
23805
23848
|
clearRecordedData: function clearRecordedData() {
|
|
23806
23849
|
signatureChunks = [];
|
|
@@ -23809,13 +23852,42 @@
|
|
|
23809
23852
|
signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.stop();
|
|
23810
23853
|
signatureRecorder = null;
|
|
23811
23854
|
set({
|
|
23812
|
-
|
|
23855
|
+
recordingStartedAt: undefined,
|
|
23856
|
+
recordingStoppedAt: undefined,
|
|
23857
|
+
firstChunkReceivedAt: undefined,
|
|
23858
|
+
lastChunkReceivedAt: undefined,
|
|
23813
23859
|
signaturePadEmpty: true,
|
|
23814
|
-
signatureValid: false
|
|
23860
|
+
signatureValid: false,
|
|
23861
|
+
signatureStartedAt: undefined,
|
|
23862
|
+
signatureEndedAt: undefined
|
|
23815
23863
|
});
|
|
23816
23864
|
}
|
|
23817
23865
|
});
|
|
23818
23866
|
}));
|
|
23867
|
+
function waitForOneMoreChunk(timeoutMs) {
|
|
23868
|
+
if (timeoutMs === void 0) {
|
|
23869
|
+
timeoutMs = 3000;
|
|
23870
|
+
}
|
|
23871
|
+
var start = performance.now();
|
|
23872
|
+
return new Promise(function (resolve) {
|
|
23873
|
+
var initialLastChunkReceivedAt = useVideoSignatureStore.getState().lastChunkReceivedAt;
|
|
23874
|
+
if (!initialLastChunkReceivedAt) return resolve();
|
|
23875
|
+
function gotAChunk() {
|
|
23876
|
+
var lastChunkReceivedAt = useVideoSignatureStore.getState().lastChunkReceivedAt;
|
|
23877
|
+
return performance.now() - start > timeoutMs || !lastChunkReceivedAt || !initialLastChunkReceivedAt || lastChunkReceivedAt > initialLastChunkReceivedAt;
|
|
23878
|
+
}
|
|
23879
|
+
setTimeout(function () {
|
|
23880
|
+
if (gotAChunk()) return resolve(); // check immediately
|
|
23881
|
+
// otherwise, check every 100ms
|
|
23882
|
+
var interval = setInterval(function () {
|
|
23883
|
+
if (gotAChunk()) {
|
|
23884
|
+
clearInterval(interval);
|
|
23885
|
+
resolve();
|
|
23886
|
+
}
|
|
23887
|
+
}, 100);
|
|
23888
|
+
}, 0);
|
|
23889
|
+
});
|
|
23890
|
+
}
|
|
23819
23891
|
function VideoSignatureContextProvider(_a) {
|
|
23820
23892
|
var _this = this;
|
|
23821
23893
|
var _b, _c;
|
|
@@ -23834,7 +23906,14 @@
|
|
|
23834
23906
|
// clear recorded data when the component is mounted
|
|
23835
23907
|
useVideoSignatureStore.getState().clearRecordedData();
|
|
23836
23908
|
}, []);
|
|
23837
|
-
var
|
|
23909
|
+
var _e = useVideoSignatureStore(useShallow(function (state) {
|
|
23910
|
+
return {
|
|
23911
|
+
recordingStartedAt: state.recordingStartedAt,
|
|
23912
|
+
recordingStoppedAt: state.recordingStoppedAt
|
|
23913
|
+
};
|
|
23914
|
+
})),
|
|
23915
|
+
recordingStartedAt = _e.recordingStartedAt,
|
|
23916
|
+
recordingStoppedAt = _e.recordingStoppedAt;
|
|
23838
23917
|
useFrameLoop(React.useCallback(function () {
|
|
23839
23918
|
return __awaiter(_this, void 0, void 0, function () {
|
|
23840
23919
|
var signaturePad, ctx, _a, w, h, isPortrait, rect;
|
|
@@ -23861,7 +23940,7 @@
|
|
|
23861
23940
|
});
|
|
23862
23941
|
});
|
|
23863
23942
|
}, [videoRef]), {
|
|
23864
|
-
autoStart:
|
|
23943
|
+
autoStart: !!recordingStartedAt && !recordingStoppedAt,
|
|
23865
23944
|
throttleMs: 1000 / 24
|
|
23866
23945
|
});
|
|
23867
23946
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children, /*#__PURE__*/React.createElement(InvisibleCanvas, {
|
|
@@ -23870,6 +23949,17 @@
|
|
|
23870
23949
|
height: (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.videoHeight
|
|
23871
23950
|
}));
|
|
23872
23951
|
}
|
|
23952
|
+
function formatTimestamp(durationMs) {
|
|
23953
|
+
// should be in the format of 00:00:00:00 (hh:mm:ss:cs)
|
|
23954
|
+
var hours = Math.floor(durationMs / 3600000);
|
|
23955
|
+
var minutes = Math.floor(durationMs % 3600000 / 60000);
|
|
23956
|
+
var seconds = Math.floor(durationMs % 60000 / 1000);
|
|
23957
|
+
var milliseconds = durationMs % 1000;
|
|
23958
|
+
// Convert milliseconds to centiseconds (1/100th of a second)
|
|
23959
|
+
var centiseconds = Math.floor(milliseconds / 10);
|
|
23960
|
+
var csString = centiseconds.toString().padStart(2, '0');
|
|
23961
|
+
return "".concat(hours.toString().padStart(2, '0'), ":") + "".concat(minutes.toString().padStart(2, '0'), ":") + "".concat(seconds.toString().padStart(2, '0'), ":") + "".concat(csString);
|
|
23962
|
+
}
|
|
23873
23963
|
|
|
23874
23964
|
function VideoSignaturePad(_a) {
|
|
23875
23965
|
var onAcceptBtnClicked = _a.onAcceptBtnClicked,
|
|
@@ -23931,8 +24021,11 @@
|
|
|
23931
24021
|
ref: signaturePad,
|
|
23932
24022
|
canvasProps: canvasProps,
|
|
23933
24023
|
onBegin: function onBegin() {
|
|
23934
|
-
return useVideoSignatureStore.setState({
|
|
23935
|
-
|
|
24024
|
+
return useVideoSignatureStore.setState(function (s) {
|
|
24025
|
+
return {
|
|
24026
|
+
signaturePadEmpty: false,
|
|
24027
|
+
signatureStartedAt: s.signatureStartedAt || performance.now()
|
|
24028
|
+
};
|
|
23936
24029
|
});
|
|
23937
24030
|
},
|
|
23938
24031
|
onEnd: function onEnd() {
|
|
@@ -23942,7 +24035,8 @@
|
|
|
23942
24035
|
return point;
|
|
23943
24036
|
});
|
|
23944
24037
|
useVideoSignatureStore.setState({
|
|
23945
|
-
signatureValid: points.length >= minSignaturePadPoints
|
|
24038
|
+
signatureValid: points.length >= minSignaturePadPoints,
|
|
24039
|
+
signatureEndedAt: performance.now()
|
|
23946
24040
|
});
|
|
23947
24041
|
}
|
|
23948
24042
|
}), !headTrackingSatisfied && !!verbiage.headTrackingUnsatisfiedText ? ( /*#__PURE__*/React.createElement(SignaturePadContentContainer, {
|
|
@@ -24007,13 +24101,14 @@
|
|
|
24007
24101
|
mode = _g[0],
|
|
24008
24102
|
setMode = _g[1];
|
|
24009
24103
|
React.useEffect(function () {
|
|
24010
|
-
|
|
24011
|
-
if (guideToDisplay) setMode(guideToDisplay);
|
|
24012
|
-
}, 2000);
|
|
24013
|
-
return function () {
|
|
24014
|
-
return clearTimeout(delayedTransition);
|
|
24015
|
-
};
|
|
24104
|
+
if (guideToDisplay) setMode(guideToDisplay);
|
|
24016
24105
|
}, [guideToDisplay]);
|
|
24106
|
+
var firstChunkReceivedAt = useVideoSignatureStore(useShallow(function (state) {
|
|
24107
|
+
return {
|
|
24108
|
+
firstChunkReceivedAt: state.firstChunkReceivedAt
|
|
24109
|
+
};
|
|
24110
|
+
})).firstChunkReceivedAt;
|
|
24111
|
+
var signaturePadDisabled = requestedAction !== 'CAPTURE_SIGNATURE' || !firstChunkReceivedAt;
|
|
24017
24112
|
return /*#__PURE__*/React.createElement(Container$3, {
|
|
24018
24113
|
className: classNames.container
|
|
24019
24114
|
}, /*#__PURE__*/React.createElement(Inner$1, {
|
|
@@ -24037,7 +24132,7 @@
|
|
|
24037
24132
|
}, /*#__PURE__*/React.createElement(VideoSignaturePad, {
|
|
24038
24133
|
onAcceptBtnClicked: onAcceptBtnClicked,
|
|
24039
24134
|
onClearBtnClicked: onClearBtnClicked,
|
|
24040
|
-
disabled:
|
|
24135
|
+
disabled: signaturePadDisabled,
|
|
24041
24136
|
headTrackingSatisfied: headTrackingSatisfied,
|
|
24042
24137
|
minSignaturePadPoints: minSignaturePadPoints,
|
|
24043
24138
|
classNames: classNames,
|
|
@@ -24049,9 +24144,9 @@
|
|
|
24049
24144
|
return (_a = props.theme) === null || _a === void 0 ? void 0 : _a.fontFamily;
|
|
24050
24145
|
});
|
|
24051
24146
|
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"])));
|
|
24052
|
-
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:
|
|
24147
|
+
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"])));
|
|
24053
24148
|
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"])));
|
|
24054
|
-
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:
|
|
24149
|
+
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"])));
|
|
24055
24150
|
var templateObject_1$a, templateObject_2$9, templateObject_3$8, templateObject_4$4, templateObject_5$3;
|
|
24056
24151
|
|
|
24057
24152
|
var DEFAULT_MIN_SIGNATURE_PAD_POINTS = 10;
|
|
@@ -24094,9 +24189,14 @@
|
|
|
24094
24189
|
onHeadTrackingPredictionMade = _o.onPredictionMade,
|
|
24095
24190
|
startHeadTracking = _o.start,
|
|
24096
24191
|
stopHeadTracking = _o.stop;
|
|
24097
|
-
var _p = useVideoSignatureStore()
|
|
24192
|
+
var _p = useVideoSignatureStore(useShallow(function (state) {
|
|
24193
|
+
return {
|
|
24194
|
+
clearRecordedData: state.clearRecordedData,
|
|
24195
|
+
firstChunkReceivedAt: state.firstChunkReceivedAt
|
|
24196
|
+
};
|
|
24197
|
+
})),
|
|
24098
24198
|
clearRecordedData = _p.clearRecordedData,
|
|
24099
|
-
|
|
24199
|
+
firstChunkReceivedAt = _p.firstChunkReceivedAt;
|
|
24100
24200
|
React.useEffect(function () {
|
|
24101
24201
|
useVideoSignatureStore.setState({
|
|
24102
24202
|
onSignatureVideoCaptured: onSignatureVideoCaptured
|
|
@@ -24180,7 +24280,7 @@
|
|
|
24180
24280
|
face: lastFace,
|
|
24181
24281
|
scaling: debugScalingDetails,
|
|
24182
24282
|
color: headTrackingSatisfied ? 'green' : 'red'
|
|
24183
|
-
}))), /*#__PURE__*/React.createElement(DebugStatsPane, null, "Video: ", videoWidth, "x", videoHeight, /*#__PURE__*/React.createElement("br", null), "Recording: ",
|
|
24283
|
+
}))), /*#__PURE__*/React.createElement(DebugStatsPane, null, "Video: ", videoWidth, "x", videoHeight, /*#__PURE__*/React.createElement("br", null), "Recording: ", firstChunkReceivedAt ? 'true' : 'false'))), /*#__PURE__*/React.createElement(ExitCaptureButton, {
|
|
24184
24284
|
onClick: onExit,
|
|
24185
24285
|
className: classNames.exitCaptureBtn
|
|
24186
24286
|
}));
|
|
@@ -24511,6 +24611,8 @@
|
|
|
24511
24611
|
setSelfieImage = _u.setSelfieImage,
|
|
24512
24612
|
setSignatureData = _u.setSignatureData,
|
|
24513
24613
|
setSignatureVideoUrl = _u.setSignatureVideoUrl,
|
|
24614
|
+
setSignatureStartTimestamp = _u.setSignatureStartTimestamp,
|
|
24615
|
+
setSignatureEndTimestamp = _u.setSignatureEndTimestamp,
|
|
24514
24616
|
logSelfieCaptureAttempt = _u.logSelfieCaptureAttempt,
|
|
24515
24617
|
uploadDocument = _u.uploadDocument;
|
|
24516
24618
|
var cameraAccessDenied = useCameraStore(useShallow(function (state) {
|
|
@@ -24570,12 +24672,14 @@
|
|
|
24570
24672
|
filetype: 'image/jpeg'
|
|
24571
24673
|
}).then(onSelfieCaptured);
|
|
24572
24674
|
}, [logCaptureMetadata, onSelfieCaptured, setSelfieImage, uploadDocument]);
|
|
24573
|
-
var onSignatureCaptureCompleted = React.useCallback(function (videoData, signatureData, signatureImageData) {
|
|
24675
|
+
var onSignatureCaptureCompleted = React.useCallback(function (videoData, signatureData, signatureImageData, signatureStartTimestamp, signatureEndTimestamp) {
|
|
24574
24676
|
setSignatureData(signatureData);
|
|
24575
24677
|
setSignatureVideoUrl(URL.createObjectURL(videoData));
|
|
24678
|
+
if (signatureStartTimestamp) setSignatureStartTimestamp(signatureStartTimestamp);
|
|
24679
|
+
if (signatureEndTimestamp) setSignatureEndTimestamp(signatureEndTimestamp);
|
|
24576
24680
|
setCaptureState('SUCCESS');
|
|
24577
|
-
onVideoCaptured === null || onVideoCaptured === void 0 ? void 0 : onVideoCaptured(videoData, signatureData, signatureImageData);
|
|
24578
|
-
}, [onVideoCaptured, setSignatureData, setSignatureVideoUrl]);
|
|
24681
|
+
onVideoCaptured === null || onVideoCaptured === void 0 ? void 0 : onVideoCaptured(videoData, signatureData, signatureImageData, signatureStartTimestamp, signatureEndTimestamp);
|
|
24682
|
+
}, [onVideoCaptured, setSignatureData, setSignatureEndTimestamp, setSignatureStartTimestamp, setSignatureVideoUrl]);
|
|
24579
24683
|
var _x = React.useState(true),
|
|
24580
24684
|
showLoadingOverlay = _x[0],
|
|
24581
24685
|
setShowLoadingOverlay = _x[1];
|