idmission-web-sdk 1.0.188 → 1.0.189

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.
@@ -48,7 +48,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
48
48
  var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
49
49
  var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
50
50
 
51
- var webSdkVersion = '1.0.188';
51
+ var webSdkVersion = '1.0.189';
52
52
 
53
53
  function getPlatform() {
54
54
  if (typeof window === 'undefined') return;
@@ -8796,9 +8796,9 @@ var IdCaptureModelsProvider = function IdCaptureModelsProvider(_a) {
8796
8796
  (function () {
8797
8797
  return tslib.__awaiter(void 0, void 0, void 0, function () {
8798
8798
  var canvases, prediction, e_1;
8799
- var _a, _b, _c;
8800
- return tslib.__generator(this, function (_d) {
8801
- switch (_d.label) {
8799
+ var _a, _b, _c, _d;
8800
+ return tslib.__generator(this, function (_e) {
8801
+ switch (_e.label) {
8802
8802
  case 0:
8803
8803
  if (!documentDetectionModel || !focusModel || !lastPredictionCanvas.current || !cropCanvas.current || !rotateCanvas.current) return [2 /*return*/];
8804
8804
  canvases = {
@@ -8806,12 +8806,12 @@ var IdCaptureModelsProvider = function IdCaptureModelsProvider(_a) {
8806
8806
  cropCanvas: cropCanvas.current,
8807
8807
  rotateCanvas: rotateCanvas.current
8808
8808
  };
8809
- _d.label = 1;
8809
+ _e.label = 1;
8810
8810
  case 1:
8811
- _d.trys.push([1, 3,, 4]);
8811
+ _e.trys.push([1, 3,, 4]);
8812
8812
  return [4 /*yield*/, makePredictions(frame, thresholds, canvases, logPredictions)];
8813
8813
  case 2:
8814
- prediction = _d.sent();
8814
+ prediction = _e.sent();
8815
8815
  setDetectionTime(prediction.detectionTime);
8816
8816
  setFocusPredictionTime(prediction.focusPredictionTime);
8817
8817
  if (bestFocusScore.current <= prediction.focusScore) {
@@ -8827,10 +8827,12 @@ var IdCaptureModelsProvider = function IdCaptureModelsProvider(_a) {
8827
8827
  (_c = onPredictionHandler.current) === null || _c === void 0 ? void 0 : _c.call(onPredictionHandler, prediction);
8828
8828
  return [3 /*break*/, 4];
8829
8829
  case 3:
8830
- e_1 = _d.sent();
8830
+ e_1 = _e.sent();
8831
8831
  console.log('caught an error while predicting!', e_1);
8832
- if (e_1.message === 'Error: Requested texture size [0x0] is invalid.') {
8832
+ if ((_d = e_1.message) === null || _d === void 0 ? void 0 : _d.includes('Requested texture size [0x0] is invalid.')) {
8833
8833
  console.log("it's the texture one!");
8834
+ } else if (e_1.message === 'CanvasRenderingContext2D.drawImage: Passed-in canvas is empty') {
8835
+ console.log("it's the empty canvas one!");
8834
8836
  } else {
8835
8837
  throw e_1;
8836
8838
  }