idmission-web-sdk 2.1.112 → 2.1.113

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.1.112';
207
+ var webSdkVersion = '2.1.113';
208
208
 
209
209
  function getPlatform() {
210
210
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -14201,12 +14201,15 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14201
14201
  var _25 = useState(0),
14202
14202
  currentDetectionScore = _25[0],
14203
14203
  setCurrentDetectionScore = _25[1];
14204
- var _26 = useState(0),
14205
- currentFocusScore = _26[0],
14206
- setCurrentFocusScore = _26[1];
14204
+ var _26 = useState('none'),
14205
+ currentDetectedDocumentType = _26[0],
14206
+ setCurrentDetectedDocumentType = _26[1];
14207
14207
  var _27 = useState(0),
14208
- goodFramesCount = _27[0],
14209
- setGoodFramesCount = _27[1];
14208
+ currentFocusScore = _27[0],
14209
+ setCurrentFocusScore = _27[1];
14210
+ var _28 = useState(0),
14211
+ goodFramesCount = _28[0],
14212
+ setGoodFramesCount = _28[1];
14210
14213
  var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? videoIdCaptureThresholds.goodFrames.idCardFront : videoIdCaptureThresholds.goodFrames.idCardBack;
14211
14214
  var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
14212
14215
  useEffect(function () {
@@ -14214,6 +14217,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14214
14217
  onIdPredictionMade(function (prediction) {
14215
14218
  setDetectedObjects(prediction.detectedObjects);
14216
14219
  setCurrentDetectionScore(prediction.detectionScore);
14220
+ setCurrentDetectedDocumentType(prediction.detectedDocumentType);
14217
14221
  setCurrentFocusScore(prediction.focusScore);
14218
14222
  var detectionThresholdMet = requestedAction === 'SHOW_ID_FRONT' ? prediction.idCardFrontDetectionThresholdMet : prediction.idCardBackDetectionThresholdMet;
14219
14223
  var isGoodFrame = detectionThresholdMet && prediction.focusThresholdMet;
@@ -14226,9 +14230,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14226
14230
  } : 0);
14227
14231
  });
14228
14232
  }, [idCaptureModelsEnabled, onIdPredictionMade, idModelError, requestedAction, videoIdCaptureThresholds.flipShortcutThreshold]);
14229
- var _28 = useState(null),
14230
- idFrontCaptureStartedAt = _28[0],
14231
- setFirstGoodFrameTime = _28[1];
14233
+ var _29 = useState(null),
14234
+ idFrontCaptureStartedAt = _29[0],
14235
+ setFirstGoodFrameTime = _29[1];
14232
14236
  useEffect(function () {
14233
14237
  if (goodFramesCount === 1) setFirstGoodFrameTime(new Date().getTime());
14234
14238
  }, [goodFramesCount]);
@@ -14249,9 +14253,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14249
14253
  var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
14250
14254
  var faceBox = face === null || face === void 0 ? void 0 : face.box;
14251
14255
  var faceCentered = !faceBox || !frameWidth || faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
14252
- var _29 = useState(),
14253
- countdownStartedAt = _29[0],
14254
- setCountdownStartedAt = _29[1];
14256
+ var _30 = useState(),
14257
+ countdownStartedAt = _30[0],
14258
+ setCountdownStartedAt = _30[1];
14255
14259
  var photoCanvas = useRef(null);
14256
14260
  var frameLock = useRef(false);
14257
14261
  var captureFrame = useCallback(function () {
@@ -14374,9 +14378,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14374
14378
  stopSelfieGuidance();
14375
14379
  };
14376
14380
  }, [startSelfieGuidance, stopSelfieGuidance]);
14377
- var _30 = useState(0),
14378
- numFramesWithoutFaces = _30[0],
14379
- setNumFramesWithoutFaces = _30[1];
14381
+ var _31 = useState(0),
14382
+ numFramesWithoutFaces = _31[0],
14383
+ setNumFramesWithoutFaces = _31[1];
14380
14384
  onSelfiePredictionMade(useThrottledCallback(useCallback(function (_a) {
14381
14385
  var face = _a.face;
14382
14386
  if (selfieModelError) return;
@@ -14392,12 +14396,12 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14392
14396
  }
14393
14397
  }, [disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, numFramesWithoutFaces, onFaceNotDetected, timeoutStartedAt]);
14394
14398
  var theme = useTheme();
14395
- var _31 = useTranslations(rawVerbiage, {
14399
+ var _32 = useTranslations(rawVerbiage, {
14396
14400
  faceNotCenteredText: 'Please move your face to the center...',
14397
14401
  captureBtnText: 'Capture'
14398
14402
  }),
14399
- captureBtnText = _31.captureBtnText,
14400
- faceNotCenteredText = _31.faceNotCenteredText;
14403
+ captureBtnText = _32.captureBtnText,
14404
+ faceNotCenteredText = _32.faceNotCenteredText;
14401
14405
  var debugScalingDetails = useDebugScalingDetails({
14402
14406
  enabled: debugMode,
14403
14407
  pageWidth: width,
@@ -14452,7 +14456,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14452
14456
  className: classNames.guidanceMessage,
14453
14457
  "$background": (_p = (_o = (_m = theme.guidanceMessages) === null || _m === void 0 ? void 0 : _m.negative) === null || _o === void 0 ? void 0 : _o.backgroundColor) !== null && _p !== void 0 ? _p : 'red',
14454
14458
  "$textColor": (_s = (_r = (_q = theme.guidanceMessages) === null || _q === void 0 ? void 0 : _q.negative) === null || _r === void 0 ? void 0 : _r.textColor) !== null && _s !== void 0 ? _s : 'white'
14455
- }, guidanceText))), debugMode && ( /*#__PURE__*/React__default.createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default.createElement("br", null), isRecordingVideo ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__default.createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodFramesCount, "/", goodFramesThreshold, /*#__PURE__*/React__default.createElement("br", null), "Detection Score: ", currentDetectionScore, /*#__PURE__*/React__default.createElement("br", null), "Focus Score: ", currentFocusScore, /*#__PURE__*/React__default.createElement("br", null), "Best Frame Detection Score:", ' ', (_u = (_t = bestFrameDetails.current) === null || _t === void 0 ? void 0 : _t.detectionScore) !== null && _u !== void 0 ? _u : 0, /*#__PURE__*/React__default.createElement("br", null), "Best Frame Focus Score: ", (_w = (_v = bestFrameDetails.current) === null || _v === void 0 ? void 0 : _v.focusScore) !== null && _w !== void 0 ? _w : 0)), countdownRemaining > 0 && capturingId && ( /*#__PURE__*/React__default.createElement(CountdownContainer, {
14459
+ }, guidanceText))), debugMode && ( /*#__PURE__*/React__default.createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default.createElement("br", null), isRecordingVideo ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__default.createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodFramesCount, "/", goodFramesThreshold, /*#__PURE__*/React__default.createElement("br", null), "Document Type: ", currentDetectedDocumentType, /*#__PURE__*/React__default.createElement("br", null), "Detection Score: ", currentDetectionScore, /*#__PURE__*/React__default.createElement("br", null), "Focus Score: ", currentFocusScore, /*#__PURE__*/React__default.createElement("br", null), "Best Frame Detection Score:", ' ', (_u = (_t = bestFrameDetails.current) === null || _t === void 0 ? void 0 : _t.detectionScore) !== null && _u !== void 0 ? _u : 0, /*#__PURE__*/React__default.createElement("br", null), "Best Frame Focus Score: ", (_w = (_v = bestFrameDetails.current) === null || _v === void 0 ? void 0 : _v.focusScore) !== null && _w !== void 0 ? _w : 0)), countdownRemaining > 0 && capturingId && ( /*#__PURE__*/React__default.createElement(CountdownContainer, {
14456
14460
  className: classNames.countdownContainer
14457
14461
  }, /*#__PURE__*/React__default.createElement(Countdown, {
14458
14462
  className: classNames.countdown