bry-biometric-collector 2.0.5 → 2.0.6

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/README.md CHANGED
@@ -61,7 +61,7 @@ Currently supported tag parameters:
61
61
  Example: `video_dimensions="800x500"`
62
62
 
63
63
  - **collector_select**: The collectors that should be rendered. Possible values are `"BOTH", "FINGERS",
64
- "FACE"`. When using only one, the tabs are hidden.
64
+ "FACE", "DOCUMENT"`. When using only one, the tabs are hidden.
65
65
 
66
66
  Default: `"BOTH"`
67
67
 
@@ -91,23 +91,48 @@ Currently supported tag parameters:
91
91
 
92
92
  Example: `hide_tabs=false`
93
93
 
94
- - **import_bry_web_collector_script**: Wether to import the script used by the default web collector extension.
94
+ - **import_extension_script**: Wether to import the personalized extension script.
95
95
 
96
96
  Default: `true`
97
97
 
98
- Example: `import_bry_web_collector_script=false`
98
+ Example: `import_extension_script=false`
99
99
 
100
100
  - **liveness_enable**: Wether to enable liveness verification in the facial capture process. If enabled, the liveness check enpoint also has to be set.
101
101
 
102
102
  Default: `false`
103
103
 
104
- Example: `import_bry_web_collector_script=false`
104
+ Example: `liveness_enable=false`
105
105
 
106
106
  - **extension_url_chrome**: The url provided to the user when the component detects the extension isn't installed in a chrome environment.
107
107
 
108
+ Default: `https://chrome.google.com/webstore/detail/assinatura-digital-no-nav/mbpaklahifpfndjiefdfjhmkefppocfm`
109
+
110
+ Example: `extension_url_chrome="https://chrome.google.com/webstore/detail/minha-extensao/"`
108
111
 
109
112
  - **extension_url_mozilla**: The url provided to the user when the component detects the extension isn't installed in a mozilla environment.
110
113
 
114
+ Default: `https://addons.mozilla.org/pt-BR/firefox/addon/assinatura-digital-navegador/`
115
+
116
+ Example: `extension_url_mozilla="https://addons.mozilla.org/pt-BR/firefox/addon/minha-extensao/"`
117
+
118
+ - **extension_url_script**: The url provided import extension script.
119
+
120
+ Default: `https://www.bry.com.br/downloads/extension/v2/api/v1/extension-api.js`
121
+
122
+ Example: `extension_url_mozilla="https://www.bry.com.br/downloads/extension/v2/api/v1/extension-api.js"`
123
+
124
+ - **show_capture_button**: Wether to hide capture button. If you enable a button to trigger manual capture, it will be shown below the video.
125
+
126
+ Default: `true`
127
+
128
+ Example: `show_capture_button=false`
129
+
130
+ - **show_unconformities**: Wether to hide unconformities and capture preview. If enabled, a preview of the photo will be shown along with possible nonconformities.
131
+
132
+ Default: `true`
133
+
134
+ Example: `show_unconformities=false`
135
+
111
136
  ### **Run-time Configuration**
112
137
 
113
138
  #### **Functions**
@@ -222,8 +247,6 @@ The Web-component exports a series of functions that the host environment may ca
222
247
  }
223
248
  ```
224
249
 
225
- - **setRejectOnFailLiveness**: Sets wether to reject a picture based on liveness check failure (either capture or facial liveness).
226
-
227
250
  - **getFingers**: synchronously get just the fingers.
228
251
 
229
252
  - **getJustification**: Get the picture justification the user typed in.
@@ -463,6 +486,14 @@ The web component listens to and emits a few events. The events emitted are:
463
486
 
464
487
  - **finger-cleared**: If notifyFingersClearedStore is enabled, when the clearbtn is pressed, the fingers' current state are exported..
465
488
 
489
+ - **document-scrapped**: When the user scraps their document photo (by clicking capture again after having saved their picture) this event gets emitted without any data.
490
+
491
+ - **export-document**: When the user saves their document photo (by clicking finish), an event of this kind is emitted with their picture like so:
492
+
493
+ ```ts
494
+ {detail: {bodyPart: 'DOCUMENT', data: string, justification: string}}
495
+ ```
496
+
466
497
  And the events the webcomponent listens to are:
467
498
 
468
499
  - **change-tabs**: When received, the web component switches the currently displaying tab. This is useful when you want an outer tab switching mechanism. The event must contain the tab to switch to which must be either 'Face' or 'Fingers', for example:
@@ -0,0 +1,319 @@
1
+ import { aH as N, S as U, r as Z, t as V, w as y, x as a, y as L, B as w, H as k, I as f, Q as o, T as B, aT as C, aU as D, aM as R, D as d, aV as E, J as h, aD as O, aW as M } from "./main_baf553c3_2.0.6.js";
2
+ var A = /* @__PURE__ */ ((r) => (r.OK = "OK", r.DEVICE_NOT_FOUND_ERROR = "DEVICE_NOT_FOUND_ERROR", r.CAMERA_DENIED_ERROR = "CAMERA_DENIED_ERROR", r.CAMERA_IN_USE_ERROR = "CAMERA_IN_USE_ERROR", r.CAMERA_CLOSED_ERROR = "CAMERA_CLOSED_ERROR", r.CAMERA_UNSUPPORTED = "CAMERA_UNSUPPORTED", r))(A || {});
3
+ const S = N(
4
+ "OK"
5
+ /* OK */
6
+ );
7
+ function g(r) {
8
+ let e, c, m, l, u, i, x, n, p, v, b = [
9
+ { class: "text-[8em] mx-auto" },
10
+ { xmlns: "http://www.w3.org/2000/svg" },
11
+ { width: "1em" },
12
+ { height: "1em" },
13
+ { viewBox: "0 0 256 256" },
14
+ /*$$props*/
15
+ r[2]
16
+ ], _ = {};
17
+ for (let t = 0; t < b.length; t += 1)
18
+ _ = C(_, b[t]);
19
+ return {
20
+ c() {
21
+ e = R("svg"), c = R("path"), m = d(), l = w("span"), l.textContent = "A câmera não atende os requisitos necessários.", u = d(), i = w("span"), i.textContent = "Por favor, conecte outra câmera e tente novamente.", x = d(), n = w("button"), n.textContent = "Reiniciar", f(c, "fill", "currentColor"), f(c, "d", "M249.45 69.31a12 12 0 0 0-12.51 1L212 88.43V72a20 20 0 0 0-20-20h-68.12a12 12 0 0 0 0 24H188v68a12 12 0 0 0 4.46 9.33c.15.13.31.25.48.38l44 32A12 12 0 0 0 256 176V80a12 12 0 0 0-6.55-10.69M232 152.43l-20-14.54v-19.78l20-14.54ZM56.88 31.93a12 12 0 1 0-17.76 16.14L42.69 52H32a20 20 0 0 0-20 20v112a20 20 0 0 0 20 20h148.87l18.25 20.07a12 12 0 0 0 17.76-16.14ZM36 180V76h28.51l94.55 104Z"), E(e, _), f(l, "class", "text-xl font-bold text-center"), f(i, "class", "m-auto text-base block text-center"), f(n, "class", "z-20 ce-dui-btn ce-dui-btn-outline ce-dui-btn-primary m-auto");
22
+ },
23
+ m(t, s) {
24
+ a(t, e, s), h(e, c), a(t, m, s), a(t, l, s), a(t, u, s), a(t, i, s), a(t, x, s), a(t, n, s), p || (v = O(
25
+ n,
26
+ "click",
27
+ /*click_handler_4*/
28
+ r[7]
29
+ ), p = !0);
30
+ },
31
+ p(t, s) {
32
+ E(e, _ = M(b, [
33
+ { class: "text-[8em] mx-auto" },
34
+ { xmlns: "http://www.w3.org/2000/svg" },
35
+ { width: "1em" },
36
+ { height: "1em" },
37
+ { viewBox: "0 0 256 256" },
38
+ s & /*$$props*/
39
+ 4 && /*$$props*/
40
+ t[2]
41
+ ]));
42
+ },
43
+ d(t) {
44
+ t && o(e), t && o(m), t && o(l), t && o(u), t && o(i), t && o(x), t && o(n), p = !1, v();
45
+ }
46
+ };
47
+ }
48
+ function I(r) {
49
+ let e, c, m, l, u, i, x, n, p, v, b = [
50
+ { class: "text-[8em] mx-auto" },
51
+ { xmlns: "http://www.w3.org/2000/svg" },
52
+ { width: "1em" },
53
+ { height: "1em" },
54
+ { viewBox: "0 0 256 256" },
55
+ /*$$props*/
56
+ r[2]
57
+ ], _ = {};
58
+ for (let t = 0; t < b.length; t += 1)
59
+ _ = C(_, b[t]);
60
+ return {
61
+ c() {
62
+ e = R("svg"), c = R("path"), m = d(), l = w("span"), l.textContent = "Por favor, permaneça na mesma aba durante a coleta biométrica.", u = d(), i = w("span"), i.textContent = "Clique no botão Reiniciar para capturar novamente.", x = d(), n = w("button"), n.textContent = "Reiniciar", f(c, "fill", "currentColor"), f(c, "d", "M236.8 188.09L149.35 36.22a24.76 24.76 0 0 0-42.7 0L19.2 188.09a23.51 23.51 0 0 0 0 23.72A24.35 24.35 0 0 0 40.55 224h174.9a24.35 24.35 0 0 0 21.33-12.19a23.51 23.51 0 0 0 .02-23.72m-13.87 15.71a8.5 8.5 0 0 1-7.48 4.2H40.55a8.5 8.5 0 0 1-7.48-4.2a7.59 7.59 0 0 1 0-7.72l87.45-151.87a8.75 8.75 0 0 1 15 0l87.45 151.87a7.59 7.59 0 0 1-.04 7.72M120 144v-40a8 8 0 0 1 16 0v40a8 8 0 0 1-16 0m20 36a12 12 0 1 1-12-12a12 12 0 0 1 12 12"), E(e, _), f(l, "class", "text-xl font-bold text-center"), f(i, "class", "m-auto text-base block text-center"), f(n, "class", "z-20 ce-dui-btn ce-dui-btn-outline ce-dui-btn-primary m-auto");
63
+ },
64
+ m(t, s) {
65
+ a(t, e, s), h(e, c), a(t, m, s), a(t, l, s), a(t, u, s), a(t, i, s), a(t, x, s), a(t, n, s), p || (v = O(
66
+ n,
67
+ "click",
68
+ /*click_handler_3*/
69
+ r[6]
70
+ ), p = !0);
71
+ },
72
+ p(t, s) {
73
+ E(e, _ = M(b, [
74
+ { class: "text-[8em] mx-auto" },
75
+ { xmlns: "http://www.w3.org/2000/svg" },
76
+ { width: "1em" },
77
+ { height: "1em" },
78
+ { viewBox: "0 0 256 256" },
79
+ s & /*$$props*/
80
+ 4 && /*$$props*/
81
+ t[2]
82
+ ]));
83
+ },
84
+ d(t) {
85
+ t && o(e), t && o(m), t && o(l), t && o(u), t && o(i), t && o(x), t && o(n), p = !1, v();
86
+ }
87
+ };
88
+ }
89
+ function P(r) {
90
+ let e, c, m, l, u, i, x, n, p, v, b = [
91
+ { class: "text-[8em] mx-auto" },
92
+ { xmlns: "http://www.w3.org/2000/svg" },
93
+ { width: "1em" },
94
+ { height: "1em" },
95
+ { viewBox: "0 0 256 256" },
96
+ /*$$props*/
97
+ r[2]
98
+ ], _ = {};
99
+ for (let t = 0; t < b.length; t += 1)
100
+ _ = C(_, b[t]);
101
+ return {
102
+ c() {
103
+ e = R("svg"), c = R("path"), m = d(), l = w("span"), l.textContent = "A câmera está em uso.", u = d(), i = w("span"), i.textContent = "Certifique-se de que a câmera não está sendo utilizada por nenhuma outra aplicação e clique no botão abaixo.", x = d(), n = w("button"), n.textContent = "Reiniciar", f(c, "fill", "currentColor"), f(c, "d", "M56.88 31.93a12 12 0 1 0-17.76 16.14l4 4.37A28 28 0 0 0 20 80v112a28 28 0 0 0 28 28h147.42l3.7 4.07a12 12 0 0 0 17.76-16.14Zm49.35 90L136 154.64a24 24 0 0 1-29.77-32.75ZM48 196a4 4 0 0 1-4-4V80a4 4 0 0 1 4-4h16.51l24.92 27.41a48 48 0 0 0 63.34 69.67L173.6 196ZM236 80v94.14a12 12 0 0 1-24 0V80a4 4 0 0 0-4-4h-32a12 12 0 0 1-10-5.34L153.57 52h-51.51a12 12 0 0 1 0-24H160a12 12 0 0 1 10 5.34L182.42 52H208a28 28 0 0 1 28 28"), E(e, _), f(l, "class", "text-xl font-bold text-center"), f(i, "class", "m-auto text-base block text-center"), f(n, "class", "z-20 ce-dui-btn ce-dui-btn-outline ce-dui-btn-primary m-auto");
104
+ },
105
+ m(t, s) {
106
+ a(t, e, s), h(e, c), a(t, m, s), a(t, l, s), a(t, u, s), a(t, i, s), a(t, x, s), a(t, n, s), p || (v = O(
107
+ n,
108
+ "click",
109
+ /*click_handler_2*/
110
+ r[5]
111
+ ), p = !0);
112
+ },
113
+ p(t, s) {
114
+ E(e, _ = M(b, [
115
+ { class: "text-[8em] mx-auto" },
116
+ { xmlns: "http://www.w3.org/2000/svg" },
117
+ { width: "1em" },
118
+ { height: "1em" },
119
+ { viewBox: "0 0 256 256" },
120
+ s & /*$$props*/
121
+ 4 && /*$$props*/
122
+ t[2]
123
+ ]));
124
+ },
125
+ d(t) {
126
+ t && o(e), t && o(m), t && o(l), t && o(u), t && o(i), t && o(x), t && o(n), p = !1, v();
127
+ }
128
+ };
129
+ }
130
+ function H(r) {
131
+ let e, c, m, l, u, i, x, n, p, v, b = [
132
+ { class: "text-[8em] mx-auto" },
133
+ { xmlns: "http://www.w3.org/2000/svg" },
134
+ { width: "1em" },
135
+ { height: "1em" },
136
+ { viewBox: "0 0 256 256" },
137
+ /*$$props*/
138
+ r[2]
139
+ ], _ = {};
140
+ for (let t = 0; t < b.length; t += 1)
141
+ _ = C(_, b[t]);
142
+ return {
143
+ c() {
144
+ e = R("svg"), c = R("path"), m = d(), l = w("span"), l.textContent = "A câmera não foi detectada.", u = d(), i = w("span"), i.textContent = "Por favor, conecte a sua câmera, espere alguns instantes e clique no botão Reiniciar.", x = d(), n = w("button"), n.textContent = "Reiniciar", f(c, "fill", "currentColor"), f(c, "d", "m137 168l11.52-11.51a12 12 0 0 0-17-17L120 151l-15-15l11.52-11.51a12 12 0 0 0-17-17L88 119l-15.51-15.49a12 12 0 0 0-17 17L59 124l-20.46 20.49a36 36 0 0 0 0 50.91l2.55 2.54l-25.58 25.57a12 12 0 0 0 17 17l25.57-25.58l2.54 2.55a36.06 36.06 0 0 0 50.91 0L132 197l3.51 3.52a12 12 0 0 0 17-17Zm-42.46 32.49a12 12 0 0 1-17 0l-22.03-22.06a12 12 0 0 1 0-17L76 141l39 39Zm146-185a12 12 0 0 0-17 0l-25.6 25.6l-2.54-2.55a36.05 36.05 0 0 0-50.91 0L124 59l-3.51-3.52a12 12 0 0 0-17 17l80 80a12 12 0 0 0 17-17L197 132l20.49-20.49a36 36 0 0 0 0-50.91l-2.55-2.54l25.58-25.57a12 12 0 0 0-.03-16.98Zm-40 79L180 115l-39-39l20.49-20.49a12 12 0 0 1 17 0l22.06 22.06a12 12 0 0 1 0 17Z"), E(e, _), f(l, "class", "text-xl font-bold text-center"), f(i, "class", "m-auto text-base block text-center"), f(n, "class", "z-20 ce-dui-btn ce-dui-btn-outline ce-dui-btn-primary m-auto");
145
+ },
146
+ m(t, s) {
147
+ a(t, e, s), h(e, c), a(t, m, s), a(t, l, s), a(t, u, s), a(t, i, s), a(t, x, s), a(t, n, s), p || (v = O(
148
+ n,
149
+ "click",
150
+ /*click_handler_1*/
151
+ r[4]
152
+ ), p = !0);
153
+ },
154
+ p(t, s) {
155
+ E(e, _ = M(b, [
156
+ { class: "text-[8em] mx-auto" },
157
+ { xmlns: "http://www.w3.org/2000/svg" },
158
+ { width: "1em" },
159
+ { height: "1em" },
160
+ { viewBox: "0 0 256 256" },
161
+ s & /*$$props*/
162
+ 4 && /*$$props*/
163
+ t[2]
164
+ ]));
165
+ },
166
+ d(t) {
167
+ t && o(e), t && o(m), t && o(l), t && o(u), t && o(i), t && o(x), t && o(n), p = !1, v();
168
+ }
169
+ };
170
+ }
171
+ function q(r) {
172
+ let e, c, m, l, u, i, x, n, p, v, b = [
173
+ { class: "text-[8em] mx-auto" },
174
+ { xmlns: "http://www.w3.org/2000/svg" },
175
+ { width: "1em" },
176
+ { height: "1em" },
177
+ { viewBox: "0 0 256 256" },
178
+ /*$$props*/
179
+ r[2]
180
+ ], _ = {};
181
+ for (let t = 0; t < b.length; t += 1)
182
+ _ = C(_, b[t]);
183
+ return {
184
+ c() {
185
+ e = R("svg"), c = R("path"), m = d(), l = w("span"), l.textContent = "Por favor, conceda permissão de acesso à câmera.", u = d(), i = w("span"), i.textContent = "Após conceder a permissão, clique no botão Reiniciar.", x = d(), n = w("button"), n.textContent = "Reiniciar", f(c, "fill", "currentColor"), f(c, "d", "M249.45 69.31a12 12 0 0 0-12.51 1L212 88.43V72a20 20 0 0 0-20-20h-68.12a12 12 0 0 0 0 24H188v68a12 12 0 0 0 4.46 9.33c.15.13.31.25.48.38l44 32A12 12 0 0 0 256 176V80a12 12 0 0 0-6.55-10.69M232 152.43l-20-14.54v-19.78l20-14.54ZM56.88 31.93a12 12 0 1 0-17.76 16.14L42.69 52H32a20 20 0 0 0-20 20v112a20 20 0 0 0 20 20h148.87l18.25 20.07a12 12 0 0 0 17.76-16.14ZM36 180V76h28.51l94.55 104Z"), E(e, _), f(l, "class", "text-xl font-bold text-center"), f(i, "class", "m-auto text-base block text-center"), f(n, "class", "z-20 ce-dui-btn ce-dui-btn-outline ce-dui-btn-primary m-auto");
186
+ },
187
+ m(t, s) {
188
+ a(t, e, s), h(e, c), a(t, m, s), a(t, l, s), a(t, u, s), a(t, i, s), a(t, x, s), a(t, n, s), p || (v = O(
189
+ n,
190
+ "click",
191
+ /*click_handler*/
192
+ r[3]
193
+ ), p = !0);
194
+ },
195
+ p(t, s) {
196
+ E(e, _ = M(b, [
197
+ { class: "text-[8em] mx-auto" },
198
+ { xmlns: "http://www.w3.org/2000/svg" },
199
+ { width: "1em" },
200
+ { height: "1em" },
201
+ { viewBox: "0 0 256 256" },
202
+ s & /*$$props*/
203
+ 4 && /*$$props*/
204
+ t[2]
205
+ ]));
206
+ },
207
+ d(t) {
208
+ t && o(e), t && o(m), t && o(l), t && o(u), t && o(i), t && o(x), t && o(n), p = !1, v();
209
+ }
210
+ };
211
+ }
212
+ function T(r) {
213
+ let e;
214
+ function c(u, i) {
215
+ if (
216
+ /*$cameraStatusStore*/
217
+ u[1] === A.CAMERA_DENIED_ERROR
218
+ )
219
+ return q;
220
+ if (
221
+ /*$cameraStatusStore*/
222
+ u[1] === A.DEVICE_NOT_FOUND_ERROR
223
+ )
224
+ return H;
225
+ if (
226
+ /*$cameraStatusStore*/
227
+ u[1] === A.CAMERA_IN_USE_ERROR
228
+ )
229
+ return P;
230
+ if (
231
+ /*$cameraStatusStore*/
232
+ u[1] === A.CAMERA_CLOSED_ERROR
233
+ )
234
+ return I;
235
+ if (
236
+ /*$cameraStatusStore*/
237
+ u[1] === A.CAMERA_UNSUPPORTED
238
+ )
239
+ return g;
240
+ }
241
+ let m = c(r), l = m && m(r);
242
+ return {
243
+ c() {
244
+ e = w("div"), l && l.c(), this.c = k, f(e, "class", "flex flex-col gap-4 justify-center absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible text-nowrap");
245
+ },
246
+ m(u, i) {
247
+ a(u, e, i), l && l.m(e, null);
248
+ },
249
+ p(u, [i]) {
250
+ m === (m = c(u)) && l ? l.p(u, i) : (l && l.d(1), l = m && m(u), l && (l.c(), l.m(e, null)));
251
+ },
252
+ i: k,
253
+ o: k,
254
+ d(u) {
255
+ u && o(e), l && l.d();
256
+ }
257
+ };
258
+ }
259
+ function z(r, e, c) {
260
+ let m;
261
+ B(r, S, (v) => c(1, m = v));
262
+ let { handler: l = () => {
263
+ } } = e;
264
+ const u = () => {
265
+ l(), console.log("canicna", l);
266
+ }, i = () => {
267
+ l(), console.log("canicna", l);
268
+ }, x = () => {
269
+ l(), console.log("canicna", l);
270
+ }, n = () => {
271
+ l();
272
+ }, p = () => {
273
+ l();
274
+ };
275
+ return r.$$set = (v) => {
276
+ c(2, e = C(C({}, e), D(v))), "handler" in v && c(0, l = v.handler);
277
+ }, e = D(e), [
278
+ l,
279
+ m,
280
+ e,
281
+ u,
282
+ i,
283
+ x,
284
+ n,
285
+ p
286
+ ];
287
+ }
288
+ class F extends U {
289
+ constructor(e) {
290
+ super(), Z(
291
+ this,
292
+ {
293
+ target: this.shadowRoot,
294
+ props: y(this.attributes),
295
+ customElement: !0
296
+ },
297
+ z,
298
+ T,
299
+ V,
300
+ { handler: 0 },
301
+ null
302
+ ), e && (e.target && a(e.target, this, e.anchor), e.props && (this.$set(e.props), L()));
303
+ }
304
+ static get observedAttributes() {
305
+ return ["handler"];
306
+ }
307
+ get handler() {
308
+ return this.$$.ctx[0];
309
+ }
310
+ set handler(e) {
311
+ this.$$set({ handler: e }), L();
312
+ }
313
+ }
314
+ customElements.define("camera-status", F);
315
+ export {
316
+ A as C,
317
+ F as a,
318
+ S as c
319
+ };