@jumio/websdk 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/{ar-r_DoysMW.js → ar-CtlHDG6H.js} +182 -167
  2. package/assets/da_object-Dmvt-Ksj.js +2 -0
  3. package/assets/da_system_worker-ZGTOZ8Bz.js +2 -0
  4. package/assets_da_1_2_1.tar-CezVOOjH.js +5 -0
  5. package/{bg-K3UMs6MV.js → bg-DgLE8mHQ.js} +206 -191
  6. package/{cs-oGImcAou.js → cs-BFf8GyOj.js} +222 -207
  7. package/{da-uc4Vru3M.js → da-BZwpDyTS.js} +190 -175
  8. package/dac-Cmfpw_6X.js +5 -0
  9. package/dac-CokYN9l5.js +5 -0
  10. package/dac_simd-DMVKk3l2.js +5 -0
  11. package/dac_simd-q7MAa__h.js +5 -0
  12. package/{de-cQD0d0A0.js → de-Cp5StGSa.js} +198 -183
  13. package/{el-leBfjUfs.js → el-C31SDAuU.js} +218 -203
  14. package/{en-0qDOCvQn.js → en-CK01mW1I.js} +202 -197
  15. package/{en_GB-n6QtnSZN.js → en_GB-Ddnyfnh0.js} +190 -175
  16. package/{es-aNYmSPki.js → es-CIbLurgW.js} +174 -159
  17. package/{es_MX-r36U_Jqq.js → es_MX-DHViNP6r.js} +207 -192
  18. package/{et-9fpmHCkv.js → et-r0kxHYS9.js} +178 -163
  19. package/{fi-fT9A2Vh5.js → fi-EQlNU5JN.js} +206 -191
  20. package/{fr-OKZdZJEt.js → fr-BdB-W--5.js} +174 -159
  21. package/{he-uO8_5V1g.js → he-Bl65eqJg.js} +226 -211
  22. package/{hr-KcV9q2Xx.js → hr-BOfLORrg.js} +200 -184
  23. package/{hu-iM2u6OaD.js → hu-CqEA9OsM.js} +207 -192
  24. package/{hy-zybQB3Tm.js → hy-DaGftduw.js} +202 -187
  25. package/{id-xHr32v_R.js → id-Buhh4_Zv.js} +202 -187
  26. package/index-DI9KBv9w.js +473 -0
  27. package/index-DeJpOTt6.js +55542 -0
  28. package/index.js +463 -391
  29. package/{it-zm7gbFz3.js → it-BK8Kg3Te.js} +316 -301
  30. package/{ja-Bd_CADVD.js → ja-WKpVlqKm.js} +198 -183
  31. package/{ka_GE-_y6zr4EZ.js → ka_GE-C2jHkOAf.js} +214 -199
  32. package/{km_KH-mwP5WeAa.js → km_KH-CNKg7Bvz.js} +205 -190
  33. package/{ko--JSSGq__.js → ko-CI_J_hnP.js} +182 -167
  34. package/loader-KgYPyFqZ.js +5 -0
  35. package/{lt-_UnGIkKt.js → lt-CuqSGDeq.js} +214 -199
  36. package/{ms-78aI09ta.js → ms-CkQgACN0.js} +186 -171
  37. package/{nl-4esHvruC.js → nl-Cjydgynt.js} +210 -195
  38. package/{no-oP5LAaE-.js → no-CzEYNMWN.js} +186 -171
  39. package/package.json +9 -3
  40. package/{pl-5JCiR8ab.js → pl-D5NELjcl.js} +162 -147
  41. package/{pt-TifT68ls.js → pt-BQZaUkOU.js} +172 -157
  42. package/{pt_BR-WPIjpqul.js → pt_BR-Dz1vn-WW.js} +186 -171
  43. package/{ro-Gg-G4ybY.js → ro-Bm1RZXj1.js} +163 -148
  44. package/{ru-c7W5B2L3.js → ru-C9iAlLhp.js} +186 -171
  45. package/{sk-W0z_fs8T.js → sk-OxLa6r-C.js} +190 -175
  46. package/{sr_Cyrl-IOWbdVLW.js → sr_Cyrl-DHLIlqNO.js} +189 -174
  47. package/{sr_Latn-TIZaWQxn.js → sr_Latn-8YMYL3VJ.js} +178 -163
  48. package/{sv-bud0Rfop.js → sv-CTm5IoAf.js} +190 -175
  49. package/{sw-bNz6x2em.js → sw-DsbacNrb.js} +190 -175
  50. package/{th-_DeBSBsT.js → th-s-407GzV.js} +197 -182
  51. package/third-party-licenses.txt +374 -186
  52. package/{tr-fCyFs10x.js → tr-BanPf3wI.js} +182 -167
  53. package/{uk-L1MBDENH.js → uk-BjyNRFjy.js} +195 -180
  54. package/{vi-UJfY1Plg.js → vi-BBJz_MBx.js} +194 -179
  55. package/{zh_CN-h9kBmIpr.js → zh_CN-BAdtWMfY.js} +198 -183
  56. package/{zh_HK-d3DRFqpo.js → zh_HK-DQKjipbu.js} +218 -203
  57. package/assets/da_object-En8q-z2F.js +0 -2
  58. package/assets/da_system_worker-x3TQoc4z.js +0 -2
  59. package/dac-PjLlwi1Y.js +0 -5
  60. package/dac-vj2mao-O.js +0 -5
  61. package/dac_simd-PjLlwi1Y.js +0 -5
  62. package/dac_simd-pr5isM2g.js +0 -5
  63. package/index-0Sg4F775.js +0 -1133
  64. package/index-CJaKL1b3.js +0 -42309
@@ -0,0 +1,473 @@
1
+ var re = (t, e, a) => {
2
+ if (!e.has(t))
3
+ throw TypeError("Cannot " + a);
4
+ };
5
+ var r = (t, e, a) => (re(t, e, "read from private field"), a ? a.call(t) : e.get(t)), u = (t, e, a) => {
6
+ if (e.has(t))
7
+ throw TypeError("Cannot add the same private member more than once");
8
+ e instanceof WeakSet ? e.add(t) : e.set(t, a);
9
+ }, F = (t, e, a, i) => (re(t, e, "write to private field"), i ? i.call(t, a) : e.set(t, a), a);
10
+ var l = (t, e, a) => (re(t, e, "access private method"), a);
11
+ import { S as Ue, A as C, s as oe, c as He, F as o, a as A, g as w, l as J, h as Ke, b as p, d as W, e as B, t as Qe, f as ye, i as ie, j as Xe, k as ne, m as _e, n as S, o as Ye, p as Ze, q as et, r as tt, C as at, u as st, v as rt, w as it, x as nt, y as ot, z as ct, B as ut, D as dt, E as se, G as ke, H as ce, I as lt, J as ht, K as Ie, L as Re, M as pt, T as St, N as mt, O as vt } from "./index-DeJpOTt6.js";
12
+ import { P as Lt, Q as Mt, R as Nt, U as bt } from "./index-DeJpOTt6.js";
13
+ var n, b, y, P, _, D, G, Le, U, Me, H, Ne, K, be, E, ue, Q, Pe, x, de, X, De, Y, Ee, Z, xe, ee, $e, te, Ae, k, q, ae, We, $, le;
14
+ class gt {
15
+ constructor(e) {
16
+ u(this, G);
17
+ u(this, U);
18
+ u(this, H);
19
+ u(this, K);
20
+ /* prettier-ignore */
21
+ u(this, E);
22
+ u(this, Q);
23
+ u(this, x);
24
+ u(this, X);
25
+ u(this, Y);
26
+ u(this, Z);
27
+ u(this, ee);
28
+ u(this, te);
29
+ u(this, k);
30
+ u(this, ae);
31
+ u(this, $);
32
+ u(this, n, void 0);
33
+ u(this, b, new Ue());
34
+ u(this, y, void 0);
35
+ u(this, P, void 0);
36
+ u(this, _, void 0);
37
+ u(this, D, !0);
38
+ F(this, n, e), F(this, y, new C(
39
+ r(this, n),
40
+ r(this, n).livenessService.smoothedFeedback$
41
+ )), F(this, P, new C(
42
+ r(this, n),
43
+ r(this, n).livenessService.holdStillThreshold$
44
+ )), F(this, _, new C(r(this, n), oe())), oe().pipe(
45
+ He(async (a) => {
46
+ var i, s, c, d, m, R;
47
+ switch (a) {
48
+ case o.JumioStandardCaptureScreenLiveness:
49
+ if (!Ke(r(this, n).livenessService.getLivenessSettings()))
50
+ return (i = r(this, n).stateManager) == null ? void 0 : i.dispatch(p.JumioStandardCaptureScreenCaptureInitial);
51
+ if (r(this, D)) {
52
+ if (!W(r(this, n).livenessService.getLivenessSettings()))
53
+ return (s = r(this, n).stateManager) == null ? void 0 : s.dispatch(p.JumioStandardCaptureScreenCaptureNear);
54
+ if (!B(r(this, n).livenessService.getLivenessSettings()))
55
+ return (c = r(this, n).stateManager) == null ? void 0 : c.dispatch(p.JumioStandardCaptureScreenCaptureFar);
56
+ } else {
57
+ if (!B(r(this, n).livenessService.getLivenessSettings()))
58
+ return (d = r(this, n).stateManager) == null ? void 0 : d.dispatch(p.JumioStandardCaptureScreenCaptureFar);
59
+ if (!W(r(this, n).livenessService.getLivenessSettings()))
60
+ return (m = r(this, n).stateManager) == null ? void 0 : m.dispatch(p.JumioStandardCaptureScreenCaptureNear);
61
+ }
62
+ return (R = r(this, n).stateManager) == null ? void 0 : R.dispatch(p.JumioStandardCaptureScreenCaptureComplete);
63
+ case o.JumioStandardCaptureScreenCaptureNear:
64
+ A(
65
+ w(o.JumioStandardCaptureScreenCaptureNear, J)
66
+ );
67
+ break;
68
+ case o.JumioStandardCaptureScreenCaptureFar:
69
+ A(
70
+ w(o.JumioStandardCaptureScreenCaptureFar, J)
71
+ );
72
+ break;
73
+ case o.JumioStandardCaptureScreenCaptureTransitionNearToFar:
74
+ A(
75
+ w(o.JumioStandardCaptureScreenCaptureFar, J)
76
+ );
77
+ break;
78
+ case o.JumioStandardCaptureScreenCaptureTransitionFarToNear:
79
+ A(
80
+ w(o.JumioStandardCaptureScreenCaptureNear, J)
81
+ );
82
+ break;
83
+ case o.JumioStandardCaptureScreenCaptureComplete:
84
+ return l(this, Q, Pe).call(this);
85
+ }
86
+ }),
87
+ Qe(r(this, b))
88
+ ).subscribe(), r(this, n).addController(this);
89
+ }
90
+ hostDisconnected() {
91
+ r(this, b).next();
92
+ }
93
+ isScanning() {
94
+ var e;
95
+ return ((e = r(this, y).value) == null ? void 0 : e.allChecksPassed) === !0;
96
+ }
97
+ async onFrameRendered() {
98
+ switch (r(this, _).value) {
99
+ case o.JumioStandardCaptureScreenCaptureInitial:
100
+ await l(this, U, Me).call(this);
101
+ break;
102
+ case o.JumioStandardCaptureScreenCaptureNear:
103
+ await l(this, H, Ne).call(this);
104
+ break;
105
+ case o.JumioStandardCaptureScreenCaptureFar:
106
+ await l(this, K, be).call(this);
107
+ break;
108
+ case o.JumioStandardCaptureScreenCaptureTransitionNearToFar:
109
+ await l(this, E, ue).call(this, {
110
+ from: o.JumioStandardCaptureScreenCaptureNear,
111
+ to: o.JumioStandardCaptureScreenCaptureFar
112
+ }, o.JumioStandardCaptureScreenCaptureTransitionNearToFar);
113
+ break;
114
+ case o.JumioStandardCaptureScreenCaptureTransitionFarToNear:
115
+ await l(this, E, ue).call(this, {
116
+ from: o.JumioStandardCaptureScreenCaptureFar,
117
+ to: o.JumioStandardCaptureScreenCaptureNear
118
+ }, o.JumioStandardCaptureScreenCaptureTransitionFarToNear);
119
+ break;
120
+ }
121
+ }
122
+ postImageMessage(e) {
123
+ r(this, n).livenessService.postMessage(e);
124
+ }
125
+ }
126
+ n = new WeakMap(), b = new WeakMap(), y = new WeakMap(), P = new WeakMap(), _ = new WeakMap(), D = new WeakMap(), G = new WeakSet(), Le = function() {
127
+ const e = ye(), a = ie();
128
+ let i = !0;
129
+ return e && a && 2 * a.faceEllipse.ry / e.height <= Xe && (i = !1), i;
130
+ }, U = new WeakSet(), Me = async function() {
131
+ var s, c;
132
+ const e = r(this, n).getVideoFrameId(), a = r(this, n).getRenderer(), i = await ((s = a == null ? void 0 : a.getImageData) == null ? void 0 : s.call(a));
133
+ if (i)
134
+ return ne({
135
+ step: o.JumioStandardCaptureScreenCaptureInitial,
136
+ videoFrameId: e,
137
+ time: /* @__PURE__ */ new Date(),
138
+ image: i,
139
+ bestSelfieShot: !1
140
+ }), l(this, k, q).call(this), F(this, D, l(this, G, Le).call(this)), (c = r(this, n).stateManager) == null ? void 0 : c.dispatch(p.JumioStandardCaptureScreenPoseDone);
141
+ }, H = new WeakSet(), Ne = async function() {
142
+ return l(this, x, de).call(this, {
143
+ step: o.JumioStandardCaptureScreenCaptureNear,
144
+ hasEnoughFrames: W,
145
+ stepDone: l(this, $, le).bind(this, o.JumioStandardCaptureScreenCaptureNear)
146
+ });
147
+ }, K = new WeakSet(), be = async function() {
148
+ return l(this, x, de).call(this, {
149
+ step: o.JumioStandardCaptureScreenCaptureFar,
150
+ hasEnoughFrames: B,
151
+ stepDone: l(this, $, le).bind(this, o.JumioStandardCaptureScreenCaptureFar)
152
+ });
153
+ }, E = new WeakSet(), ue = async function(e, a) {
154
+ var R, Fe, we;
155
+ const i = ye(), s = _e(i, w(o.JumioStandardCaptureScreenCaptureNear, J)), c = _e(i, w(o.JumioStandardCaptureScreenCaptureFar, J)), d = S(o.JumioStandardCaptureScreenCaptureTransitionNearToFar, o.JumioStandardCaptureScreenCaptureTransitionFarToNear), m = ((R = r(this, n).livenessService.getLivenessSettings()) == null ? void 0 : R.transitionImages) ?? 0;
156
+ if (s && c && m > 0) {
157
+ const Ge = Ye(2 * s.rxMin, 2 * c.rxMax, m);
158
+ if (Ze(r(this, n).livenessService.getLivenessSettings()))
159
+ return (Fe = r(this, n).stateManager) == null ? void 0 : Fe.dispatch(p.JumioStandardCaptureScreenPoseDone);
160
+ const Je = ie(), f = r(this, n).getRenderer();
161
+ if (Je && f && et({
162
+ faceWidth: Je.faceRoi.width,
163
+ index: d.length,
164
+ breakPoints: Ge,
165
+ transition: e
166
+ })) {
167
+ const Te = await ((we = f == null ? void 0 : f.getImageData) == null ? void 0 : we.call(f));
168
+ Te && (ne({
169
+ step: a,
170
+ videoFrameId: r(this, n).getVideoFrameId(),
171
+ time: /* @__PURE__ */ new Date(),
172
+ image: Te,
173
+ bestSelfieShot: !1
174
+ }), l(this, k, q).call(this));
175
+ }
176
+ }
177
+ }, Q = new WeakSet(), Pe = async function() {
178
+ var a, i;
179
+ const e = await Promise.all(
180
+ S().map(async (s) => ({
181
+ ...s,
182
+ image: await tt(s.image)
183
+ }))
184
+ );
185
+ (i = (a = r(this, n)).uploadFile) == null || i.call(a, {
186
+ uploadFilesMetadata: {
187
+ files: e.map(({ image: s, ...c }, d) => ({
188
+ multipartName: `${at.Facemap}_${st.JumioLiveness}_${d}`,
189
+ fileType: rt[s.type],
190
+ uploadType: `JUMIO_LIVENESS_${d}`,
191
+ usabilityExpected: !0,
192
+ fileMetaData: c,
193
+ file: s
194
+ }))
195
+ }
196
+ });
197
+ }, x = new WeakSet(), de = async function({ step: e, stepDone: a, hasEnoughFrames: i }) {
198
+ var c;
199
+ const s = ie();
200
+ if (i(r(this, n).livenessService.getLivenessSettings())) {
201
+ await a();
202
+ return;
203
+ }
204
+ if (s && this.isScanning()) {
205
+ l(this, te, Ae).call(this, s, e) || it(e);
206
+ const d = r(this, n).getRenderer();
207
+ if (d && l(this, Y, Ee).call(this, s)) {
208
+ const m = await ((c = d.getImageData) == null ? void 0 : c.call(d));
209
+ m && (ne({
210
+ step: e,
211
+ videoFrameId: r(this, n).getVideoFrameId(),
212
+ sequenceId: s.sequenceId,
213
+ time: /* @__PURE__ */ new Date(),
214
+ image: m,
215
+ pose: s,
216
+ bestSelfieShot: l(this, X, De).call(this, e)
217
+ }), l(this, k, q).call(this));
218
+ }
219
+ }
220
+ }, X = new WeakSet(), De = function(e) {
221
+ return e === o.JumioStandardCaptureScreenCaptureNear && S(e).length === 0;
222
+ }, Y = new WeakSet(), Ee = function(e) {
223
+ const a = r(this, y).value;
224
+ return a && a.fps >= nt ? l(this, ee, $e).call(this, e) : l(this, Z, xe).call(this, ot(), a);
225
+ }, Z = new WeakSet(), xe = function(e, a) {
226
+ return a ? (e == null ? void 0 : e.allChecksPassed) && a.successRate >= 0.5 : !1;
227
+ }, ee = new WeakSet(), $e = function(e) {
228
+ const a = r(this, P).value ?? Number.MIN_VALUE;
229
+ return ct(e.shift) && e.shift >= 0 && e.shift <= Math.max(a, 1);
230
+ }, te = new WeakSet(), Ae = function(e, a) {
231
+ return ut(e.sequenceId, a);
232
+ }, k = new WeakSet(), q = function() {
233
+ const e = S(), a = S(o.JumioStandardCaptureScreenCaptureTransitionNearToFar), i = S(o.JumioStandardCaptureScreenCaptureTransitionFarToNear), [s] = e, c = (s == null ? void 0 : s.time) ?? /* @__PURE__ */ new Date();
234
+ dt(r(this, n), {
235
+ metadata: {
236
+ step: r(this, _).value ?? "",
237
+ frames: S().map(({ image: d, ...m }) => m),
238
+ framesCaptured: S().length,
239
+ initialFrameCount: S(o.JumioStandardCaptureScreenCaptureInitial).length,
240
+ nearFrameCount: S(o.JumioStandardCaptureScreenCaptureNear).length,
241
+ farFrameCount: S(o.JumioStandardCaptureScreenCaptureFar).length,
242
+ nearToFarTransitionFrameCount: a.length,
243
+ farToNearTransitionFrameCount: i.length,
244
+ date: /* @__PURE__ */ new Date(),
245
+ time: Date.now(),
246
+ duration: Date.now() - c.getTime()
247
+ },
248
+ tags: {
249
+ jliveFramesCaptured: e.length,
250
+ jLiveFramesToBeCaptured: l(this, ae, We).call(this)
251
+ }
252
+ });
253
+ }, ae = new WeakSet(), We = function() {
254
+ const {
255
+ initialImages: e = 0,
256
+ nearImages: a = 0,
257
+ transitionImages: i = 0,
258
+ farImages: s = 0
259
+ } = r(this, n).livenessService.getLivenessSettings() ?? {};
260
+ return e + a + i + s;
261
+ }, $ = new WeakSet(), le = async function(e) {
262
+ var a, i, s;
263
+ switch (e) {
264
+ case o.JumioStandardCaptureScreenCaptureFar:
265
+ if (W(r(this, n).livenessService.getLivenessSettings()))
266
+ return (a = r(this, n).stateManager) == null ? void 0 : a.dispatch(p.JumioStandardCaptureScreenLiveness);
267
+ break;
268
+ case o.JumioStandardCaptureScreenCaptureNear:
269
+ if (B(r(this, n).livenessService.getLivenessSettings()))
270
+ return (i = r(this, n).stateManager) == null ? void 0 : i.dispatch(p.JumioStandardCaptureScreenLiveness);
271
+ break;
272
+ }
273
+ return (s = r(this, n).stateManager) == null ? void 0 : s.dispatch(p.JumioStandardCaptureScreenTransition);
274
+ };
275
+ const Ct = ":host{position:absolute;top:0;right:0;bottom:0;left:0}.webgl-renderer{display:none}.loading-indicator{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}";
276
+ var ft = Object.defineProperty, Ft = Object.getOwnPropertyDescriptor, wt = (t, e, a, i) => {
277
+ for (var s = i > 1 ? void 0 : i ? Ft(e, a) : e, c = t.length - 1, d; c >= 0; c--)
278
+ (d = t[c]) && (s = (i ? d(e, a, s) : d(s)) || s);
279
+ return i && s && ft(e, a, s), s;
280
+ }, Be = (t, e, a) => {
281
+ if (!e.has(t))
282
+ throw TypeError("Cannot " + a);
283
+ }, h = (t, e, a) => (Be(t, e, "read from private field"), a ? a.call(t) : e.get(t)), g = (t, e, a) => {
284
+ if (e.has(t))
285
+ throw TypeError("Cannot add the same private member more than once");
286
+ e instanceof WeakSet ? e.add(t) : e.set(t, a);
287
+ }, V = (t, e, a) => (Be(t, e, "access private method"), a), j, I, fe, v, he, Ve, pe, Oe, Se, qe, me, je;
288
+ let ve = class extends se {
289
+ constructor() {
290
+ super(...arguments), g(this, he), g(this, pe), g(this, Se), g(this, me), this.livenessService = ke(), g(this, j, new C(this, this.livenessService.videoResolution$)), g(this, I, new C(this, this.livenessService.pose$)), g(this, fe, new C(this, this.livenessService.faceFinder$)), g(this, v, Ie());
291
+ }
292
+ render() {
293
+ var t, e;
294
+ return ce`
295
+ <canvas
296
+ ${lt(h(this, v))}
297
+ class="canvas2d"
298
+ width="${((t = h(this, j).value) == null ? void 0 : t.width) ?? 0}"
299
+ height="${((e = h(this, j).value) == null ? void 0 : e.height) ?? 0}"
300
+ ></canvas>
301
+ `;
302
+ }
303
+ updated(t) {
304
+ super.updated(t), this.renderTick();
305
+ }
306
+ onStreamPause() {
307
+ }
308
+ async onVideoTick() {
309
+ this.renderTick();
310
+ }
311
+ renderTick() {
312
+ var a, i;
313
+ const t = (a = h(this, v).value) == null ? void 0 : a.getContext("2d");
314
+ t == null || t.save(), t == null || t.translate(((i = h(this, v).value) == null ? void 0 : i.width) ?? 0, 0), t == null || t.scale(-1, 1);
315
+ const e = h(this, I).value;
316
+ t && e && (V(this, Se, qe).call(this), V(this, he, Ve).call(this), V(this, pe, Oe).call(this), V(this, me, je).call(this)), t == null || t.restore();
317
+ }
318
+ };
319
+ j = /* @__PURE__ */ new WeakMap();
320
+ I = /* @__PURE__ */ new WeakMap();
321
+ fe = /* @__PURE__ */ new WeakMap();
322
+ v = /* @__PURE__ */ new WeakMap();
323
+ he = /* @__PURE__ */ new WeakSet();
324
+ Ve = function() {
325
+ var a;
326
+ const t = (a = h(this, v).value) == null ? void 0 : a.getContext("2d"), e = h(this, I).value;
327
+ t && e && (t.save(), t.strokeStyle = "green", t.strokeRect(e.faceRoi.x, e.faceRoi.y, e.faceRoi.width, e.faceRoi.height), t.restore());
328
+ };
329
+ pe = /* @__PURE__ */ new WeakSet();
330
+ Oe = function() {
331
+ var a;
332
+ const t = (a = h(this, v).value) == null ? void 0 : a.getContext("2d"), e = h(this, I).value;
333
+ t && e && (t.save(), t.beginPath(), t.strokeStyle = "red", t.ellipse(
334
+ e.faceEllipse.cx,
335
+ e.faceEllipse.cy,
336
+ e.faceEllipse.rx,
337
+ e.faceEllipse.ry,
338
+ 0,
339
+ 0,
340
+ 2 * Math.PI,
341
+ !1
342
+ ), t.closePath(), t.stroke(), t.restore());
343
+ };
344
+ Se = /* @__PURE__ */ new WeakSet();
345
+ qe = function() {
346
+ var a;
347
+ const t = (a = h(this, v).value) == null ? void 0 : a.getContext("2d"), e = h(this, fe).value;
348
+ t && e && (t.save(), t.beginPath(), t.strokeStyle = "blue", t.ellipse(e.cx, e.cy, e.rx, e.ry, 0, 0, 2 * Math.PI, !1), t.closePath(), t.stroke(), t.restore());
349
+ };
350
+ me = /* @__PURE__ */ new WeakSet();
351
+ je = function() {
352
+ var a;
353
+ const t = (a = h(this, v).value) == null ? void 0 : a.getContext("2d"), e = h(this, I).value;
354
+ t && e && (t.save(), t.beginPath(), t.fillStyle = "red", t.ellipse(e.faceEllipse.cx, e.faceEllipse.cy, 5, 5, 0, 0, 2 * Math.PI, !1), t.closePath(), t.fill(), t.restore());
355
+ };
356
+ ve.styles = [
357
+ ...se.styles,
358
+ ht`
359
+ :host {
360
+ pointer-events: none;
361
+ }
362
+
363
+ .canvas2d {
364
+ position: absolute;
365
+ top: 0;
366
+ right: 0;
367
+ bottom: 0;
368
+ left: 0;
369
+
370
+ width: 100%;
371
+ height: 100%;
372
+ object-fit: contain;
373
+ }
374
+ `
375
+ ];
376
+ ve = wt([
377
+ Re("jumio-sdk-liveness-debug")
378
+ ], ve);
379
+ var Jt = Object.defineProperty, Tt = Object.getOwnPropertyDescriptor, yt = (t, e, a, i) => {
380
+ for (var s = i > 1 ? void 0 : i ? Tt(e, a) : e, c = t.length - 1, d; c >= 0; c--)
381
+ (d = t[c]) && (s = (i ? d(e, a, s) : d(s)) || s);
382
+ return i && s && Jt(e, a, s), s;
383
+ }, ze = (t, e, a) => {
384
+ if (!e.has(t))
385
+ throw TypeError("Cannot " + a);
386
+ }, L = (t, e, a) => (ze(t, e, "read from private field"), a ? a.call(t) : e.get(t)), O = (t, e, a) => {
387
+ if (e.has(t))
388
+ throw TypeError("Cannot add the same private member more than once");
389
+ e instanceof WeakSet ? e.add(t) : e.set(t, a);
390
+ }, M = (t, e, a, i) => (ze(t, e, "write to private field"), e.set(t, a), a), ge, N, z, T;
391
+ let Ce = class extends se {
392
+ constructor() {
393
+ super(...arguments), this.stateManager = pt(), this.livenessService = ke(), this.cameraRef = Ie(), O(this, ge, new C(this, oe())), O(this, N, !0), O(this, z, void 0), O(this, T, 0), this.onFrameRendered = async () => {
394
+ var t, e;
395
+ if (M(this, T, L(this, T) + 1), L(this, N)) {
396
+ M(this, N, !1);
397
+ const a = await ((e = (t = this.getRenderer()) == null ? void 0 : t.getImageData) == null ? void 0 : e.call(t));
398
+ a && this.componentController.postImageMessage({
399
+ event: "image",
400
+ timestamp: Date.now().toString(),
401
+ image: a,
402
+ format: "rgba"
403
+ }), await this.componentController.onFrameRendered(), M(this, N, !0);
404
+ }
405
+ }, this.getImageData = async (...t) => {
406
+ var a;
407
+ const e = this.getRenderer();
408
+ return (a = e == null ? void 0 : e.getImageData) == null ? void 0 : a.call(e, ...t);
409
+ }, this.getBlob = async (...t) => {
410
+ var e, a;
411
+ return (a = (e = this.getRenderer()) == null ? void 0 : e.getBlob) == null ? void 0 : a.call(e, ...t);
412
+ }, this.captureImage = async (...t) => {
413
+ var e, a;
414
+ return (a = (e = this.getRenderer()) == null ? void 0 : e.captureImage) == null ? void 0 : a.call(e, ...t);
415
+ }, this.onStreamStart = async (...t) => {
416
+ var e, a;
417
+ return M(this, T, 0), (a = (e = this.getRenderer()) == null ? void 0 : e.onStreamStart) == null ? void 0 : a.call(e, ...t);
418
+ }, this.onStreamResize = async (...t) => {
419
+ var e, a;
420
+ return (a = (e = this.getRenderer()) == null ? void 0 : e.onStreamResize) == null ? void 0 : a.call(e, ...t);
421
+ }, this.onVideoTick = async (...t) => {
422
+ var a, i, s;
423
+ const e = await ((i = (a = this.getRenderer()) == null ? void 0 : a.onVideoTick) == null ? void 0 : i.call(a, ...t));
424
+ return (s = this.onFrameRendered) == null || s.call(this, ...t), e;
425
+ };
426
+ }
427
+ get componentController() {
428
+ return L(this, z) ?? M(this, z, new gt(this));
429
+ }
430
+ render() {
431
+ const t = L(this, ge).value === o.JumioStandardCaptureScreenLivenessLoading ? ce`<x-ds-prompt-loader data-state="pulsing" class="loading-indicator"></x-ds-prompt-loader>` : St;
432
+ return ce`
433
+ ${t}
434
+ <!--
435
+ <jumio-sdk-liveness-debug></jumio-sdk-liveness-debug>
436
+ -->
437
+ `;
438
+ }
439
+ getVideoFrameId() {
440
+ return L(this, T);
441
+ }
442
+ setRenderingAllowedState(t) {
443
+ var e, a;
444
+ return (a = (e = this.getRenderer()) == null ? void 0 : e.setRenderingAllowedState) == null ? void 0 : a.call(e, t);
445
+ }
446
+ getRenderingAllowedState() {
447
+ var t, e;
448
+ return ((e = (t = this.getRenderer()) == null ? void 0 : t.getRenderingAllowedState) == null ? void 0 : e.call(t)) ?? !0;
449
+ }
450
+ getRenderer() {
451
+ var t, e, a;
452
+ return (a = (e = (t = this.cameraRef) == null ? void 0 : t.value) == null ? void 0 : e.canvasRendererElRef) == null ? void 0 : a.value;
453
+ }
454
+ };
455
+ ge = /* @__PURE__ */ new WeakMap();
456
+ N = /* @__PURE__ */ new WeakMap();
457
+ z = /* @__PURE__ */ new WeakMap();
458
+ T = /* @__PURE__ */ new WeakMap();
459
+ Ce.styles = [...se.styles, mt(Ct)];
460
+ Ce = yt([
461
+ Re("jumio-sdk-liveness"),
462
+ vt()
463
+ ], Ce);
464
+ export {
465
+ Ce as JumioLivenessComponent,
466
+ Lt as JumioSdkLivenessCaptureStateComponent,
467
+ ve as JumioSdkLivenessDebugComponent,
468
+ Mt as JumioSdkLivenessProviderComponent,
469
+ Nt as JumioSdkLivenessService,
470
+ ke as getJumioSdkLivenessServiceInstance,
471
+ bt as resetJumioSdkLivenessServiceInstance
472
+ };
473
+ //# sourceMappingURL=index-DI9KBv9w.js.map