@jaak.ai/stamps 1.0.0-dev.11 → 1.0.0-dev.13

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.
@@ -6065,7 +6065,7 @@ async function checkMandatoryCapabilites() {
6065
6065
  * Determine whether this is a desktop device based on the screen resolution.
6066
6066
  */
6067
6067
  function isDesktop() {
6068
- return !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
6068
+ return !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|Tablet/i.test(navigator.userAgent);
6069
6069
  }
6070
6070
 
6071
6071
  var StatusDocumentDetector;
@@ -6096,7 +6096,7 @@ const DocumentDetector = class {
6096
6096
  this.engineLocation = "https://storage.googleapis.com/jaak-storage/models/web/document-detector/v2.0.0";
6097
6097
  this.workerLocation = "https://storage.googleapis.com/jaak-storage/models/web/document-detector/v2.0.0/BlinkIDWasmSDK.worker.min.js";
6098
6098
  this.wasmType = "ADVANCE";
6099
- this.blinkIdVariant = isDesktop() ? "full" : "lightweight";
6099
+ this.blinkIdVariant = "lightweight";
6100
6100
  this.recognizers = ['BlinkIdMultiSideRecognizer'];
6101
6101
  this.recognizerOptions = {
6102
6102
  BlinkIdMultiSideRecognizer: {
@@ -6109,11 +6109,7 @@ const DocumentDetector = class {
6109
6109
  leftFactor: 0.1,
6110
6110
  rightFactor: 0.1
6111
6111
  },
6112
- fullDocumentImageDpi: 300,
6113
- enableBlurFilter: false,
6114
- enableGlareFilter: false,
6115
- blurStrictnessLevel: 2,
6116
- glareStrictnessLevel: 2
6112
+ fullDocumentImageDpi: 300
6117
6113
  }
6118
6114
  };
6119
6115
  this.recognitionPauseTimeout = 3800;
@@ -6189,8 +6185,17 @@ const DocumentDetector = class {
6189
6185
  this.config = undefined;
6190
6186
  }
6191
6187
  configHandler(newConfig) {
6192
- if (newConfig && newConfig.key) {
6188
+ if (newConfig) {
6193
6189
  this.licenseKey = newConfig.key;
6190
+ this.blinkIdVariant = newConfig.dynamicMode ? (isDesktop() ? "full" : "lightweight") : "lightweight";
6191
+ if (newConfig.strictMode === false) {
6192
+ this.recognizerOptions.BlinkIdMultiSideRecognizer.blurStrictnessLevel = 2;
6193
+ this.recognizerOptions.BlinkIdMultiSideRecognizer.glareStrictnessLevel = 2;
6194
+ }
6195
+ else {
6196
+ this.recognizerOptions.BlinkIdMultiSideRecognizer.blurStrictnessLevel = 1;
6197
+ this.recognizerOptions.BlinkIdMultiSideRecognizer.glareStrictnessLevel = 1;
6198
+ }
6194
6199
  }
6195
6200
  }
6196
6201
  async setUiState(state) {
@@ -11,7 +11,7 @@ export class DocumentDetector {
11
11
  this.engineLocation = "https://storage.googleapis.com/jaak-storage/models/web/document-detector/v2.0.0";
12
12
  this.workerLocation = "https://storage.googleapis.com/jaak-storage/models/web/document-detector/v2.0.0/BlinkIDWasmSDK.worker.min.js";
13
13
  this.wasmType = "ADVANCE";
14
- this.blinkIdVariant = DeviceHelpers.isDesktop() ? "full" : "lightweight";
14
+ this.blinkIdVariant = "lightweight";
15
15
  this.recognizers = ['BlinkIdMultiSideRecognizer'];
16
16
  this.recognizerOptions = {
17
17
  BlinkIdMultiSideRecognizer: {
@@ -24,11 +24,7 @@ export class DocumentDetector {
24
24
  leftFactor: 0.1,
25
25
  rightFactor: 0.1
26
26
  },
27
- fullDocumentImageDpi: 300,
28
- enableBlurFilter: false,
29
- enableGlareFilter: false,
30
- blurStrictnessLevel: 2,
31
- glareStrictnessLevel: 2
27
+ fullDocumentImageDpi: 300
32
28
  }
33
29
  };
34
30
  this.recognitionPauseTimeout = 3800;
@@ -104,8 +100,17 @@ export class DocumentDetector {
104
100
  this.config = undefined;
105
101
  }
106
102
  configHandler(newConfig) {
107
- if (newConfig && newConfig.key) {
103
+ if (newConfig) {
108
104
  this.licenseKey = newConfig.key;
105
+ this.blinkIdVariant = newConfig.dynamicMode ? (DeviceHelpers.isDesktop() ? "full" : "lightweight") : "lightweight";
106
+ if (newConfig.strictMode === false) {
107
+ this.recognizerOptions.BlinkIdMultiSideRecognizer.blurStrictnessLevel = 2;
108
+ this.recognizerOptions.BlinkIdMultiSideRecognizer.glareStrictnessLevel = 2;
109
+ }
110
+ else {
111
+ this.recognizerOptions.BlinkIdMultiSideRecognizer.blurStrictnessLevel = 1;
112
+ this.recognizerOptions.BlinkIdMultiSideRecognizer.glareStrictnessLevel = 1;
113
+ }
109
114
  }
110
115
  }
111
116
  async setUiState(state) {
@@ -211,8 +216,8 @@ export class DocumentDetector {
211
216
  "type": "unknown",
212
217
  "mutable": true,
213
218
  "complexType": {
214
- "original": "{\n key: string;\n }",
215
- "resolved": "{ key: string; }",
219
+ "original": "{\n key: string;\n dynamicMode: boolean;\n strictMode: boolean;\n }",
220
+ "resolved": "{ key: string; dynamicMode: boolean; strictMode: boolean; }",
216
221
  "references": {}
217
222
  },
218
223
  "required": false,
@@ -33,5 +33,5 @@ export async function checkMandatoryCapabilites() {
33
33
  * Determine whether this is a desktop device based on the screen resolution.
34
34
  */
35
35
  export function isDesktop() {
36
- return !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
36
+ return !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|Tablet/i.test(navigator.userAgent);
37
37
  }
@@ -6061,7 +6061,7 @@ async function checkMandatoryCapabilites() {
6061
6061
  * Determine whether this is a desktop device based on the screen resolution.
6062
6062
  */
6063
6063
  function isDesktop() {
6064
- return !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
6064
+ return !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|Tablet/i.test(navigator.userAgent);
6065
6065
  }
6066
6066
 
6067
6067
  var StatusDocumentDetector;
@@ -6092,7 +6092,7 @@ const DocumentDetector = class {
6092
6092
  this.engineLocation = "https://storage.googleapis.com/jaak-storage/models/web/document-detector/v2.0.0";
6093
6093
  this.workerLocation = "https://storage.googleapis.com/jaak-storage/models/web/document-detector/v2.0.0/BlinkIDWasmSDK.worker.min.js";
6094
6094
  this.wasmType = "ADVANCE";
6095
- this.blinkIdVariant = isDesktop() ? "full" : "lightweight";
6095
+ this.blinkIdVariant = "lightweight";
6096
6096
  this.recognizers = ['BlinkIdMultiSideRecognizer'];
6097
6097
  this.recognizerOptions = {
6098
6098
  BlinkIdMultiSideRecognizer: {
@@ -6105,11 +6105,7 @@ const DocumentDetector = class {
6105
6105
  leftFactor: 0.1,
6106
6106
  rightFactor: 0.1
6107
6107
  },
6108
- fullDocumentImageDpi: 300,
6109
- enableBlurFilter: false,
6110
- enableGlareFilter: false,
6111
- blurStrictnessLevel: 2,
6112
- glareStrictnessLevel: 2
6108
+ fullDocumentImageDpi: 300
6113
6109
  }
6114
6110
  };
6115
6111
  this.recognitionPauseTimeout = 3800;
@@ -6185,8 +6181,17 @@ const DocumentDetector = class {
6185
6181
  this.config = undefined;
6186
6182
  }
6187
6183
  configHandler(newConfig) {
6188
- if (newConfig && newConfig.key) {
6184
+ if (newConfig) {
6189
6185
  this.licenseKey = newConfig.key;
6186
+ this.blinkIdVariant = newConfig.dynamicMode ? (isDesktop() ? "full" : "lightweight") : "lightweight";
6187
+ if (newConfig.strictMode === false) {
6188
+ this.recognizerOptions.BlinkIdMultiSideRecognizer.blurStrictnessLevel = 2;
6189
+ this.recognizerOptions.BlinkIdMultiSideRecognizer.glareStrictnessLevel = 2;
6190
+ }
6191
+ else {
6192
+ this.recognizerOptions.BlinkIdMultiSideRecognizer.blurStrictnessLevel = 1;
6193
+ this.recognizerOptions.BlinkIdMultiSideRecognizer.glareStrictnessLevel = 1;
6194
+ }
6190
6195
  }
6191
6196
  }
6192
6197
  async setUiState(state) {