datakeen-session-react 1.1.202-dev.16 → 1.1.202-dev.18

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 (108) hide show
  1. package/dist/cjs/components/DatakeenSession.js +17 -16
  2. package/dist/cjs/components/card-capture-guide/CardCaptureGuide.js +139 -0
  3. package/dist/cjs/components/card-capture-guide/captureTelemetry.js +81 -0
  4. package/dist/cjs/components/card-capture-guide/guidance.js +48 -0
  5. package/dist/cjs/components/card-capture-guide/guideCore.js +389 -0
  6. package/dist/cjs/components/card-capture-guide/guideRuntime.js +118 -0
  7. package/dist/cjs/components/card-capture-guide/modelLoader.js +46 -0
  8. package/dist/cjs/components/card-capture-guide/useCaptureGuideThresholds.js +33 -0
  9. package/dist/cjs/components/card-capture-guide/useCardCaptureGuide.js +117 -0
  10. package/dist/cjs/components/card-capture-guide/useMinDisplay.js +30 -0
  11. package/dist/cjs/components/document-collection/DocumentCollection.js +9 -0
  12. package/dist/cjs/components/id-check/Photo.js +230 -122
  13. package/dist/cjs/components/id-check/card-capture/CardCapture.js +270 -0
  14. package/dist/cjs/components/id-check/card-capture/DynamicCardMask.js +85 -0
  15. package/dist/cjs/components/id-check/card-capture/geometry.js +119 -0
  16. package/dist/cjs/components/id-check/card-capture/guideTone.js +15 -0
  17. package/dist/cjs/components/jdi/JDIDocumentSelection.js +9 -0
  18. package/dist/cjs/components/selfie/Video.js +2 -2
  19. package/dist/cjs/components/selfie/selfie-flow/SelfieFlow.js +4 -2
  20. package/dist/cjs/components/session/DocumentCheck.js +37 -2
  21. package/dist/cjs/components/session/EndFlow.js +4 -0
  22. package/dist/cjs/components/session/Selfie.js +1 -1
  23. package/dist/cjs/components/signature-electronic/SignatureElectronic.js +9 -2
  24. package/dist/cjs/components/start-flow/Start.js +4 -0
  25. package/dist/cjs/components/template/TemplateNodeRenderer.js +3 -1
  26. package/dist/cjs/components/ui/Button.js +3 -3
  27. package/dist/cjs/context/CardCaptureGuideContext.js +16 -0
  28. package/dist/cjs/hooks/useClientInfo.js +7 -0
  29. package/dist/cjs/hooks/useUserInputForm.js +3 -1
  30. package/dist/cjs/i18n/en.json.js +57 -1
  31. package/dist/cjs/i18n/es.json.js +57 -1
  32. package/dist/cjs/i18n/fr.json.js +57 -1
  33. package/dist/cjs/index.css.js +1 -1
  34. package/dist/cjs/index.js +15 -0
  35. package/dist/cjs/preview/DatakeenJourneyPreview.js +257 -0
  36. package/dist/cjs/preview/PreviewAutomaticStep.js +23 -0
  37. package/dist/cjs/preview/PreviewBranchPicker.js +54 -0
  38. package/dist/cjs/preview/PreviewCaptureDisabled.js +19 -0
  39. package/dist/cjs/preview/previewAdapter.js +27 -0
  40. package/dist/cjs/preview/previewMode.js +21 -0
  41. package/dist/cjs/preview/previewNavigation.js +105 -0
  42. package/dist/cjs/services/api.js +5 -0
  43. package/dist/cjs/services/cameraService.js +6 -0
  44. package/dist/cjs/services/realtime/sseClient.js +4 -0
  45. package/dist/cjs/services/sessionService.js +50 -0
  46. package/dist/cjs/utils/cssLoader.js +6 -4
  47. package/dist/cjs/utils/isMobileDevice.js +8 -0
  48. package/dist/esm/components/DatakeenSession.js +17 -16
  49. package/dist/esm/components/card-capture-guide/CardCaptureGuide.js +135 -0
  50. package/dist/esm/components/card-capture-guide/captureTelemetry.js +78 -0
  51. package/dist/esm/components/card-capture-guide/guidance.js +44 -0
  52. package/dist/esm/components/card-capture-guide/guideCore.js +372 -0
  53. package/dist/esm/components/card-capture-guide/guideRuntime.js +115 -0
  54. package/dist/esm/components/card-capture-guide/modelLoader.js +42 -0
  55. package/dist/esm/components/card-capture-guide/useCaptureGuideThresholds.js +31 -0
  56. package/dist/esm/components/card-capture-guide/useCardCaptureGuide.js +115 -0
  57. package/dist/esm/components/card-capture-guide/useMinDisplay.js +28 -0
  58. package/dist/esm/components/document-collection/DocumentCollection.js +10 -1
  59. package/dist/esm/components/id-check/Photo.js +232 -124
  60. package/dist/esm/components/id-check/card-capture/CardCapture.js +266 -0
  61. package/dist/esm/components/id-check/card-capture/DynamicCardMask.js +81 -0
  62. package/dist/esm/components/id-check/card-capture/geometry.js +110 -0
  63. package/dist/esm/components/id-check/card-capture/guideTone.js +13 -0
  64. package/dist/esm/components/jdi/JDIDocumentSelection.js +9 -0
  65. package/dist/esm/components/selfie/Video.js +2 -2
  66. package/dist/esm/components/selfie/selfie-flow/SelfieFlow.js +4 -2
  67. package/dist/esm/components/session/DocumentCheck.js +37 -2
  68. package/dist/esm/components/session/EndFlow.js +4 -0
  69. package/dist/esm/components/session/Selfie.js +1 -1
  70. package/dist/esm/components/signature-electronic/SignatureElectronic.js +9 -2
  71. package/dist/esm/components/start-flow/Start.js +4 -0
  72. package/dist/esm/components/template/TemplateNodeRenderer.js +3 -1
  73. package/dist/esm/components/ui/Button.js +3 -3
  74. package/dist/esm/context/CardCaptureGuideContext.js +13 -0
  75. package/dist/esm/hooks/useClientInfo.js +7 -0
  76. package/dist/esm/hooks/useUserInputForm.js +3 -1
  77. package/dist/esm/i18n/en.json.js +55 -2
  78. package/dist/esm/i18n/es.json.js +55 -2
  79. package/dist/esm/i18n/fr.json.js +55 -2
  80. package/dist/esm/index.css.js +1 -1
  81. package/dist/esm/index.js +6 -0
  82. package/dist/esm/preview/DatakeenJourneyPreview.js +253 -0
  83. package/dist/esm/preview/PreviewAutomaticStep.js +19 -0
  84. package/dist/esm/preview/PreviewBranchPicker.js +48 -0
  85. package/dist/esm/preview/PreviewCaptureDisabled.js +15 -0
  86. package/dist/esm/preview/previewAdapter.js +25 -0
  87. package/dist/esm/preview/previewMode.js +15 -0
  88. package/dist/esm/preview/previewNavigation.js +98 -0
  89. package/dist/esm/services/api.js +5 -0
  90. package/dist/esm/services/cameraService.js +6 -0
  91. package/dist/esm/services/realtime/sseClient.js +4 -0
  92. package/dist/esm/services/sessionService.js +49 -1
  93. package/dist/esm/utils/cssLoader.js +6 -4
  94. package/dist/esm/utils/isMobileDevice.js +8 -0
  95. package/dist/types/components/card-capture-guide/CardCaptureGuide.d.ts +46 -0
  96. package/dist/types/components/card-capture-guide/guidance.d.ts +45 -0
  97. package/dist/types/components/card-capture-guide/guideCore.d.ts +96 -0
  98. package/dist/types/components/card-capture-guide/guideRuntime.d.ts +13 -0
  99. package/dist/types/components/card-capture-guide/modelLoader.d.ts +13 -0
  100. package/dist/types/components/card-capture-guide/useCardCaptureGuide.d.ts +38 -0
  101. package/dist/types/index.d.ts +8 -0
  102. package/dist/types/preview/DatakeenJourneyPreview.d.ts +6 -0
  103. package/dist/types/preview/types.d.ts +77 -0
  104. package/dist/types/services/documentTemplate.d.ts +13 -0
  105. package/dist/types/types/camera.d.ts +3 -0
  106. package/dist/types/types/session.d.ts +268 -1
  107. package/dist/types/utils/cssLoader.d.ts +0 -4
  108. package/package.json +2 -1
@@ -15,6 +15,7 @@ import { useI18n } from '../../hooks/useI18n.js';
15
15
  import useIsMobile from '../../hooks/useIsMobile.js';
16
16
  import { resolveEndScreenIcon } from './endScreenIcons.js';
17
17
  import { replaceLocation } from '../../utils/navigation.js';
18
+ import { isPreviewMode } from '../../preview/previewMode.js';
18
19
 
19
20
  // Couleur des icônes = couleur du bouton choisie pour le journey (buttonBgColor).
20
21
  var ICON_COLOR = "var(--dk-btn-bg, #11e5c5)";
@@ -101,6 +102,9 @@ var EndFlow = function (_a) {
101
102
  }, []);
102
103
  var handleEndSession = function () { return __awaiter(void 0, void 0, void 0, function () {
103
104
  return __generator(this, function (_a) {
105
+ // APP3-2057 — aperçu du builder : ni fermeture, ni redirection, ni postMessage, ni nettoyage.
106
+ if (isPreviewMode())
107
+ return [2 /*return*/];
104
108
  setIsEnding(true);
105
109
  try {
106
110
  clearSessionSensitiveData(sessionId);
@@ -45,7 +45,7 @@ var Selfie = function (_a) {
45
45
  var handleRetakeSelfie = function () {
46
46
  setInternalStep(0);
47
47
  };
48
- return (jsxs("div", { className: "h-full w-full transition-opacity duration-500 ".concat(isTransitioning ? "opacity-50" : "opacity-100"), children: [internalStep === 0 && (jsx(Video, { setSelfieData: setSelfieData, setStep: setInternalStep, sessionId: sessionId, iad: node.iad, btnBg: (_b = template.buttonBgColor) !== null && _b !== void 0 ? _b : "#11E5C5", btnText: (_c = template.buttonTextColor) !== null && _c !== void 0 ? _c : "#3C3C40" })), internalStep === 1 && selfieData && (jsx(SelfieConfirmation, { selfieData: selfieData, onConfirm: handleConfirmSelfie, onRetake: handleRetakeSelfie, setSelfiePhoto: setSelfiePhoto })), internalStep === 2 && selfieData && (jsx(SelfieProcessing, { onProcessingComplete: selfieProcessed, selfieVideo: selfieData, selfiePhoto: selfiePhoto, onRetake: onRetake, nodeId: node.id, onContinueAnyway: node.allowContinueOnFailure === false
48
+ return (jsxs("div", { className: "h-full w-full transition-opacity duration-500 ".concat(isTransitioning ? "opacity-50" : "opacity-100"), children: [internalStep === 0 && (jsx(Video, { setSelfieData: setSelfieData, setStep: setInternalStep, sessionId: sessionId, iad: node.iad, btnBg: (_b = template.buttonBgColor) !== null && _b !== void 0 ? _b : "#11E5C5", btnText: (_c = template.buttonTextColor) !== null && _c !== void 0 ? _c : "#3C3C40", onPreviewContinue: function () { return stepObject.goToNextStep(node.id, template); } })), internalStep === 1 && selfieData && (jsx(SelfieConfirmation, { selfieData: selfieData, onConfirm: handleConfirmSelfie, onRetake: handleRetakeSelfie, setSelfiePhoto: setSelfiePhoto })), internalStep === 2 && selfieData && (jsx(SelfieProcessing, { onProcessingComplete: selfieProcessed, selfieVideo: selfieData, selfiePhoto: selfiePhoto, onRetake: onRetake, nodeId: node.id, onContinueAnyway: node.allowContinueOnFailure === false
49
49
  ? undefined
50
50
  : handleContinueAnyway }))] }));
51
51
  };
@@ -5,6 +5,8 @@ import sdkI18n from '../../i18n/index.js';
5
5
  import SignatureElectronicIntroduction from './SignatureElectronicIntroduction.js';
6
6
  import DocusealSignature from './DocusealSignature.js';
7
7
  import SignedDocumentPreview from './SignedDocumentPreview.js';
8
+ import { isPreviewMode } from '../../preview/previewMode.js';
9
+ import PreviewCaptureDisabled from '../../preview/PreviewCaptureDisabled.js';
8
10
 
9
11
  /**
10
12
  * Maps an InformationFieldKey (journey field) to the corresponding UserInput key.
@@ -28,14 +30,15 @@ var SignatureElectronic = function (_a) {
28
30
  var t = useTranslation("translation", { i18n: sdkI18n }).t;
29
31
  var signatureViewStorageKey = useMemo(function () { return "dk-signature-open:".concat(sessionId, ":").concat(external_id !== null && external_id !== void 0 ? external_id : "no-template"); }, [sessionId, external_id]);
30
32
  var _c = useState(function () {
31
- if (typeof window === "undefined")
33
+ if (typeof window === "undefined" || isPreviewMode())
32
34
  return false;
33
35
  return window.sessionStorage.getItem(signatureViewStorageKey) === "1";
34
36
  }), showSignature = _c[0], setShowSignature = _c[1];
35
37
  var _d = useState(false), showSignedDocumentPreview = _d[0], setShowSignedDocumentPreview = _d[1];
36
38
  var _e = useState(null), signedAt = _e[0], setSignedAt = _e[1];
37
39
  useEffect(function () {
38
- if (typeof window === "undefined")
40
+ // APP3-2057 — aperçu du builder : rien n'est écrit dans le stockage du navigateur.
41
+ if (typeof window === "undefined" || isPreviewMode())
39
42
  return;
40
43
  if (showSignature) {
41
44
  window.sessionStorage.setItem(signatureViewStorageKey, "1");
@@ -115,6 +118,10 @@ var SignatureElectronic = function (_a) {
115
118
  if (showSignedDocumentPreview) {
116
119
  return (jsx(SignedDocumentPreview, { sessionId: sessionId, nodeId: node.id, nodeTitle: node.pageTitle || node.title, completedAt: signedAt, logo: (_b = session === null || session === void 0 ? void 0 : session.template) === null || _b === void 0 ? void 0 : _b.logo, title: node.signedScreenTitle, description: node.signedScreenDescription, downloadHint: node.signedScreenDownloadHint, onContinue: handleContinueFromPreview }));
117
120
  }
121
+ // APP3-2057 — aperçu du builder : pas de signature Docuseal (ni jeton, ni iframe tierce).
122
+ if (showSignature && isPreviewMode()) {
123
+ return jsx(PreviewCaptureDisabled, { onContinue: handleContinueFromPreview });
124
+ }
118
125
  if (showSignature && external_id) {
119
126
  return (jsx(DocusealSignature, { sessionId: sessionId, templateId: external_id, templateName: title, onComplete: handleComplete, onBack: handleBack, prefillValues: prefillValues, readonlyFieldNames: readonlyFieldNames }));
120
127
  }
@@ -9,6 +9,7 @@ import '../../utils/cssLoader.js';
9
9
  import '../../context/DocumentContext.js';
10
10
  import '../../services/api.js';
11
11
  import '../../config/env.js';
12
+ import '../../context/CardCaptureGuideContext.js';
12
13
  import 'axios';
13
14
  import '../../services/auditTrailService.js';
14
15
  import 'ua-parser-js';
@@ -34,6 +35,8 @@ import '../../assets/selfietake.svg.js';
34
35
  import '../../assets/before-passport.png.js';
35
36
  import '../../services/cameraService.js';
36
37
  import '../../services/documentEdgeDetectionService.js';
38
+ import '../card-capture-guide/guideCore.js';
39
+ import '../card-capture-guide/captureTelemetry.js';
37
40
  import '../document-video/document-video-flow/DocumentVideoFlow.js';
38
41
  import '../document-collection/DocumentProcessing.js';
39
42
  import '../../constants/userInputForm.js';
@@ -48,6 +51,7 @@ import '@radix-ui/react-checkbox';
48
51
  import '@radix-ui/react-icons';
49
52
  import '../../services/professionalImageQuality.js';
50
53
  import '../../providers/I18nProvider.js';
54
+ import '../card-capture-guide/CardCaptureGuide.js';
51
55
 
52
56
  var Start = function (_a) {
53
57
  var setStep = _a.setStep, welcomeTitle = _a.welcomeTitle, welcomeSubtitle = _a.welcomeSubtitle, welcomeDescription = _a.welcomeDescription, welcomeImage = _a.welcomeImage, session = _a.session;
@@ -18,6 +18,7 @@ import SignatureElectronic from '../signature-electronic/SignatureElectronic.js'
18
18
  import ExternalVerificationNodeHandler from './ExternalVerificationNodeHandler.js';
19
19
  import PdfGeneration from '../session/PdfGeneration.js';
20
20
  import LegalConsentNode from '../legal-consent/LegalConsentNode.js';
21
+ import { isMobileDevice } from '../../utils/isMobileDevice.js';
21
22
 
22
23
  var TemplateNodeRenderer = function (_a) {
23
24
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
@@ -105,7 +106,8 @@ var TemplateNodeRenderer = function (_a) {
105
106
  return (jsxs("div", { className: "flex flex-col items-center justify-center h-full p-4 text-center", children: [jsx("div", { className: "text-red-500 text-4xl mb-4", children: "\u26A0\uFE0F" }), jsx("h2", { className: "text-xl font-bold text-red-600 mb-2", children: "Erreur de configuration" }), jsx("p", { className: "text-gray-600 mb-4", children: "Le type de document requis n'est pas sp\u00E9cifi\u00E9 dans le template." }), jsx("button", { className: "px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors", onClick: function () { return stepObject.setStep(0); }, children: "Recommencer" })] }));
106
107
  }
107
108
  // Determine if current device is mobile for capture method
108
- var isMobile = /Android|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i.test(navigator.userAgent);
109
+ // (même détection par user-agent ; suit l'appareil simulé en aperçu, APP3-2057).
110
+ var isMobile = isMobileDevice();
109
111
  return (jsx(DocumentCheck, { stepObject: stepObject, node: node, sessionId: sessionId, documentTypeId: node.requiredDocumentType, acceptedCountries: node.acceptedCountries, onContinueOnPC: onContinueOnPC, isMobileCapture: isMobileTemplate && isMobile, allowedAddingMethods: node.allowedAddingMethods || ["download", "picture"], template: session.template, templateIndex: templateIndex, setUserInput: setUserInput }, "doc-check-".concat(templateIndex)));
110
112
  // }
111
113
  }
@@ -4,7 +4,7 @@ import useIsMobile from '../../hooks/useIsMobile.js';
4
4
 
5
5
  var Button = function (_a) {
6
6
  var _b, _c;
7
- var _d = _a.variant, variant = _d === void 0 ? "primary" : _d, children = _a.children, _e = _a.className, className = _e === void 0 ? "" : _e, style = _a.style, onClick = _a.onClick, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.type, type = _g === void 0 ? "button" : _g;
7
+ var _d = _a.variant, variant = _d === void 0 ? "primary" : _d, children = _a.children, _e = _a.className, className = _e === void 0 ? "" : _e, style = _a.style, onClick = _a.onClick, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.type, type = _g === void 0 ? "button" : _g, testId = _a.testId;
8
8
  var isMobile = useIsMobile(768);
9
9
  var baseShared = "flex items-center justify-center gap-2 shrink-0 font-poppins text-sm font-medium leading-[110%] transition-filter";
10
10
  var base = isMobile
@@ -13,13 +13,13 @@ var Button = function (_a) {
13
13
  if (variant === "secondary") {
14
14
  return (jsx("button", { type: type, className: "".concat(base, " bg-transparent border border-gray-300 text-gray-600 ").concat(disabled
15
15
  ? "opacity-60 cursor-not-allowed"
16
- : "hover:bg-black/5 cursor-pointer", " ").concat(className), onClick: onClick, disabled: disabled, children: children }));
16
+ : "hover:bg-black/5 cursor-pointer", " ").concat(className), onClick: onClick, disabled: disabled, "data-testid": testId, children: children }));
17
17
  }
18
18
  return (jsx("button", { type: type, className: "".concat(base, " ").concat(disabled
19
19
  ? "bg-gray-200 text-gray-400 cursor-not-allowed opacity-60"
20
20
  : "hover:brightness-110 active:brightness-90 cursor-pointer", " ").concat(className), style: disabled
21
21
  ? style
22
- : __assign(__assign({}, style), { backgroundColor: (_b = style === null || style === void 0 ? void 0 : style.backgroundColor) !== null && _b !== void 0 ? _b : "var(--dk-btn-bg)", color: (_c = style === null || style === void 0 ? void 0 : style.color) !== null && _c !== void 0 ? _c : "var(--dk-btn-text)" }), onClick: onClick, disabled: disabled, children: children }));
22
+ : __assign(__assign({}, style), { backgroundColor: (_b = style === null || style === void 0 ? void 0 : style.backgroundColor) !== null && _b !== void 0 ? _b : "var(--dk-btn-bg)", color: (_c = style === null || style === void 0 ? void 0 : style.color) !== null && _c !== void 0 ? _c : "var(--dk-btn-text)" }), onClick: onClick, disabled: disabled, "data-testid": testId, children: children }));
23
23
  };
24
24
 
25
25
  export { Button as default };
@@ -0,0 +1,13 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { createContext, useContext } from 'react';
3
+
4
+ var EMPTY = {};
5
+ var CardCaptureGuideConfigContext = createContext(EMPTY);
6
+ /** Makes `sessionConfig.cardCaptureGuide` readable by the capture screens deep in the tree. */
7
+ var CardCaptureGuideConfigProvider = function (_a) {
8
+ var value = _a.value, children = _a.children;
9
+ return jsx(CardCaptureGuideConfigContext.Provider, { value: value !== null && value !== void 0 ? value : EMPTY, children: children });
10
+ };
11
+ var useCardCaptureGuideConfig = function () { return useContext(CardCaptureGuideConfigContext); };
12
+
13
+ export { CardCaptureGuideConfigProvider, useCardCaptureGuideConfig };
@@ -1,5 +1,6 @@
1
1
  import { useState, useEffect } from 'react';
2
2
  import { UAParser } from 'ua-parser-js';
3
+ import { isPreviewMode } from '../preview/previewMode.js';
3
4
 
4
5
  var getClientInfoFromUA = function () {
5
6
  var uaResult = new UAParser().getResult();
@@ -18,6 +19,12 @@ var useClientInfo = function () {
18
19
  var _b = useState(false), isLoaded = _b[0], setIsLoaded = _b[1];
19
20
  useEffect(function () {
20
21
  var _a = getClientInfoFromUA(), device = _a.device, browser = _a.browser, os = _a.os;
22
+ // APP3-2057 — aperçu du builder : pas de géolocalisation IP (aucun appel tiers).
23
+ if (isPreviewMode()) {
24
+ setInfo({ device: device, browser: browser, os: os, ip: "unknown_ip", location: "unknown_location" });
25
+ setIsLoaded(true);
26
+ return;
27
+ }
21
28
  fetch("https://ipapi.co/json/")
22
29
  .then(function (response) { return response.json(); })
23
30
  .then(function (data) {
@@ -13,6 +13,7 @@ import { useI18n } from './useI18n.js';
13
13
  import { logFormValidated } from '../services/auditTrailService.js';
14
14
  import { fetchSessionById } from '../services/sessionService.js';
15
15
  import { extractedRootTarget } from '../utils/extractedCopy.js';
16
+ import { isPreviewMode } from '../preview/previewMode.js';
16
17
 
17
18
  var useUserInputForm = function (_a) {
18
19
  var stepObject = _a.stepObject, setUserInput = _a.setUserInput, initialUserInput = _a.initialUserInput, node = _a.node, template = _a.template, contactInfo = _a.contactInfo, setContactInfo = _a.setContactInfo, onContinueCallback = _a.onContinueCallback, sessionId = _a.sessionId;
@@ -177,7 +178,8 @@ var useUserInputForm = function (_a) {
177
178
  clearTimeout(addressRequestState.current.debounce);
178
179
  addressRequestState.current.debounce = null;
179
180
  }
180
- if (query.trim().length < 3) {
181
+ // APP3-2057 — aperçu du builder : pas d'appel au service d'autocomplétion d'adresse.
182
+ if (query.trim().length < 3 || isPreviewMode()) {
181
183
  if (addressRequestState.current.controller) {
182
184
  addressRequestState.current.controller.abort();
183
185
  addressRequestState.current.controller = null;
@@ -1129,6 +1129,56 @@ var complementary_mandate = {
1129
1129
  error: "The mandate check failed. Please try again.",
1130
1130
  retry: "Try again"
1131
1131
  };
1132
+ var card_capture_guide = {
1133
+ loading: "Loading guide…",
1134
+ no_card: "Position your ID card in frame",
1135
+ too_far: "Move the card closer",
1136
+ too_dark: "Increase the brightness",
1137
+ card_detected: "Card detected — keep it in view",
1138
+ hold_still: "Hold still…",
1139
+ too_blurry: "Adjust the focus",
1140
+ bright_spot: "Avoid reflections",
1141
+ ready: "Perfect — capturing",
1142
+ camera_error: "Unable to start the camera",
1143
+ model_error: "Unable to load the card guide"
1144
+ };
1145
+ var card_capture = {
1146
+ side: {
1147
+ recto: "Front",
1148
+ verso: "Back"
1149
+ },
1150
+ shutter: "Take the photo",
1151
+ switch_camera: "Switch camera",
1152
+ nudge: "You can also take the photo yourself",
1153
+ fallback: "Place the card in the frame, then press the button",
1154
+ saving: "Saving the photo…",
1155
+ saved: "Photo saved"
1156
+ };
1157
+ var preview = {
1158
+ automatic: {
1159
+ description: "This step runs automatically during the journey, without any user action.",
1160
+ choose_branch: "Choose which path to show in the preview.",
1161
+ no_branch: "This step is not connected to any next step."
1162
+ },
1163
+ branch_picker: {
1164
+ title: "Which path should be shown?",
1165
+ description: "In a real journey, the next step depends on the result of this step. Choose the branch to preview."
1166
+ },
1167
+ branch: {
1168
+ "true": "True",
1169
+ "false": "False",
1170
+ compliant: "Compliant",
1171
+ non_compliant: "Non-compliant",
1172
+ to_verify: "To verify",
1173
+ validated: "Validated",
1174
+ invalidated: "Invalidated",
1175
+ unnamed: "Next step"
1176
+ },
1177
+ capture_disabled: {
1178
+ title: "Capture disabled in preview",
1179
+ description: "In the preview, the camera, file uploads, signature and analyses are not started."
1180
+ }
1181
+ };
1132
1182
  var enTranslations = {
1133
1183
  start: start,
1134
1184
  user_input_form: user_input_form,
@@ -1187,7 +1237,10 @@ var enTranslations = {
1187
1237
  nfc_scan: nfc_scan,
1188
1238
  inpi_verification: inpi_verification,
1189
1239
  signed_document: signed_document,
1190
- complementary_mandate: complementary_mandate
1240
+ complementary_mandate: complementary_mandate,
1241
+ card_capture_guide: card_capture_guide,
1242
+ card_capture: card_capture,
1243
+ preview: preview
1191
1244
  };
1192
1245
 
1193
- export { LEGAL_CONSENT, before, before_verso, buttons, camera, complementary_mandate, custom_form, enTranslations as default, documentTypes, document_check, document_collection, document_upload, document_video, errors, id_check, inpi_verification, jdi, language_selection, loading, nfc_scan, orientation, pdf_generation, photo, powered_by, processing, qr_code, select_component, selfie, session, signature, signed_document, start, start_verification, success, unissey, user_guidance, user_input_form, validation_points };
1246
+ export { LEGAL_CONSENT, before, before_verso, buttons, camera, card_capture, card_capture_guide, complementary_mandate, custom_form, enTranslations as default, documentTypes, document_check, document_collection, document_upload, document_video, errors, id_check, inpi_verification, jdi, language_selection, loading, nfc_scan, orientation, pdf_generation, photo, powered_by, preview, processing, qr_code, select_component, selfie, session, signature, signed_document, start, start_verification, success, unissey, user_guidance, user_input_form, validation_points };
@@ -1129,6 +1129,56 @@ var complementary_mandate = {
1129
1129
  error: "La verificación del mandato ha fallado. Inténtelo de nuevo.",
1130
1130
  retry: "Reintentar"
1131
1131
  };
1132
+ var card_capture_guide = {
1133
+ loading: "Cargando la guía…",
1134
+ no_card: "Coloque su documento de identidad en el marco",
1135
+ too_far: "Acerque la tarjeta",
1136
+ too_dark: "Aumente la luminosidad",
1137
+ card_detected: "Tarjeta detectada — manténgala en el marco",
1138
+ hold_still: "No se mueva…",
1139
+ too_blurry: "Ajuste el enfoque",
1140
+ bright_spot: "Evite los reflejos",
1141
+ ready: "Perfecto — capturando",
1142
+ camera_error: "No se puede iniciar la cámara",
1143
+ model_error: "No se puede cargar la guía de captura"
1144
+ };
1145
+ var card_capture = {
1146
+ side: {
1147
+ recto: "Anverso",
1148
+ verso: "Reverso"
1149
+ },
1150
+ shutter: "Tomar la foto",
1151
+ switch_camera: "Cambiar de cámara",
1152
+ nudge: "También puede tomar la foto usted mismo",
1153
+ fallback: "Coloque la tarjeta en el marco y pulse el botón",
1154
+ saving: "Guardando la foto…",
1155
+ saved: "Foto guardada"
1156
+ };
1157
+ var preview = {
1158
+ automatic: {
1159
+ description: "Este paso se ejecuta automáticamente durante el recorrido, sin acción del usuario.",
1160
+ choose_branch: "Elija qué continuación mostrar en la vista previa.",
1161
+ no_branch: "Este paso no está conectado a ningún paso siguiente."
1162
+ },
1163
+ branch_picker: {
1164
+ title: "¿Qué continuación mostrar?",
1165
+ description: "En un recorrido real, la continuación depende del resultado de este paso. Elija la rama que desea previsualizar."
1166
+ },
1167
+ branch: {
1168
+ "true": "Verdadero",
1169
+ "false": "Falso",
1170
+ compliant: "Conforme",
1171
+ non_compliant: "No conforme",
1172
+ to_verify: "Por verificar",
1173
+ validated: "Validado",
1174
+ invalidated: "Invalidado",
1175
+ unnamed: "Paso siguiente"
1176
+ },
1177
+ capture_disabled: {
1178
+ title: "Captura desactivada en la vista previa",
1179
+ description: "En la vista previa no se inician la cámara, el envío de archivos, la firma ni los análisis."
1180
+ }
1181
+ };
1132
1182
  var esTranslations = {
1133
1183
  start: start,
1134
1184
  user_input_form: user_input_form,
@@ -1187,7 +1237,10 @@ var esTranslations = {
1187
1237
  nfc_scan: nfc_scan,
1188
1238
  inpi_verification: inpi_verification,
1189
1239
  signed_document: signed_document,
1190
- complementary_mandate: complementary_mandate
1240
+ complementary_mandate: complementary_mandate,
1241
+ card_capture_guide: card_capture_guide,
1242
+ card_capture: card_capture,
1243
+ preview: preview
1191
1244
  };
1192
1245
 
1193
- export { LEGAL_CONSENT, before, before_verso, buttons, camera, complementary_mandate, custom_form, esTranslations as default, documentTypes, document_check, document_collection, document_upload, document_video, errors, id_check, inpi_verification, jdi, language_selection, loading, nfc_scan, orientation, pdf_generation, photo, powered_by, processing, qr_code, select_component, selfie, session, signature, signed_document, start, start_verification, success, unissey, user_guidance, user_input_form, validation_points };
1246
+ export { LEGAL_CONSENT, before, before_verso, buttons, camera, card_capture, card_capture_guide, complementary_mandate, custom_form, esTranslations as default, documentTypes, document_check, document_collection, document_upload, document_video, errors, id_check, inpi_verification, jdi, language_selection, loading, nfc_scan, orientation, pdf_generation, photo, powered_by, preview, processing, qr_code, select_component, selfie, session, signature, signed_document, start, start_verification, success, unissey, user_guidance, user_input_form, validation_points };
@@ -1129,6 +1129,56 @@ var complementary_mandate = {
1129
1129
  error: "La vérification du mandat a échoué. Veuillez réessayer.",
1130
1130
  retry: "Réessayer"
1131
1131
  };
1132
+ var card_capture_guide = {
1133
+ loading: "Chargement du guide…",
1134
+ no_card: "Placez votre pièce d'identité dans le cadre",
1135
+ too_far: "Rapprochez la carte",
1136
+ too_dark: "Augmenter la luminosité",
1137
+ card_detected: "Carte détectée — gardez-la dans le cadre",
1138
+ hold_still: "Ne bougez plus…",
1139
+ too_blurry: "Ajuster la focalisation",
1140
+ bright_spot: "Éviter les reflets",
1141
+ ready: "Parfait — capture en cours",
1142
+ camera_error: "Impossible de démarrer la caméra",
1143
+ model_error: "Impossible de charger le guide de capture"
1144
+ };
1145
+ var card_capture = {
1146
+ side: {
1147
+ recto: "Recto",
1148
+ verso: "Verso"
1149
+ },
1150
+ shutter: "Prendre la photo",
1151
+ switch_camera: "Changer de caméra",
1152
+ nudge: "Vous pouvez aussi prendre la photo vous-même",
1153
+ fallback: "Placez la carte dans le cadre puis appuyez sur le bouton",
1154
+ saving: "Enregistrement de la photo…",
1155
+ saved: "Photo enregistrée"
1156
+ };
1157
+ var preview = {
1158
+ automatic: {
1159
+ description: "Cette étape s'exécute automatiquement pendant le parcours, sans action de l'utilisateur.",
1160
+ choose_branch: "Choisissez la suite à afficher dans l'aperçu.",
1161
+ no_branch: "Cette étape n'est reliée à aucune étape suivante."
1162
+ },
1163
+ branch_picker: {
1164
+ title: "Quelle suite afficher ?",
1165
+ description: "Dans un vrai parcours, la suite dépend du résultat de cette étape. Choisissez la branche à prévisualiser."
1166
+ },
1167
+ branch: {
1168
+ "true": "Vrai",
1169
+ "false": "Faux",
1170
+ compliant: "Conforme",
1171
+ non_compliant: "Non conforme",
1172
+ to_verify: "À vérifier",
1173
+ validated: "Validé",
1174
+ invalidated: "Invalidé",
1175
+ unnamed: "Étape suivante"
1176
+ },
1177
+ capture_disabled: {
1178
+ title: "Capture désactivée dans l'aperçu",
1179
+ description: "Dans l'aperçu, la caméra, l'envoi de fichiers, la signature et les analyses ne sont pas lancés."
1180
+ }
1181
+ };
1132
1182
  var frTranslations = {
1133
1183
  start: start,
1134
1184
  user_input_form: user_input_form,
@@ -1187,7 +1237,10 @@ var frTranslations = {
1187
1237
  nfc_scan: nfc_scan,
1188
1238
  inpi_verification: inpi_verification,
1189
1239
  signed_document: signed_document,
1190
- complementary_mandate: complementary_mandate
1240
+ complementary_mandate: complementary_mandate,
1241
+ card_capture_guide: card_capture_guide,
1242
+ card_capture: card_capture,
1243
+ preview: preview
1191
1244
  };
1192
1245
 
1193
- export { LEGAL_CONSENT, before, before_verso, buttons, camera, complementary_mandate, custom_form, frTranslations as default, documentTypes, document_check, document_collection, document_upload, document_video, errors, id_check, inpi_verification, jdi, language_selection, loading, nfc_scan, orientation, pdf_generation, photo, powered_by, processing, qr_code, select_component, selfie, session, signature, signed_document, start, start_verification, success, unissey, user_guidance, user_input_form, validation_points };
1246
+ export { LEGAL_CONSENT, before, before_verso, buttons, camera, card_capture, card_capture_guide, complementary_mandate, custom_form, frTranslations as default, documentTypes, document_check, document_collection, document_upload, document_video, errors, id_check, inpi_verification, jdi, language_selection, loading, nfc_scan, orientation, pdf_generation, photo, powered_by, preview, processing, qr_code, select_component, selfie, session, signature, signed_document, start, start_verification, success, unissey, user_guidance, user_input_form, validation_points };