bry-biometric-collector 2.4.1 → 3.0.0-RC01

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 (23) hide show
  1. package/dist/DocumentCollector_480bc217_3.0.0-RC01.js +1029 -0
  2. package/dist/FaceCollector_95bb182b_3.0.0-RC01.js +2041 -0
  3. package/dist/ValidationAlert_0a6b586f_3.0.0-RC01.js +1656 -0
  4. package/dist/{___vite-browser-external_commonjs-proxy_ed55ad19_2.4.1.js → ___vite-browser-external_commonjs-proxy_8bb8db0d_3.0.0-RC01.js} +31 -31
  5. package/dist/bry-biometric-collector-main.js +3 -3
  6. package/dist/{fingersApi_ad7905b1_2.4.1.js → fingersApi_09f5a55b_3.0.0-RC01.js} +2 -2
  7. package/dist/index-no-detector_281a271b_3.0.0-RC01.js +15045 -0
  8. package/dist/index-no-detector_56051121_3.0.0-RC01.js +10830 -0
  9. package/dist/index.js +3 -3
  10. package/dist/{index_2724a1c0_2.4.1.js → index_b8df6bb6_3.0.0-RC01.js} +3 -3
  11. package/dist/{index_554d13bc_2.4.1.js → index_fa569ec3_3.0.0-RC01.js} +3 -3
  12. package/dist/{main_a11369bb_2.4.1.js → main_550fd4ab_3.0.0-RC01.js} +2678 -2611
  13. package/dist/style.css +1 -1
  14. package/package.json +3 -3
  15. package/dist/DocumentCollector_1945fe25_2.4.1.js +0 -1121
  16. package/dist/FaceCollector_76033700_2.4.1.js +0 -1992
  17. package/dist/TakePictureBtn_8ab0f124_2.4.1.js +0 -864
  18. package/dist/index-no-detector_4b302e78_2.4.1.js +0 -10414
  19. package/dist/index-no-detector_b6972e40_2.4.1.js +0 -5739
  20. /package/dist/{en-us_99b30d39_2.4.1.js → en-us_99b30d39_3.0.0-RC01.js} +0 -0
  21. /package/dist/{es-cl_cfa50670_2.4.1.js → es-cl_cfa50670_3.0.0-RC01.js} +0 -0
  22. /package/dist/{face_api_0e3ce8c8_2.4.1.js → face_api_0e3ce8c8_3.0.0-RC01.js} +0 -0
  23. /package/dist/{pt-br_d5ca6103_2.4.1.js → pt-br_d5ca6103_3.0.0-RC01.js} +0 -0
@@ -0,0 +1,1029 @@
1
+ import { S as Rt, q as kt, r as Et, t as St, w as k, x as U, y as v, Q as L, z as te, B as K, aX as pe, C as h, T as C, D as ie, E as W, G as B, H as P, I as ae, J as _, bb as De, L as le, M as Y, N as m, P as Z, R as di, U as tt, V as it, W as Be, X as fe, Y as G, Z as he, _ as gi, a0 as me, a2 as fi, a1 as ne, a3 as Ie, a4 as Ge, a5 as Qe, a6 as Dt, aa as be, ac as Ye, ad as hi, ae as pt, af as Ce, $ as mi, a9 as Xe, ah as _t, aj as Ve, ao as Ii, ap as bi, ar as Ci, as as wi, at as Mi, av as xe, aw as ee, j as vi, ax as Je, aI as yt, d as we, aJ as At, aK as Ke, aL as Di, az as qe, bc as pi, aM as _i, aN as yi, aO as Ai, au as Ni, aP as Ti, aQ as zi, aR as Me, aS as Oi, aT as ji, aU as ve, aV as se, aW as at, aY as Ri, aZ as X, a_ as V, a$ as Nt, b0 as ki, aC as Ei, b3 as $e, bd as Si } from "./main_550fd4ab_3.0.0-RC01.js";
2
+ import { W as Zi, C as Pi, V as Wi, a as Li } from "./ValidationAlert_0a6b586f_3.0.0-RC01.js";
3
+ import { matchDimensions as Fi, resizeResults as Hi } from "./face_api_0e3ce8c8_3.0.0-RC01.js";
4
+ const Ui = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwNiIgaGVpZ2h0PSI4OTAiIHZpZXdCb3g9IjAgMCAxMjA2IDg5MCIgZmlsbD0ibm9uZSIgb3BhY2l0eT0iMC4yIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPGcgZmlsdGVyPSJ1cmwoI2ZpbHRlcjBfZF8xOF80KSIgb3BhY2l0eT0iMCI+CiAgICA8bWFzayBpZD0icGF0aC0xLWluc2lkZS0xXzE4XzQiIGZpbGw9IndoaXRlIj4KICAgIDxyZWN0IHg9IjQiIHdpZHRoPSIxMTk4IiBoZWlnaHQ9Ijg4MiIgcng9IjYiLz4KICAgIDwvbWFzaz4KICAgIDxyZWN0IHg9IjQiIHdpZHRoPSIxMTk4IiBoZWlnaHQ9Ijg4MiIgcng9IjYiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS1vcGFjaXR5PSIwLjkiIHN0cm9rZS13aWR0aD0iMTYiIHNoYXBlLXJlbmRlcmluZz0iY3Jpc3BFZGdlcyIgbWFzaz0idXJsKCNwYXRoLTEtaW5zaWRlLTFfMThfNCkiLz4KICAgIDwvZz4KICAgIDxtYXNrIGlkPSJwYXRoLTItaW5zaWRlLTJfMThfNCIgZmlsbD0id2hpdGUiPgogICAgPHJlY3QgeD0iMjE5LjI3OCIgeT0iMjk2IiB3aWR0aD0iMzM4Ljg2MyIgaGVpZ2h0PSI0NjgiIHJ4PSI3Ii8+CiAgICA8L21hc2s+CiAgICA8cmVjdCB4PSIyMTkuMjc4IiB5PSIyOTYiIHdpZHRoPSIzMzguODYzIiBoZWlnaHQ9IjQ2OCIgcng9IjciIHN0cm9rZT0id2hpdGUiIHN0cm9rZS1vcGFjaXR5PSIwLjkiIHN0cm9rZS13aWR0aD0iMTYiIG1hc2s9InVybCgjcGF0aC0yLWluc2lkZS0yXzE4XzQpIi8+CiAgICA8ZWxsaXBzZSBjeD0iMzg5LjIzOCIgY3k9IjUxMS4yMjgiIHJ4PSI4Ni4yMzc2IiByeT0iODUuMjI4NCIgZmlsbD0id2hpdGUiIGZpbGwtb3BhY2l0eT0iMC4wOCIvPgogICAgPHBhdGggZD0iTTQ3MS40NzUgNTExLjIyOEM0NzEuNDc1IDU1Ni4wNDUgNDM0LjcwMSA1OTIuNDU3IDM4OS4yMzggNTkyLjQ1N0MzNDMuNzc0IDU5Mi40NTcgMzA3IDU1Ni4wNDUgMzA3IDUxMS4yMjhDMzA3IDQ2Ni40MTEgMzQzLjc3NCA0MzAgMzg5LjIzOCA0MzBDNDM0LjcwMSA0MzAgNDcxLjQ3NSA0NjYuNDExIDQ3MS40NzUgNTExLjIyOFoiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS1vcGFjaXR5PSIwLjkiIHN0cm9rZS13aWR0aD0iOCIvPgogICAgPHBhdGggZD0iTTM4Ny4zOCA2MDhDNTM1LjI2IDYwOCA1MzkuODggNzQzLjQ3MyA1MzkuODggNzQzLjQ3M0wyMzkgNzQzLjVDMjM5IDc0My41IDIzOS41IDYwOCAzODcuMzggNjA4WiIgZmlsbD0id2hpdGUiIGZpbGwtb3BhY2l0eT0iMC4wOCIvPgogICAgPHBhdGggZD0iTTM4Ny4zOCA2MTJDNDU5Ljc5NCA2MTIgNDk2LjY0OSA2NDUuMDIgNTE1LjYyNSA2NzcuNzQzQzUyNS4xOCA2OTQuMjIgNTMwLjI1NSA3MTAuNzMzIDUzMi45MzggNzIzLjE1QzUzNC4yNzggNzI5LjM1MSA1MzUuMDE2IDczNC41MDggNTM1LjQxOCA3MzguMDk4QzUzNS40NzMgNzM4LjU4NiA1MzUuNTIxIDczOS4wNDUgNTM1LjU2NCA3MzkuNDc0TDI0My4xODQgNzM5LjVDMjQzLjIxNiA3MzkuMDM3IDI0My4yNTMgNzM4LjUzOCAyNDMuMjk3IDczOC4wMDNDMjQzLjU5IDczNC40MTQgMjQ0LjE3MSA3MjkuMjU4IDI0NS4zMjIgNzIzLjA1OEMyNDcuNjI2IDcxMC42NDIgMjUyLjE5NyA2OTQuMTM4IDI2MS4yNDEgNjc3LjY3NkMyNzAuMjczIDY2MS4yMzYgMjgzLjc0OCA2NDQuODY0IDMwMy44OTEgNjMyLjU4N0MzMjQuMDI0IDYyMC4zMTYgMzUxLjA0MiA2MTIgMzg3LjM4IDYxMloiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS1vcGFjaXR5PSIwLjkiIHN0cm9rZS13aWR0aD0iOCIvPgogICAgPGRlZnM+CiAgICA8ZmlsdGVyIGlkPSJmaWx0ZXIwX2RfMThfNCIgeD0iMCIgeT0iMCIgd2lkdGg9IjEyMDYiIGhlaWdodD0iODkwIiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CiAgICA8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgogICAgPGZlQ29sb3JNYXRyaXggaW49IlNvdXJjZUFscGhhIiB0eXBlPSJtYXRyaXgiIHZhbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMTI3IDAiIHJlc3VsdD0iaGFyZEFscGhhIi8+CiAgICA8ZmVPZmZzZXQgZHk9IjQiLz4KICAgIDxmZUdhdXNzaWFuQmx1ciBzdGREZXZpYXRpb249IjIiLz4KICAgIDxmZUNvbXBvc2l0ZSBpbjI9ImhhcmRBbHBoYSIgb3BlcmF0b3I9Im91dCIvPgogICAgPGZlQ29sb3JNYXRyaXggdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMjUgMCIvPgogICAgPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJlZmZlY3QxX2Ryb3BTaGFkb3dfMThfNCIvPgogICAgPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJlZmZlY3QxX2Ryb3BTaGFkb3dfMThfNCIgcmVzdWx0PSJzaGFwZSIvPgogICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8L3N2Zz4KICAgIA==";
5
+ function Bi(a) {
6
+ let e, t, s, o, n, l, c, d, u;
7
+ return c = new Zi({}), {
8
+ c() {
9
+ e = v("div"), t = v("div"), s = v("div"), o = v("img"), l = L(), te(c.$$.fragment), this.c = K, pe(o.src, n = Ui) || h(o, "src", n), h(o, "alt", "document"), h(s, "class", "w-full h-full relative"), h(t, "class", "absolute inset-0 flex justify-center"), h(e, "id", "doc-rectangle"), h(e, "class", d = "doc-loader " + /*loading*/
10
+ (a[0] ? "doc-loading" : "") + " z-10"), h(
11
+ e,
12
+ "style",
13
+ /*styleVars*/
14
+ a[1]
15
+ );
16
+ },
17
+ m(r, g) {
18
+ k(r, e, g), C(e, t), C(t, s), C(s, o), C(e, l), ie(c, e, null), u = !0;
19
+ },
20
+ p(r, [g]) {
21
+ (!u || g & /*loading*/
22
+ 1 && d !== (d = "doc-loader " + /*loading*/
23
+ (r[0] ? "doc-loading" : "") + " z-10")) && h(e, "class", d), (!u || g & /*styleVars*/
24
+ 2) && h(
25
+ e,
26
+ "style",
27
+ /*styleVars*/
28
+ r[1]
29
+ );
30
+ },
31
+ i(r) {
32
+ u || (W(c.$$.fragment, r), u = !0);
33
+ },
34
+ o(r) {
35
+ B(c.$$.fragment, r), u = !1;
36
+ },
37
+ d(r) {
38
+ r && P(e), ae(c);
39
+ }
40
+ };
41
+ }
42
+ const et = 1.36, Gi = "hsl(var(--p))", Qi = "hsl(var(--su))";
43
+ function Yi(a, e, t) {
44
+ let s, o, n;
45
+ _(a, De, (g) => t(7, o = g)), _(a, le, (g) => t(6, n = g));
46
+ let { loading: l } = e, c, d, u = 6, r = 0.7;
47
+ return Y() && (r = 0.85, u = 5), a.$$set = (g) => {
48
+ "loading" in g && t(0, l = g.loading);
49
+ }, a.$$.update = () => {
50
+ a.$$.dirty & /*$videoStore, percentage, rectangleHeight, rectangleWidth*/
51
+ 108 && n && (n.videoWidth / n.videoHeight > et ? (t(3, d = n.videoHeight * r), t(2, c = d * et)) : (t(2, c = n.videoWidth * r), t(3, d = c / et)), m(De, o.width = c, o), m(De, o.height = d, o)), a.$$.dirty & /*rectangleWidth, rectangleHeight, borderWidth*/
52
+ 28 && t(1, s = `
53
+ --rectangle-width: ${c}px;
54
+ --rectangle-height: ${d}px;
55
+ --border-color: ${Gi};
56
+ --border-color-animation: ${Qi};
57
+ --rectangle-border: ${u}px;
58
+ `);
59
+ }, [
60
+ l,
61
+ s,
62
+ c,
63
+ d,
64
+ u,
65
+ r,
66
+ n
67
+ ];
68
+ }
69
+ class Zt extends Rt {
70
+ constructor(e) {
71
+ super(), kt(
72
+ this,
73
+ {
74
+ target: this.shadowRoot,
75
+ props: St(this.attributes),
76
+ customElement: !0
77
+ },
78
+ Yi,
79
+ Bi,
80
+ Et,
81
+ { loading: 0 },
82
+ null
83
+ ), e && (e.target && k(e.target, this, e.anchor), e.props && (this.$set(e.props), U()));
84
+ }
85
+ static get observedAttributes() {
86
+ return ["loading"];
87
+ }
88
+ get loading() {
89
+ return this.$$.ctx[0];
90
+ }
91
+ set loading(e) {
92
+ this.$$set({ loading: e }), U();
93
+ }
94
+ }
95
+ customElements.define("doc-rectangle", Zt);
96
+ function Tt(a) {
97
+ let e, t, s, o, n, l, c, d, u, r, g, I, D, y, E, f, w, z, N = (
98
+ /*$ready*/
99
+ a[11] && zt(a)
100
+ );
101
+ return g = new ji({}), D = new Pi({
102
+ props: {
103
+ showConfigButton: (
104
+ /*showConfigButton*/
105
+ a[1]
106
+ ),
107
+ showCameraButton: (
108
+ /*showCameraButton*/
109
+ a[2]
110
+ ),
111
+ videoOverlay: (
112
+ /*videoOverlay*/
113
+ a[3]
114
+ ),
115
+ videoOverlayTransparency: (
116
+ /*videoOverlayTransparency*/
117
+ a[4]
118
+ ),
119
+ handler: (
120
+ /*capture*/
121
+ a[24]
122
+ )
123
+ }
124
+ }), {
125
+ c() {
126
+ e = v("div"), t = v("div"), s = v("video"), n = L(), l = v("canvas"), c = L(), d = v("div"), u = v("div"), N && N.c(), r = L(), te(g.$$.fragment), I = L(), te(D.$$.fragment), h(s, "id", "bry-cc-camera-video-tag"), h(s, "class", o = /*$ready*/
127
+ a[11] ? Y() ? "absolute inset-0" : "w-full h-full object-cover" : "w-0 h-0"), s.playsInline = !0, s.muted = !0, s.autoplay = !0, h(l, "id", "bry-ce-detectionsCanvas"), h(l, "class", "absolute top-0 left-0 max-w-full"), h(t, "class", "overflow-hidden"), ve(
128
+ t,
129
+ "width",
130
+ /*$videoStore*/
131
+ a[12].videoWidth + "px"
132
+ ), ve(
133
+ t,
134
+ "height",
135
+ /*$videoStore*/
136
+ a[12].videoHeight + "px"
137
+ ), h(u, "class", "flex flex-grow w-full items-center justify-center relative"), h(d, "class", "absolute inset-0 flex flex-col items-center justify-between w-full h-full"), h(e, "class", y = /*$ready*/
138
+ a[11] ? "relative" : "relative w-0 h-0"), e.hidden = E = /*$cameraStatusStore*/
139
+ a[10] !== Z.OK;
140
+ },
141
+ m(A, j) {
142
+ k(A, e, j), C(e, t), C(t, s), a[32](s), C(t, n), C(t, l), a[34](l), C(e, c), C(e, d), C(d, u), N && N.m(u, null), C(d, r), ie(g, d, null), C(d, I), ie(D, d, null), f = !0, w || (z = [
143
+ se(
144
+ s,
145
+ "canplay",
146
+ /*canplay_handler*/
147
+ a[33]
148
+ ),
149
+ se(
150
+ s,
151
+ "play",
152
+ /*play*/
153
+ a[5],
154
+ { once: !0 }
155
+ )
156
+ ], w = !0);
157
+ },
158
+ p(A, j) {
159
+ (!f || j[0] & /*$ready*/
160
+ 2048 && o !== (o = /*$ready*/
161
+ A[11] ? Y() ? "absolute inset-0" : "w-full h-full object-cover" : "w-0 h-0")) && h(s, "class", o), (!f || j[0] & /*$videoStore*/
162
+ 4096) && ve(
163
+ t,
164
+ "width",
165
+ /*$videoStore*/
166
+ A[12].videoWidth + "px"
167
+ ), (!f || j[0] & /*$videoStore*/
168
+ 4096) && ve(
169
+ t,
170
+ "height",
171
+ /*$videoStore*/
172
+ A[12].videoHeight + "px"
173
+ ), /*$ready*/
174
+ A[11] ? N ? (N.p(A, j), j[0] & /*$ready*/
175
+ 2048 && W(N, 1)) : (N = zt(A), N.c(), W(N, 1), N.m(u, null)) : N && (tt(), B(N, 1, 1, () => {
176
+ N = null;
177
+ }), it());
178
+ const S = {};
179
+ j[0] & /*showConfigButton*/
180
+ 2 && (S.showConfigButton = /*showConfigButton*/
181
+ A[1]), j[0] & /*showCameraButton*/
182
+ 4 && (S.showCameraButton = /*showCameraButton*/
183
+ A[2]), j[0] & /*videoOverlay*/
184
+ 8 && (S.videoOverlay = /*videoOverlay*/
185
+ A[3]), j[0] & /*videoOverlayTransparency*/
186
+ 16 && (S.videoOverlayTransparency = /*videoOverlayTransparency*/
187
+ A[4]), D.$set(S), (!f || j[0] & /*$ready*/
188
+ 2048 && y !== (y = /*$ready*/
189
+ A[11] ? "relative" : "relative w-0 h-0")) && h(e, "class", y), (!f || j[0] & /*$cameraStatusStore*/
190
+ 1024 && E !== (E = /*$cameraStatusStore*/
191
+ A[10] !== Z.OK)) && (e.hidden = E);
192
+ },
193
+ i(A) {
194
+ f || (W(N), W(g.$$.fragment, A), W(D.$$.fragment, A), f = !0);
195
+ },
196
+ o(A) {
197
+ B(N), B(g.$$.fragment, A), B(D.$$.fragment, A), f = !1;
198
+ },
199
+ d(A) {
200
+ A && P(e), a[32](null), a[34](null), N && N.d(), ae(g), ae(D), w = !1, at(z);
201
+ }
202
+ };
203
+ }
204
+ function zt(a) {
205
+ let e, t, s, o;
206
+ return e = new Wi({
207
+ props: {
208
+ isCountingDown: (
209
+ /*isCountingDown*/
210
+ a[9]
211
+ )
212
+ }
213
+ }), s = new Zt({
214
+ props: { loading: (
215
+ /*isCountingDown*/
216
+ a[9]
217
+ ) }
218
+ }), {
219
+ c() {
220
+ te(e.$$.fragment), t = L(), te(s.$$.fragment);
221
+ },
222
+ m(n, l) {
223
+ ie(e, n, l), k(n, t, l), ie(s, n, l), o = !0;
224
+ },
225
+ p(n, l) {
226
+ const c = {};
227
+ l[0] & /*isCountingDown*/
228
+ 512 && (c.isCountingDown = /*isCountingDown*/
229
+ n[9]), e.$set(c);
230
+ const d = {};
231
+ l[0] & /*isCountingDown*/
232
+ 512 && (d.loading = /*isCountingDown*/
233
+ n[9]), s.$set(d);
234
+ },
235
+ i(n) {
236
+ o || (W(e.$$.fragment, n), W(s.$$.fragment, n), o = !0);
237
+ },
238
+ o(n) {
239
+ B(e.$$.fragment, n), B(s.$$.fragment, n), o = !1;
240
+ },
241
+ d(n) {
242
+ ae(e, n), n && P(t), ae(s, n);
243
+ }
244
+ };
245
+ }
246
+ function Ot(a) {
247
+ let e, t, s, o, n;
248
+ function l(u, r) {
249
+ return (
250
+ /*$isLoading*/
251
+ u[20] ? Vi : Xi
252
+ );
253
+ }
254
+ let c = l(a), d = c(a);
255
+ return {
256
+ c() {
257
+ e = v("slot"), t = v("div"), s = v("img"), n = L(), d.c(), pe(s.src, o = Ri) || h(s, "src", o), h(s, "alt", "loading gif"), h(s, "class", "m-auto h-[10em] lg:h-[12em]"), h(t, "class", "translate-y-1/3 md:translate-y-1/4 xl:translate-y-1/2"), h(e, "name", "loading-camera-gif"), h(e, "class", "block h-[17em] lg:h-[21.6em] xl:h-[30em]");
258
+ },
259
+ m(u, r) {
260
+ k(u, e, r), C(e, t), C(t, s), C(t, n), d.m(t, null);
261
+ },
262
+ p(u, r) {
263
+ c === (c = l(u)) && d ? d.p(u, r) : (d.d(1), d = c(u), d && (d.c(), d.m(t, null)));
264
+ },
265
+ d(u) {
266
+ u && P(e), d.d();
267
+ }
268
+ };
269
+ }
270
+ function Xi(a) {
271
+ let e, t = (
272
+ /*$_*/
273
+ a[18]("faceCollector.initiatingCamera") + ""
274
+ ), s;
275
+ return {
276
+ c() {
277
+ e = v("span"), s = X(t), h(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
278
+ },
279
+ m(o, n) {
280
+ k(o, e, n), C(e, s);
281
+ },
282
+ p(o, n) {
283
+ n[0] & /*$_*/
284
+ 262144 && t !== (t = /*$_*/
285
+ o[18]("faceCollector.initiatingCamera") + "") && V(s, t);
286
+ },
287
+ d(o) {
288
+ o && P(e);
289
+ }
290
+ };
291
+ }
292
+ function Vi(a) {
293
+ let e;
294
+ return {
295
+ c() {
296
+ e = v("span"), e.textContent = "Loading camera...", h(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center");
297
+ },
298
+ m(t, s) {
299
+ k(t, e, s);
300
+ },
301
+ p: K,
302
+ d(t) {
303
+ t && P(e);
304
+ }
305
+ };
306
+ }
307
+ function jt(a) {
308
+ let e, t, s = (
309
+ /*$_*/
310
+ a[18]("faceCollector.finish") + ""
311
+ ), o, n, l, c, d = (
312
+ /*$_*/
313
+ a[18]("faceCollector.retakePhoto") + ""
314
+ ), u, r, g;
315
+ return {
316
+ c() {
317
+ e = v("div"), t = v("button"), o = X(s), l = L(), c = v("button"), u = X(d), t.disabled = n = /*$justification*/
318
+ a[15].length === 0, h(t, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), h(c, "id", "bry-cc-retake-button"), h(c, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), h(e, "class", "ce-dui-btn-group flex");
319
+ },
320
+ m(I, D) {
321
+ k(I, e, D), C(e, t), C(t, o), C(e, l), C(e, c), C(c, u), r || (g = [
322
+ se(
323
+ t,
324
+ "click",
325
+ /*click_handler*/
326
+ a[35]
327
+ ),
328
+ se(
329
+ c,
330
+ "click",
331
+ /*click_handler_1*/
332
+ a[36]
333
+ )
334
+ ], r = !0);
335
+ },
336
+ p(I, D) {
337
+ D[0] & /*$_*/
338
+ 262144 && s !== (s = /*$_*/
339
+ I[18]("faceCollector.finish") + "") && V(o, s), D[0] & /*$justification*/
340
+ 32768 && n !== (n = /*$justification*/
341
+ I[15].length === 0) && (t.disabled = n), D[0] & /*$_*/
342
+ 262144 && d !== (d = /*$_*/
343
+ I[18]("faceCollector.retakePhoto") + "") && V(u, d);
344
+ },
345
+ d(I) {
346
+ I && P(e), r = !1, at(g);
347
+ }
348
+ };
349
+ }
350
+ function xi(a) {
351
+ let e, t;
352
+ return e = new Li({ props: { handler: (
353
+ /*func*/
354
+ a[40]
355
+ ) } }), {
356
+ c() {
357
+ te(e.$$.fragment);
358
+ },
359
+ m(s, o) {
360
+ ie(e, s, o), t = !0;
361
+ },
362
+ p: K,
363
+ i(s) {
364
+ t || (W(e.$$.fragment, s), t = !0);
365
+ },
366
+ o(s) {
367
+ B(e.$$.fragment, s), t = !1;
368
+ },
369
+ d(s) {
370
+ ae(e, s);
371
+ }
372
+ };
373
+ }
374
+ function Ji(a) {
375
+ let e, t, s, o, n, l;
376
+ function c(r, g) {
377
+ return (
378
+ /*$captured*/
379
+ r[13] ? Ki : qi
380
+ );
381
+ }
382
+ let d = c(a), u = d(a);
383
+ return {
384
+ c() {
385
+ e = v("div"), t = v("img"), n = L(), u.c(), h(t, "class", "m-auto col-start-1 col-end-1 max-h-[23.2em]"), pe(t.src, s = /*$dataTypePrefix*/
386
+ a[19] + "," + /*$image*/
387
+ a[16]) || h(t, "src", s), t.hidden = o = !/*$captured*/
388
+ a[13] || !/*$showFaceWhileValidating*/
389
+ a[21], h(t, "alt", ""), h(e, "class", l = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (/*$showFaceWhileValidating*/
390
+ a[21] ? "grid overflow-hidden" : "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible"));
391
+ },
392
+ m(r, g) {
393
+ k(r, e, g), C(e, t), C(e, n), u.m(e, null);
394
+ },
395
+ p(r, g) {
396
+ g[0] & /*$dataTypePrefix, $image*/
397
+ 589824 && !pe(t.src, s = /*$dataTypePrefix*/
398
+ r[19] + "," + /*$image*/
399
+ r[16]) && h(t, "src", s), g[0] & /*$captured, $showFaceWhileValidating*/
400
+ 2105344 && o !== (o = !/*$captured*/
401
+ r[13] || !/*$showFaceWhileValidating*/
402
+ r[21]) && (t.hidden = o), d === (d = c(r)) && u ? u.p(r, g) : (u.d(1), u = d(r), u && (u.c(), u.m(e, null))), g[0] & /*$showFaceWhileValidating*/
403
+ 2097152 && l !== (l = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (/*$showFaceWhileValidating*/
404
+ r[21] ? "grid overflow-hidden" : "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible")) && h(e, "class", l);
405
+ },
406
+ i: K,
407
+ o: K,
408
+ d(r) {
409
+ r && P(e), u.d();
410
+ }
411
+ };
412
+ }
413
+ function Ki(a) {
414
+ let e, t, s, o, n = (
415
+ /*$_*/
416
+ a[18]("faceCollector.finish") + ""
417
+ ), l, c, d, u, r = (
418
+ /*$_*/
419
+ a[18]("faceCollector.retakePhoto") + ""
420
+ ), g, I, D;
421
+ function y(w, z) {
422
+ return (
423
+ /*$requestResult*/
424
+ w[17] === ee.TEMPLATE_EXTRACTION_ERROR ? ta : (
425
+ /*$saved*/
426
+ w[14] ? $i : ea
427
+ )
428
+ );
429
+ }
430
+ let E = y(a), f = E(a);
431
+ return {
432
+ c() {
433
+ e = v("div"), f.c(), t = L(), s = v("div"), o = v("button"), l = X(n), d = L(), u = v("button"), g = X(r), o.disabled = c = /*$saved*/
434
+ a[14] || /*$requestResult*/
435
+ a[17] !== ee.OK, h(o, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), h(u, "id", "bry-cc-retake-button"), h(u, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), h(s, "class", "ce-dui-btn-group flex"), h(e, "class", "flex flex-col justify-between");
436
+ },
437
+ m(w, z) {
438
+ k(w, e, z), f.m(e, null), C(e, t), C(e, s), C(s, o), C(o, l), C(s, d), C(s, u), C(u, g), I || (D = [
439
+ se(
440
+ o,
441
+ "click",
442
+ /*click_handler_2*/
443
+ a[38]
444
+ ),
445
+ se(
446
+ u,
447
+ "click",
448
+ /*click_handler_3*/
449
+ a[39]
450
+ )
451
+ ], I = !0);
452
+ },
453
+ p(w, z) {
454
+ E === (E = y(w)) && f ? f.p(w, z) : (f.d(1), f = E(w), f && (f.c(), f.m(e, t))), z[0] & /*$_*/
455
+ 262144 && n !== (n = /*$_*/
456
+ w[18]("faceCollector.finish") + "") && V(l, n), z[0] & /*$saved, $requestResult*/
457
+ 147456 && c !== (c = /*$saved*/
458
+ w[14] || /*$requestResult*/
459
+ w[17] !== ee.OK) && (o.disabled = c), z[0] & /*$_*/
460
+ 262144 && r !== (r = /*$_*/
461
+ w[18]("faceCollector.retakePhoto") + "") && V(g, r);
462
+ },
463
+ d(w) {
464
+ w && P(e), f.d(), I = !1, at(D);
465
+ }
466
+ };
467
+ }
468
+ function qi(a) {
469
+ let e;
470
+ return {
471
+ c() {
472
+ e = v("div"), h(e, "class", "");
473
+ },
474
+ m(t, s) {
475
+ k(t, e, s);
476
+ },
477
+ p: K,
478
+ d(t) {
479
+ t && P(e);
480
+ }
481
+ };
482
+ }
483
+ function $i(a) {
484
+ let e, t = (
485
+ /*$_*/
486
+ a[18]("docCollector.captured") + ""
487
+ ), s;
488
+ return {
489
+ c() {
490
+ e = v("h1"), s = X(t), h(e, "class", "text-3xl font-bold pb-[1em] transition-opacity");
491
+ },
492
+ m(o, n) {
493
+ k(o, e, n), C(e, s);
494
+ },
495
+ p(o, n) {
496
+ n[0] & /*$_*/
497
+ 262144 && t !== (t = /*$_*/
498
+ o[18]("docCollector.captured") + "") && V(s, t);
499
+ },
500
+ d(o) {
501
+ o && P(e);
502
+ }
503
+ };
504
+ }
505
+ function ea(a) {
506
+ let e, t = (
507
+ /*$_*/
508
+ a[18]("faceCollector.everythingOk") + ""
509
+ ), s;
510
+ return {
511
+ c() {
512
+ e = v("h1"), s = X(t), h(e, "class", "text-3xl font-bold pb-[1em] transition-opacity");
513
+ },
514
+ m(o, n) {
515
+ k(o, e, n), C(e, s);
516
+ },
517
+ p(o, n) {
518
+ n[0] & /*$_*/
519
+ 262144 && t !== (t = /*$_*/
520
+ o[18]("faceCollector.everythingOk") + "") && V(s, t);
521
+ },
522
+ d(o) {
523
+ o && P(e);
524
+ }
525
+ };
526
+ }
527
+ function ta(a) {
528
+ let e, t = (
529
+ /*$_*/
530
+ a[18]("docCollector.docNotFound") + ""
531
+ ), s;
532
+ return {
533
+ c() {
534
+ e = v("h1"), s = X(t), h(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error");
535
+ },
536
+ m(o, n) {
537
+ k(o, e, n), C(e, s);
538
+ },
539
+ p(o, n) {
540
+ n[0] & /*$_*/
541
+ 262144 && t !== (t = /*$_*/
542
+ o[18]("docCollector.docNotFound") + "") && V(s, t);
543
+ },
544
+ d(o) {
545
+ o && P(e);
546
+ }
547
+ };
548
+ }
549
+ function ia(a) {
550
+ let e, t, s, o, n, l, c, d, u, r = (
551
+ /*$videoStore*/
552
+ a[12] && Tt(a)
553
+ ), g = !/*$ready*/
554
+ a[11] && /*$cameraStatusStore*/
555
+ a[10] === Z.OK && Ot(a), I = (
556
+ /*$captured*/
557
+ a[13] && jt(a)
558
+ );
559
+ const D = [Ji, xi], y = [];
560
+ function E(f, w) {
561
+ return (
562
+ /*showUnconformities*/
563
+ f[0] && /*$captured*/
564
+ f[13] ? 0 : (
565
+ /*$cameraStatusStore*/
566
+ f[10] !== Z.OK ? 1 : -1
567
+ )
568
+ );
569
+ }
570
+ return ~(l = E(a)) && (c = y[l] = D[l](a)), {
571
+ c() {
572
+ e = v("div"), t = v("div"), r && r.c(), s = L(), g && g.c(), o = L(), I && I.c(), n = L(), c && c.c(), d = di(), this.c = K, h(t, "class", "relative mx-auto"), h(e, "class", "flex flex-col justify-between");
573
+ },
574
+ m(f, w) {
575
+ k(f, e, w), C(e, t), r && r.m(t, null), C(t, s), g && g.m(t, null), C(t, o), I && I.m(t, null), a[37](e), k(f, n, w), ~l && y[l].m(f, w), k(f, d, w), u = !0;
576
+ },
577
+ p(f, w) {
578
+ /*$videoStore*/
579
+ f[12] ? r ? (r.p(f, w), w[0] & /*$videoStore*/
580
+ 4096 && W(r, 1)) : (r = Tt(f), r.c(), W(r, 1), r.m(t, s)) : r && (tt(), B(r, 1, 1, () => {
581
+ r = null;
582
+ }), it()), !/*$ready*/
583
+ f[11] && /*$cameraStatusStore*/
584
+ f[10] === Z.OK ? g ? g.p(f, w) : (g = Ot(f), g.c(), g.m(t, o)) : g && (g.d(1), g = null), /*$captured*/
585
+ f[13] ? I ? I.p(f, w) : (I = jt(f), I.c(), I.m(t, null)) : I && (I.d(1), I = null);
586
+ let z = l;
587
+ l = E(f), l === z ? ~l && y[l].p(f, w) : (c && (tt(), B(y[z], 1, 1, () => {
588
+ y[z] = null;
589
+ }), it()), ~l ? (c = y[l], c ? c.p(f, w) : (c = y[l] = D[l](f), c.c()), W(c, 1), c.m(d.parentNode, d)) : c = null);
590
+ },
591
+ i(f) {
592
+ u || (W(r), W(c), u = !0);
593
+ },
594
+ o(f) {
595
+ B(r), B(c), u = !1;
596
+ },
597
+ d(f) {
598
+ f && P(e), r && r.d(), g && g.d(), I && I.d(), a[37](null), f && P(n), ~l && y[l].d(f), f && P(d);
599
+ }
600
+ };
601
+ }
602
+ let aa = !1, sa = 5;
603
+ function oa(a, e, t) {
604
+ const s = e.videoWidth / e.videoHeight, o = t.width / t.height;
605
+ let n = 0, l = 0, c = e.videoWidth, d = e.videoHeight;
606
+ s > o ? (c = e.videoHeight * o, n = (e.videoWidth - c) / 2) : s < o && (d = e.videoWidth / o, l = (e.videoHeight - d) / 2), a.drawImage(e, n, l, c, d, 0, 0, t.width, t.height);
607
+ }
608
+ function na(a, e, t) {
609
+ let s, o, n, l, c, d, u, r, g, I, D, y, E, f, w, z, N, A, j, S, _e, x, re, J, st, ot, nt;
610
+ _(a, Be, (i) => t(55, s = i)), _(a, fe, (i) => t(57, n = i)), _(a, G, (i) => t(10, l = i)), _(a, he, (i) => t(11, c = i)), _(a, gi, (i) => t(58, d = i)), _(a, me, (i) => t(59, u = i)), _(a, fi, (i) => t(60, r = i)), _(a, ne, (i) => t(61, g = i)), _(a, le, (i) => t(12, I = i)), _(a, Ie, (i) => t(13, D = i)), _(a, Ge, (i) => t(62, y = i)), _(a, Qe, (i) => t(63, E = i)), _(a, Dt, (i) => t(64, f = i)), _(a, De, (i) => t(65, w = i)), _(a, be, (i) => t(66, z = i)), _(a, Ye, (i) => t(14, N = i)), _(a, hi, (i) => t(15, A = i)), _(a, pt, (i) => t(16, j = i)), _(a, Ce, (i) => t(17, S = i)), _(a, mi, (i) => t(18, _e = i)), _(a, Xe, (i) => t(67, x = i)), _(a, _t, (i) => t(68, J = i)), _(a, Ve, (i) => t(69, st = i)), _(a, Ii, (i) => t(20, ot = i)), _(a, bi, (i) => t(21, nt = i));
611
+ let M, R, Q, oe = !1, lt = !1, F = {
612
+ width: 2560,
613
+ height: 1440,
614
+ aspectRatio: -1
615
+ };
616
+ const Pt = { width: 2560, height: 1440 };
617
+ let { enableMinutiae: ye } = e, { videoDimensions: Ae } = e, { noTabs: Ne } = e, { weightsPath: Te } = e, { showUnconformities: rt } = e, { showConfigButton: ct } = e, { showCameraButton: ut } = e, { videoOverlay: dt } = e, { videoOverlayTransparency: gt } = e;
618
+ const ce = Nt(!1);
619
+ _(a, ce, (i) => t(56, o = i));
620
+ const ze = Nt("data:image/png;base64");
621
+ _(a, ze, (i) => t(19, re = i));
622
+ let ft = !1, ue = !0, ht = 0, Oe = 0, je = !0, mt = 0, Re = (/* @__PURE__ */ new Date()).getTime(), ke = !1;
623
+ Ci.mixin({
624
+ toast: !0,
625
+ position: "bottom-left",
626
+ timer: 13e3,
627
+ timerProgressBar: !0
628
+ }), wi(async () => {
629
+ if (m(he, c = !1, c), It(), J)
630
+ try {
631
+ await Mi(Te), lt = !0;
632
+ } catch {
633
+ m(_t, J = !1, J);
634
+ }
635
+ await Se(), Lt();
636
+ });
637
+ function It() {
638
+ m(Ie, D = !1, D), m(Dt, f = !0, f), m(be, z = "", z), m(me, u = xe.REAR_CAMERA, u), m(fe, n = !1, n), m(Ye, N = !1, N), m(Ce, S = ee.OK, S), m(Xe, x = "", x);
639
+ const i = vi(Je);
640
+ i.closedMouth = !1, i.isPersonCloseEnough = !1, i.isPersonTooclose = !0, i.isPersonInFrame = !1, Je.set(i);
641
+ }
642
+ async function Wt() {
643
+ const [i, p] = (Ae ?? "")?.replaceAll(" ", "")?.split("x")?.map((b) => b ? parseInt(b) : void 0);
644
+ if (!(!i || !p))
645
+ if (Y()) {
646
+ await ki();
647
+ const b = window.innerWidth, O = window.innerHeight, T = p, H = O / b * T;
648
+ m(
649
+ le,
650
+ I = {
651
+ videoWidth: T,
652
+ videoHeight: H
653
+ },
654
+ I
655
+ );
656
+ } else
657
+ m(le, I = { videoWidth: i, videoHeight: p }, I);
658
+ }
659
+ function bt() {
660
+ m(G, l = Z.OK, l), ft = !0, ue = !1;
661
+ }
662
+ async function de() {
663
+ if (J && !lt)
664
+ return Me(M, de);
665
+ if (M) {
666
+ if (st !== qe.Document && !Ne)
667
+ return Me(M, de);
668
+ m(he, c = !0, c), J && (o || m(ce, o = !0, o)), Me(M, de);
669
+ }
670
+ }
671
+ async function Ct() {
672
+ let i = Ht();
673
+ if (J && !await Ei(i)) {
674
+ console.warn("Document capture - document not detected! Resetting capture.");
675
+ return;
676
+ }
677
+ m(Ie, D = !0, D);
678
+ let p = [];
679
+ try {
680
+ const b = i.toDataURL("image/jpeg").split(",");
681
+ m(ze, re = b[0], re), m(pt, j = b[1], j), m(Xe, x = b[1], x), p = [
682
+ {
683
+ bodyPart: "DOCUMENT",
684
+ data: x
685
+ }
686
+ ], m(Ce, S = ee.OK, S), window.dispatchEvent(new CustomEvent(
687
+ "document-unconformities-validated",
688
+ {
689
+ detail: { bodyParts: p, status: S }
690
+ }
691
+ ));
692
+ } catch (b) {
693
+ console.error(b);
694
+ let O, T = Si.DOCUMENT_NOT_FOUND, H = [];
695
+ b instanceof Error && ["DOCUMENT_NOT_FOUND"].includes(b.message) && (m(Ce, S = ee.TEMPLATE_EXTRACTION_ERROR, S), O = b.message, H = [
696
+ {
697
+ bodyPart: "DOCUMENT",
698
+ data: x,
699
+ format: "jpg"
700
+ }
701
+ ]), window.dispatchEvent(new CustomEvent(
702
+ "document-unconformities-validated",
703
+ {
704
+ detail: {
705
+ bodyParts: H,
706
+ errorCode: O,
707
+ translatedError: _e(T),
708
+ status: S
709
+ }
710
+ }
711
+ ));
712
+ }
713
+ }
714
+ function Ee() {
715
+ const i = {
716
+ bodyPart: "DOCUMENT",
717
+ data: j,
718
+ justification: A
719
+ };
720
+ m(Ye, N = !0, N), window.dispatchEvent(new CustomEvent("export-document", { detail: i }));
721
+ }
722
+ function ge() {
723
+ window.dispatchEvent(new CustomEvent("document-scrapped")), It(), ue && bt();
724
+ }
725
+ async function Se(i) {
726
+ if (!je) {
727
+ m(G, l = Z.CAMERA_ORIENTATION_PORTRAIT, l);
728
+ return;
729
+ }
730
+ await Wt();
731
+ try {
732
+ let { stream: p, deviceId: b, width: O, height: T, aspectRatio: H } = await yt(F.width, F.height, u, i);
733
+ if (m(Ge, y = p, y), F.aspectRatio = H || O / T, F.aspectRatio > 1 && O < F.width || F.aspectRatio < 1 && T < F.width) {
734
+ F.width = O, F.height = O / 1.7777, y.getTracks()?.forEach((Pe) => Pe?.stop());
735
+ const { stream: Ze } = await yt(F.width, F.height, u, i);
736
+ m(Ge, y = Ze, y);
737
+ }
738
+ m(ne, g = b || r[0].deviceId, g);
739
+ } catch (p) {
740
+ const b = p;
741
+ ue = !0;
742
+ const O = we(p) && p.constraint ? p.constraint : "";
743
+ console.error(b, O), we(b) && "message" in b && b.message.includes("Permission denied") && (console.error("User didn't give permission to use camera!"), m(G, l = Z.CAMERA_DENIED_ERROR, l)), we(b) && "message" in b && b.message.includes("Requested device not found") && m(G, l = Z.DEVICE_NOT_FOUND_ERROR, l), (O.includes("width") || O.includes("height")) && (console.error(`Camera does not meet the minimum supported requirements! (${O})`), m(G, l = Z.CAMERA_UNSUPPORTED, l));
744
+ }
745
+ }
746
+ async function q() {
747
+ m(ne, g = "", g), await Se();
748
+ }
749
+ function Lt() {
750
+ navigator.mediaDevices.ondevicechange = async (i) => {
751
+ await At(), l !== Z.OK ? await q() : y.active || (Ke(), m(G, l = Z.DEVICE_NOT_FOUND_ERROR, l));
752
+ };
753
+ }
754
+ function Ft() {
755
+ m(fe, n = !1, n);
756
+ const i = (/* @__PURE__ */ new Date()).getTime();
757
+ i - Re > 5e3 ? (Re = i, m(be, z = "docCollector.docWasNotFound", z)) : ke || (ke = !0, setTimeout(
758
+ () => {
759
+ ke = !1, z != "docCollector.docWasNotFound" && m(be, z = "", z);
760
+ },
761
+ 1500
762
+ ));
763
+ }
764
+ function Ht() {
765
+ const i = I.videoWidth, p = I.videoHeight, b = Pt.width, O = p / i * b, T = document.createElement("canvas"), H = T.getContext("2d");
766
+ T.width = b, T.height = O, H && oa(H, M, T);
767
+ const Ze = T.width / I.videoWidth, Pe = T.height / I.videoHeight, li = Y() ? 0.25 : 0.15, ri = Math.round(T.height * li), We = w.width * Ze, Le = w.height * Pe, Mt = (Y() ? 0.15 : 0.2) * We, vt = 0.2 * Le, ci = (T.width - We) / 2 - Mt / 2, ui = (T.height - ri - Le) / 2 - vt / 2, Fe = We + Mt, He = Le + vt, $ = document.createElement("canvas");
768
+ $.width = Fe, $.height = He;
769
+ const Ue = $.getContext("2d");
770
+ return Ue?.clearRect(0, 0, $.width, $.height), Ue?.drawImage(T, ci, ui, Fe, He, 0, 0, Fe, He), Ue?.save(), $;
771
+ }
772
+ const Ut = le.subscribe((i) => {
773
+ M && R && (t(6, M.width = i.videoWidth, M), t(6, M.height = i.videoHeight, M), t(7, R.width = i.videoWidth, R), t(7, R.height = i.videoHeight, R));
774
+ }), Bt = Je.subscribe((i) => {
775
+ let p = "";
776
+ if (i.isPersonCloseEnough ? i.isPersonTooclose ? p = "docCollector.moveAwayCamera" : i.isPersonInFrame || (p = "docCollector.stayInFrame") : p = "docCollector.comeCloserCamera", n && Di(p), !D && f && n && !oe && i.isPersonInFrame && !(!i.isPersonCloseEnough || i.isPersonTooclose)) {
777
+ t(9, oe = !0), mt = (/* @__PURE__ */ new Date()).getTime() + 4500;
778
+ const b = setInterval(
779
+ async () => {
780
+ if (!f || D || !i.isPersonCloseEnough || i.isPersonTooclose || !i.isPersonInFrame) {
781
+ t(9, oe = !1), setTimeout(
782
+ () => {
783
+ },
784
+ 1500
785
+ ), clearInterval(b);
786
+ return;
787
+ }
788
+ const O = (/* @__PURE__ */ new Date()).getTime();
789
+ Math.floor((mt - O) % (1e3 * 60) / 1e3) <= 0 && (clearInterval(b), t(9, oe = !1), Ct());
790
+ },
791
+ 100
792
+ );
793
+ }
794
+ }), Gt = Ie.subscribe((i) => {
795
+ Q && (i ? (Q.classList.remove("flex"), Q.classList.add("hidden")) : (Q.classList.add("flex"), Q.classList.remove("hidden")));
796
+ }), Qt = Qe.subscribe((i) => {
797
+ M && i && (console.log("setting null in video srcObject"), t(6, M.srcObject = null, M), t(6, M.src = "", M), m(ne, g = null, g));
798
+ });
799
+ Ve.subscribe(async (i) => {
800
+ i === qe.Document && await At();
801
+ });
802
+ const Yt = ne.subscribe(async (i) => {
803
+ if (!(!y || !i))
804
+ try {
805
+ const p = await pi(F.width, F.height, i);
806
+ t(6, M.srcObject = y, M), m(Qe, E = !1, E), y.getTracks().forEach((b) => {
807
+ b.readyState === "live" && console.log(`Camera ${b.label} opened successfully!`);
808
+ }), m(G, l = Z.OK, l), _i(M);
809
+ } catch (p) {
810
+ const b = p;
811
+ ue = !0, we(b) && "message" in b && b.message.includes("Requested device not found") && m(G, l = Z.DEVICE_NOT_FOUND_ERROR, l);
812
+ }
813
+ }), Xt = Ve.subscribe(async (i) => {
814
+ i === qe.Document && !ft && !D && aa && await bt();
815
+ }), Vt = ce.subscribe(async (i) => {
816
+ i && wt();
817
+ }), xt = he.subscribe((i) => {
818
+ i && window.dispatchEvent(new CustomEvent("brycc-camera-ready"));
819
+ }), Jt = yi.subscribe(async (i) => {
820
+ if (!(!I || r.length <= 1)) {
821
+ if (Ke(), !Y()) {
822
+ const b = (r.findIndex((T) => T.deviceId === g) + 1) % r.length, O = r[b].deviceId;
823
+ await Se(O);
824
+ return;
825
+ }
826
+ i ? (m(me, u = xe.FRONT_CAMERA, u), await q()) : (m(me, u = xe.REAR_CAMERA, u), await q());
827
+ }
828
+ }), Kt = Ai.subscribe(async (i) => {
829
+ !i.isSupported || !Y() || d != "DOCUMENT" || (je = i.orientation.includes("portrait"), je ? M && !c ? await q() : m(G, l = Z.OK, l) : m(G, l = Z.CAMERA_ORIENTATION_PORTRAIT, l));
830
+ });
831
+ async function wt() {
832
+ let i;
833
+ try {
834
+ if (Oe >= sa) {
835
+ Oe = 0;
836
+ const p = await Ni(), b = await import("./face_api_0e3ce8c8_3.0.0-RC01.js");
837
+ let O;
838
+ if (O = b.detectSingleFace(M, p), i = await O.withFaceLandmarks(), R.getContext("2d")?.clearRect(0, 0, R.width, R.height), i != null) {
839
+ const T = Fi(R, M, !0);
840
+ Ti(R, M, T);
841
+ const H = Hi(i, T);
842
+ zi(H, R, ye, !0), m(fe, n = !0, n), Re = (/* @__PURE__ */ new Date()).getTime();
843
+ } else
844
+ Ft();
845
+ } else
846
+ Oe++;
847
+ } catch (p) {
848
+ console.warn(`FaceapiLoop: ${p}`);
849
+ } finally {
850
+ o && Me(M, wt);
851
+ }
852
+ }
853
+ Be.subscribe(async (i) => {
854
+ i && (ge(), m(Be, s = !1, s));
855
+ }), Oi(() => {
856
+ Ke(), Gt(), Bt(), Ut(), Qt(), Yt(), Xt(), clearInterval(ht), Vt(), Jt(), xt(), Kt(), ht = 0;
857
+ });
858
+ function qt(i) {
859
+ $e[i ? "unshift" : "push"](() => {
860
+ M = i, t(6, M);
861
+ });
862
+ }
863
+ const $t = () => {
864
+ t(6, M.width = I.videoWidth, M), t(6, M.height = I.videoHeight, M), t(7, R.width = I.videoWidth, R), t(7, R.height = I.videoHeight, R);
865
+ };
866
+ function ei(i) {
867
+ $e[i ? "unshift" : "push"](() => {
868
+ R = i, t(7, R);
869
+ });
870
+ }
871
+ const ti = () => Ee(), ii = () => ge();
872
+ function ai(i) {
873
+ $e[i ? "unshift" : "push"](() => {
874
+ Q = i, t(8, Q);
875
+ });
876
+ }
877
+ const si = () => Ee(), oi = () => ge(), ni = async () => {
878
+ await q();
879
+ };
880
+ return a.$$set = (i) => {
881
+ "enableMinutiae" in i && t(28, ye = i.enableMinutiae), "videoDimensions" in i && t(29, Ae = i.videoDimensions), "noTabs" in i && t(30, Ne = i.noTabs), "weightsPath" in i && t(31, Te = i.weightsPath), "showUnconformities" in i && t(0, rt = i.showUnconformities), "showConfigButton" in i && t(1, ct = i.showConfigButton), "showCameraButton" in i && t(2, ut = i.showCameraButton), "videoOverlay" in i && t(3, dt = i.videoOverlay), "videoOverlayTransparency" in i && t(4, gt = i.videoOverlayTransparency);
882
+ }, [
883
+ rt,
884
+ ct,
885
+ ut,
886
+ dt,
887
+ gt,
888
+ de,
889
+ M,
890
+ R,
891
+ Q,
892
+ oe,
893
+ l,
894
+ c,
895
+ I,
896
+ D,
897
+ N,
898
+ A,
899
+ j,
900
+ S,
901
+ _e,
902
+ re,
903
+ ot,
904
+ nt,
905
+ ce,
906
+ ze,
907
+ Ct,
908
+ Ee,
909
+ ge,
910
+ q,
911
+ ye,
912
+ Ae,
913
+ Ne,
914
+ Te,
915
+ qt,
916
+ $t,
917
+ ei,
918
+ ti,
919
+ ii,
920
+ ai,
921
+ si,
922
+ oi,
923
+ ni
924
+ ];
925
+ }
926
+ class la extends Rt {
927
+ constructor(e) {
928
+ super(), kt(
929
+ this,
930
+ {
931
+ target: this.shadowRoot,
932
+ props: St(this.attributes),
933
+ customElement: !0
934
+ },
935
+ na,
936
+ ia,
937
+ Et,
938
+ {
939
+ enableMinutiae: 28,
940
+ videoDimensions: 29,
941
+ noTabs: 30,
942
+ weightsPath: 31,
943
+ showUnconformities: 0,
944
+ showConfigButton: 1,
945
+ showCameraButton: 2,
946
+ videoOverlay: 3,
947
+ videoOverlayTransparency: 4,
948
+ play: 5
949
+ },
950
+ null,
951
+ [-1, -1, -1]
952
+ ), e && (e.target && k(e.target, this, e.anchor), e.props && (this.$set(e.props), U()));
953
+ }
954
+ static get observedAttributes() {
955
+ return [
956
+ "enableMinutiae",
957
+ "videoDimensions",
958
+ "noTabs",
959
+ "weightsPath",
960
+ "showUnconformities",
961
+ "showConfigButton",
962
+ "showCameraButton",
963
+ "videoOverlay",
964
+ "videoOverlayTransparency",
965
+ "play"
966
+ ];
967
+ }
968
+ get enableMinutiae() {
969
+ return this.$$.ctx[28];
970
+ }
971
+ set enableMinutiae(e) {
972
+ this.$$set({ enableMinutiae: e }), U();
973
+ }
974
+ get videoDimensions() {
975
+ return this.$$.ctx[29];
976
+ }
977
+ set videoDimensions(e) {
978
+ this.$$set({ videoDimensions: e }), U();
979
+ }
980
+ get noTabs() {
981
+ return this.$$.ctx[30];
982
+ }
983
+ set noTabs(e) {
984
+ this.$$set({ noTabs: e }), U();
985
+ }
986
+ get weightsPath() {
987
+ return this.$$.ctx[31];
988
+ }
989
+ set weightsPath(e) {
990
+ this.$$set({ weightsPath: e }), U();
991
+ }
992
+ get showUnconformities() {
993
+ return this.$$.ctx[0];
994
+ }
995
+ set showUnconformities(e) {
996
+ this.$$set({ showUnconformities: e }), U();
997
+ }
998
+ get showConfigButton() {
999
+ return this.$$.ctx[1];
1000
+ }
1001
+ set showConfigButton(e) {
1002
+ this.$$set({ showConfigButton: e }), U();
1003
+ }
1004
+ get showCameraButton() {
1005
+ return this.$$.ctx[2];
1006
+ }
1007
+ set showCameraButton(e) {
1008
+ this.$$set({ showCameraButton: e }), U();
1009
+ }
1010
+ get videoOverlay() {
1011
+ return this.$$.ctx[3];
1012
+ }
1013
+ set videoOverlay(e) {
1014
+ this.$$set({ videoOverlay: e }), U();
1015
+ }
1016
+ get videoOverlayTransparency() {
1017
+ return this.$$.ctx[4];
1018
+ }
1019
+ set videoOverlayTransparency(e) {
1020
+ this.$$set({ videoOverlayTransparency: e }), U();
1021
+ }
1022
+ get play() {
1023
+ return this.$$.ctx[5];
1024
+ }
1025
+ }
1026
+ customElements.define("document-collector", la);
1027
+ export {
1028
+ la as default
1029
+ };