@regulaforensics/idv-capture-web 0.1.114-nightly → 0.1.115-nightly

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.
@@ -22,7 +22,7 @@ var b1 = (e) => {
22
22
  throw l;
23
23
  }, "return" in r && i("return"), o;
24
24
  };
25
- import { B as cc, r as Bs, j as CE } from "./index-Dwq1rPYR.js";
25
+ import { B as cc, r as Bs, j as CE } from "./index-DiIS40wn.js";
26
26
  var KT = Object.defineProperty, qT = Object.defineProperties, QT = Object.getOwnPropertyDescriptors, SE = Object.getOwnPropertySymbols, JT = Object.prototype.hasOwnProperty, XT = Object.prototype.propertyIsEnumerable, Fo = (e, r) => (r = Symbol[e]) ? r : Symbol.for("Symbol." + e), $T = (e) => {
27
27
  throw TypeError(e);
28
28
  }, gE = (e, r, t) => r in e ? KT(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, tt = (e, r) => {
@@ -24050,60 +24050,64 @@ function Sde(e, r) {
24050
24050
  return (r === "string" ? String : Number)(e);
24051
24051
  }
24052
24052
  var n0 = !1, ls = function(r) {
24053
- var t = r.perform, i = r.moduleProps, o = r.isProcessing, l = i.processParam, c = i.functionality, d = i.sessionId, p = Bs.useRef(null), f = Bs.useRef(null), m = {
24053
+ var t = r.perform, i = r.moduleProps, o = r.isProcessing, l = i.processParam, c = i.functionality, d = i.sessionId, p = i.serviceToken, f = Bs.useRef(null), m = Bs.useRef(null), g = {
24054
24054
  // '--main-color': 'var(--base-main-color)',
24055
24055
  "--font-family": "var(--base-font-family)"
24056
- }, g = function(C) {
24057
- var I;
24058
- if (C.detail.action === ht.PROCESS_FINISHED) {
24059
- var O, v, L;
24060
- if (((O = C.detail.data) === null || O === void 0 ? void 0 : O.status) === ga.ERROR) {
24061
- var b = C.detail.data.reason, T = new Kc({
24056
+ }, S = function(I) {
24057
+ var O;
24058
+ if (I.detail.action === ht.PROCESS_FINISHED) {
24059
+ var v, L, b;
24060
+ if (((v = I.detail.data) === null || v === void 0 ? void 0 : v.status) === ga.ERROR) {
24061
+ var T = I.detail.data.reason, N = new Kc({
24062
24062
  errorCode: r0.INTERNAL_ERROR,
24063
- underlyingError: "ErrorTypes." + b
24064
- }), N = new Wc({
24063
+ underlyingError: "ErrorTypes." + T
24064
+ }), x = new Wc({
24065
24065
  errorCode: t0.SCAN_ERROR,
24066
- underlyingBaseError: T
24066
+ underlyingBaseError: N
24067
24067
  });
24068
- t(N);
24068
+ t(x);
24069
24069
  }
24070
- var x = (v = C.detail.data) === null || v === void 0 ? void 0 : v.status, P = x === 1, F = x === 2;
24071
- if (!(P || F) || !((L = C.detail.data) !== null && L !== void 0 && L.response)) return;
24072
- o && o(!0), window.RegulaDocumentSDK.finalizePackage().then(function(G) {
24070
+ var P = (L = I.detail.data) === null || L === void 0 ? void 0 : L.status, F = P === 1, G = P === 2;
24071
+ if (!(F || G) || !((b = I.detail.data) !== null && b !== void 0 && b.response)) return;
24072
+ o && o(!0), window.RegulaDocumentSDK.finalizePackage().then(function(U) {
24073
24073
  t({
24074
- transactionId: (G == null ? void 0 : G.transactionId) || "",
24074
+ transactionId: (U == null ? void 0 : U.transactionId) || "",
24075
24075
  has_nfc: !1,
24076
24076
  cancel: !1
24077
24077
  });
24078
- }).catch(function(G) {
24079
- console.log("finalizePackage error: ", G), t({
24078
+ }).catch(function(U) {
24079
+ console.log("finalizePackage error: ", U), t({
24080
24080
  transactionId: "",
24081
24081
  cancel: !0,
24082
24082
  has_nfc: !1
24083
24083
  });
24084
24084
  });
24085
24085
  }
24086
- (((I = C.detail) === null || I === void 0 ? void 0 : I.action) === ht.CLOSE || C.detail.action === ht.CAMERA_PROCESS_CLOSED) && t({
24086
+ (((O = I.detail) === null || O === void 0 ? void 0 : O.action) === ht.CLOSE || I.detail.action === ht.CAMERA_PROCESS_CLOSED) && t({
24087
24087
  transactionId: "",
24088
24088
  cancel: !0,
24089
24089
  has_nfc: !1
24090
24090
  });
24091
24091
  };
24092
24092
  return Bs.useEffect(function() {
24093
- function S(I) {
24094
- return I ? (I.internalScenario && (I.scenario = I.internalScenario), delete I.internalScenario, I) : {};
24093
+ function C(v) {
24094
+ return v ? (v.internalScenario && (v.scenario = v.internalScenario), delete v.internalScenario, v) : {};
24095
24095
  }
24096
- var C = {
24097
- processParam: mde({}, S(l))
24096
+ var I = C(l);
24097
+ p && I !== null && I !== void 0 && I.backendProcessing && (I.backendProcessing.httpHeaders = {
24098
+ Authorization: "Connection ".concat(p)
24099
+ });
24100
+ var O = {
24101
+ processParam: mde({}, I)
24098
24102
  };
24099
- d && (C.tag = d), window.RegulaDocumentSDK.recognizerProcessParam = C, window.RegulaDocumentSDK.imageProcessParam = {
24103
+ d && (O.tag = d), window.RegulaDocumentSDK.recognizerProcessParam = O, window.RegulaDocumentSDK.imageProcessParam = {
24100
24104
  processParam: {
24101
24105
  scenario: CO.MrzAndLocate
24102
24106
  }
24103
24107
  };
24104
24108
  }, []), Bs.useEffect(function() {
24105
- var S = f.current;
24106
- S && (S.settings = {
24109
+ var C = m.current;
24110
+ C && (C.settings = {
24107
24111
  locale: "en",
24108
24112
  startScreen: !1,
24109
24113
  skipButton: c == null ? void 0 : c.showSkipNextPageButton,
@@ -24111,15 +24115,15 @@ var n0 = !1, ls = function(r) {
24111
24115
  captureButton: c == null ? void 0 : c.showCaptureButton,
24112
24116
  captureButtonDelay: c == null ? void 0 : c.showCaptureButtonDelayFromStart
24113
24117
  });
24114
- }, [f.current]), Bs.useEffect(function() {
24115
- var S = p.current;
24116
- return S && S.addEventListener("document-reader", g), function() {
24117
- S && S.removeEventListener("document-reader", g);
24118
+ }, [m.current]), Bs.useEffect(function() {
24119
+ var C = f.current;
24120
+ return C && C.addEventListener("document-reader", S), function() {
24121
+ C && C.removeEventListener("document-reader", S);
24118
24122
  };
24119
24123
  }, []), /* @__PURE__ */ CE.jsx("div", { style: {
24120
24124
  height: "100%",
24121
24125
  position: "relative"
24122
- }, ref: p, children: /* @__PURE__ */ CE.jsx("document-reader", { style: m, ref: f }) });
24126
+ }, ref: f, children: /* @__PURE__ */ CE.jsx("document-reader", { style: g, ref: m }) });
24123
24127
  };
24124
24128
  ls.getSupportedTemplates = function() {
24125
24129
  return [dD.DOC_READER];