UNPKG

bry-biometric-collector

Version:

BRy web-collector component for biometric capture.

1,582 lines 72.8 kB
import { w as Qt, S as Gt, x as Yt, y as Zt, z as xt, B as k, C as z, D as w, E as X, G as h, H as R, I as O, J as ct, K as he, L as j, M as U, N, O as Xi, $ as Gi, P as Yi, Q as q, R as As, T as Ne, U as P, V as He, W as $t, X as b, Y as B, Z as pe, _ as we, a0 as Q, a1 as ft, a2 as Y, a3 as dt, a4 as Ce, a5 as Pt, a6 as Bt, a7 as Ze, a8 as Ls, a9 as xe, aa as ve, ab as Fs, ac as Fe, ad as Wt, ae as Ti, af as Ss, ag as je, ah as ke, ai as Ns, aj as Ps, ak as Mt, al as Ut, am as de, an as se, ao as Oe, ap as ki, aq as Vt, ar as $e, as as zt, at as Bs, au as et, av as Oi, aw as Ri, ax as Ws, ay as Ms, az as Us, aA as Vs, f as Ii, aB as m, aC as zs, aD as js, aE as Ks, l as ee, aF as Hs, aG as jt, aH as K, m as ut, aI as Kt, aJ as qs, aK as Di, aL as Js, aM as tt, aN as it, aO as Ai, aP as Qs, aQ as st, A as Ht, aR as Re, aS as Xs, aT as Ke, aU as Gs, aV as Li, e as Se, aW as qt, aX as nt, aY as Ys, aZ as Jt, a_ as Zs, a$ as xs, b0 as $s, d as ot, b1 as en, b2 as tn, b3 as sn, b4 as at, b5 as nn, b6 as on, b7 as an, b8 as lt, b9 as re, ba as mt, bb as ln, bc as rn, bd as cn, be as rt, bf as oe, bg as un, bh as fn, bi as Fi, bj as Zi, bk as ht, bl as dn } from "./main_8f1a8854_3.3.6.js"; import { V as hn, C as mn } from "./ValidationAlert_452e8b93_3.3.6.js"; import { detectSingleFace as _n, matchDimensions as bn, resizeResults as gn } from "./face_api_d3d25326_3.3.6.js"; import { F as vn } from "./FaceOval_773deaf4_3.3.6.js"; import { C as pn } from "./CaptureBar_66e29ad8_3.3.6.js"; const Xt = Qt(!1); class wn { isDevToolsOpen = !1; detectionCount = 0; checkSizeTimeout = null; detectionInterval = null; detectDevToolsBySize() { const e = window.outerWidth - window.innerWidth > 200, t = window.outerHeight - window.innerHeight > 200; return e || t; } checkForDevTools = () => { this.detectDevToolsBySize() ? (this.detectionCount++, this.detectionCount >= 2 && !this.isDevToolsOpen && (this.isDevToolsOpen = !0, Xt.set(this.isDevToolsOpen))) : (this.detectionCount = 0, this.isDevToolsOpen && (this.isDevToolsOpen = !1, Xt.set(this.isDevToolsOpen))); }; startDetection() { this.stopDetection(), window.addEventListener("resize", () => { this.checkSizeTimeout && clearTimeout(this.checkSizeTimeout), this.checkSizeTimeout = window.setTimeout(this.checkForDevTools, 500); }), window.addEventListener("focus", () => setTimeout(this.checkForDevTools, 300)), this.detectionInterval = window.setInterval(this.checkForDevTools, 1e3), this.checkForDevTools(); } stopDetection() { this.detectionInterval && (clearInterval(this.detectionInterval), this.detectionInterval = null), this.checkSizeTimeout && (clearTimeout(this.checkSizeTimeout), this.checkSizeTimeout = null); } } function Cn(i) { let e; return { c() { e = w("div"), this.c = X, h(e, "class", "video-overlay z-0"), h( e, "style", /*styleVars*/ i[0] ); }, m(t, o) { k(t, e, o); }, p(t, [o]) { o & /*styleVars*/ 1 && h( e, "style", /*styleVars*/ t[0] ); }, i: X, o: X, d(t) { t && R(e); } }; } function En(i, e, t) { let o, a; O(i, ct, (r) => t(6, a = r)); let c, f, n = 0.8, { overlayColor: l } = e, { overlayTransparency: u } = e; return he() && (n = 0.65), i.$$set = (r) => { "overlayColor" in r && t(1, l = r.overlayColor), "overlayTransparency" in r && t(2, u = r.overlayTransparency); }, i.$$.update = () => { i.$$.dirty & /*$videoStore, percentage, ovalHeight*/ 112 && a && (t(4, f = a.videoHeight * n), t(3, c = f / 1.45)), i.$$.dirty & /*ovalWidth, ovalHeight, overlayColor, overlayTransparency*/ 30 && t(0, o = ` --oval-width: ${c}px; --oval-height: ${f}px; --overlay-color: ${l}; --overlay-transparency: ${u}; `); }, [ o, l, u, c, f, n, a ]; } class xi extends Gt { constructor(e) { super(), Yt( this, { target: this.shadowRoot, props: xt(this.attributes), customElement: !0 }, En, Cn, Zt, { overlayColor: 1, overlayTransparency: 2 }, null ), e && (e.target && k(e.target, this, e.anchor), e.props && (this.$set(e.props), z())); } static get observedAttributes() { return ["overlayColor", "overlayTransparency"]; } get overlayColor() { return this.$$.ctx[1]; } set overlayColor(e) { this.$$set({ overlayColor: e }), z(); } get overlayTransparency() { return this.$$.ctx[2]; } set overlayTransparency(e) { this.$$set({ overlayTransparency: e }), z(); } } customElements.define("overlay-oval", xi); function Si(i) { let e, t, o, a, c, f, n = ( /*$_*/ i[2]("faceCollector.obtainingPicture") + "" ), l; return { c() { e = w("slot"), t = w("div"), o = w("img"), c = N(), f = w("span"), l = P(n), He(o.src, a = $t) || h(o, "src", a), h(o, "alt", "loading gif"), h(o, "class", "m-auto h-[10em] lg:h-[12em]"), h(f, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center"), h(t, "class", "translate-y-1/3 md:translate-y-1/4 xl:translate-y-1/2"), h(e, "name", "loading-camera-gif"), h(e, "class", "block h-[17em] lg:h-[21.6em] xl:h-[30em]"); }, m(u, r) { k(u, e, r), b(e, t), b(t, o), b(t, c), b(t, f), b(f, l); }, p(u, r) { r & /*$_*/ 4 && n !== (n = /*$_*/ u[2]("faceCollector.obtainingPicture") + "") && B(l, n); }, d(u) { u && R(e); } }; } function Ni(i) { let e, t, o, a, c, f; function n(r, d) { return ( /*$isLoading*/ r[5] ? Tn : yn ); } let l = n(i), u = l(i); return { c() { e = w("div"), t = w("slot"), o = w("div"), a = w("img"), f = N(), u.c(), He(a.src, c = $t) || h(a, "src", c), h(a, "alt", "loading gif"), h(a, "class", "m-auto h-[10em] lg:h-[12em]"), h(o, "class", "translate-y-1/3 md:translate-y-1/4 xl:translate-y-1/2"), h(t, "name", "loading-camera-gif"), h(t, "class", "block h-[17em] lg:h-[21.6em] xl:h-[30em]"), h(e, "class", "bg-white absolute inset-0 z-10 flex items-center justify-center"); }, m(r, d) { k(r, e, d), b(e, t), b(t, o), b(o, a), b(o, f), u.m(o, null); }, p(r, d) { l === (l = n(r)) && u ? u.p(r, d) : (u.d(1), u = l(r), u && (u.c(), u.m(o, null))); }, d(r) { r && R(e), u.d(); } }; } function yn(i) { let e, t = ( /*$_*/ i[2]("faceCollector.obtainingPicture") + "" ), o; return { c() { e = w("span"), o = P(t), h(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center"); }, m(a, c) { k(a, e, c), b(e, o); }, p(a, c) { c & /*$_*/ 4 && t !== (t = /*$_*/ a[2]("faceCollector.obtainingPicture") + "") && B(o, t); }, d(a) { a && R(e); } }; } function Tn(i) { let e; return { c() { e = w("span"), e.textContent = "Obtaining photo...", h(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center"); }, m(t, o) { k(t, e, o); }, p: X, d(t) { t && R(e); } }; } function Pi(i) { let e, t, o, a, c; function f(u, r) { return ( /*$isLoading*/ u[5] ? On : kn ); } let n = f(i), l = n(i); return { c() { e = w("slot"), t = w("div"), o = w("img"), c = N(), l.c(), He(o.src, a = $t) || h(o, "src", a), h(o, "alt", "loading gif"), h(o, "class", "m-auto h-[10em] lg:h-[12em]"), h(t, "class", "translate-y-1/3 md:translate-y-1/4 xl:translate-y-1/2"), h(e, "name", "loading-camera-gif"), h(e, "class", "block h-[17em] lg:h-[21.6em] xl:h-[30em]"); }, m(u, r) { k(u, e, r), b(e, t), b(t, o), b(t, c), l.m(t, null); }, p(u, r) { n === (n = f(u)) && l ? l.p(u, r) : (l.d(1), l = n(u), l && (l.c(), l.m(t, null))); }, d(u) { u && R(e), l.d(); } }; } function kn(i) { let e, t = ( /*$_*/ i[2]("faceCollector.initiatingCamera") + "" ), o; return { c() { e = w("span"), o = P(t), h(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center"); }, m(a, c) { k(a, e, c), b(e, o); }, p(a, c) { c & /*$_*/ 4 && t !== (t = /*$_*/ a[2]("faceCollector.initiatingCamera") + "") && B(o, t); }, d(a) { a && R(e); } }; } function On(i) { let e; return { c() { e = w("span"), e.textContent = "Loading camera...", h(e, "class", "2xl:text-2xl lg:text-2xl text-md block p-2 m-auto text-center"); }, m(t, o) { k(t, e, o); }, p: X, d(t) { t && R(e); } }; } function Rn(i) { let e = j() && /*waitingIdrndCaptureEvent*/ i[0], t, o, a = (j() && /*idrndLoading*/ (i[1] || !/*$ready*/ i[6]) || !j() && !/*$ready*/ i[6]) && /*$cameraStatusStore*/ i[4] === U.OK, c, f = e && Si(i), n = ( /*$detectingFace*/ i[3] && /*$cameraStatusStore*/ i[4] === U.OK && Ni(i) ), l = a && Pi(i); return { c() { f && f.c(), t = N(), n && n.c(), o = N(), l && l.c(), c = Xi(), this.c = X; }, m(u, r) { f && f.m(u, r), k(u, t, r), n && n.m(u, r), k(u, o, r), l && l.m(u, r), k(u, c, r); }, p(u, [r]) { r & /*waitingIdrndCaptureEvent*/ 1 && (e = j() && /*waitingIdrndCaptureEvent*/ u[0]), e ? f ? f.p(u, r) : (f = Si(u), f.c(), f.m(t.parentNode, t)) : f && (f.d(1), f = null), /*$detectingFace*/ u[3] && /*$cameraStatusStore*/ u[4] === U.OK ? n ? n.p(u, r) : (n = Ni(u), n.c(), n.m(o.parentNode, o)) : n && (n.d(1), n = null), r & /*idrndLoading, $ready, $cameraStatusStore*/ 82 && (a = (j() && /*idrndLoading*/ (u[1] || !/*$ready*/ u[6]) || !j() && !/*$ready*/ u[6]) && /*$cameraStatusStore*/ u[4] === U.OK), a ? l ? l.p(u, r) : (l = Pi(u), l.c(), l.m(c.parentNode, c)) : l && (l.d(1), l = null); }, i: X, o: X, d(u) { f && f.d(u), u && R(t), n && n.d(u), u && R(o), l && l.d(u), u && R(c); } }; } function In(i, e, t) { let o, a, c, f, n; O(i, Gi, (r) => t(2, o = r)), O(i, Yi, (r) => t(3, a = r)), O(i, q, (r) => t(4, c = r)), O(i, As, (r) => t(5, f = r)), O(i, Ne, (r) => t(6, n = r)); let { waitingIdrndCaptureEvent: l } = e, { idrndLoading: u } = e; return i.$$set = (r) => { "waitingIdrndCaptureEvent" in r && t(0, l = r.waitingIdrndCaptureEvent), "idrndLoading" in r && t(1, u = r.idrndLoading); }, [ l, u, o, a, c, f, n ]; } class $i extends Gt { constructor(e) { super(), Yt( this, { target: this.shadowRoot, props: xt(this.attributes), customElement: !0 }, In, Rn, Zt, { waitingIdrndCaptureEvent: 0, idrndLoading: 1 }, null ), e && (e.target && k(e.target, this, e.anchor), e.props && (this.$set(e.props), z())); } static get observedAttributes() { return ["waitingIdrndCaptureEvent", "idrndLoading"]; } get waitingIdrndCaptureEvent() { return this.$$.ctx[0]; } set waitingIdrndCaptureEvent(e) { this.$$set({ waitingIdrndCaptureEvent: e }), z(); } get idrndLoading() { return this.$$.ctx[1]; } set idrndLoading(e) { this.$$set({ idrndLoading: e }), z(); } } customElements.define("loading-component", $i); function Bi(i, e, t) { const o = i.slice(); return o[123] = e[t], o; } function Wi(i, e, t) { const o = i.slice(); return o[123] = e[t], o; } function Mi(i) { let e, t, o = j(), a, c, f, n, l, u, r, d, g, _, y, p, v, C, I, L, G, ae = o && Dn(i), H = ( /*$ready*/ i[24] && !/*$detectingFace*/ i[28] && Ui(i) ); return _ = new an({}), p = new pn({ props: { showConfigButton: ( /*showConfigButton*/ i[4] ), showAutoCaptureButton: ( /*showAutoCaptureButton*/ i[5] ), showCaptureButton: ( /*showCaptureButton*/ i[0] ), showCameraButton: ( /*showCameraButton*/ i[6] ), enableCaptureButton: ( /*enableCaptureButton*/ i[18] ), videoOverlay: ( /*videoOverlay*/ i[9] ), videoOverlayTransparency: ( /*videoOverlayTransparency*/ i[10] ), idrndClosed: ( /*idrndClosed*/ i[20] ), idrndLoading: ( /*idrndLoading*/ i[19] ), waitingIdrndCaptureEvent: ( /*waitingIdrndCaptureEvent*/ i[21] ), handler: ( /*capture*/ i[13] ) } }), { c() { e = w("div"), t = w("div"), ae && ae.c(), a = N(), c = w("video"), n = N(), l = w("canvas"), u = N(), r = w("div"), d = w("div"), H && H.c(), g = N(), pe(_.$$.fragment), y = N(), pe(p.$$.fragment), h(c, "id", "bry-cc-camera-video-tag"), h(c, "class", f = /*$ready*/ i[24] ? he() ? "absolute inset-0 -scale-x-100" : "w-full h-full object-cover -scale-x-100" : "w-0 h-0"), c.playsInline = !0, c.muted = !0, c.autoplay = !0, h(l, "id", "bry-ce-detectionsCanvas"), h(l, "class", "absolute top-0 left-0 max-w-full -scale-x-100"), h(t, "class", "overflow-hidden"), lt( t, "width", /*$videoStore*/ i[27].videoWidth + "px" ), lt( t, "height", /*$videoStore*/ i[27].videoHeight + "px" ), h(d, "class", "flex flex-grow w-full items-center justify-center relative"), h(r, "class", "absolute inset-0 flex flex-col items-center justify-between w-full h-full"), h(e, "class", v = /*$ready*/ i[24] ? "relative" : "relative w-0 h-0"), e.hidden = C = /*$cameraStatusStore*/ i[23] !== U.OK || j() && /*idrndLoading*/ (i[19] || /*idrndClosed*/ i[20] || /*waitingIdrndCaptureEvent*/ i[21]); }, m(D, W) { k(D, e, W), b(e, t), ae && ae.m(t, null), b(t, a), b(t, c), i[51](c), b(t, n), b(t, l), i[53](l), b(e, u), b(e, r), b(r, d), H && H.m(d, null), b(r, g), we(_, r, null), b(r, y), we(p, r, null), I = !0, L || (G = [ re( c, "canplay", /*canplay_handler*/ i[52] ), re( c, "play", /*play*/ i[12], { once: !0 } ) ], L = !0); }, p(D, W) { o && ae.p(D, W), (!I || W[0] & /*$ready*/ 16777216 && f !== (f = /*$ready*/ D[24] ? he() ? "absolute inset-0 -scale-x-100" : "w-full h-full object-cover -scale-x-100" : "w-0 h-0")) && h(c, "class", f), (!I || W[0] & /*$videoStore*/ 134217728) && lt( t, "width", /*$videoStore*/ D[27].videoWidth + "px" ), (!I || W[0] & /*$videoStore*/ 134217728) && lt( t, "height", /*$videoStore*/ D[27].videoHeight + "px" ), /*$ready*/ D[24] && !/*$detectingFace*/ D[28] ? H ? (H.p(D, W), W[0] & /*$ready, $detectingFace*/ 285212672 && Q(H, 1)) : (H = Ui(D), H.c(), Q(H, 1), H.m(d, null)) : H && (ft(), Y(H, 1, 1, () => { H = null; }), dt()); const S = {}; W[0] & /*showConfigButton*/ 16 && (S.showConfigButton = /*showConfigButton*/ D[4]), W[0] & /*showAutoCaptureButton*/ 32 && (S.showAutoCaptureButton = /*showAutoCaptureButton*/ D[5]), W[0] & /*showCaptureButton*/ 1 && (S.showCaptureButton = /*showCaptureButton*/ D[0]), W[0] & /*showCameraButton*/ 64 && (S.showCameraButton = /*showCameraButton*/ D[6]), W[0] & /*enableCaptureButton*/ 262144 && (S.enableCaptureButton = /*enableCaptureButton*/ D[18]), W[0] & /*videoOverlay*/ 512 && (S.videoOverlay = /*videoOverlay*/ D[9]), W[0] & /*videoOverlayTransparency*/ 1024 && (S.videoOverlayTransparency = /*videoOverlayTransparency*/ D[10]), W[0] & /*idrndClosed*/ 1048576 && (S.idrndClosed = /*idrndClosed*/ D[20]), W[0] & /*idrndLoading*/ 524288 && (S.idrndLoading = /*idrndLoading*/ D[19]), W[0] & /*waitingIdrndCaptureEvent*/ 2097152 && (S.waitingIdrndCaptureEvent = /*waitingIdrndCaptureEvent*/ D[21]), p.$set(S), (!I || W[0] & /*$ready*/ 16777216 && v !== (v = /*$ready*/ D[24] ? "relative" : "relative w-0 h-0")) && h(e, "class", v), (!I || W[0] & /*$cameraStatusStore, idrndLoading, idrndClosed, waitingIdrndCaptureEvent*/ 12058624 && C !== (C = /*$cameraStatusStore*/ D[23] !== U.OK || j() && /*idrndLoading*/ (D[19] || /*idrndClosed*/ D[20] || /*waitingIdrndCaptureEvent*/ D[21]))) && (e.hidden = C); }, i(D) { I || (Q(H), Q(_.$$.fragment, D), Q(p.$$.fragment, D), I = !0); }, o(D) { Y(H), Y(_.$$.fragment, D), Y(p.$$.fragment, D), I = !1; }, d(D) { D && R(e), ae && ae.d(), i[51](null), i[53](null), H && H.d(), Ce(_), Ce(p), L = !1, mt(G); } }; } function Dn(i) { let e; return { c() { e = w("idlive-face-capture"), e.hidden = !0, oe(e, "mask_hidden", ""), oe(e, "auto_capture_disabled", ""), oe(e, "auto_close_disabled", ""), oe( e, "device_id", /*$selectedVideoDeviceId*/ i[25] ), oe(e, "face_not_centered_check_enabled", ""), oe(e, "sunglasses_detected_check_enabled", ""), oe(e, "mouth_open_check_enabled", ""), oe(e, "face_blurry_check_enabled", ""), oe(e, "dark_image_check_enabled", ""), oe(e, "eyes_closed_check_enabled", ""), oe( e, "payload_size", /*livenessBlobSize*/ i[11] ); }, m(t, o) { k(t, e, o), i[50](e); }, p(t, o) { o[0] & /*$selectedVideoDeviceId*/ 33554432 && oe( e, "device_id", /*$selectedVideoDeviceId*/ t[25] ), o[0] & /*livenessBlobSize*/ 2048 && oe( e, "payload_size", /*livenessBlobSize*/ t[11] ); }, d(t) { t && R(e), i[50](null); } }; } function Ui(i) { let e, t, o, a, c, f; return e = new hn({ props: { isCountingDown: ( /*isCountingDown*/ i[17] ) } }), o = new vn({ props: { loading: ( /*isCountingDown*/ i[17] ), showWatermark: ( /*showWatermark*/ i[8] ) } }), c = new xi({ props: { overlayColor: ( /*videoOverlay*/ i[9] ), overlayTransparency: ( /*videoOverlayTransparency*/ i[10] ) } }), { c() { pe(e.$$.fragment), t = N(), pe(o.$$.fragment), a = N(), pe(c.$$.fragment); }, m(n, l) { we(e, n, l), k(n, t, l), we(o, n, l), k(n, a, l), we(c, n, l), f = !0; }, p(n, l) { const u = {}; l[0] & /*isCountingDown*/ 131072 && (u.isCountingDown = /*isCountingDown*/ n[17]), e.$set(u); const r = {}; l[0] & /*isCountingDown*/ 131072 && (r.loading = /*isCountingDown*/ n[17]), l[0] & /*showWatermark*/ 256 && (r.showWatermark = /*showWatermark*/ n[8]), o.$set(r); const d = {}; l[0] & /*videoOverlay*/ 512 && (d.overlayColor = /*videoOverlay*/ n[9]), l[0] & /*videoOverlayTransparency*/ 1024 && (d.overlayTransparency = /*videoOverlayTransparency*/ n[10]), c.$set(d); }, i(n) { f || (Q(e.$$.fragment, n), Q(o.$$.fragment, n), Q(c.$$.fragment, n), f = !0); }, o(n) { Y(e.$$.fragment, n), Y(o.$$.fragment, n), Y(c.$$.fragment, n), f = !1; }, d(n) { Ce(e, n), n && R(t), Ce(o, n), n && R(a), Ce(c, n); } }; } function Vi(i) { let e, t, o = ( /*$_*/ i[33]("faceCollector.finish") + "" ), a, c, f, n, l = ( /*$_*/ i[33]("faceCollector.retakePhoto") + "" ), u, r, d; return { c() { e = w("div"), t = w("button"), a = P(o), f = N(), n = w("button"), u = P(l), t.disabled = c = /*$justification*/ i[30].length === 0, h(t, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), h(n, "id", "bry-cc-retake-button"), h(n, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), h(e, "class", "ce-dui-btn-group flex"); }, m(g, _) { k(g, e, _), b(e, t), b(t, a), b(e, f), b(e, n), b(n, u), r || (d = [ re( t, "click", /*click_handler*/ i[54] ), re( n, "click", /*click_handler_1*/ i[55] ) ], r = !0); }, p(g, _) { _[1] & /*$_*/ 4 && o !== (o = /*$_*/ g[33]("faceCollector.finish") + "") && B(a, o), _[0] & /*$justification*/ 1073741824 && c !== (c = /*$justification*/ g[30].length === 0) && (t.disabled = c), _[1] & /*$_*/ 4 && l !== (l = /*$_*/ g[33]("faceCollector.retakePhoto") + "") && B(u, l); }, d(g) { g && R(e), r = !1, mt(d); } }; } function An(i) { let e, t; return e = new mn({ props: { handler: ( /*func*/ i[64] ) } }), { c() { pe(e.$$.fragment); }, m(o, a) { we(e, o, a), t = !0; }, p: X, i(o) { t || (Q(e.$$.fragment, o), t = !0); }, o(o) { Y(e.$$.fragment, o), t = !1; }, d(o) { Ce(e, o); } }; } function Ln(i) { let e, t, o, a, c, f, n, l, u; const r = [ Bn, Pn, Nn, Sn, Fn ], d = []; function g(_, y) { return ( /*$captured*/ _[26] ? ( /*$unconformitiesStore*/ _[34].isLoading ? 1 : ( /*$requestResult*/ _[32] !== K.OK ? 2 : ( /*$saved*/ _[29] ? 4 : 3 ) ) ) : 0 ); } return f = g(i), n = d[f] = r[f](i), { c() { e = w("div"), t = w("img"), c = N(), n.c(), h(t, "class", "m-auto col-start-1 col-end-1 max-h-[23.2em]"), He(t.src, o = /*$dataTypePrefix*/ i[35] + "," + /*$image*/ i[31]) || h(t, "src", o), t.hidden = a = !/*$captured*/ i[26] || !/*$showFaceWhileValidating*/ i[36] && /*$unconformitiesStore*/ i[34].isLoading, h(t, "alt", ""), h(e, "class", l = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (!/*$showFaceWhileValidating*/ i[36] && /*$unconformitiesStore*/ i[34].isLoading ? "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible" : "grid overflow-hidden")); }, m(_, y) { k(_, e, y), b(e, t), b(e, c), d[f].m(e, null), u = !0; }, p(_, y) { (!u || y[1] & /*$dataTypePrefix, $image*/ 17 && !He(t.src, o = /*$dataTypePrefix*/ _[35] + "," + /*$image*/ _[31])) && h(t, "src", o), (!u || y[0] & /*$captured*/ 67108864 | y[1] & /*$showFaceWhileValidating, $unconformitiesStore*/ 40 && a !== (a = !/*$captured*/ _[26] || !/*$showFaceWhileValidating*/ _[36] && /*$unconformitiesStore*/ _[34].isLoading)) && (t.hidden = a); let p = f; f = g(_), f === p ? d[f].p(_, y) : (ft(), Y(d[p], 1, 1, () => { d[p] = null; }), dt(), n = d[f], n ? n.p(_, y) : (n = d[f] = r[f](_), n.c()), Q(n, 1), n.m(e, null)), (!u || y[1] & /*$showFaceWhileValidating, $unconformitiesStore*/ 40 && l !== (l = "grid-cols-1 grid-rows-2 sm:grid-cols-2 sm:grid-rows-1 gap-[.5em] " + (!/*$showFaceWhileValidating*/ _[36] && /*$unconformitiesStore*/ _[34].isLoading ? "absolute -translate-y-1/2 -translate-x-1/2 top-1/2 left-1/2 overflow-visible" : "grid overflow-hidden"))) && h(e, "class", l); }, i(_) { u || (Q(n), u = !0); }, o(_) { Y(n), u = !1; }, d(_) { _ && R(e), d[f].d(); } }; } function Fn(i) { let e, t, o = ( /*$_*/ i[33]("faceCollector.captured") + "" ), a, c, f, n, l, u = ( /*$_*/ i[33]("faceCollector.retakePhoto") + "" ), r, d, g = ut(un).faceStrategy !== fn.DISABLED, _, y, p, v = ( /*$unconformitiesStore*/ i[34].unconformities.length !== 0 && zi(i) ), C = g && Wn(); return { c() { e = w("div"), t = w("h1"), a = P(o), c = N(), v && v.c(), f = N(), n = w("div"), l = w("button"), r = P(u), d = N(), C && C.c(), h(t, "class", "text-3xl font-bold pb-[1em] transition-opacity"), h(l, "id", "bry-cc-retake-button"), h(l, "class", "ce-dui-btn ce-dui-btn-block flex-shrink text-base"), h(n, "class", "flex flex-row"), Fi(n, "ce-dui-btn-group", !/*$exportButtonDisabled*/ i[37]); }, m(I, L) { k(I, e, L), b(e, t), b(t, a), b(e, c), v && v.m(e, null), b(e, f), b(e, n), b(n, l), b(l, r), b(n, d), C && C.m(n, null), _ = !0, y || (p = re( l, "click", /*click_handler_6*/ i[63] ), y = !0); }, p(I, L) { (!_ || L[1] & /*$_*/ 4) && o !== (o = /*$_*/ I[33]("faceCollector.captured") + "") && B(a, o), /*$unconformitiesStore*/ I[34].unconformities.length !== 0 ? v ? v.p(I, L) : (v = zi(I), v.c(), v.m(e, f)) : v && (v.d(1), v = null), (!_ || L[1] & /*$_*/ 4) && u !== (u = /*$_*/ I[33]("faceCollector.retakePhoto") + "") && B(r, u), (!_ || L[1] & /*$exportButtonDisabled*/ 64) && Fi(n, "ce-dui-btn-group", !/*$exportButtonDisabled*/ I[37]); }, i(I) { _ || (Q(C), _ = !0); }, o(I) { Y(C), _ = !1; }, d(I) { I && R(e), v && v.d(), C && C.d(), y = !1, p(); } }; } function Sn(i) { let e, t, o = ( /*evaluatePhoto*/ (i[2] ? ( /*$unconformitiesStore*/ i[34].unconformities.length === 0 ? ( /*$_*/ i[33]("faceCollector.everythingOk") ) : ( /*$_*/ i[33]("faceCollector.unconformities") ) ) : ( /*$_*/ i[33]("faceCollector.previewCapture") )) + "" ), a, c, f, n, l, u, r = ( /*$unconformitiesStore*/ i[34].unconformities ), d = []; for (let p = 0; p < r.length; p += 1) d[p] = ji(Bi(i, r, p)); let g = ( /*evaluatePhoto*/ i[2] && /*$unconformitiesStore*/ i[34].unconformities.length == 0 && Ki(i) ), _ = ( /*showJustificationField*/ i[7] && /*$unconformitiesStore*/ i[34].unconformities.length > 0 && Hi(i) ), y = ( /*$captured*/ i[26] && qi(i) ); return { c() { e = w("div"), t = w("h1"), a = P(o), c = N(), f = w("div"); for (let p = 0; p < d.length; p += 1) d[p].c(); n = N(), g && g.c(), l = N(), _ && _.c(), u = N(), y && y.c(), h(t, "class", "text-3xl font-bold transition-opacity"), h(f, "class", "flex flex-wrap"), h(e, "class", "flex flex-col justify-between"); }, m(p, v) { k(p, e, v), b(e, t), b(t, a), b(e, c), b(e, f); for (let C = 0; C < d.length; C += 1) d[C] && d[C].m(f, null); b(f, n), g && g.m(f, null), b(e, l), _ && _.m(e, null), b(e, u), y && y.m(e, null); }, p(p, v) { if (v[0] & /*evaluatePhoto*/ 4 | v[1] & /*$unconformitiesStore, $_*/ 12 && o !== (o = /*evaluatePhoto*/ (p[2] ? ( /*$unconformitiesStore*/ p[34].unconformities.length === 0 ? ( /*$_*/ p[33]("faceCollector.everythingOk") ) : ( /*$_*/ p[33]("faceCollector.unconformities") ) ) : ( /*$_*/ p[33]("faceCollector.previewCapture") )) + "") && B(a, o), v[1] & /*$unconformitiesStore*/ 8) { r = /*$unconformitiesStore*/ p[34].unconformities; let C; for (C = 0; C < r.length; C += 1) { const I = Bi(p, r, C); d[C] ? d[C].p(I, v) : (d[C] = ji(I), d[C].c(), d[C].m(f, n)); } for (; C < d.length; C += 1) d[C].d(1); d.length = r.length; } /*evaluatePhoto*/ p[2] && /*$unconformitiesStore*/ p[34].unconformities.length == 0 ? g ? g.p(p, v) : (g = Ki(p), g.c(), g.m(f, null)) : g && (g.d(1), g = null), /*showJustificationField*/ p[7] && /*$unconformitiesStore*/ p[34].unconformities.length > 0 ? _ ? _.p(p, v) : (_ = Hi(p), _.c(), _.m(e, u)) : _ && (_.d(1), _ = null), /*$captured*/ p[26] ? y ? y.p(p, v) : (y = qi(p), y.c(), y.m(e, null)) : y && (y.d(1), y = null); }, i: X, o: X, d(p) { p && R(e), Zi(d, p), g && g.d(), _ && _.d(), y && y.d(); } }; } function Nn(i) { let e, t, o, a, c = ( /*$_*/ i[33]("faceCollector.finish") + "" ), f, n, l, u = ( /*$_*/ i[33]("faceCollector.retakePhoto") + "" ), r, d, g; function _(v, C) { return ( /*$requestResult*/ v[32] === K.LIVENESS_DETECTION_FAILURE || /*$requestResult*/ v[32] === K.UNKNOWN_LIVENESS_ERROR ? Hn : ( /*$requestResult*/ v[32] === K.LOW_LIVENESS_SCORE ? Kn : ( /*$requestResult*/ v[32] === K.TEMPLATE_EXTRACTION_ERROR || /*$requestResult*/ v[32] === K.UNKNOWN_TEMPLATE_EXTRACTION_ERROR ? jn : ( /*$requestResult*/ v[32] === K.UNABLE_TO_COMMUNICATE_WITH_TEMPLATE_EXTRACTION_SERVICE ? zn : ( /*$requestResult*/ v[32] === K.LIVENESS_EVALUATION_ERROR ? Vn : ( /*$requestResult*/ v[32] === K.INSUFFICIENT_FACE_QUALITY ? Un : Mn ) ) ) ) ) ); } let y = _(i), p = y(i); return { c() { e = w("div"), p.c(), t = N(), o = w("div"), a = w("button"), f = P(c), n = N(), l = w("button"), r = P(u), a.disabled = !0, h(a, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink"), h(l, "id", "bry-cc-retake-button"), h(l, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink"), h(o, "class", "ce-dui-btn-group flex"), h(e, "class", "flex flex-col justify-between"); }, m(v, C) { k(v, e, C), p.m(e, null), b(e, t), b(e, o), b(o, a), b(a, f), b(o, n), b(o, l), b(l, r), d || (g = [ re( a, "click", /*click_handler_2*/ i[57] ), re( l, "click", /*click_handler_3*/ i[58] ) ], d = !0); }, p(v, C) { y === (y = _(v)) && p ? p.p(v, C) : (p.d(1), p = y(v), p && (p.c(), p.m(e, t))), C[1] & /*$_*/ 4 && c !== (c = /*$_*/ v[33]("faceCollector.finish") + "") && B(f, c), C[1] & /*$_*/ 4 && u !== (u = /*$_*/ v[33]("faceCollector.retakePhoto") + "") && B(r, u); }, i: X, o: X, d(v) { v && R(e), p.d(), d = !1, mt(g); } }; } function Pn(i) { let e, t, o = ( /*$_*/ i[33]("faceCollector.validating") + "" ), a, c, f; return { c() { e = w("div"), t = w("h1"), a = P(o), c = N(), f = w("div"), h(t, "class", "inline-block text-3xl font-bold pb-[1em] transition-opacity"), h(f, "class", "ml-6 inline-block dot-typing"), h(e, "class", "min-w-[200px]"); }, m(n, l) { k(n, e, l), b(e, t), b(t, a), b(e, c), b(e, f); }, p(n, l) { l[1] & /*$_*/ 4 && o !== (o = /*$_*/ n[33]("faceCollector.validating") + "") && B(a, o); }, i: X, o: X, d(n) { n && R(e); } }; } function Bn(i) { let e; return { c() { e = w("div"), h(e, "class", ""); }, m(t, o) { k(t, e, o); }, p: X, i: X, o: X, d(t) { t && R(e); } }; } function zi(i) { let e, t, o = ( /*$_*/ i[33]("faceCollector.justification") + "" ), a, c, f, n, l; return { c() { e = w("label"), t = w("span"), a = P(o), c = N(), f = w("textarea"), h(t, "class", "ce-dui-label-text text-base"), h(e, "class", "ce-dui-label"), h(e, "for", "justification"), h(f, "contenteditable", ""), h(f, "id", "justification"), h(f, "class", "ce-dui-textarea ce-dui-textarea-bordered textarea-ghost h-[6em] w-full text-base"); }, m(u, r) { k(u, e, r), b(e, t), b(t, a), k(u, c, r), k(u, f, r), ht( f, /*$justification*/ i[30] ), n || (l = re( f, "input", /*textarea_input_handler_1*/ i[62] ), n = !0); }, p(u, r) { r[1] & /*$_*/ 4 && o !== (o = /*$_*/ u[33]("faceCollector.justification") + "") && B(a, o), r[0] & /*$justification*/ 1073741824 && ht( f, /*$justification*/ u[30] ); }, d(u) { u && R(e), u && R(c), u && R(f), n = !1, l(); } }; } function Wn(i) { let e, t; return e = new dn({ props: { cssClass: "ce-dui-btn-block flex-shrink" } }), { c() { pe(e.$$.fragment); }, m(o, a) { we(e, o, a), t = !0; }, i(o) { t || (Q(e.$$.fragment, o), t = !0); }, o(o) { Y(e.$$.fragment, o), t = !1; }, d(o) { Ce(e, o); } }; } function ji(i) { let e, t = ( /*unconformity*/ i[123] + "" ), o; return { c() { e = w("div"), o = P(t), h(e, "class", "ce-dui-badge ce-dui-badge-lg h-[2em] ce-dui-badge-error text-xl pb-[.25em] m-[.5em]"); }, m(a, c) { k(a, e, c), b(e, o); }, p(a, c) { c[1] & /*$unconformitiesStore*/ 8 && t !== (t = /*unconformity*/ a[123] + "") && B(o, t); }, d(a) { a && R(e); } }; } function Ki(i) { let e, t = ( /*$_*/ i[33]("faceCollector.noNonconformity") + "" ), o; return { c() { e = w("div"), o = P(t), h(e, "class", "ce-dui-badge ce-dui-badge-lg h-[2em] ce-dui-badge-info text-xl pb-[.25em] m-[.5em]"); }, m(a, c) { k(a, e, c), b(e, o); }, p(a, c) { c[1] & /*$_*/ 4 && t !== (t = /*$_*/ a[33]("faceCollector.noNonconformity") + "") && B(o, t); }, d(a) { a && R(e); } }; } function Hi(i) { let e, t, o, a = ( /*$_*/ i[33]("faceCollector.provideAReasonForTheLowQualityCapture") + "" ), c, f, n, l, u, r, d, g, _ = ( /*$_*/ i[33]("faceCollector.thisInformationIsRequired") + "" ), y, p, v, C; return { c() { e = w("div"), t = w("label"), o = w("span"), c = P(a), f = N(), n = w("textarea"), u = N(), r = w("label"), d = w("span"), g = P("("), y = P(_), p = P(")"), h(o, "class", "ce-dui-label-text text-base"), h(t, "class", "ce-dui-label"), h(t, "for", "justification"), h(n, "contenteditable", ""), h(n, "id", "justification"), h(n, "class", "ce-dui-textarea ce-dui-textarea-bordered h-[6em] text-base"), h(n, "placeholder", l = /*$_*/ i[33]("faceCollector.yourJustification")), h(d, "class", "ce-dui-label-text-alt text-base"), h(r, "class", "ce-dui-label"), h(r, "for", "justification"), h(e, "class", "ce-dui-form-control"); }, m(I, L) { k(I, e, L), b(e, t), b(t, o), b(o, c), b(e, f), b(e, n), ht( n, /*$justification*/ i[30] ), b(e, u), b(e, r), b(r, d), b(d, g), b(d, y), b(d, p), v || (C = re( n, "input", /*textarea_input_handler*/ i[59] ), v = !0); }, p(I, L) { L[1] & /*$_*/ 4 && a !== (a = /*$_*/ I[33]("faceCollector.provideAReasonForTheLowQualityCapture") + "") && B(c, a), L[1] & /*$_*/ 4 && l !== (l = /*$_*/ I[33]("faceCollector.yourJustification")) && h(n, "placeholder", l), L[0] & /*$justification*/ 1073741824 && ht( n, /*$justification*/ I[30] ), L[1] & /*$_*/ 4 && _ !== (_ = /*$_*/ I[33]("faceCollector.thisInformationIsRequired") + "") && B(y, _); }, d(I) { I && R(e), v = !1, C(); } }; } function qi(i) { let e, t, o = ( /*$_*/ i[33]("faceCollector.finish") + "" ), a, c, f, n, l = ( /*$_*/ i[33]("faceCollector.retakePhoto") + "" ), u, r, d; return { c() { e = w("div"), t = w("button"), a = P(o), f = N(), n = w("button"), u = P(l), t.disabled = c = /*evaluatePhoto*/ i[2] && /*showJustificationField*/ i[7] && /*$justification*/ i[30].length === 0 && /*$unconformitiesStore*/ i[34].unconformities.length !== 0, h(t, "class", "ce-dui-btn ce-dui-btn-primary ce-dui-btn-block flex-shrink text-base"), h(n, "id", "bry-cc-retake-button"), h(n, "class", "ce-dui-btn ce-dui-btn-block ce-dui-btn-outline flex-shrink text-base"), h(e, "class", "ce-dui-btn-group flex"); }, m(g, _) { k(g, e, _), b(e, t), b(t, a), b(e, f), b(e, n), b(n, u), r || (d = [ re( t, "click", /*click_handler_4*/ i[60] ), re( n, "click", /*click_handler_5*/ i[61] ) ], r = !0); }, p(g, _) { _[1] & /*$_*/ 4 && o !== (o = /*$_*/ g[33]("faceCollector.finish") + "") && B(a, o), _[0] & /*evaluatePhoto, showJustificationField, $justification*/ 1073741956 | _[1] & /*$unconformitiesStore*/ 8 && c !== (c = /*evaluatePhoto*/ g[2] && /*showJustificationField*/ g[7] && /*$justification*/ g[30].length === 0 && /*$unconformitiesStore*/ g[34].unconformities.length !== 0) && (t.disabled = c), _[1] & /*$_*/ 4 && l !== (l = /*$_*/ g[33]("faceCollector.retakePhoto") + "") && B(u, l); }, d(g) { g && R(e), r = !1, mt(d); } }; } function Mn(i) { let e, t = ( /*$_*/ i[33]("faceCollector.everythingOk") + "" ), o; return { c() { e = w("h1"), o = P(t), h(e, "class", "text-3xl font-bold pb-[1em] transition-opacity"); }, m(a, c) { k(a, e, c), b(e, o); }, p(a, c) { c[1] & /*$_*/ 4 && t !== (t = /*$_*/ a[33]("faceCollector.everythingOk") + "") && B(o, t); }, d(a) { a && R(e); } }; } function Un(i) { let e, t, o, a, c = ( /*$_*/ i[33]("liveness.error.faceQualityInsufficient") + "" ), f, n = ( /*$unconformitiesStore*/ i[34].unconformities ), l = []; for (let r = 0; r < n.length; r += 1) l[r] = Ji(Wi(i, n, r)); let u = ( /*evaluatePhoto*/ i[2] && /*$unconformitiesStore*/ i[34].unconformities.length == 0 && Qi(i) ); return { c() { e = w("div"); for (let r = 0; r < l.length; r += 1) l[r].c(); t = N(), u && u.c(), o = N(), a = w("h1"), f = P(c), h(e, "class", "flex flex-wrap"), h(a, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error"); }, m(r, d) { k(r, e, d); for (let g = 0; g < l.length; g += 1) l[g] && l[g].m(e, null); b(e, t), u && u.m(e, null), k(r, o, d), k(r, a, d), b(a, f); }, p(r, d) { if (d[1] & /*$unconformitiesStore*/ 8) { n = /*$unconformitiesStore*/ r[34].unconformities; let g; for (g = 0; g < n.length; g += 1) { const _ = Wi(r, n, g); l[g] ? l[g].p(_, d) : (l[g] = Ji(_), l[g].c(), l[g].m(e, t)); } for (; g < l.length; g += 1) l[g].d(1); l.length = n.length; } /*evaluatePhoto*/ r[2] && /*$unconformitiesStore*/ r[34].unconformities.length == 0 ? u ? u.p(r, d) : (u = Qi(r), u.c(), u.m(e, null)) : u && (u.d(1), u = null), d[1] & /*$_*/ 4 && c !== (c = /*$_*/ r[33]("liveness.error.faceQualityInsufficient") + "") && B(f, c); }, d(r) { r && R(e), Zi(l, r), u && u.d(), r && R(o), r && R(a); } }; } function Vn(i) { let e, t = ( /*$_*/ i[33]("liveness.error.evaluationError") + "" ), o; return { c() { e = w("h1"), o = P(t), h(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error"); }, m(a, c) { k(a, e, c), b(e, o); }, p(a, c) { c[1] & /*$_*/ 4 && t !== (t = /*$_*/ a[33]("liveness.error.evaluationError") + "") && B(o, t); }, d(a) { a && R(e); } }; } function zn(i) { let e, t = ( /*$_*/ i[33]("faceCollector.unableToCompleteRequest") + "" ), o; return { c() { e = w("h1"), o = P(t), h(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error"); }, m(a, c) { k(a, e, c), b(e, o); }, p(a, c) { c[1] & /*$_*/ 4 && t !== (t = /*$_*/ a[33]("faceCollector.unableToCompleteRequest") + "") && B(o, t); }, d(a) { a && R(e); } }; } function jn(i) { let e, t = ( /*$_*/ i[33]("faceCollector.lowQualityCapture") + "" ), o; return { c() { e = w("h1"), o = P(t), h(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error"); }, m(a, c) { k(a, e, c), b(e, o); }, p(a, c) { c[1] & /*$_*/ 4 && t !== (t = /*$_*/ a[33]("faceCollector.lowQualityCapture") + "") && B(o, t); }, d(a) { a && R(e); } }; } function Kn(i) { let e, t = ( /*$_*/ i[33]("liveness.error.error") + "" ), o, a, c = ( /*$_*/ i[33]("faceCollector.unaliveCapture") + "" ), f; return { c() { e = w("h1"), o = P(t), a = P(": "), f = P(c), h(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error"); }, m(n, l) { k(n, e, l), b(e, o), b(e, a), b(e, f); }, p(n, l) { l[1] & /*$_*/ 4 && t !== (t = /*$_*/ n[33]("liveness.error.error") + "") && B(o, t), l[1] & /*$_*/ 4 && c !== (c = /*$_*/ n[33]("faceCollector.unaliveCapture") + "") && B(f, c); }, d(n) { n && R(e); } }; } function Hn(i) { let e, t = ( /*$_*/ i[33]("liveness.error.error") + "" ), o, a, c = ( /*$_*/ i[33]( /*livenessError*/ i[22] ) + "" ), f; return { c() { e = w("h1"), o = P(t), a = P(": "), f = P(c), h(e, "class", "text-3xl font-bold pb-[1em] transition-opacity text-error"); }, m(n, l) { k(n, e, l), b(e, o), b(e, a), b(e, f); }, p(n, l) { l[1] & /*$_*/ 4 && t !== (t = /*$_*/ n[33]("liveness.error.error") + "") && B(o, t), l[0] & /*livenessError*/ 4194304 | l[1] & /*$_*/ 4 && c !== (c = /*$_*/ n[33]( /*livenessError*/ n[22] ) + "") && B(f, c); }, d(n) { n && R(e); } }; } function Ji(i) { let e, t = ( /*unconformity*/ i[123] + "" ), o; return { c() { e = w("div"), o = P(t), h(e, "class", "ce-dui-badge ce-dui-badge-lg h-[2em] ce-dui-badge-error text-xl pb-[.25em] m-[.5em]"); }, m(a, c) { k(a, e, c), b(e, o); }, p(a, c) { c[1] & /*$unconformitiesStore*/ 8 && t !== (t = /*unconformity*/ a[123] + "") && B(o, t); }, d(a) { a && R(e); } }; } function Qi(i) { let e, t = ( /*$_*/ i[33]("faceCollector.noNonconformity") + "" ), o; return { c() { e = w("div"), o = P(t), h(e, "class", "ce-dui-badge ce-dui-badge-lg h-[2em] ce-dui-badge-info text-xl pb-[.25em] m-[.5em]"); }, m(a, c) { k(a, e, c), b(e, o); }, p(a, c) { c[1] & /*$_*/ 4 && t !== (t = /*$_*/ a[33]("faceCollector.noNonconformity") + "") && B(o, t); }, d(a) { a && R(e); } }; } function qn(i) { let e, t, o, a, c, f, n, l, u, r, d = ( /*$videoStore*/ i[27] && Mi(i) ); a = new $i({ props: { waitingIdrndCaptureEvent: ( /*waitingIdrndCaptureEvent*/ i[21] ), idrndLoading: ( /*idrndLoading*/ i[19] ) } }); let g = ( /*$captured*/ i[26] && Vi(i) ); const _ = [Ln, An], y = []; function p(v, C) { return (!/*idrndClosed*/ v[20] || /*$captured*/ v[26]) && /*showUnconformities*/ v[3] ? 0 : ( /*$cameraStatusStore*/ v[23] !== U.OK ? 1 : -1 ); } return ~(n = p(i)) && (l = y[n] = _[n](i)), { c() { e = w("div"), t = w("div"), d && d.c(), o = N(), pe(a.$$.fragment), c = N(), g && g.c(), f = N(), l && l.c(), u = Xi(), this.c = X, h(t, "class", "relative mx-auto"), h(e, "class", "flex flex-col justify-between"); }, m(v, C) { k(v, e, C), b(e, t), d && d.m(t, null), b(t, o), we(a, t, null), b(t, c), g && g.m(t, null), i[56](e), k(v, f, C), ~n && y[n].m(v, C), k(v, u, C), r = !0; }, p(v, C) { /*$videoStore*/ v[27] ? d ? (d.p(v, C), C[0] & /*$videoStore*/ 134217728 && Q(d, 1)) : (d = Mi(v), d.c(), Q(d, 1), d.m(t, o)) : d && (ft(), Y(d, 1, 1, () => { d = null; }), dt()); const I = {}; C[0] & /*waitingIdrndCaptureEvent*/ 2097152 && (I.waitingIdrndCaptureEvent = /*waitingIdrndCaptureEvent*/ v[21]), C[0] & /*idrndLoading*/ 524288 && (I.idrndLoading = /*idrndLoading*/ v[19]), a.$set(I), /*$captured*/ v[26] ? g ? g.p(v, C) : (g = Vi(v), g.c(), g.m(t, null)) : g && (g.d(1), g = null); let L = n; n = p(v), n === L ? ~n && y[n].p(v, C) : (l && (ft(), Y(y[L], 1, 1, () => { y[L] = null; }), dt()), ~n ? (l = y[n], l ? l.p(v, C) : (l = y[n] = _[n](v), l.c()), Q(l, 1), l.m(u.parentNode, u)) : l = null); }, i(v) { r || (Q(d), Q(a.$$.fragment, v), Q(l), r = !0); }, o(v) { Y(d), Y(a.$$.fragment, v), Y(l), r = !1; }, d(v) { v && R(e), d && d.d(), Ce(a), g && g.d(), i[56](null), v && R(f), ~n && y[n].d(v), v && R(u); } }; } let Jn = 0, Qn = 3e3; function Xn() { ({}).VITE_USE_DEV === "true" ? import("./index-idlf-detector_18843221_3.3.6.js") : import("./index-idlf-detector_a5efb00c_3.3.6.js"); } function Gn(i, e, t) { let o, a, c, f, n, l, u, r, d, g, _, y, p, v, C, I, L, G, ae, H, D, W, S, A, Ie, te, ce, De, Ee, Pe, _t, ei, bt, gt, vt, ti, ii; O(i, Pt, (s) => t(76, o = s)), O(i, Bt, (s) => t(77, a = s)), O(i, Ze, (s) => t(79, f = s)), O(i, q, (s) => t(23, n = s)), O(i, Ne, (s) => t(24, l = s)), O(i, Ls, (s) => t(80, u = s)), O(i, xe, (s) => t(81, r = s)), O(i, ve, (s) => t(25, d = s)), O(i, Fs, (s) => t(82, g = s)), O(i, Fe, (s) => t(26, _ = s)), O(i, Wt, (s) => t(83, y = s)), O(i, ct, (s) => t(27, p = s)), O(i, Yi, (s) => t(28, v = s)), O(i, Ti, (s) => t(84, C = s)), O(i, Ss, (s) => t(85, I = s)), O(i, je, (s) => t(86, L = s)), O(i, ke, (s) => t(87, G = s)), O(i, Ns, (s) => t(88, ae = s)), O(i, Ps, (s) => t(89, H = s)), O(i, Mt, (s) => t(29, D = s)), O(i, Ut, (s) => t(30, W = s)), O(i, de, (s) => t(31, S = s)), O(i, se, (s) => t(32, A = s)), O(i, Gi, (s) => t(33, Ie = s)), O(i, Oe, (s) => t(34, te = s)), O(i, ki, (s) => t(90, De = s)), O(i, Vt, (s) => t(91, Ee = s)), O(i, $e, (s) => t(92, Pe = s)), O(i, zt, (s) => t(93, _t = s)), O(i, Bs, (s) => t(94, ei = s)), O(i, et, (s) => t(95, bt = s)), O(i, Oi, (s) => t(96, gt = s)), O(i, Ri, (s) => t(97, vt = s)), O(i, Ws, (s) => t(36, ti = s)), O(i, Ms, (s) => t(37, ii = s)); let F, ne, me, pt, si = !1, Be = !1, wt = !1, _e = !1, Ct = (/* @__PURE__ */ new Date()).getTime(), { enableMinutiae: Et } = e, { videoDimensions: yt } = e, { noTabs: Tt } = e, { weightsPath: kt } = e, { evaluatePhoto: be } = e, { showCaptureButton: Ot } = e, { showUnconformities: ni } = e, { showConfigButton: oi } = e, { showAutoCaptureButton: Rt } = e, { showCameraButton: ai } = e, { showJustificationField: li } = e, { minEyeToEyeDist: We } = e, { showWatermark: ri } = e, { videoOverlay: ci } = e, { videoOverlayTransparency: ui } = e, { faceDetectionSensitivity: It } = e, { hidden: qe } = e, { livenessBlobSize: fi } = e; const Je = Qt(!1); O(i, Je, (s) => t(78, c = s)); const Ae = Qt("data:image/png;base64"); O(i, Ae, (s) => t(35, ce = s)); let { widgetInstance: J } = e, di = new wn(), Me = !1, Dt = !1, Qe = !0, le = !0, Ue = !1, hi = 0, ie = "", At = 0, Xe = !0, mi = 0; const Ge = Us.mixin({ toast: !0, position: "bottom-left", timer: 13e3, timerProgressBar: !0 }); Vs(async () => { if (Ii("Mounting Face Collector!"), m($e, Pe = !0, Pe), m(Ne, l = !1, l), _i(), Lt(), zs(() => { t(18, _e = !0); }), j() ? (Xn(), es(), di.startDetection()) : await ye(), De) try { await js(kt), si = !0, pt = await Ks(); } catch (s) { ee("Failed to initialize Face API:", s), m(ki, De = !1, De), t(0, Ot = !0), t(18, _e = !0); } he() || ts(); }); async function Lt() { const [s, T] = (yt ?? "")?.replaceAll(" ", "")?.split("x")?.map((E) => E ? parseInt(E) : void 0); !s || !T || (he() ? (await Hs(), m( ct, p = { videoWidth: window.innerWidth, videoHeight: window.innerHeight }, p )) : m(ct, p = { videoWidth: s, videoHeight: T }, p)); } function _i() { m(Ze, f = !1, f), m(Fe, _ = !1, _), m(xe, r = jt.FRONT_CAMERA, r), Rt && m(Ti, C = !1, C), m(Mt, D = !1, D), m(se, A = K.OK, A), m(je, L = "", L), m(Oe, te.unconformities = [], te); const s = ut(Kt); s.closedMouth = !1, s.isPersonCloseEnough = !1, s.isPersonTooclose = !0, s.isPersonInFrame = !1, Kt.set(s), m(ke, G = "", G), m(Vt, Ee = !0, Ee); } function es() { J.addEventListener("open", (s) => { const T = s.detail[0].video; m( Ri, vt = { width: T.videoWidth, height: T.videoHeight }, vt ), t(14, F.srcObject = T.srcObject, F), m(Pt, o = F.srcObject, o), t(19, Qe = !1), qe || qs(J), m(Ne, l = !0, l); function E() { le || at(F, E, !0); } E(); }), J.addEventListener("error", (s) => { ee(s), s.detail[0].message.toLowerCase().includes("device in use") ? m(q, n = U.CAMERA_IN_USE_ERROR, n) : s.detail[0].message.toLowerCase().includes("permission") ? m(q, n = U.CAMERA_DENIED_ERROR, n) : s.detail[0].message.toLowerCase().includes("not found") && !he() ? m(q, n = U.DEVICE_NOT_FOUND_ERROR, n) : m(q, n = U.CAMERA_DENIED_ERROR, n), t(19, Qe = !1); }), J.addEventListener("faceDetection", (s) => { s.detail[0].errors.length > 0 && Di(s.detail[0].errors); }), J.addEventListener("detection", (s) => { s.detail[0].errors.length > 0 && Di(s.detail[0].errors); }), J.addEventListener("close", async (s) => { _ || (Me = !1), t(20, le = !0), t(21, Ue = !1), n === U.OK && (m(q, n = U.CAMERA_CLOSED_ERROR, n), setTimeout( () => { le && qe && (Ii("Reopening camera after close (lost focus on widget)"), Ve()); }, 1e3 )); }), J.addEventListener("initialize", async (s) => { Dt = !0, m(Oi, gt = !0, gt); try { J.setLicense(Js, "faceDetector"); } catch (T) { ee("Error setting license:", T); } _t === tt.Face && !Me && !_ && Dt && await Ft(); }),