youverify-liveness-web 1.0.4 → 1.0.5
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/dist/index.js +137 -137
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -124,7 +124,7 @@ function Wn(e) {
|
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
126
|
function _n(e, t, n, r, o, i, s, a, l, u) {
|
|
127
|
-
var d, c, f, p, _, y, m, v, g, $, T, S, M, A, W,
|
|
127
|
+
var d, c, f, p, _, y, m, v, g, $, T, S, M, A, W, C, b = t.type;
|
|
128
128
|
if (t.constructor !== void 0) return null;
|
|
129
129
|
128 & n.__u && (l = !!(32 & n.__u), i = [a = t.__e = n.__e]), (d = O.__b) && d(t);
|
|
130
130
|
e: if (typeof b == "function") try {
|
|
@@ -147,7 +147,7 @@ function _n(e, t, n, r, o, i, s, a, l, u) {
|
|
|
147
147
|
} else do
|
|
148
148
|
c.__d = !1, M && M(t), d = c.render(c.props, c.state, c.context), c.state = c.__s;
|
|
149
149
|
while (c.__d && ++A < 25);
|
|
150
|
-
c.state = c.__s, c.getChildContext != null && (r = me(me({}, r), c.getChildContext())), g && !f && c.getSnapshotBeforeUpdate != null && (y = c.getSnapshotBeforeUpdate(p, _)), Rr(e, Tt(
|
|
150
|
+
c.state = c.__s, c.getChildContext != null && (r = me(me({}, r), c.getChildContext())), g && !f && c.getSnapshotBeforeUpdate != null && (y = c.getSnapshotBeforeUpdate(p, _)), Rr(e, Tt(C = d != null && d.type === q && d.key == null ? d.props.children : d) ? C : [C], t, n, r, o, i, s, a, l, u), c.base = t.__e, t.__u &= -161, c.__h.length && s.push(c), m && (c.__E = c.__ = null);
|
|
151
151
|
} catch (R) {
|
|
152
152
|
if (t.__v = null, l || i != null) {
|
|
153
153
|
for (t.__u |= l ? 160 : 32; a && a.nodeType === 8 && a.nextSibling; ) a = a.nextSibling;
|
|
@@ -684,7 +684,7 @@ O.diffed = function(e) {
|
|
|
684
684
|
};
|
|
685
685
|
var Zr = { ReactCurrentDispatcher: { current: { readContext: function(e) {
|
|
686
686
|
return $n.__n[e.__c].props.value;
|
|
687
|
-
}, useCallback: U, useContext: te, useDebugValue: wn, useDeferredValue: Sn, useEffect: H, useId: ke, useImperativeHandle: gn, useInsertionEffect:
|
|
687
|
+
}, useCallback: U, useContext: te, useDebugValue: wn, useDeferredValue: Sn, useEffect: H, useId: ke, useImperativeHandle: gn, useInsertionEffect: Cn, useLayoutEffect: De, useMemo: z, useReducer: it, useRef: w, useState: x, useSyncExternalStore: St, useTransition: Fn } } }, yi = "17.0.2";
|
|
688
688
|
function Jr(e) {
|
|
689
689
|
return de.bind(null, e);
|
|
690
690
|
}
|
|
@@ -717,10 +717,10 @@ function kn(e) {
|
|
|
717
717
|
function Sn(e) {
|
|
718
718
|
return e;
|
|
719
719
|
}
|
|
720
|
-
function
|
|
720
|
+
function Fn() {
|
|
721
721
|
return [!1, kn];
|
|
722
722
|
}
|
|
723
|
-
var
|
|
723
|
+
var Cn = De, so = je;
|
|
724
724
|
function St(e, t) {
|
|
725
725
|
var n = t(), r = x({ h: { __: n, v: t } }), o = r[0].h, i = r[1];
|
|
726
726
|
return De(function() {
|
|
@@ -740,7 +740,7 @@ function Wt(e) {
|
|
|
740
740
|
return !0;
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
|
-
var L = { useState: x, useId: ke, useReducer: it, useEffect: H, useLayoutEffect: De, useInsertionEffect:
|
|
743
|
+
var L = { useState: x, useId: ke, useReducer: it, useEffect: H, useLayoutEffect: De, useInsertionEffect: Cn, useTransition: Fn, useDeferredValue: Sn, useSyncExternalStore: St, startTransition: kn, useRef: w, useImperativeHandle: gn, useMemo: z, useCallback: U, useContext: te, useDebugValue: wn, version: "17.0.2", Children: Vr, render: Kr, hydrate: Xr, unmountComponentAtNode: to, createPortal: kt, createElement: de, createContext: ie, createFactory: Jr, cloneElement: Tn, createRef: mn, Fragment: q, isValidElement: je, isElement: so, isFragment: Qr, isMemo: eo, findDOMNode: no, Component: ue, PureComponent: yt, memo: zr, forwardRef: En, flushSync: oo, unstable_batchedUpdates: ro, StrictMode: io, Suspense: Qe, SuspenseList: We, lazy: Yr, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: Zr };
|
|
744
744
|
const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
745
745
|
__proto__: null,
|
|
746
746
|
Children: Vr,
|
|
@@ -780,14 +780,14 @@ const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
780
780
|
useErrorBoundary: ni,
|
|
781
781
|
useId: ke,
|
|
782
782
|
useImperativeHandle: gn,
|
|
783
|
-
useInsertionEffect:
|
|
783
|
+
useInsertionEffect: Cn,
|
|
784
784
|
useLayoutEffect: De,
|
|
785
785
|
useMemo: z,
|
|
786
786
|
useReducer: it,
|
|
787
787
|
useRef: w,
|
|
788
788
|
useState: x,
|
|
789
789
|
useSyncExternalStore: St,
|
|
790
|
-
useTransition:
|
|
790
|
+
useTransition: Fn,
|
|
791
791
|
version: yi
|
|
792
792
|
}, Symbol.toStringTag, { value: "Module" })), ao = typeof document < "u" ? L.useLayoutEffect : () => {
|
|
793
793
|
};
|
|
@@ -911,18 +911,18 @@ function Si(e) {
|
|
|
911
911
|
};
|
|
912
912
|
}
|
|
913
913
|
let at = null, rn = /* @__PURE__ */ new Set(), et = /* @__PURE__ */ new Map(), Re = !1, on = !1;
|
|
914
|
-
const
|
|
914
|
+
const Fi = {
|
|
915
915
|
Tab: !0,
|
|
916
916
|
Escape: !0
|
|
917
917
|
};
|
|
918
918
|
function xn(e, t) {
|
|
919
919
|
for (let n of rn) n(e, t);
|
|
920
920
|
}
|
|
921
|
-
function
|
|
921
|
+
function Ci(e) {
|
|
922
922
|
return !(e.metaKey || !Ei() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
|
|
923
923
|
}
|
|
924
924
|
function gt(e) {
|
|
925
|
-
Re = !0,
|
|
925
|
+
Re = !0, Ci(e) && (at = "keyboard", xn("keyboard", e));
|
|
926
926
|
}
|
|
927
927
|
function le(e) {
|
|
928
928
|
at = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (Re = !0, xn("pointer", e));
|
|
@@ -979,7 +979,7 @@ const Mi = /* @__PURE__ */ new Set([
|
|
|
979
979
|
function Pi(e, t, n) {
|
|
980
980
|
var r;
|
|
981
981
|
const o = typeof window < "u" ? Pe(n == null ? void 0 : n.target).HTMLInputElement : HTMLInputElement, i = typeof window < "u" ? Pe(n == null ? void 0 : n.target).HTMLTextAreaElement : HTMLTextAreaElement, s = typeof window < "u" ? Pe(n == null ? void 0 : n.target).HTMLElement : HTMLElement, a = typeof window < "u" ? Pe(n == null ? void 0 : n.target).KeyboardEvent : KeyboardEvent;
|
|
982
|
-
return e = e || (n == null ? void 0 : n.target) instanceof o && !Mi.has(n == null || (r = n.target) === null || r === void 0 ? void 0 : r.type) || (n == null ? void 0 : n.target) instanceof i || (n == null ? void 0 : n.target) instanceof s && (n == null ? void 0 : n.target.isContentEditable), !(e && t === "keyboard" && n instanceof a && !
|
|
982
|
+
return e = e || (n == null ? void 0 : n.target) instanceof o && !Mi.has(n == null || (r = n.target) === null || r === void 0 ? void 0 : r.type) || (n == null ? void 0 : n.target) instanceof i || (n == null ? void 0 : n.target) instanceof s && (n == null ? void 0 : n.target.isContentEditable), !(e && t === "keyboard" && n instanceof a && !Fi[n.key]);
|
|
983
983
|
}
|
|
984
984
|
function Ni(e, t, n) {
|
|
985
985
|
sn(), H(() => {
|
|
@@ -1152,10 +1152,10 @@ let Hi = class {
|
|
|
1152
1152
|
return this.handoffState === "complete";
|
|
1153
1153
|
}
|
|
1154
1154
|
}, Le = new Hi();
|
|
1155
|
-
function
|
|
1155
|
+
function Ft(e) {
|
|
1156
1156
|
return Le.isServer ? null : e instanceof Node ? e.ownerDocument : e != null && e.hasOwnProperty("current") && e.current instanceof Node ? e.current.ownerDocument : document;
|
|
1157
1157
|
}
|
|
1158
|
-
function
|
|
1158
|
+
function Ct(e) {
|
|
1159
1159
|
typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch((t) => setTimeout(() => {
|
|
1160
1160
|
throw t;
|
|
1161
1161
|
}));
|
|
@@ -1173,7 +1173,7 @@ function Se() {
|
|
|
1173
1173
|
return t.add(() => clearTimeout(r));
|
|
1174
1174
|
}, microTask(...n) {
|
|
1175
1175
|
let r = { current: !0 };
|
|
1176
|
-
return
|
|
1176
|
+
return Ct(() => {
|
|
1177
1177
|
r.current && n[0]();
|
|
1178
1178
|
}), t.add(() => {
|
|
1179
1179
|
r.current = !1;
|
|
@@ -1227,7 +1227,7 @@ function zi({ disabled: e = !1 } = {}) {
|
|
|
1227
1227
|
if (o.dispose(), t.current === null) {
|
|
1228
1228
|
t.current = a.currentTarget, r(!0);
|
|
1229
1229
|
{
|
|
1230
|
-
let l =
|
|
1230
|
+
let l = Ft(a.currentTarget);
|
|
1231
1231
|
o.addEventListener(l, "pointerup", i, !1), o.addEventListener(l, "pointermove", (u) => {
|
|
1232
1232
|
if (t.current) {
|
|
1233
1233
|
let d = Wi(u);
|
|
@@ -1286,13 +1286,13 @@ function pt(e, t = {}, n, r, o) {
|
|
|
1286
1286
|
for (let _ of p) c[`data-${_}`] = "";
|
|
1287
1287
|
}
|
|
1288
1288
|
}
|
|
1289
|
-
if (i === q && (Object.keys(
|
|
1290
|
-
if (Object.keys(
|
|
1289
|
+
if (i === q && (Object.keys(Ce(l)).length > 0 || Object.keys(Ce(c)).length > 0)) if (!je(d) || Array.isArray(d) && d.length > 1) {
|
|
1290
|
+
if (Object.keys(Ce(l)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${r} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(Ce(l)).concat(Object.keys(Ce(c))).map((f) => ` - ${f}`).join(`
|
|
1291
1291
|
`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', "Render a single element as the child so that we can forward the props onto that element."].map((f) => ` - ${f}`).join(`
|
|
1292
1292
|
`)].join(`
|
|
1293
1293
|
`));
|
|
1294
1294
|
} else {
|
|
1295
|
-
let f = d.props, p = f == null ? void 0 : f.className, _ = typeof p == "function" ? (...v) => ln(p(...v), l.className) : ln(p, l.className), y = _ ? { className: _ } : {}, m = mo(d.props,
|
|
1295
|
+
let f = d.props, p = f == null ? void 0 : f.className, _ = typeof p == "function" ? (...v) => ln(p(...v), l.className) : ln(p, l.className), y = _ ? { className: _ } : {}, m = mo(d.props, Ce(Vt(l, ["ref"])));
|
|
1296
1296
|
for (let v in c) v in m && delete c[v];
|
|
1297
1297
|
return Tn(d, Object.assign({}, m, c, u, { ref: o(d.ref, u.ref) }, y));
|
|
1298
1298
|
}
|
|
@@ -1336,7 +1336,7 @@ function oe(e) {
|
|
|
1336
1336
|
var t;
|
|
1337
1337
|
return Object.assign(En(e), { displayName: (t = e.displayName) != null ? t : e.name });
|
|
1338
1338
|
}
|
|
1339
|
-
function
|
|
1339
|
+
function Ce(e) {
|
|
1340
1340
|
let t = Object.assign({}, e);
|
|
1341
1341
|
for (let n in t) t[n] === void 0 && delete t[n];
|
|
1342
1342
|
return t;
|
|
@@ -1476,7 +1476,7 @@ function cs(e, { allowed: t, disallowed: n } = {}) {
|
|
|
1476
1476
|
let a = (i = t == null ? void 0 : t()) != null ? i : [];
|
|
1477
1477
|
for (let l of a) {
|
|
1478
1478
|
if (!l) continue;
|
|
1479
|
-
let u =
|
|
1479
|
+
let u = Ft(l);
|
|
1480
1480
|
if (!u) continue;
|
|
1481
1481
|
let d = l.parentElement;
|
|
1482
1482
|
for (; d && d !== u.body; ) {
|
|
@@ -1519,7 +1519,7 @@ function ps(e = document.body) {
|
|
|
1519
1519
|
var $o = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))($o || {});
|
|
1520
1520
|
function hs(e, t = 0) {
|
|
1521
1521
|
var n;
|
|
1522
|
-
return e === ((n =
|
|
1522
|
+
return e === ((n = Ft(e)) == null ? void 0 : n.body) ? !1 : Te(t, { 0() {
|
|
1523
1523
|
return e.matches(dn);
|
|
1524
1524
|
}, 1() {
|
|
1525
1525
|
let r = e;
|
|
@@ -1641,7 +1641,7 @@ function bs(e, t, n) {
|
|
|
1641
1641
|
}, !0), ko(r, "blur", (l) => i(l, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
|
|
1642
1642
|
}
|
|
1643
1643
|
function lt(...e) {
|
|
1644
|
-
return z(() =>
|
|
1644
|
+
return z(() => Ft(...e), [...e]);
|
|
1645
1645
|
}
|
|
1646
1646
|
function So(e, t, n, r) {
|
|
1647
1647
|
let o = Oe(n);
|
|
@@ -1746,14 +1746,14 @@ function Ss(e, t, n = () => ({ containers: [] })) {
|
|
|
1746
1746
|
if (!(!t || !e)) return Ne.dispatch("PUSH", t, n), () => Ne.dispatch("POP", t, n);
|
|
1747
1747
|
}, [e, t]), i;
|
|
1748
1748
|
}
|
|
1749
|
-
function
|
|
1749
|
+
function Fs(e, t, n = () => [document.body]) {
|
|
1750
1750
|
let r = Be(e, "scroll-lock");
|
|
1751
1751
|
Ss(r, t, (o) => {
|
|
1752
1752
|
var i;
|
|
1753
1753
|
return { containers: [...(i = o.containers) != null ? i : [], n] };
|
|
1754
1754
|
});
|
|
1755
1755
|
}
|
|
1756
|
-
function
|
|
1756
|
+
function Cs(e) {
|
|
1757
1757
|
let t = { called: !1 };
|
|
1758
1758
|
return (...n) => {
|
|
1759
1759
|
if (!t.called) return t.called = !0, e(...n);
|
|
@@ -1793,7 +1793,7 @@ function Ls(e, { prepare: t, run: n, done: r, inFlight: o }) {
|
|
|
1793
1793
|
}), i.dispose;
|
|
1794
1794
|
}
|
|
1795
1795
|
function As(e, t) {
|
|
1796
|
-
let n =
|
|
1796
|
+
let n = Cs(t), r = Se();
|
|
1797
1797
|
if (!e) return r.dispose;
|
|
1798
1798
|
let { transitionDuration: o, transitionDelay: i } = getComputedStyle(e), [s, a] = [o, i].map((u) => {
|
|
1799
1799
|
let [d = 0] = u.split(",").filter(Boolean).map((c) => c.includes("ms") ? parseFloat(c) : parseFloat(c) * 1e3).sort((c, f) => f - c);
|
|
@@ -1859,10 +1859,10 @@ Os(() => {
|
|
|
1859
1859
|
}
|
|
1860
1860
|
window.addEventListener("click", e, { capture: !0 }), window.addEventListener("mousedown", e, { capture: !0 }), window.addEventListener("focus", e, { capture: !0 }), document.body.addEventListener("click", e, { capture: !0 }), document.body.addEventListener("mousedown", e, { capture: !0 }), document.body.addEventListener("focus", e, { capture: !0 });
|
|
1861
1861
|
});
|
|
1862
|
-
function
|
|
1862
|
+
function Fo(e) {
|
|
1863
1863
|
let t = G(e), n = w(!1);
|
|
1864
1864
|
H(() => (n.current = !1, () => {
|
|
1865
|
-
n.current = !0,
|
|
1865
|
+
n.current = !0, Ct(() => {
|
|
1866
1866
|
n.current && t();
|
|
1867
1867
|
});
|
|
1868
1868
|
}), [t]);
|
|
@@ -1878,12 +1878,12 @@ function ct() {
|
|
|
1878
1878
|
t !== !0 && n(!0);
|
|
1879
1879
|
}, [t]), H(() => Le.handoff(), []), e ? !1 : t;
|
|
1880
1880
|
}
|
|
1881
|
-
let
|
|
1881
|
+
let Co = ie(!1);
|
|
1882
1882
|
function Ws() {
|
|
1883
|
-
return te(
|
|
1883
|
+
return te(Co);
|
|
1884
1884
|
}
|
|
1885
1885
|
function lr(e) {
|
|
1886
|
-
return L.createElement(
|
|
1886
|
+
return L.createElement(Co.Provider, { value: e.force }, e.children);
|
|
1887
1887
|
}
|
|
1888
1888
|
function Us(e) {
|
|
1889
1889
|
let t = Ws(), n = te(Mo), r = lt(e), [o, i] = x(() => {
|
|
@@ -1913,7 +1913,7 @@ let xo = q, zs = oe(function(e, t) {
|
|
|
1913
1913
|
!s || !a || s.contains(a) || (a.setAttribute("data-headlessui-portal", ""), s.appendChild(a));
|
|
1914
1914
|
}, [s, a]), re(() => {
|
|
1915
1915
|
if (a && l) return l.register(a);
|
|
1916
|
-
}, [l, a]),
|
|
1916
|
+
}, [l, a]), Fo(() => {
|
|
1917
1917
|
var d;
|
|
1918
1918
|
!s || !a || (a instanceof Node && s.contains(a) && s.removeChild(a), s.childNodes.length <= 0 && ((d = s.parentElement) == null || d.removeChild(s)));
|
|
1919
1919
|
}), u ? !s || !a ? null : kt(ae({ ourProps: { ref: o }, theirProps: n, slot: {}, defaultTag: xo, name: "Portal" }), a) : null;
|
|
@@ -2024,7 +2024,7 @@ let ta = oe(ea), na = Object.assign(ta, { features: Me });
|
|
|
2024
2024
|
function ra(e = !0) {
|
|
2025
2025
|
let t = w(be.slice());
|
|
2026
2026
|
return Pn(([n], [r]) => {
|
|
2027
|
-
r === !0 && n === !1 &&
|
|
2027
|
+
r === !0 && n === !1 && Ct(() => {
|
|
2028
2028
|
t.current.splice(0);
|
|
2029
2029
|
}), r === !1 && n === !0 && (t.current = be.slice());
|
|
2030
2030
|
}, [e, be, t]), G(() => {
|
|
@@ -2036,7 +2036,7 @@ function oa(e, { ownerDocument: t }) {
|
|
|
2036
2036
|
let n = !!(e & 8), r = ra(n);
|
|
2037
2037
|
Pn(() => {
|
|
2038
2038
|
n || (t == null ? void 0 : t.activeElement) === (t == null ? void 0 : t.body) && ye(r());
|
|
2039
|
-
}, [n]),
|
|
2039
|
+
}, [n]), Fo(() => {
|
|
2040
2040
|
n && ye(r());
|
|
2041
2041
|
});
|
|
2042
2042
|
}
|
|
@@ -2049,7 +2049,7 @@ function ia(e, { ownerDocument: t, container: n, initialFocus: r, initialFocusFa
|
|
|
2049
2049
|
return;
|
|
2050
2050
|
}
|
|
2051
2051
|
let l = n.current;
|
|
2052
|
-
l &&
|
|
2052
|
+
l && Ct(() => {
|
|
2053
2053
|
if (!a.current) return;
|
|
2054
2054
|
let u = t == null ? void 0 : t.activeElement;
|
|
2055
2055
|
if (r != null && r.current) {
|
|
@@ -2142,11 +2142,11 @@ function Ro(e, t) {
|
|
|
2142
2142
|
let Io = q, Do = bt.RenderStrategy;
|
|
2143
2143
|
function ua(e, t) {
|
|
2144
2144
|
var n, r;
|
|
2145
|
-
let { transition: o = !0, beforeEnter: i, afterEnter: s, beforeLeave: a, afterLeave: l, enter: u, enterFrom: d, enterTo: c, entered: f, leave: p, leaveFrom: _, leaveTo: y, ...m } = e, v = w(null), g = Ao(e), $ = he(...g ? [v, t] : t === null ? [] : [t]), T = (n = m.unmount) == null || n ? Ee.Unmount : Ee.Hidden, { show: S, appear: M, initial: A } = la(), [W,
|
|
2145
|
+
let { transition: o = !0, beforeEnter: i, afterEnter: s, beforeLeave: a, afterLeave: l, enter: u, enterFrom: d, enterTo: c, entered: f, leave: p, leaveFrom: _, leaveTo: y, ...m } = e, v = w(null), g = Ao(e), $ = he(...g ? [v, t] : t === null ? [] : [t]), T = (n = m.unmount) == null || n ? Ee.Unmount : Ee.Hidden, { show: S, appear: M, initial: A } = la(), [W, C] = x(S ? "visible" : "hidden"), b = ca(), { register: R, unregister: j } = b;
|
|
2146
2146
|
re(() => R(v), [R, v]), re(() => {
|
|
2147
2147
|
if (T === Ee.Hidden && v.current) {
|
|
2148
2148
|
if (S && W !== "visible") {
|
|
2149
|
-
|
|
2149
|
+
C("visible");
|
|
2150
2150
|
return;
|
|
2151
2151
|
}
|
|
2152
2152
|
return Te(W, { hidden: () => j(v), visible: () => R(v) });
|
|
@@ -2157,8 +2157,8 @@ function ua(e, t) {
|
|
|
2157
2157
|
if (g && I && W === "visible" && v.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
|
|
2158
2158
|
}, [v, W, I, g]);
|
|
2159
2159
|
let Y = A && !M, Q = M && S && A, X = w(!1), k = Ro(() => {
|
|
2160
|
-
X.current || (
|
|
2161
|
-
}, b),
|
|
2160
|
+
X.current || (C("hidden"), j(v));
|
|
2161
|
+
}, b), F = G((Z) => {
|
|
2162
2162
|
X.current = !0;
|
|
2163
2163
|
let J = Z ? "enter" : "leave";
|
|
2164
2164
|
k.onStart(v, J, (ee) => {
|
|
@@ -2168,12 +2168,12 @@ function ua(e, t) {
|
|
|
2168
2168
|
let J = Z ? "enter" : "leave";
|
|
2169
2169
|
X.current = !1, k.onStop(v, J, (ee) => {
|
|
2170
2170
|
ee === "enter" ? s == null || s() : ee === "leave" && (l == null || l());
|
|
2171
|
-
}), J === "leave" && !At(k) && (
|
|
2171
|
+
}), J === "leave" && !At(k) && (C("hidden"), j(v));
|
|
2172
2172
|
});
|
|
2173
2173
|
H(() => {
|
|
2174
|
-
g && o || (
|
|
2174
|
+
g && o || (F(S), N(S));
|
|
2175
2175
|
}, [S, g, o]);
|
|
2176
|
-
let P = !(!o || !g || !I || Y), [, E] = Ns(P, v, S, { start:
|
|
2176
|
+
let P = !(!o || !g || !I || Y), [, E] = Ns(P, v, S, { start: F, end: N }), D = Ce({ ref: $, className: ((r = ln(m.className, Q && u, Q && d, E.enter && u, E.enter && E.closed && d, E.enter && !E.closed && c, E.leave && p, E.leave && !E.closed && _, E.leave && E.closed && y, !E.transition && S && f)) == null ? void 0 : r.trim()) || void 0, ...Ps(E) }), V = 0;
|
|
2177
2177
|
return W === "visible" && (V |= ce.Open), W === "hidden" && (V |= ce.Closed), E.enter && (V |= ce.Opening), E.leave && (V |= ce.Closing), L.createElement(Lt.Provider, { value: k }, L.createElement(Is, { value: V }, ae({ ourProps: D, theirProps: m, defaultTag: Io, features: Do, visible: W === "visible", name: "Transition.Child" })));
|
|
2178
2178
|
}
|
|
2179
2179
|
function da(e, t) {
|
|
@@ -2231,20 +2231,20 @@ let cr = oe(function(e, t) {
|
|
|
2231
2231
|
let p = w(null), _ = he(p, t), y = lt(p), m = o ? 0 : 1, [v, g] = it(ma, { titleId: null, descriptionId: null, panelRef: mn() }), $ = G(() => i(!1)), T = G((P) => g({ type: 0, id: P })), S = ct() ? m === 0 : !1, [M, A] = qs(), W = { get current() {
|
|
2232
2232
|
var P;
|
|
2233
2233
|
return (P = v.panelRef.current) != null ? P : p.current;
|
|
2234
|
-
} }, { resolveContainers:
|
|
2234
|
+
} }, { resolveContainers: C, mainTreeNodeRef: b, MainTreeNode: R } = Zs({ portals: M, defaultContainers: [W] }), j = f !== null ? (f & ce.Closing) === ce.Closing : !1;
|
|
2235
2235
|
cs(u || j ? !1 : S, { allowed: G(() => {
|
|
2236
2236
|
var P, E;
|
|
2237
2237
|
return [(E = (P = p.current) == null ? void 0 : P.closest("[data-headlessui-portal]")) != null ? E : null];
|
|
2238
2238
|
}), disallowed: G(() => {
|
|
2239
2239
|
var P, E;
|
|
2240
2240
|
return [(E = (P = b.current) == null ? void 0 : P.closest("body > *:not(#headlessui-portal-root)")) != null ? E : null];
|
|
2241
|
-
}) }), bs(S,
|
|
2241
|
+
}) }), bs(S, C, (P) => {
|
|
2242
2242
|
P.preventDefault(), $();
|
|
2243
2243
|
}), Ks(S, y == null ? void 0 : y.defaultView, (P) => {
|
|
2244
2244
|
P.preventDefault(), P.stopPropagation(), document.activeElement && "blur" in document.activeElement && typeof document.activeElement.blur == "function" && document.activeElement.blur(), $();
|
|
2245
|
-
}),
|
|
2246
|
-
let [I, Y] = es(), Q = z(() => [{ dialogState: m, close: $, setTitleId: T }, v], [m, v, $, T]), X = z(() => ({ open: m === 0 }), [m]), k = { ref: _, id: r, role: a, tabIndex: -1, "aria-modal": u ? void 0 : m === 0 ? !0 : void 0, "aria-labelledby": v.titleId, "aria-describedby": I },
|
|
2247
|
-
return S && !u && (N |= Me.RestoreFocus, N |= Me.TabLock, l && (N |= Me.AutoFocus),
|
|
2245
|
+
}), Fs(u || j ? !1 : S, y, C), Eo(S, p, $);
|
|
2246
|
+
let [I, Y] = es(), Q = z(() => [{ dialogState: m, close: $, setTitleId: T }, v], [m, v, $, T]), X = z(() => ({ open: m === 0 }), [m]), k = { ref: _, id: r, role: a, tabIndex: -1, "aria-modal": u ? void 0 : m === 0 ? !0 : void 0, "aria-labelledby": v.titleId, "aria-describedby": I }, F = !Xs(), N = Me.None;
|
|
2247
|
+
return S && !u && (N |= Me.RestoreFocus, N |= Me.TabLock, l && (N |= Me.AutoFocus), F && (N |= Me.InitialFocus)), L.createElement(Ds, null, L.createElement(lr, { force: !0 }, L.createElement(Gs, null, L.createElement(An.Provider, { value: Q }, L.createElement(Po, { target: p }, L.createElement(lr, { force: !1 }, L.createElement(Y, { slot: X }, L.createElement(A, null, L.createElement(na, { initialFocus: s, initialFocusFallback: p, containers: C, features: N }, L.createElement(ss, { value: $ }, ae({ ourProps: k, theirProps: d, slot: X, defaultTag: _a, features: ya, visible: m === 0, name: "Dialog" })))))))))), L.createElement(Ji, null, L.createElement(R, null)));
|
|
2248
2248
|
}), _a = "div", ya = bt.RenderStrategy | bt.Static;
|
|
2249
2249
|
function ga(e, t) {
|
|
2250
2250
|
let { transition: n = !1, open: r, ...o } = e, i = Pt(), s = e.hasOwnProperty("open") || i !== null, a = e.hasOwnProperty("onClose");
|
|
@@ -2276,7 +2276,7 @@ function ka(e, t) {
|
|
|
2276
2276
|
}
|
|
2277
2277
|
let Sa = oe(ga), Ho = oe(ba);
|
|
2278
2278
|
oe($a);
|
|
2279
|
-
let
|
|
2279
|
+
let Fa = oe(ka), Ca = Object.assign(Sa, { Panel: Ho, Title: Fa, Description: os });
|
|
2280
2280
|
const xa = "_root_1duny_1", Ma = "_modal_1duny_10", Pa = "_container_1duny_13", Na = "_page_1duny_18", La = "_close_1duny_21", ht = {
|
|
2281
2281
|
root: xa,
|
|
2282
2282
|
modal: Ma,
|
|
@@ -2730,7 +2730,7 @@ function tl(e) {
|
|
|
2730
2730
|
sessionId: _,
|
|
2731
2731
|
sessionToken: y,
|
|
2732
2732
|
forceDevUrl: m
|
|
2733
|
-
} = e, [v, g] = x(0), [$, T] = x(0), [S, M] = x(null), [A, W] = x(!1), { saveStream:
|
|
2733
|
+
} = e, [v, g] = x(0), [$, T] = x(0), [S, M] = x(null), [A, W] = x(!1), { saveStream: C, savePhoto: b, savedPhoto: R, clearSavedPhoto: j, savedStreams: I } = zo(), { postData: Y, validateSessionId: Q } = Ka(
|
|
2734
2734
|
f,
|
|
2735
2735
|
m,
|
|
2736
2736
|
t,
|
|
@@ -2740,7 +2740,7 @@ function tl(e) {
|
|
|
2740
2740
|
[n, $]
|
|
2741
2741
|
), k = () => {
|
|
2742
2742
|
T((E) => E + 1), g((E) => E + 1);
|
|
2743
|
-
},
|
|
2743
|
+
}, F = (E) => {
|
|
2744
2744
|
const D = new Image();
|
|
2745
2745
|
D.crossOrigin = "Anonymous", D.src = Ja, D.onload = () => {
|
|
2746
2746
|
const V = Rn(D, D.width, D.height);
|
|
@@ -2803,7 +2803,7 @@ function tl(e) {
|
|
|
2803
2803
|
return;
|
|
2804
2804
|
}
|
|
2805
2805
|
const E = await $e.loadDetector();
|
|
2806
|
-
pr = E,
|
|
2806
|
+
pr = E, F(E), M(E);
|
|
2807
2807
|
};
|
|
2808
2808
|
return H(() => {
|
|
2809
2809
|
if (hr) {
|
|
@@ -2834,7 +2834,7 @@ function tl(e) {
|
|
|
2834
2834
|
},
|
|
2835
2835
|
onRequestClose: a,
|
|
2836
2836
|
faceDetector: S,
|
|
2837
|
-
saveStream:
|
|
2837
|
+
saveStream: C,
|
|
2838
2838
|
savePhoto: b,
|
|
2839
2839
|
clearSavedPhoto: j,
|
|
2840
2840
|
onComplete: N,
|
|
@@ -3112,9 +3112,9 @@ function It(e = {}) {
|
|
|
3112
3112
|
d(g.faces);
|
|
3113
3113
|
} };
|
|
3114
3114
|
}
|
|
3115
|
-
const
|
|
3116
|
-
root:
|
|
3117
|
-
container:
|
|
3115
|
+
const Fl = "_root_5hgaj_1", Cl = "_container_5hgaj_4", xl = "_progress_5hgaj_7", Ml = "_intro_5hgaj_12", Pl = "_content_5hgaj_15", Nl = "_branding_5hgaj_18", Ll = "_instructionsContainer_5hgaj_22", Al = "_instructions_5hgaj_22", se = {
|
|
3116
|
+
root: Fl,
|
|
3117
|
+
container: Cl,
|
|
3118
3118
|
progress: xl,
|
|
3119
3119
|
intro: Ml,
|
|
3120
3120
|
content: Pl,
|
|
@@ -3304,8 +3304,8 @@ function zl(e) {
|
|
|
3304
3304
|
return 10;
|
|
3305
3305
|
}
|
|
3306
3306
|
}, []), A = (b) => {
|
|
3307
|
-
const { keypoints: R, box: j } = b, I = { x: j.width * 0.5, y: j.height * 0.5 }, Y = R[Ul], Q = { y: Y.y - j.yMin, x: Y.x - j.xMin }, X = I.x - Q.x, k = Q.y - I.y,
|
|
3308
|
-
return Math.abs(X) <
|
|
3307
|
+
const { keypoints: R, box: j } = b, I = { x: j.width * 0.5, y: j.height * 0.5 }, Y = R[Ul], Q = { y: Y.y - j.yMin, x: Y.x - j.xMin }, X = I.x - Q.x, k = Q.y - I.y, F = M();
|
|
3308
|
+
return Math.abs(X) < F && Math.abs(k) < F ? null : S(X, k);
|
|
3309
3309
|
}, { detectFaces: W } = It({
|
|
3310
3310
|
frameSize: 280,
|
|
3311
3311
|
validations: ["zoom", "in-frame"],
|
|
@@ -3385,13 +3385,13 @@ function Xl(e) {
|
|
|
3385
3385
|
}), M = () => {
|
|
3386
3386
|
i($r), a(!1), u(!1), c.current = "inactive", f.current = 0, p.current = !1, g();
|
|
3387
3387
|
}, A = (I) => {
|
|
3388
|
-
const { keypoints: Y } = I, Q = Y[1], X = Y[9], k = Q.x - X.x,
|
|
3389
|
-
return 90 - Math.atan2(
|
|
3388
|
+
const { keypoints: Y } = I, Q = Y[1], X = Y[9], k = Q.x - X.x, F = Q.y - X.y;
|
|
3389
|
+
return 90 - Math.atan2(F, k) * (180 / Math.PI);
|
|
3390
3390
|
}, W = (I) => {
|
|
3391
3391
|
c.current = "inactive", i(n[I].question), _.current = setTimeout(() => {
|
|
3392
3392
|
c.current = "active";
|
|
3393
3393
|
}, 2e3);
|
|
3394
|
-
},
|
|
3394
|
+
}, C = z(() => {
|
|
3395
3395
|
switch (t) {
|
|
3396
3396
|
case "easy":
|
|
3397
3397
|
return 2;
|
|
@@ -3402,7 +3402,7 @@ function Xl(e) {
|
|
|
3402
3402
|
}
|
|
3403
3403
|
}, []), b = (I) => {
|
|
3404
3404
|
try {
|
|
3405
|
-
if (c.current = "inactive", Math.abs(I) <
|
|
3405
|
+
if (c.current = "inactive", Math.abs(I) < C)
|
|
3406
3406
|
throw new Error("Tilt head further to answer");
|
|
3407
3407
|
const Y = I > 0, Q = n[f.current].answer;
|
|
3408
3408
|
if (Y === Q)
|
|
@@ -3478,7 +3478,7 @@ function Jl(e) {
|
|
|
3478
3478
|
}
|
|
3479
3479
|
return t;
|
|
3480
3480
|
}
|
|
3481
|
-
const
|
|
3481
|
+
const Fe = (e, t) => {
|
|
3482
3482
|
for (const [n, r] of Object.entries(e))
|
|
3483
3483
|
if (r === t) return n;
|
|
3484
3484
|
return null;
|
|
@@ -3688,7 +3688,7 @@ function nc(e) {
|
|
|
3688
3688
|
await M({ ref: b, frameSize: R, throttleInterval: 500 });
|
|
3689
3689
|
} catch {
|
|
3690
3690
|
}
|
|
3691
|
-
},
|
|
3691
|
+
}, C = async () => {
|
|
3692
3692
|
};
|
|
3693
3693
|
return /* @__PURE__ */ h(
|
|
3694
3694
|
Dt,
|
|
@@ -3702,7 +3702,7 @@ function nc(e) {
|
|
|
3702
3702
|
onReset: A,
|
|
3703
3703
|
completed: l,
|
|
3704
3704
|
onStart: async () => {
|
|
3705
|
-
await
|
|
3705
|
+
await C(), y();
|
|
3706
3706
|
},
|
|
3707
3707
|
children: d ? /* @__PURE__ */ h(q, {}) : /* @__PURE__ */ h(ut, { onStream: W, onRecord: p })
|
|
3708
3708
|
}
|
|
@@ -3763,7 +3763,7 @@ const Yt = {
|
|
|
3763
3763
|
LEFT_EYE: [36, 37, 38, 39, 40, 41],
|
|
3764
3764
|
RIGHT_EYE: [42, 43, 44, 45, 46, 47],
|
|
3765
3765
|
MOUTH: [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59]
|
|
3766
|
-
}, mt = (e, t) => Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2),
|
|
3766
|
+
}, mt = (e, t) => Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2), Fr = (e) => {
|
|
3767
3767
|
if (e.length !== 6) return 0;
|
|
3768
3768
|
const t = mt(e[1], e[5]), n = mt(e[2], e[4]), r = mt(e[0], e[3]);
|
|
3769
3769
|
return (t + n) / (2 * r);
|
|
@@ -3779,7 +3779,7 @@ const Yt = {
|
|
|
3779
3779
|
(A) => e[A]
|
|
3780
3780
|
), v = Yt.RIGHT_EYE.map(
|
|
3781
3781
|
(A) => e[A]
|
|
3782
|
-
), g = Yt.MOUTH.map((A) => e[A]), $ =
|
|
3782
|
+
), g = Yt.MOUTH.map((A) => e[A]), $ = Fr(m), T = Fr(v), S = oc(g);
|
|
3783
3783
|
o = ($ + T) / 2 > 1, i = S < 73.24, o || t("Please look at the camera!"), i || t("Please close your mouth!");
|
|
3784
3784
|
}
|
|
3785
3785
|
const s = 0.5, a = 0.12, l = ((c = r == null ? void 0 : r.find((_) => _.categoryName === "eyeBlinkLeft")) == null ? void 0 : c.score) ?? 0, u = ((f = r == null ? void 0 : r.find((_) => _.categoryName === "eyeBlinkRight")) == null ? void 0 : f.score) ?? 0, d = ((p = r == null ? void 0 : r.find((_) => _.categoryName === "jawOpen")) == null ? void 0 : p.score) ?? 0;
|
|
@@ -3801,26 +3801,26 @@ function sc(e = {}) {
|
|
|
3801
3801
|
livenessTimeout: s
|
|
3802
3802
|
} = e, { faceDetector: a, savePhoto: l } = fe(), { checkFacialFeatures: u, checkZoomLevel: d, checkInFrame: c } = Bo(), f = w(null), p = w(null), _ = w(!1), y = w(null), m = w(!1), v = w([]), g = U(() => {
|
|
3803
3803
|
p.current && clearTimeout(p.current), y.current && clearTimeout(y.current), v.current.forEach(clearTimeout), m.current = !1, _.current = !0;
|
|
3804
|
-
}, []), $ = w(null), T = w(null), S = w([]), M = 10, A = 7.5, W = 2,
|
|
3804
|
+
}, []), $ = w(null), T = w(null), S = w([]), M = 10, A = 7.5, W = 2, C = w({
|
|
3805
3805
|
sharpness: 0,
|
|
3806
3806
|
data: null
|
|
3807
|
-
}), b = (k,
|
|
3807
|
+
}), b = (k, F) => {
|
|
3808
3808
|
const N = k.getContext("2d");
|
|
3809
|
-
if (!N ||
|
|
3809
|
+
if (!N || F.width === 0 || F.height === 0 || !N || F.width === 0 || F.height === 0)
|
|
3810
3810
|
return !1;
|
|
3811
3811
|
const P = N.getImageData(
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3812
|
+
F.xMin,
|
|
3813
|
+
F.yMin,
|
|
3814
|
+
F.width,
|
|
3815
|
+
F.height
|
|
3816
3816
|
), { data: E } = P;
|
|
3817
3817
|
let D = 0, V = 0;
|
|
3818
3818
|
for (let J = 0; J < E.length; J += 4)
|
|
3819
3819
|
0.299 * E[J] + 0.587 * E[J + 1] + 0.114 * E[J + 2] > 250 && V++;
|
|
3820
3820
|
const Z = E.length / 4;
|
|
3821
3821
|
return D = V / Z, D > 0.01;
|
|
3822
|
-
}, R = (k,
|
|
3823
|
-
const E =
|
|
3822
|
+
}, R = (k, F, N, P) => {
|
|
3823
|
+
const E = F.current, D = E == null ? void 0 : E.parentElement;
|
|
3824
3824
|
if (!(!E || !D))
|
|
3825
3825
|
for (const V of P)
|
|
3826
3826
|
switch (V) {
|
|
@@ -3848,7 +3848,7 @@ function sc(e = {}) {
|
|
|
3848
3848
|
break;
|
|
3849
3849
|
}
|
|
3850
3850
|
}, j = (k) => {
|
|
3851
|
-
const
|
|
3851
|
+
const F = [
|
|
3852
3852
|
33,
|
|
3853
3853
|
// Left eye inner corner
|
|
3854
3854
|
133,
|
|
@@ -3862,21 +3862,21 @@ function sc(e = {}) {
|
|
|
3862
3862
|
386
|
|
3863
3863
|
// Right eye pupil area
|
|
3864
3864
|
], N = 0.5;
|
|
3865
|
-
for (const P of
|
|
3865
|
+
for (const P of F) {
|
|
3866
3866
|
const E = k[P];
|
|
3867
3867
|
if (!E || E.score && E.score < N)
|
|
3868
3868
|
return !1;
|
|
3869
3869
|
}
|
|
3870
3870
|
return !0;
|
|
3871
|
-
}, I = (k,
|
|
3871
|
+
}, I = (k, F) => {
|
|
3872
3872
|
const N = k.getContext("2d");
|
|
3873
|
-
if (!N ||
|
|
3873
|
+
if (!N || F.width === 0 || F.height === 0)
|
|
3874
3874
|
return !1;
|
|
3875
3875
|
const P = N.getImageData(
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3876
|
+
F.xMin,
|
|
3877
|
+
F.yMin,
|
|
3878
|
+
F.width,
|
|
3879
|
+
F.height
|
|
3880
3880
|
), { data: E } = P;
|
|
3881
3881
|
let D = 0;
|
|
3882
3882
|
for (let Z = 0; Z < E.length; Z += 4) {
|
|
@@ -3885,11 +3885,11 @@ function sc(e = {}) {
|
|
|
3885
3885
|
}
|
|
3886
3886
|
return D / (E.length / 4) < 60;
|
|
3887
3887
|
}, Y = (k) => {
|
|
3888
|
-
const
|
|
3888
|
+
const F = {
|
|
3889
3889
|
x: k.box.xMin + (k.box.width ?? 0) / 2,
|
|
3890
3890
|
y: k.box.yMin + (k.box.height ?? 0) / 2
|
|
3891
3891
|
};
|
|
3892
|
-
if (S.current.push(
|
|
3892
|
+
if (S.current.push(F), S.current.length > M && S.current.shift(), S.current.length < M) return !1;
|
|
3893
3893
|
let N = 0, P = 0, E = 0;
|
|
3894
3894
|
for (let ee = 1; ee < S.current.length; ee++) {
|
|
3895
3895
|
const He = S.current[ee - 1], dt = S.current[ee], qe = dt.x - He.x, In = dt.y - He.y, Dn = Math.sqrt(qe * qe + In * In);
|
|
@@ -3897,7 +3897,7 @@ function sc(e = {}) {
|
|
|
3897
3897
|
}
|
|
3898
3898
|
const V = N / (M - 1) > A, Z = P >= W, J = V || Z;
|
|
3899
3899
|
return J && i("🚨 Head shake detected!"), J;
|
|
3900
|
-
}, Q = (k,
|
|
3900
|
+
}, Q = (k, F, N, P) => {
|
|
3901
3901
|
try {
|
|
3902
3902
|
if (k.length === 0 || k.length > 1) {
|
|
3903
3903
|
p.current && (clearTimeout(p.current), p.current = null), i(
|
|
@@ -3933,20 +3933,20 @@ function sc(e = {}) {
|
|
|
3933
3933
|
i("Too much glare. Please avoid direct light on your face.");
|
|
3934
3934
|
return;
|
|
3935
3935
|
}
|
|
3936
|
-
i("Hold still..."),
|
|
3936
|
+
i("Hold still..."), C.current = { sharpness: 0, data: null }, v.current.forEach(clearTimeout);
|
|
3937
3937
|
const ee = setTimeout(() => i("Almost there..."), 400), He = setTimeout(
|
|
3938
3938
|
() => i("Detecting liveness..."),
|
|
3939
3939
|
700
|
|
3940
3940
|
);
|
|
3941
3941
|
v.current = [ee, He], p.current = setTimeout(() => {
|
|
3942
|
-
|
|
3942
|
+
C.current.data ? (l(C.current.data), r(E, !0, N, !0)) : o("Could not capture a clear photo. Please try again.");
|
|
3943
3943
|
}, 1e3);
|
|
3944
3944
|
}
|
|
3945
3945
|
if (p.current) {
|
|
3946
|
-
const ee = ja(
|
|
3947
|
-
ee >
|
|
3946
|
+
const ee = ja(F);
|
|
3947
|
+
ee > C.current.sharpness && (C.current = {
|
|
3948
3948
|
sharpness: ee,
|
|
3949
|
-
data:
|
|
3949
|
+
data: F
|
|
3950
3950
|
});
|
|
3951
3951
|
}
|
|
3952
3952
|
} catch (E) {
|
|
@@ -3956,16 +3956,16 @@ function sc(e = {}) {
|
|
|
3956
3956
|
return { detectFaces: async (k) => {
|
|
3957
3957
|
if (!a) return;
|
|
3958
3958
|
f.current = k.ref.current;
|
|
3959
|
-
const
|
|
3960
|
-
if (!
|
|
3959
|
+
const F = f.current;
|
|
3960
|
+
if (!F || F.videoWidth === 0) return;
|
|
3961
3961
|
$.current || ($.current = document.createElement("canvas"), T.current = $.current.getContext("2d", {
|
|
3962
3962
|
willReadFrequently: !0
|
|
3963
3963
|
}));
|
|
3964
3964
|
const N = $.current, P = T.current;
|
|
3965
3965
|
if (!N || !P) return;
|
|
3966
|
-
N.width =
|
|
3966
|
+
N.width = F.videoWidth, N.height = F.videoHeight, P.drawImage(F, 0, 0, N.width, N.height);
|
|
3967
3967
|
const E = P.getImageData(0, 0, N.width, N.height);
|
|
3968
|
-
!m.current &&
|
|
3968
|
+
!m.current && F.readyState >= 2 && !_.current && (m.current = !0, y.current = setTimeout(() => {
|
|
3969
3969
|
o("Liveness check TIMED OUT. Please try again."), g();
|
|
3970
3970
|
}, s));
|
|
3971
3971
|
const { faces: D, blendShapes: V, inBox: Z } = await $e.detectFaces(
|
|
@@ -4040,12 +4040,12 @@ function pc(e) {
|
|
|
4040
4040
|
s.current.setToken(m);
|
|
4041
4041
|
let $ = "", T = "", S, M = 0;
|
|
4042
4042
|
if (v.length === 3) {
|
|
4043
|
-
const
|
|
4044
|
-
if (
|
|
4045
|
-
const b = JSON.parse(
|
|
4043
|
+
const C = JSON.parse(atob(v[1]));
|
|
4044
|
+
if (C.face) {
|
|
4045
|
+
const b = JSON.parse(C.face), R = /^https:\/\/[^/:]+\.(api\.cognitive\.microsoft|cognitiveservices\.azure)\.com$/;
|
|
4046
4046
|
if (b.endpoint && (R.test(b.endpoint) || b.endpoint === "https://virginia.api.cognitive.microsoft.us")) {
|
|
4047
4047
|
s.current.setEndpoint(b.endpoint);
|
|
4048
|
-
const I = JSON.parse(
|
|
4048
|
+
const I = JSON.parse(C["allowed-paths"]);
|
|
4049
4049
|
if (I) {
|
|
4050
4050
|
const Y = (A = I.find(
|
|
4051
4051
|
(P) => P.path.toLocaleLowerCase().endsWith("/session/start")
|
|
@@ -4065,7 +4065,7 @@ function pc(e) {
|
|
|
4065
4065
|
k && ({ path: T, quota: M } = k, s.current.setLivenessWithVerifyPath(
|
|
4066
4066
|
T
|
|
4067
4067
|
));
|
|
4068
|
-
const
|
|
4068
|
+
const F = new Set(
|
|
4069
4069
|
I.map(
|
|
4070
4070
|
(P) => {
|
|
4071
4071
|
var E;
|
|
@@ -4073,8 +4073,8 @@ function pc(e) {
|
|
|
4073
4073
|
}
|
|
4074
4074
|
)
|
|
4075
4075
|
);
|
|
4076
|
-
if (
|
|
4077
|
-
const P =
|
|
4076
|
+
if (F.size === 1 && (X || k)) {
|
|
4077
|
+
const P = F.values().next().value;
|
|
4078
4078
|
s.current.setApiVersion(P), g = !0, S = b.clientClaims.livenessOperationMode;
|
|
4079
4079
|
}
|
|
4080
4080
|
}
|
|
@@ -4082,23 +4082,23 @@ function pc(e) {
|
|
|
4082
4082
|
}
|
|
4083
4083
|
s.current.setOperationQuota(M), s.current.setOperationMode(
|
|
4084
4084
|
window.Module.LivenessOperationMode[S]
|
|
4085
|
-
),
|
|
4085
|
+
), C.sid && s.current.setSid(C.sid), C["azure-resource-id"] && s.current.setResourceId(C["azure-resource-id"]);
|
|
4086
4086
|
}
|
|
4087
4087
|
if (g)
|
|
4088
4088
|
s.current.initialize();
|
|
4089
4089
|
else {
|
|
4090
|
-
const
|
|
4091
|
-
livenessError:
|
|
4090
|
+
const C = {
|
|
4091
|
+
livenessError: Fe(
|
|
4092
4092
|
window.Module.LivenessFailureReason,
|
|
4093
4093
|
window.Module.LivenessFailureReason.InvalidToken
|
|
4094
4094
|
),
|
|
4095
|
-
recognitionError:
|
|
4095
|
+
recognitionError: Fe(
|
|
4096
4096
|
window.Module.RecognitionFailureReason,
|
|
4097
4097
|
window.Module.RecognitionFailureReason.None
|
|
4098
4098
|
)
|
|
4099
4099
|
};
|
|
4100
4100
|
r(
|
|
4101
|
-
|
|
4101
|
+
C.livenessError ? Kt[C.livenessError] || C.livenessError : "Something went wrong"
|
|
4102
4102
|
), u();
|
|
4103
4103
|
}
|
|
4104
4104
|
}, f = (m) => {
|
|
@@ -4121,7 +4121,7 @@ function pc(e) {
|
|
|
4121
4121
|
break;
|
|
4122
4122
|
}
|
|
4123
4123
|
if (!a.current && g) {
|
|
4124
|
-
const T =
|
|
4124
|
+
const T = Fe(
|
|
4125
4125
|
window.Module.FeedbackForFace,
|
|
4126
4126
|
$
|
|
4127
4127
|
);
|
|
@@ -4143,11 +4143,11 @@ function pc(e) {
|
|
|
4143
4143
|
]);
|
|
4144
4144
|
if ($) {
|
|
4145
4145
|
const A = {
|
|
4146
|
-
livenessError:
|
|
4146
|
+
livenessError: Fe(
|
|
4147
4147
|
window.Module.LivenessFailureReason,
|
|
4148
4148
|
v.failureReason
|
|
4149
4149
|
),
|
|
4150
|
-
recognitionError:
|
|
4150
|
+
recognitionError: Fe(
|
|
4151
4151
|
window.Module.RecognitionFailureReason,
|
|
4152
4152
|
g.failureReason
|
|
4153
4153
|
)
|
|
@@ -4157,12 +4157,12 @@ function pc(e) {
|
|
|
4157
4157
|
);
|
|
4158
4158
|
} else {
|
|
4159
4159
|
const A = {
|
|
4160
|
-
livenessStatus:
|
|
4160
|
+
livenessStatus: Fe(
|
|
4161
4161
|
window.Module.LivenessStatus,
|
|
4162
4162
|
v.status
|
|
4163
4163
|
),
|
|
4164
4164
|
recognitionResult: {
|
|
4165
|
-
status:
|
|
4165
|
+
status: Fe(
|
|
4166
4166
|
window.Module.RecognitionStatus,
|
|
4167
4167
|
g.status
|
|
4168
4168
|
),
|
|
@@ -4205,7 +4205,7 @@ function pc(e) {
|
|
|
4205
4205
|
destroy: u
|
|
4206
4206
|
};
|
|
4207
4207
|
}
|
|
4208
|
-
const
|
|
4208
|
+
const Cr = "Detecting face...";
|
|
4209
4209
|
function hc({
|
|
4210
4210
|
onImageCaptured: e,
|
|
4211
4211
|
fetchAzureSessionToken: t,
|
|
@@ -4214,22 +4214,22 @@ function hc({
|
|
|
4214
4214
|
onReset: o,
|
|
4215
4215
|
onFailure: i
|
|
4216
4216
|
}) {
|
|
4217
|
-
const [s, a] = x(
|
|
4217
|
+
const [s, a] = x(Cr), [l, u] = x(!1), d = w("findingFace"), c = w(null), f = w(), p = w(!1), [_, y] = x(0), m = w(!1), [v, g] = x(!1);
|
|
4218
4218
|
H(() => {
|
|
4219
4219
|
y(Math.min(window.innerWidth, window.innerHeight) * 0.6);
|
|
4220
4220
|
}, []), H(() => {
|
|
4221
4221
|
n(), t();
|
|
4222
4222
|
}, []);
|
|
4223
4223
|
const $ = pc({
|
|
4224
|
-
onMessage: (
|
|
4225
|
-
d.current === "analyzingLiveness" && a(
|
|
4224
|
+
onMessage: (C) => {
|
|
4225
|
+
d.current === "analyzingLiveness" && a(C);
|
|
4226
4226
|
},
|
|
4227
4227
|
onComplete: () => {
|
|
4228
4228
|
d.current = "done", e(!0);
|
|
4229
4229
|
},
|
|
4230
|
-
onError: (
|
|
4231
|
-
const b = Ql(
|
|
4232
|
-
a(b.message), d.current = "done", u(!0), r && r(
|
|
4230
|
+
onError: (C) => {
|
|
4231
|
+
const b = Ql(C);
|
|
4232
|
+
a(b.message), d.current = "done", u(!0), r && r(C), i({
|
|
4233
4233
|
faceImage: "",
|
|
4234
4234
|
passed: !1,
|
|
4235
4235
|
metadata: {},
|
|
@@ -4237,21 +4237,21 @@ function hc({
|
|
|
4237
4237
|
});
|
|
4238
4238
|
}
|
|
4239
4239
|
}), T = () => {
|
|
4240
|
-
m.current = !1, a(
|
|
4240
|
+
m.current = !1, a(Cr), d.current = "findingFace", c.current = null, $.reset(), f.current && cancelAnimationFrame(f.current), u(!1), o();
|
|
4241
4241
|
}, { detectFaces: S, cleanup: M } = sc({
|
|
4242
4242
|
validations: ["zoom", "features"],
|
|
4243
4243
|
frameSize: _,
|
|
4244
4244
|
livenessTimeout: 1e4,
|
|
4245
|
-
onFace: async (
|
|
4245
|
+
onFace: async (C, b, R) => {
|
|
4246
4246
|
p.current = b, b && d.current === "findingFace" && !m.current && R && (m.current = !0, g(!0));
|
|
4247
4247
|
},
|
|
4248
4248
|
onPhotoSaved: () => {
|
|
4249
4249
|
},
|
|
4250
|
-
onMessage: (
|
|
4251
|
-
d.current === "findingFace" && a(
|
|
4250
|
+
onMessage: (C) => {
|
|
4251
|
+
d.current === "findingFace" && a(C);
|
|
4252
4252
|
},
|
|
4253
|
-
onError: (
|
|
4254
|
-
a(
|
|
4253
|
+
onError: (C) => {
|
|
4254
|
+
a(C), u(!0), r && r(C);
|
|
4255
4255
|
}
|
|
4256
4256
|
});
|
|
4257
4257
|
H(
|
|
@@ -4289,8 +4289,8 @@ function hc({
|
|
|
4289
4289
|
}
|
|
4290
4290
|
})();
|
|
4291
4291
|
}, [v]);
|
|
4292
|
-
const W = (
|
|
4293
|
-
|
|
4292
|
+
const W = (C) => {
|
|
4293
|
+
C.current && (c.current = C.current, A());
|
|
4294
4294
|
};
|
|
4295
4295
|
return H(
|
|
4296
4296
|
() => () => {
|
|
@@ -4364,7 +4364,7 @@ function mc() {
|
|
|
4364
4364
|
clearSavedPhoto: c,
|
|
4365
4365
|
branding: f,
|
|
4366
4366
|
isMobileAppWebView: p
|
|
4367
|
-
} = fe(), [_, y] = x(!1), [m, v] = x(!1), [g, $] = x(null), [T, S] = x(!1), [M, A] = x(!1), [W,
|
|
4367
|
+
} = fe(), [_, y] = x(!1), [m, v] = x(!1), [g, $] = x(null), [T, S] = x(!1), [M, A] = x(!1), [W, C] = x(0), [b, R] = x(null);
|
|
4368
4368
|
H(() => {
|
|
4369
4369
|
const k = t();
|
|
4370
4370
|
n(k);
|
|
@@ -4388,7 +4388,7 @@ function mc() {
|
|
|
4388
4388
|
return;
|
|
4389
4389
|
}
|
|
4390
4390
|
const k = setTimeout(() => {
|
|
4391
|
-
R((
|
|
4391
|
+
R((F) => (F ?? 1) - 1);
|
|
4392
4392
|
}, 1e3);
|
|
4393
4393
|
return () => {
|
|
4394
4394
|
clearTimeout(k);
|
|
@@ -4408,7 +4408,7 @@ function mc() {
|
|
|
4408
4408
|
/* @__PURE__ */ h(ml, {}),
|
|
4409
4409
|
/* @__PURE__ */ h("div", { children: /* @__PURE__ */ h("p", { className: "yvlw-text-xs yvlw-m-0 yvlw-p-0 subtext", children: "You have been given this set of tasks to complete. They are pretty easy to do but we will be guiding you every step of the way." }) }),
|
|
4410
4410
|
/* @__PURE__ */ h("ol", { children: [
|
|
4411
|
-
o.map((k,
|
|
4411
|
+
o.map((k, F) => /* @__PURE__ */ h("li", { className: Q(F), children: el[k.id].name }, `task-${F}`)),
|
|
4412
4412
|
/* @__PURE__ */ h("li", { className: s ? ne.active : "", children: "Complete! 🎉" })
|
|
4413
4413
|
] })
|
|
4414
4414
|
] }),
|
|
@@ -4475,7 +4475,7 @@ function mc() {
|
|
|
4475
4475
|
},
|
|
4476
4476
|
onError: (k) => $(k),
|
|
4477
4477
|
onReset: () => {
|
|
4478
|
-
Xe = null, A(!1),
|
|
4478
|
+
Xe = null, A(!1), C((k) => k + 1), c();
|
|
4479
4479
|
},
|
|
4480
4480
|
onFailure: l
|
|
4481
4481
|
},
|
|
@@ -4483,7 +4483,7 @@ function mc() {
|
|
|
4483
4483
|
) })
|
|
4484
4484
|
}
|
|
4485
4485
|
),
|
|
4486
|
-
o.map((k,
|
|
4486
|
+
o.map((k, F) => {
|
|
4487
4487
|
let N;
|
|
4488
4488
|
switch (k.id) {
|
|
4489
4489
|
case "complete-the-circle":
|
|
@@ -4505,7 +4505,7 @@ function mc() {
|
|
|
4505
4505
|
return /* @__PURE__ */ h(
|
|
4506
4506
|
pe,
|
|
4507
4507
|
{
|
|
4508
|
-
show: m && M && !s && i ===
|
|
4508
|
+
show: m && M && !s && i === F,
|
|
4509
4509
|
appear: !0,
|
|
4510
4510
|
as: "div",
|
|
4511
4511
|
leave: "yvlw-transform yvlw-transition yvlw-duration-300",
|
|
@@ -4516,7 +4516,7 @@ function mc() {
|
|
|
4516
4516
|
className: "yvlw-h-full",
|
|
4517
4517
|
children: N
|
|
4518
4518
|
},
|
|
4519
|
-
`task-${
|
|
4519
|
+
`task-${F}`
|
|
4520
4520
|
);
|
|
4521
4521
|
}),
|
|
4522
4522
|
/* @__PURE__ */ h(
|
|
@@ -4534,8 +4534,8 @@ function mc() {
|
|
|
4534
4534
|
$t,
|
|
4535
4535
|
{
|
|
4536
4536
|
Icon: Wa,
|
|
4537
|
-
title: T ? "All Set!" : "
|
|
4538
|
-
description: T ? "You can now close or exit the window" : "Your
|
|
4537
|
+
title: T ? "All Set!" : "Please click the button below to complete your verification",
|
|
4538
|
+
description: T ? "You can now close or exit the window" : "Your identity has been verified. You must click the button below to submit and finalize the process.",
|
|
4539
4539
|
actionText: b !== null && b > 0 ? `Finish in (${b}s)` : "Finish",
|
|
4540
4540
|
loading: _,
|
|
4541
4541
|
onActionClick: j,
|
|
@@ -4602,7 +4602,7 @@ function _c(e) {
|
|
|
4602
4602
|
sessionToken: _,
|
|
4603
4603
|
forceDevUrl: y,
|
|
4604
4604
|
children: /* @__PURE__ */ h(
|
|
4605
|
-
|
|
4605
|
+
Ca,
|
|
4606
4606
|
{
|
|
4607
4607
|
id: n,
|
|
4608
4608
|
open: u === "page" ? !0 : m,
|