bry-biometric-collector 3.3.0-RC03 → 3.3.0-RC04

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.
Files changed (22) hide show
  1. package/README.md +8 -3
  2. package/dist/{DocumentCollector_7dff158f_3.3.0-RC03.js → DocumentCollector_defd5e57_3.3.0-RC04.js} +258 -258
  3. package/dist/FaceCollector_16e3c9ed_3.3.0-RC04.js +2392 -0
  4. package/dist/{ValidationAlert_90602fb5_3.3.0-RC03.js → ValidationAlert_722c259d_3.3.0-RC04.js} +122 -122
  5. package/dist/{___vite-browser-external_commonjs-proxy_33bd553f_3.3.0-RC03.js → ___vite-browser-external_commonjs-proxy_c9629267_3.3.0-RC04.js} +1 -1
  6. package/dist/bry-biometric-collector-main.js +2 -2
  7. package/dist/faceApi_8254146e_3.3.0-RC04.js +15 -0
  8. package/dist/{fingersApi_0fe148d9_3.3.0-RC03.js → fingersApi_2e316625_3.3.0-RC04.js} +34 -34
  9. package/dist/index.d.ts +2 -2
  10. package/dist/index.js +2 -2
  11. package/dist/{index_c5f180d9_3.3.0-RC03.js → index_882c2cd7_3.3.0-RC04.js} +3 -3
  12. package/dist/{index_9787e7e2_3.3.0-RC03.js → index_ccdcae61_3.3.0-RC04.js} +3 -3
  13. package/dist/{main_aed227b6_3.3.0-RC03.js → main_adc308db_3.3.0-RC04.js} +6434 -6398
  14. package/package.json +4 -2
  15. package/dist/FaceCollector_e0849e85_3.3.0-RC03.js +0 -2366
  16. package/dist/faceApi_53f06f20_3.3.0-RC03.js +0 -17
  17. /package/dist/{en-us_e83efd5d_3.3.0-RC03.js → en-us_e83efd5d_3.3.0-RC04.js} +0 -0
  18. /package/dist/{es-cl_5939150a_3.3.0-RC03.js → es-cl_5939150a_3.3.0-RC04.js} +0 -0
  19. /package/dist/{face_api_0e3ce8c8_3.3.0-RC03.js → face_api_0e3ce8c8_3.3.0-RC04.js} +0 -0
  20. /package/dist/{index-idlf-detector_39cfdffa_3.3.0-RC03.js → index-idlf-detector_39cfdffa_3.3.0-RC04.js} +0 -0
  21. /package/dist/{index-idlf-detector_a819b3c8_3.3.0-RC03.js → index-idlf-detector_a819b3c8_3.3.0-RC04.js} +0 -0
  22. /package/dist/{pt-br_fae15356_3.3.0-RC03.js → pt-br_fae15356_3.3.0-RC04.js} +0 -0
@@ -0,0 +1,2392 @@
1
+ import { z as Zt, S as gt, B as vt, C as pt, D as wt, E as T, G as N, H as w, I as Y, J as d, K as H, L as Qe, M as G, N as Xe, O as D, P as O, Q as ze, R as Je, T as he, U as h, V as _e, W as be, X as ge, Y as z, Z as B, _ as F, a0 as Yi, $ as Zi, a1 as xi, a2 as Q, a3 as Bs, a4 as qe, a5 as S, a6 as Ge, a7 as $t, a8 as g, a9 as P, aa as jt, ab as it, x as st, y as at, ac as Ws, ad as nt, ae as we, af as Ms, ag as Fe, ah as yi, ai as Kt, aj as ki, ak as Us, al as je, am as ke, an as Vs, ao as zs, ap as Ht, aq as qt, ar as me, as as ae, at as Te, au as Ti, av as ot, aw as Jt, ax as js, ay as lt, az as Oi, aA as Ri, aB as Ks, aC as Hs, aD as qs, aE as Js, f as Di, aF as Qs, aG as Xs, aH as Gs, aI as Qt, aJ as j, m as _t, aK as Xt, aL as Ys, l as oe, aM as Ii, aN as Zs, aO as rt, aP as ct, aQ as Ai, aR as xs, aS as ut, A as Gt, aT as Oe, aU as $s, aV as Ke, aW as ea, aX as Li, e as Se, aY as Yt, aZ as ft, a_ as ta, w as dt, a$ as ia, b0 as sa, b1 as aa, b2 as na, b3 as oa, b4 as la, b5 as He, b6 as ra, b7 as ca, b8 as ht, b9 as fe, ba as Ct, bb as ua, bc as fa, d as Fi, bd as da, be as mt, bf as le, bg as ha, bh as ma, bi as Si, bj as $i, bk as bt, bl as _a } from "./main_adc308db_3.3.0-RC04.js";
2
+ import { W as ba, C as ga, V as va, a as pa } from "./ValidationAlert_722c259d_3.3.0-RC04.js";
3
+ import { detectSingleFace as wa, matchDimensions as Ca, resizeResults as Ea } from "./face_api_0e3ce8c8_3.3.0-RC04.js";
4
+ const xt = Zt(!1);
5
+ class ya {
6
+ isDevToolsOpen = !1;
7
+ detectionCount = 0;
8
+ checkSizeTimeout = null;
9
+ detectionInterval = null;
10
+ detectDevToolsBySize() {
11
+ const e = window.outerWidth - window.innerWidth > 200, t = window.outerHeight - window.innerHeight > 200;
12
+ return e || t;
13
+ }
14
+ checkForDevTools = () => {
15
+ this.detectDevToolsBySize() ? (this.detectionCount++, this.detectionCount >= 2 && !this.isDevToolsOpen && (this.isDevToolsOpen = !0, xt.set(this.isDevToolsOpen))) : (this.detectionCount = 0, this.isDevToolsOpen && (this.isDevToolsOpen = !1, xt.set(this.isDevToolsOpen)));
16
+ };
17
+ startDetection() {
18
+ this.stopDetection(), window.addEventListener("resize", () => {
19
+ this.checkSizeTimeout && clearTimeout(this.checkSizeTimeout), this.checkSizeTimeout = window.setTimeout(this.checkForDevTools, 500);
20
+ }), window.addEventListener("focus", () => setTimeout(this.checkForDevTools, 300)), this.detectionInterval = window.setInterval(this.checkForDevTools, 1e3), this.checkForDevTools();
21
+ }
22
+ stopDetection() {
23
+ this.detectionInterval && (clearInterval(this.detectionInterval), this.detectionInterval = null), this.checkSizeTimeout && (clearTimeout(this.checkSizeTimeout), this.checkSizeTimeout = null);
24
+ }
25
+ }
26
+ function Ni(i) {
27
+ let e, t;
28
+ return e = new ba({}), {
29
+ c() {
30
+ _e(e.$$.fragment);
31
+ },
32
+ m(a, n) {
33
+ be(e, a, n), t = !0;
34
+ },
35
+ i(a) {
36
+ t || (H(e.$$.fragment, a), t = !0);
37
+ },
38
+ o(a) {
39
+ G(e.$$.fragment, a), t = !1;
40
+ },
41
+ d(a) {
42
+ ge(e, a);
43
+ }
44
+ };
45
+ }
46
+ function ka(i) {
47
+ let e, t, a, n = (
48
+ /*showWatermark*/
49
+ i[1] && Ni()
50
+ );
51
+ return {
52
+ c() {
53
+ e = w("div"), n && n.c(), this.c = Y, d(e, "id", "face-oval"), d(e, "class", t = "loader " + /*loading*/
54
+ (i[0] ? "loading" : "") + " z-10"), d(
55
+ e,
56
+ "style",
57
+ /*styleVars*/
58
+ i[2]
59
+ );
60
+ },
61
+ m(r, f) {
62
+ T(r, e, f), n && n.m(e, null), a = !0;
63
+ },
64
+ p(r, [f]) {
65
+ /*showWatermark*/
66
+ r[1] ? n ? f & /*showWatermark*/
67
+ 2 && H(n, 1) : (n = Ni(), n.c(), H(n, 1), n.m(e, null)) : n && (Qe(), G(n, 1, 1, () => {
68
+ n = null;
69
+ }), Xe()), (!a || f & /*loading*/
70
+ 1 && t !== (t = "loader " + /*loading*/
71
+ (r[0] ? "loading" : "") + " z-10")) && d(e, "class", t), (!a || f & /*styleVars*/
72
+ 4) && d(
73
+ e,
74
+ "style",
75
+ /*styleVars*/
76
+ r[2]
77
+ );
78
+ },
79
+ i(r) {
80
+ a || (H(n), a = !0);
81
+ },
82
+ o(r) {
83
+ G(n), a = !1;
84
+ },
85
+ d(r) {
86
+ r && D(e), n && n.d();
87
+ }
88
+ };
89
+ }
90
+ const Ta = "hsl(var(--p))", Oa = "hsl(var(--su))";
91
+ function Ra(i, e, t) {
92
+ let a, n, r;
93
+ O(i, ze, (b) => t(8, n = b)), O(i, Je, (b) => t(9, r = b));
94
+ let { loading: f } = e, { showWatermark: l } = e, o, c, u = 0.8, m = 8, _ = 0.15;
95
+ return he() && (u = 0.65, m = 10, _ = 0.25), i.$$set = (b) => {
96
+ "loading" in b && t(0, f = b.loading), "showWatermark" in b && t(1, l = b.showWatermark);
97
+ }, i.$$.update = () => {
98
+ if (i.$$.dirty & /*$videoStore, percentage, ovalHeight, ovalWidth, $ovalDimensions, captureBarPercentage*/
99
+ 952 && r) {
100
+ t(4, c = r.videoHeight * u), t(3, o = c / 1.45), h(ze, n.width = o, n), h(ze, n.height = c, n), h(ze, n.x = (r.videoWidth - n.width) / 2, n);
101
+ let b = r.videoHeight - r.videoHeight * _;
102
+ h(ze, n.y = b - n.height, n);
103
+ }
104
+ i.$$.dirty & /*ovalWidth, ovalHeight, borderWidth*/
105
+ 88 && t(2, a = `
106
+ --oval-width: ${o}px;
107
+ --oval-height: ${c}px;
108
+ --border-color: ${Ta};
109
+ --border-color-animation: ${Oa};
110
+ --oval-border: ${m}px;
111
+ `);
112
+ }, [
113
+ f,
114
+ l,
115
+ a,
116
+ o,
117
+ c,
118
+ u,
119
+ m,
120
+ _,
121
+ n,
122
+ r
123
+ ];
124
+ }
125
+ class es extends gt {
126
+ constructor(e) {
127
+ super(), vt(
128
+ this,
129
+ {
130
+ target: this.shadowRoot,
131
+ props: wt(this.attributes),
132
+ customElement: !0
133
+ },
134
+ Ra,
135
+ ka,
136
+ pt,
137
+ { loading: 0, showWatermark: 1 },
138
+ null
139
+ ), e && (e.target && T(e.target, this, e.anchor), e.props && (this.$set(e.props), N()));
140
+ }
141
+ static get observedAttributes() {
142
+ return ["loading", "showWatermark"];
143
+ }
144
+ get loading() {
145
+ return this.$$.ctx[0];
146
+ }
147
+ set loading(e) {
148
+ this.$$set({ loading: e }), N();
149
+ }
150
+ get showWatermark() {
151
+ return this.$$.ctx[1];
152
+ }
153
+ set showWatermark(e) {
154
+ this.$$set({ showWatermark: e }), N();
155
+ }
156
+ }
157
+ customElements.define("face-oval", es);
158
+ function Da(i) {
159
+ let e;
160
+ return {
161
+ c() {
162
+ e = w("div"), this.c = Y, d(e, "class", "video-overlay z-0"), d(
163
+ e,
164
+ "style",
165
+ /*styleVars*/
166
+ i[0]
167
+ );
168
+ },
169
+ m(t, a) {
170
+ T(t, e, a);
171
+ },
172
+ p(t, [a]) {
173
+ a & /*styleVars*/
174
+ 1 && d(
175
+ e,
176
+ "style",
177
+ /*styleVars*/
178
+ t[0]
179
+ );
180
+ },
181
+ i: Y,
182
+ o: Y,
183
+ d(t) {
184
+ t && D(e);
185
+ }
186
+ };
187
+ }
188
+ function Ia(i, e, t) {
189
+ let a, n;
190
+ O(i, Je, (u) => t(6, n = u));
191
+ let r, f, l = 0.8, { overlayColor: o } = e, { overlayTransparency: c } = e;
192
+ return he() && (l = 0.65), i.$$set = (u) => {
193
+ "overlayColor" in u && t(1, o = u.overlayColor), "overlayTransparency" in u && t(2, c = u.overlayTransparency);
194
+ }, i.$$.update = () => {
195
+ i.$$.dirty & /*$videoStore, percentage, ovalHeight*/
196
+ 112 && n && (t(4, f = n.videoHeight * l), t(3, r = f / 1.45)), i.$$.dirty & /*ovalWidth, ovalHeight, overlayColor, overlayTransparency*/
197
+ 30 && t(0, a = `
198
+ --oval-width: ${r}px;
199
+ --oval-height: ${f}px;
200
+ --overlay-color: ${o};
201
+ --overlay-transparency: ${c};
202
+ `);
203
+ }, [
204
+ a,
205
+ o,
206
+ c,
207
+ r,
208
+ f,
209
+ l,
210
+ n
211
+ ];
212
+ }
213
+ class ts extends gt {
214
+ constructor(e) {
215
+ super(), vt(
216
+ this,
217
+ {
218
+ target: this.shadowRoot,
219
+ props: wt(this.attributes),
220
+ customElement: !0
221
+ },
222
+ Ia,
223
+ Da,
224
+ pt,
225
+ { overlayColor: 1, overlayTransparency: 2 },
226
+ null
227
+ ), e && (e.target && T(e.target, this, e.anchor), e.props && (this.$set(e.props), N()));
228
+ }
229
+ static get observedAttributes() {
230
+ return ["overlayColor", "overlayTransparency"];
231
+ }
232
+ get overlayColor() {
233
+ return this.$$.ctx[1];
234
+ }
235
+ set overlayColor(e) {
236
+ this.$$set({ overlayColor: e }), N();
237
+ }
238
+ get overlayTransparency() {
239
+ return this.$$.ctx[2];
240
+ }
241
+ set overlayTransparency(e) {
242
+ this.$$set({ overlayTransparency: e }), N();
243
+ }
244
+ }
245
+ customElements.define("overlay-oval", ts);
246
+ function Pi(i) {
247
+ let e, t, a, n, r, f, l = (
248
+ /*$_*/
249
+ i[2]("faceCollector.obtainingPicture") + ""
250
+ ), o;
251
+ return {
252
+ c() {
253
+ e = w("slot"), t = w("div"), a = w("img"), r = F(), f = w("span"), o = S(l), Ge(a.src, n = $t) || d(a, "src", n), d(a, "alt", "loading gif"), d(a, "class", "m-auto h-[10em] lg:h-[12em]"), d(f, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center"), d(t, "class", "translate-y-1/3 md:translate-y-1/4 xl:translate-y-1/2"), d(e, "name", "loading-camera-gif"), d(e, "class", "block h-[17em] lg:h-[21.6em] xl:h-[30em]");
254
+ },
255
+ m(c, u) {
256
+ T(c, e, u), g(e, t), g(t, a), g(t, r), g(t, f), g(f, o);
257
+ },
258
+ p(c, u) {
259
+ u & /*$_*/
260
+ 4 && l !== (l = /*$_*/
261
+ c[2]("faceCollector.obtainingPicture") + "") && P(o, l);
262
+ },
263
+ d(c) {
264
+ c && D(e);
265
+ }
266
+ };
267
+ }
268
+ function Bi(i) {
269
+ let e, t, a, n, r, f;
270
+ function l(u, m) {
271
+ return (
272
+ /*$isLoading*/
273
+ u[5] ? La : Aa
274
+ );
275
+ }
276
+ let o = l(i), c = o(i);
277
+ return {
278
+ c() {
279
+ e = w("div"), t = w("slot"), a = w("div"), n = w("img"), f = F(), c.c(), Ge(n.src, r = $t) || d(n, "src", r), d(n, "alt", "loading gif"), d(n, "class", "m-auto h-[10em] lg:h-[12em]"), d(a, "class", "translate-y-1/3 md:translate-y-1/4 xl:translate-y-1/2"), d(t, "name", "loading-camera-gif"), d(t, "class", "block h-[17em] lg:h-[21.6em] xl:h-[30em]"), d(e, "class", "bg-white absolute inset-0 z-10 flex items-center justify-center");
280
+ },
281
+ m(u, m) {
282
+ T(u, e, m), g(e, t), g(t, a), g(a, n), g(a, f), c.m(a, null);
283
+ },
284
+ p(u, m) {
285
+ o === (o = l(u)) && c ? c.p(u, m) : (c.d(1), c = o(u), c && (c.c(), c.m(a, null)));
286
+ },
287
+ d(u) {
288
+ u && D(e), c.d();
289
+ }
290
+ };
291
+ }
292
+ function Aa(i) {
293
+ let e, t = (
294
+ /*$_*/
295
+ i[2]("faceCollector.obtainingPicture") + ""
296
+ ), a;
297
+ return {
298
+ c() {
299
+ e = w("span"), a = S(t), d(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
300
+ },
301
+ m(n, r) {
302
+ T(n, e, r), g(e, a);
303
+ },
304
+ p(n, r) {
305
+ r & /*$_*/
306
+ 4 && t !== (t = /*$_*/
307
+ n[2]("faceCollector.obtainingPicture") + "") && P(a, t);
308
+ },
309
+ d(n) {
310
+ n && D(e);
311
+ }
312
+ };
313
+ }
314
+ function La(i) {
315
+ let e;
316
+ return {
317
+ c() {
318
+ e = w("span"), e.textContent = "Obtaining photo...", d(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
319
+ },
320
+ m(t, a) {
321
+ T(t, e, a);
322
+ },
323
+ p: Y,
324
+ d(t) {
325
+ t && D(e);
326
+ }
327
+ };
328
+ }
329
+ function Wi(i) {
330
+ let e, t, a, n, r;
331
+ function f(c, u) {
332
+ return (
333
+ /*$isLoading*/
334
+ c[5] ? Sa : Fa
335
+ );
336
+ }
337
+ let l = f(i), o = l(i);
338
+ return {
339
+ c() {
340
+ e = w("slot"), t = w("div"), a = w("img"), r = F(), o.c(), Ge(a.src, n = $t) || d(a, "src", n), d(a, "alt", "loading gif"), d(a, "class", "m-auto h-[10em] lg:h-[12em]"), d(t, "class", "translate-y-1/3 md:translate-y-1/4 xl:translate-y-1/2"), d(e, "name", "loading-camera-gif"), d(e, "class", "block h-[17em] lg:h-[21.6em] xl:h-[30em]");
341
+ },
342
+ m(c, u) {
343
+ T(c, e, u), g(e, t), g(t, a), g(t, r), o.m(t, null);
344
+ },
345
+ p(c, u) {
346
+ l === (l = f(c)) && o ? o.p(c, u) : (o.d(1), o = l(c), o && (o.c(), o.m(t, null)));
347
+ },
348
+ d(c) {
349
+ c && D(e), o.d();
350
+ }
351
+ };
352
+ }
353
+ function Fa(i) {
354
+ let e, t = (
355
+ /*$_*/
356
+ i[2]("faceCollector.initiatingCamera") + ""
357
+ ), a;
358
+ return {
359
+ c() {
360
+ e = w("span"), a = S(t), d(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
361
+ },
362
+ m(n, r) {
363
+ T(n, e, r), g(e, a);
364
+ },
365
+ p(n, r) {
366
+ r & /*$_*/
367
+ 4 && t !== (t = /*$_*/
368
+ n[2]("faceCollector.initiatingCamera") + "") && P(a, t);
369
+ },
370
+ d(n) {
371
+ n && D(e);
372
+ }
373
+ };
374
+ }
375
+ function Sa(i) {
376
+ let e;
377
+ return {
378
+ c() {
379
+ e = w("span"), e.textContent = "Loading camera...", d(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
380
+ },
381
+ m(t, a) {
382
+ T(t, e, a);
383
+ },
384
+ p: Y,
385
+ d(t) {
386
+ t && D(e);
387
+ }
388
+ };
389
+ }
390
+ function Na(i) {
391
+ let e = z() && /*waitingIdrndCaptureEvent*/
392
+ i[0], t, a, n = (z() && /*idrndLoading*/
393
+ (i[1] || !/*$ready*/
394
+ i[6]) || !z() && !/*$ready*/
395
+ i[6]) && /*$cameraStatusStore*/
396
+ i[4] === B.OK, r, f = e && Pi(i), l = (
397
+ /*$detectingFace*/
398
+ i[3] && /*$cameraStatusStore*/
399
+ i[4] === B.OK && Bi(i)
400
+ ), o = n && Wi(i);
401
+ return {
402
+ c() {
403
+ f && f.c(), t = F(), l && l.c(), a = F(), o && o.c(), r = Yi(), this.c = Y;
404
+ },
405
+ m(c, u) {
406
+ f && f.m(c, u), T(c, t, u), l && l.m(c, u), T(c, a, u), o && o.m(c, u), T(c, r, u);
407
+ },
408
+ p(c, [u]) {
409
+ u & /*waitingIdrndCaptureEvent*/
410
+ 1 && (e = z() && /*waitingIdrndCaptureEvent*/
411
+ c[0]), e ? f ? f.p(c, u) : (f = Pi(c), f.c(), f.m(t.parentNode, t)) : f && (f.d(1), f = null), /*$detectingFace*/
412
+ c[3] && /*$cameraStatusStore*/
413
+ c[4] === B.OK ? l ? l.p(c, u) : (l = Bi(c), l.c(), l.m(a.parentNode, a)) : l && (l.d(1), l = null), u & /*idrndLoading, $ready, $cameraStatusStore*/
414
+ 82 && (n = (z() && /*idrndLoading*/
415
+ (c[1] || !/*$ready*/
416
+ c[6]) || !z() && !/*$ready*/
417
+ c[6]) && /*$cameraStatusStore*/
418
+ c[4] === B.OK), n ? o ? o.p(c, u) : (o = Wi(c), o.c(), o.m(r.parentNode, r)) : o && (o.d(1), o = null);
419
+ },
420
+ i: Y,
421
+ o: Y,
422
+ d(c) {
423
+ f && f.d(c), c && D(t), l && l.d(c), c && D(a), o && o.d(c), c && D(r);
424
+ }
425
+ };
426
+ }
427
+ function Pa(i, e, t) {
428
+ let a, n, r, f, l;
429
+ O(i, Zi, (u) => t(2, a = u)), O(i, xi, (u) => t(3, n = u)), O(i, Q, (u) => t(4, r = u)), O(i, Bs, (u) => t(5, f = u)), O(i, qe, (u) => t(6, l = u));
430
+ let { waitingIdrndCaptureEvent: o } = e, { idrndLoading: c } = e;
431
+ return i.$$set = (u) => {
432
+ "waitingIdrndCaptureEvent" in u && t(0, o = u.waitingIdrndCaptureEvent), "idrndLoading" in u && t(1, c = u.idrndLoading);
433
+ }, [
434
+ o,
435
+ c,
436
+ a,
437
+ n,
438
+ r,
439
+ f,
440
+ l
441
+ ];
442
+ }
443
+ class is extends gt {
444
+ constructor(e) {
445
+ super(), vt(
446
+ this,
447
+ {
448
+ target: this.shadowRoot,
449
+ props: wt(this.attributes),
450
+ customElement: !0
451
+ },
452
+ Pa,
453
+ Na,
454
+ pt,
455
+ {
456
+ waitingIdrndCaptureEvent: 0,
457
+ idrndLoading: 1
458
+ },
459
+ null
460
+ ), e && (e.target && T(e.target, this, e.anchor), e.props && (this.$set(e.props), N()));
461
+ }
462
+ static get observedAttributes() {
463
+ return ["waitingIdrndCaptureEvent", "idrndLoading"];
464
+ }
465
+ get waitingIdrndCaptureEvent() {
466
+ return this.$$.ctx[0];
467
+ }
468
+ set waitingIdrndCaptureEvent(e) {
469
+ this.$$set({ waitingIdrndCaptureEvent: e }), N();
470
+ }
471
+ get idrndLoading() {
472
+ return this.$$.ctx[1];
473
+ }
474
+ set idrndLoading(e) {
475
+ this.$$set({ idrndLoading: e }), N();
476
+ }
477
+ }
478
+ customElements.define("loading-component", is);
479
+ function Mi(i, e, t) {
480
+ const a = i.slice();
481
+ return a[125] = e[t], a;
482
+ }
483
+ function Ui(i, e, t) {
484
+ const a = i.slice();
485
+ return a[125] = e[t], a;
486
+ }
487
+ function Vi(i) {
488
+ let e, t, a = z(), n, r, f, l, o, c, u, m, _, b, C, p, v, E, R, V, x, K = a && Ba(i), q = (
489
+ /*$ready*/
490
+ i[23] && !/*$detectingFace*/
491
+ i[26] && zi(i)
492
+ );
493
+ return b = new ca({}), p = new ga({
494
+ props: {
495
+ showConfigButton: (
496
+ /*showConfigButton*/
497
+ i[4]
498
+ ),
499
+ showAutoCaptureButton: (
500
+ /*showAutoCaptureButton*/
501
+ i[5]
502
+ ),
503
+ showCaptureButton: (
504
+ /*showCaptureButton*/
505
+ i[0]
506
+ ),
507
+ showCameraButton: (
508
+ /*showCameraButton*/
509
+ i[6]
510
+ ),
511
+ enableCaptureButton: (
512
+ /*enableCaptureButton*/
513
+ i[17]
514
+ ),
515
+ videoOverlay: (
516
+ /*videoOverlay*/
517
+ i[9]
518
+ ),
519
+ videoOverlayTransparency: (
520
+ /*videoOverlayTransparency*/
521
+ i[10]
522
+ ),
523
+ idrndClosed: (
524
+ /*idrndClosed*/
525
+ i[19]
526
+ ),
527
+ idrndLoading: (
528
+ /*idrndLoading*/
529
+ i[18]
530
+ ),
531
+ waitingIdrndCaptureEvent: (
532
+ /*waitingIdrndCaptureEvent*/
533
+ i[20]
534
+ ),
535
+ handler: (
536
+ /*capture*/
537
+ i[39]
538
+ )
539
+ }
540
+ }), {
541
+ c() {
542
+ e = w("div"), t = w("div"), K && K.c(), n = F(), r = w("video"), l = F(), o = w("canvas"), c = F(), u = w("div"), m = w("div"), q && q.c(), _ = F(), _e(b.$$.fragment), C = F(), _e(p.$$.fragment), d(r, "id", "bry-cc-camera-video-tag"), d(r, "class", f = /*$ready*/
543
+ i[23] ? he() ? "absolute inset-0 -scale-x-100" : "w-full h-full object-cover -scale-x-100" : "w-0 h-0"), r.playsInline = !0, r.muted = !0, r.autoplay = !0, d(o, "id", "bry-ce-detectionsCanvas"), d(o, "class", "absolute top-0 left-0 max-w-full -scale-x-100"), d(t, "class", "overflow-hidden"), ht(
544
+ t,
545
+ "width",
546
+ /*$videoStore*/
547
+ i[34].videoWidth + "px"
548
+ ), ht(
549
+ t,
550
+ "height",
551
+ /*$videoStore*/
552
+ i[34].videoHeight + "px"
553
+ ), d(m, "class", "flex flex-grow w-full items-center justify-center relative"), d(u, "class", "absolute inset-0 flex flex-col items-center justify-between w-full h-full"), d(e, "class", v = /*$ready*/
554
+ i[23] ? "relative" : "relative w-0 h-0"), e.hidden = E = /*$cameraStatusStore*/
555
+ i[22] !== B.OK || z() && /*idrndLoading*/
556
+ (i[18] || /*idrndClosed*/
557
+ i[19] || /*waitingIdrndCaptureEvent*/
558
+ i[20]);
559
+ },
560
+ m(A, W) {
561
+ T(A, e, W), g(e, t), K && K.m(t, null), g(t, n), g(t, r), i[51](r), g(t, l), g(t, o), i[53](o), g(e, c), g(e, u), g(u, m), q && q.m(m, null), g(u, _), be(b, u, null), g(u, C), be(p, u, null), R = !0, V || (x = [
562
+ fe(
563
+ r,
564
+ "canplay",
565
+ /*canplay_handler*/
566
+ i[52]
567
+ ),
568
+ fe(
569
+ r,
570
+ "play",
571
+ /*play*/
572
+ i[12],
573
+ { once: !0 }
574
+ )
575
+ ], V = !0);
576
+ },
577
+ p(A, W) {
578
+ a && K.p(A, W), (!R || W[0] & /*$ready*/
579
+ 8388608 && f !== (f = /*$ready*/
580
+ A[23] ? he() ? "absolute inset-0 -scale-x-100" : "w-full h-full object-cover -scale-x-100" : "w-0 h-0")) && d(r, "class", f), (!R || W[1] & /*$videoStore*/
581
+ 8) && ht(
582
+ t,
583
+ "width",
584
+ /*$videoStore*/
585
+ A[34].videoWidth + "px"
586
+ ), (!R || W[1] & /*$videoStore*/
587
+ 8) && ht(
588
+ t,
589
+ "height",
590
+ /*$videoStore*/
591
+ A[34].videoHeight + "px"
592
+ ), /*$ready*/
593
+ A[23] && !/*$detectingFace*/
594
+ A[26] ? q ? (q.p(A, W), W[0] & /*$ready, $detectingFace*/
595
+ 75497472 && H(q, 1)) : (q = zi(A), q.c(), H(q, 1), q.m(m, null)) : q && (Qe(), G(q, 1, 1, () => {
596
+ q = null;
597
+ }), Xe());
598
+ const Z = {};
599
+ W[0] & /*showConfigButton*/
600
+ 16 && (Z.showConfigButton = /*showConfigButton*/
601
+ A[4]), W[0] & /*showAutoCaptureButton*/
602
+ 32 && (Z.showAutoCaptureButton = /*showAutoCaptureButton*/
603
+ A[5]), W[0] & /*showCaptureButton*/
604
+ 1 && (Z.showCaptureButton = /*showCaptureButton*/
605
+ A[0]), W[0] & /*showCameraButton*/
606
+ 64 && (Z.showCameraButton = /*showCameraButton*/
607
+ A[6]), W[0] & /*enableCaptureButton*/
608
+ 131072 && (Z.enableCaptureButton = /*enableCaptureButton*/
609
+ A[17]), W[0] & /*videoOverlay*/
610
+ 512 && (Z.videoOverlay = /*videoOverlay*/
611
+ A[9]), W[0] & /*videoOverlayTransparency*/
612
+ 1024 && (Z.videoOverlayTransparency = /*videoOverlayTransparency*/
613
+ A[10]), W[0] & /*idrndClosed*/
614
+ 524288 && (Z.idrndClosed = /*idrndClosed*/
615
+ A[19]), W[0] & /*idrndLoading*/
616
+ 262144 && (Z.idrndLoading = /*idrndLoading*/
617
+ A[18]), W[0] & /*waitingIdrndCaptureEvent*/
618
+ 1048576 && (Z.waitingIdrndCaptureEvent = /*waitingIdrndCaptureEvent*/
619
+ A[20]), p.$set(Z), (!R || W[0] & /*$ready*/
620
+ 8388608 && v !== (v = /*$ready*/
621
+ A[23] ? "relative" : "relative w-0 h-0")) && d(e, "class", v), (!R || W[0] & /*$cameraStatusStore, idrndLoading, idrndClosed, waitingIdrndCaptureEvent*/
622
+ 6029312 && E !== (E = /*$cameraStatusStore*/
623
+ A[22] !== B.OK || z() && /*idrndLoading*/
624
+ (A[18] || /*idrndClosed*/
625
+ A[19] || /*waitingIdrndCaptureEvent*/
626
+ A[20]))) && (e.hidden = E);
627
+ },
628
+ i(A) {
629
+ R || (H(q), H(b.$$.fragment, A), H(p.$$.fragment, A), R = !0);
630
+ },
631
+ o(A) {
632
+ G(q), G(b.$$.fragment, A), G(p.$$.fragment, A), R = !1;
633
+ },
634
+ d(A) {
635
+ A && D(e), K && K.d(), i[51](null), i[53](null), q && q.d(), ge(b), ge(p), V = !1, Ct(x);
636
+ }
637
+ };
638
+ }
639
+ function Ba(i) {
640
+ let e;
641
+ return {
642
+ c() {
643
+ e = w("idlive-face-capture"), e.hidden = !0, le(e, "mask_hidden", ""), le(e, "auto_capture_disabled", ""), le(e, "auto_close_disabled", ""), le(
644
+ e,
645
+ "device_id",
646
+ /*$selectedVideoDeviceId*/
647
+ i[24]
648
+ ), le(e, "face_not_centered_check_enabled", ""), le(e, "sunglasses_detected_check_enabled", ""), le(e, "mouth_open_check_enabled", ""), le(e, "face_blurry_check_enabled", ""), le(e, "dark_image_check_enabled", ""), le(e, "eyes_closed_check_enabled", ""), le(
649
+ e,
650
+ "payload_size",
651
+ /*livenessBlobSize*/
652
+ i[11]
653
+ );
654
+ },
655
+ m(t, a) {
656
+ T(t, e, a), i[50](e);
657
+ },
658
+ p(t, a) {
659
+ a[0] & /*$selectedVideoDeviceId*/
660
+ 16777216 && le(
661
+ e,
662
+ "device_id",
663
+ /*$selectedVideoDeviceId*/
664
+ t[24]
665
+ ), a[0] & /*livenessBlobSize*/
666
+ 2048 && le(
667
+ e,
668
+ "payload_size",
669
+ /*livenessBlobSize*/
670
+ t[11]
671
+ );
672
+ },
673
+ d(t) {
674
+ t && D(e), i[50](null);
675
+ }
676
+ };
677
+ }
678
+ function zi(i) {
679
+ let e, t, a, n, r, f;
680
+ return e = new va({
681
+ props: {
682
+ isCountingDown: (
683
+ /*isCountingDown*/
684
+ i[16]
685
+ )
686
+ }
687
+ }), a = new es({
688
+ props: {
689
+ loading: (
690
+ /*isCountingDown*/
691
+ i[16]
692
+ ),
693
+ showWatermark: (
694
+ /*showWatermark*/
695
+ i[8]
696
+ )
697
+ }
698
+ }), r = new ts({
699
+ props: {
700
+ overlayColor: (
701
+ /*videoOverlay*/
702
+ i[9]
703
+ ),
704
+ overlayTransparency: (
705
+ /*videoOverlayTransparency*/
706
+ i[10]
707
+ )
708
+ }
709
+ }), {
710
+ c() {
711
+ _e(e.$$.fragment), t = F(), _e(a.$$.fragment), n = F(), _e(r.$$.fragment);
712
+ },
713
+ m(l, o) {
714
+ be(e, l, o), T(l, t, o), be(a, l, o), T(l, n, o), be(r, l, o), f = !0;
715
+ },
716
+ p(l, o) {
717
+ const c = {};
718
+ o[0] & /*isCountingDown*/
719
+ 65536 && (c.isCountingDown = /*isCountingDown*/
720
+ l[16]), e.$set(c);
721
+ const u = {};
722
+ o[0] & /*isCountingDown*/
723
+ 65536 && (u.loading = /*isCountingDown*/
724
+ l[16]), o[0] & /*showWatermark*/
725
+ 256 && (u.showWatermark = /*showWatermark*/
726
+ l[8]), a.$set(u);
727
+ const m = {};
728
+ o[0] & /*videoOverlay*/
729
+ 512 && (m.overlayColor = /*videoOverlay*/
730
+ l[9]), o[0] & /*videoOverlayTransparency*/
731
+ 1024 && (m.overlayTransparency = /*videoOverlayTransparency*/
732
+ l[10]), r.$set(m);
733
+ },
734
+ i(l) {
735
+ f || (H(e.$$.fragment, l), H(a.$$.fragment, l), H(r.$$.fragment, l), f = !0);
736
+ },
737
+ o(l) {
738
+ G(e.$$.fragment, l), G(a.$$.fragment, l), G(r.$$.fragment, l), f = !1;
739
+ },
740
+ d(l) {
741
+ ge(e, l), l && D(t), ge(a, l), l && D(n), ge(r, l);
742
+ }
743
+ };
744
+ }
745
+ function ji(i) {
746
+ let e, t, a = (
747
+ /*$_*/
748
+ i[31]("faceCollector.finish") + ""
749
+ ), n, r, f, l, o = (
750
+ /*$_*/
751
+ i[31]("faceCollector.retakePhoto") + ""
752
+ ), c, u, m;
753
+ return {
754
+ c() {
755
+ e = w("div"), t = w("button"), n = S(a), f = F(), l = w("button"), c = S(o), t.disabled = r = /*$justification*/
756
+ i[28].length === 0, d(t, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), d(l, "id", "bry-cc-retake-button"), d(l, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), d(e, "class", "ce-dui-btn-group flex");
757
+ },
758
+ m(_, b) {
759
+ T(_, e, b), g(e, t), g(t, n), g(e, f), g(e, l), g(l, c), u || (m = [
760
+ fe(
761
+ t,
762
+ "click",
763
+ /*click_handler*/
764
+ i[54]
765
+ ),
766
+ fe(
767
+ l,
768
+ "click",
769
+ /*click_handler_1*/
770
+ i[55]
771
+ )
772
+ ], u = !0);
773
+ },
774
+ p(_, b) {
775
+ b[1] & /*$_*/
776
+ 1 && a !== (a = /*$_*/
777
+ _[31]("faceCollector.finish") + "") && P(n, a), b[0] & /*$justification*/
778
+ 268435456 && r !== (r = /*$justification*/
779
+ _[28].length === 0) && (t.disabled = r), b[1] & /*$_*/
780
+ 1 && o !== (o = /*$_*/
781
+ _[31]("faceCollector.retakePhoto") + "") && P(c, o);
782
+ },
783
+ d(_) {
784
+ _ && D(e), u = !1, Ct(m);
785
+ }
786
+ };
787
+ }
788
+ function Wa(i) {
789
+ let e, t;
790
+ return e = new pa({ props: { handler: (
791
+ /*func*/
792
+ i[64]
793
+ ) } }), {
794
+ c() {
795
+ _e(e.$$.fragment);
796
+ },
797
+ m(a, n) {
798
+ be(e, a, n), t = !0;
799
+ },
800
+ p: Y,
801
+ i(a) {
802
+ t || (H(e.$$.fragment, a), t = !0);
803
+ },
804
+ o(a) {
805
+ G(e.$$.fragment, a), t = !1;
806
+ },
807
+ d(a) {
808
+ ge(e, a);
809
+ }
810
+ };
811
+ }
812
+ function Ma(i) {
813
+ let e, t, a, n, r, f, l, o, c;
814
+ const u = [
815
+ Ka,
816
+ ja,
817
+ za,
818
+ Va,
819
+ Ua
820
+ ], m = [];
821
+ function _(b, C) {
822
+ return (
823
+ /*$captured*/
824
+ b[25] ? (
825
+ /*$unconformitiesStore*/
826
+ b[32].isLoading ? 1 : (
827
+ /*$requestResult*/
828
+ b[30] !== j.OK ? 2 : (
829
+ /*$saved*/
830
+ b[27] ? 4 : 3
831
+ )
832
+ )
833
+ ) : 0
834
+ );
835
+ }
836
+ return f = _(i), l = m[f] = u[f](i), {
837
+ c() {
838
+ e = w("div"), t = w("img"), r = F(), l.c(), d(t, "class", "m-auto col-start-1 col-end-1 max-h-[23.2em]"), Ge(t.src, a = /*$dataTypePrefix*/
839
+ i[33] + "," + /*$image*/
840
+ i[29]) || d(t, "src", a), t.hidden = n = !/*$captured*/
841
+ i[25] || !/*$showFaceWhileValidating*/
842
+ i[35] && /*$unconformitiesStore*/
843
+ i[32].isLoading, d(t, "alt", ""), d(e, "class", o = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (!/*$showFaceWhileValidating*/
844
+ i[35] && /*$unconformitiesStore*/
845
+ i[32].isLoading ? "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible" : "grid overflow-hidden"));
846
+ },
847
+ m(b, C) {
848
+ T(b, e, C), g(e, t), g(e, r), m[f].m(e, null), c = !0;
849
+ },
850
+ p(b, C) {
851
+ (!c || C[0] & /*$image*/
852
+ 536870912 | C[1] & /*$dataTypePrefix*/
853
+ 4 && !Ge(t.src, a = /*$dataTypePrefix*/
854
+ b[33] + "," + /*$image*/
855
+ b[29])) && d(t, "src", a), (!c || C[0] & /*$captured*/
856
+ 33554432 | C[1] & /*$showFaceWhileValidating, $unconformitiesStore*/
857
+ 18 && n !== (n = !/*$captured*/
858
+ b[25] || !/*$showFaceWhileValidating*/
859
+ b[35] && /*$unconformitiesStore*/
860
+ b[32].isLoading)) && (t.hidden = n);
861
+ let p = f;
862
+ f = _(b), f === p ? m[f].p(b, C) : (Qe(), G(m[p], 1, 1, () => {
863
+ m[p] = null;
864
+ }), Xe(), l = m[f], l ? l.p(b, C) : (l = m[f] = u[f](b), l.c()), H(l, 1), l.m(e, null)), (!c || C[1] & /*$showFaceWhileValidating, $unconformitiesStore*/
865
+ 18 && o !== (o = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (!/*$showFaceWhileValidating*/
866
+ b[35] && /*$unconformitiesStore*/
867
+ b[32].isLoading ? "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible" : "grid overflow-hidden"))) && d(e, "class", o);
868
+ },
869
+ i(b) {
870
+ c || (H(l), c = !0);
871
+ },
872
+ o(b) {
873
+ G(l), c = !1;
874
+ },
875
+ d(b) {
876
+ b && D(e), m[f].d();
877
+ }
878
+ };
879
+ }
880
+ function Ua(i) {
881
+ let e, t, a = (
882
+ /*$_*/
883
+ i[31]("faceCollector.captured") + ""
884
+ ), n, r, f, l, o, c = (
885
+ /*$_*/
886
+ i[31]("faceCollector.retakePhoto") + ""
887
+ ), u, m, _ = _t(ha).faceStrategy !== ma.DISABLED, b, C, p, v = (
888
+ /*$unconformitiesStore*/
889
+ i[32].unconformities.length !== 0 && Ki(i)
890
+ ), E = _ && Ha();
891
+ return {
892
+ c() {
893
+ e = w("div"), t = w("h1"), n = S(a), r = F(), v && v.c(), f = F(), l = w("div"), o = w("button"), u = S(c), m = F(), E && E.c(), d(t, "class", "text-3xl font-bold pb-[1em] transition-opacity"), d(o, "id", "bry-cc-retake-button"), d(o, "class", "ce-dui-btn ce-dui-btn-block flex-shrink text-base"), d(l, "class", "flex flex-row"), Si(l, "ce-dui-btn-group", !/*$exportButtonDisabled*/
894
+ i[36]);
895
+ },
896
+ m(R, V) {
897
+ T(R, e, V), g(e, t), g(t, n), g(e, r), v && v.m(e, null), g(e, f), g(e, l), g(l, o), g(o, u), g(l, m), E && E.m(l, null), b = !0, C || (p = fe(
898
+ o,
899
+ "click",
900
+ /*click_handler_6*/
901
+ i[63]
902
+ ), C = !0);
903
+ },
904
+ p(R, V) {
905
+ (!b || V[1] & /*$_*/
906
+ 1) && a !== (a = /*$_*/
907
+ R[31]("faceCollector.captured") + "") && P(n, a), /*$unconformitiesStore*/
908
+ R[32].unconformities.length !== 0 ? v ? v.p(R, V) : (v = Ki(R), v.c(), v.m(e, f)) : v && (v.d(1), v = null), (!b || V[1] & /*$_*/
909
+ 1) && c !== (c = /*$_*/
910
+ R[31]("faceCollector.retakePhoto") + "") && P(u, c), (!b || V[1] & /*$exportButtonDisabled*/
911
+ 32) && Si(l, "ce-dui-btn-group", !/*$exportButtonDisabled*/
912
+ R[36]);
913
+ },
914
+ i(R) {
915
+ b || (H(E), b = !0);
916
+ },
917
+ o(R) {
918
+ G(E), b = !1;
919
+ },
920
+ d(R) {
921
+ R && D(e), v && v.d(), E && E.d(), C = !1, p();
922
+ }
923
+ };
924
+ }
925
+ function Va(i) {
926
+ let e, t, a = (
927
+ /*evaluatePhoto*/
928
+ (i[2] ? (
929
+ /*$unconformitiesStore*/
930
+ i[32].unconformities.length === 0 ? (
931
+ /*$_*/
932
+ i[31]("faceCollector.everythingOk")
933
+ ) : (
934
+ /*$_*/
935
+ i[31]("faceCollector.unconformities")
936
+ )
937
+ ) : (
938
+ /*$_*/
939
+ i[31]("faceCollector.previewCapture")
940
+ )) + ""
941
+ ), n, r, f, l, o, c, u = (
942
+ /*$unconformitiesStore*/
943
+ i[32].unconformities
944
+ ), m = [];
945
+ for (let p = 0; p < u.length; p += 1)
946
+ m[p] = Hi(Mi(i, u, p));
947
+ let _ = (
948
+ /*evaluatePhoto*/
949
+ i[2] && /*$unconformitiesStore*/
950
+ i[32].unconformities.length == 0 && qi(i)
951
+ ), b = (
952
+ /*showJustificationField*/
953
+ i[7] && /*$unconformitiesStore*/
954
+ i[32].unconformities.length > 0 && Ji(i)
955
+ ), C = (
956
+ /*$captured*/
957
+ i[25] && Qi(i)
958
+ );
959
+ return {
960
+ c() {
961
+ e = w("div"), t = w("h1"), n = S(a), r = F(), f = w("div");
962
+ for (let p = 0; p < m.length; p += 1)
963
+ m[p].c();
964
+ l = F(), _ && _.c(), o = F(), b && b.c(), c = F(), C && C.c(), d(t, "class", "text-3xl font-bold transition-opacity"), d(f, "class", "flex flex-wrap"), d(e, "class", "flex flex-col justify-between");
965
+ },
966
+ m(p, v) {
967
+ T(p, e, v), g(e, t), g(t, n), g(e, r), g(e, f);
968
+ for (let E = 0; E < m.length; E += 1)
969
+ m[E] && m[E].m(f, null);
970
+ g(f, l), _ && _.m(f, null), g(e, o), b && b.m(e, null), g(e, c), C && C.m(e, null);
971
+ },
972
+ p(p, v) {
973
+ if (v[0] & /*evaluatePhoto*/
974
+ 4 | v[1] & /*$unconformitiesStore, $_*/
975
+ 3 && a !== (a = /*evaluatePhoto*/
976
+ (p[2] ? (
977
+ /*$unconformitiesStore*/
978
+ p[32].unconformities.length === 0 ? (
979
+ /*$_*/
980
+ p[31]("faceCollector.everythingOk")
981
+ ) : (
982
+ /*$_*/
983
+ p[31]("faceCollector.unconformities")
984
+ )
985
+ ) : (
986
+ /*$_*/
987
+ p[31]("faceCollector.previewCapture")
988
+ )) + "") && P(n, a), v[1] & /*$unconformitiesStore*/
989
+ 2) {
990
+ u = /*$unconformitiesStore*/
991
+ p[32].unconformities;
992
+ let E;
993
+ for (E = 0; E < u.length; E += 1) {
994
+ const R = Mi(p, u, E);
995
+ m[E] ? m[E].p(R, v) : (m[E] = Hi(R), m[E].c(), m[E].m(f, l));
996
+ }
997
+ for (; E < m.length; E += 1)
998
+ m[E].d(1);
999
+ m.length = u.length;
1000
+ }
1001
+ /*evaluatePhoto*/
1002
+ p[2] && /*$unconformitiesStore*/
1003
+ p[32].unconformities.length == 0 ? _ ? _.p(p, v) : (_ = qi(p), _.c(), _.m(f, null)) : _ && (_.d(1), _ = null), /*showJustificationField*/
1004
+ p[7] && /*$unconformitiesStore*/
1005
+ p[32].unconformities.length > 0 ? b ? b.p(p, v) : (b = Ji(p), b.c(), b.m(e, c)) : b && (b.d(1), b = null), /*$captured*/
1006
+ p[25] ? C ? C.p(p, v) : (C = Qi(p), C.c(), C.m(e, null)) : C && (C.d(1), C = null);
1007
+ },
1008
+ i: Y,
1009
+ o: Y,
1010
+ d(p) {
1011
+ p && D(e), $i(m, p), _ && _.d(), b && b.d(), C && C.d();
1012
+ }
1013
+ };
1014
+ }
1015
+ function za(i) {
1016
+ let e, t, a, n, r = (
1017
+ /*$_*/
1018
+ i[31]("faceCollector.finish") + ""
1019
+ ), f, l, o, c = (
1020
+ /*$_*/
1021
+ i[31]("faceCollector.retakePhoto") + ""
1022
+ ), u, m, _;
1023
+ function b(v, E) {
1024
+ return (
1025
+ /*$requestResult*/
1026
+ v[30] === j.LIVENESS_DETECTION_FAILURE || /*$requestResult*/
1027
+ v[30] === j.UNKNOWN_LIVENESS_ERROR ? Za : (
1028
+ /*$requestResult*/
1029
+ v[30] === j.LOW_LIVENESS_SCORE ? Ya : (
1030
+ /*$requestResult*/
1031
+ v[30] === j.TEMPLATE_EXTRACTION_ERROR || /*$requestResult*/
1032
+ v[30] === j.UNKNOWN_TEMPLATE_EXTRACTION_ERROR ? Ga : (
1033
+ /*$requestResult*/
1034
+ v[30] === j.UNABLE_TO_COMMUNICATE_WITH_TEMPLATE_EXTRACTION_SERVICE ? Xa : (
1035
+ /*$requestResult*/
1036
+ v[30] === j.LIVENESS_EVALUATION_ERROR ? Qa : (
1037
+ /*$requestResult*/
1038
+ v[30] === j.INSUFFICIENT_FACE_QUALITY ? Ja : qa
1039
+ )
1040
+ )
1041
+ )
1042
+ )
1043
+ )
1044
+ );
1045
+ }
1046
+ let C = b(i), p = C(i);
1047
+ return {
1048
+ c() {
1049
+ e = w("div"), p.c(), t = F(), a = w("div"), n = w("button"), f = S(r), l = F(), o = w("button"), u = S(c), n.disabled = !0, d(n, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), d(o, "id", "bry-cc-retake-button"), d(o, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), d(a, "class", "ce-dui-btn-group flex"), d(e, "class", "flex flex-col justify-between");
1050
+ },
1051
+ m(v, E) {
1052
+ T(v, e, E), p.m(e, null), g(e, t), g(e, a), g(a, n), g(n, f), g(a, l), g(a, o), g(o, u), m || (_ = [
1053
+ fe(
1054
+ n,
1055
+ "click",
1056
+ /*click_handler_2*/
1057
+ i[57]
1058
+ ),
1059
+ fe(
1060
+ o,
1061
+ "click",
1062
+ /*click_handler_3*/
1063
+ i[58]
1064
+ )
1065
+ ], m = !0);
1066
+ },
1067
+ p(v, E) {
1068
+ C === (C = b(v)) && p ? p.p(v, E) : (p.d(1), p = C(v), p && (p.c(), p.m(e, t))), E[1] & /*$_*/
1069
+ 1 && r !== (r = /*$_*/
1070
+ v[31]("faceCollector.finish") + "") && P(f, r), E[1] & /*$_*/
1071
+ 1 && c !== (c = /*$_*/
1072
+ v[31]("faceCollector.retakePhoto") + "") && P(u, c);
1073
+ },
1074
+ i: Y,
1075
+ o: Y,
1076
+ d(v) {
1077
+ v && D(e), p.d(), m = !1, Ct(_);
1078
+ }
1079
+ };
1080
+ }
1081
+ function ja(i) {
1082
+ let e, t, a = (
1083
+ /*$_*/
1084
+ i[31]("faceCollector.validating") + ""
1085
+ ), n, r, f;
1086
+ return {
1087
+ c() {
1088
+ e = w("div"), t = w("h1"), n = S(a), r = F(), f = w("div"), d(t, "class", "inline-block text-3xl font-bold pb-[1em] transition-opacity"), d(f, "class", "ml-6 inline-block dot-typing"), d(e, "class", "min-w-[200px]");
1089
+ },
1090
+ m(l, o) {
1091
+ T(l, e, o), g(e, t), g(t, n), g(e, r), g(e, f);
1092
+ },
1093
+ p(l, o) {
1094
+ o[1] & /*$_*/
1095
+ 1 && a !== (a = /*$_*/
1096
+ l[31]("faceCollector.validating") + "") && P(n, a);
1097
+ },
1098
+ i: Y,
1099
+ o: Y,
1100
+ d(l) {
1101
+ l && D(e);
1102
+ }
1103
+ };
1104
+ }
1105
+ function Ka(i) {
1106
+ let e;
1107
+ return {
1108
+ c() {
1109
+ e = w("div"), d(e, "class", "");
1110
+ },
1111
+ m(t, a) {
1112
+ T(t, e, a);
1113
+ },
1114
+ p: Y,
1115
+ i: Y,
1116
+ o: Y,
1117
+ d(t) {
1118
+ t && D(e);
1119
+ }
1120
+ };
1121
+ }
1122
+ function Ki(i) {
1123
+ let e, t, a = (
1124
+ /*$_*/
1125
+ i[31]("faceCollector.justification") + ""
1126
+ ), n, r, f, l, o;
1127
+ return {
1128
+ c() {
1129
+ e = w("label"), t = w("span"), n = S(a), r = F(), f = w("textarea"), d(t, "class", "ce-dui-label-text text-base"), d(e, "class", "ce-dui-label"), d(e, "for", "justification"), d(f, "contenteditable", ""), d(f, "id", "justification"), d(f, "class", "ce-dui-textarea ce-dui-textarea-bordered textarea-ghost h-[6em] w-full text-base");
1130
+ },
1131
+ m(c, u) {
1132
+ T(c, e, u), g(e, t), g(t, n), T(c, r, u), T(c, f, u), bt(
1133
+ f,
1134
+ /*$justification*/
1135
+ i[28]
1136
+ ), l || (o = fe(
1137
+ f,
1138
+ "input",
1139
+ /*textarea_input_handler_1*/
1140
+ i[62]
1141
+ ), l = !0);
1142
+ },
1143
+ p(c, u) {
1144
+ u[1] & /*$_*/
1145
+ 1 && a !== (a = /*$_*/
1146
+ c[31]("faceCollector.justification") + "") && P(n, a), u[0] & /*$justification*/
1147
+ 268435456 && bt(
1148
+ f,
1149
+ /*$justification*/
1150
+ c[28]
1151
+ );
1152
+ },
1153
+ d(c) {
1154
+ c && D(e), c && D(r), c && D(f), l = !1, o();
1155
+ }
1156
+ };
1157
+ }
1158
+ function Ha(i) {
1159
+ let e, t;
1160
+ return e = new _a({
1161
+ props: { cssClass: "ce-dui-btn-block flex-shrink" }
1162
+ }), {
1163
+ c() {
1164
+ _e(e.$$.fragment);
1165
+ },
1166
+ m(a, n) {
1167
+ be(e, a, n), t = !0;
1168
+ },
1169
+ i(a) {
1170
+ t || (H(e.$$.fragment, a), t = !0);
1171
+ },
1172
+ o(a) {
1173
+ G(e.$$.fragment, a), t = !1;
1174
+ },
1175
+ d(a) {
1176
+ ge(e, a);
1177
+ }
1178
+ };
1179
+ }
1180
+ function Hi(i) {
1181
+ let e, t = (
1182
+ /*unconformity*/
1183
+ i[125] + ""
1184
+ ), a;
1185
+ return {
1186
+ c() {
1187
+ e = w("div"), a = S(t), d(e, "class", "ce-dui-badge ce-dui-badge-lg h-[2em] ce-dui-badge-error text-xl pb-[.25em] m-[.5em]");
1188
+ },
1189
+ m(n, r) {
1190
+ T(n, e, r), g(e, a);
1191
+ },
1192
+ p(n, r) {
1193
+ r[1] & /*$unconformitiesStore*/
1194
+ 2 && t !== (t = /*unconformity*/
1195
+ n[125] + "") && P(a, t);
1196
+ },
1197
+ d(n) {
1198
+ n && D(e);
1199
+ }
1200
+ };
1201
+ }
1202
+ function qi(i) {
1203
+ let e, t = (
1204
+ /*$_*/
1205
+ i[31]("faceCollector.noNonconformity") + ""
1206
+ ), a;
1207
+ return {
1208
+ c() {
1209
+ e = w("div"), a = S(t), d(e, "class", "ce-dui-badge ce-dui-badge-lg h-[2em] ce-dui-badge-info text-xl pb-[.25em] m-[.5em]");
1210
+ },
1211
+ m(n, r) {
1212
+ T(n, e, r), g(e, a);
1213
+ },
1214
+ p(n, r) {
1215
+ r[1] & /*$_*/
1216
+ 1 && t !== (t = /*$_*/
1217
+ n[31]("faceCollector.noNonconformity") + "") && P(a, t);
1218
+ },
1219
+ d(n) {
1220
+ n && D(e);
1221
+ }
1222
+ };
1223
+ }
1224
+ function Ji(i) {
1225
+ let e, t, a, n = (
1226
+ /*$_*/
1227
+ i[31]("faceCollector.provideAReasonForTheLowQualityCapture") + ""
1228
+ ), r, f, l, o, c, u, m, _, b = (
1229
+ /*$_*/
1230
+ i[31]("faceCollector.thisInformationIsRequired") + ""
1231
+ ), C, p, v, E;
1232
+ return {
1233
+ c() {
1234
+ e = w("div"), t = w("label"), a = w("span"), r = S(n), f = F(), l = w("textarea"), c = F(), u = w("label"), m = w("span"), _ = S("("), C = S(b), p = S(")"), d(a, "class", "ce-dui-label-text text-base"), d(t, "class", "ce-dui-label"), d(t, "for", "justification"), d(l, "contenteditable", ""), d(l, "id", "justification"), d(l, "class", "ce-dui-textarea ce-dui-textarea-bordered h-[6em] text-base"), d(l, "placeholder", o = /*$_*/
1235
+ i[31]("faceCollector.yourJustification")), d(m, "class", "ce-dui-label-text-alt text-base"), d(u, "class", "ce-dui-label"), d(u, "for", "justification"), d(e, "class", "ce-dui-form-control");
1236
+ },
1237
+ m(R, V) {
1238
+ T(R, e, V), g(e, t), g(t, a), g(a, r), g(e, f), g(e, l), bt(
1239
+ l,
1240
+ /*$justification*/
1241
+ i[28]
1242
+ ), g(e, c), g(e, u), g(u, m), g(m, _), g(m, C), g(m, p), v || (E = fe(
1243
+ l,
1244
+ "input",
1245
+ /*textarea_input_handler*/
1246
+ i[59]
1247
+ ), v = !0);
1248
+ },
1249
+ p(R, V) {
1250
+ V[1] & /*$_*/
1251
+ 1 && n !== (n = /*$_*/
1252
+ R[31]("faceCollector.provideAReasonForTheLowQualityCapture") + "") && P(r, n), V[1] & /*$_*/
1253
+ 1 && o !== (o = /*$_*/
1254
+ R[31]("faceCollector.yourJustification")) && d(l, "placeholder", o), V[0] & /*$justification*/
1255
+ 268435456 && bt(
1256
+ l,
1257
+ /*$justification*/
1258
+ R[28]
1259
+ ), V[1] & /*$_*/
1260
+ 1 && b !== (b = /*$_*/
1261
+ R[31]("faceCollector.thisInformationIsRequired") + "") && P(C, b);
1262
+ },
1263
+ d(R) {
1264
+ R && D(e), v = !1, E();
1265
+ }
1266
+ };
1267
+ }
1268
+ function Qi(i) {
1269
+ let e, t, a = (
1270
+ /*$_*/
1271
+ i[31]("faceCollector.finish") + ""
1272
+ ), n, r, f, l, o = (
1273
+ /*$_*/
1274
+ i[31]("faceCollector.retakePhoto") + ""
1275
+ ), c, u, m;
1276
+ return {
1277
+ c() {
1278
+ e = w("div"), t = w("button"), n = S(a), f = F(), l = w("button"), c = S(o), t.disabled = r = /*evaluatePhoto*/
1279
+ i[2] && /*showJustificationField*/
1280
+ i[7] && /*$justification*/
1281
+ i[28].length === 0 && /*$unconformitiesStore*/
1282
+ i[32].unconformities.length !== 0, d(t, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink text-base"), d(l, "id", "bry-cc-retake-button"), d(l, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink text-base"), d(e, "class", "ce-dui-btn-group flex");
1283
+ },
1284
+ m(_, b) {
1285
+ T(_, e, b), g(e, t), g(t, n), g(e, f), g(e, l), g(l, c), u || (m = [
1286
+ fe(
1287
+ t,
1288
+ "click",
1289
+ /*click_handler_4*/
1290
+ i[60]
1291
+ ),
1292
+ fe(
1293
+ l,
1294
+ "click",
1295
+ /*click_handler_5*/
1296
+ i[61]
1297
+ )
1298
+ ], u = !0);
1299
+ },
1300
+ p(_, b) {
1301
+ b[1] & /*$_*/
1302
+ 1 && a !== (a = /*$_*/
1303
+ _[31]("faceCollector.finish") + "") && P(n, a), b[0] & /*evaluatePhoto, showJustificationField, $justification*/
1304
+ 268435588 | b[1] & /*$unconformitiesStore*/
1305
+ 2 && r !== (r = /*evaluatePhoto*/
1306
+ _[2] && /*showJustificationField*/
1307
+ _[7] && /*$justification*/
1308
+ _[28].length === 0 && /*$unconformitiesStore*/
1309
+ _[32].unconformities.length !== 0) && (t.disabled = r), b[1] & /*$_*/
1310
+ 1 && o !== (o = /*$_*/
1311
+ _[31]("faceCollector.retakePhoto") + "") && P(c, o);
1312
+ },
1313
+ d(_) {
1314
+ _ && D(e), u = !1, Ct(m);
1315
+ }
1316
+ };
1317
+ }
1318
+ function qa(i) {
1319
+ let e, t = (
1320
+ /*$_*/
1321
+ i[31]("faceCollector.everythingOk") + ""
1322
+ ), a;
1323
+ return {
1324
+ c() {
1325
+ e = w("h1"), a = S(t), d(e, "class", "text-3xl font-bold pb-[1em] transition-opacity");
1326
+ },
1327
+ m(n, r) {
1328
+ T(n, e, r), g(e, a);
1329
+ },
1330
+ p(n, r) {
1331
+ r[1] & /*$_*/
1332
+ 1 && t !== (t = /*$_*/
1333
+ n[31]("faceCollector.everythingOk") + "") && P(a, t);
1334
+ },
1335
+ d(n) {
1336
+ n && D(e);
1337
+ }
1338
+ };
1339
+ }
1340
+ function Ja(i) {
1341
+ let e, t, a, n, r = (
1342
+ /*$_*/
1343
+ i[31]("liveness.error.faceQualityInsufficient") + ""
1344
+ ), f, l = (
1345
+ /*$unconformitiesStore*/
1346
+ i[32].unconformities
1347
+ ), o = [];
1348
+ for (let u = 0; u < l.length; u += 1)
1349
+ o[u] = Xi(Ui(i, l, u));
1350
+ let c = (
1351
+ /*evaluatePhoto*/
1352
+ i[2] && /*$unconformitiesStore*/
1353
+ i[32].unconformities.length == 0 && Gi(i)
1354
+ );
1355
+ return {
1356
+ c() {
1357
+ e = w("div");
1358
+ for (let u = 0; u < o.length; u += 1)
1359
+ o[u].c();
1360
+ t = F(), c && c.c(), a = F(), n = w("h1"), f = S(r), d(e, "class", "flex flex-wrap"), d(n, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1361
+ },
1362
+ m(u, m) {
1363
+ T(u, e, m);
1364
+ for (let _ = 0; _ < o.length; _ += 1)
1365
+ o[_] && o[_].m(e, null);
1366
+ g(e, t), c && c.m(e, null), T(u, a, m), T(u, n, m), g(n, f);
1367
+ },
1368
+ p(u, m) {
1369
+ if (m[1] & /*$unconformitiesStore*/
1370
+ 2) {
1371
+ l = /*$unconformitiesStore*/
1372
+ u[32].unconformities;
1373
+ let _;
1374
+ for (_ = 0; _ < l.length; _ += 1) {
1375
+ const b = Ui(u, l, _);
1376
+ o[_] ? o[_].p(b, m) : (o[_] = Xi(b), o[_].c(), o[_].m(e, t));
1377
+ }
1378
+ for (; _ < o.length; _ += 1)
1379
+ o[_].d(1);
1380
+ o.length = l.length;
1381
+ }
1382
+ /*evaluatePhoto*/
1383
+ u[2] && /*$unconformitiesStore*/
1384
+ u[32].unconformities.length == 0 ? c ? c.p(u, m) : (c = Gi(u), c.c(), c.m(e, null)) : c && (c.d(1), c = null), m[1] & /*$_*/
1385
+ 1 && r !== (r = /*$_*/
1386
+ u[31]("liveness.error.faceQualityInsufficient") + "") && P(f, r);
1387
+ },
1388
+ d(u) {
1389
+ u && D(e), $i(o, u), c && c.d(), u && D(a), u && D(n);
1390
+ }
1391
+ };
1392
+ }
1393
+ function Qa(i) {
1394
+ let e, t = (
1395
+ /*$_*/
1396
+ i[31]("liveness.error.evaluationError") + ""
1397
+ ), a;
1398
+ return {
1399
+ c() {
1400
+ e = w("h1"), a = S(t), d(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1401
+ },
1402
+ m(n, r) {
1403
+ T(n, e, r), g(e, a);
1404
+ },
1405
+ p(n, r) {
1406
+ r[1] & /*$_*/
1407
+ 1 && t !== (t = /*$_*/
1408
+ n[31]("liveness.error.evaluationError") + "") && P(a, t);
1409
+ },
1410
+ d(n) {
1411
+ n && D(e);
1412
+ }
1413
+ };
1414
+ }
1415
+ function Xa(i) {
1416
+ let e, t = (
1417
+ /*$_*/
1418
+ i[31]("faceCollector.unableToCompleteRequest") + ""
1419
+ ), a;
1420
+ return {
1421
+ c() {
1422
+ e = w("h1"), a = S(t), d(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1423
+ },
1424
+ m(n, r) {
1425
+ T(n, e, r), g(e, a);
1426
+ },
1427
+ p(n, r) {
1428
+ r[1] & /*$_*/
1429
+ 1 && t !== (t = /*$_*/
1430
+ n[31]("faceCollector.unableToCompleteRequest") + "") && P(a, t);
1431
+ },
1432
+ d(n) {
1433
+ n && D(e);
1434
+ }
1435
+ };
1436
+ }
1437
+ function Ga(i) {
1438
+ let e, t = (
1439
+ /*$_*/
1440
+ i[31]("faceCollector.lowQualityCapture") + ""
1441
+ ), a;
1442
+ return {
1443
+ c() {
1444
+ e = w("h1"), a = S(t), d(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1445
+ },
1446
+ m(n, r) {
1447
+ T(n, e, r), g(e, a);
1448
+ },
1449
+ p(n, r) {
1450
+ r[1] & /*$_*/
1451
+ 1 && t !== (t = /*$_*/
1452
+ n[31]("faceCollector.lowQualityCapture") + "") && P(a, t);
1453
+ },
1454
+ d(n) {
1455
+ n && D(e);
1456
+ }
1457
+ };
1458
+ }
1459
+ function Ya(i) {
1460
+ let e, t = (
1461
+ /*$_*/
1462
+ i[31]("liveness.error.error") + ""
1463
+ ), a, n, r = (
1464
+ /*$_*/
1465
+ i[31]("faceCollector.unaliveCapture") + ""
1466
+ ), f;
1467
+ return {
1468
+ c() {
1469
+ e = w("h1"), a = S(t), n = S(": "), f = S(r), d(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1470
+ },
1471
+ m(l, o) {
1472
+ T(l, e, o), g(e, a), g(e, n), g(e, f);
1473
+ },
1474
+ p(l, o) {
1475
+ o[1] & /*$_*/
1476
+ 1 && t !== (t = /*$_*/
1477
+ l[31]("liveness.error.error") + "") && P(a, t), o[1] & /*$_*/
1478
+ 1 && r !== (r = /*$_*/
1479
+ l[31]("faceCollector.unaliveCapture") + "") && P(f, r);
1480
+ },
1481
+ d(l) {
1482
+ l && D(e);
1483
+ }
1484
+ };
1485
+ }
1486
+ function Za(i) {
1487
+ let e, t = (
1488
+ /*$_*/
1489
+ i[31]("liveness.error.error") + ""
1490
+ ), a, n, r = (
1491
+ /*$_*/
1492
+ i[31](
1493
+ /*livenessError*/
1494
+ i[21]
1495
+ ) + ""
1496
+ ), f;
1497
+ return {
1498
+ c() {
1499
+ e = w("h1"), a = S(t), n = S(": "), f = S(r), d(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1500
+ },
1501
+ m(l, o) {
1502
+ T(l, e, o), g(e, a), g(e, n), g(e, f);
1503
+ },
1504
+ p(l, o) {
1505
+ o[1] & /*$_*/
1506
+ 1 && t !== (t = /*$_*/
1507
+ l[31]("liveness.error.error") + "") && P(a, t), o[0] & /*livenessError*/
1508
+ 2097152 | o[1] & /*$_*/
1509
+ 1 && r !== (r = /*$_*/
1510
+ l[31](
1511
+ /*livenessError*/
1512
+ l[21]
1513
+ ) + "") && P(f, r);
1514
+ },
1515
+ d(l) {
1516
+ l && D(e);
1517
+ }
1518
+ };
1519
+ }
1520
+ function Xi(i) {
1521
+ let e, t = (
1522
+ /*unconformity*/
1523
+ i[125] + ""
1524
+ ), a;
1525
+ return {
1526
+ c() {
1527
+ e = w("div"), a = S(t), d(e, "class", "ce-dui-badge ce-dui-badge-lg h-[2em] ce-dui-badge-error text-xl pb-[.25em] m-[.5em]");
1528
+ },
1529
+ m(n, r) {
1530
+ T(n, e, r), g(e, a);
1531
+ },
1532
+ p(n, r) {
1533
+ r[1] & /*$unconformitiesStore*/
1534
+ 2 && t !== (t = /*unconformity*/
1535
+ n[125] + "") && P(a, t);
1536
+ },
1537
+ d(n) {
1538
+ n && D(e);
1539
+ }
1540
+ };
1541
+ }
1542
+ function Gi(i) {
1543
+ let e, t = (
1544
+ /*$_*/
1545
+ i[31]("faceCollector.noNonconformity") + ""
1546
+ ), a;
1547
+ return {
1548
+ c() {
1549
+ e = w("div"), a = S(t), d(e, "class", "ce-dui-badge ce-dui-badge-lg h-[2em] ce-dui-badge-info text-xl pb-[.25em] m-[.5em]");
1550
+ },
1551
+ m(n, r) {
1552
+ T(n, e, r), g(e, a);
1553
+ },
1554
+ p(n, r) {
1555
+ r[1] & /*$_*/
1556
+ 1 && t !== (t = /*$_*/
1557
+ n[31]("faceCollector.noNonconformity") + "") && P(a, t);
1558
+ },
1559
+ d(n) {
1560
+ n && D(e);
1561
+ }
1562
+ };
1563
+ }
1564
+ function xa(i) {
1565
+ let e, t, a, n, r, f, l, o, c, u, m = (
1566
+ /*$videoStore*/
1567
+ i[34] && Vi(i)
1568
+ );
1569
+ n = new is({
1570
+ props: {
1571
+ waitingIdrndCaptureEvent: (
1572
+ /*waitingIdrndCaptureEvent*/
1573
+ i[20]
1574
+ ),
1575
+ idrndLoading: (
1576
+ /*idrndLoading*/
1577
+ i[18]
1578
+ )
1579
+ }
1580
+ });
1581
+ let _ = (
1582
+ /*$captured*/
1583
+ i[25] && ji(i)
1584
+ );
1585
+ const b = [Ma, Wa], C = [];
1586
+ function p(v, E) {
1587
+ return (!/*idrndClosed*/
1588
+ v[19] || /*$captured*/
1589
+ v[25]) && /*showUnconformities*/
1590
+ v[3] ? 0 : (
1591
+ /*$cameraStatusStore*/
1592
+ v[22] !== B.OK ? 1 : -1
1593
+ );
1594
+ }
1595
+ return ~(l = p(i)) && (o = C[l] = b[l](i)), {
1596
+ c() {
1597
+ e = w("div"), t = w("div"), m && m.c(), a = F(), _e(n.$$.fragment), r = F(), _ && _.c(), f = F(), o && o.c(), c = Yi(), this.c = Y, d(t, "class", "relative mx-auto"), d(e, "class", "flex flex-col justify-between");
1598
+ },
1599
+ m(v, E) {
1600
+ T(v, e, E), g(e, t), m && m.m(t, null), g(t, a), be(n, t, null), g(t, r), _ && _.m(t, null), i[56](e), T(v, f, E), ~l && C[l].m(v, E), T(v, c, E), u = !0;
1601
+ },
1602
+ p(v, E) {
1603
+ /*$videoStore*/
1604
+ v[34] ? m ? (m.p(v, E), E[1] & /*$videoStore*/
1605
+ 8 && H(m, 1)) : (m = Vi(v), m.c(), H(m, 1), m.m(t, a)) : m && (Qe(), G(m, 1, 1, () => {
1606
+ m = null;
1607
+ }), Xe());
1608
+ const R = {};
1609
+ E[0] & /*waitingIdrndCaptureEvent*/
1610
+ 1048576 && (R.waitingIdrndCaptureEvent = /*waitingIdrndCaptureEvent*/
1611
+ v[20]), E[0] & /*idrndLoading*/
1612
+ 262144 && (R.idrndLoading = /*idrndLoading*/
1613
+ v[18]), n.$set(R), /*$captured*/
1614
+ v[25] ? _ ? _.p(v, E) : (_ = ji(v), _.c(), _.m(t, null)) : _ && (_.d(1), _ = null);
1615
+ let V = l;
1616
+ l = p(v), l === V ? ~l && C[l].p(v, E) : (o && (Qe(), G(C[V], 1, 1, () => {
1617
+ C[V] = null;
1618
+ }), Xe()), ~l ? (o = C[l], o ? o.p(v, E) : (o = C[l] = b[l](v), o.c()), H(o, 1), o.m(c.parentNode, c)) : o = null);
1619
+ },
1620
+ i(v) {
1621
+ u || (H(m), H(n.$$.fragment, v), H(o), u = !0);
1622
+ },
1623
+ o(v) {
1624
+ G(m), G(n.$$.fragment, v), G(o), u = !1;
1625
+ },
1626
+ d(v) {
1627
+ v && D(e), m && m.d(), ge(n), _ && _.d(), i[56](null), v && D(f), ~l && C[l].d(v), v && D(c);
1628
+ }
1629
+ };
1630
+ }
1631
+ let $a = 0, en = 3e3;
1632
+ function tn() {
1633
+ ({}).VITE_USE_DEV === "true" ? import("./index-idlf-detector_39cfdffa_3.3.0-RC04.js") : import("./index-idlf-detector_a819b3c8_3.3.0-RC04.js");
1634
+ }
1635
+ function sn(i, e, t) {
1636
+ let a, n, r, f, l, o, c, u, m, _, b, C, p, v, E, R, V, x, K, q, A, W, Z, J, I, Re, ie, de, Ce, Ne, Et, re, ei, yt, kt, Tt, ti, ii;
1637
+ O(i, jt, (s) => t(76, a = s)), O(i, it, (s) => t(78, r = s)), O(i, st, (s) => t(79, f = s)), O(i, at, (s) => t(80, l = s)), O(i, Q, (s) => t(22, o = s)), O(i, qe, (s) => t(23, c = s)), O(i, Ws, (s) => t(81, u = s)), O(i, nt, (s) => t(82, m = s)), O(i, we, (s) => t(24, _ = s)), O(i, Ms, (s) => t(83, b = s)), O(i, Fe, (s) => t(25, C = s)), O(i, yi, (s) => t(84, p = s)), O(i, Kt, (s) => t(85, v = s)), O(i, xi, (s) => t(26, E = s)), O(i, ki, (s) => t(86, R = s)), O(i, Us, (s) => t(87, V = s)), O(i, je, (s) => t(88, x = s)), O(i, ke, (s) => t(89, K = s)), O(i, Vs, (s) => t(90, q = s)), O(i, zs, (s) => t(91, A = s)), O(i, Ht, (s) => t(27, W = s)), O(i, qt, (s) => t(28, Z = s)), O(i, me, (s) => t(29, J = s)), O(i, ae, (s) => t(30, I = s)), O(i, Zi, (s) => t(31, Re = s)), O(i, Te, (s) => t(32, ie = s)), O(i, Ti, (s) => t(92, Ce = s)), O(i, ot, (s) => t(93, Ne = s)), O(i, Jt, (s) => t(94, Et = s)), O(i, Je, (s) => t(34, re = s)), O(i, js, (s) => t(95, ei = s)), O(i, lt, (s) => t(96, yt = s)), O(i, Oi, (s) => t(97, kt = s)), O(i, Ri, (s) => t(98, Tt = s)), O(i, Ks, (s) => t(35, ti = s)), O(i, Hs, (s) => t(36, ii = s));
1638
+ let L, ne, ve, si, ai = !1, Pe = !1, Ot = !1, Rt = !1, Dt = (/* @__PURE__ */ new Date()).getTime(), { enableMinutiae: It } = e, { videoDimensions: At } = e, { noTabs: Lt } = e, { weightsPath: Ft } = e, { evaluatePhoto: pe } = e, { showCaptureButton: St } = e, { showUnconformities: ni } = e, { showConfigButton: oi } = e, { showAutoCaptureButton: Nt } = e, { showCameraButton: li } = e, { showJustificationField: ri } = e, { minEyeToEyeDist: Be } = e, { showWatermark: ci } = e, { videoOverlay: ui } = e, { videoOverlayTransparency: fi } = e, { faceDetectionSensitivity: Pt } = e, { hidden: Bt } = e, { livenessBlobSize: di } = e;
1639
+ const Ye = Zt(!1);
1640
+ O(i, Ye, (s) => t(77, n = s));
1641
+ const De = Zt("data:image/png;base64");
1642
+ O(i, De, (s) => t(33, de = s));
1643
+ let { widgetInstance: X } = e, ss = new ya(), We = !1, Wt = !1, Ze = !0, ce = !0, Me = !1, hi = 0, se = "", Mt = 0, xe = !0, mi = 0;
1644
+ const $e = qs.mixin({
1645
+ toast: !0,
1646
+ position: "bottom-left",
1647
+ timer: 13e3,
1648
+ timerProgressBar: !0
1649
+ });
1650
+ Js(async () => {
1651
+ if (Di("Mounting Face Collector!"), h(ot, Ne = !0, Ne), h(qe, c = !1, c), _i(), Ut(), z() ? (tn(), as()) : await Ee(), Ce)
1652
+ try {
1653
+ await Qs(Ft), ai = !0, si = await Xs();
1654
+ } catch {
1655
+ h(Ti, Ce = !1, Ce), t(0, St = !0);
1656
+ }
1657
+ he() || os();
1658
+ });
1659
+ async function Ut() {
1660
+ const [s, y] = (At ?? "")?.replaceAll(" ", "")?.split("x")?.map((k) => k ? parseInt(k) : void 0);
1661
+ !s || !y || (he() ? (await Gs(), h(
1662
+ Je,
1663
+ re = {
1664
+ videoWidth: window.innerWidth,
1665
+ videoHeight: window.innerHeight
1666
+ },
1667
+ re
1668
+ )) : h(Je, re = { videoWidth: s, videoHeight: y }, re));
1669
+ }
1670
+ function _i() {
1671
+ h(it, r = !1, r), h(Fe, C = !1, C), h(nt, m = Qt.FRONT_CAMERA, m), Nt && h(ki, R = !1, R), h(Ht, W = !1, W), h(ae, I = j.OK, I), h(je, x = "", x), h(Te, ie.unconformities = [], ie);
1672
+ const s = _t(Xt);
1673
+ s.closedMouth = !1, s.isPersonCloseEnough = !1, s.isPersonTooclose = !0, s.isPersonInFrame = !1, Xt.set(s), h(ke, K = "", K), h(at, l = !1, l), h(st, f = !0, f);
1674
+ }
1675
+ function as() {
1676
+ X.addEventListener("open", (s) => {
1677
+ const y = s.detail[0].video;
1678
+ h(
1679
+ Ri,
1680
+ Tt = {
1681
+ width: y.videoWidth,
1682
+ height: y.videoHeight
1683
+ },
1684
+ Tt
1685
+ ), t(13, L.srcObject = y.srcObject, L), t(18, Ze = !1), f || Ys(X);
1686
+ function k() {
1687
+ ce || He(L, k, !0);
1688
+ }
1689
+ k();
1690
+ }), X.addEventListener("error", (s) => {
1691
+ oe(s), s.detail[0].message.toLowerCase().includes("device in use") ? h(Q, o = B.CAMERA_IN_USE_ERROR, o) : s.detail[0].message.toLowerCase().includes("permission") ? h(Q, o = B.CAMERA_DENIED_ERROR, o) : s.detail[0].message.toLowerCase().includes("not found") && !he() ? h(Q, o = B.DEVICE_NOT_FOUND_ERROR, o) : h(Q, o = B.CAMERA_DENIED_ERROR, o), t(18, Ze = !1);
1692
+ }), X.addEventListener("faceDetection", (s) => {
1693
+ s.detail[0].errors.length > 0 && Ii(s.detail[0].errors);
1694
+ }), X.addEventListener("detection", (s) => {
1695
+ s.detail[0].errors.length > 0 && Ii(s.detail[0].errors);
1696
+ }), X.addEventListener("close", async (s) => {
1697
+ C || (We = !1), t(19, ce = !0), t(20, Me = !1), o === B.OK && (h(Q, o = B.CAMERA_CLOSED_ERROR, o), setTimeout(
1698
+ () => {
1699
+ cameraDeviceId && ce && Ae();
1700
+ },
1701
+ 500
1702
+ )), setTimeout(
1703
+ () => {
1704
+ ce && Bt && (Di("Reopening camera after close (lost focus on widget)"), Ae());
1705
+ },
1706
+ 1e3
1707
+ );
1708
+ }), X.addEventListener("initialize", async (s) => {
1709
+ Wt = !0, h(Oi, kt = !0, kt);
1710
+ try {
1711
+ X.setLicense(Zs, "faceDetector");
1712
+ } catch (y) {
1713
+ oe("Error setting license:", y);
1714
+ }
1715
+ Et === rt.Face && !We && !C && Wt && await Vt();
1716
+ }), X.addEventListener("capture", async (s) => {
1717
+ t(21, se = "");
1718
+ const { encryptedFile: y, photo: k } = s.detail[0];
1719
+ h(lt, yt = y, yt);
1720
+ const M = (await ct(k)).split(",");
1721
+ if (t(20, Me = !1), h(ae, I = j.OK, I), h(Te, ie.isLoading = !0, ie), h(Fe, C = !0, C), We = !1, h(De, de = M[0], de), h(me, J = M[1], J), h(je, x = M[1], x), !ei) {
1722
+ let ee, Ue, wi, Ci;
1723
+ try {
1724
+ if (f && !Ai(Be))
1725
+ throw new Error("FACE_TOO_SMALL");
1726
+ const te = xs();
1727
+ if (f && te)
1728
+ throw new Error(te);
1729
+ ({ bodyParts: ee, icaoWarnings: Ue } = await ut(x, pe, (await ct(y)).split(",")[1])), window.dispatchEvent(new CustomEvent(
1730
+ "face-unconformities-validated",
1731
+ {
1732
+ detail: {
1733
+ bodyParts: ee,
1734
+ icaoWarnings: Ue,
1735
+ status: I
1736
+ }
1737
+ }
1738
+ ));
1739
+ } catch (te) {
1740
+ oe(te);
1741
+ let ye = Oe.UNKNOWN, Ve = [], Ei = [];
1742
+ te instanceof Gt && te.response?.status === 400 ? te.response.data && Array.isArray(te.response.data.bodyParts) ? (Ve = te.response.data.bodyParts, Ei = te.response.data.icaoWarnings, wi = te.response.data.invalidLivenessCounter, Ci = te.response.data.invalidLivenessLimit, ye = Ve.find((Ps) => Ps.livenessResult.error)?.livenessResult.error_code, h(ae, I = j.LIVENESS_DETECTION_FAILURE, I), t(21, se = Oe[ye]), oe("Liveness error:", ye)) : h(ae, I = j.TEMPLATE_EXTRACTION_ERROR, I) : te instanceof Error && $s.includes(te.message) ? (h(ae, I = j.UNKNOWN_LIVENESS_ERROR, I), ye = te.message, t(21, se = Oe[ye]), Ve = vi(), Ve[0].livenessResult = {
1743
+ error: se,
1744
+ error_code: ye
1745
+ }) : pe && $e.fire({
1746
+ icon: "error",
1747
+ title: "Falha ao comunicar com serviço de Liveness"
1748
+ }), h(Te, ie.isLoading = !1, ie), window.dispatchEvent(new CustomEvent(
1749
+ "face-unconformities-validated",
1750
+ {
1751
+ detail: {
1752
+ bodyParts: Ve,
1753
+ errorCode: ye,
1754
+ translatedError: Re(se),
1755
+ status: I,
1756
+ icaoWarnings: Ei,
1757
+ invalidLivenessCounter: wi,
1758
+ invalidLivenessLimit: Ci
1759
+ }
1760
+ }
1761
+ ));
1762
+ return;
1763
+ }
1764
+ if (I !== j.OK) {
1765
+ Ue && Ke(Ue), h(Te, ie.isLoading = !1, ie);
1766
+ return;
1767
+ }
1768
+ ee[0].livenessResult && bi(ee[0].livenessResult), ee.length !== 0 && ee[0].data && h(me, J = ee[0].data, J), Ke(Ue);
1769
+ return;
1770
+ }
1771
+ let U, $;
1772
+ try {
1773
+ $ = await ea(y), bi($.data);
1774
+ } catch (ee) {
1775
+ h(ae, I = j.UNKNOWN_LIVENESS_ERROR, I), oe(ee), ee instanceof Gt && ee.response?.status === 400 ? (U = ee.response.data.error_code, t(21, se = Oe[U]), oe("Liveness error:", U), h(ae, I = j.LIVENESS_DETECTION_FAILURE, I)) : $e.fire({
1776
+ icon: "error",
1777
+ title: "Falha ao comunicar com serviço de Liveness"
1778
+ });
1779
+ }
1780
+ if (I !== j.OK) {
1781
+ h(Te, ie.isLoading = !1, ie), window.dispatchEvent(new CustomEvent(
1782
+ "face-unconformities-validated",
1783
+ {
1784
+ detail: {
1785
+ bodyParts: [
1786
+ {
1787
+ bodyPart: "FACE",
1788
+ data: x,
1789
+ livenessBlob: (await ct(y)).split(",")[1],
1790
+ ...$ && { livenessResult: $ }
1791
+ }
1792
+ ],
1793
+ ...U && { errorCode: U },
1794
+ ...se && { translatedError: Re(se) },
1795
+ status: I
1796
+ }
1797
+ }
1798
+ ));
1799
+ return;
1800
+ }
1801
+ let { bodyParts: ue, icaoWarnings: Le } = await ut(x, pe);
1802
+ window.dispatchEvent(new CustomEvent(
1803
+ "face-unconformities-validated",
1804
+ {
1805
+ detail: {
1806
+ bodyParts: ue,
1807
+ icaoWarnings: Le,
1808
+ status: I,
1809
+ errorCode: U,
1810
+ ...se && { translatedError: Re(se) }
1811
+ }
1812
+ }
1813
+ )), ue[0].data && h(me, J = ue[0].data, J), Ke(Le);
1814
+ });
1815
+ }
1816
+ async function Ee(s) {
1817
+ if (!xe) {
1818
+ h(Q, o = B.CAMERA_ORIENTATION_PORTRAIT, o);
1819
+ return;
1820
+ }
1821
+ await Ut(), z() ? Vt() : await ns(re.videoWidth, re.videoHeight, s);
1822
+ }
1823
+ async function Vt() {
1824
+ if (z()) {
1825
+ if (await Ut(), !b[0]?.deviceId) {
1826
+ try {
1827
+ await Li(640, 480);
1828
+ } catch (s) {
1829
+ const y = s, k = Se(s) && s.constraint ? s.constraint : "";
1830
+ oe(y.message, k), Se(y) && "message" in y && y.message.includes("Requested device not found") && h(Q, o = B.DEVICE_NOT_FOUND_ERROR, o);
1831
+ }
1832
+ await Yt(), h(we, _ = b[0].deviceId, _);
1833
+ }
1834
+ h(Q, o = B.OK, o), X && "openCamera" in X && X.openCamera(), We = !0, t(19, ce = !1), t(18, Ze = !0);
1835
+ }
1836
+ }
1837
+ async function et() {
1838
+ if (Ce && !ai)
1839
+ return He(L, et);
1840
+ if (L) {
1841
+ if (Et !== rt.Face && !Lt)
1842
+ return He(L, et);
1843
+ h(qe, c = !0, c), h(ot, Ne = !1, Ne), Ce && (n || h(Ye, n = !0, n)), He(L, et);
1844
+ }
1845
+ }
1846
+ async function zt() {
1847
+ if (h(ae, I = j.OK, I), z()) {
1848
+ t(20, Me = !0), X.takePhoto();
1849
+ return;
1850
+ }
1851
+ let s = null;
1852
+ try {
1853
+ if (Ce) {
1854
+ const U = await ua(L, Pt);
1855
+ if (s = U.canvas, h(Fe, C = !0, C), !U.result) {
1856
+ const ee = s.toDataURL("image/jpeg").split(",");
1857
+ throw h(De, de = ee[0], de), h(me, J = ee[1], J), new Error("FACE_NOT_FOUND");
1858
+ }
1859
+ const $ = s.toDataURL("image/jpeg").split(",");
1860
+ h(De, de = $[0], de), h(me, J = $[1], J), h(je, x = $[1], x);
1861
+ let ue, Le;
1862
+ if (!Ai(Be))
1863
+ throw new Error("FACE_TOO_SMALL");
1864
+ ({ bodyParts: ue, icaoWarnings: Le } = await ut(J, pe)), window.dispatchEvent(new CustomEvent(
1865
+ "face-unconformities-validated",
1866
+ {
1867
+ detail: {
1868
+ bodyParts: ue,
1869
+ icaoWarnings: Le,
1870
+ status: I
1871
+ }
1872
+ }
1873
+ )), ue.length !== 0 && ue[0].data && h(me, J = ue[0].data, J), Ke(Le);
1874
+ return;
1875
+ }
1876
+ h(Fe, C = !0, C);
1877
+ const y = await ls();
1878
+ h(De, de = y[0], de), h(me, J = y[1], J), h(je, x = y[1], x);
1879
+ let { bodyParts: k, icaoWarnings: M } = await ut(J, pe);
1880
+ window.dispatchEvent(new CustomEvent(
1881
+ "face-unconformities-validated",
1882
+ {
1883
+ detail: {
1884
+ bodyParts: k,
1885
+ icaoWarnings: M,
1886
+ status: I
1887
+ }
1888
+ }
1889
+ )), k.length !== 0 && k[0].data && h(me, J = k[0].data, J), Ke(M);
1890
+ } catch (y) {
1891
+ oe(y);
1892
+ let k = Oe.UNKNOWN, M = [], U = [];
1893
+ if (y instanceof Gt && y.response?.status === 400)
1894
+ if (y.response.data && Array.isArray(y.response.data.bodyParts)) {
1895
+ M = y.response.data.bodyParts, U = y.response.data.icaoWarnings;
1896
+ const $ = M.find((ue) => ue.livenessResult.error);
1897
+ k = $?.livenessResult.error_code, h(ae, I = j.LIVENESS_DETECTION_FAILURE, I), $?.livenessResult.error_code || h(ae, I = j.UNKNOWN_LIVENESS_ERROR, I), t(21, se = Oe[k]), oe("Liveness error:", k);
1898
+ } else
1899
+ h(ae, I = j.TEMPLATE_EXTRACTION_ERROR, I);
1900
+ else
1901
+ y instanceof Error && ["FACE_NOT_FOUND", "FACE_TOO_SMALL"].includes(y.message) ? (h(ae, I = j.LIVENESS_DETECTION_FAILURE, I), k = y.message, t(21, se = Oe[k]), M = vi()) : (h(ae, I = j.UNABLE_TO_COMMUNICATE_WITH_TEMPLATE_EXTRACTION_SERVICE, I), pe && $e.fire({
1902
+ icon: "error",
1903
+ title: "Falha ao comunicar com serviço de Liveness"
1904
+ }));
1905
+ h(Te, ie.isLoading = !1, ie), window.dispatchEvent(new CustomEvent(
1906
+ "face-unconformities-validated",
1907
+ {
1908
+ detail: {
1909
+ bodyParts: M,
1910
+ errorCode: k,
1911
+ translatedError: Re(se),
1912
+ status: I,
1913
+ icaoWarnings: U
1914
+ }
1915
+ }
1916
+ ));
1917
+ }
1918
+ }
1919
+ function tt() {
1920
+ const s = {
1921
+ bodyPart: "FACE",
1922
+ data: J,
1923
+ justification: Z
1924
+ };
1925
+ h(Ht, W = !0, W), _t(lt) && ct(_t(lt)).then((y) => {
1926
+ s.livenessBlob = y.split(",")[1];
1927
+ }), window.dispatchEvent(new CustomEvent("export-face", { detail: s }));
1928
+ }
1929
+ function Ie() {
1930
+ window.dispatchEvent(new CustomEvent("face-scrapped")), _i(), ce && Vt();
1931
+ }
1932
+ function bi(s) {
1933
+ let y = "", k = "success";
1934
+ s.isAlive ? y = `Vivacidade de face (${s.face_liveness.probability.toFixed(2)}) e de captura (${s.capture_liveness.probability}, ${s.capture_liveness.score.toFixed(2)}) verificados!` : s?.face_liveness?.probability && (k = "error", y = `Vivacidade de face (${s.face_liveness.probability.toFixed(2)}) e de captura (${s.capture_liveness.probability}, ${s.capture_liveness.score.toFixed(2)}) insuficientes!`), A && $e.fire({ icon: k, title: y });
1935
+ }
1936
+ async function ns(s, y, k) {
1937
+ try {
1938
+ const { stream: M, deviceId: U } = await Li(q.width, q.height, m, k);
1939
+ h(yi, p = M, p), h(we, _ = U || b[0].deviceId, _);
1940
+ } catch (M) {
1941
+ const U = M, $ = Se(M) && M.constraint ? M.constraint : "";
1942
+ oe(U.message, $), Se(U) && "message" in U && U.message.toLowerCase().includes("permission") ? (oe("User didn't give permission to use camera!"), h(Q, o = B.CAMERA_DENIED_ERROR, o)) : Se(U) && "message" in U && U.message.toLowerCase().includes("not found") && !he() ? h(Q, o = B.DEVICE_NOT_FOUND_ERROR, o) : $.includes("width") || $.includes("height") ? (oe(`Camera does not meet the minimum supported requirements! (${$})`), h(Q, o = B.CAMERA_UNSUPPORTED, o)) : (h(Q, o = B.CAMERA_DENIED_ERROR, o), oe("Unable to open camera!"));
1943
+ }
1944
+ }
1945
+ async function Ae() {
1946
+ h(we, _ = "", _), await Ee();
1947
+ }
1948
+ function os() {
1949
+ navigator.mediaDevices.ondevicechange = async (s) => {
1950
+ s.type == "devicechange" && (await Yt(), o !== B.OK ? await Ae() : (!z() && !p.active || z() && !ce) && (ft(X), h(Q, o = B.DEVICE_NOT_FOUND_ERROR, o), t(19, ce = !0)));
1951
+ };
1952
+ }
1953
+ async function gi() {
1954
+ h(it, r = !1, r);
1955
+ const s = (/* @__PURE__ */ new Date()).getTime();
1956
+ if (s - Dt > 5e3) {
1957
+ Dt = s;
1958
+ try {
1959
+ if (L.width === 0 || L.height === 0)
1960
+ return;
1961
+ const k = await fa(L);
1962
+ if (k < 50) {
1963
+ h(ke, K = "faceCollector.illuminationTooLow", K);
1964
+ return;
1965
+ }
1966
+ if (k > 180) {
1967
+ h(ke, K = "faceCollector.illuminationTooHigh", K);
1968
+ return;
1969
+ }
1970
+ } catch (k) {
1971
+ Fi("An error occurred while getting the video lighting level: ", k);
1972
+ }
1973
+ try {
1974
+ if (await da(L) < 4.5) {
1975
+ h(ke, K = "faceCollector.lowSharpness", K);
1976
+ return;
1977
+ }
1978
+ } catch (k) {
1979
+ Fi("An error occurred while getting the video sharpness level: ", k);
1980
+ }
1981
+ h(ke, K = "faceCollector.faceWasNotFound", K);
1982
+ } else
1983
+ Ot || (Ot = !0, setTimeout(
1984
+ () => {
1985
+ let k = [
1986
+ "faceCollector.faceWasNotFound",
1987
+ "faceCollector.illuminationTooLow",
1988
+ "faceCollector.lowSharpness",
1989
+ "faceCollector.illuminationTooHigh"
1990
+ ];
1991
+ Ot = !1, t(17, Rt = !1), K && !k.includes(K) && h(ke, K = "", K);
1992
+ },
1993
+ 1500
1994
+ ));
1995
+ }
1996
+ function vi() {
1997
+ return [
1998
+ {
1999
+ bodyPart: "FACE",
2000
+ data: x,
2001
+ format: "jpg",
2002
+ capturedEyeToEyeDist: V,
2003
+ minEyeToEyeDist: Be
2004
+ }
2005
+ ];
2006
+ }
2007
+ async function ls() {
2008
+ const s = document.createElement("canvas"), y = s.getContext("2d");
2009
+ return s.width = L.width, s.height = L.height, y?.drawImage(L, 0, 0, s.width, s.height), s.toDataURL("image/jpeg").split(",");
2010
+ }
2011
+ const rs = Xt.subscribe((s) => {
2012
+ let y = "";
2013
+ if (s.isPersonCloseEnough ? s.isPersonTooclose ? y = "faceCollector.moveAwayCamera" : s.isPersonInFrame ? s.closedMouth || (y = "faceCollector.dontOpenMouth") : y = "faceCollector.stayInFrame" : y = "faceCollector.comeCloserCamera", r && ta(y), !C && R && r && !E && !Pe && s.isPersonInFrame && s.closedMouth && !(!s.isPersonCloseEnough || s.isPersonTooclose)) {
2014
+ t(16, Pe = !0), mi = (/* @__PURE__ */ new Date()).getTime() + en;
2015
+ const k = setInterval(
2016
+ async () => {
2017
+ if (!R || C || E || Me || z() && ce || !s.isPersonCloseEnough || s.isPersonTooclose || !s.closedMouth || !s.isPersonInFrame) {
2018
+ t(16, Pe = !1), setTimeout(
2019
+ () => {
2020
+ },
2021
+ 1500
2022
+ ), clearInterval(k);
2023
+ return;
2024
+ }
2025
+ const M = (/* @__PURE__ */ new Date()).getTime();
2026
+ Math.floor((mi - M) % (1e3 * 60) / 1e3) <= 0 && (clearInterval(k), t(16, Pe = !1), zt());
2027
+ },
2028
+ 100
2029
+ );
2030
+ }
2031
+ }), cs = Fe.subscribe((s) => {
2032
+ ve && (s ? (ve.classList.remove("flex"), ve.classList.add("hidden")) : (ve.classList.add("flex"), ve.classList.remove("hidden")));
2033
+ }), us = Kt.subscribe((s) => {
2034
+ L && s && (dt("setting null in video srcObject"), t(13, L.srcObject = null, L), t(13, L.src = "", L), h(we, _ = null, _));
2035
+ });
2036
+ Jt.subscribe(async (s) => {
2037
+ s === rt.Face && (await Yt(), z() && h(we, _ = b[0]?.deviceId, _));
2038
+ });
2039
+ const fs = we.subscribe(async (s) => {
2040
+ if (!(!z() && !p || !s || z() && ce))
2041
+ try {
2042
+ if (z()) {
2043
+ await ft(X), await Ee();
2044
+ return;
2045
+ }
2046
+ t(13, L.srcObject = p, L), h(Kt, v = !1, v), xe ? h(Q, o = B.OK, o) : h(Q, o = B.CAMERA_ORIENTATION_PORTRAIT, o), p.getTracks().forEach((y) => {
2047
+ y.readyState === "live" && dt(`Camera ${y.label} (${y.id}) opened successfully!`);
2048
+ }), h(Q, o = B.OK, o), ia(L);
2049
+ } catch (y) {
2050
+ const k = y;
2051
+ t(19, ce = !0), Se(k) && "message" in k && k.message.includes("Requested device not found") && h(Q, o = B.DEVICE_NOT_FOUND_ERROR, o);
2052
+ }
2053
+ }), ds = Jt.subscribe(async (s) => {
2054
+ s === rt.Face && z() && !We && !C && Wt && await Ee();
2055
+ }), hs = Ye.subscribe(async (s) => {
2056
+ s && pi();
2057
+ }), ms = sa.subscribe(async (s) => {
2058
+ if (b[0]?.deviceId) {
2059
+ if (ft(), !he() || z()) {
2060
+ const k = (b.findIndex((U) => U.deviceId === _) + 1) % b.length, M = b[k].deviceId;
2061
+ z() ? h(we, _ = M, _) : await Ee(M);
2062
+ return;
2063
+ }
2064
+ s ? (h(nt, m = Qt.REAR_CAMERA, m), await Ee()) : (h(nt, m = Qt.FRONT_CAMERA, m), await Ee());
2065
+ }
2066
+ }), _s = aa.subscribe(async (s) => {
2067
+ !s.isSupported || !he() || u != "FACE" || (xe = s.orientation.includes("portrait"), xe ? L && !c ? await Ae() : c && h(Q, o = B.OK, o) : h(Q, o = B.CAMERA_ORIENTATION_PORTRAIT, o));
2068
+ }), bs = xt.subscribe((s) => {
2069
+ s && window.dispatchEvent(new CustomEvent("console-open-status", { detail: { isOpen: s } }));
2070
+ }), gs = at.subscribe(async (s) => {
2071
+ dt("CaptureFace event received:", s), s && (h(st, f = !1, f), await zt(), h(at, l = !1, l), h(st, f = !0, f));
2072
+ });
2073
+ async function pi() {
2074
+ let s;
2075
+ try {
2076
+ if (Mt >= $a) {
2077
+ Mt = 0;
2078
+ let y;
2079
+ if (y = wa(L, si), s = await y.withFaceLandmarks(), ne.getContext("2d")?.clearRect(0, 0, ne.width, ne.height), s != null) {
2080
+ const k = Ca(ne, L, !0);
2081
+ na(ne, L, k);
2082
+ const M = Ea(s, k);
2083
+ oa(M) ? (la(M, ne, It), h(it, r = !0, r), t(17, Rt = !0), Dt = (/* @__PURE__ */ new Date()).getTime()) : gi();
2084
+ } else
2085
+ gi();
2086
+ } else
2087
+ Mt++;
2088
+ } catch {
2089
+ } finally {
2090
+ n && He(L, pi);
2091
+ }
2092
+ }
2093
+ jt.subscribe(async (s) => {
2094
+ s && (Ie(), h(jt, a = !1, a));
2095
+ });
2096
+ const vs = qe.subscribe((s) => {
2097
+ s && window.dispatchEvent(new CustomEvent("brycc-camera-ready"));
2098
+ }), ps = ot.subscribe((s) => {
2099
+ s && window.dispatchEvent(new CustomEvent("brycc-face-initialized"));
2100
+ });
2101
+ ra(() => {
2102
+ dt("Destroying face collector"), ft(X), cs(), rs(), us(), fs(), ds(), clearInterval(hi), hs(), ms(), _s(), bs(), gs(), vs(), ps(), hi = 0, ss.stopDetection();
2103
+ });
2104
+ function ws(s) {
2105
+ mt[s ? "unshift" : "push"](() => {
2106
+ X = s, t(1, X);
2107
+ });
2108
+ }
2109
+ function Cs(s) {
2110
+ mt[s ? "unshift" : "push"](() => {
2111
+ L = s, t(13, L);
2112
+ });
2113
+ }
2114
+ const Es = () => {
2115
+ z() || (t(13, L.width = re.videoWidth, L), t(13, L.height = re.videoHeight, L), t(14, ne.width = re.videoWidth, ne), t(14, ne.height = re.videoHeight, ne));
2116
+ };
2117
+ function ys(s) {
2118
+ mt[s ? "unshift" : "push"](() => {
2119
+ ne = s, t(14, ne);
2120
+ });
2121
+ }
2122
+ const ks = () => tt(), Ts = () => Ie();
2123
+ function Os(s) {
2124
+ mt[s ? "unshift" : "push"](() => {
2125
+ ve = s, t(15, ve);
2126
+ });
2127
+ }
2128
+ const Rs = () => tt(), Ds = () => Ie();
2129
+ function Is() {
2130
+ Z = this.value, qt.set(Z);
2131
+ }
2132
+ const As = () => tt(), Ls = () => Ie();
2133
+ function Fs() {
2134
+ Z = this.value, qt.set(Z);
2135
+ }
2136
+ const Ss = () => Ie(), Ns = async () => {
2137
+ await Ae();
2138
+ };
2139
+ return i.$$set = (s) => {
2140
+ "enableMinutiae" in s && t(43, It = s.enableMinutiae), "videoDimensions" in s && t(44, At = s.videoDimensions), "noTabs" in s && t(45, Lt = s.noTabs), "weightsPath" in s && t(46, Ft = s.weightsPath), "evaluatePhoto" in s && t(2, pe = s.evaluatePhoto), "showCaptureButton" in s && t(0, St = s.showCaptureButton), "showUnconformities" in s && t(3, ni = s.showUnconformities), "showConfigButton" in s && t(4, oi = s.showConfigButton), "showAutoCaptureButton" in s && t(5, Nt = s.showAutoCaptureButton), "showCameraButton" in s && t(6, li = s.showCameraButton), "showJustificationField" in s && t(7, ri = s.showJustificationField), "minEyeToEyeDist" in s && t(47, Be = s.minEyeToEyeDist), "showWatermark" in s && t(8, ci = s.showWatermark), "videoOverlay" in s && t(9, ui = s.videoOverlay), "videoOverlayTransparency" in s && t(10, fi = s.videoOverlayTransparency), "faceDetectionSensitivity" in s && t(48, Pt = s.faceDetectionSensitivity), "hidden" in s && t(49, Bt = s.hidden), "livenessBlobSize" in s && t(11, di = s.livenessBlobSize), "widgetInstance" in s && t(1, X = s.widgetInstance);
2141
+ }, [
2142
+ St,
2143
+ X,
2144
+ pe,
2145
+ ni,
2146
+ oi,
2147
+ Nt,
2148
+ li,
2149
+ ri,
2150
+ ci,
2151
+ ui,
2152
+ fi,
2153
+ di,
2154
+ et,
2155
+ L,
2156
+ ne,
2157
+ ve,
2158
+ Pe,
2159
+ Rt,
2160
+ Ze,
2161
+ ce,
2162
+ Me,
2163
+ se,
2164
+ o,
2165
+ c,
2166
+ _,
2167
+ C,
2168
+ E,
2169
+ W,
2170
+ Z,
2171
+ J,
2172
+ I,
2173
+ Re,
2174
+ ie,
2175
+ de,
2176
+ re,
2177
+ ti,
2178
+ ii,
2179
+ Ye,
2180
+ De,
2181
+ zt,
2182
+ tt,
2183
+ Ie,
2184
+ Ae,
2185
+ It,
2186
+ At,
2187
+ Lt,
2188
+ Ft,
2189
+ Be,
2190
+ Pt,
2191
+ Bt,
2192
+ ws,
2193
+ Cs,
2194
+ Es,
2195
+ ys,
2196
+ ks,
2197
+ Ts,
2198
+ Os,
2199
+ Rs,
2200
+ Ds,
2201
+ Is,
2202
+ As,
2203
+ Ls,
2204
+ Fs,
2205
+ Ss,
2206
+ Ns
2207
+ ];
2208
+ }
2209
+ class an extends gt {
2210
+ constructor(e) {
2211
+ super(), vt(
2212
+ this,
2213
+ {
2214
+ target: this.shadowRoot,
2215
+ props: wt(this.attributes),
2216
+ customElement: !0
2217
+ },
2218
+ sn,
2219
+ xa,
2220
+ pt,
2221
+ {
2222
+ enableMinutiae: 43,
2223
+ videoDimensions: 44,
2224
+ noTabs: 45,
2225
+ weightsPath: 46,
2226
+ evaluatePhoto: 2,
2227
+ showCaptureButton: 0,
2228
+ showUnconformities: 3,
2229
+ showConfigButton: 4,
2230
+ showAutoCaptureButton: 5,
2231
+ showCameraButton: 6,
2232
+ showJustificationField: 7,
2233
+ minEyeToEyeDist: 47,
2234
+ showWatermark: 8,
2235
+ videoOverlay: 9,
2236
+ videoOverlayTransparency: 10,
2237
+ faceDetectionSensitivity: 48,
2238
+ hidden: 49,
2239
+ livenessBlobSize: 11,
2240
+ widgetInstance: 1,
2241
+ play: 12
2242
+ },
2243
+ null,
2244
+ [-1, -1, -1, -1, -1]
2245
+ ), e && (e.target && T(e.target, this, e.anchor), e.props && (this.$set(e.props), N()));
2246
+ }
2247
+ static get observedAttributes() {
2248
+ return [
2249
+ "enableMinutiae",
2250
+ "videoDimensions",
2251
+ "noTabs",
2252
+ "weightsPath",
2253
+ "evaluatePhoto",
2254
+ "showCaptureButton",
2255
+ "showUnconformities",
2256
+ "showConfigButton",
2257
+ "showAutoCaptureButton",
2258
+ "showCameraButton",
2259
+ "showJustificationField",
2260
+ "minEyeToEyeDist",
2261
+ "showWatermark",
2262
+ "videoOverlay",
2263
+ "videoOverlayTransparency",
2264
+ "faceDetectionSensitivity",
2265
+ "hidden",
2266
+ "livenessBlobSize",
2267
+ "widgetInstance",
2268
+ "play"
2269
+ ];
2270
+ }
2271
+ get enableMinutiae() {
2272
+ return this.$$.ctx[43];
2273
+ }
2274
+ set enableMinutiae(e) {
2275
+ this.$$set({ enableMinutiae: e }), N();
2276
+ }
2277
+ get videoDimensions() {
2278
+ return this.$$.ctx[44];
2279
+ }
2280
+ set videoDimensions(e) {
2281
+ this.$$set({ videoDimensions: e }), N();
2282
+ }
2283
+ get noTabs() {
2284
+ return this.$$.ctx[45];
2285
+ }
2286
+ set noTabs(e) {
2287
+ this.$$set({ noTabs: e }), N();
2288
+ }
2289
+ get weightsPath() {
2290
+ return this.$$.ctx[46];
2291
+ }
2292
+ set weightsPath(e) {
2293
+ this.$$set({ weightsPath: e }), N();
2294
+ }
2295
+ get evaluatePhoto() {
2296
+ return this.$$.ctx[2];
2297
+ }
2298
+ set evaluatePhoto(e) {
2299
+ this.$$set({ evaluatePhoto: e }), N();
2300
+ }
2301
+ get showCaptureButton() {
2302
+ return this.$$.ctx[0];
2303
+ }
2304
+ set showCaptureButton(e) {
2305
+ this.$$set({ showCaptureButton: e }), N();
2306
+ }
2307
+ get showUnconformities() {
2308
+ return this.$$.ctx[3];
2309
+ }
2310
+ set showUnconformities(e) {
2311
+ this.$$set({ showUnconformities: e }), N();
2312
+ }
2313
+ get showConfigButton() {
2314
+ return this.$$.ctx[4];
2315
+ }
2316
+ set showConfigButton(e) {
2317
+ this.$$set({ showConfigButton: e }), N();
2318
+ }
2319
+ get showAutoCaptureButton() {
2320
+ return this.$$.ctx[5];
2321
+ }
2322
+ set showAutoCaptureButton(e) {
2323
+ this.$$set({ showAutoCaptureButton: e }), N();
2324
+ }
2325
+ get showCameraButton() {
2326
+ return this.$$.ctx[6];
2327
+ }
2328
+ set showCameraButton(e) {
2329
+ this.$$set({ showCameraButton: e }), N();
2330
+ }
2331
+ get showJustificationField() {
2332
+ return this.$$.ctx[7];
2333
+ }
2334
+ set showJustificationField(e) {
2335
+ this.$$set({ showJustificationField: e }), N();
2336
+ }
2337
+ get minEyeToEyeDist() {
2338
+ return this.$$.ctx[47];
2339
+ }
2340
+ set minEyeToEyeDist(e) {
2341
+ this.$$set({ minEyeToEyeDist: e }), N();
2342
+ }
2343
+ get showWatermark() {
2344
+ return this.$$.ctx[8];
2345
+ }
2346
+ set showWatermark(e) {
2347
+ this.$$set({ showWatermark: e }), N();
2348
+ }
2349
+ get videoOverlay() {
2350
+ return this.$$.ctx[9];
2351
+ }
2352
+ set videoOverlay(e) {
2353
+ this.$$set({ videoOverlay: e }), N();
2354
+ }
2355
+ get videoOverlayTransparency() {
2356
+ return this.$$.ctx[10];
2357
+ }
2358
+ set videoOverlayTransparency(e) {
2359
+ this.$$set({ videoOverlayTransparency: e }), N();
2360
+ }
2361
+ get faceDetectionSensitivity() {
2362
+ return this.$$.ctx[48];
2363
+ }
2364
+ set faceDetectionSensitivity(e) {
2365
+ this.$$set({ faceDetectionSensitivity: e }), N();
2366
+ }
2367
+ get hidden() {
2368
+ return this.$$.ctx[49];
2369
+ }
2370
+ set hidden(e) {
2371
+ this.$$set({ hidden: e }), N();
2372
+ }
2373
+ get livenessBlobSize() {
2374
+ return this.$$.ctx[11];
2375
+ }
2376
+ set livenessBlobSize(e) {
2377
+ this.$$set({ livenessBlobSize: e }), N();
2378
+ }
2379
+ get widgetInstance() {
2380
+ return this.$$.ctx[1];
2381
+ }
2382
+ set widgetInstance(e) {
2383
+ this.$$set({ widgetInstance: e }), N();
2384
+ }
2385
+ get play() {
2386
+ return this.$$.ctx[12];
2387
+ }
2388
+ }
2389
+ customElements.define("face-collector", an);
2390
+ export {
2391
+ an as default
2392
+ };