idmission-web-sdk 2.3.21 → 2.3.23

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/sdk2.esm.js CHANGED
@@ -204,7 +204,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
204
204
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
205
205
  };
206
206
 
207
- var webSdkVersion = '2.3.21';
207
+ var webSdkVersion = '2.3.23';
208
208
 
209
209
  function getPlatform() {
210
210
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -3449,14 +3449,13 @@ function applyNonMaxSuppression(detectedObjects, isGoodBox) {
3449
3449
  });
3450
3450
  }
3451
3451
 
3452
- function useFrameLoop(fn, _a) {
3453
- var _b = _a.throttleMs,
3454
- throttleMs = _b === void 0 ? 0 : _b,
3455
- _c = _a.autoStart,
3456
- autoStart = _c === void 0 ? false : _c;
3457
- var _d = useState(false),
3458
- running = _d[0],
3459
- setRunning = _d[1];
3452
+ function useFrameLoop(fn, options) {
3453
+ if (options === void 0) {
3454
+ options = {};
3455
+ }
3456
+ var _a = useState(false),
3457
+ running = _a[0],
3458
+ setRunning = _a[1];
3460
3459
  var startedAtRef = useRef(null);
3461
3460
  var loopId = useRef(0);
3462
3461
  var frameId = useRef(0);
@@ -3464,36 +3463,36 @@ function useFrameLoop(fn, _a) {
3464
3463
  if (!running) return;
3465
3464
  var timer;
3466
3465
  var currentLoopId = loopId.current;
3467
- function renderPrediction() {
3466
+ function hotLoop() {
3468
3467
  return __awaiter(this, void 0, void 0, function () {
3469
3468
  var start, timeRunning, took, amountToThrottle;
3470
- var _a, _b;
3471
- return __generator(this, function (_c) {
3472
- switch (_c.label) {
3469
+ var _a, _b, _c;
3470
+ return __generator(this, function (_d) {
3471
+ switch (_d.label) {
3473
3472
  case 0:
3474
3473
  if (currentLoopId !== loopId.current) return [2 /*return*/];
3475
3474
  start = new Date().getTime();
3476
3475
  timeRunning = start - ((_b = (_a = startedAtRef.current) === null || _a === void 0 ? void 0 : _a.getTime()) !== null && _b !== void 0 ? _b : 0);
3477
3476
  return [4 /*yield*/, fn(frameId.current, timeRunning)];
3478
3477
  case 1:
3479
- _c.sent();
3478
+ _d.sent();
3480
3479
  took = new Date().getTime() - start;
3481
- amountToThrottle = Math.max((throttleMs !== null && throttleMs !== void 0 ? throttleMs : 0) - took, 0);
3480
+ amountToThrottle = Math.max(((_c = options.throttleMs) !== null && _c !== void 0 ? _c : 0) - took, 0);
3482
3481
  timer = setTimeout(function () {
3483
- frameId.current = requestAnimationFrame(renderPrediction);
3482
+ frameId.current = requestAnimationFrame(hotLoop);
3484
3483
  }, amountToThrottle);
3485
3484
  return [2 /*return*/];
3486
3485
  }
3487
3486
  });
3488
3487
  });
3489
3488
  }
3490
- renderPrediction().then();
3489
+ void hotLoop();
3491
3490
  return function () {
3492
3491
  loopId.current += 1;
3493
3492
  if (frameId.current) cancelAnimationFrame(frameId.current);
3494
3493
  if (timer) clearTimeout(timer);
3495
3494
  };
3496
- }, [fn, running, throttleMs]);
3495
+ }, [fn, running, options.throttleMs]);
3497
3496
  var start = useCallback(function () {
3498
3497
  startedAtRef.current = new Date();
3499
3498
  setRunning(true);
@@ -3504,11 +3503,9 @@ function useFrameLoop(fn, _a) {
3504
3503
  startedAtRef.current = null;
3505
3504
  }, []);
3506
3505
  useEffect(function startAutomatically() {
3507
- if (autoStart) start();
3508
- return function () {
3509
- stop();
3510
- };
3511
- }, [autoStart, start, stop]);
3506
+ if (options.autoStart) start();
3507
+ return stop;
3508
+ }, [options.autoStart, start, stop]);
3512
3509
  return {
3513
3510
  start: start,
3514
3511
  stop: stop
@@ -13330,9 +13327,6 @@ var videoRecorder = null;
13330
13327
  var audioRecorder = null;
13331
13328
  var videoChunks = [];
13332
13329
  var audioChunks = [];
13333
- function getVideoRecorder() {
13334
- return videoRecorder;
13335
- }
13336
13330
  function setVideoRecorder(recorder) {
13337
13331
  videoRecorder = recorder;
13338
13332
  }
@@ -13360,20 +13354,22 @@ var useVideoRecorderStore = create()(devtools(function (set, get) {
13360
13354
  return _assign(_assign({}, initialState$2), {
13361
13355
  startRecordingVideo: function startRecordingVideo(camera, audioStream) {
13362
13356
  var _a, _b, _c;
13363
- var videoStream = get().mergeAVStreams ? new MediaStream(__spreadArray(__spreadArray([], (_b = (_a = camera === null || camera === void 0 ? void 0 : camera.stream) === null || _a === void 0 ? void 0 : _a.getTracks()) !== null && _b !== void 0 ? _b : [], true), (_c = audioStream === null || audioStream === void 0 ? void 0 : audioStream.getTracks()) !== null && _c !== void 0 ? _c : [], true)) : camera.stream;
13357
+ var _d = get(),
13358
+ mergeAVStreams = _d.mergeAVStreams,
13359
+ startRecordingAudio = _d.startRecordingAudio;
13360
+ var videoStream = mergeAVStreams ? new MediaStream(__spreadArray(__spreadArray([], (_b = (_a = camera === null || camera === void 0 ? void 0 : camera.stream) === null || _a === void 0 ? void 0 : _a.getTracks()) !== null && _b !== void 0 ? _b : [], true), (_c = audioStream === null || audioStream === void 0 ? void 0 : audioStream.getTracks()) !== null && _c !== void 0 ? _c : [], true)) : camera.stream;
13364
13361
  if (!videoStream) return;
13365
13362
  clearVideoChunks();
13366
- setVideoRecorder(null);
13363
+ videoRecorder = null;
13367
13364
  set({
13368
13365
  isRecordingVideo: true,
13369
13366
  videoRecordingStopped: false,
13370
13367
  videoRecordingIntentionallyStopped: false
13371
13368
  });
13372
- var videoRecorder = new MediaRecorder(videoStream, {
13369
+ videoRecorder = new MediaRecorder(videoStream, {
13373
13370
  videoBitsPerSecond: 270000,
13374
13371
  audioBitsPerSecond: 32000
13375
13372
  });
13376
- setVideoRecorder(videoRecorder);
13377
13373
  videoRecorder.ondataavailable = function (e) {
13378
13374
  videoChunks.push(e.data);
13379
13375
  };
@@ -13384,12 +13380,14 @@ var useVideoRecorderStore = create()(devtools(function (set, get) {
13384
13380
  };
13385
13381
  videoRecorder.start(100);
13386
13382
  setTimeout(function () {
13387
- var videoRecorder = getVideoRecorder();
13388
13383
  if (!videoRecorder || videoRecorder.state === 'inactive') {
13389
13384
  log('media recorder is inactive!');
13390
13385
  // TODO: figure out what to do here
13391
13386
  }
13392
13387
  }, 100);
13388
+ if (audioStream && !mergeAVStreams) {
13389
+ startRecordingAudio(audioStream);
13390
+ }
13393
13391
  },
13394
13392
  stopRecordingVideo: function stopRecordingVideo() {
13395
13393
  set({
@@ -13507,16 +13505,7 @@ var useVideoRecorder = function useVideoRecorder(mergeAVStreams) {
13507
13505
  };
13508
13506
 
13509
13507
  var signatureRecorder = null;
13510
- var getSignatureRecorder = function getSignatureRecorder() {
13511
- return signatureRecorder;
13512
- };
13513
- var setSignatureRecorder = function setSignatureRecorder(recorder) {
13514
- return signatureRecorder = recorder;
13515
- };
13516
13508
  var signatureChunks = [];
13517
- var clearSignatureChunks = function clearSignatureChunks() {
13518
- return signatureChunks = [];
13519
- };
13520
13509
  var videoSignatureInitialState = {
13521
13510
  startRecording: function startRecording() {
13522
13511
  return null;
@@ -13531,19 +13520,11 @@ var videoSignatureInitialState = {
13531
13520
  signaturePad: {
13532
13521
  current: null
13533
13522
  },
13534
- signatureData: null,
13535
- signatureDataUrl: null,
13536
- signatureVideoData: null,
13537
- signatureVideoUrl: null,
13538
13523
  outputCanvas: {
13539
13524
  current: null
13540
13525
  },
13541
- onAcceptClicked: function onAcceptClicked() {
13542
- return __awaiter(void 0, void 0, void 0, function () {
13543
- return __generator(this, function (_a) {
13544
- return [2 /*return*/];
13545
- });
13546
- });
13526
+ onSignatureVideoCaptured: function onSignatureVideoCaptured() {
13527
+ return null;
13547
13528
  }
13548
13529
  };
13549
13530
  var useVideoSignatureStore = create()(devtools(function (set, get) {
@@ -13553,25 +13534,22 @@ var useVideoSignatureStore = create()(devtools(function (set, get) {
13553
13534
  if (captureAudio === void 0) {
13554
13535
  captureAudio = false;
13555
13536
  }
13537
+ // set our flag and clear whatever we have recorded so far.
13556
13538
  set({
13557
13539
  isRecording: true
13558
13540
  });
13559
- clearSignatureChunks();
13560
- useVideoRecorderStore.getState().clearRecordedData();
13561
- var _b = useVideoRecorderStore.getState(),
13562
- startRecordingVideo = _b.startRecordingVideo,
13563
- startRecordingAudio = _b.startRecordingAudio;
13564
- startRecordingVideo(camera, audioStream);
13565
- if (captureAudio) startRecordingAudio(audioStream);
13566
- var stream = get().outputCanvas.current.captureStream(24 /* fps */);
13567
- var tracks = [stream.getVideoTracks()[0]];
13541
+ signatureChunks = [];
13542
+ // start recording video and audio
13543
+ useVideoRecorderStore.getState().startRecordingVideo(camera, captureAudio ? audioStream : undefined);
13544
+ // start recording from the output canvas to capture the signature
13545
+ var videoStream = get().outputCanvas.current.captureStream(24); // fps
13546
+ var tracks = [videoStream.getVideoTracks()[0]];
13568
13547
  var audioTrack = (_a = audioStream === null || audioStream === void 0 ? void 0 : audioStream.getAudioTracks()) === null || _a === void 0 ? void 0 : _a[0];
13569
13548
  if (audioTrack) tracks.push(audioTrack);
13570
- var signatureRecorder = new MediaRecorder(new MediaStream(tracks), {
13549
+ signatureRecorder = new MediaRecorder(new MediaStream(tracks), {
13571
13550
  videoBitsPerSecond: 270000,
13572
13551
  audioBitsPerSecond: 32000
13573
13552
  });
13574
- setSignatureRecorder(signatureRecorder);
13575
13553
  signatureRecorder.ondataavailable = function (event) {
13576
13554
  signatureChunks.push(event.data);
13577
13555
  };
@@ -13584,43 +13562,41 @@ var useVideoSignatureStore = create()(devtools(function (set, get) {
13584
13562
  if (!signatureRecorder) return;
13585
13563
  signatureRecorder.stop();
13586
13564
  signatureRecorder.onstop = function () {
13587
- log('VideoSignatureContext: onstop');
13588
13565
  var blob = new Blob(signatureChunks, {
13589
13566
  type: 'video/mp4'
13590
13567
  });
13591
- useVideoSignatureStore.setState({
13592
- signatureVideoData: blob,
13593
- signatureVideoUrl: URL.createObjectURL(blob)
13568
+ signatureChunks = [];
13569
+ signatureRecorder = null;
13570
+ var signaturePad = get().signaturePad.current;
13571
+ if (!signaturePad) throw new Error('Signature pad not found');
13572
+ var signatureData = buildSignatureData(signaturePad);
13573
+ exportSignatureImage(signaturePad).then(function (imageUrl) {
13574
+ if (imageUrl) signatureData.fileContent = dataUrlToBase64Sync(imageUrl);
13575
+ get().onSignatureVideoCaptured(blob, signatureData, imageUrl);
13594
13576
  });
13595
- clearSignatureChunks();
13596
- setSignatureRecorder(null);
13597
13577
  };
13598
13578
  useVideoRecorderStore.getState().stopRecording();
13599
13579
  },
13600
13580
  clearRecordedData: function clearRecordedData() {
13601
- var _a;
13602
- clearSignatureChunks();
13581
+ signatureChunks = [];
13603
13582
  useVideoRecorderStore.getState().stopRecordingVideo();
13604
13583
  useVideoRecorderStore.getState().clearRecordedData();
13605
- (_a = getSignatureRecorder()) === null || _a === void 0 ? void 0 : _a.stop();
13606
- setSignatureRecorder(null);
13584
+ signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.stop();
13585
+ signatureRecorder = null;
13607
13586
  set({
13608
- isRecording: false,
13609
- signatureVideoData: null,
13610
- signatureVideoUrl: null
13587
+ isRecording: false
13611
13588
  });
13612
13589
  }
13613
13590
  });
13614
13591
  }));
13615
13592
  function VideoSignatureContextProvider(_a) {
13593
+ var _this = this;
13616
13594
  var _b, _c;
13617
13595
  var children = _a.children,
13618
13596
  _d = _a.captureAudio,
13619
13597
  captureAudio = _d === void 0 ? false : _d;
13620
- var _e = useCameraStore(),
13621
- camera = _e.camera,
13622
- videoRef = _e.videoRef;
13623
- var isRecordingVideo = useVideoRecorder(captureAudio).isRecordingVideo;
13598
+ var videoRef = useCameraStore().videoRef;
13599
+ useVideoRecorder(captureAudio);
13624
13600
  var outputCanvas = useRef(null);
13625
13601
  useEffect(function () {
13626
13602
  return useVideoSignatureStore.setState({
@@ -13632,36 +13608,35 @@ function VideoSignatureContextProvider(_a) {
13632
13608
  useVideoSignatureStore.getState().clearRecordedData();
13633
13609
  }, []);
13634
13610
  var isRecording = useVideoSignatureStore().isRecording;
13635
- var animationFrame = useRef(0);
13636
- useEffect(function () {
13637
- if (!videoRef.current || !outputCanvas.current || !camera || !isRecording || !isRecordingVideo) return;
13638
- var ctx = outputCanvas.current.getContext('2d');
13639
- if (!ctx) return;
13640
- var signaturePad = useVideoSignatureStore.getState().signaturePad;
13641
- animationFrame.current = requestAnimationFrame(function runFrame() {
13642
- if (!signaturePad.current || !videoRef.current || !outputCanvas.current) {
13643
- cancelAnimationFrame(animationFrame.current);
13644
- return;
13645
- }
13646
- var _a = [videoRef.current.videoWidth, videoRef.current.videoHeight],
13647
- w = _a[0],
13648
- h = _a[1];
13649
- var isPortrait = w < h;
13650
- outputCanvas.current.width = w;
13651
- outputCanvas.current.height = h;
13652
- var rect = [w * (isPortrait ? 0.02 : 0.15), h * (isPortrait ? 0.15 : 0.25), w * (isPortrait ? 0.96 : 0.7), h * (isPortrait ? 0.7 : 0.5)];
13653
- ctx.drawImage(videoRef.current, 0, 0, w, h);
13654
- ctx.beginPath();
13655
- ctx.fillStyle = 'rgba(255,255,255,0.5)';
13656
- ctx.roundRect.apply(ctx, __spreadArray(__spreadArray([], rect, false), [16], false));
13657
- ctx.fill();
13658
- ctx.drawImage.apply(ctx, __spreadArray([signaturePad.current.getCanvas()], rect, false));
13659
- animationFrame.current = requestAnimationFrame(runFrame);
13611
+ useFrameLoop(useCallback(function () {
13612
+ return __awaiter(_this, void 0, void 0, function () {
13613
+ var signaturePad, ctx, _a, w, h, isPortrait, rect;
13614
+ return __generator(this, function (_b) {
13615
+ signaturePad = useVideoSignatureStore.getState().signaturePad;
13616
+ if (!outputCanvas.current || !signaturePad.current || !videoRef.current) return [2 /*return*/];
13617
+ ctx = outputCanvas.current.getContext('2d');
13618
+ if (!ctx) return [2 /*return*/];
13619
+ _a = [videoRef.current.videoWidth, videoRef.current.videoHeight], w = _a[0], h = _a[1];
13620
+ isPortrait = w < h;
13621
+ outputCanvas.current.width = w;
13622
+ outputCanvas.current.height = h;
13623
+ rect = [w * (isPortrait ? 0.02 : 0.15), h * (isPortrait ? 0.15 : 0.25), w * (isPortrait ? 0.96 : 0.7), h * (isPortrait ? 0.7 : 0.5)];
13624
+ // draw the current video frame
13625
+ ctx.drawImage(videoRef.current, 0, 0, w, h);
13626
+ // draw a semi-transparent white rectangle over the video to simulate a signature pad
13627
+ ctx.beginPath();
13628
+ ctx.fillStyle = 'rgba(255,255,255,0.5)';
13629
+ ctx.roundRect.apply(ctx, __spreadArray(__spreadArray([], rect, false), [16], false));
13630
+ ctx.fill();
13631
+ // draw whatever the user has drawn on the signature pad
13632
+ ctx.drawImage.apply(ctx, __spreadArray([signaturePad.current.getCanvas()], rect, false));
13633
+ return [2 /*return*/];
13634
+ });
13660
13635
  });
13661
- return function () {
13662
- return cancelAnimationFrame(animationFrame.current);
13663
- };
13664
- }, [camera, isRecording, isRecordingVideo, videoRef]);
13636
+ }, [videoRef]), {
13637
+ autoStart: isRecording,
13638
+ throttleMs: 1000 / 24
13639
+ });
13665
13640
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, children, /*#__PURE__*/React__default.createElement(InvisibleCanvas, {
13666
13641
  ref: outputCanvas,
13667
13642
  width: (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth,
@@ -13670,7 +13645,6 @@ function VideoSignatureContextProvider(_a) {
13670
13645
  }
13671
13646
 
13672
13647
  function VideoSignatureGuides(_a) {
13673
- var _this = this;
13674
13648
  var _b = _a.requestedAction,
13675
13649
  requestedAction = _b === void 0 ? 'VERIFY_LIVENESS' : _b,
13676
13650
  _c = _a.faceGuideStatus,
@@ -13726,32 +13700,7 @@ function VideoSignatureGuides(_a) {
13726
13700
  if (signaturePadEmpty) setEmptyContentDismissed(false);
13727
13701
  }, [signaturePadEmpty]);
13728
13702
  var onAcceptClicked = useCallback(function () {
13729
- return __awaiter(_this, void 0, void 0, function () {
13730
- var signatureData, imageUrl;
13731
- return __generator(this, function (_a) {
13732
- switch (_a.label) {
13733
- case 0:
13734
- log('VideoSignatureContext: onAcceptClicked');
13735
- if (!signaturePad.current) return [2 /*return*/];
13736
- log('VideoSignatureContext: building signature data...');
13737
- signatureData = buildSignatureData(signaturePad.current);
13738
- log('VideoSignatureContext: exporting signature image...', signatureData);
13739
- return [4 /*yield*/, exportSignatureImage(signaturePad.current)];
13740
- case 1:
13741
- imageUrl = _a.sent();
13742
- if (imageUrl) signatureData.fileContent = dataUrlToBase64Sync(imageUrl);
13743
- log('VideoSignatureContext: setting signature data url...', imageUrl);
13744
- useVideoSignatureStore.setState({
13745
- signatureData: signatureData,
13746
- signatureDataUrl: imageUrl
13747
- });
13748
- log('VideoSignatureContext: stopping signature recorder...');
13749
- // getSignatureRecorder()?.stop()
13750
- useVideoSignatureStore.getState().stopRecording();
13751
- return [2 /*return*/];
13752
- }
13753
- });
13754
- });
13703
+ useVideoSignatureStore.getState().stopRecording();
13755
13704
  }, []);
13756
13705
  return /*#__PURE__*/React__default.createElement(Container$3, {
13757
13706
  className: classNames.container
@@ -13845,7 +13794,7 @@ var templateObject_1$b, templateObject_2$9, templateObject_3$8, templateObject_4
13845
13794
  var DEFAULT_MIN_SIGNATURE_PAD_POINTS = 10;
13846
13795
  var DEFAULT_HEAD_TRACKING_BOUNDARY_PERCENTAGE = 0.01;
13847
13796
  var VideoSignatureCapture = function VideoSignatureCapture(_a) {
13848
- var onVideoCaptured = _a.onVideoCaptured,
13797
+ var onSignatureVideoCaptured = _a.onSignatureVideoCaptured,
13849
13798
  onFaceNotDetected = _a.onFaceNotDetected,
13850
13799
  onExit = _a.onExit,
13851
13800
  _b = _a.restartVideoOnSignaturePadCleared,
@@ -13878,17 +13827,19 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
13878
13827
  videoWidth = _k.videoWidth,
13879
13828
  videoHeight = _k.videoHeight;
13880
13829
  var _l = useSelfieGuidanceModelsContext(),
13881
- onPredictionMade = _l.onPredictionMade,
13830
+ onHeadTrackingPredictionMade = _l.onPredictionMade,
13882
13831
  startHeadTracking = _l.start,
13883
13832
  stopHeadTracking = _l.stop;
13884
13833
  var _m = useVideoSignatureStore(),
13885
- signatureData = _m.signatureData,
13886
- signatureDataUrl = _m.signatureDataUrl,
13887
- signatureVideoData = _m.signatureVideoData,
13888
13834
  startRecording = _m.startRecording,
13889
13835
  stopRecording = _m.stopRecording,
13890
13836
  clearRecordedData = _m.clearRecordedData,
13891
13837
  isRecording = _m.isRecording;
13838
+ useEffect(function () {
13839
+ useVideoSignatureStore.setState({
13840
+ onSignatureVideoCaptured: onSignatureVideoCaptured
13841
+ });
13842
+ }, [onSignatureVideoCaptured]);
13892
13843
  useEffect(function () {
13893
13844
  if (!camera) return;
13894
13845
  startRecording(camera, audioStream, captureAudio);
@@ -13903,11 +13854,6 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
13903
13854
  var verbiage = useTranslations(rawVerbiage, {
13904
13855
  guidanceMessageText: 'Please sign the box below'
13905
13856
  });
13906
- useEffect(function () {
13907
- if (signatureVideoData && signatureData && signatureDataUrl) {
13908
- onVideoCaptured === null || onVideoCaptured === void 0 ? void 0 : onVideoCaptured(signatureVideoData, signatureData, signatureDataUrl);
13909
- }
13910
- }, [onVideoCaptured, signatureData, signatureDataUrl, signatureVideoData]);
13911
13857
  var _o = useState(true),
13912
13858
  headTrackingSatisfied = _o[0],
13913
13859
  setHeadTrackingSatisfied = _o[1];
@@ -13917,7 +13863,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
13917
13863
  var _q = useState(0),
13918
13864
  numFramesWithoutFaces = _q[0],
13919
13865
  setNumFramesWithoutFaces = _q[1];
13920
- onPredictionMade(useThrottledCallback(useCallback(function (_a) {
13866
+ onHeadTrackingPredictionMade(useThrottledCallback(useCallback(function (_a) {
13921
13867
  var face = _a.face;
13922
13868
  if (!camera) return;
13923
13869
  var nearBoundary = (face === null || face === void 0 ? void 0 : face.box.xMin) < videoWidth * headTrackingBoundaryPercentage || (face === null || face === void 0 ? void 0 : face.box.xMax) > videoWidth * (1 - headTrackingBoundaryPercentage) || (face === null || face === void 0 ? void 0 : face.box.yMin) < videoHeight * headTrackingBoundaryPercentage || (face === null || face === void 0 ? void 0 : face.box.yMax) > videoHeight * (1 - headTrackingBoundaryPercentage);
@@ -14139,6 +14085,7 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
14139
14085
  var onSignatureCaptureFacesNotDetected = useCallback(function () {
14140
14086
  setShowLoadingOverlay(false);
14141
14087
  setCaptureState('CHECKING_LIVENESS');
14088
+ useVideoSignatureStore.getState().clearRecordedData();
14142
14089
  }, []);
14143
14090
  var _u = useState(0),
14144
14091
  attempt = _u[0],
@@ -14219,7 +14166,7 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
14219
14166
  }));
14220
14167
  case 'CAPTURING_SIGNATURE':
14221
14168
  return /*#__PURE__*/React__default.createElement(VideoSignatureCapture, {
14222
- onVideoCaptured: onSignatureCaptureCompleted,
14169
+ onSignatureVideoCaptured: onSignatureCaptureCompleted,
14223
14170
  onFaceNotDetected: onSignatureCaptureFacesNotDetected,
14224
14171
  onExit: onExitSignatureCapture,
14225
14172
  minSignaturePadPoints: minSignaturePadPoints,