bry-biometric-collector 2.2.22 → 2.2.23

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.
@@ -1,2000 +0,0 @@
1
- import { S as Mi, q as Bi, r as Xt, t as Ui, w as S, x as b, y as F, z as te, B as u, C as Re, D as c, E as me, G as U, H as D, I as L, J as lt, $ as Wi, K as d, L as oe, M as V, N, O as G, P as He, Q as ee, R as je, T as Mt, U as va, V as mt, W as Le, X as Ca, Y as Se, Z as We, _ as Bt, a0 as ni, a1 as Ut, a2 as Ea, a3 as oi, a4 as De, a5 as tt, a6 as ce, a7 as Wt, a8 as Vt, a9 as ye, aa as wa, ab as ka, ac as ya, ad as ri, ae as ht, af as _t, ag as Kt, ah as Ra, ai as bt, aj as ci, ak as ui, al as gt, am as fi, an as Ta, ao as Oa, ap as Ia, aq as Aa, ar as Pa, as as Ht, at as La, au as Q, av as pt, aw as vt, A as jt, ax as it, ay as Ct, az as Sa, aA as di, aB as qt, d as Et, aC as wt, aD as zt, aE as Da, aF as Jt, aG as Na, aH as Fa, aI as Ma, aJ as Ve, aK as Ba, aL as mi, aM as Rt, aN as Ua, aO as qe, aP as ze, aQ as Je, aR as st, aS as Qt, aT as hi, aU as _i, j as kt, aV as Wa, aW as Va, aX as Ka, aY as Ke, aZ as at, a_ as Ha, a$ as ja, b0 as bi, b1 as qa, b2 as yt, b3 as za } from "./main_140d65a3_2.2.22.js";
2
- import { C as H, c as re, a as Ja, T as Xa, b as Qa } from "./TakePictureBtn_98c2ad5f_2.2.22.js";
3
- function Ga(a) {
4
- let e, t, l = (
5
- /*$_*/
6
- a[0]("buttons.startCapture") + ""
7
- ), s, n, m;
8
- return {
9
- c() {
10
- e = b("div"), t = b("button"), s = F(l), this.c = te, u(t, "class", Re() ? "ce-dui-btn ce-dui-btn-primary text-base text-xl pb-[2px] absolute z-20 bottom-10" : "ce-dui-btn ce-dui-btn-primary text-base text-xl pb-[2px] absolute z-20 bottom-2"), u(e, "class", "flex justify-center items-center");
11
- },
12
- m(r, o) {
13
- S(r, e, o), c(e, t), c(t, s), n || (m = me(
14
- t,
15
- "click",
16
- /*click_handler*/
17
- a[2]
18
- ), n = !0);
19
- },
20
- p(r, [o]) {
21
- o & /*$_*/
22
- 1 && l !== (l = /*$_*/
23
- r[0]("buttons.startCapture") + "") && U(s, l);
24
- },
25
- i: te,
26
- o: te,
27
- d(r) {
28
- r && D(e), n = !1, m();
29
- }
30
- };
31
- }
32
- function Ya(a, e, t) {
33
- let l, s;
34
- L(a, lt, (r) => t(3, l = r)), L(a, Wi, (r) => t(0, s = r));
35
- function n() {
36
- d(lt, l = !0, l);
37
- }
38
- return [s, n, () => n()];
39
- }
40
- class Vi extends Mi {
41
- constructor(e) {
42
- super(), Bi(
43
- this,
44
- {
45
- target: this.shadowRoot,
46
- props: Ui(this.attributes),
47
- customElement: !0
48
- },
49
- Ya,
50
- Ga,
51
- Xt,
52
- {},
53
- null
54
- ), e && e.target && S(e.target, this, e.anchor);
55
- }
56
- }
57
- customElements.define("start-auto-capture-btn", Vi);
58
- function gi(a, e, t) {
59
- const l = a.slice();
60
- return l[117] = e[t], l;
61
- }
62
- function Za(a) {
63
- let e;
64
- return {
65
- c() {
66
- e = b("idlive-face-capture"), e.hidden = !0, at(e, "mask_hidden", ""), at(e, "auto_capture_disabled", ""), at(e, "auto_close_disabled", ""), at(
67
- e,
68
- "device_id",
69
- /*$selectedVideoDeviceId*/
70
- a[21]
71
- );
72
- },
73
- m(t, l) {
74
- S(t, e, l), a[53](e);
75
- },
76
- p(t, l) {
77
- l[0] & /*$selectedVideoDeviceId*/
78
- 2097152 && at(
79
- e,
80
- "device_id",
81
- /*$selectedVideoDeviceId*/
82
- t[21]
83
- );
84
- },
85
- d(t) {
86
- t && D(e), a[53](null);
87
- }
88
- };
89
- }
90
- function pi(a) {
91
- let e, t, l;
92
- return {
93
- c() {
94
- e = b("video"), u(e, "id", "bry-cc-camera-video-tag"), u(e, "class", "absolute -z-10"), e.playsInline = !0, e.muted = !0, e.autoplay = !0;
95
- },
96
- m(s, n) {
97
- S(s, e, n), a[54](e), t || (l = [
98
- me(
99
- e,
100
- "canplay",
101
- /*canplay_handler*/
102
- a[55]
103
- ),
104
- me(
105
- e,
106
- "play",
107
- /*play*/
108
- a[8],
109
- { once: !0 }
110
- )
111
- ], t = !0);
112
- },
113
- p: te,
114
- d(s) {
115
- s && D(e), a[54](null), t = !1, Rt(l);
116
- }
117
- };
118
- }
119
- function vi(a) {
120
- let e, t;
121
- return e = new Ua({}), {
122
- c() {
123
- qe(e.$$.fragment);
124
- },
125
- m(l, s) {
126
- ze(e, l, s), t = !0;
127
- },
128
- i(l) {
129
- t || (G(e.$$.fragment, l), t = !0);
130
- },
131
- o(l) {
132
- ee(e.$$.fragment, l), t = !1;
133
- },
134
- d(l) {
135
- Je(e, l);
136
- }
137
- };
138
- }
139
- function Ci(a) {
140
- let e, t;
141
- return e = new Ja({}), {
142
- c() {
143
- qe(e.$$.fragment);
144
- },
145
- m(l, s) {
146
- ze(e, l, s), t = !0;
147
- },
148
- i(l) {
149
- t || (G(e.$$.fragment, l), t = !0);
150
- },
151
- o(l) {
152
- ee(e.$$.fragment, l), t = !1;
153
- },
154
- d(l) {
155
- Je(e, l);
156
- }
157
- };
158
- }
159
- function Ei(a) {
160
- let e, t;
161
- return e = new Vi({}), {
162
- c() {
163
- qe(e.$$.fragment);
164
- },
165
- m(l, s) {
166
- ze(e, l, s), t = !0;
167
- },
168
- i(l) {
169
- t || (G(e.$$.fragment, l), t = !0);
170
- },
171
- o(l) {
172
- ee(e.$$.fragment, l), t = !1;
173
- },
174
- d(l) {
175
- Je(e, l);
176
- }
177
- };
178
- }
179
- function wi(a) {
180
- let e, t;
181
- return e = new Xa({
182
- props: {
183
- disabled: !/*$faceFound*/
184
- a[36] && /*$enableFaceApi*/
185
- a[34] || !/*$ready*/
186
- a[35] && !/*$enableFaceApi*/
187
- a[34],
188
- hidden: (
189
- /*$cameraStatusStore*/
190
- a[20] !== H.OK || V() && /*idrndLoading*/
191
- (a[16] || /*idrndClosed*/
192
- a[17] || /*waitingIdrndCaptureEvent*/
193
- a[18])
194
- ),
195
- handler: (
196
- /*capture*/
197
- a[42]
198
- )
199
- }
200
- }), {
201
- c() {
202
- qe(e.$$.fragment);
203
- },
204
- m(l, s) {
205
- ze(e, l, s), t = !0;
206
- },
207
- p(l, s) {
208
- const n = {};
209
- s[1] & /*$faceFound, $enableFaceApi, $ready*/
210
- 56 && (n.disabled = !/*$faceFound*/
211
- l[36] && /*$enableFaceApi*/
212
- l[34] || !/*$ready*/
213
- l[35] && !/*$enableFaceApi*/
214
- l[34]), s[0] & /*$cameraStatusStore, idrndLoading, idrndClosed, waitingIdrndCaptureEvent*/
215
- 1507328 && (n.hidden = /*$cameraStatusStore*/
216
- l[20] !== H.OK || V() && /*idrndLoading*/
217
- (l[16] || /*idrndClosed*/
218
- l[17] || /*waitingIdrndCaptureEvent*/
219
- l[18])), e.$set(n);
220
- },
221
- i(l) {
222
- t || (G(e.$$.fragment, l), t = !0);
223
- },
224
- o(l) {
225
- ee(e.$$.fragment, l), t = !1;
226
- },
227
- d(l) {
228
- Je(e, l);
229
- }
230
- };
231
- }
232
- function ki(a) {
233
- let e, t = (
234
- /*$_*/
235
- a[32]("faceCollector.stayStill") + ""
236
- ), l;
237
- return {
238
- c() {
239
- e = b("span"), l = F(t), u(e, "class", "absolute left-1/2 -translate-x-1/2 ce-dui-badge ce-dui-badge-lg h-[2em] text-2xl xl:text-base w-[12.1em] " + (Re() ? "top-[10%]" : "top-[3%]"));
240
- },
241
- m(s, n) {
242
- S(s, e, n), c(e, l);
243
- },
244
- p(s, n) {
245
- n[1] & /*$_*/
246
- 2 && t !== (t = /*$_*/
247
- s[32]("faceCollector.stayStill") + "") && U(l, t);
248
- },
249
- d(s) {
250
- s && D(e);
251
- }
252
- };
253
- }
254
- function yi(a) {
255
- let e, t = (
256
- /*$_*/
257
- a[32](`${/*$faceValidationAlert*/
258
- a[26]}`) + ""
259
- ), l;
260
- return {
261
- c() {
262
- e = b("span"), l = F(t), u(e, "class", "absolute left-1/2 -translate-x-1/2 ce-dui-badge ce-dui-badge-lg h-[2em] text-2xl xl:text-base w-[12.1em] " + (Re() ? "top-[10%]" : "top-[3%]"));
263
- },
264
- m(s, n) {
265
- S(s, e, n), c(e, l);
266
- },
267
- p(s, n) {
268
- n[0] & /*$faceValidationAlert*/
269
- 67108864 | n[1] & /*$_*/
270
- 2 && t !== (t = /*$_*/
271
- s[32](`${/*$faceValidationAlert*/
272
- s[26]}`) + "") && U(l, t);
273
- },
274
- d(s) {
275
- s && D(e);
276
- }
277
- };
278
- }
279
- function Ri(a) {
280
- let e, t, l, s, n;
281
- function m(f, h) {
282
- return (
283
- /*$isLoading*/
284
- f[37] ? $a : xa
285
- );
286
- }
287
- let r = m(a), o = r(a);
288
- return {
289
- c() {
290
- e = b("slot"), t = b("div"), l = b("img"), n = N(), o.c(), st(l.src, s = Qt) || u(l, "src", s), u(l, "alt", "loading gif"), u(l, "class", "m-auto h-[10em] lg:h-[12em]"), u(t, "class", "translate-y-1/3 md:translate-y-1/4 xl:translate-y-1/2"), u(e, "name", "loading-camera-gif"), u(e, "class", "block h-[17em] lg:h-[21.6em] xl:h-[30em]");
291
- },
292
- m(f, h) {
293
- S(f, e, h), c(e, t), c(t, l), c(t, n), o.m(t, null);
294
- },
295
- p(f, h) {
296
- r === (r = m(f)) && o ? o.p(f, h) : (o.d(1), o = r(f), o && (o.c(), o.m(t, null)));
297
- },
298
- d(f) {
299
- f && D(e), o.d();
300
- }
301
- };
302
- }
303
- function xa(a) {
304
- let e, t = (
305
- /*$_*/
306
- a[32]("faceCollector.initiatingCamera") + ""
307
- ), l;
308
- return {
309
- c() {
310
- e = b("span"), l = F(t), u(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
311
- },
312
- m(s, n) {
313
- S(s, e, n), c(e, l);
314
- },
315
- p(s, n) {
316
- n[1] & /*$_*/
317
- 2 && t !== (t = /*$_*/
318
- s[32]("faceCollector.initiatingCamera") + "") && U(l, t);
319
- },
320
- d(s) {
321
- s && D(e);
322
- }
323
- };
324
- }
325
- function $a(a) {
326
- let e;
327
- return {
328
- c() {
329
- e = b("span"), e.textContent = "Loading camera...", u(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
330
- },
331
- m(t, l) {
332
- S(t, e, l);
333
- },
334
- p: te,
335
- d(t) {
336
- t && D(e);
337
- }
338
- };
339
- }
340
- function Ti(a) {
341
- let e, t, l, s, n;
342
- function m(f, h) {
343
- return (
344
- /*$isLoading*/
345
- f[37] ? tl : el
346
- );
347
- }
348
- let r = m(a), o = r(a);
349
- return {
350
- c() {
351
- e = b("slot"), t = b("div"), l = b("img"), n = N(), o.c(), st(l.src, s = Qt) || u(l, "src", s), u(l, "alt", "loading gif"), u(l, "class", "m-auto h-[10em] lg:h-[12em]"), u(t, "class", "translate-y-1/3 md:translate-y-1/4 xl:translate-y-1/2"), u(e, "name", "obtaining-photo-gif"), u(e, "class", "block h-[17em] lg:h-[21.6em] xl:h-[30em]");
352
- },
353
- m(f, h) {
354
- S(f, e, h), c(e, t), c(t, l), c(t, n), o.m(t, null);
355
- },
356
- p(f, h) {
357
- r === (r = m(f)) && o ? o.p(f, h) : (o.d(1), o = r(f), o && (o.c(), o.m(t, null)));
358
- },
359
- d(f) {
360
- f && D(e), o.d();
361
- }
362
- };
363
- }
364
- function el(a) {
365
- let e, t = (
366
- /*$_*/
367
- a[32]("faceCollector.obtainingPicture") + ""
368
- ), l;
369
- return {
370
- c() {
371
- e = b("span"), l = F(t), u(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
372
- },
373
- m(s, n) {
374
- S(s, e, n), c(e, l);
375
- },
376
- p(s, n) {
377
- n[1] & /*$_*/
378
- 2 && t !== (t = /*$_*/
379
- s[32]("faceCollector.obtainingPicture") + "") && U(l, t);
380
- },
381
- d(s) {
382
- s && D(e);
383
- }
384
- };
385
- }
386
- function tl(a) {
387
- let e;
388
- return {
389
- c() {
390
- e = b("span"), e.textContent = "Obtaining photo...", u(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
391
- },
392
- m(t, l) {
393
- S(t, e, l);
394
- },
395
- p: te,
396
- d(t) {
397
- t && D(e);
398
- }
399
- };
400
- }
401
- function Oi(a) {
402
- let e, t, l, s, n;
403
- function m(f, h) {
404
- return (
405
- /*$isLoading*/
406
- f[37] ? al : il
407
- );
408
- }
409
- let r = m(a), o = r(a);
410
- return {
411
- c() {
412
- e = b("slot"), t = b("div"), l = b("img"), n = N(), o.c(), st(l.src, s = Qt) || u(l, "src", s), u(l, "alt", "loading gif"), u(l, "class", "m-auto h-[10em] lg:h-[12em]"), u(t, "class", "translate-y-1/3 md:translate-y-1/4 xl:translate-y-1/2"), u(e, "name", "loading-camera-gif"), u(e, "class", "block h-[17em] lg:h-[21.6em] xl:h-[30em]");
413
- },
414
- m(f, h) {
415
- S(f, e, h), c(e, t), c(t, l), c(t, n), o.m(t, null);
416
- },
417
- p(f, h) {
418
- r === (r = m(f)) && o ? o.p(f, h) : (o.d(1), o = r(f), o && (o.c(), o.m(t, null)));
419
- },
420
- d(f) {
421
- f && D(e), o.d();
422
- }
423
- };
424
- }
425
- function il(a) {
426
- let e, t = (
427
- /*$_*/
428
- a[32]("faceCollector.initiatingCamera") + ""
429
- ), l;
430
- return {
431
- c() {
432
- e = b("span"), l = F(t), u(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
433
- },
434
- m(s, n) {
435
- S(s, e, n), c(e, l);
436
- },
437
- p(s, n) {
438
- n[1] & /*$_*/
439
- 2 && t !== (t = /*$_*/
440
- s[32]("faceCollector.initiatingCamera") + "") && U(l, t);
441
- },
442
- d(s) {
443
- s && D(e);
444
- }
445
- };
446
- }
447
- function al(a) {
448
- let e;
449
- return {
450
- c() {
451
- e = b("span"), e.textContent = "Loading camera...", u(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
452
- },
453
- m(t, l) {
454
- S(t, e, l);
455
- },
456
- p: te,
457
- d(t) {
458
- t && D(e);
459
- }
460
- };
461
- }
462
- function Ii(a) {
463
- let e, t, l = (
464
- /*$_*/
465
- a[32]("faceCollector.finish") + ""
466
- ), s, n, m, r, o = (
467
- /*$_*/
468
- a[32]("faceCollector.retakePhoto") + ""
469
- ), f, h, p;
470
- return {
471
- c() {
472
- e = b("div"), t = b("button"), s = F(l), m = N(), r = b("button"), f = F(o), t.disabled = n = /*$justification*/
473
- a[30].length === 0, u(t, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), u(r, "id", "bry-cc-retake-button"), u(r, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), u(e, "class", "ce-dui-btn-group flex");
474
- },
475
- m(w, _) {
476
- S(w, e, _), c(e, t), c(t, s), c(e, m), c(e, r), c(r, f), h || (p = [
477
- me(
478
- t,
479
- "click",
480
- /*click_handler*/
481
- a[59]
482
- ),
483
- me(
484
- r,
485
- "click",
486
- /*click_handler_1*/
487
- a[60]
488
- )
489
- ], h = !0);
490
- },
491
- p(w, _) {
492
- _[1] & /*$_*/
493
- 2 && l !== (l = /*$_*/
494
- w[32]("faceCollector.finish") + "") && U(s, l), _[0] & /*$justification*/
495
- 1073741824 && n !== (n = /*$justification*/
496
- w[30].length === 0) && (t.disabled = n), _[1] & /*$_*/
497
- 2 && o !== (o = /*$_*/
498
- w[32]("faceCollector.retakePhoto") + "") && U(f, o);
499
- },
500
- d(w) {
501
- w && D(e), h = !1, Rt(p);
502
- }
503
- };
504
- }
505
- function ll(a) {
506
- let e, t;
507
- return e = new Qa({ props: { handler: (
508
- /*func*/
509
- a[69]
510
- ) } }), {
511
- c() {
512
- qe(e.$$.fragment);
513
- },
514
- m(l, s) {
515
- ze(e, l, s), t = !0;
516
- },
517
- p: te,
518
- i(l) {
519
- t || (G(e.$$.fragment, l), t = !0);
520
- },
521
- o(l) {
522
- ee(e.$$.fragment, l), t = !1;
523
- },
524
- d(l) {
525
- Je(e, l);
526
- }
527
- };
528
- }
529
- function sl(a) {
530
- let e, t, l, s, n, m, r, o, f;
531
- const h = [
532
- ul,
533
- cl,
534
- rl,
535
- ol,
536
- nl
537
- ], p = [];
538
- function w(_, k) {
539
- return (
540
- /*$captured*/
541
- _[23] ? (
542
- /*$unconformitiesStore*/
543
- _[27].isLoading ? 1 : (
544
- /*$requestResult*/
545
- _[28] !== Q.OK ? 2 : (
546
- /*$saved*/
547
- _[29] ? 4 : 3
548
- )
549
- )
550
- ) : 0
551
- );
552
- }
553
- return m = w(a), r = p[m] = h[m](a), {
554
- c() {
555
- e = b("div"), t = b("img"), n = N(), r.c(), u(t, "class", "m-auto col-start-1 col-end-1 max-h-[23.2em]"), st(t.src, l = /*$dataTypePrefix*/
556
- a[33] + "," + /*$image*/
557
- a[31]) || u(t, "src", l), t.hidden = s = !/*$captured*/
558
- a[23] || !/*$showFaceWhileValidating*/
559
- a[38] && /*$unconformitiesStore*/
560
- a[27].isLoading, u(t, "alt", ""), u(e, "class", o = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (!/*$showFaceWhileValidating*/
561
- a[38] && /*$unconformitiesStore*/
562
- a[27].isLoading ? "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible" : "grid m-[1em] overflow-hidden"));
563
- },
564
- m(_, k) {
565
- S(_, e, k), c(e, t), c(e, n), p[m].m(e, null), f = !0;
566
- },
567
- p(_, k) {
568
- (!f || k[1] & /*$dataTypePrefix, $image*/
569
- 5 && !st(t.src, l = /*$dataTypePrefix*/
570
- _[33] + "," + /*$image*/
571
- _[31])) && u(t, "src", l), (!f || k[0] & /*$captured, $unconformitiesStore*/
572
- 142606336 | k[1] & /*$showFaceWhileValidating*/
573
- 128 && s !== (s = !/*$captured*/
574
- _[23] || !/*$showFaceWhileValidating*/
575
- _[38] && /*$unconformitiesStore*/
576
- _[27].isLoading)) && (t.hidden = s);
577
- let v = m;
578
- m = w(_), m === v ? p[m].p(_, k) : (He(), ee(p[v], 1, 1, () => {
579
- p[v] = null;
580
- }), je(), r = p[m], r ? r.p(_, k) : (r = p[m] = h[m](_), r.c()), G(r, 1), r.m(e, null)), (!f || k[0] & /*$unconformitiesStore*/
581
- 134217728 | k[1] & /*$showFaceWhileValidating*/
582
- 128 && o !== (o = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (!/*$showFaceWhileValidating*/
583
- _[38] && /*$unconformitiesStore*/
584
- _[27].isLoading ? "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible" : "grid m-[1em] overflow-hidden"))) && u(e, "class", o);
585
- },
586
- i(_) {
587
- f || (G(r), f = !0);
588
- },
589
- o(_) {
590
- ee(r), f = !1;
591
- },
592
- d(_) {
593
- _ && D(e), p[m].d();
594
- }
595
- };
596
- }
597
- function nl(a) {
598
- let e, t, l = (
599
- /*$_*/
600
- a[32]("faceCollector.captured") + ""
601
- ), s, n, m, r, o, f = (
602
- /*$_*/
603
- a[32]("faceCollector.retakePhoto") + ""
604
- ), h, p, w = kt(Ha).faceStrategy !== ja.DISABLED, _, k, v, E = (
605
- /*$unconformitiesStore*/
606
- a[27].unconformities.length !== 0 && Ai(a)
607
- ), T = w && fl();
608
- return {
609
- c() {
610
- e = b("div"), t = b("h1"), s = F(l), n = N(), E && E.c(), m = N(), r = b("div"), o = b("button"), h = F(f), p = N(), T && T.c(), u(t, "class", "text-3xl font-bold pb-[1em] transition-opacity"), u(o, "id", "bry-cc-retake-button"), u(o, "class", "ce-dui-btn ce-dui-btn-block flex-shrink text-base"), u(r, "class", "flex flex-row"), bi(r, "ce-dui-btn-group", !/*$exportButtonDisabled*/
611
- a[39]);
612
- },
613
- m(A, B) {
614
- S(A, e, B), c(e, t), c(t, s), c(e, n), E && E.m(e, null), c(e, m), c(e, r), c(r, o), c(o, h), c(r, p), T && T.m(r, null), _ = !0, k || (v = me(
615
- o,
616
- "click",
617
- /*click_handler_6*/
618
- a[68]
619
- ), k = !0);
620
- },
621
- p(A, B) {
622
- (!_ || B[1] & /*$_*/
623
- 2) && l !== (l = /*$_*/
624
- A[32]("faceCollector.captured") + "") && U(s, l), /*$unconformitiesStore*/
625
- A[27].unconformities.length !== 0 ? E ? E.p(A, B) : (E = Ai(A), E.c(), E.m(e, m)) : E && (E.d(1), E = null), (!_ || B[1] & /*$_*/
626
- 2) && f !== (f = /*$_*/
627
- A[32]("faceCollector.retakePhoto") + "") && U(h, f), (!_ || B[1] & /*$exportButtonDisabled*/
628
- 256) && bi(r, "ce-dui-btn-group", !/*$exportButtonDisabled*/
629
- A[39]);
630
- },
631
- i(A) {
632
- _ || (G(T), _ = !0);
633
- },
634
- o(A) {
635
- ee(T), _ = !1;
636
- },
637
- d(A) {
638
- A && D(e), E && E.d(), T && T.d(), k = !1, v();
639
- }
640
- };
641
- }
642
- function ol(a) {
643
- let e, t, l = (
644
- /*evaluatePhoto*/
645
- (a[1] ? (
646
- /*$_*/
647
- a[32]("faceCollector.unconformities")
648
- ) : (
649
- /*$_*/
650
- a[32]("faceCollector.previewCapture")
651
- )) + ""
652
- ), s, n, m, r, o, f, h = (
653
- /*$unconformitiesStore*/
654
- a[27].unconformities
655
- ), p = [];
656
- for (let v = 0; v < h.length; v += 1)
657
- p[v] = Pi(gi(a, h, v));
658
- let w = (
659
- /*evaluatePhoto*/
660
- a[1] && /*$unconformitiesStore*/
661
- a[27].unconformities.length == 0 && Li(a)
662
- ), _ = (
663
- /*showJustificationField*/
664
- a[7] && Si(a)
665
- ), k = (
666
- /*$captured*/
667
- a[23] && Di(a)
668
- );
669
- return {
670
- c() {
671
- e = b("div"), t = b("h1"), s = F(l), n = N(), m = b("div");
672
- for (let v = 0; v < p.length; v += 1)
673
- p[v].c();
674
- r = N(), w && w.c(), o = N(), _ && _.c(), f = N(), k && k.c(), u(t, "class", "text-3xl font-bold transition-opacity"), u(m, "class", "flex flex-wrap"), u(e, "class", "flex flex-col justify-between");
675
- },
676
- m(v, E) {
677
- S(v, e, E), c(e, t), c(t, s), c(e, n), c(e, m);
678
- for (let T = 0; T < p.length; T += 1)
679
- p[T] && p[T].m(m, null);
680
- c(m, r), w && w.m(m, null), c(e, o), _ && _.m(e, null), c(e, f), k && k.m(e, null);
681
- },
682
- p(v, E) {
683
- if (E[0] & /*evaluatePhoto*/
684
- 2 | E[1] & /*$_*/
685
- 2 && l !== (l = /*evaluatePhoto*/
686
- (v[1] ? (
687
- /*$_*/
688
- v[32]("faceCollector.unconformities")
689
- ) : (
690
- /*$_*/
691
- v[32]("faceCollector.previewCapture")
692
- )) + "") && U(s, l), E[0] & /*$unconformitiesStore*/
693
- 134217728) {
694
- h = /*$unconformitiesStore*/
695
- v[27].unconformities;
696
- let T;
697
- for (T = 0; T < h.length; T += 1) {
698
- const A = gi(v, h, T);
699
- p[T] ? p[T].p(A, E) : (p[T] = Pi(A), p[T].c(), p[T].m(m, r));
700
- }
701
- for (; T < p.length; T += 1)
702
- p[T].d(1);
703
- p.length = h.length;
704
- }
705
- /*evaluatePhoto*/
706
- v[1] && /*$unconformitiesStore*/
707
- v[27].unconformities.length == 0 ? w ? w.p(v, E) : (w = Li(v), w.c(), w.m(m, null)) : w && (w.d(1), w = null), /*showJustificationField*/
708
- v[7] ? _ ? _.p(v, E) : (_ = Si(v), _.c(), _.m(e, f)) : _ && (_.d(1), _ = null), /*$captured*/
709
- v[23] ? k ? k.p(v, E) : (k = Di(v), k.c(), k.m(e, null)) : k && (k.d(1), k = null);
710
- },
711
- i: te,
712
- o: te,
713
- d(v) {
714
- v && D(e), qa(p, v), w && w.d(), _ && _.d(), k && k.d();
715
- }
716
- };
717
- }
718
- function rl(a) {
719
- let e, t, l, s, n = (
720
- /*$_*/
721
- a[32]("faceCollector.finish") + ""
722
- ), m, r, o, f = (
723
- /*$_*/
724
- a[32]("faceCollector.retakePhoto") + ""
725
- ), h, p, w;
726
- function _(E, T) {
727
- return (
728
- /*$requestResult*/
729
- E[28] === Q.LIVENESS_DETECTION_FAILURE || /*$requestResult*/
730
- E[28] === Q.UNKNOWN_LIVENESS_ERROR ? gl : (
731
- /*$requestResult*/
732
- E[28] === Q.LOW_LIVENESS_SCORE ? bl : (
733
- /*$requestResult*/
734
- E[28] === Q.TEMPLATE_EXTRACTION_ERROR || /*$requestResult*/
735
- E[28] === Q.UNKNOWN_TEMPLATE_EXTRACTION_ERROR ? _l : (
736
- /*$requestResult*/
737
- E[28] === Q.UNABLE_TO_COMMUNICATE_WITH_TEMPLATE_EXTRACTION_SERVICE ? hl : (
738
- /*$requestResult*/
739
- E[28] === Q.LIVENESS_EVALUATION_ERROR ? ml : dl
740
- )
741
- )
742
- )
743
- )
744
- );
745
- }
746
- let k = _(a), v = k(a);
747
- return {
748
- c() {
749
- e = b("div"), v.c(), t = N(), l = b("div"), s = b("button"), m = F(n), r = N(), o = b("button"), h = F(f), s.disabled = !0, u(s, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), u(o, "id", "bry-cc-retake-button"), u(o, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), u(l, "class", "ce-dui-btn-group flex"), u(e, "class", "flex flex-col justify-between");
750
- },
751
- m(E, T) {
752
- S(E, e, T), v.m(e, null), c(e, t), c(e, l), c(l, s), c(s, m), c(l, r), c(l, o), c(o, h), p || (w = [
753
- me(
754
- s,
755
- "click",
756
- /*click_handler_2*/
757
- a[62]
758
- ),
759
- me(
760
- o,
761
- "click",
762
- /*click_handler_3*/
763
- a[63]
764
- )
765
- ], p = !0);
766
- },
767
- p(E, T) {
768
- k === (k = _(E)) && v ? v.p(E, T) : (v.d(1), v = k(E), v && (v.c(), v.m(e, t))), T[1] & /*$_*/
769
- 2 && n !== (n = /*$_*/
770
- E[32]("faceCollector.finish") + "") && U(m, n), T[1] & /*$_*/
771
- 2 && f !== (f = /*$_*/
772
- E[32]("faceCollector.retakePhoto") + "") && U(h, f);
773
- },
774
- i: te,
775
- o: te,
776
- d(E) {
777
- E && D(e), v.d(), p = !1, Rt(w);
778
- }
779
- };
780
- }
781
- function cl(a) {
782
- let e, t, l = (
783
- /*$_*/
784
- a[32]("faceCollector.validating") + ""
785
- ), s, n, m;
786
- return {
787
- c() {
788
- e = b("div"), t = b("h1"), s = F(l), n = N(), m = b("div"), u(t, "class", "inline-block text-3xl font-bold pb-[1em] transition-opacity"), u(m, "class", "ml-6 inline-block dot-typing"), u(e, "class", "min-w-[200px]");
789
- },
790
- m(r, o) {
791
- S(r, e, o), c(e, t), c(t, s), c(e, n), c(e, m);
792
- },
793
- p(r, o) {
794
- o[1] & /*$_*/
795
- 2 && l !== (l = /*$_*/
796
- r[32]("faceCollector.validating") + "") && U(s, l);
797
- },
798
- i: te,
799
- o: te,
800
- d(r) {
801
- r && D(e);
802
- }
803
- };
804
- }
805
- function ul(a) {
806
- let e;
807
- return {
808
- c() {
809
- e = b("div"), u(e, "class", "");
810
- },
811
- m(t, l) {
812
- S(t, e, l);
813
- },
814
- p: te,
815
- i: te,
816
- o: te,
817
- d(t) {
818
- t && D(e);
819
- }
820
- };
821
- }
822
- function Ai(a) {
823
- let e, t, l = (
824
- /*$_*/
825
- a[32]("faceCollector.justification") + ""
826
- ), s, n, m, r, o;
827
- return {
828
- c() {
829
- e = b("label"), t = b("span"), s = F(l), n = N(), m = b("textarea"), u(t, "class", "ce-dui-label-text text-base"), u(e, "class", "ce-dui-label"), u(e, "for", "justification"), u(m, "contenteditable", ""), u(m, "id", "justification"), u(m, "class", "ce-dui-textarea ce-dui-textarea-bordered textarea-ghost h-[6em] w-full text-base");
830
- },
831
- m(f, h) {
832
- S(f, e, h), c(e, t), c(t, s), S(f, n, h), S(f, m, h), yt(
833
- m,
834
- /*$justification*/
835
- a[30]
836
- ), r || (o = me(
837
- m,
838
- "input",
839
- /*textarea_input_handler_1*/
840
- a[67]
841
- ), r = !0);
842
- },
843
- p(f, h) {
844
- h[1] & /*$_*/
845
- 2 && l !== (l = /*$_*/
846
- f[32]("faceCollector.justification") + "") && U(s, l), h[0] & /*$justification*/
847
- 1073741824 && yt(
848
- m,
849
- /*$justification*/
850
- f[30]
851
- );
852
- },
853
- d(f) {
854
- f && D(e), f && D(n), f && D(m), r = !1, o();
855
- }
856
- };
857
- }
858
- function fl(a) {
859
- let e, t;
860
- return e = new za({
861
- props: { cssClass: "ce-dui-btn-block flex-shrink" }
862
- }), {
863
- c() {
864
- qe(e.$$.fragment);
865
- },
866
- m(l, s) {
867
- ze(e, l, s), t = !0;
868
- },
869
- i(l) {
870
- t || (G(e.$$.fragment, l), t = !0);
871
- },
872
- o(l) {
873
- ee(e.$$.fragment, l), t = !1;
874
- },
875
- d(l) {
876
- Je(e, l);
877
- }
878
- };
879
- }
880
- function Pi(a) {
881
- let e, t = (
882
- /*unconformity*/
883
- a[117] + ""
884
- ), l;
885
- return {
886
- c() {
887
- e = b("div"), l = F(t), u(e, "class", "ce-dui-badge ce-dui-badge-lg h-[2em] ce-dui-badge-error text-xl pb-[.25em] m-[.5em]");
888
- },
889
- m(s, n) {
890
- S(s, e, n), c(e, l);
891
- },
892
- p(s, n) {
893
- n[0] & /*$unconformitiesStore*/
894
- 134217728 && t !== (t = /*unconformity*/
895
- s[117] + "") && U(l, t);
896
- },
897
- d(s) {
898
- s && D(e);
899
- }
900
- };
901
- }
902
- function Li(a) {
903
- let e, t = (
904
- /*$_*/
905
- a[32]("faceCollector.noNonconformity") + ""
906
- ), l;
907
- return {
908
- c() {
909
- e = b("div"), l = F(t), u(e, "class", "ce-dui-badge ce-dui-badge-lg h-[2em] ce-dui-badge-info text-xl pb-[.25em] m-[.5em]");
910
- },
911
- m(s, n) {
912
- S(s, e, n), c(e, l);
913
- },
914
- p(s, n) {
915
- n[1] & /*$_*/
916
- 2 && t !== (t = /*$_*/
917
- s[32]("faceCollector.noNonconformity") + "") && U(l, t);
918
- },
919
- d(s) {
920
- s && D(e);
921
- }
922
- };
923
- }
924
- function Si(a) {
925
- let e, t, l, s = (
926
- /*$_*/
927
- a[32]("faceCollector.provideAReasonForTheLowQualityCapture") + ""
928
- ), n, m, r, o, f, h, p, w, _ = (
929
- /*$_*/
930
- a[32]("faceCollector.thisInformationIsRequired") + ""
931
- ), k, v, E, T;
932
- return {
933
- c() {
934
- e = b("div"), t = b("label"), l = b("span"), n = F(s), m = N(), r = b("textarea"), f = N(), h = b("label"), p = b("span"), w = F("("), k = F(_), v = F(")"), u(l, "class", "ce-dui-label-text text-base"), u(t, "class", "ce-dui-label"), u(t, "for", "justification"), u(r, "contenteditable", ""), u(r, "id", "justification"), u(r, "class", "ce-dui-textarea ce-dui-textarea-bordered h-[6em] text-base"), u(r, "placeholder", o = /*$_*/
935
- a[32]("faceCollector.yourJustification")), u(p, "class", "ce-dui-label-text-alt text-base"), u(h, "class", "ce-dui-label"), u(h, "for", "justification"), u(e, "class", "ce-dui-form-control");
936
- },
937
- m(A, B) {
938
- S(A, e, B), c(e, t), c(t, l), c(l, n), c(e, m), c(e, r), yt(
939
- r,
940
- /*$justification*/
941
- a[30]
942
- ), c(e, f), c(e, h), c(h, p), c(p, w), c(p, k), c(p, v), E || (T = me(
943
- r,
944
- "input",
945
- /*textarea_input_handler*/
946
- a[64]
947
- ), E = !0);
948
- },
949
- p(A, B) {
950
- B[1] & /*$_*/
951
- 2 && s !== (s = /*$_*/
952
- A[32]("faceCollector.provideAReasonForTheLowQualityCapture") + "") && U(n, s), B[1] & /*$_*/
953
- 2 && o !== (o = /*$_*/
954
- A[32]("faceCollector.yourJustification")) && u(r, "placeholder", o), B[0] & /*$justification*/
955
- 1073741824 && yt(
956
- r,
957
- /*$justification*/
958
- A[30]
959
- ), B[1] & /*$_*/
960
- 2 && _ !== (_ = /*$_*/
961
- A[32]("faceCollector.thisInformationIsRequired") + "") && U(k, _);
962
- },
963
- d(A) {
964
- A && D(e), E = !1, T();
965
- }
966
- };
967
- }
968
- function Di(a) {
969
- let e, t, l = (
970
- /*$_*/
971
- a[32]("faceCollector.finish") + ""
972
- ), s, n, m, r, o = (
973
- /*$_*/
974
- a[32]("faceCollector.retakePhoto") + ""
975
- ), f, h, p;
976
- return {
977
- c() {
978
- e = b("div"), t = b("button"), s = F(l), m = N(), r = b("button"), f = F(o), t.disabled = n = /*$justification*/
979
- a[30].length === 0 && /*showJustificationField*/
980
- a[7], u(t, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink text-base"), u(r, "id", "bry-cc-retake-button"), u(r, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink text-base"), u(e, "class", "ce-dui-btn-group flex");
981
- },
982
- m(w, _) {
983
- S(w, e, _), c(e, t), c(t, s), c(e, m), c(e, r), c(r, f), h || (p = [
984
- me(
985
- t,
986
- "click",
987
- /*click_handler_4*/
988
- a[65]
989
- ),
990
- me(
991
- r,
992
- "click",
993
- /*click_handler_5*/
994
- a[66]
995
- )
996
- ], h = !0);
997
- },
998
- p(w, _) {
999
- _[1] & /*$_*/
1000
- 2 && l !== (l = /*$_*/
1001
- w[32]("faceCollector.finish") + "") && U(s, l), _[0] & /*$justification, showJustificationField*/
1002
- 1073741952 && n !== (n = /*$justification*/
1003
- w[30].length === 0 && /*showJustificationField*/
1004
- w[7]) && (t.disabled = n), _[1] & /*$_*/
1005
- 2 && o !== (o = /*$_*/
1006
- w[32]("faceCollector.retakePhoto") + "") && U(f, o);
1007
- },
1008
- d(w) {
1009
- w && D(e), h = !1, Rt(p);
1010
- }
1011
- };
1012
- }
1013
- function dl(a) {
1014
- let e, t = (
1015
- /*$_*/
1016
- a[32]("faceCollector.everythingOk") + ""
1017
- ), l;
1018
- return {
1019
- c() {
1020
- e = b("h1"), l = F(t), u(e, "class", "text-3xl font-bold pb-[1em] transition-opacity");
1021
- },
1022
- m(s, n) {
1023
- S(s, e, n), c(e, l);
1024
- },
1025
- p(s, n) {
1026
- n[1] & /*$_*/
1027
- 2 && t !== (t = /*$_*/
1028
- s[32]("faceCollector.everythingOk") + "") && U(l, t);
1029
- },
1030
- d(s) {
1031
- s && D(e);
1032
- }
1033
- };
1034
- }
1035
- function ml(a) {
1036
- let e, t = (
1037
- /*$_*/
1038
- a[32]("liveness.error.evaluationError") + ""
1039
- ), l;
1040
- return {
1041
- c() {
1042
- e = b("h1"), l = F(t), u(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1043
- },
1044
- m(s, n) {
1045
- S(s, e, n), c(e, l);
1046
- },
1047
- p(s, n) {
1048
- n[1] & /*$_*/
1049
- 2 && t !== (t = /*$_*/
1050
- s[32]("liveness.error.evaluationError") + "") && U(l, t);
1051
- },
1052
- d(s) {
1053
- s && D(e);
1054
- }
1055
- };
1056
- }
1057
- function hl(a) {
1058
- let e, t = (
1059
- /*$_*/
1060
- a[32]("faceCollector.unableToCompleteRequest") + ""
1061
- ), l;
1062
- return {
1063
- c() {
1064
- e = b("h1"), l = F(t), u(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1065
- },
1066
- m(s, n) {
1067
- S(s, e, n), c(e, l);
1068
- },
1069
- p(s, n) {
1070
- n[1] & /*$_*/
1071
- 2 && t !== (t = /*$_*/
1072
- s[32]("faceCollector.unableToCompleteRequest") + "") && U(l, t);
1073
- },
1074
- d(s) {
1075
- s && D(e);
1076
- }
1077
- };
1078
- }
1079
- function _l(a) {
1080
- let e, t = (
1081
- /*$_*/
1082
- a[32]("faceCollector.lowQualityCapture") + ""
1083
- ), l;
1084
- return {
1085
- c() {
1086
- e = b("h1"), l = F(t), u(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1087
- },
1088
- m(s, n) {
1089
- S(s, e, n), c(e, l);
1090
- },
1091
- p(s, n) {
1092
- n[1] & /*$_*/
1093
- 2 && t !== (t = /*$_*/
1094
- s[32]("faceCollector.lowQualityCapture") + "") && U(l, t);
1095
- },
1096
- d(s) {
1097
- s && D(e);
1098
- }
1099
- };
1100
- }
1101
- function bl(a) {
1102
- let e, t = (
1103
- /*$_*/
1104
- a[32]("liveness.error.error") + ""
1105
- ), l, s, n = (
1106
- /*$_*/
1107
- a[32]("faceCollector.unaliveCapture") + ""
1108
- ), m;
1109
- return {
1110
- c() {
1111
- e = b("h1"), l = F(t), s = F(": "), m = F(n), u(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1112
- },
1113
- m(r, o) {
1114
- S(r, e, o), c(e, l), c(e, s), c(e, m);
1115
- },
1116
- p(r, o) {
1117
- o[1] & /*$_*/
1118
- 2 && t !== (t = /*$_*/
1119
- r[32]("liveness.error.error") + "") && U(l, t), o[1] & /*$_*/
1120
- 2 && n !== (n = /*$_*/
1121
- r[32]("faceCollector.unaliveCapture") + "") && U(m, n);
1122
- },
1123
- d(r) {
1124
- r && D(e);
1125
- }
1126
- };
1127
- }
1128
- function gl(a) {
1129
- let e, t = (
1130
- /*$_*/
1131
- a[32]("liveness.error.error") + ""
1132
- ), l, s, n = (
1133
- /*$_*/
1134
- a[32](
1135
- /*livenessError*/
1136
- a[19]
1137
- ) + ""
1138
- ), m, r;
1139
- return {
1140
- c() {
1141
- e = b("h1"), l = F(t), s = F(": "), m = F(n), r = F("."), u(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
1142
- },
1143
- m(o, f) {
1144
- S(o, e, f), c(e, l), c(e, s), c(e, m), c(e, r);
1145
- },
1146
- p(o, f) {
1147
- f[1] & /*$_*/
1148
- 2 && t !== (t = /*$_*/
1149
- o[32]("liveness.error.error") + "") && U(l, t), f[0] & /*livenessError*/
1150
- 524288 | f[1] & /*$_*/
1151
- 2 && n !== (n = /*$_*/
1152
- o[32](
1153
- /*livenessError*/
1154
- o[19]
1155
- ) + "") && U(m, n);
1156
- },
1157
- d(o) {
1158
- o && D(e);
1159
- }
1160
- };
1161
- }
1162
- function pl(a) {
1163
- let e, t, l, s, n = V(), m, r = (
1164
- /*unique*/
1165
- a[13]
1166
- ), o, f, h, p, w, _, k, v, E, T, A, B, P, he, pe, j = !V() && !/*$ready*/
1167
- a[35], ue, fe = V() && /*waitingIdrndCaptureEvent*/
1168
- a[18], Ne, ve = V() && /*idrndLoading*/
1169
- a[16] && /*$cameraStatusStore*/
1170
- a[20] === H.OK, Te, Oe, Y, Z, Ee, Ce = n && Za(a), de = pi(a), x = (
1171
- /*showConfigButton*/
1172
- a[4] && /*$ready*/
1173
- a[35] && vi()
1174
- ), $ = (
1175
- /*showCameraButton*/
1176
- a[6] && /*$ready*/
1177
- a[35] && Ci()
1178
- ), K = (
1179
- /*showAutoCaptureButton*/
1180
- a[5] && !/*$automaticCapture*/
1181
- a[24] && !/*showCaptureButton*/
1182
- a[2] && /*$ready*/
1183
- a[35] && Ei()
1184
- ), q = (
1185
- /*showCaptureButton*/
1186
- a[2] && /*$ready*/
1187
- a[35] && wi(a)
1188
- ), ie = (
1189
- /*isCountingDown*/
1190
- a[12] && ki(a)
1191
- ), ae = (
1192
- /*$enableFaceApi*/
1193
- a[34] && !/*isCountingDown*/
1194
- a[12] && /*$faceFound*/
1195
- a[36] && !/*$faceValidated*/
1196
- a[25] && /*$faceValidationAlert*/
1197
- a[26] && yi(a)
1198
- ), le = j && Ri(a), R = fe && Ti(a), W = ve && Oi(a), z = (
1199
- /*$captured*/
1200
- a[23] && Ii(a)
1201
- );
1202
- const we = [sl, ll], _e = [];
1203
- function Xe(g, M) {
1204
- return (!/*idrndClosed*/
1205
- g[17] || /*$captured*/
1206
- g[23]) && /*showUnconformities*/
1207
- g[3] ? 0 : (
1208
- /*$cameraStatusStore*/
1209
- g[20] !== H.OK ? 1 : -1
1210
- );
1211
- }
1212
- return ~(Y = Xe(a)) && (Z = _e[Y] = we[Y](a)), {
1213
- c() {
1214
- e = b("div"), t = b("div"), l = b("div"), s = b("div"), Ce && Ce.c(), m = N(), de.c(), o = N(), x && x.c(), f = N(), $ && $.c(), h = N(), K && K.c(), p = N(), q && q.c(), w = N(), _ = b("canvas"), k = N(), v = b("canvas"), E = N(), T = b("canvas"), A = N(), ie && ie.c(), B = N(), ae && ae.c(), pe = N(), le && le.c(), ue = N(), R && R.c(), Ne = N(), W && W.c(), Te = N(), z && z.c(), Oe = N(), Z && Z.c(), this.c = te, u(_, "id", "bry-ce-displayCanvas"), u(_, "class", "max-w-full -scale-x-100"), u(v, "id", "bry-ce-detectionsCanvas"), u(v, "class", "absolute top-0 left-0 max-w-full -scale-x-100"), u(T, "id", "bry-ce-maskCanvas"), u(T, "class", "absolute top-0 left-0 max-w-full -scale-x-100"), u(s, "class", P = /*$ready*/
1215
- a[35] ? "relative" : "relative w-0 h-0"), s.hidden = he = /*$cameraStatusStore*/
1216
- a[20] !== H.OK || V() && /*idrndLoading*/
1217
- (a[16] || /*idrndClosed*/
1218
- a[17] || /*waitingIdrndCaptureEvent*/
1219
- a[18]), u(l, "class", "relative mx-auto"), u(t, "class", "flex flex-col justify-between");
1220
- },
1221
- m(g, M) {
1222
- S(g, e, M), c(e, t), c(t, l), c(l, s), Ce && Ce.m(s, null), c(s, m), de.m(s, null), c(s, o), x && x.m(s, null), c(s, f), $ && $.m(s, null), c(s, h), K && K.m(s, null), c(s, p), q && q.m(s, null), c(s, w), c(s, _), a[56](_), c(s, k), c(s, v), a[57](v), c(s, E), c(s, T), a[58](T), c(s, A), ie && ie.m(s, null), c(s, B), ae && ae.m(s, null), c(l, pe), le && le.m(l, null), c(l, ue), R && R.m(l, null), c(l, Ne), W && W.m(l, null), c(l, Te), z && z.m(l, null), a[61](t), c(e, Oe), ~Y && _e[Y].m(e, null), Ee = !0;
1223
- },
1224
- p(g, M) {
1225
- n && Ce.p(g, M), M[0] & /*unique*/
1226
- 8192 && Xt(r, r = /*unique*/
1227
- g[13]) ? (de.d(1), de = pi(g), de.c(), de.m(s, o)) : de.p(g, M), /*showConfigButton*/
1228
- g[4] && /*$ready*/
1229
- g[35] ? x ? M[0] & /*showConfigButton*/
1230
- 16 | M[1] & /*$ready*/
1231
- 16 && G(x, 1) : (x = vi(), x.c(), G(x, 1), x.m(s, f)) : x && (He(), ee(x, 1, 1, () => {
1232
- x = null;
1233
- }), je()), /*showCameraButton*/
1234
- g[6] && /*$ready*/
1235
- g[35] ? $ ? M[0] & /*showCameraButton*/
1236
- 64 | M[1] & /*$ready*/
1237
- 16 && G($, 1) : ($ = Ci(), $.c(), G($, 1), $.m(s, h)) : $ && (He(), ee($, 1, 1, () => {
1238
- $ = null;
1239
- }), je()), /*showAutoCaptureButton*/
1240
- g[5] && !/*$automaticCapture*/
1241
- g[24] && !/*showCaptureButton*/
1242
- g[2] && /*$ready*/
1243
- g[35] ? K ? M[0] & /*showAutoCaptureButton, $automaticCapture, showCaptureButton*/
1244
- 16777252 | M[1] & /*$ready*/
1245
- 16 && G(K, 1) : (K = Ei(), K.c(), G(K, 1), K.m(s, p)) : K && (He(), ee(K, 1, 1, () => {
1246
- K = null;
1247
- }), je()), /*showCaptureButton*/
1248
- g[2] && /*$ready*/
1249
- g[35] ? q ? (q.p(g, M), M[0] & /*showCaptureButton*/
1250
- 4 | M[1] & /*$ready*/
1251
- 16 && G(q, 1)) : (q = wi(g), q.c(), G(q, 1), q.m(s, w)) : q && (He(), ee(q, 1, 1, () => {
1252
- q = null;
1253
- }), je()), /*isCountingDown*/
1254
- g[12] ? ie ? ie.p(g, M) : (ie = ki(g), ie.c(), ie.m(s, B)) : ie && (ie.d(1), ie = null), /*$enableFaceApi*/
1255
- g[34] && !/*isCountingDown*/
1256
- g[12] && /*$faceFound*/
1257
- g[36] && !/*$faceValidated*/
1258
- g[25] && /*$faceValidationAlert*/
1259
- g[26] ? ae ? ae.p(g, M) : (ae = yi(g), ae.c(), ae.m(s, null)) : ae && (ae.d(1), ae = null), (!Ee || M[1] & /*$ready*/
1260
- 16 && P !== (P = /*$ready*/
1261
- g[35] ? "relative" : "relative w-0 h-0")) && u(s, "class", P), (!Ee || M[0] & /*$cameraStatusStore, idrndLoading, idrndClosed, waitingIdrndCaptureEvent*/
1262
- 1507328 && he !== (he = /*$cameraStatusStore*/
1263
- g[20] !== H.OK || V() && /*idrndLoading*/
1264
- (g[16] || /*idrndClosed*/
1265
- g[17] || /*waitingIdrndCaptureEvent*/
1266
- g[18]))) && (s.hidden = he), M[1] & /*$ready*/
1267
- 16 && (j = !V() && !/*$ready*/
1268
- g[35]), j ? le ? le.p(g, M) : (le = Ri(g), le.c(), le.m(l, ue)) : le && (le.d(1), le = null), M[0] & /*waitingIdrndCaptureEvent*/
1269
- 262144 && (fe = V() && /*waitingIdrndCaptureEvent*/
1270
- g[18]), fe ? R ? R.p(g, M) : (R = Ti(g), R.c(), R.m(l, Ne)) : R && (R.d(1), R = null), M[0] & /*idrndLoading, $cameraStatusStore*/
1271
- 1114112 && (ve = V() && /*idrndLoading*/
1272
- g[16] && /*$cameraStatusStore*/
1273
- g[20] === H.OK), ve ? W ? W.p(g, M) : (W = Oi(g), W.c(), W.m(l, Te)) : W && (W.d(1), W = null), /*$captured*/
1274
- g[23] ? z ? z.p(g, M) : (z = Ii(g), z.c(), z.m(l, null)) : z && (z.d(1), z = null);
1275
- let Ie = Y;
1276
- Y = Xe(g), Y === Ie ? ~Y && _e[Y].p(g, M) : (Z && (He(), ee(_e[Ie], 1, 1, () => {
1277
- _e[Ie] = null;
1278
- }), je()), ~Y ? (Z = _e[Y], Z ? Z.p(g, M) : (Z = _e[Y] = we[Y](g), Z.c()), G(Z, 1), Z.m(e, null)) : Z = null);
1279
- },
1280
- i(g) {
1281
- Ee || (G(x), G($), G(K), G(q), G(Z), Ee = !0);
1282
- },
1283
- o(g) {
1284
- ee(x), ee($), ee(K), ee(q), ee(Z), Ee = !1;
1285
- },
1286
- d(g) {
1287
- g && D(e), Ce && Ce.d(), de.d(g), x && x.d(), $ && $.d(), K && K.d(), q && q.d(), a[56](null), a[57](null), a[58](null), ie && ie.d(), ae && ae.d(), le && le.d(), R && R.d(), W && W.d(), z && z.d(), a[61](null), ~Y && _e[Y].d();
1288
- }
1289
- };
1290
- }
1291
- let vl = 5, Ni = 3e3;
1292
- function Fi(a, e, t) {
1293
- const l = e.videoHeight >= e.videoWidth && t.height >= t.width || e.videoHeight < e.videoWidth && t.height < t.width;
1294
- a.drawImage(
1295
- e,
1296
- l ? 0 : e.videoWidth / 2 - t.width,
1297
- 0,
1298
- l ? e.videoWidth : e.videoHeight * (t.width / t.height),
1299
- e.videoHeight,
1300
- 0,
1301
- 0,
1302
- t.width,
1303
- t.height
1304
- );
1305
- }
1306
- function Cl(a, e, t) {
1307
- let l, s, n, m, r, o, f, h, p, w, _, k, v, E, T, A, B, P, he, pe, j, ue, fe, Ne, ve, Te, Oe, Y, Z, Ee, Ce, de, x, $, K, q, ie, ae, le;
1308
- L(a, Mt, (i) => t(78, l = i)), L(a, re, (i) => t(20, n = i)), L(a, va, (i) => t(80, m = i)), L(a, mt, (i) => t(81, r = i)), L(a, Le, (i) => t(21, o = i)), L(a, Ca, (i) => t(82, f = i)), L(a, Se, (i) => t(22, h = i)), L(a, We, (i) => t(23, p = i)), L(a, Bt, (i) => t(83, w = i)), L(a, ni, (i) => t(84, _ = i)), L(a, lt, (i) => t(24, k = i)), L(a, Ut, (i) => t(25, v = i)), L(a, Ea, (i) => t(85, E = i)), L(a, oi, (i) => t(26, T = i)), L(a, De, (i) => t(27, A = i)), L(a, tt, (i) => t(86, B = i)), L(a, ce, (i) => t(28, P = i)), L(a, Wt, (i) => t(29, he = i)), L(a, Vt, (i) => t(30, pe = i)), L(a, ye, (i) => t(31, j = i)), L(a, Wi, (i) => t(32, ue = i)), L(a, wa, (i) => t(87, Ne = i)), L(a, ka, (i) => t(34, ve = i)), L(a, ya, (i) => t(88, Te = i)), L(a, ri, (i) => t(89, Oe = i)), L(a, ht, (i) => t(90, Y = i)), L(a, _t, (i) => t(35, Z = i)), L(a, Kt, (i) => t(91, Ee = i)), L(a, Ra, (i) => t(92, Ce = i)), L(a, bt, (i) => t(93, de = i)), L(a, ci, (i) => t(94, x = i)), L(a, ui, (i) => t(95, $ = i)), L(a, gt, (i) => t(96, K = i)), L(a, fi, (i) => t(36, q = i)), L(a, Ta, (i) => t(37, ie = i)), L(a, Oa, (i) => t(38, ae = i)), L(a, Ia, (i) => t(39, le = i));
1309
- let R, W, z, we = !1, _e = {}, Xe = !1, { enableMinutiae: g } = e, { videoDimensions: M } = e, { noTabs: Ie } = e, { weightsPath: Tt } = e, { evaluatePhoto: ke } = e, { showCaptureButton: Ot } = e, { showUnconformities: Gt } = e, { videoOverlay: nt } = e, { videoOverlayTransparency: Qe } = e, { showConfigButton: Yt } = e, { showAutoCaptureButton: Ge } = e, { showCameraButton: Zt } = e, { showJustificationField: xt } = e, { minEyeToEyeDist: Ye } = e;
1310
- const ot = hi(!1);
1311
- L(a, ot, (i) => t(79, s = i));
1312
- const Ze = hi("data:image/png;base64");
1313
- L(a, Ze, (i) => t(33, fe = i));
1314
- let { widgetInstance: ne } = e, Ae, J, rt = !1, $t = !1, ct = !0, be = !0, ut = !1, ei = 0, ge = "", It = 0, At = !0, Pt = 0, Lt = !1;
1315
- const xe = Aa.mixin({
1316
- toast: !0,
1317
- position: "bottom-left",
1318
- timer: 13e3,
1319
- timerProgressBar: !0
1320
- });
1321
- Pa(async () => {
1322
- d(ht, Y = !0, Y), d(_t, Z = !1, Z), d(fi, q = !1, q), d(We, p = !1, p), d(mt, r = Ht.FRONT_CAMERA, r), d(re, n = H.OK, n), Ge && d(lt, k = !1, k), V() && (import("./index-no-detector_4b302e78_2.2.22.js"), Ki()), await Fe(), ve && (await La(Tt), Xe = !0), ji();
1323
- });
1324
- function St(i, C) {
1325
- i.clearRect(0, 0, J.width, J.height), i.save(), nt != "none" ? (Qe > 0 && (i.globalAlpha = Qe / 100), i.fillStyle = nt, i.fillRect(0, 0, J.width, J.height)) : (i.beginPath(), i.rect(0, 0, J.width, J.height));
1326
- let y = J.height * 0.8;
1327
- const O = h.videoWidth / 2;
1328
- let I = h.videoHeight * 0.5;
1329
- (Ge || Ot) && (I = h.videoHeight * 0.44), Re() && (y = J.height * 0.65, I = h.videoHeight * 0.51);
1330
- const X = y / 1.45;
1331
- d(gt, K.width = X, K), d(gt, K.height = y, K), d(gt, K.y = I, K), i.ellipse(O, I, X / 2, y / 2, 0, 0, 2 * Math.PI, !0), Qe == 0 && i.clip(), Fi(i, C, J), i.restore(), i.save(), i.beginPath();
1332
- const Be = window.getComputedStyle(J).getPropertyValue("--p"), Ue = window.getComputedStyle(J).getPropertyValue("--su");
1333
- if (i.strokeStyle = `hsl(${Be})`, i.lineWidth = 16, i.ellipse(O, I, X / 2, y / 2, 0, 0, 2 * Math.PI), i.stroke(), we && !Lt) {
1334
- const et = 1 - (Pt - (/* @__PURE__ */ new Date()).getTime()) / Ni;
1335
- i.save(), i.beginPath(), i.lineWidth = 16, i.strokeStyle = `hsl(${Ue})`, i.ellipse(O, I, X / 2, y / 2, 0, 0 - Math.PI / 2, 1.5 * (Math.PI * 2 * et) - Math.PI / 2), i.stroke();
1336
- }
1337
- i.beginPath();
1338
- const se = new Path2D();
1339
- se.ellipse(O, I, X / 2, y / 2, 0, 0, 2 * Math.PI), i.clip(se), Fi(i, C, J), i.restore();
1340
- }
1341
- function Ki() {
1342
- ne.addEventListener("open", (i) => {
1343
- const C = i.detail[0].video;
1344
- d(
1345
- ui,
1346
- $ = {
1347
- width: C.videoWidth,
1348
- height: C.videoHeight
1349
- },
1350
- $
1351
- ), t(9, R.srcObject = C.srcObject, R), t(16, ct = !1);
1352
- function y() {
1353
- be || (St(J.getContext("2d"), C), Ve(R, y, !0));
1354
- }
1355
- y();
1356
- }), ne.addEventListener("error", (i) => {
1357
- console.error(i), i.detail[0].message === "Device in use" ? d(re, n = H.CAMERA_IN_USE_ERROR, n) : i.detail[0].message === "Permission denied" || i.detail[0].message === "Permission dismissed" ? d(re, n = H.CAMERA_DENIED_ERROR, n) : i.detail[0].message === "Requested device not found" && d(re, n = H.DEVICE_NOT_FOUND_ERROR, n), t(16, ct = !1);
1358
- }), ne.addEventListener("faceDetection", (i) => {
1359
- }), ne.addEventListener("close", async (i) => {
1360
- p || (rt = !1), t(17, be = !0), t(18, ut = !1), n === H.OK && d(re, n = H.CAMERA_CLOSED_ERROR, n);
1361
- }), ne.addEventListener("initialize", async (i) => {
1362
- $t = !0, d(ci, x = !0, x);
1363
- }), ne.addEventListener("capture", async (i) => {
1364
- t(19, ge = "");
1365
- const { encryptedFile: C, photo: y } = i.detail[0];
1366
- d(bt, de = C, de), t(18, ut = !1), d(ce, P = Q.OK, P), d(De, A.isLoading = !0, A), d(We, p = !0, p), rt = !1;
1367
- const O = (await pt(y)).split(",");
1368
- if (d(Ze, fe = O[0], fe), d(ye, j = O[1], j), d(tt, B = O[1], B), !Ce) {
1369
- let se, et;
1370
- try {
1371
- ({ bodyParts: se, icaoWarnings: et } = await vt(B, ke, (await pt(C)).split(",")[1])), window.dispatchEvent(new CustomEvent(
1372
- "face-unconformities-validated",
1373
- {
1374
- detail: {
1375
- bodyParts: se,
1376
- icaoWarnings: et,
1377
- status: P
1378
- }
1379
- }
1380
- ));
1381
- } catch (Pe) {
1382
- console.error(Pe);
1383
- let dt = it.UNKNOWN, Ft = [], li = [];
1384
- if (Pe instanceof jt && Pe.response?.status === 400)
1385
- if (Pe.response.data && Array.isArray(Pe.response.data.bodyParts)) {
1386
- Ft = Pe.response.data.bodyParts, li = Pe.response.data.icaoWarnings;
1387
- const si = Ft.find((pa) => pa.livenessResult.error);
1388
- dt = si?.livenessResult.error_code, d(ce, P = Q.LIVENESS_DETECTION_FAILURE, P), si?.livenessResult.error_code || d(ce, P = Q.UNKNOWN_LIVENESS_ERROR, P), t(19, ge = it[dt]), console.error("Liveness error:", dt);
1389
- } else
1390
- d(ce, P = Q.TEMPLATE_EXTRACTION_ERROR, P);
1391
- else
1392
- d(ce, P = Q.UNABLE_TO_COMMUNICATE_WITH_TEMPLATE_EXTRACTION_SERVICE, P), ke && xe.fire({
1393
- icon: "error",
1394
- title: "Falha ao comunicar com serviço de Liveness"
1395
- });
1396
- d(De, A.isLoading = !1, A), window.dispatchEvent(new CustomEvent(
1397
- "face-unconformities-validated",
1398
- {
1399
- detail: {
1400
- bodyParts: Ft,
1401
- errorCode: dt,
1402
- translatedError: ue(ge),
1403
- status: P,
1404
- icaoWarnings: li
1405
- }
1406
- }
1407
- ));
1408
- return;
1409
- }
1410
- if (P !== Q.OK) {
1411
- d(De, A.isLoading = !1, A);
1412
- return;
1413
- }
1414
- se[0].livenessResult && ii(se[0].livenessResult), se.length !== 0 && se[0].data && d(ye, j = se[0].data, j), Ct(et);
1415
- return;
1416
- }
1417
- let I, X;
1418
- try {
1419
- X = await Sa(C), ii(X.data);
1420
- } catch (se) {
1421
- d(ce, P = Q.UNKNOWN_LIVENESS_ERROR, P), console.error(se), se instanceof jt && se.response?.status === 400 ? (I = se.response.data.error_code, t(19, ge = it[I]), console.error("Liveness error:", I), d(ce, P = Q.LIVENESS_DETECTION_FAILURE, P)) : xe.fire({
1422
- icon: "error",
1423
- title: "Falha ao comunicar com serviço de Liveness"
1424
- });
1425
- }
1426
- if (P !== Q.OK) {
1427
- d(De, A.isLoading = !1, A), window.dispatchEvent(new CustomEvent(
1428
- "face-unconformities-validated",
1429
- {
1430
- detail: {
1431
- bodyParts: [
1432
- {
1433
- bodyPart: "FACE",
1434
- data: B,
1435
- livenessBlob: (await pt(C)).split(",")[1],
1436
- ...X && { livenessResult: X }
1437
- }
1438
- ],
1439
- ...I && { errorCode: I },
1440
- ...ge && { translatedError: ue(ge) },
1441
- status: P
1442
- }
1443
- }
1444
- ));
1445
- return;
1446
- }
1447
- let { bodyParts: Be, icaoWarnings: Ue } = await vt(B, ke);
1448
- window.dispatchEvent(new CustomEvent(
1449
- "face-unconformities-validated",
1450
- {
1451
- detail: {
1452
- bodyParts: Be,
1453
- icaoWarnings: Ue,
1454
- status: P,
1455
- errorCode: I,
1456
- ...ge && { translatedError: ue(ge) }
1457
- }
1458
- }
1459
- )), Be[0].data && d(ye, j = Be[0].data, j), Ct(Ue);
1460
- });
1461
- }
1462
- async function Fe(i) {
1463
- const [C, y] = (M ?? "")?.replaceAll(" ", "")?.split("x")?.map((O) => O ? parseInt(O) : void 0);
1464
- if (!(!C || !y)) {
1465
- if (d(Se, h = { videoWidth: C, videoHeight: y }, h), V() && y < C && Re() && d(Se, h = { videoWidth: y, videoHeight: C }, h), V()) {
1466
- Dt();
1467
- return;
1468
- }
1469
- await Hi(C, y, i);
1470
- }
1471
- }
1472
- async function Dt() {
1473
- if (V() && (d(re, n = H.OK, n), ne && "openCamera" in ne && ne.openCamera(), rt = !0, t(17, be = !1), t(16, ct = !0), !f[0]?.deviceId)) {
1474
- const [i, C] = (M ?? "")?.replaceAll(" ", "")?.split("x")?.map((y) => y ? parseInt(y) : void 0);
1475
- if (!i || !C)
1476
- return;
1477
- await di(i, C, r), await qt();
1478
- }
1479
- }
1480
- async function $e() {
1481
- if (ve && !Xe)
1482
- return Ve(R, $e);
1483
- if (R) {
1484
- if (Ee !== Jt.Face && !Ie)
1485
- return Ve(R, $e);
1486
- d(_t, Z = !0, Z), d(ht, Y = !1, Y), ve ? (s || d(ot, s = !0, s), V() || St(J.getContext("2d"), R), Ve(R, $e)) : (St(J.getContext("2d"), R), Ve(R, $e));
1487
- }
1488
- }
1489
- async function ti() {
1490
- if (Oe && (mi(), d(ri, Oe = !1, Oe)), Ye > 0 && Te < Ye) {
1491
- let i = "FACE_MUITO_PEQUENA";
1492
- const C = _i[i];
1493
- i = _i.FACE_MUITO_PEQUENA, window.dispatchEvent(new CustomEvent(
1494
- "low-quality-face",
1495
- {
1496
- detail: {
1497
- errorCode: i,
1498
- translatedError: ue(C),
1499
- bodyParts: [
1500
- {
1501
- bodyPart: "FACE",
1502
- minEyeToEyeDist: Ye,
1503
- capturedEyeToEyeDist: Te
1504
- }
1505
- ]
1506
- }
1507
- }
1508
- )), xe.fire({
1509
- icon: "error",
1510
- title: ue(C)
1511
- });
1512
- return;
1513
- }
1514
- if (d(ce, P = Q.OK, P), V()) {
1515
- t(18, ut = !0), ne.takePhoto();
1516
- return;
1517
- }
1518
- d(We, p = !0, p);
1519
- try {
1520
- if (ve) {
1521
- const [i] = await (await import("./face_api_0e3ce8c8_2.2.22.js")).extractFaces(R, [Ne]), C = i.toDataURL("image/jpeg").split(",");
1522
- d(Ze, fe = C[0], fe), d(ye, j = C[1], j), d(tt, B = C[1], B);
1523
- let y, O;
1524
- ({ bodyParts: y, icaoWarnings: O } = await vt(j, ke)), window.dispatchEvent(new CustomEvent(
1525
- "face-unconformities-validated",
1526
- {
1527
- detail: {
1528
- bodyParts: y,
1529
- icaoWarnings: O,
1530
- status: P
1531
- }
1532
- }
1533
- )), y.length !== 0 && y[0].data && d(ye, j = y[0].data, j), Ct(O);
1534
- } else {
1535
- const i = document.createElement("canvas"), C = i.getContext("2d");
1536
- i.width = R.width, i.height = R.height, C?.drawImage(R, 0, 0, i.width, i.height);
1537
- const y = i.toDataURL("image/jpeg").split(",");
1538
- d(Ze, fe = y[0], fe), d(ye, j = y[1], j), d(tt, B = y[1], B);
1539
- let { bodyParts: O, icaoWarnings: I } = await vt(j, ke);
1540
- window.dispatchEvent(new CustomEvent(
1541
- "face-unconformities-validated",
1542
- {
1543
- detail: {
1544
- bodyParts: O,
1545
- icaoWarnings: I,
1546
- status: P
1547
- }
1548
- }
1549
- )), O.length !== 0 && O[0].data && d(ye, j = O[0].data, j), Ct(I);
1550
- }
1551
- } catch (i) {
1552
- console.error(i);
1553
- let C = it.UNKNOWN, y = [], O = [];
1554
- if (i instanceof jt && i.response?.status === 400)
1555
- if (i.response.data && Array.isArray(i.response.data.bodyParts)) {
1556
- y = i.response.data.bodyParts, O = i.response.data.icaoWarnings;
1557
- const I = y.find((X) => X.livenessResult.error);
1558
- C = I?.livenessResult.error_code, d(ce, P = Q.LIVENESS_DETECTION_FAILURE, P), I?.livenessResult.error_code || d(ce, P = Q.UNKNOWN_LIVENESS_ERROR, P), t(19, ge = it[C]), console.error("Liveness error:", C);
1559
- } else
1560
- d(ce, P = Q.TEMPLATE_EXTRACTION_ERROR, P);
1561
- else
1562
- d(ce, P = Q.UNABLE_TO_COMMUNICATE_WITH_TEMPLATE_EXTRACTION_SERVICE, P), ke && xe.fire({
1563
- icon: "error",
1564
- title: "Falha ao comunicar com serviço de Liveness"
1565
- });
1566
- d(De, A.isLoading = !1, A), window.dispatchEvent(new CustomEvent(
1567
- "face-unconformities-validated",
1568
- {
1569
- detail: {
1570
- bodyParts: y,
1571
- errorCode: C,
1572
- translatedError: ue(ge),
1573
- status: P,
1574
- icaoWarnings: O
1575
- }
1576
- }
1577
- ));
1578
- return;
1579
- }
1580
- }
1581
- function ft() {
1582
- const i = {
1583
- bodyPart: "FACE",
1584
- data: j,
1585
- justification: pe
1586
- };
1587
- d(Wt, he = !0, he), kt(bt) && pt(kt(bt)).then((C) => {
1588
- i.livenessBlob = C.split(",")[1];
1589
- }), window.dispatchEvent(new CustomEvent("export-face", { detail: i }));
1590
- }
1591
- function Me() {
1592
- window.dispatchEvent(new CustomEvent("face-scrapped")), d(Wt, he = !1, he), d(ce, P = Q.OK, P), d(We, p = !1, p), d(tt, B = "", B), d(De, A.unconformities = [], A);
1593
- const i = kt(zt);
1594
- i.closedMouth = !1, i.isPersonCloseEnough = !1, i.isPersonTooclose = !0, i.isPersonInFrame = !1, d(oi, T = "", T), d(Ut, v = !0, v), Ge && d(lt, k = !1, k), zt.set(i), be && Dt();
1595
- }
1596
- function ii(i) {
1597
- let C = "", y = "success";
1598
- i.isAlive ? C = `Vivacidade de face (${i.face_liveness.probability.toFixed(2)}) e de captura (${i.capture_liveness.probability}, ${i.capture_liveness.score.toFixed(2)}) verificados!` : i?.face_liveness?.probability && (y = "error", C = `Vivacidade de face (${i.face_liveness.probability.toFixed(2)}) e de captura (${i.capture_liveness.probability}, ${i.capture_liveness.score.toFixed(2)}) insuficientes!`), E && xe.fire({ icon: y, title: C });
1599
- }
1600
- async function Hi(i, C, y) {
1601
- try {
1602
- const { deviceId: O, width: I, height: X, aspectRatio: Be, facingMode: Ue, touchPoints: se } = await di(i, C, r, y);
1603
- I < i && X < C && d(
1604
- Se,
1605
- h = {
1606
- videoWidth: I,
1607
- videoHeight: X
1608
- },
1609
- h
1610
- ), Re() && (!Ue || se <= 1) && I > X && d(
1611
- Se,
1612
- h = {
1613
- videoWidth: X,
1614
- videoHeight: I
1615
- },
1616
- h
1617
- ), d(Le, o = O || f[0].deviceId, o);
1618
- } catch (O) {
1619
- const I = O;
1620
- t(17, be = !0);
1621
- const X = Et(O) && O.constraint ? O.constraint : "";
1622
- console.error(I, X), Et(I) && "message" in I && I.message.includes("Permission denied") && (console.error("User didn't give permission to use camera!"), d(re, n = H.CAMERA_DENIED_ERROR, n)), Et(I) && "message" in I && I.message.includes("Requested device not found") && d(re, n = H.DEVICE_NOT_FOUND_ERROR, n), (X.includes("width") || X.includes("height")) && (console.error(`Camera does not meet the minimum supported requirements! (${X})`), d(re, n = H.CAMERA_UNSUPPORTED, n));
1623
- }
1624
- }
1625
- async function Nt() {
1626
- d(Le, o = "", o), await Fe();
1627
- }
1628
- function ji() {
1629
- navigator.mediaDevices.ondevicechange = async (i) => {
1630
- await qt(), n !== H.OK ? await Nt() : (!V() && !_.active || V() && !be) && (wt(ne), d(re, n = H.DEVICE_NOT_FOUND_ERROR, n), t(17, be = !0));
1631
- };
1632
- }
1633
- const qi = Se.subscribe((i) => {
1634
- R && W && (t(9, R.width = i.videoWidth, R), t(9, R.height = i.videoHeight, R), t(10, W.width = i.videoWidth, W), t(10, W.height = i.videoHeight, W), t(14, Ae.width = i.videoWidth, Ae), t(14, Ae.height = i.videoHeight, Ae), t(15, J.width = i.videoWidth, J), t(15, J.height = i.videoHeight, J));
1635
- }), zi = zt.subscribe((i) => {
1636
- if (m == "DOCUMENT")
1637
- return;
1638
- let C = "", y = !1;
1639
- if (i.isPersonCloseEnough ? i.isPersonTooclose ? C = "faceCollector.moveAwayCamera" : i.isPersonInFrame ? i.closedMouth ? y = !0 : C = "faceCollector.dontOpenMouth" : C = "faceCollector.stayInFrame" : C = "faceCollector.comeCloserCamera", Da(y, C), !p && k && !we && i.isPersonInFrame && i.closedMouth && !(!i.isPersonCloseEnough || i.isPersonTooclose)) {
1640
- t(12, we = !0), d(Ut, v = !0, v), Pt = (/* @__PURE__ */ new Date()).getTime() + Ni;
1641
- const O = setInterval(
1642
- () => {
1643
- if (!k || p || V() && be || !i.isPersonCloseEnough || i.isPersonTooclose || !i.closedMouth || !i.isPersonInFrame) {
1644
- t(12, we = !1), Lt = !0, setTimeout(
1645
- () => {
1646
- Lt = !1;
1647
- },
1648
- 1500
1649
- ), clearInterval(O);
1650
- return;
1651
- }
1652
- const I = (/* @__PURE__ */ new Date()).getTime();
1653
- Math.floor((Pt - I) % (1e3 * 60) / 1e3) <= 0 && (clearInterval(O), t(12, we = !1), ti());
1654
- },
1655
- 100
1656
- );
1657
- }
1658
- }), Ji = We.subscribe((i) => {
1659
- z && (i ? (z.classList.remove("flex"), z.classList.add("hidden")) : (z.classList.add("flex"), z.classList.remove("hidden")));
1660
- }), Xi = Bt.subscribe((i) => {
1661
- R && i && (console.log("setting null in video srcObject"), t(9, R.srcObject = null, R), t(9, R.src = "", R), d(Le, o = null, o));
1662
- });
1663
- Kt.subscribe(async (i) => {
1664
- i === Jt.Face && (await qt(), V() && d(Le, o = f[0]?.deviceId, o));
1665
- });
1666
- const Qi = Le.subscribe(async (i) => {
1667
- if (!i || m == "DOCUMENT" || V() && be)
1668
- return;
1669
- R || t(13, _e = {});
1670
- const { videoHeight: C, videoWidth: y } = h;
1671
- try {
1672
- if (V()) {
1673
- await wt(ne), await Dt();
1674
- return;
1675
- }
1676
- const O = await Na(y, C, i);
1677
- t(9, R.srcObject = O, R), d(ni, _ = O, _), d(Bt, w = !1, w), At ? d(re, n = H.OK, n) : d(re, n = H.CAMERA_ORIENTATION_PORTRAIT, n), O.getTracks().forEach((I) => {
1678
- I.readyState === "live" && console.log(`Camera ${I.label} opened successfully!`);
1679
- });
1680
- } catch (O) {
1681
- const I = O;
1682
- t(17, be = !0), Et(I) && "message" in I && I.message.includes("Requested device not found") && d(re, n = H.DEVICE_NOT_FOUND_ERROR, n);
1683
- }
1684
- }), Gi = Kt.subscribe(async (i) => {
1685
- i === Jt.Face && V() && !rt && !p && $t && await Fe();
1686
- }), Yi = ot.subscribe(async (i) => {
1687
- i && ai();
1688
- }), Zi = Fa.subscribe(async (i) => {
1689
- if (h) {
1690
- if (wt(), !Re()) {
1691
- const y = (f.findIndex((I) => I.deviceId === o) + 1) % f.length, O = f[y].deviceId;
1692
- V() ? d(Le, o = O, o) : await Fe(O);
1693
- return;
1694
- }
1695
- i ? (d(mt, r = Ht.REAR_CAMERA, r), await Fe()) : (d(mt, r = Ht.FRONT_CAMERA, r), await Fe());
1696
- }
1697
- }), xi = Ma.subscribe(async (i) => {
1698
- !i.isSupported || !Re() || m != "FACE" || (At = i.orientation.includes("portrait"), At ? d(re, n = H.OK, n) : d(re, n = H.CAMERA_ORIENTATION_PORTRAIT, n));
1699
- });
1700
- async function ai() {
1701
- let i;
1702
- if (It >= vl) {
1703
- It = 0;
1704
- const C = await Wa(), y = await import("./face_api_0e3ce8c8_2.2.22.js");
1705
- let O;
1706
- O = y.detectSingleFace(J, C), i = await O.withFaceLandmarks(), W.getContext("2d")?.clearRect(0, 0, W.width, W.height);
1707
- } else
1708
- It++;
1709
- i ? Va(i, W, g) : Ka(), s && Ve(R, ai);
1710
- }
1711
- Mt.subscribe(async (i) => {
1712
- i && (Me(), d(Mt, l = !1, l));
1713
- });
1714
- const $i = _t.subscribe((i) => {
1715
- i && window.dispatchEvent(new CustomEvent("brycc-camera-ready"));
1716
- }), ea = ht.subscribe((i) => {
1717
- i && window.dispatchEvent(new CustomEvent("brycc-face-initialized"));
1718
- });
1719
- Ba(() => {
1720
- wt(), Ji(), zi(), qi(), Xi(), Qi(), Gi(), clearInterval(ei), Yi(), Zi(), xi(), $i(), ea(), mi(), ei = 0;
1721
- });
1722
- function ta(i) {
1723
- Ke[i ? "unshift" : "push"](() => {
1724
- ne = i, t(0, ne);
1725
- });
1726
- }
1727
- function ia(i) {
1728
- Ke[i ? "unshift" : "push"](() => {
1729
- R = i, t(9, R);
1730
- });
1731
- }
1732
- const aa = () => {
1733
- V() || d(
1734
- Se,
1735
- h = {
1736
- videoHeight: R.videoHeight,
1737
- videoWidth: R.videoWidth
1738
- },
1739
- h
1740
- );
1741
- };
1742
- function la(i) {
1743
- Ke[i ? "unshift" : "push"](() => {
1744
- J = i, t(15, J);
1745
- });
1746
- }
1747
- function sa(i) {
1748
- Ke[i ? "unshift" : "push"](() => {
1749
- W = i, t(10, W);
1750
- });
1751
- }
1752
- function na(i) {
1753
- Ke[i ? "unshift" : "push"](() => {
1754
- Ae = i, t(14, Ae);
1755
- });
1756
- }
1757
- const oa = () => ft(), ra = () => Me();
1758
- function ca(i) {
1759
- Ke[i ? "unshift" : "push"](() => {
1760
- z = i, t(11, z);
1761
- });
1762
- }
1763
- const ua = () => ft(), fa = () => Me();
1764
- function da() {
1765
- pe = this.value, Vt.set(pe);
1766
- }
1767
- const ma = () => ft(), ha = () => Me();
1768
- function _a() {
1769
- pe = this.value, Vt.set(pe);
1770
- }
1771
- const ba = () => Me(), ga = async () => {
1772
- await Nt();
1773
- };
1774
- return a.$$set = (i) => {
1775
- "enableMinutiae" in i && t(46, g = i.enableMinutiae), "videoDimensions" in i && t(47, M = i.videoDimensions), "noTabs" in i && t(48, Ie = i.noTabs), "weightsPath" in i && t(49, Tt = i.weightsPath), "evaluatePhoto" in i && t(1, ke = i.evaluatePhoto), "showCaptureButton" in i && t(2, Ot = i.showCaptureButton), "showUnconformities" in i && t(3, Gt = i.showUnconformities), "videoOverlay" in i && t(50, nt = i.videoOverlay), "videoOverlayTransparency" in i && t(51, Qe = i.videoOverlayTransparency), "showConfigButton" in i && t(4, Yt = i.showConfigButton), "showAutoCaptureButton" in i && t(5, Ge = i.showAutoCaptureButton), "showCameraButton" in i && t(6, Zt = i.showCameraButton), "showJustificationField" in i && t(7, xt = i.showJustificationField), "minEyeToEyeDist" in i && t(52, Ye = i.minEyeToEyeDist), "widgetInstance" in i && t(0, ne = i.widgetInstance);
1776
- }, [
1777
- ne,
1778
- ke,
1779
- Ot,
1780
- Gt,
1781
- Yt,
1782
- Ge,
1783
- Zt,
1784
- xt,
1785
- $e,
1786
- R,
1787
- W,
1788
- z,
1789
- we,
1790
- _e,
1791
- Ae,
1792
- J,
1793
- ct,
1794
- be,
1795
- ut,
1796
- ge,
1797
- n,
1798
- o,
1799
- h,
1800
- p,
1801
- k,
1802
- v,
1803
- T,
1804
- A,
1805
- P,
1806
- he,
1807
- pe,
1808
- j,
1809
- ue,
1810
- fe,
1811
- ve,
1812
- Z,
1813
- q,
1814
- ie,
1815
- ae,
1816
- le,
1817
- ot,
1818
- Ze,
1819
- ti,
1820
- ft,
1821
- Me,
1822
- Nt,
1823
- g,
1824
- M,
1825
- Ie,
1826
- Tt,
1827
- nt,
1828
- Qe,
1829
- Ye,
1830
- ta,
1831
- ia,
1832
- aa,
1833
- la,
1834
- sa,
1835
- na,
1836
- oa,
1837
- ra,
1838
- ca,
1839
- ua,
1840
- fa,
1841
- da,
1842
- ma,
1843
- ha,
1844
- _a,
1845
- ba,
1846
- ga
1847
- ];
1848
- }
1849
- class El extends Mi {
1850
- constructor(e) {
1851
- super(), Bi(
1852
- this,
1853
- {
1854
- target: this.shadowRoot,
1855
- props: Ui(this.attributes),
1856
- customElement: !0
1857
- },
1858
- Cl,
1859
- pl,
1860
- Xt,
1861
- {
1862
- enableMinutiae: 46,
1863
- videoDimensions: 47,
1864
- noTabs: 48,
1865
- weightsPath: 49,
1866
- evaluatePhoto: 1,
1867
- showCaptureButton: 2,
1868
- showUnconformities: 3,
1869
- videoOverlay: 50,
1870
- videoOverlayTransparency: 51,
1871
- showConfigButton: 4,
1872
- showAutoCaptureButton: 5,
1873
- showCameraButton: 6,
1874
- showJustificationField: 7,
1875
- minEyeToEyeDist: 52,
1876
- widgetInstance: 0,
1877
- play: 8
1878
- },
1879
- null,
1880
- [-1, -1, -1, -1]
1881
- ), e && (e.target && S(e.target, this, e.anchor), e.props && (this.$set(e.props), oe()));
1882
- }
1883
- static get observedAttributes() {
1884
- return [
1885
- "enableMinutiae",
1886
- "videoDimensions",
1887
- "noTabs",
1888
- "weightsPath",
1889
- "evaluatePhoto",
1890
- "showCaptureButton",
1891
- "showUnconformities",
1892
- "videoOverlay",
1893
- "videoOverlayTransparency",
1894
- "showConfigButton",
1895
- "showAutoCaptureButton",
1896
- "showCameraButton",
1897
- "showJustificationField",
1898
- "minEyeToEyeDist",
1899
- "widgetInstance",
1900
- "play"
1901
- ];
1902
- }
1903
- get enableMinutiae() {
1904
- return this.$$.ctx[46];
1905
- }
1906
- set enableMinutiae(e) {
1907
- this.$$set({ enableMinutiae: e }), oe();
1908
- }
1909
- get videoDimensions() {
1910
- return this.$$.ctx[47];
1911
- }
1912
- set videoDimensions(e) {
1913
- this.$$set({ videoDimensions: e }), oe();
1914
- }
1915
- get noTabs() {
1916
- return this.$$.ctx[48];
1917
- }
1918
- set noTabs(e) {
1919
- this.$$set({ noTabs: e }), oe();
1920
- }
1921
- get weightsPath() {
1922
- return this.$$.ctx[49];
1923
- }
1924
- set weightsPath(e) {
1925
- this.$$set({ weightsPath: e }), oe();
1926
- }
1927
- get evaluatePhoto() {
1928
- return this.$$.ctx[1];
1929
- }
1930
- set evaluatePhoto(e) {
1931
- this.$$set({ evaluatePhoto: e }), oe();
1932
- }
1933
- get showCaptureButton() {
1934
- return this.$$.ctx[2];
1935
- }
1936
- set showCaptureButton(e) {
1937
- this.$$set({ showCaptureButton: e }), oe();
1938
- }
1939
- get showUnconformities() {
1940
- return this.$$.ctx[3];
1941
- }
1942
- set showUnconformities(e) {
1943
- this.$$set({ showUnconformities: e }), oe();
1944
- }
1945
- get videoOverlay() {
1946
- return this.$$.ctx[50];
1947
- }
1948
- set videoOverlay(e) {
1949
- this.$$set({ videoOverlay: e }), oe();
1950
- }
1951
- get videoOverlayTransparency() {
1952
- return this.$$.ctx[51];
1953
- }
1954
- set videoOverlayTransparency(e) {
1955
- this.$$set({ videoOverlayTransparency: e }), oe();
1956
- }
1957
- get showConfigButton() {
1958
- return this.$$.ctx[4];
1959
- }
1960
- set showConfigButton(e) {
1961
- this.$$set({ showConfigButton: e }), oe();
1962
- }
1963
- get showAutoCaptureButton() {
1964
- return this.$$.ctx[5];
1965
- }
1966
- set showAutoCaptureButton(e) {
1967
- this.$$set({ showAutoCaptureButton: e }), oe();
1968
- }
1969
- get showCameraButton() {
1970
- return this.$$.ctx[6];
1971
- }
1972
- set showCameraButton(e) {
1973
- this.$$set({ showCameraButton: e }), oe();
1974
- }
1975
- get showJustificationField() {
1976
- return this.$$.ctx[7];
1977
- }
1978
- set showJustificationField(e) {
1979
- this.$$set({ showJustificationField: e }), oe();
1980
- }
1981
- get minEyeToEyeDist() {
1982
- return this.$$.ctx[52];
1983
- }
1984
- set minEyeToEyeDist(e) {
1985
- this.$$set({ minEyeToEyeDist: e }), oe();
1986
- }
1987
- get widgetInstance() {
1988
- return this.$$.ctx[0];
1989
- }
1990
- set widgetInstance(e) {
1991
- this.$$set({ widgetInstance: e }), oe();
1992
- }
1993
- get play() {
1994
- return this.$$.ctx[8];
1995
- }
1996
- }
1997
- customElements.define("face-collector", El);
1998
- export {
1999
- El as default
2000
- };