idmission-web-sdk 2.3.84 → 2.3.86

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
@@ -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.84';
208
+ var webSdkVersion = '2.3.86';
209
209
 
210
210
  function getPlatform() {
211
211
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -13662,10 +13662,13 @@ var AcceptBtn$1 = styled(LoaderButton)(templateObject_2$b || (templateObject_2$b
13662
13662
  var templateObject_1$c, templateObject_2$b;
13663
13663
 
13664
13664
  function isBlob(blobPart) {
13665
- return typeof blobPart === 'object' && 'type' in blobPart;
13665
+ return typeof Blob !== 'undefined' && blobPart instanceof Blob;
13666
13666
  }
13667
13667
  function inferBlobType(blobPart) {
13668
- return isBlob(blobPart) ? blobPart.type : undefined;
13668
+ var _a;
13669
+ if (!isBlob(blobPart)) return undefined;
13670
+ var t = ((_a = blobPart.type) !== null && _a !== void 0 ? _a : '').trim();
13671
+ return t.length > 0 ? t : undefined;
13669
13672
  }
13670
13673
 
13671
13674
  var videoRecorder = null;
@@ -13801,8 +13804,7 @@ var useVideoRecorder = function useVideoRecorder(mergeAVStreams) {
13801
13804
  useVideoRecorderStore.getState().clearRecordedData();
13802
13805
  }, []);
13803
13806
  var processVideo = useCallback(function () {
13804
- var _a;
13805
- var inferredType = (_a = inferBlobType(videoChunks[0])) !== null && _a !== void 0 ? _a : 'video/mp4';
13807
+ var inferredType = inferBlobType(videoChunks[0]) || (videoRecorder === null || videoRecorder === void 0 ? void 0 : videoRecorder.mimeType) || 'video/mp4';
13806
13808
  var videoBlob = new Blob(videoChunks, {
13807
13809
  type: inferredType
13808
13810
  });
@@ -13814,8 +13816,9 @@ var useVideoRecorder = function useVideoRecorder(mergeAVStreams) {
13814
13816
  setVideoRecorder(null);
13815
13817
  }, []);
13816
13818
  var processAudio = useCallback(function () {
13819
+ var inferredType = inferBlobType(audioChunks[0]) || (audioRecorder === null || audioRecorder === void 0 ? void 0 : audioRecorder.mimeType) || 'audio/mp4';
13817
13820
  var audioBlob = new Blob(audioChunks, {
13818
- type: 'audio/mp4'
13821
+ type: inferredType
13819
13822
  });
13820
13823
  useVideoRecorderStore.setState({
13821
13824
  audioUrl: URL.createObjectURL(audioBlob),
@@ -13855,6 +13858,7 @@ var useVideoRecorder = function useVideoRecorder(mergeAVStreams) {
13855
13858
  }, [audioRecordingIntentionallyStopped, audioRecordingStopped, audioUrl, isRecordingAudio, isRecordingVideo, videoRecordingIntentionallyStopped, videoRecordingStopped, videoUrl]);
13856
13859
  };
13857
13860
 
13861
+ var RECORDING_TIMESTAMP_PADDING_MS = 500;
13858
13862
  var signatureRecorder = null;
13859
13863
  var signatureChunks = [];
13860
13864
  var videoSignatureInitialState = {
@@ -13929,23 +13933,22 @@ var useVideoSignatureStore = create()(devtools(function (set, get) {
13929
13933
  if (!signatureRecorder) return;
13930
13934
  signatureRecorder.stop();
13931
13935
  signatureRecorder.onstop = function () {
13932
- var _a;
13933
- var inferredType = (_a = inferBlobType(signatureChunks[0])) !== null && _a !== void 0 ? _a : 'video/mp4';
13936
+ var inferredType = inferBlobType(signatureChunks[0]) || (signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.mimeType) || 'video/mp4';
13934
13937
  var blob = new Blob(signatureChunks, {
13935
13938
  type: inferredType
13936
13939
  });
13937
13940
  signatureChunks = [];
13938
13941
  signatureRecorder = null;
13939
13942
  if (!signatureData) return;
13940
- var _b = get(),
13941
- onSignatureVideoCaptured = _b.onSignatureVideoCaptured,
13942
- recordingStartedAt = _b.recordingStartedAt,
13943
- signatureStartedAt = _b.signatureStartedAt,
13944
- signatureEndedAt = _b.signatureEndedAt,
13945
- lastChunkReceivedAt = _b.lastChunkReceivedAt;
13943
+ var _a = get(),
13944
+ onSignatureVideoCaptured = _a.onSignatureVideoCaptured,
13945
+ recordingStartedAt = _a.recordingStartedAt,
13946
+ signatureStartedAt = _a.signatureStartedAt,
13947
+ signatureEndedAt = _a.signatureEndedAt,
13948
+ lastChunkReceivedAt = _a.lastChunkReceivedAt;
13946
13949
  var endMs = Math.min(signatureEndedAt !== null && signatureEndedAt !== void 0 ? signatureEndedAt : Infinity, lastChunkReceivedAt !== null && lastChunkReceivedAt !== void 0 ? lastChunkReceivedAt : Infinity);
13947
- var signatureStartTimestamp = signatureStartedAt && recordingStartedAt ? formatTimestamp(Math.max(0, signatureStartedAt - recordingStartedAt - 500)) : undefined;
13948
- var signatureEndTimestamp = endMs !== Infinity && recordingStartedAt ? formatTimestamp(Math.min(endMs - recordingStartedAt + 500, lastChunkReceivedAt !== null && lastChunkReceivedAt !== void 0 ? lastChunkReceivedAt : Infinity)) : undefined;
13950
+ var signatureStartTimestamp = signatureStartedAt && recordingStartedAt ? formatTimestamp(Math.max(0, signatureStartedAt - recordingStartedAt - RECORDING_TIMESTAMP_PADDING_MS)) : undefined;
13951
+ var signatureEndTimestamp = endMs !== Infinity && recordingStartedAt ? formatTimestamp(Math.min(endMs - recordingStartedAt + RECORDING_TIMESTAMP_PADDING_MS, lastChunkReceivedAt !== null && lastChunkReceivedAt !== void 0 ? lastChunkReceivedAt : Infinity)) : undefined;
13949
13952
  onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, signatureStartTimestamp, signatureEndTimestamp);
13950
13953
  };
13951
13954
  useVideoRecorderStore.getState().stopRecording();
@@ -14957,6 +14960,7 @@ function VideoSignatureWizardGuides(_a) {
14957
14960
  var onClearBtnClicked = useCallback(function () {
14958
14961
  var _a, _b;
14959
14962
  useVideoSignatureStore.setState({
14963
+ signatureStartedAt: undefined,
14960
14964
  signaturePadEmpty: true,
14961
14965
  signatureValid: false
14962
14966
  });