bry-biometric-collector 3.2.1 → 3.3.0-RC02

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