idmission-web-sdk 2.3.81 → 2.3.83
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/lib/camera/useVideoRecorder.d.ts.map +1 -1
- package/dist/lib/utils/blobs.d.ts +3 -0
- package/dist/lib/utils/blobs.d.ts.map +1 -0
- package/dist/sdk2.cjs.development.js +182 -62
- 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 +182 -62
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +182 -62
- 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 +1 -1
|
@@ -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.83';
|
|
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,
|
|
@@ -23546,6 +23566,13 @@
|
|
|
23546
23566
|
var AcceptBtn$1 = styled(LoaderButton)(templateObject_2$b || (templateObject_2$b = __makeTemplateObject(["\n margin-left: auto;\n"], ["\n margin-left: auto;\n"])));
|
|
23547
23567
|
var templateObject_1$c, templateObject_2$b;
|
|
23548
23568
|
|
|
23569
|
+
function isBlob(blobPart) {
|
|
23570
|
+
return typeof blobPart === 'object' && 'type' in blobPart;
|
|
23571
|
+
}
|
|
23572
|
+
function inferBlobType(blobPart) {
|
|
23573
|
+
return isBlob(blobPart) ? blobPart.type : undefined;
|
|
23574
|
+
}
|
|
23575
|
+
|
|
23549
23576
|
var videoRecorder = null;
|
|
23550
23577
|
var audioRecorder = null;
|
|
23551
23578
|
var videoChunks = [];
|
|
@@ -23679,8 +23706,10 @@
|
|
|
23679
23706
|
useVideoRecorderStore.getState().clearRecordedData();
|
|
23680
23707
|
}, []);
|
|
23681
23708
|
var processVideo = React.useCallback(function () {
|
|
23709
|
+
var _a;
|
|
23710
|
+
var inferredType = (_a = inferBlobType(videoChunks[0])) !== null && _a !== void 0 ? _a : 'video/mp4';
|
|
23682
23711
|
var videoBlob = new Blob(videoChunks, {
|
|
23683
|
-
type:
|
|
23712
|
+
type: inferredType
|
|
23684
23713
|
});
|
|
23685
23714
|
useVideoRecorderStore.setState({
|
|
23686
23715
|
videoUrl: URL.createObjectURL(videoBlob),
|
|
@@ -23743,7 +23772,6 @@
|
|
|
23743
23772
|
clearRecordedData: function clearRecordedData() {
|
|
23744
23773
|
return null;
|
|
23745
23774
|
},
|
|
23746
|
-
isRecording: false,
|
|
23747
23775
|
signaturePad: {
|
|
23748
23776
|
current: null
|
|
23749
23777
|
},
|
|
@@ -23766,7 +23794,7 @@
|
|
|
23766
23794
|
if (!camera) throw new Error('Camera not found');
|
|
23767
23795
|
// set our flag and clear whatever we have recorded so far.
|
|
23768
23796
|
set({
|
|
23769
|
-
|
|
23797
|
+
recordingStartedAt: performance.now()
|
|
23770
23798
|
});
|
|
23771
23799
|
signatureChunks = [];
|
|
23772
23800
|
// start recording video and audio
|
|
@@ -23780,27 +23808,53 @@
|
|
|
23780
23808
|
videoBitsPerSecond: 270000,
|
|
23781
23809
|
audioBitsPerSecond: 32000
|
|
23782
23810
|
});
|
|
23811
|
+
var hasFirstChunk = false;
|
|
23783
23812
|
signatureRecorder.ondataavailable = function (event) {
|
|
23784
23813
|
signatureChunks.push(event.data);
|
|
23814
|
+
if (!hasFirstChunk) {
|
|
23815
|
+
hasFirstChunk = true;
|
|
23816
|
+
set({
|
|
23817
|
+
firstChunkReceivedAt: performance.now(),
|
|
23818
|
+
lastChunkReceivedAt: performance.now()
|
|
23819
|
+
});
|
|
23820
|
+
} else {
|
|
23821
|
+
set({
|
|
23822
|
+
lastChunkReceivedAt: performance.now()
|
|
23823
|
+
});
|
|
23824
|
+
}
|
|
23785
23825
|
};
|
|
23786
23826
|
signatureRecorder.start(100);
|
|
23787
23827
|
},
|
|
23788
23828
|
stopRecording: function stopRecording(signatureData, imageUrl) {
|
|
23789
23829
|
set({
|
|
23790
|
-
|
|
23830
|
+
firstChunkReceivedAt: undefined,
|
|
23831
|
+
recordingStoppedAt: performance.now()
|
|
23832
|
+
});
|
|
23833
|
+
waitForOneMoreChunk().then(function () {
|
|
23834
|
+
if (!signatureRecorder) return;
|
|
23835
|
+
signatureRecorder.stop();
|
|
23836
|
+
signatureRecorder.onstop = function () {
|
|
23837
|
+
var _a;
|
|
23838
|
+
var inferredType = (_a = inferBlobType(signatureChunks[0])) !== null && _a !== void 0 ? _a : 'video/mp4';
|
|
23839
|
+
var blob = new Blob(signatureChunks, {
|
|
23840
|
+
type: inferredType
|
|
23841
|
+
});
|
|
23842
|
+
signatureChunks = [];
|
|
23843
|
+
signatureRecorder = null;
|
|
23844
|
+
if (!signatureData) return;
|
|
23845
|
+
var _b = get(),
|
|
23846
|
+
onSignatureVideoCaptured = _b.onSignatureVideoCaptured,
|
|
23847
|
+
recordingStartedAt = _b.recordingStartedAt,
|
|
23848
|
+
signatureStartedAt = _b.signatureStartedAt,
|
|
23849
|
+
signatureEndedAt = _b.signatureEndedAt,
|
|
23850
|
+
lastChunkReceivedAt = _b.lastChunkReceivedAt;
|
|
23851
|
+
var endMs = Math.min(signatureEndedAt !== null && signatureEndedAt !== void 0 ? signatureEndedAt : Infinity, lastChunkReceivedAt !== null && lastChunkReceivedAt !== void 0 ? lastChunkReceivedAt : Infinity);
|
|
23852
|
+
var signatureStartTimestamp = signatureStartedAt && recordingStartedAt ? formatTimestamp(Math.max(0, signatureStartedAt - recordingStartedAt - 500)) : undefined;
|
|
23853
|
+
var signatureEndTimestamp = endMs !== Infinity && recordingStartedAt ? formatTimestamp(Math.min(endMs - recordingStartedAt + 500, lastChunkReceivedAt !== null && lastChunkReceivedAt !== void 0 ? lastChunkReceivedAt : Infinity)) : undefined;
|
|
23854
|
+
onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, signatureStartTimestamp, signatureEndTimestamp);
|
|
23855
|
+
};
|
|
23856
|
+
useVideoRecorderStore.getState().stopRecording();
|
|
23791
23857
|
});
|
|
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
23858
|
},
|
|
23805
23859
|
clearRecordedData: function clearRecordedData() {
|
|
23806
23860
|
signatureChunks = [];
|
|
@@ -23809,13 +23863,42 @@
|
|
|
23809
23863
|
signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.stop();
|
|
23810
23864
|
signatureRecorder = null;
|
|
23811
23865
|
set({
|
|
23812
|
-
|
|
23866
|
+
recordingStartedAt: undefined,
|
|
23867
|
+
recordingStoppedAt: undefined,
|
|
23868
|
+
firstChunkReceivedAt: undefined,
|
|
23869
|
+
lastChunkReceivedAt: undefined,
|
|
23813
23870
|
signaturePadEmpty: true,
|
|
23814
|
-
signatureValid: false
|
|
23871
|
+
signatureValid: false,
|
|
23872
|
+
signatureStartedAt: undefined,
|
|
23873
|
+
signatureEndedAt: undefined
|
|
23815
23874
|
});
|
|
23816
23875
|
}
|
|
23817
23876
|
});
|
|
23818
23877
|
}));
|
|
23878
|
+
function waitForOneMoreChunk(timeoutMs) {
|
|
23879
|
+
if (timeoutMs === void 0) {
|
|
23880
|
+
timeoutMs = 3000;
|
|
23881
|
+
}
|
|
23882
|
+
var start = performance.now();
|
|
23883
|
+
return new Promise(function (resolve) {
|
|
23884
|
+
var initialLastChunkReceivedAt = useVideoSignatureStore.getState().lastChunkReceivedAt;
|
|
23885
|
+
if (!initialLastChunkReceivedAt) return resolve();
|
|
23886
|
+
function gotAChunk() {
|
|
23887
|
+
var lastChunkReceivedAt = useVideoSignatureStore.getState().lastChunkReceivedAt;
|
|
23888
|
+
return performance.now() - start > timeoutMs || !lastChunkReceivedAt || !initialLastChunkReceivedAt || lastChunkReceivedAt > initialLastChunkReceivedAt;
|
|
23889
|
+
}
|
|
23890
|
+
setTimeout(function () {
|
|
23891
|
+
if (gotAChunk()) return resolve(); // check immediately
|
|
23892
|
+
// otherwise, check every 100ms
|
|
23893
|
+
var interval = setInterval(function () {
|
|
23894
|
+
if (gotAChunk()) {
|
|
23895
|
+
clearInterval(interval);
|
|
23896
|
+
resolve();
|
|
23897
|
+
}
|
|
23898
|
+
}, 100);
|
|
23899
|
+
}, 0);
|
|
23900
|
+
});
|
|
23901
|
+
}
|
|
23819
23902
|
function VideoSignatureContextProvider(_a) {
|
|
23820
23903
|
var _this = this;
|
|
23821
23904
|
var _b, _c;
|
|
@@ -23834,7 +23917,14 @@
|
|
|
23834
23917
|
// clear recorded data when the component is mounted
|
|
23835
23918
|
useVideoSignatureStore.getState().clearRecordedData();
|
|
23836
23919
|
}, []);
|
|
23837
|
-
var
|
|
23920
|
+
var _e = useVideoSignatureStore(useShallow(function (state) {
|
|
23921
|
+
return {
|
|
23922
|
+
recordingStartedAt: state.recordingStartedAt,
|
|
23923
|
+
recordingStoppedAt: state.recordingStoppedAt
|
|
23924
|
+
};
|
|
23925
|
+
})),
|
|
23926
|
+
recordingStartedAt = _e.recordingStartedAt,
|
|
23927
|
+
recordingStoppedAt = _e.recordingStoppedAt;
|
|
23838
23928
|
useFrameLoop(React.useCallback(function () {
|
|
23839
23929
|
return __awaiter(_this, void 0, void 0, function () {
|
|
23840
23930
|
var signaturePad, ctx, _a, w, h, isPortrait, rect;
|
|
@@ -23861,7 +23951,7 @@
|
|
|
23861
23951
|
});
|
|
23862
23952
|
});
|
|
23863
23953
|
}, [videoRef]), {
|
|
23864
|
-
autoStart:
|
|
23954
|
+
autoStart: !!recordingStartedAt && !recordingStoppedAt,
|
|
23865
23955
|
throttleMs: 1000 / 24
|
|
23866
23956
|
});
|
|
23867
23957
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children, /*#__PURE__*/React.createElement(InvisibleCanvas, {
|
|
@@ -23870,6 +23960,17 @@
|
|
|
23870
23960
|
height: (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.videoHeight
|
|
23871
23961
|
}));
|
|
23872
23962
|
}
|
|
23963
|
+
function formatTimestamp(durationMs) {
|
|
23964
|
+
// should be in the format of 00:00:00:00 (hh:mm:ss:cs)
|
|
23965
|
+
var hours = Math.floor(durationMs / 3600000);
|
|
23966
|
+
var minutes = Math.floor(durationMs % 3600000 / 60000);
|
|
23967
|
+
var seconds = Math.floor(durationMs % 60000 / 1000);
|
|
23968
|
+
var milliseconds = durationMs % 1000;
|
|
23969
|
+
// Convert milliseconds to centiseconds (1/100th of a second)
|
|
23970
|
+
var centiseconds = Math.floor(milliseconds / 10);
|
|
23971
|
+
var csString = centiseconds.toString().padStart(2, '0');
|
|
23972
|
+
return "".concat(hours.toString().padStart(2, '0'), ":") + "".concat(minutes.toString().padStart(2, '0'), ":") + "".concat(seconds.toString().padStart(2, '0'), ":") + "".concat(csString);
|
|
23973
|
+
}
|
|
23873
23974
|
|
|
23874
23975
|
function VideoSignaturePad(_a) {
|
|
23875
23976
|
var onAcceptBtnClicked = _a.onAcceptBtnClicked,
|
|
@@ -23931,8 +24032,11 @@
|
|
|
23931
24032
|
ref: signaturePad,
|
|
23932
24033
|
canvasProps: canvasProps,
|
|
23933
24034
|
onBegin: function onBegin() {
|
|
23934
|
-
return useVideoSignatureStore.setState({
|
|
23935
|
-
|
|
24035
|
+
return useVideoSignatureStore.setState(function (s) {
|
|
24036
|
+
return {
|
|
24037
|
+
signaturePadEmpty: false,
|
|
24038
|
+
signatureStartedAt: s.signatureStartedAt || performance.now()
|
|
24039
|
+
};
|
|
23936
24040
|
});
|
|
23937
24041
|
},
|
|
23938
24042
|
onEnd: function onEnd() {
|
|
@@ -23942,7 +24046,8 @@
|
|
|
23942
24046
|
return point;
|
|
23943
24047
|
});
|
|
23944
24048
|
useVideoSignatureStore.setState({
|
|
23945
|
-
signatureValid: points.length >= minSignaturePadPoints
|
|
24049
|
+
signatureValid: points.length >= minSignaturePadPoints,
|
|
24050
|
+
signatureEndedAt: performance.now()
|
|
23946
24051
|
});
|
|
23947
24052
|
}
|
|
23948
24053
|
}), !headTrackingSatisfied && !!verbiage.headTrackingUnsatisfiedText ? ( /*#__PURE__*/React.createElement(SignaturePadContentContainer, {
|
|
@@ -24009,6 +24114,12 @@
|
|
|
24009
24114
|
React.useEffect(function () {
|
|
24010
24115
|
if (guideToDisplay) setMode(guideToDisplay);
|
|
24011
24116
|
}, [guideToDisplay]);
|
|
24117
|
+
var firstChunkReceivedAt = useVideoSignatureStore(useShallow(function (state) {
|
|
24118
|
+
return {
|
|
24119
|
+
firstChunkReceivedAt: state.firstChunkReceivedAt
|
|
24120
|
+
};
|
|
24121
|
+
})).firstChunkReceivedAt;
|
|
24122
|
+
var signaturePadDisabled = requestedAction !== 'CAPTURE_SIGNATURE' || !firstChunkReceivedAt;
|
|
24012
24123
|
return /*#__PURE__*/React.createElement(Container$3, {
|
|
24013
24124
|
className: classNames.container
|
|
24014
24125
|
}, /*#__PURE__*/React.createElement(Inner$1, {
|
|
@@ -24032,7 +24143,7 @@
|
|
|
24032
24143
|
}, /*#__PURE__*/React.createElement(VideoSignaturePad, {
|
|
24033
24144
|
onAcceptBtnClicked: onAcceptBtnClicked,
|
|
24034
24145
|
onClearBtnClicked: onClearBtnClicked,
|
|
24035
|
-
disabled:
|
|
24146
|
+
disabled: signaturePadDisabled,
|
|
24036
24147
|
headTrackingSatisfied: headTrackingSatisfied,
|
|
24037
24148
|
minSignaturePadPoints: minSignaturePadPoints,
|
|
24038
24149
|
classNames: classNames,
|
|
@@ -24089,9 +24200,14 @@
|
|
|
24089
24200
|
onHeadTrackingPredictionMade = _o.onPredictionMade,
|
|
24090
24201
|
startHeadTracking = _o.start,
|
|
24091
24202
|
stopHeadTracking = _o.stop;
|
|
24092
|
-
var _p = useVideoSignatureStore()
|
|
24203
|
+
var _p = useVideoSignatureStore(useShallow(function (state) {
|
|
24204
|
+
return {
|
|
24205
|
+
clearRecordedData: state.clearRecordedData,
|
|
24206
|
+
firstChunkReceivedAt: state.firstChunkReceivedAt
|
|
24207
|
+
};
|
|
24208
|
+
})),
|
|
24093
24209
|
clearRecordedData = _p.clearRecordedData,
|
|
24094
|
-
|
|
24210
|
+
firstChunkReceivedAt = _p.firstChunkReceivedAt;
|
|
24095
24211
|
React.useEffect(function () {
|
|
24096
24212
|
useVideoSignatureStore.setState({
|
|
24097
24213
|
onSignatureVideoCaptured: onSignatureVideoCaptured
|
|
@@ -24175,7 +24291,7 @@
|
|
|
24175
24291
|
face: lastFace,
|
|
24176
24292
|
scaling: debugScalingDetails,
|
|
24177
24293
|
color: headTrackingSatisfied ? 'green' : 'red'
|
|
24178
|
-
}))), /*#__PURE__*/React.createElement(DebugStatsPane, null, "Video: ", videoWidth, "x", videoHeight, /*#__PURE__*/React.createElement("br", null), "Recording: ",
|
|
24294
|
+
}))), /*#__PURE__*/React.createElement(DebugStatsPane, null, "Video: ", videoWidth, "x", videoHeight, /*#__PURE__*/React.createElement("br", null), "Recording: ", firstChunkReceivedAt ? 'true' : 'false'))), /*#__PURE__*/React.createElement(ExitCaptureButton, {
|
|
24179
24295
|
onClick: onExit,
|
|
24180
24296
|
className: classNames.exitCaptureBtn
|
|
24181
24297
|
}));
|
|
@@ -24506,6 +24622,8 @@
|
|
|
24506
24622
|
setSelfieImage = _u.setSelfieImage,
|
|
24507
24623
|
setSignatureData = _u.setSignatureData,
|
|
24508
24624
|
setSignatureVideoUrl = _u.setSignatureVideoUrl,
|
|
24625
|
+
setSignatureStartTimestamp = _u.setSignatureStartTimestamp,
|
|
24626
|
+
setSignatureEndTimestamp = _u.setSignatureEndTimestamp,
|
|
24509
24627
|
logSelfieCaptureAttempt = _u.logSelfieCaptureAttempt,
|
|
24510
24628
|
uploadDocument = _u.uploadDocument;
|
|
24511
24629
|
var cameraAccessDenied = useCameraStore(useShallow(function (state) {
|
|
@@ -24565,12 +24683,14 @@
|
|
|
24565
24683
|
filetype: 'image/jpeg'
|
|
24566
24684
|
}).then(onSelfieCaptured);
|
|
24567
24685
|
}, [logCaptureMetadata, onSelfieCaptured, setSelfieImage, uploadDocument]);
|
|
24568
|
-
var onSignatureCaptureCompleted = React.useCallback(function (videoData, signatureData, signatureImageData) {
|
|
24686
|
+
var onSignatureCaptureCompleted = React.useCallback(function (videoData, signatureData, signatureImageData, signatureStartTimestamp, signatureEndTimestamp) {
|
|
24569
24687
|
setSignatureData(signatureData);
|
|
24570
24688
|
setSignatureVideoUrl(URL.createObjectURL(videoData));
|
|
24689
|
+
if (signatureStartTimestamp) setSignatureStartTimestamp(signatureStartTimestamp);
|
|
24690
|
+
if (signatureEndTimestamp) setSignatureEndTimestamp(signatureEndTimestamp);
|
|
24571
24691
|
setCaptureState('SUCCESS');
|
|
24572
|
-
onVideoCaptured === null || onVideoCaptured === void 0 ? void 0 : onVideoCaptured(videoData, signatureData, signatureImageData);
|
|
24573
|
-
}, [onVideoCaptured, setSignatureData, setSignatureVideoUrl]);
|
|
24692
|
+
onVideoCaptured === null || onVideoCaptured === void 0 ? void 0 : onVideoCaptured(videoData, signatureData, signatureImageData, signatureStartTimestamp, signatureEndTimestamp);
|
|
24693
|
+
}, [onVideoCaptured, setSignatureData, setSignatureEndTimestamp, setSignatureStartTimestamp, setSignatureVideoUrl]);
|
|
24574
24694
|
var _x = React.useState(true),
|
|
24575
24695
|
showLoadingOverlay = _x[0],
|
|
24576
24696
|
setShowLoadingOverlay = _x[1];
|