@tsocial/tvweb-sdk.nbcci 0.0.0-beta.20251211-162126 → 0.0.0-beta.20251215-165409
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.
- package/build/tvweb-sdk.nbcci.cjs.min.js +184 -182
- package/build/tvweb-sdk.nbcci.esm.min.js +184 -182
- package/build/tvweb-sdk.nbcci.standalone.js +814 -90
- package/build/tvweb-sdk.nbcci.standalone.min.js +184 -182
- package/build/types/index.d.ts +33 -4
- package/package.json +5 -6
|
@@ -19095,7 +19095,7 @@
|
|
|
19095
19095
|
t.decode = t.parse = w, t.encode = t.stringify = k;
|
|
19096
19096
|
}), A = (E.decode, E.parse, E.encode, E.stringify), B = function() {
|
|
19097
19097
|
function e(e) {
|
|
19098
|
-
this.authorizer = e.authorizer, this.domain = e.domain, this.onError = e.onError, this.configHeaders = e.headers, this.fallbackUrls = e.fallbackUrls;
|
|
19098
|
+
this.authorizer = e.authorizer, this.domain = e.domain, this.onError = e.onError, this.configHeaders = e.headers, this.fallbackUrls = e.fallbackUrls, this.requestTimeoutMs = e.requestTimeoutMs;
|
|
19099
19099
|
}
|
|
19100
19100
|
return e.prototype.get = function(e, t, r) {
|
|
19101
19101
|
var n = new URL(this.resolveUrl(e));
|
|
@@ -19155,13 +19155,24 @@
|
|
|
19155
19155
|
requestPath: e,
|
|
19156
19156
|
method: "GET"
|
|
19157
19157
|
}, "blob");
|
|
19158
|
+
}, e.prototype.setupTimeout = function() {
|
|
19159
|
+
if (!this.requestTimeoutMs || this.requestTimeoutMs <= 0) return {};
|
|
19160
|
+
var e = new AbortController, t = setTimeout(function() {
|
|
19161
|
+
e.abort();
|
|
19162
|
+
}, this.requestTimeoutMs);
|
|
19163
|
+
return {
|
|
19164
|
+
abortController: e,
|
|
19165
|
+
timeoutId: t
|
|
19166
|
+
};
|
|
19167
|
+
}, e.prototype.cleanupTimeout = function(e) {
|
|
19168
|
+
e && clearTimeout(e);
|
|
19158
19169
|
}, e.prototype.request = function(e, t, r) {
|
|
19159
19170
|
return void 0 === r && (r = "json"), s(this, void 0, void 0, function() {
|
|
19160
|
-
var n, a, o, s, l, u;
|
|
19171
|
+
var n, a, o, s, l, u, d, f, h;
|
|
19161
19172
|
return c(this, function(c) {
|
|
19162
19173
|
switch(c.label){
|
|
19163
19174
|
case 0:
|
|
19164
|
-
n = {}, a = {}, this.authorizer && (n = this.authorizer.getHeaders(t)), this.configHeaders && (a = this.configHeaders), t.headers = i(i(i({}, t.headers), n), a), c.label = 1;
|
|
19175
|
+
n = {}, a = {}, this.authorizer && (n = this.authorizer.getHeaders(t)), this.configHeaders && (a = this.configHeaders), t.headers = i(i(i({}, t.headers), n), a), s = (o = this.setupTimeout()).abortController, l = o.timeoutId, s && (t.signal = s.signal), c.label = 1;
|
|
19165
19176
|
case 1:
|
|
19166
19177
|
return c.trys.push([
|
|
19167
19178
|
1,
|
|
@@ -19173,22 +19184,22 @@
|
|
|
19173
19184
|
fetch(e, t)
|
|
19174
19185
|
];
|
|
19175
19186
|
case 2:
|
|
19176
|
-
return
|
|
19187
|
+
return u = c.sent(), this.cleanupTimeout(l), [
|
|
19177
19188
|
4,
|
|
19178
|
-
"blob" === r ?
|
|
19189
|
+
"blob" === r ? u.blob() : u.json()
|
|
19179
19190
|
];
|
|
19180
19191
|
case 3:
|
|
19181
|
-
if ((
|
|
19192
|
+
if ((d = c.sent()).errors && this.onError) throw this.onError(d.errors), d;
|
|
19182
19193
|
return [
|
|
19183
19194
|
2,
|
|
19184
|
-
|
|
19195
|
+
d
|
|
19185
19196
|
];
|
|
19186
19197
|
case 4:
|
|
19187
|
-
if (
|
|
19198
|
+
if (f = c.sent(), this.cleanupTimeout(l), this.shouldRetryWithFallback(f) && Array.isArray(this.fallbackUrls) && this.fallbackUrls.length > 0) return h = "GET" === t.method ? new URL(e).searchParams : null, [
|
|
19188
19199
|
2,
|
|
19189
|
-
this.retryWithFallback(t.requestPath, t,
|
|
19200
|
+
this.retryWithFallback(t.requestPath, t, h, r)
|
|
19190
19201
|
];
|
|
19191
|
-
throw
|
|
19202
|
+
throw f;
|
|
19192
19203
|
case 5:
|
|
19193
19204
|
return [
|
|
19194
19205
|
2
|
|
@@ -19204,41 +19215,41 @@
|
|
|
19204
19215
|
return "AbortError" === e.name ? (console.error("Request timed out"), !0) : e instanceof TypeError && (console.error("Network error occurred:", e.message), !0);
|
|
19205
19216
|
}, e.prototype.retryWithFallback = function(e, t, r, n) {
|
|
19206
19217
|
return void 0 === r && (r = null), void 0 === n && (n = "json"), s(this, void 0, void 0, function() {
|
|
19207
|
-
var
|
|
19218
|
+
var a, o, s, l, u, d, f, h, p, m;
|
|
19208
19219
|
return c(this, function(c) {
|
|
19209
19220
|
switch(c.label){
|
|
19210
19221
|
case 0:
|
|
19211
19222
|
if (!Array.isArray(this.fallbackUrls) || 0 === this.fallbackUrls.length) throw Error("No fallback URLs available");
|
|
19212
|
-
|
|
19223
|
+
a = null, o = 0, c.label = 1;
|
|
19213
19224
|
case 1:
|
|
19214
|
-
if (!(
|
|
19225
|
+
if (!(o < this.fallbackUrls.length)) return [
|
|
19215
19226
|
3,
|
|
19216
19227
|
7
|
|
19217
19228
|
];
|
|
19218
|
-
c.label = 2;
|
|
19229
|
+
l = (s = this.setupTimeout()).abortController, u = s.timeoutId, c.label = 2;
|
|
19219
19230
|
case 2:
|
|
19220
19231
|
return c.trys.push([
|
|
19221
19232
|
2,
|
|
19222
19233
|
5,
|
|
19223
19234
|
,
|
|
19224
19235
|
6
|
|
19225
|
-
]),
|
|
19236
|
+
]), d = new URL(this.resolveFallbackUrl(e, this.fallbackUrls[o])), r && "GET" === t.method && (d.search = r.toString()), f = i({}, t), l && (f.signal = l.signal), [
|
|
19226
19237
|
4,
|
|
19227
|
-
fetch(
|
|
19238
|
+
fetch(d.toString(), f)
|
|
19228
19239
|
];
|
|
19229
19240
|
case 3:
|
|
19230
|
-
return
|
|
19241
|
+
return h = c.sent(), this.cleanupTimeout(u), [
|
|
19231
19242
|
4,
|
|
19232
|
-
"blob" === n ?
|
|
19243
|
+
"blob" === n ? h.blob() : h.json()
|
|
19233
19244
|
];
|
|
19234
19245
|
case 4:
|
|
19235
|
-
if ((
|
|
19246
|
+
if ((p = c.sent()).errors && this.onError) throw this.onError(p.errors), p;
|
|
19236
19247
|
return [
|
|
19237
19248
|
2,
|
|
19238
|
-
|
|
19249
|
+
p
|
|
19239
19250
|
];
|
|
19240
19251
|
case 5:
|
|
19241
|
-
return
|
|
19252
|
+
return m = c.sent(), this.cleanupTimeout(u), a = m, this.shouldRetryWithFallback(m) ? [
|
|
19242
19253
|
3,
|
|
19243
19254
|
6
|
|
19244
19255
|
] : [
|
|
@@ -19246,12 +19257,12 @@
|
|
|
19246
19257
|
7
|
|
19247
19258
|
];
|
|
19248
19259
|
case 6:
|
|
19249
|
-
return
|
|
19260
|
+
return o++, [
|
|
19250
19261
|
3,
|
|
19251
19262
|
1
|
|
19252
19263
|
];
|
|
19253
19264
|
case 7:
|
|
19254
|
-
throw
|
|
19265
|
+
throw a;
|
|
19255
19266
|
}
|
|
19256
19267
|
});
|
|
19257
19268
|
});
|
|
@@ -19570,12 +19581,13 @@
|
|
|
19570
19581
|
}
|
|
19571
19582
|
function L(e, t, r, n) {
|
|
19572
19583
|
void 0 === r && (r = "production");
|
|
19573
|
-
var i = void 0 === n ? {} : n, a = i.headers, o = i.fallbackUrls;
|
|
19584
|
+
var i = void 0 === n ? {} : n, a = i.headers, o = i.fallbackUrls, s = i.requestTimeoutMs;
|
|
19574
19585
|
return new B({
|
|
19575
19586
|
authorizer: new M(e, t),
|
|
19576
19587
|
domain: N(r),
|
|
19577
19588
|
headers: a,
|
|
19578
|
-
fallbackUrls: o
|
|
19589
|
+
fallbackUrls: o,
|
|
19590
|
+
requestTimeoutMs: s
|
|
19579
19591
|
});
|
|
19580
19592
|
}
|
|
19581
19593
|
var D = function() {
|
|
@@ -30444,7 +30456,8 @@
|
|
|
30444
30456
|
}), this.transactionEnabled = i.supportTransaction || !1, this.encryptionEnabled = i.enableEncryption || !1;
|
|
30445
30457
|
var a = L(e, t, r, {
|
|
30446
30458
|
headers: i.httpHeaders,
|
|
30447
|
-
fallbackUrls: i.fallbackUrls
|
|
30459
|
+
fallbackUrls: i.fallbackUrls,
|
|
30460
|
+
requestTimeoutMs: i.requestTimeoutMs
|
|
30448
30461
|
});
|
|
30449
30462
|
this.transactionManager = new j(a), this.encryptionService = new rq(t), this.compareFaceService = new d(a), this.clientSettingsService = new f(a), this.convertPDFService = new b(a), this.ekycPDFService = new v(a), this.readIDCardService = new n(a), this.requestVerifyIDCardService = new p(a), this.requestVerifyPortraitSerivce = new m(a), this.imagesService = new l(a), this.fileService = new u(a), this.verifyFaceLivenessService = new h(a), this.searchFaceService = new y(a), this.detectIDTamperingService = new g(a), this.httpClient = a;
|
|
30450
30463
|
}
|
|
@@ -33770,7 +33783,7 @@
|
|
|
33770
33783
|
}, nS$1;
|
|
33771
33784
|
}();
|
|
33772
33785
|
function nB$1() {
|
|
33773
|
-
return "0.0.0-beta.
|
|
33786
|
+
return "0.0.0-beta.20251215-165409";
|
|
33774
33787
|
}
|
|
33775
33788
|
function nI$1() {
|
|
33776
33789
|
return {
|
|
@@ -41246,51 +41259,56 @@
|
|
|
41246
41259
|
}, uz;
|
|
41247
41260
|
}(), uG);
|
|
41248
41261
|
}();
|
|
41249
|
-
let dm = d_, dg = d_, dy =
|
|
41262
|
+
let dm = d_, dg = d_, dy = db();
|
|
41250
41263
|
for(;;)try {
|
|
41251
|
-
if (parseInt(dg(
|
|
41264
|
+
if (parseInt(dg(378)) / 1 + -parseInt(dg(391)) / 2 * (-parseInt(dg(386)) / 3) + parseInt(dg(380)) / 4 * (parseInt(dg(384)) / 5) + -parseInt(dg(381)) / 6 + -parseInt(dg(383)) / 7 * (-parseInt(dg(377)) / 8) + -parseInt(dg(379)) / 9 + -parseInt(dg(367)) / 10 * (-parseInt(dg(372)) / 11) === 229615) break;
|
|
41252
41265
|
dy.push(dy.shift());
|
|
41253
41266
|
} catch (e) {
|
|
41254
41267
|
dy.push(dy.shift());
|
|
41255
41268
|
}
|
|
41256
|
-
|
|
41257
|
-
function dv() {
|
|
41269
|
+
function db() {
|
|
41258
41270
|
let e = [
|
|
41259
|
-
"
|
|
41260
|
-
"
|
|
41271
|
+
"25310HBUOBg",
|
|
41272
|
+
"DepBO8t60S",
|
|
41273
|
+
"MFkwEwYHKo",
|
|
41261
41274
|
"3059301306",
|
|
41262
|
-
"KoZIzj0DAQ",
|
|
41263
|
-
"6gYYqrS",
|
|
41264
|
-
"7198670NThCRv",
|
|
41265
|
-
"KA==",
|
|
41266
|
-
"3402308atSQXs",
|
|
41267
|
-
"000",
|
|
41268
|
-
"44P0rKKsZK",
|
|
41269
41275
|
"+faHkP3QC3",
|
|
41270
|
-
"
|
|
41271
|
-
"
|
|
41272
|
-
"
|
|
41273
|
-
"
|
|
41274
|
-
"
|
|
41276
|
+
"407Ilvdnt",
|
|
41277
|
+
"44P0rKKsZK",
|
|
41278
|
+
"3d02010608",
|
|
41279
|
+
"ytJdcsPxrD",
|
|
41280
|
+
"D9EKOWS+U4",
|
|
41281
|
+
"14552FNqEza",
|
|
41282
|
+
"101165gbwSGf",
|
|
41283
|
+
"3599838cBdphG",
|
|
41284
|
+
"96444qpbkcR",
|
|
41285
|
+
"671448TAUmcs",
|
|
41275
41286
|
"072a8648ce",
|
|
41276
|
-
"
|
|
41277
|
-
"
|
|
41278
|
-
"
|
|
41287
|
+
"532kymtpA",
|
|
41288
|
+
"45uWuFYC",
|
|
41289
|
+
"MfPrcYTM70",
|
|
41290
|
+
"6ocbIJZ",
|
|
41291
|
+
"000",
|
|
41292
|
+
"0301070342",
|
|
41293
|
+
"KoZIzj0DAQ",
|
|
41294
|
+
"ZIzj0CAQYI",
|
|
41295
|
+
"191450lvsUWR",
|
|
41279
41296
|
"2a8648ce3d",
|
|
41280
|
-
"
|
|
41281
|
-
"
|
|
41297
|
+
"cDQgAE9h6Z",
|
|
41298
|
+
"KA=="
|
|
41282
41299
|
];
|
|
41283
|
-
return (
|
|
41300
|
+
return (db = function() {
|
|
41284
41301
|
return e;
|
|
41285
41302
|
})();
|
|
41286
41303
|
}
|
|
41304
|
+
let dv = dm(370) + dm(382) + dm(374) + dm(392) + dm(388) + dm(387);
|
|
41287
41305
|
function d_(e, t) {
|
|
41288
|
-
let r =
|
|
41306
|
+
let r = db();
|
|
41289
41307
|
return (d_ = function(e, t) {
|
|
41290
|
-
return r[e -=
|
|
41308
|
+
return r[e -= 366];
|
|
41291
41309
|
})(e, t);
|
|
41292
41310
|
}
|
|
41293
|
-
let dx = dm(
|
|
41311
|
+
let dx = dm(369) + dm(390) + dm(389) + dm(393) + dm(368) + dm(375) + dm(371) + dm(373) + "Mjci1ul8mm" + dm(376) + dm(385) + "ssRdXLZEX8" + dm(366);
|
|
41294
41312
|
async function dC(e) {
|
|
41295
41313
|
let t = new TextEncoder().encode(e);
|
|
41296
41314
|
return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256", t))).map((e)=>e.toString(16).padStart(2, "0")).join("");
|
|
@@ -41395,7 +41413,7 @@
|
|
|
41395
41413
|
isValid: !1,
|
|
41396
41414
|
error: i0$1.invalid_license
|
|
41397
41415
|
};
|
|
41398
|
-
let { mode: a, license: o, signature: s } = dS(e), c = dw(i4$1(o)), l = (r = t || dx, n = i4$1(r).replace(
|
|
41416
|
+
let { mode: a, license: o, signature: s } = dS(e), c = dw(i4$1(o)), l = (r = t || dx, n = i4$1(r).replace(dv, ""), i = new dp.ec("p256").keyFromPublic(n, "hex"), {
|
|
41399
41417
|
verifySignature: async (e, t)=>{
|
|
41400
41418
|
try {
|
|
41401
41419
|
let r = await dC(e), n = i4$1(t);
|
|
@@ -43357,7 +43375,8 @@
|
|
|
43357
43375
|
"x-request-id": e,
|
|
43358
43376
|
...r
|
|
43359
43377
|
},
|
|
43360
|
-
fallbackUrls: c
|
|
43378
|
+
fallbackUrls: c,
|
|
43379
|
+
requestTimeoutMs: 6e4
|
|
43361
43380
|
}), {
|
|
43362
43381
|
onDone: n
|
|
43363
43382
|
});
|
|
@@ -43386,7 +43405,8 @@
|
|
|
43386
43405
|
"x-request-id": l,
|
|
43387
43406
|
...r
|
|
43388
43407
|
},
|
|
43389
|
-
fallbackUrls: s
|
|
43408
|
+
fallbackUrls: s,
|
|
43409
|
+
requestTimeoutMs: 6e4
|
|
43390
43410
|
}), {
|
|
43391
43411
|
onDone: ()=>{}
|
|
43392
43412
|
});
|
|
@@ -90518,7 +90538,7 @@
|
|
|
90518
90538
|
}
|
|
90519
90539
|
};
|
|
90520
90540
|
|
|
90521
|
-
const videoSettings$
|
|
90541
|
+
const videoSettings$5 = libExports.isMobile ? {
|
|
90522
90542
|
// aspectRatio: 16 / 9,
|
|
90523
90543
|
width: {
|
|
90524
90544
|
ideal: 640
|
|
@@ -91297,7 +91317,7 @@
|
|
|
91297
91317
|
flipHorizontal: frontCamera,
|
|
91298
91318
|
ref: videoRef,
|
|
91299
91319
|
onError: onErrorCallback,
|
|
91300
|
-
videoSettings: videoSettings$
|
|
91320
|
+
videoSettings: videoSettings$5,
|
|
91301
91321
|
closeButton: /*#__PURE__*/ jsxRuntimeExports.jsx(CloseIcon, {}),
|
|
91302
91322
|
children: /*#__PURE__*/ jsxRuntimeExports.jsxs(WarmUpOverlay, {
|
|
91303
91323
|
overlay: !warmupDone || !isPlaying,
|
|
@@ -91859,11 +91879,11 @@
|
|
|
91859
91879
|
extraConfig: null
|
|
91860
91880
|
};
|
|
91861
91881
|
|
|
91862
|
-
const DirectionalIcon = dt$1.img`
|
|
91882
|
+
const DirectionalIcon$1 = dt$1.img`
|
|
91863
91883
|
width: ${({ width })=>width};
|
|
91864
91884
|
`;
|
|
91865
91885
|
// eslint-disable-next-line react/require-default-props
|
|
91866
|
-
function DirectionIcon({ type }) {
|
|
91886
|
+
function DirectionIcon$1({ type }) {
|
|
91867
91887
|
const theme = nt$2();
|
|
91868
91888
|
// default icons and widths based on version
|
|
91869
91889
|
const iconDirection = useThemeIcon(`Selfie.Active.directionIcon.${type}`, `${type}_arrow.gif`);
|
|
@@ -91880,7 +91900,7 @@
|
|
|
91880
91900
|
if (type === ra$1.FaceDirection.FRONTAL) {
|
|
91881
91901
|
// For frontal direction, use the SVG icon if available
|
|
91882
91902
|
if (frontalIcon) {
|
|
91883
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
|
|
91903
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon$1, {
|
|
91884
91904
|
src: frontalIcon,
|
|
91885
91905
|
width: iconWidth,
|
|
91886
91906
|
alt: ""
|
|
@@ -91888,20 +91908,20 @@
|
|
|
91888
91908
|
}
|
|
91889
91909
|
}
|
|
91890
91910
|
if (directionIconSrc && directionIconSrc !== null) {
|
|
91891
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
|
|
91911
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon$1, {
|
|
91892
91912
|
src: get(theme, `Selfie.Active.directionIcon.${type}`),
|
|
91893
91913
|
width: iconWidth,
|
|
91894
91914
|
alt: ""
|
|
91895
91915
|
});
|
|
91896
91916
|
}
|
|
91897
91917
|
// fallback to default icons and width
|
|
91898
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
|
|
91918
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon$1, {
|
|
91899
91919
|
src: iconDirection,
|
|
91900
91920
|
alt: "",
|
|
91901
91921
|
width: iconWidth
|
|
91902
91922
|
});
|
|
91903
91923
|
}
|
|
91904
|
-
DirectionIcon.propTypes = {
|
|
91924
|
+
DirectionIcon$1.propTypes = {
|
|
91905
91925
|
type: PropTypes.oneOf([
|
|
91906
91926
|
ra$1.FaceDirection.LEFT,
|
|
91907
91927
|
ra$1.FaceDirection.RIGHT,
|
|
@@ -91909,12 +91929,12 @@
|
|
|
91909
91929
|
ra$1.FaceDirection.FRONTAL
|
|
91910
91930
|
])
|
|
91911
91931
|
};
|
|
91912
|
-
DirectionIcon.defaultProps = {
|
|
91932
|
+
DirectionIcon$1.defaultProps = {
|
|
91913
91933
|
type: ra$1.FaceDirection.LEFT
|
|
91914
91934
|
};
|
|
91915
91935
|
|
|
91916
91936
|
// To reduce the calculation for blazeface
|
|
91917
|
-
const videoSettings$
|
|
91937
|
+
const videoSettings$4 = libExports.isMobile ? {
|
|
91918
91938
|
width: {
|
|
91919
91939
|
ideal: 640
|
|
91920
91940
|
}
|
|
@@ -92039,7 +92059,7 @@
|
|
|
92039
92059
|
onClose: onCloseCallback,
|
|
92040
92060
|
flipHorizontal: flipVideoHorizontal ?? frontCamera,
|
|
92041
92061
|
ref: refVideo,
|
|
92042
|
-
videoSettings: videoSettings$
|
|
92062
|
+
videoSettings: videoSettings$4,
|
|
92043
92063
|
onError: onErrorCallback,
|
|
92044
92064
|
scale: cameraScale,
|
|
92045
92065
|
defaultCameraId: defaultCameraId,
|
|
@@ -92150,16 +92170,16 @@
|
|
|
92150
92170
|
isLoading: false,
|
|
92151
92171
|
flipVideoHorizontal: null,
|
|
92152
92172
|
customDirectionIcon: {
|
|
92153
|
-
[ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
92173
|
+
[ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
92154
92174
|
type: ra$1.FaceDirection.LEFT
|
|
92155
92175
|
}),
|
|
92156
|
-
[ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
92176
|
+
[ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
92157
92177
|
type: ra$1.FaceDirection.RIGHT
|
|
92158
92178
|
}),
|
|
92159
|
-
[ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
92179
|
+
[ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
92160
92180
|
type: ra$1.FaceDirection.UP
|
|
92161
92181
|
}),
|
|
92162
|
-
[ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
92182
|
+
[ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
92163
92183
|
type: ra$1.FaceDirection.FRONTAL
|
|
92164
92184
|
})
|
|
92165
92185
|
},
|
|
@@ -92537,7 +92557,7 @@
|
|
|
92537
92557
|
});
|
|
92538
92558
|
}
|
|
92539
92559
|
|
|
92540
|
-
const videoSettings$
|
|
92560
|
+
const videoSettings$3 = libExports.isMobile ? {
|
|
92541
92561
|
// aspectRatio: 16 / 9,
|
|
92542
92562
|
width: {
|
|
92543
92563
|
ideal: 640
|
|
@@ -93070,7 +93090,7 @@
|
|
|
93070
93090
|
flipHorizontal: frontCamera,
|
|
93071
93091
|
ref: videoRef,
|
|
93072
93092
|
onError: onErrorCallback,
|
|
93073
|
-
videoSettings: videoSettings$
|
|
93093
|
+
videoSettings: videoSettings$3,
|
|
93074
93094
|
closeButton: /*#__PURE__*/ jsxRuntimeExports.jsx(CloseIcon, {}),
|
|
93075
93095
|
children: /*#__PURE__*/ jsxRuntimeExports.jsxs(WarmUpOverlay, {
|
|
93076
93096
|
overlay: !warmupDone || !isPlaying,
|
|
@@ -93412,13 +93432,13 @@
|
|
|
93412
93432
|
};
|
|
93413
93433
|
|
|
93414
93434
|
// To reduce the calculation for blazeface
|
|
93415
|
-
const videoSettings = libExports.isMobile ? {
|
|
93435
|
+
const videoSettings$2 = libExports.isMobile ? {
|
|
93416
93436
|
width: {
|
|
93417
93437
|
ideal: 640
|
|
93418
93438
|
}
|
|
93419
93439
|
} : null;
|
|
93420
93440
|
// eslint-disable-next-line react/prop-types, consistent-return
|
|
93421
|
-
const SelfieStepImageHolder = ({ stepNumber, type, theme })=>{
|
|
93441
|
+
const SelfieStepImageHolder$1 = ({ stepNumber, type, theme })=>{
|
|
93422
93442
|
const imageHolderIcon = useDefaultThemeIcon(`instruction_${type}.svg`);
|
|
93423
93443
|
// prioritize custom theme icons
|
|
93424
93444
|
const customHolderSrc = get(theme, `Selfie.Active.imageHolder.${type}`);
|
|
@@ -93443,7 +93463,7 @@
|
|
|
93443
93463
|
alt: ""
|
|
93444
93464
|
});
|
|
93445
93465
|
};
|
|
93446
|
-
function renderDirectionIcon(directionIcon, directionIconAnimation) {
|
|
93466
|
+
function renderDirectionIcon$1(directionIcon, directionIconAnimation) {
|
|
93447
93467
|
if (!directionIcon) return null;
|
|
93448
93468
|
if (typeof directionIcon === 'string') {
|
|
93449
93469
|
return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
@@ -93588,7 +93608,7 @@
|
|
|
93588
93608
|
onClose: onCloseCallback,
|
|
93589
93609
|
flipHorizontal: flipVideoHorizontal ?? frontCamera,
|
|
93590
93610
|
ref: refVideo,
|
|
93591
|
-
videoSettings: videoSettings,
|
|
93611
|
+
videoSettings: videoSettings$2,
|
|
93592
93612
|
onError: onErrorCallback,
|
|
93593
93613
|
scale: cameraScale,
|
|
93594
93614
|
defaultCameraId: defaultCameraId,
|
|
@@ -93613,7 +93633,7 @@
|
|
|
93613
93633
|
showErrorRing: !!faceDetectionError
|
|
93614
93634
|
}),
|
|
93615
93635
|
/*#__PURE__*/ jsxRuntimeExports.jsx(InstructionsOverlay, {
|
|
93616
|
-
children: renderDirectionIcon(directionIcon, directionIconAnimation)
|
|
93636
|
+
children: renderDirectionIcon$1(directionIcon, directionIconAnimation)
|
|
93617
93637
|
}),
|
|
93618
93638
|
activeCapturing && /*#__PURE__*/ jsxRuntimeExports.jsx(CapturingOverlay, {})
|
|
93619
93639
|
]
|
|
@@ -93636,7 +93656,7 @@
|
|
|
93636
93656
|
className: "image_preview",
|
|
93637
93657
|
src: objUrl,
|
|
93638
93658
|
alt: ""
|
|
93639
|
-
}) : /*#__PURE__*/ jsxRuntimeExports.jsx(SelfieStepImageHolder, {
|
|
93659
|
+
}) : /*#__PURE__*/ jsxRuntimeExports.jsx(SelfieStepImageHolder$1, {
|
|
93640
93660
|
stepNumber: index + 1,
|
|
93641
93661
|
type: name,
|
|
93642
93662
|
theme: theme
|
|
@@ -93727,16 +93747,16 @@
|
|
|
93727
93747
|
frontCamera: true,
|
|
93728
93748
|
isLoading: false,
|
|
93729
93749
|
customDirectionIcon: {
|
|
93730
|
-
[ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
93750
|
+
[ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
93731
93751
|
type: ra$1.FaceDirection.LEFT
|
|
93732
93752
|
}),
|
|
93733
|
-
[ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
93753
|
+
[ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
93734
93754
|
type: ra$1.FaceDirection.RIGHT
|
|
93735
93755
|
}),
|
|
93736
|
-
[ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
93756
|
+
[ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
93737
93757
|
type: ra$1.FaceDirection.UP
|
|
93738
93758
|
}),
|
|
93739
|
-
[ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
93759
|
+
[ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
93740
93760
|
type: ra$1.FaceDirection.FRONTAL
|
|
93741
93761
|
})
|
|
93742
93762
|
},
|
|
@@ -93864,6 +93884,706 @@
|
|
|
93864
93884
|
};
|
|
93865
93885
|
const useWrapIndicator = ()=>reactExports.useContext(WrapIndicatorContext);
|
|
93866
93886
|
|
|
93887
|
+
const DirectionalIcon = dt$1.img`
|
|
93888
|
+
width: ${({ width })=>width};
|
|
93889
|
+
`;
|
|
93890
|
+
// eslint-disable-next-line react/require-default-props
|
|
93891
|
+
function DirectionIcon({ type }) {
|
|
93892
|
+
const theme = nt$2();
|
|
93893
|
+
// default icons and widths based on version
|
|
93894
|
+
const iconDirection = useThemeIcon(`Selfie.Active.directionIcon.${type}`, `${type}_arrow.gif`);
|
|
93895
|
+
const iconWidth = getTheme(`Selfie.Active.directionIcon.${type}Width`)({
|
|
93896
|
+
theme
|
|
93897
|
+
});
|
|
93898
|
+
// prioritize custom theme icons
|
|
93899
|
+
const directionIconSrc = get(theme, `Selfie.Active.directionIcon.${type}`);
|
|
93900
|
+
if (directionIconSrc === null) {
|
|
93901
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
93902
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
|
93903
|
+
}
|
|
93904
|
+
if (directionIconSrc && directionIconSrc !== null) {
|
|
93905
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
|
|
93906
|
+
src: get(theme, `Selfie.Active.directionIcon.${type}`),
|
|
93907
|
+
width: iconWidth,
|
|
93908
|
+
alt: ""
|
|
93909
|
+
});
|
|
93910
|
+
}
|
|
93911
|
+
// fallback to default icons and width
|
|
93912
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
|
|
93913
|
+
src: iconDirection,
|
|
93914
|
+
alt: "",
|
|
93915
|
+
width: iconWidth
|
|
93916
|
+
});
|
|
93917
|
+
}
|
|
93918
|
+
DirectionIcon.propTypes = {
|
|
93919
|
+
type: PropTypes.oneOf([
|
|
93920
|
+
ra$1.FaceDirection.LEFT,
|
|
93921
|
+
ra$1.FaceDirection.RIGHT,
|
|
93922
|
+
ra$1.FaceDirection.UP,
|
|
93923
|
+
ra$1.FaceDirection.FRONTAL
|
|
93924
|
+
])
|
|
93925
|
+
};
|
|
93926
|
+
DirectionIcon.defaultProps = {
|
|
93927
|
+
type: ra$1.FaceDirection.LEFT
|
|
93928
|
+
};
|
|
93929
|
+
|
|
93930
|
+
// To reduce the calculation for blazeface
|
|
93931
|
+
const videoSettings$1 = libExports.isMobile ? {
|
|
93932
|
+
width: {
|
|
93933
|
+
ideal: 640
|
|
93934
|
+
}
|
|
93935
|
+
} : null;
|
|
93936
|
+
// eslint-disable-next-line react/prop-types, consistent-return
|
|
93937
|
+
const SelfieStepImageHolder = ({ stepNumber, type, theme })=>{
|
|
93938
|
+
const imageHolderIcon = useDefaultThemeIcon(`instruction_${type}.svg`);
|
|
93939
|
+
// prioritize custom theme icons
|
|
93940
|
+
const customHolderSrc = get(theme, `Selfie.Active.imageHolder.${type}`);
|
|
93941
|
+
if (customHolderSrc === null) {
|
|
93942
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
93943
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
|
93944
|
+
}
|
|
93945
|
+
if (typeof customHolderSrc === 'string' && customHolderSrc !== '') {
|
|
93946
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
93947
|
+
src: customHolderSrc,
|
|
93948
|
+
alt: ""
|
|
93949
|
+
});
|
|
93950
|
+
}
|
|
93951
|
+
// v1: use step number
|
|
93952
|
+
if (get(theme, 'themeVersion') === 'v1') {
|
|
93953
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx("span", {
|
|
93954
|
+
children: stepNumber
|
|
93955
|
+
});
|
|
93956
|
+
}
|
|
93957
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
93958
|
+
src: imageHolderIcon,
|
|
93959
|
+
alt: ""
|
|
93960
|
+
});
|
|
93961
|
+
};
|
|
93962
|
+
function renderDirectionIcon(directionIcon, directionIconAnimation) {
|
|
93963
|
+
if (!directionIcon) return null;
|
|
93964
|
+
if (typeof directionIcon === 'string') {
|
|
93965
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
93966
|
+
className: directionIconAnimation,
|
|
93967
|
+
src: directionIcon,
|
|
93968
|
+
alt: "",
|
|
93969
|
+
style: {
|
|
93970
|
+
maxWidth: '98px',
|
|
93971
|
+
maxHeight: '98px',
|
|
93972
|
+
marginBottom: '25px'
|
|
93973
|
+
}
|
|
93974
|
+
});
|
|
93975
|
+
}
|
|
93976
|
+
return directionIcon;
|
|
93977
|
+
}
|
|
93978
|
+
// eslint-disable-next-line react/require-default-props
|
|
93979
|
+
function ActiveLivenessV1(props) {
|
|
93980
|
+
const { apiCheck, onLivenessDetectionDone, captureFrameSettings, onFramesCaptured, frontCamera, flipVideoHorizontal, customDirectionIcon, customStepTimeConstraints, onProcessing, customErrors, apiCredentials, outputEncryptionSettings, cameraScale, defaultCameraId, offsetFaceY, styledComponent, isLoading, serviceSettings, onReset } = props;
|
|
93981
|
+
const theme = nt$2();
|
|
93982
|
+
const { onErrorCallback, onCloseCallback } = useSDKCallback();
|
|
93983
|
+
const bgCameraMask = iH.useAsset('bg_camera_mask.png');
|
|
93984
|
+
const bgCameraMaskRed = iH.useAsset('bg_camera_mask_red.png');
|
|
93985
|
+
const icLoading = useThemeIcon('IDCapturing.loadingIcon.src', 'ic_loading.gif');
|
|
93986
|
+
const [uiSpacing, setUISpacing] = reactExports.useState({});
|
|
93987
|
+
const { yFaceVerificationStepsWrapper, yFaceDetectionError } = uiSpacing;
|
|
93988
|
+
const [remainingTime, setRemainingTime] = reactExports.useState('');
|
|
93989
|
+
const [currentOrientation, setCurrentOrientation] = reactExports.useState();
|
|
93990
|
+
const surroundStyle = reactExports.useMemo(()=>({
|
|
93991
|
+
backgroundColor: getTheme('Selfie.backgroundColor')({
|
|
93992
|
+
theme
|
|
93993
|
+
})
|
|
93994
|
+
}), [
|
|
93995
|
+
theme
|
|
93996
|
+
]);
|
|
93997
|
+
// preload icons
|
|
93998
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'up_arrow.gif');
|
|
93999
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'left_arrow.gif');
|
|
94000
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'right_arrow.gif');
|
|
94001
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'frontal_arrow.gif');
|
|
94002
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_up.svg');
|
|
94003
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_left.svg');
|
|
94004
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_right.svg');
|
|
94005
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_frontal.svg');
|
|
94006
|
+
const cropAreaDimension = reactExports.useCallback(({ clientHeight, videoAreaWidth, videoAreaHeight, lostX, lostY })=>{
|
|
94007
|
+
let width;
|
|
94008
|
+
let height;
|
|
94009
|
+
if (libExports.isMobile) {
|
|
94010
|
+
width = videoAreaWidth;
|
|
94011
|
+
height = width;
|
|
94012
|
+
} else {
|
|
94013
|
+
height = videoAreaHeight - 200;
|
|
94014
|
+
width = height;
|
|
94015
|
+
}
|
|
94016
|
+
const x = Math.floor((videoAreaWidth - width) / 2) + lostX;
|
|
94017
|
+
let y = 5 + lostY;
|
|
94018
|
+
const yFaceDetectionErrorNew = lostY + 25;
|
|
94019
|
+
const yCropAreaNew = yFaceDetectionErrorNew + 30;
|
|
94020
|
+
const yFaceVerificationStepsWrapperNew = yCropAreaNew + height + 20;
|
|
94021
|
+
setUISpacing({
|
|
94022
|
+
yFaceDetectionError: yFaceDetectionErrorNew,
|
|
94023
|
+
yFaceVerificationStepsWrapper: yFaceVerificationStepsWrapperNew
|
|
94024
|
+
});
|
|
94025
|
+
const topLimit = Math.floor(lostY);
|
|
94026
|
+
const botLimit = Math.floor(clientHeight - lostY);
|
|
94027
|
+
y = Math.floor(yCropAreaNew); // floor the y value to avoid blur line on ios safari
|
|
94028
|
+
if (offsetFaceY !== 0 && (y + offsetFaceY < topLimit || y + offsetFaceY + height > botLimit)) {
|
|
94029
|
+
onErrorCallback({
|
|
94030
|
+
code: `offsetFaceY must be in [-${y - topLimit}, ${botLimit - height - y}]`
|
|
94031
|
+
});
|
|
94032
|
+
} else {
|
|
94033
|
+
y += offsetFaceY;
|
|
94034
|
+
}
|
|
94035
|
+
return {
|
|
94036
|
+
x,
|
|
94037
|
+
y,
|
|
94038
|
+
width,
|
|
94039
|
+
height
|
|
94040
|
+
};
|
|
94041
|
+
}, [
|
|
94042
|
+
offsetFaceY,
|
|
94043
|
+
onErrorCallback
|
|
94044
|
+
]);
|
|
94045
|
+
const { shouldResetFlowOnOrientationChange, cropArea, curStepIndex, directionIcon, directionIconAnimation, faceDetectionError, resetFlow, handleVideoPlayed, instructions, refVideo, refIsReseting, steps, videoPlayed, activeCapturing, warmupDone, showLoading } = useActiveLiveness({
|
|
94046
|
+
currentOrientation,
|
|
94047
|
+
apiCheck,
|
|
94048
|
+
bgCameraMask,
|
|
94049
|
+
bgCameraMaskRed,
|
|
94050
|
+
surroundStyle,
|
|
94051
|
+
onLivenessDetectionDone,
|
|
94052
|
+
onError: onErrorCallback,
|
|
94053
|
+
cropAreaDimension,
|
|
94054
|
+
customDirectionIcon,
|
|
94055
|
+
captureFrameSettings,
|
|
94056
|
+
onFramesCaptured,
|
|
94057
|
+
setRemainingTime,
|
|
94058
|
+
customStepTimeConstraints,
|
|
94059
|
+
onProcessing,
|
|
94060
|
+
customErrors,
|
|
94061
|
+
apiCredentials,
|
|
94062
|
+
outputEncryptionSettings,
|
|
94063
|
+
cameraScale,
|
|
94064
|
+
serviceSettings,
|
|
94065
|
+
onReset
|
|
94066
|
+
});
|
|
94067
|
+
reactExports.useEffect(()=>{
|
|
94068
|
+
if (typeof steps[0]?.directionIcon === 'string') {
|
|
94069
|
+
Promise.all(steps.map((step)=>preloadImage(step.directionIcon)));
|
|
94070
|
+
}
|
|
94071
|
+
}, [
|
|
94072
|
+
steps
|
|
94073
|
+
]);
|
|
94074
|
+
const { CloseCameraButton } = styledComponent;
|
|
94075
|
+
const progressCircleProps = getProgressCircleProps(props, theme);
|
|
94076
|
+
const currentProgress = !refIsReseting.current ? curStepIndex / steps.length * 100 : 0;
|
|
94077
|
+
// for error text
|
|
94078
|
+
const { lang } = no$1.useSDKSettings();
|
|
94079
|
+
const timer = reactExports.useRef(0);
|
|
94080
|
+
const lastError = reactExports.useRef({});
|
|
94081
|
+
const duration = reactExports.useRef(ra$1.ErrorDuration.SHORT);
|
|
94082
|
+
const lastErrorMsg = reactExports.useMemo(()=>{
|
|
94083
|
+
const { msg, duration: errorDuration = ra$1.ErrorDuration.SHORT } = faceDetectionError || {};
|
|
94084
|
+
const errorMsg = msg?.[lang];
|
|
94085
|
+
if (Date.now() - timer.current >= duration.current) {
|
|
94086
|
+
timer.current = Date.now();
|
|
94087
|
+
duration.current = errorDuration;
|
|
94088
|
+
lastError.current = errorMsg;
|
|
94089
|
+
}
|
|
94090
|
+
return lastError.current;
|
|
94091
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
94092
|
+
}, [
|
|
94093
|
+
faceDetectionError,
|
|
94094
|
+
curStepIndex
|
|
94095
|
+
]); // curStepIndex is used to get the latest error when reset flow
|
|
94096
|
+
const onOrientationChange = reactExports.useCallback((curOrientation)=>{
|
|
94097
|
+
setCurrentOrientation(curOrientation);
|
|
94098
|
+
if (!shouldResetFlowOnOrientationChange) {
|
|
94099
|
+
if (curOrientation === MODE.LANDSCAPE) {
|
|
94100
|
+
refVideo.current?.pause();
|
|
94101
|
+
} else {
|
|
94102
|
+
refVideo.current?.play();
|
|
94103
|
+
}
|
|
94104
|
+
} else {
|
|
94105
|
+
resetFlow();
|
|
94106
|
+
}
|
|
94107
|
+
}, [
|
|
94108
|
+
refVideo,
|
|
94109
|
+
resetFlow,
|
|
94110
|
+
shouldResetFlowOnOrientationChange
|
|
94111
|
+
]);
|
|
94112
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetection, {
|
|
94113
|
+
onOrientationChange: onOrientationChange,
|
|
94114
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsxs(Camera$1, {
|
|
94115
|
+
frontCamera: frontCamera,
|
|
94116
|
+
onVideoPlayed: handleVideoPlayed,
|
|
94117
|
+
onClose: onCloseCallback,
|
|
94118
|
+
flipHorizontal: flipVideoHorizontal ?? frontCamera,
|
|
94119
|
+
ref: refVideo,
|
|
94120
|
+
videoSettings: videoSettings$1,
|
|
94121
|
+
onError: onErrorCallback,
|
|
94122
|
+
scale: cameraScale,
|
|
94123
|
+
defaultCameraId: defaultCameraId,
|
|
94124
|
+
closeButton: CloseCameraButton || null,
|
|
94125
|
+
children: [
|
|
94126
|
+
!warmupDone && /*#__PURE__*/ jsxRuntimeExports.jsx(WarmupPopup, {}),
|
|
94127
|
+
videoPlayed ? /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
94128
|
+
children: [
|
|
94129
|
+
cropArea.current ? /*#__PURE__*/ jsxRuntimeExports.jsxs(CropAreaOverlayWrapper, {
|
|
94130
|
+
x: `${cropArea.current.x}px`,
|
|
94131
|
+
y: `${cropArea.current.y}px`,
|
|
94132
|
+
width: `${cropArea.current.width}px`,
|
|
94133
|
+
height: `${cropArea.current.height}px`,
|
|
94134
|
+
surroundStyle: cropArea.current.surroundStyle,
|
|
94135
|
+
children: [
|
|
94136
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(StyledCameraMark, {}),
|
|
94137
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(OverlayProgressCircle, {
|
|
94138
|
+
...progressCircleProps,
|
|
94139
|
+
progress: currentProgress,
|
|
94140
|
+
showErrorRing: !!faceDetectionError && getTheme('Selfie.progressCircle.showErrorRing')({
|
|
94141
|
+
theme
|
|
94142
|
+
})
|
|
94143
|
+
}),
|
|
94144
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(InstructionsOverlay, {
|
|
94145
|
+
children: renderDirectionIcon(directionIcon, directionIconAnimation)
|
|
94146
|
+
}),
|
|
94147
|
+
activeCapturing && /*#__PURE__*/ jsxRuntimeExports.jsx(CapturingOverlay, {})
|
|
94148
|
+
]
|
|
94149
|
+
}) : null,
|
|
94150
|
+
instructions ? /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
94151
|
+
children: [
|
|
94152
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(FaceVerificationInstructions, {
|
|
94153
|
+
top: yFaceVerificationStepsWrapper + 5,
|
|
94154
|
+
className: "instructions",
|
|
94155
|
+
children: instructions
|
|
94156
|
+
}),
|
|
94157
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(FaceVerificationStepsWrapper, {
|
|
94158
|
+
top: yFaceVerificationStepsWrapper + 35,
|
|
94159
|
+
children: steps.map((step, index)=>{
|
|
94160
|
+
const { name, image: { objUrl } } = step;
|
|
94161
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(StepItem, {
|
|
94162
|
+
active: curStepIndex >= index,
|
|
94163
|
+
className: "step-item",
|
|
94164
|
+
children: objUrl ? /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
94165
|
+
className: "image_preview",
|
|
94166
|
+
src: objUrl,
|
|
94167
|
+
alt: ""
|
|
94168
|
+
}) : /*#__PURE__*/ jsxRuntimeExports.jsx(SelfieStepImageHolder, {
|
|
94169
|
+
stepNumber: index + 1,
|
|
94170
|
+
type: name,
|
|
94171
|
+
theme: theme
|
|
94172
|
+
})
|
|
94173
|
+
}, name);
|
|
94174
|
+
})
|
|
94175
|
+
})
|
|
94176
|
+
]
|
|
94177
|
+
}) : null
|
|
94178
|
+
]
|
|
94179
|
+
}) : null,
|
|
94180
|
+
(showLoading || isLoading) && /*#__PURE__*/ jsxRuntimeExports.jsx(LoadingIcon$2, {
|
|
94181
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
94182
|
+
src: icLoading,
|
|
94183
|
+
alt: "",
|
|
94184
|
+
className: "spin"
|
|
94185
|
+
})
|
|
94186
|
+
}),
|
|
94187
|
+
remainingTime && /*#__PURE__*/ jsxRuntimeExports.jsx(CountdownTime, {
|
|
94188
|
+
top: yFaceVerificationStepsWrapper - 30,
|
|
94189
|
+
children: remainingTime
|
|
94190
|
+
}),
|
|
94191
|
+
typeof lastErrorMsg === 'string' ? /*#__PURE__*/ jsxRuntimeExports.jsx(SimpleFaceDetectionError, {
|
|
94192
|
+
top: yFaceDetectionError - 15,
|
|
94193
|
+
className: "face-detection-error",
|
|
94194
|
+
children: lastErrorMsg
|
|
94195
|
+
}) : null
|
|
94196
|
+
]
|
|
94197
|
+
})
|
|
94198
|
+
});
|
|
94199
|
+
}
|
|
94200
|
+
ActiveLivenessV1.propTypes = {
|
|
94201
|
+
apiCheck: PropTypes.bool,
|
|
94202
|
+
onLivenessDetectionDone: PropTypes.func,
|
|
94203
|
+
onClose: PropTypes.func,
|
|
94204
|
+
onError: PropTypes.func,
|
|
94205
|
+
onReset: PropTypes.func,
|
|
94206
|
+
captureFrameSettings: PropTypes.shape({}),
|
|
94207
|
+
onFramesCaptured: PropTypes.func,
|
|
94208
|
+
flipVideoHorizontal: PropTypes.bool,
|
|
94209
|
+
frontCamera: PropTypes.bool,
|
|
94210
|
+
isLoading: PropTypes.bool,
|
|
94211
|
+
customDirectionIcon: PropTypes.shape({}),
|
|
94212
|
+
customStepTimeConstraints: PropTypes.shape({}),
|
|
94213
|
+
onProcessing: PropTypes.func,
|
|
94214
|
+
customErrors: PropTypes.shape({}),
|
|
94215
|
+
apiCredentials: PropTypes.shape({
|
|
94216
|
+
accessKey: PropTypes.string,
|
|
94217
|
+
secretKey: PropTypes.string,
|
|
94218
|
+
apiUrl: PropTypes.string
|
|
94219
|
+
}),
|
|
94220
|
+
outputEncryptionSettings: PropTypes.shape({}),
|
|
94221
|
+
cameraScale: PropTypes.number,
|
|
94222
|
+
defaultCameraId: PropTypes.string,
|
|
94223
|
+
offsetFaceY: PropTypes.number,
|
|
94224
|
+
styledComponent: PropTypes.shape({
|
|
94225
|
+
CloseCameraButton: PropTypes.node
|
|
94226
|
+
}),
|
|
94227
|
+
serviceSettings: PropTypes.shape({})
|
|
94228
|
+
};
|
|
94229
|
+
ActiveLivenessV1.defaultProps = {
|
|
94230
|
+
apiCheck: false,
|
|
94231
|
+
onLivenessDetectionDone: null,
|
|
94232
|
+
onClose: null,
|
|
94233
|
+
onError: ()=>{},
|
|
94234
|
+
onReset: ()=>{},
|
|
94235
|
+
captureFrameSettings: {
|
|
94236
|
+
enable: false,
|
|
94237
|
+
framesIntervalTime: 180,
|
|
94238
|
+
framesBatchLength: 0
|
|
94239
|
+
},
|
|
94240
|
+
onFramesCaptured: ()=>{},
|
|
94241
|
+
flipVideoHorizontal: null,
|
|
94242
|
+
frontCamera: true,
|
|
94243
|
+
isLoading: false,
|
|
94244
|
+
customDirectionIcon: {
|
|
94245
|
+
[ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
94246
|
+
type: ra$1.FaceDirection.LEFT
|
|
94247
|
+
}),
|
|
94248
|
+
[ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
94249
|
+
type: ra$1.FaceDirection.RIGHT
|
|
94250
|
+
}),
|
|
94251
|
+
[ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
94252
|
+
type: ra$1.FaceDirection.UP
|
|
94253
|
+
}),
|
|
94254
|
+
[ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
94255
|
+
type: ra$1.FaceDirection.FRONTAL
|
|
94256
|
+
})
|
|
94257
|
+
},
|
|
94258
|
+
customStepTimeConstraints: {
|
|
94259
|
+
[ra$1.FaceDirection.UP]: {
|
|
94260
|
+
delayTime: 0
|
|
94261
|
+
},
|
|
94262
|
+
[ra$1.FaceDirection.LEFT]: {
|
|
94263
|
+
delayTime: 0
|
|
94264
|
+
},
|
|
94265
|
+
[ra$1.FaceDirection.RIGHT]: {
|
|
94266
|
+
delayTime: 0
|
|
94267
|
+
},
|
|
94268
|
+
[ra$1.FaceDirection.FRONTAL]: {
|
|
94269
|
+
delayTime: 2000
|
|
94270
|
+
}
|
|
94271
|
+
},
|
|
94272
|
+
onProcessing: ()=>{},
|
|
94273
|
+
customErrors: null,
|
|
94274
|
+
apiCredentials: {
|
|
94275
|
+
accessKey: '',
|
|
94276
|
+
secretKey: '',
|
|
94277
|
+
apiUrl: ''
|
|
94278
|
+
},
|
|
94279
|
+
outputEncryptionSettings: null,
|
|
94280
|
+
cameraScale: 1,
|
|
94281
|
+
defaultCameraId: undefined,
|
|
94282
|
+
offsetFaceY: 0,
|
|
94283
|
+
styledComponent: {
|
|
94284
|
+
CloseCameraButton: null
|
|
94285
|
+
},
|
|
94286
|
+
serviceSettings: {
|
|
94287
|
+
enableUploadFrames: true,
|
|
94288
|
+
enableUploadImages: true,
|
|
94289
|
+
enableVerifySanityPortrait: true,
|
|
94290
|
+
enableVerifySanityIDCard: true,
|
|
94291
|
+
enableVerifyFaceLiveness: true,
|
|
94292
|
+
enableDetectIDCardTampering: true,
|
|
94293
|
+
enableReadIDCardInfo: true
|
|
94294
|
+
}
|
|
94295
|
+
};
|
|
94296
|
+
|
|
94297
|
+
// To reduce the calculation for blazeface
|
|
94298
|
+
const videoSettings = libExports.isMobile ? {
|
|
94299
|
+
width: {
|
|
94300
|
+
ideal: 640
|
|
94301
|
+
}
|
|
94302
|
+
} : null;
|
|
94303
|
+
// eslint-disable-next-line react/require-default-props
|
|
94304
|
+
function PassiveLivenessOldV1(props) {
|
|
94305
|
+
const { apiCheck, onLivenessDetectionDone, captureFrameSettings, onFramesCaptured, frontCamera, flipVideoHorizontal, customDirectionIcon, customStepTimeConstraints, onProcessing, customErrors, apiCredentials, outputEncryptionSettings, cameraScale, defaultCameraId, passiveModeAuto, offsetFaceY, styledComponent, serviceSettings, onReset, isLoading } = props;
|
|
94306
|
+
const theme = nt$2();
|
|
94307
|
+
const { onErrorCallback, onCloseCallback } = useSDKCallback();
|
|
94308
|
+
const bgCameraMask = iH.useAsset('bg_camera_mask.png');
|
|
94309
|
+
const bgCameraMaskRed = iH.useAsset('bg_camera_mask_red.png');
|
|
94310
|
+
const icLoading = useThemeIcon('IDCapturing.loadingIcon.src', 'ic_loading.gif');
|
|
94311
|
+
const [uiSpacing, setUISpacing] = reactExports.useState({});
|
|
94312
|
+
const { yFaceDetectionError, yFaceVerificationStepsWrapper } = uiSpacing;
|
|
94313
|
+
const [remainingTime, setRemainingTime] = reactExports.useState('');
|
|
94314
|
+
const [currentOrientation, setCurrentOrientation] = reactExports.useState();
|
|
94315
|
+
const surroundStyle = reactExports.useMemo(()=>({
|
|
94316
|
+
backgroundColor: getTheme('Selfie.backgroundColor')({
|
|
94317
|
+
theme
|
|
94318
|
+
})
|
|
94319
|
+
}), [
|
|
94320
|
+
theme
|
|
94321
|
+
]);
|
|
94322
|
+
const cropAreaDimension = reactExports.useCallback(({ lostY, height, clientHeight })=>{
|
|
94323
|
+
const yFaceDetectionErrorNew = lostY + 25;
|
|
94324
|
+
const yCropAreaNew = yFaceDetectionErrorNew + 30;
|
|
94325
|
+
const yFaceVerificationStepsWrapperNew = yCropAreaNew + height + 20;
|
|
94326
|
+
setUISpacing({
|
|
94327
|
+
yFaceDetectionError: yFaceDetectionErrorNew,
|
|
94328
|
+
yFaceVerificationStepsWrapper: yFaceVerificationStepsWrapperNew
|
|
94329
|
+
});
|
|
94330
|
+
const topLimit = Math.floor(lostY);
|
|
94331
|
+
const botLimit = Math.floor(clientHeight - lostY);
|
|
94332
|
+
let y = Math.floor(yCropAreaNew); // floor the y value to avoid blur line on ios safari
|
|
94333
|
+
if (offsetFaceY !== 0 && (y + offsetFaceY < topLimit || y + offsetFaceY + height > botLimit)) {
|
|
94334
|
+
onErrorCallback({
|
|
94335
|
+
code: `offsetFaceY must be in [-${y - topLimit}, ${botLimit - height - y}]`
|
|
94336
|
+
});
|
|
94337
|
+
} else {
|
|
94338
|
+
y += offsetFaceY;
|
|
94339
|
+
}
|
|
94340
|
+
return {
|
|
94341
|
+
y
|
|
94342
|
+
};
|
|
94343
|
+
}, [
|
|
94344
|
+
offsetFaceY,
|
|
94345
|
+
onErrorCallback
|
|
94346
|
+
]);
|
|
94347
|
+
const { shouldResetFlowOnOrientationChange, countdownToTakePicture, cropArea, curStepIndex, faceDetectionError, resetFlow, handleTriggerPassiveMode, handleVideoPlayed, refVideo, showCountdown, steps, refIsReseting, videoPlayed, warmupDone, showCaptureButton, shouldShowCountdown, showLoading } = usePassiveLiveness({
|
|
94348
|
+
currentOrientation,
|
|
94349
|
+
apiCheck,
|
|
94350
|
+
bgCameraMask,
|
|
94351
|
+
bgCameraMaskRed,
|
|
94352
|
+
surroundStyle,
|
|
94353
|
+
onLivenessDetectionDone,
|
|
94354
|
+
onError: onErrorCallback,
|
|
94355
|
+
cropAreaDimension,
|
|
94356
|
+
customDirectionIcon,
|
|
94357
|
+
captureFrameSettings,
|
|
94358
|
+
onFramesCaptured,
|
|
94359
|
+
setRemainingTime,
|
|
94360
|
+
customStepTimeConstraints,
|
|
94361
|
+
onProcessing,
|
|
94362
|
+
customErrors,
|
|
94363
|
+
apiCredentials,
|
|
94364
|
+
outputEncryptionSettings,
|
|
94365
|
+
cameraScale,
|
|
94366
|
+
passiveModeAuto,
|
|
94367
|
+
serviceSettings,
|
|
94368
|
+
onReset
|
|
94369
|
+
});
|
|
94370
|
+
reactExports.useEffect(()=>{
|
|
94371
|
+
if (typeof steps[0]?.directionIcon === 'string') {
|
|
94372
|
+
Promise.all(steps.map((step)=>preloadImage(step.directionIcon)));
|
|
94373
|
+
}
|
|
94374
|
+
}, [
|
|
94375
|
+
steps
|
|
94376
|
+
]);
|
|
94377
|
+
const { CloseCameraButton } = styledComponent;
|
|
94378
|
+
const progressCircleProps = getProgressCircleProps(props, theme);
|
|
94379
|
+
const currentProgress = !refIsReseting.current ? curStepIndex / steps.length * 100 : 0;
|
|
94380
|
+
// for error text
|
|
94381
|
+
const { lang } = no$1.useSDKSettings();
|
|
94382
|
+
const timer = reactExports.useRef(0);
|
|
94383
|
+
const lastError = reactExports.useRef({});
|
|
94384
|
+
const duration = reactExports.useRef(ra$1.ErrorDuration.SHORT);
|
|
94385
|
+
const lastErrorMsg = reactExports.useMemo(()=>{
|
|
94386
|
+
const { msg, duration: errorDuration = ra$1.ErrorDuration.SHORT } = faceDetectionError || {};
|
|
94387
|
+
const errorMsg = msg?.[lang];
|
|
94388
|
+
if (Date.now() - timer.current >= duration.current) {
|
|
94389
|
+
timer.current = Date.now();
|
|
94390
|
+
duration.current = errorDuration;
|
|
94391
|
+
lastError.current = errorMsg;
|
|
94392
|
+
}
|
|
94393
|
+
return lastError.current;
|
|
94394
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
94395
|
+
}, [
|
|
94396
|
+
faceDetectionError,
|
|
94397
|
+
curStepIndex
|
|
94398
|
+
]); // curStepIndex is used to get the latest error when reset flow
|
|
94399
|
+
const onOrientationChange = reactExports.useCallback((curOrientation)=>{
|
|
94400
|
+
setCurrentOrientation(curOrientation);
|
|
94401
|
+
if (!shouldResetFlowOnOrientationChange) {
|
|
94402
|
+
if (curOrientation === MODE.LANDSCAPE) {
|
|
94403
|
+
refVideo.current?.pause();
|
|
94404
|
+
} else {
|
|
94405
|
+
refVideo.current?.play();
|
|
94406
|
+
}
|
|
94407
|
+
} else {
|
|
94408
|
+
resetFlow();
|
|
94409
|
+
}
|
|
94410
|
+
}, [
|
|
94411
|
+
refVideo,
|
|
94412
|
+
resetFlow,
|
|
94413
|
+
shouldResetFlowOnOrientationChange
|
|
94414
|
+
]);
|
|
94415
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetection, {
|
|
94416
|
+
onOrientationChange: onOrientationChange,
|
|
94417
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsxs(Camera$1, {
|
|
94418
|
+
frontCamera: frontCamera,
|
|
94419
|
+
onVideoPlayed: handleVideoPlayed,
|
|
94420
|
+
onClose: onCloseCallback,
|
|
94421
|
+
flipHorizontal: flipVideoHorizontal ?? frontCamera,
|
|
94422
|
+
ref: refVideo,
|
|
94423
|
+
videoSettings: videoSettings,
|
|
94424
|
+
onError: onErrorCallback,
|
|
94425
|
+
scale: cameraScale,
|
|
94426
|
+
defaultCameraId: defaultCameraId,
|
|
94427
|
+
closeButton: CloseCameraButton || null,
|
|
94428
|
+
children: [
|
|
94429
|
+
!warmupDone && /*#__PURE__*/ jsxRuntimeExports.jsx(WarmupPopup, {}),
|
|
94430
|
+
videoPlayed ? /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
94431
|
+
children: [
|
|
94432
|
+
typeof lastErrorMsg === 'string' ? /*#__PURE__*/ jsxRuntimeExports.jsx(SimpleFaceDetectionError, {
|
|
94433
|
+
top: yFaceDetectionError - 15,
|
|
94434
|
+
className: "face-detection-error",
|
|
94435
|
+
children: lastErrorMsg
|
|
94436
|
+
}) : null,
|
|
94437
|
+
cropArea.current ? /*#__PURE__*/ jsxRuntimeExports.jsxs(CropAreaOverlayWrapper, {
|
|
94438
|
+
x: `${cropArea.current.x}px`,
|
|
94439
|
+
y: `${cropArea.current.y}px`,
|
|
94440
|
+
width: `${cropArea.current.width}px`,
|
|
94441
|
+
height: `${cropArea.current.height}px`,
|
|
94442
|
+
surroundStyle: cropArea.current.surroundStyle,
|
|
94443
|
+
children: [
|
|
94444
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(StyledCameraMark, {}),
|
|
94445
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(OverlayProgressCircle, {
|
|
94446
|
+
...progressCircleProps,
|
|
94447
|
+
progress: currentProgress,
|
|
94448
|
+
showErrorRing: !!faceDetectionError && getTheme('Selfie.progressCircle.showErrorRing')({
|
|
94449
|
+
theme
|
|
94450
|
+
})
|
|
94451
|
+
}),
|
|
94452
|
+
shouldShowCountdown ? /*#__PURE__*/ jsxRuntimeExports.jsx(CountDownOverlay, {
|
|
94453
|
+
children: countdownToTakePicture
|
|
94454
|
+
}) : null,
|
|
94455
|
+
faceDetectionError && /*#__PURE__*/ jsxRuntimeExports.jsx(ErrorOverlay$1, {})
|
|
94456
|
+
]
|
|
94457
|
+
}) : null,
|
|
94458
|
+
remainingTime && /*#__PURE__*/ jsxRuntimeExports.jsx(CountdownTime, {
|
|
94459
|
+
top: yFaceVerificationStepsWrapper - 30,
|
|
94460
|
+
children: remainingTime
|
|
94461
|
+
}),
|
|
94462
|
+
showCaptureButton ? /*#__PURE__*/ jsxRuntimeExports.jsx(BottomButtonsOverlay, {
|
|
94463
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(Button$4, {
|
|
94464
|
+
onClick: handleTriggerPassiveMode,
|
|
94465
|
+
disabled: showCountdown,
|
|
94466
|
+
children: get(theme, 'Selfie.captureIcon.src') ? /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
94467
|
+
src: get(theme, 'Selfie.captureIcon.src'),
|
|
94468
|
+
alt: ""
|
|
94469
|
+
}) : /*#__PURE__*/ jsxRuntimeExports.jsx(CameraIcon, {
|
|
94470
|
+
fillColor: "rgba(193, 197, 204, 1)"
|
|
94471
|
+
})
|
|
94472
|
+
})
|
|
94473
|
+
}) : null
|
|
94474
|
+
]
|
|
94475
|
+
}) : null,
|
|
94476
|
+
(showLoading || isLoading) && /*#__PURE__*/ jsxRuntimeExports.jsx(LoadingIcon$2, {
|
|
94477
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
94478
|
+
src: icLoading,
|
|
94479
|
+
alt: ""
|
|
94480
|
+
})
|
|
94481
|
+
})
|
|
94482
|
+
]
|
|
94483
|
+
})
|
|
94484
|
+
});
|
|
94485
|
+
}
|
|
94486
|
+
PassiveLivenessOldV1.propTypes = {
|
|
94487
|
+
apiCheck: PropTypes.bool,
|
|
94488
|
+
mode: PropTypes.string,
|
|
94489
|
+
onLivenessDetectionDone: PropTypes.func,
|
|
94490
|
+
onClose: PropTypes.func,
|
|
94491
|
+
onError: PropTypes.func,
|
|
94492
|
+
onReset: PropTypes.func,
|
|
94493
|
+
captureFrameSettings: PropTypes.shape({}),
|
|
94494
|
+
onFramesCaptured: PropTypes.func,
|
|
94495
|
+
frontCamera: PropTypes.bool,
|
|
94496
|
+
isLoading: PropTypes.bool,
|
|
94497
|
+
flipVideoHorizontal: PropTypes.bool,
|
|
94498
|
+
customDirectionIcon: PropTypes.shape({}),
|
|
94499
|
+
customStepTimeConstraints: PropTypes.shape({}),
|
|
94500
|
+
onProcessing: PropTypes.func,
|
|
94501
|
+
customErrors: PropTypes.shape({}),
|
|
94502
|
+
apiCredentials: PropTypes.shape({
|
|
94503
|
+
accessKey: PropTypes.string,
|
|
94504
|
+
secretKey: PropTypes.string,
|
|
94505
|
+
apiUrl: PropTypes.string
|
|
94506
|
+
}),
|
|
94507
|
+
outputEncryptionSettings: PropTypes.shape({}),
|
|
94508
|
+
cameraScale: PropTypes.number,
|
|
94509
|
+
defaultCameraId: PropTypes.string,
|
|
94510
|
+
passiveModeAuto: PropTypes.bool,
|
|
94511
|
+
offsetFaceY: PropTypes.number,
|
|
94512
|
+
styledComponent: PropTypes.shape({
|
|
94513
|
+
CloseCameraButton: PropTypes.node
|
|
94514
|
+
}),
|
|
94515
|
+
serviceSettings: PropTypes.shape({})
|
|
94516
|
+
};
|
|
94517
|
+
PassiveLivenessOldV1.defaultProps = {
|
|
94518
|
+
apiCheck: false,
|
|
94519
|
+
mode: null,
|
|
94520
|
+
onLivenessDetectionDone: null,
|
|
94521
|
+
onClose: null,
|
|
94522
|
+
onError: ()=>{},
|
|
94523
|
+
onReset: ()=>{},
|
|
94524
|
+
captureFrameSettings: {
|
|
94525
|
+
enable: false,
|
|
94526
|
+
framesIntervalTime: 180,
|
|
94527
|
+
framesBatchLength: 0
|
|
94528
|
+
},
|
|
94529
|
+
onFramesCaptured: ()=>{},
|
|
94530
|
+
frontCamera: true,
|
|
94531
|
+
isLoading: false,
|
|
94532
|
+
flipVideoHorizontal: null,
|
|
94533
|
+
customDirectionIcon: {
|
|
94534
|
+
[ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
94535
|
+
type: ra$1.FaceDirection.LEFT
|
|
94536
|
+
}),
|
|
94537
|
+
[ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
94538
|
+
type: ra$1.FaceDirection.RIGHT
|
|
94539
|
+
}),
|
|
94540
|
+
[ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
94541
|
+
type: ra$1.FaceDirection.UP
|
|
94542
|
+
}),
|
|
94543
|
+
[ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
94544
|
+
type: ra$1.FaceDirection.FRONTAL
|
|
94545
|
+
})
|
|
94546
|
+
},
|
|
94547
|
+
customStepTimeConstraints: {
|
|
94548
|
+
[ra$1.FaceDirection.UP]: {
|
|
94549
|
+
delayTime: 0
|
|
94550
|
+
},
|
|
94551
|
+
[ra$1.FaceDirection.LEFT]: {
|
|
94552
|
+
delayTime: 0
|
|
94553
|
+
},
|
|
94554
|
+
[ra$1.FaceDirection.RIGHT]: {
|
|
94555
|
+
delayTime: 0
|
|
94556
|
+
},
|
|
94557
|
+
[ra$1.FaceDirection.FRONTAL]: {
|
|
94558
|
+
delayTime: 2000
|
|
94559
|
+
}
|
|
94560
|
+
},
|
|
94561
|
+
onProcessing: ()=>{},
|
|
94562
|
+
customErrors: null,
|
|
94563
|
+
apiCredentials: {
|
|
94564
|
+
accessKey: '',
|
|
94565
|
+
secretKey: '',
|
|
94566
|
+
apiUrl: ''
|
|
94567
|
+
},
|
|
94568
|
+
outputEncryptionSettings: null,
|
|
94569
|
+
cameraScale: 1,
|
|
94570
|
+
defaultCameraId: undefined,
|
|
94571
|
+
passiveModeAuto: false,
|
|
94572
|
+
offsetFaceY: 0,
|
|
94573
|
+
styledComponent: {
|
|
94574
|
+
CloseCameraButton: null
|
|
94575
|
+
},
|
|
94576
|
+
serviceSettings: {
|
|
94577
|
+
enableUploadFrames: true,
|
|
94578
|
+
enableUploadImages: true,
|
|
94579
|
+
enableVerifySanityPortrait: true,
|
|
94580
|
+
enableVerifySanityIDCard: true,
|
|
94581
|
+
enableVerifyFaceLiveness: true,
|
|
94582
|
+
enableDetectIDCardTampering: true,
|
|
94583
|
+
enableReadIDCardInfo: true
|
|
94584
|
+
}
|
|
94585
|
+
};
|
|
94586
|
+
|
|
93867
94587
|
const withClientSettings$1 = (Component)=>{
|
|
93868
94588
|
return function WrappedComponent(props) {
|
|
93869
94589
|
const { apiCheck, apiCredentials, serviceSettings, flowId, clientSettings } = props;
|
|
@@ -93879,16 +94599,20 @@
|
|
|
93879
94599
|
});
|
|
93880
94600
|
};
|
|
93881
94601
|
};
|
|
93882
|
-
const getLivenessModeComponent = (mode, CustomLivenessDetection)=>{
|
|
94602
|
+
const getLivenessModeComponent = (mode, CustomLivenessDetection, themeVersion)=>{
|
|
93883
94603
|
let LivenessDetectionComponent = ActiveLiveness;
|
|
93884
94604
|
if (mode === ra$1.Mode.ACTIVE) {
|
|
93885
|
-
|
|
94605
|
+
const DefaultActiveLiveness = themeVersion === 'v1' ? ActiveLivenessV1 : ActiveLiveness;
|
|
94606
|
+
LivenessDetectionComponent = CustomLivenessDetection?.ActiveLiveness ?? DefaultActiveLiveness;
|
|
93886
94607
|
}
|
|
93887
94608
|
if (mode === ra$1.Mode.PASSIVE_V2) {
|
|
93888
94609
|
LivenessDetectionComponent = CustomLivenessDetection?.PassiveLivenessV2 ?? PassiveLiveness;
|
|
93889
94610
|
}
|
|
93890
94611
|
if (mode === ra$1.Mode.PASSIVE) {
|
|
93891
|
-
|
|
94612
|
+
// PassiveLivenessOldV1 to not be confused with PassiveLivenessV2 (which is totally new mode)
|
|
94613
|
+
// PassiveLivenessOldV1 refers to PassiveLiveness with themeVersion = "v1"
|
|
94614
|
+
const DefaultPassiveLiveness = themeVersion === 'v1' ? PassiveLivenessOldV1 : PassiveLiveness$1;
|
|
94615
|
+
LivenessDetectionComponent = CustomLivenessDetection?.PassiveLiveness ?? DefaultPassiveLiveness;
|
|
93892
94616
|
}
|
|
93893
94617
|
if (typeof mode === 'string' && mode.startsWith('flash')) {
|
|
93894
94618
|
LivenessDetectionComponent = CustomLivenessDetection?.FlashLiveness ?? FlashLiveness;
|
|
@@ -93901,7 +94625,7 @@
|
|
|
93901
94625
|
}, livenessComponent: CustomLivenessDetection, customTheme = {}, customTexts, ...props } = livenessProps;
|
|
93902
94626
|
const { mode, flowId, onError: onErrorFromProp, onClose: onCloseFromProp, debug, onLivenessDetectionDone } = props;
|
|
93903
94627
|
const clientSettings = useClientSettings();
|
|
93904
|
-
const { billingSettings: clientBillingSettings, enableBilling } = no$1.useSDKSettings();
|
|
94628
|
+
const { billingSettings: clientBillingSettings, enableBilling, themeVersion } = no$1.useSDKSettings();
|
|
93905
94629
|
const billingSettingsFromSdkSettings = dD.getWebSetting(clientSettings, 'data.settings.sdk_settings.billing_settings.billing_config');
|
|
93906
94630
|
const billingUrl = dD.getWebSetting(clientSettings, 'data.settings.sdk_settings.billing_settings.url');
|
|
93907
94631
|
const { submitBilling } = gR({
|
|
@@ -93987,7 +94711,7 @@
|
|
|
93987
94711
|
billingInput,
|
|
93988
94712
|
onCloseFromProp
|
|
93989
94713
|
]);
|
|
93990
|
-
const LivenessDetectionComponent = getLivenessModeComponent(mode, CustomLivenessDetection);
|
|
94714
|
+
const LivenessDetectionComponent = getLivenessModeComponent(mode, CustomLivenessDetection, themeVersion);
|
|
93991
94715
|
return /*#__PURE__*/ jsxRuntimeExports.jsx(DebugProvider, {
|
|
93992
94716
|
debug: debug,
|
|
93993
94717
|
children: /*#__PURE__*/ jsxRuntimeExports.jsx(SDKCallbackProvider, {
|
|
@@ -112751,7 +113475,7 @@
|
|
|
112751
113475
|
};
|
|
112752
113476
|
};
|
|
112753
113477
|
|
|
112754
|
-
const defaultAssetRoot = "https://vision-cdn.trustingsocial.com/tvweb-sdk.nbcci/0.0.0-beta.
|
|
113478
|
+
const defaultAssetRoot = "https://vision-cdn.trustingsocial.com/tvweb-sdk.nbcci/0.0.0-beta.20251215-165409/assets";
|
|
112755
113479
|
class TVWebSDK extends gU {
|
|
112756
113480
|
constructor(props){
|
|
112757
113481
|
super({
|