idmission-web-sdk 0.0.37 → 0.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/README.md +30 -1
  2. package/dist/components/common/GuidanceMessage.d.ts +5 -261
  3. package/dist/components/customer_flows/CustomerBiometricsEnrollment.d.ts +3 -2
  4. package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts +5 -2
  5. package/dist/components/customer_flows/CustomerIdentification.d.ts +3 -2
  6. package/dist/components/customer_flows/CustomerVerification.d.ts +3 -2
  7. package/dist/components/customer_flows/FaceValidation.d.ts +3 -2
  8. package/dist/components/customer_flows/IdAndFaceValidation.d.ts +5 -2
  9. package/dist/components/customer_flows/IdValidation.d.ts +3 -1
  10. package/dist/components/customer_identification/CustomerIdentificationCapture.d.ts +4 -2
  11. package/dist/components/customer_identification/CustomerIdentificationWizard.d.ts +4 -2
  12. package/dist/components/customer_verification/CustomerVerificationCapture.d.ts +4 -2
  13. package/dist/components/customer_verification/CustomerVerificationWizard.d.ts +4 -1
  14. package/dist/components/face_liveness/FaceLivenessCapture.d.ts +4 -2
  15. package/dist/components/face_liveness/FaceLivenessWizard.d.ts +4 -2
  16. package/dist/components/id_capture/IdCapture.d.ts +6 -1
  17. package/dist/components/id_capture/IdCaptureWizard.d.ts +4 -2
  18. package/dist/components/selfie_capture/SelfieCapture.d.ts +6 -1
  19. package/dist/sdk2.cjs.development.js +289 -254
  20. package/dist/sdk2.cjs.development.js.map +1 -1
  21. package/dist/sdk2.cjs.production.js +1 -1
  22. package/dist/sdk2.cjs.production.js.map +1 -1
  23. package/dist/sdk2.esm.js +289 -254
  24. package/dist/sdk2.esm.js.map +1 -1
  25. package/dist/sdk2.umd.development.js +289 -254
  26. package/dist/sdk2.umd.development.js.map +1 -1
  27. package/dist/sdk2.umd.production.js +1 -1
  28. package/dist/sdk2.umd.production.js.map +1 -1
  29. package/package.json +7 -6
package/dist/sdk2.esm.js CHANGED
@@ -359,7 +359,7 @@ var SubmissionProvider = function SubmissionProvider(_a) {
359
359
  }, []);
360
360
  var submit = useCallback(function () {
361
361
  return __awaiter(void 0, void 0, void 0, function () {
362
- var submissionResponse_1, submissionRequest_1, metadata, platform, onBeforeSubmitResult, e_1, host, endpoint, response, submissionResponse_2, e_2;
362
+ var submissionResponse_1, submissionRequest_1, metadata, platform, onBeforeSubmitResult, host, endpoint, response, submissionResponse_2, e_1;
363
363
  var _a;
364
364
  return __generator(this, function (_b) {
365
365
  switch (_b.label) {
@@ -378,7 +378,7 @@ var SubmissionProvider = function SubmissionProvider(_a) {
378
378
  setSubmissionStatus(SubmissionStatus.SUBMITTING);
379
379
  _b.label = 1;
380
380
  case 1:
381
- _b.trys.push([1, 8,, 9]);
381
+ _b.trys.push([1, 6,, 7]);
382
382
  submissionRequest_1 = {
383
383
  securityData: {
384
384
  userName: '',
@@ -449,7 +449,7 @@ var SubmissionProvider = function SubmissionProvider(_a) {
449
449
  }
450
450
  if (signatureData) {
451
451
  submissionRequest_1.customerData.signatureData = {
452
- signatureImage: signatureData.fileContent
452
+ signatureImage: JSON.stringify(signatureData)
453
453
  };
454
454
  }
455
455
  if (additionalDocuments) {
@@ -479,20 +479,13 @@ var SubmissionProvider = function SubmissionProvider(_a) {
479
479
  metadata.GeoLocation = JSON.stringify(geolocationResult);
480
480
  }
481
481
  submissionRequest_1.additionalData.metadata = JSON.stringify(metadata);
482
- if (!onBeforeSubmit) return [3, 5];
483
- _b.label = 2;
484
- case 2:
485
- _b.trys.push([2, 4,, 5]);
482
+ if (!onBeforeSubmit) return [3, 3];
486
483
  return [4, onBeforeSubmit(submissionRequest_1)];
487
- case 3:
484
+ case 2:
488
485
  onBeforeSubmitResult = _b.sent();
489
486
  if (onBeforeSubmitResult) submissionRequest_1 = onBeforeSubmitResult;
490
- return [3, 5];
491
- case 4:
492
- e_1 = _b.sent();
493
- console.error('onBeforeSubmit was rejected with', e_1);
494
- return [3, 5];
495
- case 5:
487
+ _b.label = 3;
488
+ case 3:
496
489
  host = url || determineSubmissionHost(environment, token);
497
490
  endpoint = determineSubmissionEndpoint(action, !!(idFrontImage || idBackImage || passportImage), !!selfieImage, !!token);
498
491
  return [4, fetch(host + endpoint, {
@@ -500,22 +493,22 @@ var SubmissionProvider = function SubmissionProvider(_a) {
500
493
  headers: apiHeaders(token),
501
494
  body: JSON.stringify(submissionRequest_1)
502
495
  })];
503
- case 6:
496
+ case 4:
504
497
  response = _b.sent();
505
498
  return [4, response.json()];
506
- case 7:
499
+ case 5:
507
500
  submissionResponse_2 = _b.sent();
508
501
  setSubmissionRequest(submissionRequest_1);
509
502
  setSubmissionResponse(submissionResponse_2);
510
503
  setSubmissionStatus(SubmissionStatus.SUBMITTED);
511
504
  onResponseReceived === null || onResponseReceived === void 0 ? void 0 : onResponseReceived(submissionResponse_2);
512
505
  return [2, submissionResponse_2];
513
- case 8:
514
- e_2 = _b.sent();
506
+ case 6:
507
+ e_1 = _b.sent();
515
508
  setSubmissionStatus(SubmissionStatus.FAILED);
516
- onRequestFailure === null || onRequestFailure === void 0 ? void 0 : onRequestFailure(e_2);
509
+ onRequestFailure === null || onRequestFailure === void 0 ? void 0 : onRequestFailure(e_1);
517
510
  return [2, null];
518
- case 9:
511
+ case 7:
519
512
  return [2];
520
513
  }
521
514
  });
@@ -8499,43 +8492,45 @@ var IdCapture = function IdCapture(_a) {
8499
8492
  processingDelay = _s === void 0 ? 0 : _s,
8500
8493
  _t = _a.assets,
8501
8494
  assets = _t === void 0 ? {} : _t,
8502
- _u = _a.verbiage,
8503
- verbiage = _u === void 0 ? {} : _u,
8504
- _v = _a.debugMode,
8505
- debugMode = _v === void 0 ? false : _v;
8506
- var _w = useResizeObserver(),
8507
- ref = _w.ref,
8508
- _x = _w.width,
8509
- width = _x === void 0 ? 1 : _x,
8510
- _y = _w.height,
8511
- height = _y === void 0 ? 1 : _y;
8512
- var _z = useReducer(reducer$5, initialState$5),
8513
- state = _z[0],
8514
- dispatch = _z[1];
8515
- var _0 = useState(''),
8516
- imageURL = _0[0],
8517
- setImageURL = _0[1];
8518
- var _1 = useState(false),
8519
- processingFrame = _1[0],
8520
- setProcessingFrame = _1[1];
8521
- var _2 = useContext(CameraStateContext),
8522
- cameraRef = _2.cameraRef,
8523
- cameraReady = _2.cameraReady,
8524
- takePhoto = _2.takePhoto,
8525
- videoRef = _2.videoRef,
8526
- videoLoaded = _2.videoLoaded;
8495
+ _u = _a.colors,
8496
+ colors = _u === void 0 ? {} : _u,
8497
+ _v = _a.verbiage,
8498
+ verbiage = _v === void 0 ? {} : _v,
8499
+ _w = _a.debugMode,
8500
+ debugMode = _w === void 0 ? false : _w;
8501
+ var _x = useResizeObserver(),
8502
+ ref = _x.ref,
8503
+ _y = _x.width,
8504
+ width = _y === void 0 ? 1 : _y,
8505
+ _z = _x.height,
8506
+ height = _z === void 0 ? 1 : _z;
8507
+ var _0 = useReducer(reducer$5, initialState$5),
8508
+ state = _0[0],
8509
+ dispatch = _0[1];
8510
+ var _1 = useState(''),
8511
+ imageURL = _1[0],
8512
+ setImageURL = _1[1];
8513
+ var _2 = useState(false),
8514
+ processingFrame = _2[0],
8515
+ setProcessingFrame = _2[1];
8516
+ var _3 = useContext(CameraStateContext),
8517
+ cameraRef = _3.cameraRef,
8518
+ cameraReady = _3.cameraReady,
8519
+ takePhoto = _3.takePhoto,
8520
+ videoRef = _3.videoRef,
8521
+ videoLoaded = _3.videoLoaded;
8527
8522
  var t = useTranslation().t;
8528
8523
  var captureStartedAt = useRef();
8529
- var _3 = useContext(IdCaptureModelsContext),
8530
- modelsReady = _3.ready,
8531
- modelsWorking = _3.working,
8532
- setThresholds = _3.setThresholds,
8533
- makePrediction = _3.makePrediction,
8534
- onPredictionMade = _3.onPredictionMade,
8535
- detectionTime = _3.detectionTime,
8536
- focusPredictionTime = _3.focusPredictionTime,
8537
- getBestFrame = _3.getBestFrame,
8538
- resetBestFrame = _3.resetBestFrame;
8524
+ var _4 = useContext(IdCaptureModelsContext),
8525
+ modelsReady = _4.ready,
8526
+ modelsWorking = _4.working,
8527
+ setThresholds = _4.setThresholds,
8528
+ makePrediction = _4.makePrediction,
8529
+ onPredictionMade = _4.onPredictionMade,
8530
+ detectionTime = _4.detectionTime,
8531
+ focusPredictionTime = _4.focusPredictionTime,
8532
+ getBestFrame = _4.getBestFrame,
8533
+ resetBestFrame = _4.resetBestFrame;
8539
8534
  useEffect(function () {
8540
8535
  captureStartedAt.current = new Date();
8541
8536
  }, []);
@@ -8564,9 +8559,9 @@ var IdCapture = function IdCapture(_a) {
8564
8559
  useEffect(function () {
8565
8560
  shouldCaptureFrames.current = videoLoaded && cameraReady && modelsReady && !state.capturing && !state.captured;
8566
8561
  }, [cameraReady, state.captured, state.capturing, modelsReady, videoLoaded]);
8567
- var _4 = useState(null),
8568
- lastFrame = _4[0],
8569
- setLastFrame = _4[1];
8562
+ var _5 = useState(null),
8563
+ lastFrame = _5[0],
8564
+ setLastFrame = _5[1];
8570
8565
  useEffect(function () {
8571
8566
  if (!modelsReady || !cameraReady || !videoLoaded) return;
8572
8567
  animationFrame.current = requestAnimationFrame(function runFrame() {
@@ -8741,9 +8736,11 @@ var IdCapture = function IdCapture(_a) {
8741
8736
  }
8742
8737
  });
8743
8738
  }
8744
- verbiage.instructionText = verbiage.instructionText || t('Scan the front of ID');
8745
- verbiage.capturingText = verbiage.capturingText || t('Capturing...');
8746
- verbiage.captureFailedText = verbiage.captureFailedText || t('Capture failed!');
8739
+ colors.guideBoxUnsatisfiedColor || (colors.guideBoxUnsatisfiedColor = 'white');
8740
+ colors.guideBoxSatisfiedColor || (colors.guideBoxSatisfiedColor = 'green');
8741
+ verbiage.instructionText || (verbiage.instructionText = t('Scan the front of ID'));
8742
+ verbiage.capturingText || (verbiage.capturingText = t('Capturing...'));
8743
+ verbiage.captureFailedText || (verbiage.captureFailedText = t('Capture failed!'));
8747
8744
  return /*#__PURE__*/React__default.createElement(PageContainer, {
8748
8745
  ref: ref,
8749
8746
  className: "flex"
@@ -8754,7 +8751,7 @@ var IdCapture = function IdCapture(_a) {
8754
8751
  portraitGuidesImageUrl: assets.portraitGuidesImageUrl,
8755
8752
  landscapeGuidesImageUrl: assets.landscapeGuidesImageUrl,
8756
8753
  isMirrored: !((_c = cameraRef.current) === null || _c === void 0 ? void 0 : _c.isRearFacing),
8757
- borderColor: state.isGoodFrame ? 'green' : 'white'
8754
+ borderColor: state.isGoodFrame ? colors.guideBoxSatisfiedColor : colors.guideBoxUnsatisfiedColor
8758
8755
  }), debugMode && state.detectedObjects.length > 0 && /*#__PURE__*/React__default.createElement(ObjectDetectionDebugOverlay, {
8759
8756
  "$flipX": !((_d = cameraRef.current) === null || _d === void 0 ? void 0 : _d.isRearFacing)
8760
8757
  }, state.detectedObjects.map(function (obj, i) {
@@ -9349,25 +9346,27 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
9349
9346
  passportFocusScoreThreshold = _k === void 0 ? 0.3 : _k,
9350
9347
  _l = _a.assets,
9351
9348
  assets = _l === void 0 ? {} : _l,
9352
- _m = _a.verbiage,
9353
- verbiage = _m === void 0 ? {} : _m,
9354
- _o = _a.debugMode,
9355
- debugMode = _o === void 0 ? false : _o;
9356
- var _p = useReducer(reducer$4, initialState$4),
9357
- state = _p[0],
9358
- dispatch = _p[1];
9349
+ _m = _a.colors,
9350
+ colors = _m === void 0 ? {} : _m,
9351
+ _o = _a.verbiage,
9352
+ verbiage = _o === void 0 ? {} : _o,
9353
+ _p = _a.debugMode,
9354
+ debugMode = _p === void 0 ? false : _p;
9355
+ var _q = useReducer(reducer$4, initialState$4),
9356
+ state = _q[0],
9357
+ dispatch = _q[1];
9359
9358
  var releaseCameraAccess = useContext(CameraStateContext).releaseCameraAccess;
9360
- var _q = useState(false),
9361
- overlayDismissed = _q[0],
9362
- setOverlayDismissed = _q[1];
9363
- var _r = useContext(SubmissionContext),
9364
- submissionStatus = _r.submissionStatus,
9365
- submissionResponse = _r.submissionResponse,
9366
- setIdFrontImage = _r.setIdFrontImage,
9367
- setIdBackImage = _r.setIdBackImage,
9368
- setPassportImage = _r.setPassportImage,
9369
- logIdFrontCaptureAttempt = _r.logIdFrontCaptureAttempt,
9370
- logIdBackCaptureAttempt = _r.logIdBackCaptureAttempt;
9359
+ var _r = useState(false),
9360
+ overlayDismissed = _r[0],
9361
+ setOverlayDismissed = _r[1];
9362
+ var _s = useContext(SubmissionContext),
9363
+ submissionStatus = _s.submissionStatus,
9364
+ submissionResponse = _s.submissionResponse,
9365
+ setIdFrontImage = _s.setIdFrontImage,
9366
+ setIdBackImage = _s.setIdBackImage,
9367
+ setPassportImage = _s.setPassportImage,
9368
+ logIdFrontCaptureAttempt = _s.logIdFrontCaptureAttempt,
9369
+ logIdBackCaptureAttempt = _s.logIdBackCaptureAttempt;
9371
9370
  var t = useTranslation().t;
9372
9371
  var operationStartedAt = useRef();
9373
9372
  useEffect(function () {
@@ -9459,9 +9458,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
9459
9458
  type: 'reset'
9460
9459
  });
9461
9460
  }, []);
9462
- var _s = useState(0),
9463
- attempt = _s[0],
9464
- setAttempt = _s[1];
9461
+ var _t = useState(0),
9462
+ attempt = _t[0],
9463
+ setAttempt = _t[1];
9465
9464
  var onExit = useCallback(function () {
9466
9465
  setOverlayDismissed(false);
9467
9466
  setAttempt(function (n) {
@@ -9476,16 +9475,16 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
9476
9475
  releaseCameraAccess();
9477
9476
  }
9478
9477
  }, [releaseCameraAccess, submissionStatus]);
9479
- assets.idCardFrontPortraitGuidesImageUrl = assets.idCardFrontPortraitGuidesImageUrl || "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg");
9480
- assets.idCardFrontLandscapeGuidesImageUrl = assets.idCardFrontLandscapeGuidesImageUrl || "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg");
9481
- assets.idCardBackPortraitGuidesImageUrl = assets.idCardBackPortraitGuidesImageUrl || "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Portrait-2.svg");
9482
- assets.idCardBackLandscapeGuidesImageUrl = assets.idCardBackLandscapeGuidesImageUrl || "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg");
9483
- assets.passportPortraitGuidesImageUrl = assets.passportPortraitGuidesImageUrl || "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Portrait-2.svg");
9484
- assets.passportLandscapeGuidesImageUrl = assets.passportLandscapeGuidesImageUrl || "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Landscape-2.svg");
9485
- assets.loadingOverlayInstructionImageUrl = assets.loadingOverlayInstructionImageUrl || "".concat(DEFAULT_CDN_URL, "/WebSDK-Instruction-DL-Capture-3-Portrait.png");
9486
- verbiage.idCardFrontInstructionText = verbiage.idCardFrontInstructionText || t('Scan the front of ID');
9487
- verbiage.idCardBackInstructionText = verbiage.idCardBackInstructionText || t('Scan the back of ID');
9488
- verbiage.passportInstructionText = verbiage.passportInstructionText || t('Scan the ID page of passport');
9478
+ assets.idCardFrontPortraitGuidesImageUrl || (assets.idCardFrontPortraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg"));
9479
+ assets.idCardFrontLandscapeGuidesImageUrl || (assets.idCardFrontLandscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
9480
+ assets.idCardBackPortraitGuidesImageUrl || (assets.idCardBackPortraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Portrait-2.svg"));
9481
+ assets.idCardBackLandscapeGuidesImageUrl || (assets.idCardBackLandscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
9482
+ assets.passportPortraitGuidesImageUrl || (assets.passportPortraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Portrait-2.svg"));
9483
+ assets.passportLandscapeGuidesImageUrl || (assets.passportLandscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Landscape-2.svg"));
9484
+ assets.loadingOverlayInstructionImageUrl || (assets.loadingOverlayInstructionImageUrl = "".concat(DEFAULT_CDN_URL, "/WebSDK-Instruction-DL-Capture-3-Portrait.png"));
9485
+ verbiage.idCardFrontInstructionText || (verbiage.idCardFrontInstructionText = t('Scan the front of ID'));
9486
+ verbiage.idCardBackInstructionText || (verbiage.idCardBackInstructionText = t('Scan the back of ID'));
9487
+ verbiage.passportInstructionText || (verbiage.passportInstructionText = t('Scan the ID page of passport'));
9489
9488
  var idCardFrontAssets = useMemo(function () {
9490
9489
  return {
9491
9490
  portraitGuidesImageUrl: assets.idCardFrontPortraitGuidesImageUrl,
@@ -9556,6 +9555,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
9556
9555
  processingScreen: flipIdPrompt,
9557
9556
  processingDelay: 3500,
9558
9557
  assets: idCardFrontAssets,
9558
+ colors: colors,
9559
9559
  verbiage: idCardFrontVerbiage,
9560
9560
  debugMode: debugMode
9561
9561
  });
@@ -9575,6 +9575,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
9575
9575
  onCapture: onCapture,
9576
9576
  onExit: onExit,
9577
9577
  assets: idCardBackAssets,
9578
+ colors: colors,
9578
9579
  verbiage: idCardBackVerbiage,
9579
9580
  debugMode: debugMode
9580
9581
  });
@@ -9594,6 +9595,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
9594
9595
  onCapture: onCapture,
9595
9596
  onExit: onExit,
9596
9597
  assets: passportAssets,
9598
+ colors: colors,
9597
9599
  verbiage: passportVerbiage,
9598
9600
  debugMode: debugMode
9599
9601
  });
@@ -9902,6 +9904,19 @@ var HighPerformanceSelfieGuidanceModelsProvider = function HighPerformanceSelfie
9902
9904
  }, children);
9903
9905
  };
9904
9906
 
9907
+ var GuidanceMessageContainer = styled.div(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n position: absolute;\n top: calc(", ");\n font-weight: bold;\n width: 100%;\n display: flex;\n"], ["\n position: absolute;\n top: calc(", ");\n font-weight: bold;\n width: 100%;\n display: flex;\n"])), function (_a) {
9908
+ var $top = _a.$top;
9909
+ return $top !== null && $top !== void 0 ? $top : '10vh';
9910
+ });
9911
+ var GuidanceMessage = styled.div(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject(["\n margin-left: auto;\n margin-right: auto;\n background: ", ";\n color: ", ";\n padding: 10px 12px 8px;\n border-radius: 8px;\n"], ["\n margin-left: auto;\n margin-right: auto;\n background: ", ";\n color: ", ";\n padding: 10px 12px 8px;\n border-radius: 8px;\n"])), function (_a) {
9912
+ var $background = _a.$background;
9913
+ return $background !== null && $background !== void 0 ? $background : '#ccc';
9914
+ }, function (_a) {
9915
+ var $textColor = _a.$textColor;
9916
+ return $textColor !== null && $textColor !== void 0 ? $textColor : 'black';
9917
+ });
9918
+ var templateObject_1$2, templateObject_2$1;
9919
+
9905
9920
  var initialState$3 = {
9906
9921
  videoWidth: 0,
9907
9922
  videoHeight: 0,
@@ -10005,24 +10020,26 @@ var SelfieCapture = function SelfieCapture(_a) {
10005
10020
  _e = _a.timeoutDurationMs,
10006
10021
  timeoutDurationMs = _e === void 0 ? 15000 : _e,
10007
10022
  guidanceMessage = _a.guidanceMessage,
10008
- _f = _a.verbiage,
10009
- verbiage = _f === void 0 ? {} : _f,
10023
+ _f = _a.colors,
10024
+ colors = _f === void 0 ? {} : _f,
10025
+ _g = _a.verbiage,
10026
+ verbiage = _g === void 0 ? {} : _g,
10010
10027
  debugMode = _a.debugMode;
10011
10028
  var t = useTranslation().t;
10012
- var _g = useResizeObserver(),
10013
- ref = _g.ref,
10014
- _h = _g.width,
10015
- width = _h === void 0 ? 1 : _h,
10016
- _j = _g.height,
10017
- height = _j === void 0 ? 1 : _j;
10018
- var _k = useReducer(reducer$3, initialState$3),
10019
- state = _k[0],
10020
- dispatch = _k[1];
10021
- var _l = useContext(CameraStateContext),
10022
- cameraRef = _l.cameraRef,
10023
- cameraReady = _l.cameraReady,
10024
- takePhoto = _l.takePhoto,
10025
- videoRef = _l.videoRef;
10029
+ var _h = useResizeObserver(),
10030
+ ref = _h.ref,
10031
+ _j = _h.width,
10032
+ width = _j === void 0 ? 1 : _j,
10033
+ _k = _h.height,
10034
+ height = _k === void 0 ? 1 : _k;
10035
+ var _l = useReducer(reducer$3, initialState$3),
10036
+ state = _l[0],
10037
+ dispatch = _l[1];
10038
+ var _m = useContext(CameraStateContext),
10039
+ cameraRef = _m.cameraRef,
10040
+ cameraReady = _m.cameraReady,
10041
+ takePhoto = _m.takePhoto,
10042
+ videoRef = _m.videoRef;
10026
10043
  var onPredictionMade = useContext(HighPerformanceSelfieGuidanceModelsContext).onPredictionMade;
10027
10044
  useEffect(function () {
10028
10045
  if (cameraReady && videoRef.current && videoRef.current.videoWidth !== 0) {
@@ -10045,9 +10062,9 @@ var SelfieCapture = function SelfieCapture(_a) {
10045
10062
  });
10046
10063
  });
10047
10064
  }, [onPredictionMade]);
10048
- var _m = useState(false),
10049
- captureReady = _m[0],
10050
- setCaptureReady = _m[1];
10065
+ var _o = useState(false),
10066
+ captureReady = _o[0],
10067
+ setCaptureReady = _o[1];
10051
10068
  useEffect(function () {
10052
10069
  var timer;
10053
10070
  if (state.faceReady) {
@@ -10091,12 +10108,12 @@ var SelfieCapture = function SelfieCapture(_a) {
10091
10108
  });
10092
10109
  })();
10093
10110
  }, [captureReady, onSelfieCaptured, state.faces, takePhoto]);
10094
- var _o = useState(),
10095
- timeoutStartedAt = _o[0],
10096
- setTimeoutStartedAt = _o[1];
10097
- var _p = useState(false),
10098
- timedOut = _p[0],
10099
- setTimedOut = _p[1];
10111
+ var _p = useState(),
10112
+ timeoutStartedAt = _p[0],
10113
+ setTimeoutStartedAt = _p[1];
10114
+ var _q = useState(false),
10115
+ timedOut = _q[0],
10116
+ setTimedOut = _q[1];
10100
10117
  useEffect(function () {
10101
10118
  if (!timeoutDurationMs) return;
10102
10119
  setTimeoutStartedAt(new Date());
@@ -10117,36 +10134,24 @@ var SelfieCapture = function SelfieCapture(_a) {
10117
10134
  videoWidth: state.videoWidth,
10118
10135
  videoHeight: state.videoHeight
10119
10136
  });
10137
+ colors.guidesUnsatisfiedColor || (colors.guidesUnsatisfiedColor = 'white');
10138
+ colors.guidesSatisfiedColor || (colors.guidesSatisfiedColor = 'green');
10120
10139
  if (!guidanceMessage) {
10121
- verbiage.guidanceHoldStillText = verbiage.guidanceHoldStillText || t('Hold still for a few seconds...');
10122
- verbiage.guidanceLookStraightText = verbiage.guidanceLookStraightText || t('Look straight into the camera...');
10123
- verbiage.guidanceMoveBackText = verbiage.guidanceMoveBackText || t('Move back...');
10124
- verbiage.guidanceMoveForwardText = verbiage.guidanceMoveForwardText || t('Move forward...');
10125
- verbiage.guidanceMoveToCenterText = verbiage.guidanceMoveToCenterText || t('Move to the center...');
10140
+ verbiage.guidanceHoldStillText || (verbiage.guidanceHoldStillText = t('Hold still for a few seconds...'));
10141
+ verbiage.guidanceLookStraightText || (verbiage.guidanceLookStraightText = t('Look straight into the camera...'));
10142
+ verbiage.guidanceMoveBackText || (verbiage.guidanceMoveBackText = t('Move back...'));
10143
+ verbiage.guidanceMoveForwardText || (verbiage.guidanceMoveForwardText = t('Move forward...'));
10144
+ verbiage.guidanceMoveToCenterText || (verbiage.guidanceMoveToCenterText = t('Move to the center...'));
10126
10145
  guidanceMessage = state.faceReady ? verbiage.guidanceHoldStillText : state.faceLookingAway ? verbiage.guidanceLookStraightText : state.faceTooClose ? verbiage.guidanceMoveBackText : state.faceTooFar ? verbiage.guidanceMoveForwardText : state.faceNotCentered ? verbiage.guidanceMoveToCenterText : '';
10127
10146
  }
10128
10147
  return /*#__PURE__*/React__default.createElement(PageContainer, {
10129
10148
  ref: ref,
10130
10149
  className: "flex"
10131
10150
  }, /*#__PURE__*/React__default.createElement(CameraVideoTag, null), /*#__PURE__*/React__default.createElement(FaceCaptureGuideOverlay, {
10132
- borderColor: state.faceReady ? 'green' : 'white'
10133
- }), guidanceMessage !== '' && /*#__PURE__*/React__default.createElement("div", {
10134
- style: {
10135
- position: 'absolute',
10136
- top: 'calc(10vh)',
10137
- fontWeight: 'bold',
10138
- width: '100%',
10139
- display: 'flex'
10140
- }
10141
- }, /*#__PURE__*/React__default.createElement("div", {
10142
- style: {
10143
- marginLeft: 'auto',
10144
- marginRight: 'auto',
10145
- background: state.faceReady ? 'green' : 'red',
10146
- color: 'white',
10147
- padding: '10px 12px 8px',
10148
- borderRadius: 8
10149
- }
10151
+ borderColor: state.faceReady ? colors.guidesSatisfiedColor : colors.guidesUnsatisfiedColor
10152
+ }), guidanceMessage !== '' && /*#__PURE__*/React__default.createElement(GuidanceMessageContainer, null, /*#__PURE__*/React__default.createElement(GuidanceMessage, {
10153
+ "$background": state.faceReady ? 'green' : 'red',
10154
+ "$textColor": "white"
10150
10155
  }, guidanceMessage)), debugMode && state.faces.length > 0 && /*#__PURE__*/React__default.createElement(ObjectDetectionDebugOverlay, {
10151
10156
  "$flipX": !((_b = cameraRef.current) === null || _b === void 0 ? void 0 : _b.isRearFacing)
10152
10157
  }, state.faces.map(function (face, i) {
@@ -10251,14 +10256,16 @@ var FaceLivenessCapture = function FaceLivenessCapture(_a) {
10251
10256
  onExit = _a.onExit,
10252
10257
  _b = _a.timeoutDurationMs,
10253
10258
  timeoutDurationMs = _b === void 0 ? 15000 : _b,
10254
- _c = _a.verbiage,
10255
- verbiage = _c === void 0 ? {} : _c,
10259
+ _c = _a.colors,
10260
+ colors = _c === void 0 ? {} : _c,
10261
+ _d = _a.verbiage,
10262
+ verbiage = _d === void 0 ? {} : _d,
10256
10263
  debugMode = _a.debugMode;
10257
10264
  var t = useTranslation().t;
10258
10265
  var checkLiveness = useContext(SubmissionContext).checkLiveness;
10259
- var _d = useReducer(reducer$2, initialState$2),
10260
- state = _d[0],
10261
- dispatch = _d[1];
10266
+ var _e = useReducer(reducer$2, initialState$2),
10267
+ state = _e[0],
10268
+ dispatch = _e[1];
10262
10269
  var onSelfieCaptured = useCallback(function (frame, face) {
10263
10270
  onCapture === null || onCapture === void 0 ? void 0 : onCapture();
10264
10271
  dispatch({
@@ -10326,9 +10333,9 @@ var FaceLivenessCapture = function FaceLivenessCapture(_a) {
10326
10333
  onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout();
10327
10334
  }
10328
10335
  }, [onTimeout, state.timesLivenessCheckFailed]);
10329
- verbiage.guidanceRemoveEyeCoveringsText = verbiage.guidanceRemoveEyeCoveringsText || t('Please remove your eye coverings (sunglasses, eye patch, etc.)...');
10330
- verbiage.guidanceRemoveHeadCoveringsText = verbiage.guidanceRemoveHeadCoveringsText || t('Please remove your head coverings (hat, scarf, etc.)...');
10331
- verbiage.guidanceRemoveMaskText = verbiage.guidanceRemoveMaskText || t('Please remove your mask...');
10336
+ verbiage.guidanceRemoveEyeCoveringsText || (verbiage.guidanceRemoveEyeCoveringsText = t('Please remove your eye coverings (sunglasses, eye patch, etc.)...'));
10337
+ verbiage.guidanceRemoveHeadCoveringsText || (verbiage.guidanceRemoveHeadCoveringsText = t('Please remove your head coverings (hat, scarf, etc.)...'));
10338
+ verbiage.guidanceRemoveMaskText || (verbiage.guidanceRemoveMaskText = t('Please remove your mask...'));
10332
10339
  var guidanceMessage = state.eyeCoveringDetected ? verbiage.guidanceRemoveEyeCoveringsText : state.headCoveringDetected ? verbiage.guidanceRemoveHeadCoveringsText : state.maskDetected ? verbiage.guidanceRemoveMaskText : undefined;
10333
10340
  return /*#__PURE__*/React__default.createElement(SelfieCapture, {
10334
10341
  onSelfieCaptured: onSelfieCaptured,
@@ -10336,6 +10343,7 @@ var FaceLivenessCapture = function FaceLivenessCapture(_a) {
10336
10343
  onExit: onExit,
10337
10344
  timeoutDurationMs: timeoutDurationMs,
10338
10345
  guidanceMessage: guidanceMessage,
10346
+ colors: colors,
10339
10347
  verbiage: verbiage,
10340
10348
  debugMode: debugMode
10341
10349
  });
@@ -10527,26 +10535,28 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
10527
10535
  timeoutDurationMs = _b === void 0 ? 15000 : _b,
10528
10536
  _c = _a.maxRetries,
10529
10537
  maxRetries = _c === void 0 ? 2 : _c,
10530
- _d = _a.debugMode,
10531
- debugMode = _d === void 0 ? false : _d,
10532
- _e = _a.verbiage,
10533
- verbiage = _e === void 0 ? {} : _e,
10534
- _f = _a.assets,
10535
- assets = _f === void 0 ? {} : _f;
10536
- var _g = useContext(SubmissionContext),
10537
- submissionResponse = _g.submissionResponse,
10538
- setSelfieImage = _g.setSelfieImage,
10539
- logSelfieCaptureAttempt = _g.logSelfieCaptureAttempt;
10538
+ _d = _a.assets,
10539
+ assets = _d === void 0 ? {} : _d,
10540
+ _e = _a.colors,
10541
+ colors = _e === void 0 ? {} : _e,
10542
+ _f = _a.verbiage,
10543
+ verbiage = _f === void 0 ? {} : _f,
10544
+ _g = _a.debugMode,
10545
+ debugMode = _g === void 0 ? false : _g;
10546
+ var _h = useContext(SubmissionContext),
10547
+ submissionResponse = _h.submissionResponse,
10548
+ setSelfieImage = _h.setSelfieImage,
10549
+ logSelfieCaptureAttempt = _h.logSelfieCaptureAttempt;
10540
10550
  var releaseCameraAccess = useContext(CameraStateContext).releaseCameraAccess;
10541
- var _h = useState(''),
10542
- faceCropImageUrl = _h[0],
10543
- setFaceCropImageUrl = _h[1];
10544
- var _j = useState(0),
10545
- retryCount = _j[0],
10546
- setRetryCount = _j[1];
10547
- var _k = useState('LOADING'),
10548
- captureState = _k[0],
10549
- setCaptureState = _k[1];
10551
+ var _j = useState(''),
10552
+ faceCropImageUrl = _j[0],
10553
+ setFaceCropImageUrl = _j[1];
10554
+ var _k = useState(0),
10555
+ retryCount = _k[0],
10556
+ setRetryCount = _k[1];
10557
+ var _l = useState('LOADING'),
10558
+ captureState = _l[0],
10559
+ setCaptureState = _l[1];
10550
10560
  var captureStartedAt = useRef();
10551
10561
  var captureEndedAt = useRef();
10552
10562
  var operationStartedAt = useRef();
@@ -10592,9 +10602,9 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
10592
10602
  setCaptureState('FAILED');
10593
10603
  onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout(submissionResponse);
10594
10604
  }, [onTimeout, submissionResponse]);
10595
- var _l = useState(0),
10596
- attempt = _l[0],
10597
- setAttempt = _l[1];
10605
+ var _m = useState(0),
10606
+ attempt = _m[0],
10607
+ setAttempt = _m[1];
10598
10608
  var onExitCallback = useCallback(function () {
10599
10609
  setAttempt(function (n) {
10600
10610
  return n + 1;
@@ -10611,6 +10621,7 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
10611
10621
  onTimeout: onTimeoutCallback,
10612
10622
  onExit: onExitCallback,
10613
10623
  timeoutDurationMs: timeoutDurationMs,
10624
+ colors: colors,
10614
10625
  verbiage: verbiage,
10615
10626
  debugMode: debugMode
10616
10627
  });
@@ -11138,8 +11149,8 @@ function truncate(str, max_chars) {
11138
11149
  return truncated;
11139
11150
  }
11140
11151
 
11141
- var Spinner = styled.div(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n display: inline-block;\n width: 80px;\n height: 80px;\n margin: auto;\n\n &:after {\n content: ' ';\n display: block;\n width: 64px;\n height: 64px;\n margin: 8px;\n border-radius: 50%;\n border: 6px solid #888;\n border-color: #888 transparent #888 transparent;\n animation: lds-dual-ring 1.2s linear infinite;\n }\n\n @keyframes lds-dual-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"], ["\n display: inline-block;\n width: 80px;\n height: 80px;\n margin: auto;\n\n &:after {\n content: ' ';\n display: block;\n width: 64px;\n height: 64px;\n margin: 8px;\n border-radius: 50%;\n border: 6px solid #888;\n border-color: #888 transparent #888 transparent;\n animation: lds-dual-ring 1.2s linear infinite;\n }\n\n @keyframes lds-dual-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])));
11142
- var templateObject_1$2;
11152
+ var Spinner = styled.div(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n display: inline-block;\n width: 80px;\n height: 80px;\n margin: auto;\n\n &:after {\n content: ' ';\n display: block;\n width: 64px;\n height: 64px;\n margin: 8px;\n border-radius: 50%;\n border: 6px solid #888;\n border-color: #888 transparent #888 transparent;\n animation: lds-dual-ring 1.2s linear infinite;\n }\n\n @keyframes lds-dual-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"], ["\n display: inline-block;\n width: 80px;\n height: 80px;\n margin: auto;\n\n &:after {\n content: ' ';\n display: block;\n width: 64px;\n height: 64px;\n margin: 8px;\n border-radius: 50%;\n border: 6px solid #888;\n border-color: #888 transparent #888 transparent;\n animation: lds-dual-ring 1.2s linear infinite;\n }\n\n @keyframes lds-dual-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])));
11153
+ var templateObject_1$1;
11143
11154
 
11144
11155
  var AdditionalDocumentCapture = function AdditionalDocumentCapture(_a) {
11145
11156
  var document = _a.document,
@@ -11285,18 +11296,11 @@ function signatureDataToIdmissionFormat(signatureCanvas) {
11285
11296
  return signatureData;
11286
11297
  }
11287
11298
 
11288
- var SignatureCanvasContainer = styled.div(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n position: absolute;\n top: 25%;\n left: 15%;\n width: 70%;\n height: 50%;\n\n @media (max-width: 800px) {\n top: 15%;\n left: 2%;\n width: 96%;\n height: 70%;\n }\n"], ["\n position: absolute;\n top: 25%;\n left: 15%;\n width: 70%;\n height: 50%;\n\n @media (max-width: 800px) {\n top: 15%;\n left: 2%;\n width: 96%;\n height: 70%;\n }\n"])));
11289
- var SignaturePad = styled.div(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject(["\n position: relative;\n background: rgba(255, 255, 255, 0.5);\n border-radius: 16px;\n flex-grow: 1;\n z-index: 100;\n height: 100%;\n"], ["\n position: relative;\n background: rgba(255, 255, 255, 0.5);\n border-radius: 16px;\n flex-grow: 1;\n z-index: 100;\n height: 100%;\n"])));
11299
+ var SignatureCanvasContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n top: 25%;\n left: 15%;\n width: 70%;\n height: 50%;\n\n @media (max-width: 800px) {\n top: 15%;\n left: 2%;\n width: 96%;\n height: 70%;\n }\n"], ["\n position: absolute;\n top: 25%;\n left: 15%;\n width: 70%;\n height: 50%;\n\n @media (max-width: 800px) {\n top: 15%;\n left: 2%;\n width: 96%;\n height: 70%;\n }\n"])));
11300
+ var SignaturePad = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n background: rgba(255, 255, 255, 0.5);\n border-radius: 16px;\n flex-grow: 1;\n z-index: 100;\n height: 100%;\n"], ["\n position: relative;\n background: rgba(255, 255, 255, 0.5);\n border-radius: 16px;\n flex-grow: 1;\n z-index: 100;\n height: 100%;\n"])));
11290
11301
  var SignatureButtonsContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-grow: 0;\n padding-top: 12px;\n display: flex;\n z-index: 1000;\n position: relative;\n"], ["\n flex-grow: 0;\n padding-top: 12px;\n display: flex;\n z-index: 1000;\n position: relative;\n"])));
11291
11302
  var SignaturePaperBacking = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n background-color: #e5e5f7;\n opacity: 0.8;\n background-image: radial-gradient(#444cf7 0.5px, transparent 0.5px),\n radial-gradient(#444cf7 0.5px, #e5e5f7 0.5px);\n background-size: 20px 20px;\n background-position: 0 0, 10px 10px;\n"], ["\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n background-color: #e5e5f7;\n opacity: 0.8;\n background-image: radial-gradient(#444cf7 0.5px, transparent 0.5px),\n radial-gradient(#444cf7 0.5px, #e5e5f7 0.5px);\n background-size: 20px 20px;\n background-position: 0 0, 10px 10px;\n"])));
11292
- var templateObject_1$1, templateObject_2$1, templateObject_3, templateObject_4;
11293
-
11294
- var GuidanceMessageContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n top: calc(", ");\n font-weight: bold;\n width: 100%;\n display: flex;\n"], ["\n position: absolute;\n top: calc(", ");\n font-weight: bold;\n width: 100%;\n display: flex;\n"])), function (_a) {
11295
- var $top = _a.$top;
11296
- return $top !== null && $top !== void 0 ? $top : '10vh';
11297
- });
11298
- var GuidanceMessage = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-left: auto;\n margin-right: auto;\n background: #ccc;\n padding: 10px 12px 8px;\n border-radius: 8px;\n"], ["\n margin-left: auto;\n margin-right: auto;\n background: #ccc;\n padding: 10px 12px 8px;\n border-radius: 8px;\n"])));
11299
- var templateObject_1, templateObject_2;
11303
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
11300
11304
 
11301
11305
  var SignatureCapture = function SignatureCapture(_a) {
11302
11306
  var onAccept = _a.onAccept,
@@ -11997,20 +12001,22 @@ var IdValidation = function IdValidation(_a) {
11997
12001
  onDenied = _a.onDenied,
11998
12002
  _j = _a.assets,
11999
12003
  assets = _j === void 0 ? {} : _j,
12000
- _k = _a.verbiage,
12001
- verbiage = _k === void 0 ? {} : _k,
12002
- _l = _a.captureSignature,
12003
- captureSignature = _l === void 0 ? false : _l,
12004
- _m = _a.captureSignatureVideo,
12005
- captureSignatureVideo = _m === void 0 ? false : _m,
12006
- _o = _a.captureAdditionalDocuments,
12007
- captureAdditionalDocuments = _o === void 0 ? [] : _o,
12008
- _p = _a.geolocationEnabled,
12009
- geolocationEnabled = _p === void 0 ? true : _p,
12010
- _q = _a.geolocationRequired,
12011
- geolocationRequired = _q === void 0 ? false : _q,
12012
- _r = _a.debugMode,
12013
- debugMode = _r === void 0 ? false : _r;
12004
+ _k = _a.colors,
12005
+ colors = _k === void 0 ? {} : _k,
12006
+ _l = _a.verbiage,
12007
+ verbiage = _l === void 0 ? {} : _l,
12008
+ _m = _a.captureSignature,
12009
+ captureSignature = _m === void 0 ? false : _m,
12010
+ _o = _a.captureSignatureVideo,
12011
+ captureSignatureVideo = _o === void 0 ? false : _o,
12012
+ _p = _a.captureAdditionalDocuments,
12013
+ captureAdditionalDocuments = _p === void 0 ? [] : _p,
12014
+ _q = _a.geolocationEnabled,
12015
+ geolocationEnabled = _q === void 0 ? true : _q,
12016
+ _r = _a.geolocationRequired,
12017
+ geolocationRequired = _r === void 0 ? false : _r,
12018
+ _s = _a.debugMode,
12019
+ debugMode = _s === void 0 ? false : _s;
12014
12020
  useLanguage(lang);
12015
12021
  var idCaptureProps = useMemo(function () {
12016
12022
  return {
@@ -12022,10 +12028,11 @@ var IdValidation = function IdValidation(_a) {
12022
12028
  passportFocusScoreThreshold: passportFocusScoreThreshold,
12023
12029
  barcodeScanningEnabled: false,
12024
12030
  assets: assets,
12031
+ colors: colors,
12025
12032
  verbiage: verbiage,
12026
12033
  debugMode: debugMode
12027
12034
  };
12028
- }, [assets, debugMode, idAutoCaptureEnabled, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold, verbiage]);
12035
+ }, [assets, colors, debugMode, idAutoCaptureEnabled, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold, verbiage]);
12029
12036
  var signatureCaptureProps = useMemo(function () {
12030
12037
  return {
12031
12038
  verbiage: {
@@ -12100,6 +12107,7 @@ var FaceValidation = function FaceValidation(_a) {
12100
12107
  onDenied = _a.onDenied,
12101
12108
  onExitAfterFailure = _a.onExitAfterFailure,
12102
12109
  assets = _a.assets,
12110
+ colors = _a.colors,
12103
12111
  verbiage = _a.verbiage,
12104
12112
  _e = _a.geolocationEnabled,
12105
12113
  geolocationEnabled = _e === void 0 ? true : _e,
@@ -12116,10 +12124,11 @@ var FaceValidation = function FaceValidation(_a) {
12116
12124
  onTimeout: onDenied,
12117
12125
  onExitAfterFailure: onExitAfterFailure,
12118
12126
  assets: assets,
12127
+ colors: colors,
12119
12128
  verbiage: verbiage,
12120
12129
  debugMode: debugMode
12121
12130
  };
12122
- }, [assets, debugMode, onApproved, onComplete, onDenied, onExitAfterFailure, timeoutDurationMs, verbiage]);
12131
+ }, [assets, colors, debugMode, onApproved, onComplete, onDenied, onExitAfterFailure, timeoutDurationMs, verbiage]);
12123
12132
  return /*#__PURE__*/React__default.createElement(SubmissionProvider, {
12124
12133
  action: SubmissionAction.NONE,
12125
12134
  environment: submissionEnvironment,
@@ -12169,10 +12178,12 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
12169
12178
  _j = _a.passportFocusScoreThreshold,
12170
12179
  passportFocusScoreThreshold = _j === void 0 ? 0.3 : _j,
12171
12180
  idCaptureAssets = _a.idCaptureAssets,
12181
+ idCaptureColors = _a.idCaptureColors,
12172
12182
  idCaptureVerbiage = _a.idCaptureVerbiage,
12173
12183
  _k = _a.faceLivenessTimeoutDurationMs,
12174
12184
  faceLivenessTimeoutDurationMs = _k === void 0 ? 15000 : _k,
12175
12185
  faceLivenessAssets = _a.faceLivenessAssets,
12186
+ faceLivenessColors = _a.faceLivenessColors,
12176
12187
  faceLivenessVerbiage = _a.faceLivenessVerbiage,
12177
12188
  onBeforeSubmit = _a.onBeforeSubmit,
12178
12189
  onComplete = _a.onComplete,
@@ -12195,6 +12206,7 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
12195
12206
  var idCaptureProps = useMemo(function () {
12196
12207
  return {
12197
12208
  assets: idCaptureAssets,
12209
+ colors: idCaptureColors,
12198
12210
  verbiage: idCaptureVerbiage,
12199
12211
  autoCaptureEnabled: idAutoCaptureEnabled,
12200
12212
  idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
@@ -12204,17 +12216,18 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
12204
12216
  passportFocusScoreThreshold: passportFocusScoreThreshold,
12205
12217
  debugMode: debugMode
12206
12218
  };
12207
- }, [debugMode, idAutoCaptureEnabled, idCaptureAssets, idCaptureVerbiage, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold]);
12219
+ }, [debugMode, idAutoCaptureEnabled, idCaptureAssets, idCaptureColors, idCaptureVerbiage, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold]);
12208
12220
  var faceLivenessProps = useMemo(function () {
12209
12221
  return {
12210
12222
  timeoutDurationMs: faceLivenessTimeoutDurationMs,
12211
12223
  onTimeout: onDenied,
12212
12224
  onExitAfterFailure: onExitAfterFailure,
12213
12225
  assets: faceLivenessAssets,
12226
+ colors: faceLivenessColors,
12214
12227
  verbiage: faceLivenessVerbiage,
12215
12228
  debugMode: debugMode
12216
12229
  };
12217
- }, [debugMode, faceLivenessAssets, faceLivenessTimeoutDurationMs, faceLivenessVerbiage, onDenied, onExitAfterFailure]);
12230
+ }, [debugMode, faceLivenessAssets, faceLivenessColors, faceLivenessTimeoutDurationMs, faceLivenessVerbiage, onDenied, onExitAfterFailure]);
12218
12231
  var signatureCaptureProps = useMemo(function () {
12219
12232
  return {
12220
12233
  verbiage: {
@@ -12302,10 +12315,12 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
12302
12315
  _j = _a.passportFocusScoreThreshold,
12303
12316
  passportFocusScoreThreshold = _j === void 0 ? 0.3 : _j,
12304
12317
  idCaptureAssets = _a.idCaptureAssets,
12318
+ idCaptureColors = _a.idCaptureColors,
12305
12319
  idCaptureVerbiage = _a.idCaptureVerbiage,
12306
12320
  _k = _a.faceLivenessTimeoutDurationMs,
12307
12321
  faceLivenessTimeoutDurationMs = _k === void 0 ? 15000 : _k,
12308
12322
  faceLivenessAssets = _a.faceLivenessAssets,
12323
+ faceLivenessColors = _a.faceLivenessColors,
12309
12324
  faceLivenessVerbiage = _a.faceLivenessVerbiage,
12310
12325
  onBeforeSubmit = _a.onBeforeSubmit,
12311
12326
  onComplete = _a.onComplete,
@@ -12328,6 +12343,7 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
12328
12343
  var idCaptureProps = useMemo(function () {
12329
12344
  return {
12330
12345
  assets: idCaptureAssets,
12346
+ colors: idCaptureColors,
12331
12347
  verbiage: idCaptureVerbiage,
12332
12348
  autoCaptureEnabled: idAutoCaptureEnabled,
12333
12349
  idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
@@ -12337,16 +12353,17 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
12337
12353
  passportFocusScoreThreshold: passportFocusScoreThreshold,
12338
12354
  debugMode: debugMode
12339
12355
  };
12340
- }, [debugMode, idAutoCaptureEnabled, idCaptureAssets, idCaptureVerbiage, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold]);
12356
+ }, [debugMode, idAutoCaptureEnabled, idCaptureAssets, idCaptureColors, idCaptureVerbiage, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold]);
12341
12357
  var faceLivenessProps = useMemo(function () {
12342
12358
  return {
12343
12359
  onExitAfterFailure: onExitAfterFailure,
12344
12360
  timeoutDurationMs: faceLivenessTimeoutDurationMs,
12345
12361
  assets: faceLivenessAssets,
12362
+ colors: faceLivenessColors,
12346
12363
  verbiage: faceLivenessVerbiage,
12347
12364
  debugMode: debugMode
12348
12365
  };
12349
- }, [debugMode, faceLivenessAssets, faceLivenessTimeoutDurationMs, faceLivenessVerbiage, onExitAfterFailure]);
12366
+ }, [debugMode, faceLivenessAssets, faceLivenessColors, faceLivenessTimeoutDurationMs, faceLivenessVerbiage, onExitAfterFailure]);
12350
12367
  var signatureCaptureProps = useMemo(function () {
12351
12368
  return {
12352
12369
  verbiage: {
@@ -12479,20 +12496,22 @@ var CustomerVerificationCapture = function CustomerVerificationCapture(_a) {
12479
12496
  onCaptureGuidanceTimeout = _a.onCaptureGuidanceTimeout,
12480
12497
  onExit = _a.onExit,
12481
12498
  captureGuidanceTimeoutDurationMs = _a.captureGuidanceTimeoutDurationMs,
12482
- _b = _a.verbiage,
12483
- verbiage = _b === void 0 ? {} : _b,
12484
- _c = _a.debugMode,
12485
- debugMode = _c === void 0 ? false : _c;
12486
- var _d = useReducer(reducer$1, initialState$1),
12487
- state = _d[0],
12488
- dispatch = _d[1];
12499
+ _b = _a.colors,
12500
+ colors = _b === void 0 ? {} : _b,
12501
+ _c = _a.verbiage,
12502
+ verbiage = _c === void 0 ? {} : _c,
12503
+ _d = _a.debugMode,
12504
+ debugMode = _d === void 0 ? false : _d;
12505
+ var _e = useReducer(reducer$1, initialState$1),
12506
+ state = _e[0],
12507
+ dispatch = _e[1];
12489
12508
  var frame = state.frame,
12490
12509
  face = state.face;
12491
- var _e = useContext(SubmissionContext),
12492
- submit = _e.submit,
12493
- submissionResponse = _e.submissionResponse,
12494
- selfieImage = _e.selfieImage,
12495
- setSelfieImage = _e.setSelfieImage;
12510
+ var _f = useContext(SubmissionContext),
12511
+ submit = _f.submit,
12512
+ submissionResponse = _f.submissionResponse,
12513
+ selfieImage = _f.selfieImage,
12514
+ setSelfieImage = _f.setSelfieImage;
12496
12515
  var onSelfieCaptured = useCallback(function (frame, face) {
12497
12516
  dispatch({
12498
12517
  type: 'verificationReady',
@@ -12565,6 +12584,7 @@ var CustomerVerificationCapture = function CustomerVerificationCapture(_a) {
12565
12584
  onTimeout: onCaptureGuidanceTimeout,
12566
12585
  onExit: onExit,
12567
12586
  timeoutDurationMs: captureGuidanceTimeoutDurationMs,
12587
+ colors: colors,
12568
12588
  verbiage: verbiage,
12569
12589
  debugMode: debugMode
12570
12590
  });
@@ -12675,17 +12695,19 @@ var CustomerVerificationWizard = function CustomerVerificationWizard(_a) {
12675
12695
  captureGuidanceTimeoutDurationMs = _a.captureGuidanceTimeoutDurationMs,
12676
12696
  _b = _a.assets,
12677
12697
  assets = _b === void 0 ? {} : _b,
12678
- _c = _a.verbiage,
12679
- verbiage = _c === void 0 ? {} : _c,
12680
- _d = _a.debugMode,
12681
- debugMode = _d === void 0 ? false : _d;
12682
- var _e = useContext(SubmissionContext),
12683
- submissionResponse = _e.submissionResponse,
12684
- selfieImage = _e.selfieImage;
12698
+ _c = _a.colors,
12699
+ colors = _c === void 0 ? {} : _c,
12700
+ _d = _a.verbiage,
12701
+ verbiage = _d === void 0 ? {} : _d,
12702
+ _e = _a.debugMode,
12703
+ debugMode = _e === void 0 ? false : _e;
12704
+ var _f = useContext(SubmissionContext),
12705
+ submissionResponse = _f.submissionResponse,
12706
+ selfieImage = _f.selfieImage;
12685
12707
  var releaseCameraAccess = useContext(CameraStateContext).releaseCameraAccess;
12686
- var _f = useState('LOADING'),
12687
- captureState = _f[0],
12688
- setCaptureState = _f[1];
12708
+ var _g = useState('LOADING'),
12709
+ captureState = _g[0],
12710
+ setCaptureState = _g[1];
12689
12711
  var onCustomerMatchedCallback = useCallback(function (response) {
12690
12712
  return __awaiter(void 0, void 0, void 0, function () {
12691
12713
  return __generator(this, function (_a) {
@@ -12717,9 +12739,9 @@ var CustomerVerificationWizard = function CustomerVerificationWizard(_a) {
12717
12739
  onCaptureGuidanceTimeout === null || onCaptureGuidanceTimeout === void 0 ? void 0 : onCaptureGuidanceTimeout();
12718
12740
  }, 0);
12719
12741
  }, [onCaptureGuidanceTimeout, releaseCameraAccess]);
12720
- var _g = useState(0),
12721
- attempt = _g[0],
12722
- setAttempt = _g[1];
12742
+ var _h = useState(0),
12743
+ attempt = _h[0],
12744
+ setAttempt = _h[1];
12723
12745
  var onExitCallback = useCallback(function () {
12724
12746
  setAttempt(function (n) {
12725
12747
  return n + 1;
@@ -12735,6 +12757,7 @@ var CustomerVerificationWizard = function CustomerVerificationWizard(_a) {
12735
12757
  onCaptureGuidanceTimeout: onCaptureGuidanceTimeoutCallback,
12736
12758
  onExit: onExitCallback,
12737
12759
  captureGuidanceTimeoutDurationMs: captureGuidanceTimeoutDurationMs,
12760
+ colors: colors,
12738
12761
  verbiage: verbiage,
12739
12762
  debugMode: debugMode
12740
12763
  });
@@ -12793,6 +12816,7 @@ var CustomerVerification = function CustomerVerification(_a) {
12793
12816
  _d = _a.timeoutDurationMs,
12794
12817
  timeoutDurationMs = _d === void 0 ? 15000 : _d,
12795
12818
  assets = _a.assets,
12819
+ colors = _a.colors,
12796
12820
  verbiage = _a.verbiage,
12797
12821
  onBeforeSubmit = _a.onBeforeSubmit,
12798
12822
  onComplete = _a.onComplete,
@@ -12828,6 +12852,7 @@ var CustomerVerification = function CustomerVerification(_a) {
12828
12852
  onExitAfterFailure: onExitAfterFailure,
12829
12853
  captureGuidanceTimeoutDurationMs: timeoutDurationMs,
12830
12854
  assets: assets,
12855
+ colors: colors,
12831
12856
  verbiage: verbiage,
12832
12857
  debugMode: debugMode
12833
12858
  }))));
@@ -12906,18 +12931,20 @@ var CustomerIdentificationCapture = function CustomerIdentificationCapture(_a) {
12906
12931
  onCaptureGuidanceTimeout = _a.onCaptureGuidanceTimeout,
12907
12932
  onExit = _a.onExit,
12908
12933
  captureGuidanceTimeoutDurationMs = _a.captureGuidanceTimeoutDurationMs,
12909
- _b = _a.verbiage,
12910
- verbiage = _b === void 0 ? {} : _b,
12911
- _c = _a.debugMode,
12912
- debugMode = _c === void 0 ? false : _c;
12913
- var _d = useReducer(reducer, initialState),
12914
- state = _d[0],
12915
- dispatch = _d[1];
12916
- var _e = useContext(SubmissionContext),
12917
- submit = _e.submit,
12918
- submissionResponse = _e.submissionResponse,
12919
- selfieImage = _e.selfieImage,
12920
- setSelfieImage = _e.setSelfieImage;
12934
+ _b = _a.colors,
12935
+ colors = _b === void 0 ? {} : _b,
12936
+ _c = _a.verbiage,
12937
+ verbiage = _c === void 0 ? {} : _c,
12938
+ _d = _a.debugMode,
12939
+ debugMode = _d === void 0 ? false : _d;
12940
+ var _e = useReducer(reducer, initialState),
12941
+ state = _e[0],
12942
+ dispatch = _e[1];
12943
+ var _f = useContext(SubmissionContext),
12944
+ submit = _f.submit,
12945
+ submissionResponse = _f.submissionResponse,
12946
+ selfieImage = _f.selfieImage,
12947
+ setSelfieImage = _f.setSelfieImage;
12921
12948
  var onSelfieCaptured = useCallback(function (frame, face) {
12922
12949
  dispatch({
12923
12950
  type: 'identificationReady',
@@ -12992,6 +13019,7 @@ var CustomerIdentificationCapture = function CustomerIdentificationCapture(_a) {
12992
13019
  onTimeout: onCaptureGuidanceTimeout,
12993
13020
  onExit: onExit,
12994
13021
  timeoutDurationMs: captureGuidanceTimeoutDurationMs,
13022
+ colors: colors,
12995
13023
  verbiage: verbiage,
12996
13024
  debugMode: debugMode
12997
13025
  });
@@ -13102,17 +13130,19 @@ var CustomerIdentificationWizard = function CustomerIdentificationWizard(_a) {
13102
13130
  captureGuidanceTimeoutDurationMs = _a.captureGuidanceTimeoutDurationMs,
13103
13131
  _b = _a.assets,
13104
13132
  assets = _b === void 0 ? {} : _b,
13105
- _c = _a.verbiage,
13106
- verbiage = _c === void 0 ? {} : _c,
13107
- _d = _a.debugMode,
13108
- debugMode = _d === void 0 ? false : _d;
13109
- var _e = useContext(SubmissionContext),
13110
- submissionResponse = _e.submissionResponse,
13111
- selfieImage = _e.selfieImage;
13133
+ _c = _a.colors,
13134
+ colors = _c === void 0 ? {} : _c,
13135
+ _d = _a.verbiage,
13136
+ verbiage = _d === void 0 ? {} : _d,
13137
+ _e = _a.debugMode,
13138
+ debugMode = _e === void 0 ? false : _e;
13139
+ var _f = useContext(SubmissionContext),
13140
+ submissionResponse = _f.submissionResponse,
13141
+ selfieImage = _f.selfieImage;
13112
13142
  var releaseCameraAccess = useContext(CameraStateContext).releaseCameraAccess;
13113
- var _f = useState('LOADING'),
13114
- captureState = _f[0],
13115
- setCaptureState = _f[1];
13143
+ var _g = useState('LOADING'),
13144
+ captureState = _g[0],
13145
+ setCaptureState = _g[1];
13116
13146
  var onCustomerMatchedCallback = useCallback(function (response) {
13117
13147
  return __awaiter(void 0, void 0, void 0, function () {
13118
13148
  return __generator(this, function (_a) {
@@ -13144,9 +13174,9 @@ var CustomerIdentificationWizard = function CustomerIdentificationWizard(_a) {
13144
13174
  onCaptureGuidanceTimeout === null || onCaptureGuidanceTimeout === void 0 ? void 0 : onCaptureGuidanceTimeout();
13145
13175
  }, 0);
13146
13176
  }, [onCaptureGuidanceTimeout, releaseCameraAccess]);
13147
- var _g = useState(0),
13148
- attempt = _g[0],
13149
- setAttempt = _g[1];
13177
+ var _h = useState(0),
13178
+ attempt = _h[0],
13179
+ setAttempt = _h[1];
13150
13180
  var onExitCallback = useCallback(function () {
13151
13181
  setAttempt(function (n) {
13152
13182
  return n + 1;
@@ -13162,6 +13192,7 @@ var CustomerIdentificationWizard = function CustomerIdentificationWizard(_a) {
13162
13192
  onCaptureGuidanceTimeout: onCaptureGuidanceTimeoutCallback,
13163
13193
  onExit: onExitCallback,
13164
13194
  captureGuidanceTimeoutDurationMs: captureGuidanceTimeoutDurationMs,
13195
+ colors: colors,
13165
13196
  verbiage: verbiage,
13166
13197
  debugMode: debugMode
13167
13198
  });
@@ -13226,6 +13257,7 @@ var CustomerIdentification = function CustomerIdentification(_a) {
13226
13257
  onCaptureGuidanceTimeout = _a.onCaptureGuidanceTimeout,
13227
13258
  onExitAfterFailure = _a.onExitAfterFailure,
13228
13259
  assets = _a.assets,
13260
+ colors = _a.colors,
13229
13261
  verbiage = _a.verbiage,
13230
13262
  geolocationEnabled = _a.geolocationEnabled,
13231
13263
  _e = _a.geolocationRequired,
@@ -13255,6 +13287,7 @@ var CustomerIdentification = function CustomerIdentification(_a) {
13255
13287
  onCaptureGuidanceTimeout: onCaptureGuidanceTimeout,
13256
13288
  captureGuidanceTimeoutDurationMs: timeoutDurationMs,
13257
13289
  assets: assets,
13290
+ colors: colors,
13258
13291
  verbiage: verbiage,
13259
13292
  debugMode: debugMode
13260
13293
  }))));
@@ -13312,6 +13345,7 @@ var CustomerBiometricsEnrollment = function CustomerBiometricsEnrollment(_a) {
13312
13345
  _d = _a.timeoutDurationMs,
13313
13346
  timeoutDurationMs = _d === void 0 ? 15000 : _d,
13314
13347
  assets = _a.assets,
13348
+ colors = _a.colors,
13315
13349
  verbiage = _a.verbiage,
13316
13350
  onBeforeSubmit = _a.onBeforeSubmit,
13317
13351
  onComplete = _a.onComplete,
@@ -13336,10 +13370,11 @@ var CustomerBiometricsEnrollment = function CustomerBiometricsEnrollment(_a) {
13336
13370
  onExitAfterFailure: onExitAfterFailure,
13337
13371
  timeoutDurationMs: timeoutDurationMs,
13338
13372
  assets: assets,
13373
+ colors: colors,
13339
13374
  verbiage: verbiage,
13340
13375
  debugMode: debugMode
13341
13376
  };
13342
- }, [assets, debugMode, onExitAfterFailure, timeoutDurationMs, verbiage]);
13377
+ }, [assets, colors, debugMode, onExitAfterFailure, timeoutDurationMs, verbiage]);
13343
13378
  var signatureCaptureProps = useMemo(function () {
13344
13379
  return {
13345
13380
  verbiage: {