datakeen-session-react 1.1.195-dev.6 → 1.1.195-dev.7

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 (38) hide show
  1. package/dist/cjs/components/document-collection/DocumentError.js +5 -1
  2. package/dist/cjs/components/document-collection/DocumentError.js.map +1 -1
  3. package/dist/cjs/components/document-collection/DocumentProcessing.js +13 -11
  4. package/dist/cjs/components/document-collection/DocumentProcessing.js.map +1 -1
  5. package/dist/cjs/components/document-video/document-video-flow/DocumentVideoProcessing.js +9 -5
  6. package/dist/cjs/components/document-video/document-video-flow/DocumentVideoProcessing.js.map +1 -1
  7. package/dist/cjs/components/jdi/JDIError.js +5 -1
  8. package/dist/cjs/components/jdi/JDIError.js.map +1 -1
  9. package/dist/cjs/components/jdi/JDIProcessing.js +12 -11
  10. package/dist/cjs/components/jdi/JDIProcessing.js.map +1 -1
  11. package/dist/cjs/i18n/en.json.js +3 -1
  12. package/dist/cjs/i18n/en.json.js.map +1 -1
  13. package/dist/cjs/i18n/es.json.js +3 -1
  14. package/dist/cjs/i18n/es.json.js.map +1 -1
  15. package/dist/cjs/i18n/fr.json.js +3 -1
  16. package/dist/cjs/i18n/fr.json.js.map +1 -1
  17. package/dist/cjs/utils/analysisErrors.js +33 -12
  18. package/dist/cjs/utils/analysisErrors.js.map +1 -1
  19. package/dist/esm/components/document-collection/DocumentError.js +5 -1
  20. package/dist/esm/components/document-collection/DocumentError.js.map +1 -1
  21. package/dist/esm/components/document-collection/DocumentProcessing.js +14 -12
  22. package/dist/esm/components/document-collection/DocumentProcessing.js.map +1 -1
  23. package/dist/esm/components/document-video/document-video-flow/DocumentVideoProcessing.js +9 -5
  24. package/dist/esm/components/document-video/document-video-flow/DocumentVideoProcessing.js.map +1 -1
  25. package/dist/esm/components/jdi/JDIError.js +5 -1
  26. package/dist/esm/components/jdi/JDIError.js.map +1 -1
  27. package/dist/esm/components/jdi/JDIProcessing.js +13 -12
  28. package/dist/esm/components/jdi/JDIProcessing.js.map +1 -1
  29. package/dist/esm/i18n/en.json.js +3 -1
  30. package/dist/esm/i18n/en.json.js.map +1 -1
  31. package/dist/esm/i18n/es.json.js +3 -1
  32. package/dist/esm/i18n/es.json.js.map +1 -1
  33. package/dist/esm/i18n/fr.json.js +3 -1
  34. package/dist/esm/i18n/fr.json.js.map +1 -1
  35. package/dist/esm/utils/analysisErrors.js +30 -12
  36. package/dist/esm/utils/analysisErrors.js.map +1 -1
  37. package/docs/POLLING_SYSTEM.md +4 -0
  38. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"JDIError.js","sources":["../../../../../src/components/jdi/JDIError.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport Button from \"../ui/Button\";\nimport ButtonDesktop from \"../ui/ButtonDesktop\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport { Prediction } from \"../../utils/apiAnalysis\";\nimport { getValidationPoints } from \"../../utils/validationUtils\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\n\ninterface JDIErrorProps {\n documentType: string;\n onRetry: () => void;\n /** Absent quand node.allowContinueOnFailure est à false : le bouton \"Continuer\n * quand même\" n'est alors jamais rendu, quel que soit isRetryAllowed. */\n onContinueAnyway?: () => void;\n onBackToUserInput?: () => void;\n retryCount?: number;\n predictions?: Prediction[]; // Nouvelles données de l'API\n errorCode?: string; // Error code from API response (e.g., \"2.1\", \"4.0\")\n allowResubmission?: boolean;\n maxResubmissionAttempts?: number;\n isRetryAllowed?: boolean;\n blockContinue?: boolean;\n}\n\nconst DEFAULT_PREDICTIONS: Prediction[] = [];\n\nconst JDIError = ({\n documentType,\n onRetry,\n onContinueAnyway,\n onBackToUserInput,\n retryCount = 0,\n predictions = DEFAULT_PREDICTIONS,\n errorCode,\n allowResubmission,\n maxResubmissionAttempts,\n isRetryAllowed = true,\n blockContinue = false,\n}: JDIErrorProps) => {\n const { t } = useI18n();\n const [validationPoints, setValidationPoints] = useState<string[]>([]);\n\n // Détail de mismatch d'identité (code 7.0), calculé côté backend et porté\n // par la première prédiction. Absent pour tous les autres codes.\n const mismatchDetails = predictions?.[0]?.mismatchDetails;\n\n useEffect(() => {\n // Use shared utility to get validation points\n setValidationPoints(\n getValidationPoints(errorCode, predictions, t, \"error\", mismatchDetails),\n );\n }, [predictions, errorCode, t, mismatchDetails]);\n\n // Get user guidance message if available\n const getUserGuidance = (): string | null => {\n if (!errorCode) return null;\n const guidance = t(`user_guidance.${errorCode}`, \"\");\n return guidance || null;\n };\n\n return (\n <MobilePageLayout\n footer={\n <div className=\"w-full max-w-md mx-auto\">\n <div className=\"flex flex-col space-y-3 md:hidden\">\n {blockContinue ? (\n <Button onClick={onRetry} className=\"w-full py-3\">\n {t(\"errors.retry_verification\")}\n </Button>\n ) : (\n <>\n {onBackToUserInput && (\n <ButtonDesktop\n onClick={onBackToUserInput}\n type=\"back\"\n className=\"w-full text-black text-center font-poppins text-sm font-medium py-2\"\n >\n {t(\"errors.back_to_user_input\")}\n </ButtonDesktop>\n )}\n {retryCount >= 1 && isRetryAllowed && onContinueAnyway && (\n <ButtonDesktop\n onClick={onContinueAnyway}\n type=\"back\"\n className=\"w-full text-black text-center font-poppins text-sm font-medium py-2\"\n >\n {t(\"errors.continue_anyway\")}\n </ButtonDesktop>\n )}\n {isRetryAllowed && (\n <Button onClick={onRetry} className=\"w-full py-3\">\n {t(\"errors.retry_verification\")}\n </Button>\n )}\n {!isRetryAllowed && onContinueAnyway && (\n <Button onClick={onContinueAnyway} className=\"w-full py-3\">\n {t(\"errors.continue_anyway\")}\n </Button>\n )}\n </>\n )}\n </div>\n <div className=\"hidden md:flex flex-col space-y-3\">\n <div className=\"flex justify-center space-x-3\">\n {blockContinue ? (\n <ButtonDesktop onClick={onRetry} type=\"continue\">\n {t(\"errors.retry_verification\")}\n </ButtonDesktop>\n ) : (\n <>\n {onBackToUserInput && (\n <ButtonDesktop\n onClick={onBackToUserInput}\n type=\"back\"\n className=\"text-black text-center font-poppins text-sm font-medium py-2\"\n >\n {t(\"errors.back_to_user_input\")}\n </ButtonDesktop>\n )}\n {retryCount >= 1 && isRetryAllowed && onContinueAnyway && (\n <ButtonDesktop\n onClick={onContinueAnyway}\n type=\"back\"\n className=\"text-black text-center font-poppins text-sm font-medium py-2\"\n >\n {t(\"errors.continue_anyway\")}\n </ButtonDesktop>\n )}\n {isRetryAllowed && (\n <ButtonDesktop onClick={onRetry} type=\"continue\">\n {t(\"errors.retry_verification\")}\n </ButtonDesktop>\n )}\n {!isRetryAllowed && onContinueAnyway && (\n <ButtonDesktop\n onClick={onContinueAnyway}\n type=\"continue\"\n >\n {t(\"errors.continue_anyway\")}\n </ButtonDesktop>\n )}\n </>\n )}\n </div>\n </div>\n </div>\n }\n >\n <div className=\"px-4 py-6 pt-11 md:px-8 md:py-8\">\n <div className=\"w-full max-w-md mx-auto space-y-6\">\n {/* Error icon */}\n <div className=\"text-center\">\n <div className=\"mx-auto w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mb-4\">\n <div className=\"w-8 h-8 bg-red-500 rounded-full flex items-center justify-center\">\n <span className=\"text-white text-lg\">✕</span>\n </div>\n </div>\n </div>\n\n {/* Header */}\n <div className=\"text-center space-y-4\">\n <Title className=\"text-xl md:text-2xl lg:text-3xl text-red-600\">\n {blockContinue\n ? t(\"errors.upload_not_confirmed.title\")\n : t(\"errors.verification_failed\")}\n </Title>\n <Subtitle className=\"text-sm text-gray-600 leading-relaxed\">\n {blockContinue\n ? t(\"errors.upload_not_confirmed.subtitle\")\n : isRetryAllowed\n ? t(\"errors.verification_failed_subtitle\", {\n documentType: \"document\",\n })\n : t(\"errors.verification_failed_subtitle_no_retry\", {\n documentType: \"document\",\n })}\n </Subtitle>\n </div>\n\n {/* Specimen warning */}\n {!blockContinue && errorCode?.startsWith(\"8\") && (\n <div className=\"bg-orange-50 border border-orange-200 rounded-lg p-4\">\n <p className=\"text-sm text-orange-800\">\n {t(\"errors.specimen_detected\")}\n </p>\n </div>\n )}\n\n {/* Error details - Validation Points */}\n {!blockContinue && (\n <div className=\"bg-red-50 border border-red-200 rounded-lg p-4\">\n <h3 className=\"font-medium text-red-900 mb-2\">\n {t(\"errors.problems_detected\")}\n </h3>\n <div className=\"text-sm text-red-800 space-y-1\">\n {validationPoints.map((point, index) => (\n <p key={index}>{point}</p>\n ))}\n </div>\n </div>\n )}\n\n {/* Resubmission limit message */}\n {!blockContinue && !isRetryAllowed && (\n <div className=\"bg-orange-50 border border-orange-200 rounded-lg p-4\">\n <h3 className=\"font-medium text-orange-900 mb-2\">\n {t(\"errors.resubmission.max_attempts_reached\")}\n </h3>\n <p className=\"text-sm text-orange-800\">\n {maxResubmissionAttempts !== undefined\n ? t(\"errors.resubmission.max_attempts_reached_description\")\n : t(\"errors.resubmission.no_resubmission_allowed\")}\n </p>\n </div>\n )}\n\n {/* User guidance - specific advice based on error code */}\n {!blockContinue && getUserGuidance() && (\n <div className=\"bg-yellow-50 border border-yellow-200 rounded-lg p-4\">\n <h3 className=\"font-medium text-yellow-900 mb-2\">\n 💡 {t(\"errors.improvement_tips\")}\n </h3>\n <p className=\"text-sm text-yellow-800\">{getUserGuidance()}</p>\n </div>\n )}\n\n {/* Next steps */}\n {!blockContinue && isRetryAllowed && (\n <div className=\"bg-blue-50 border border-blue-200 rounded-lg p-4\">\n <h3 className=\"font-medium text-blue-900 mb-2\">\n {t(\"errors.next_steps\")}\n </h3>\n <p className=\"text-sm text-blue-800\">\n {t(\"errors.next_steps_description\")}\n </p>\n </div>\n )}\n </div>\n </div>\n </MobilePageLayout>\n );\n};\n\nexport default JDIError;\n"],"names":["useI18n","useState","useEffect","getValidationPoints","_jsx","MobilePageLayout","_jsxs","Button","ButtonDesktop","Title","Subtitle"],"mappings":";;;;;;;;;;;;;;AA0BA,IAAM,mBAAmB,GAAiB,EAAE;AAE5C,IAAM,QAAQ,GAAG,UAAC,EAYF,EAAA;;IAXF,EAAA,CAAA,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A,IAAA,EAAA,EAAI,SAAS,EAAC,gCAAgC,YAC3C,CAAC,CAAC,mBAAmB,CAAC,GACpB,EACLA,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,uBAAuB,YACjC,CAAC,CAAC,+BAA+B,CAAC,GACjC,CAAA,EAAA,CACA,CACP,IACG,EAAA,CACF,EAAA,CACW;AAEvB;;;;"}
1
+ {"version":3,"file":"JDIError.js","sources":["../../../../../src/components/jdi/JDIError.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport Button from \"../ui/Button\";\nimport ButtonDesktop from \"../ui/ButtonDesktop\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport { Prediction } from \"../../utils/apiAnalysis\";\nimport { getValidationPoints } from \"../../utils/validationUtils\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\nimport { isServiceErrorCode } from \"../../utils/analysisErrors\";\n\ninterface JDIErrorProps {\n documentType: string;\n onRetry: () => void;\n /** Absent quand node.allowContinueOnFailure est à false : le bouton \"Continuer\n * quand même\" n'est alors jamais rendu, quel que soit isRetryAllowed. */\n onContinueAnyway?: () => void;\n onBackToUserInput?: () => void;\n retryCount?: number;\n predictions?: Prediction[]; // Nouvelles données de l'API\n errorCode?: string; // Error code from API response (e.g., \"2.1\", \"4.0\")\n allowResubmission?: boolean;\n maxResubmissionAttempts?: number;\n isRetryAllowed?: boolean;\n blockContinue?: boolean;\n}\n\nconst DEFAULT_PREDICTIONS: Prediction[] = [];\n\nconst JDIError = ({\n documentType,\n onRetry,\n onContinueAnyway,\n onBackToUserInput,\n retryCount = 0,\n predictions = DEFAULT_PREDICTIONS,\n errorCode,\n allowResubmission,\n maxResubmissionAttempts,\n isRetryAllowed = true,\n blockContinue = false,\n}: JDIErrorProps) => {\n const { t } = useI18n();\n const [validationPoints, setValidationPoints] = useState<string[]>([]);\n\n // Détail de mismatch d'identité (code 7.0), calculé côté backend et porté\n // par la première prédiction. Absent pour tous les autres codes.\n const mismatchDetails = predictions?.[0]?.mismatchDetails;\n\n useEffect(() => {\n // Use shared utility to get validation points\n setValidationPoints(\n getValidationPoints(errorCode, predictions, t, \"error\", mismatchDetails),\n );\n }, [predictions, errorCode, t, mismatchDetails]);\n\n // Get user guidance message if available\n const getUserGuidance = (): string | null => {\n if (!errorCode) return null;\n const guidance = t(`user_guidance.${errorCode}`, \"\");\n return guidance || null;\n };\n\n return (\n <MobilePageLayout\n footer={\n <div className=\"w-full max-w-md mx-auto\">\n <div className=\"flex flex-col space-y-3 md:hidden\">\n {blockContinue ? (\n <Button onClick={onRetry} className=\"w-full py-3\">\n {t(\"errors.retry_verification\")}\n </Button>\n ) : (\n <>\n {onBackToUserInput && (\n <ButtonDesktop\n onClick={onBackToUserInput}\n type=\"back\"\n className=\"w-full text-black text-center font-poppins text-sm font-medium py-2\"\n >\n {t(\"errors.back_to_user_input\")}\n </ButtonDesktop>\n )}\n {retryCount >= 1 && isRetryAllowed && onContinueAnyway && (\n <ButtonDesktop\n onClick={onContinueAnyway}\n type=\"back\"\n className=\"w-full text-black text-center font-poppins text-sm font-medium py-2\"\n >\n {t(\"errors.continue_anyway\")}\n </ButtonDesktop>\n )}\n {isRetryAllowed && (\n <Button onClick={onRetry} className=\"w-full py-3\">\n {t(\"errors.retry_verification\")}\n </Button>\n )}\n {!isRetryAllowed && onContinueAnyway && (\n <Button onClick={onContinueAnyway} className=\"w-full py-3\">\n {t(\"errors.continue_anyway\")}\n </Button>\n )}\n </>\n )}\n </div>\n <div className=\"hidden md:flex flex-col space-y-3\">\n <div className=\"flex justify-center space-x-3\">\n {blockContinue ? (\n <ButtonDesktop onClick={onRetry} type=\"continue\">\n {t(\"errors.retry_verification\")}\n </ButtonDesktop>\n ) : (\n <>\n {onBackToUserInput && (\n <ButtonDesktop\n onClick={onBackToUserInput}\n type=\"back\"\n className=\"text-black text-center font-poppins text-sm font-medium py-2\"\n >\n {t(\"errors.back_to_user_input\")}\n </ButtonDesktop>\n )}\n {retryCount >= 1 && isRetryAllowed && onContinueAnyway && (\n <ButtonDesktop\n onClick={onContinueAnyway}\n type=\"back\"\n className=\"text-black text-center font-poppins text-sm font-medium py-2\"\n >\n {t(\"errors.continue_anyway\")}\n </ButtonDesktop>\n )}\n {isRetryAllowed && (\n <ButtonDesktop onClick={onRetry} type=\"continue\">\n {t(\"errors.retry_verification\")}\n </ButtonDesktop>\n )}\n {!isRetryAllowed && onContinueAnyway && (\n <ButtonDesktop\n onClick={onContinueAnyway}\n type=\"continue\"\n >\n {t(\"errors.continue_anyway\")}\n </ButtonDesktop>\n )}\n </>\n )}\n </div>\n </div>\n </div>\n }\n >\n <div className=\"px-4 py-6 pt-11 md:px-8 md:py-8\">\n <div className=\"w-full max-w-md mx-auto space-y-6\">\n {/* Error icon */}\n <div className=\"text-center\">\n <div className=\"mx-auto w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mb-4\">\n <div className=\"w-8 h-8 bg-red-500 rounded-full flex items-center justify-center\">\n <span className=\"text-white text-lg\">✕</span>\n </div>\n </div>\n </div>\n\n {/* Header */}\n <div className=\"text-center space-y-4\">\n <Title className=\"text-xl md:text-2xl lg:text-3xl text-red-600\">\n {blockContinue\n ? t(\"errors.upload_not_confirmed.title\")\n : t(\"errors.verification_failed\")}\n </Title>\n <Subtitle className=\"text-sm text-gray-600 leading-relaxed\">\n {blockContinue\n ? t(\"errors.upload_not_confirmed.subtitle\")\n : isRetryAllowed\n ? t(\"errors.verification_failed_subtitle\", {\n documentType: \"document\",\n })\n : t(\"errors.verification_failed_subtitle_no_retry\", {\n documentType: \"document\",\n })}\n </Subtitle>\n </div>\n\n {/* Specimen warning */}\n {!blockContinue && errorCode?.startsWith(\"8\") && (\n <div className=\"bg-orange-50 border border-orange-200 rounded-lg p-4\">\n <p className=\"text-sm text-orange-800\">\n {t(\"errors.specimen_detected\")}\n </p>\n </div>\n )}\n\n {/* Error details - Validation Points */}\n {!blockContinue && (\n <div className=\"bg-red-50 border border-red-200 rounded-lg p-4\">\n <h3 className=\"font-medium text-red-900 mb-2\">\n {t(\"errors.problems_detected\")}\n </h3>\n <div className=\"text-sm text-red-800 space-y-1\">\n {validationPoints.map((point, index) => (\n <p key={index}>{point}</p>\n ))}\n </div>\n </div>\n )}\n\n {/* Resubmission limit message */}\n {!blockContinue && !isRetryAllowed && (\n <div className=\"bg-orange-50 border border-orange-200 rounded-lg p-4\">\n <h3 className=\"font-medium text-orange-900 mb-2\">\n {t(\"errors.resubmission.max_attempts_reached\")}\n </h3>\n <p className=\"text-sm text-orange-800\">\n {maxResubmissionAttempts !== undefined\n ? t(\"errors.resubmission.max_attempts_reached_description\")\n : t(\"errors.resubmission.no_resubmission_allowed\")}\n </p>\n </div>\n )}\n\n {/* User guidance - specific advice based on error code */}\n {!blockContinue && getUserGuidance() && (\n <div className=\"bg-yellow-50 border border-yellow-200 rounded-lg p-4\">\n <h3 className=\"font-medium text-yellow-900 mb-2\">\n {isServiceErrorCode(errorCode)\n ? // Quota / out of credits: nothing for the end user to improve.\n t(\"errors.service_refusal_title\")\n : `💡 ${t(\"errors.improvement_tips\", \"Conseils d'amélioration\")}`}\n </h3>\n <p className=\"text-sm text-yellow-800\">{getUserGuidance()}</p>\n </div>\n )}\n\n {/* Next steps */}\n {!blockContinue && isRetryAllowed && (\n <div className=\"bg-blue-50 border border-blue-200 rounded-lg p-4\">\n <h3 className=\"font-medium text-blue-900 mb-2\">\n {t(\"errors.next_steps\")}\n </h3>\n <p className=\"text-sm text-blue-800\">\n {t(\"errors.next_steps_description\")}\n </p>\n </div>\n )}\n </div>\n </div>\n </MobilePageLayout>\n );\n};\n\nexport default JDIError;\n"],"names":["useI18n","useState","useEffect","getValidationPoints","_jsx","MobilePageLayout","_jsxs","Button","ButtonDesktop","Title","Subtitle","isServiceErrorCode"],"mappings":";;;;;;;;;;;;;;;AA2BA,IAAM,mBAAmB,GAAiB,EAAE;AAE5C,IAAM,QAAQ,GAAG,UAAC,EAYF,E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E,EAAA,CAAK,CAAA,EAAA,CAC1D,CACP,EAGA,CAAC,aAAa,IAAI,cAAc,KAC/BE,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,kDAAkD,EAAA,QAAA,EAAA,CAC/DF,cAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,gCAAgC,EAAA,QAAA,EAC3C,CAAC,CAAC,mBAAmB,CAAC,EAAA,CACpB,EACLA,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,uBAAuB,EAAA,QAAA,EACjC,CAAC,CAAC,+BAA+B,CAAC,EAAA,CACjC,CAAA,EAAA,CACA,CACP,CAAA,EAAA,CACG,EAAA,CACF,EAAA,CACW;AAEvB;;;;"}
@@ -132,7 +132,7 @@ var JDIProcessing = React.memo(function (_a) {
132
132
  });
133
133
  }); };
134
134
  var processFiles = function () { return tslib_es6.__awaiter(void 0, void 0, void 0, function () {
135
- var i, response, extractedCode, codeName, codeDescription, mismatchDetails, predictions, isSuccess, canRetry, error_2, failedStepIndex_1, errorMessage, isNetworkError, isUploadNotConfirmed, isQuotaExceeded, apiError;
135
+ var i, response, serviceErrorCode, extractedCode, codeName, codeDescription, mismatchDetails, predictions, isSuccess, canRetry, error_2, failedStepIndex_1, errorMessage, isNetworkError, isUploadNotConfirmed, serviceErrorCode, apiError;
136
136
  return tslib_es6.__generator(this, function (_a) {
137
137
  switch (_a.label) {
138
138
  case 0:
@@ -241,7 +241,8 @@ var JDIProcessing = React.memo(function (_a) {
241
241
  })];
242
242
  case 5:
243
243
  response = _a.sent();
244
- extractedCode = String(response.code);
244
+ serviceErrorCode = analysisErrors.getServiceErrorCodeFromCodeName(response === null || response === void 0 ? void 0 : response.codeName);
245
+ extractedCode = serviceErrorCode || String(response.code);
245
246
  codeName = response === null || response === void 0 ? void 0 : response.codeName;
246
247
  codeDescription = response === null || response === void 0 ? void 0 : response.codeDescription;
247
248
  mismatchDetails = response === null || response === void 0 ? void 0 : response.mismatchDetails;
@@ -249,7 +250,7 @@ var JDIProcessing = React.memo(function (_a) {
249
250
  if (extractedCode && codeName) {
250
251
  predictions.push(tslib_es6.__assign({ code: extractedCode, codeName: codeName, codeDescription: codeDescription || "", type: "document" }, (mismatchDetails ? { mismatchDetails: mismatchDetails } : {})));
251
252
  }
252
- isSuccess = !jdiCodes.isBlockingCode(extractedCode, blockingCodes);
253
+ isSuccess = !serviceErrorCode && !jdiCodes.isBlockingCode(extractedCode, blockingCodes);
253
254
  canRetry = isSuccess === false;
254
255
  setAnalysisResult({
255
256
  success: isSuccess,
@@ -301,25 +302,25 @@ var JDIProcessing = React.memo(function (_a) {
301
302
  errorMessage.includes("CORS") ||
302
303
  errorMessage.includes("timeout");
303
304
  isUploadNotConfirmed = analysisErrors.isS3UploadNotConfirmedError(error_2);
304
- isQuotaExceeded = analysisErrors.isQuotaExceededError(error_2);
305
+ serviceErrorCode = analysisErrors.getServiceErrorCode(error_2);
305
306
  apiError = error_2;
306
307
  setAnalysisResult({
307
308
  success: false,
308
309
  data: null,
309
- // Propage le code/message QUOTA_EXCEEDED pour que l'écran
310
- // d'erreur puisse afficher un message dédié (limité au cas
311
- // quota : les autres erreurs gardent leur comportement existant).
312
- predictions: isQuotaExceeded
310
+ // Propage le code QUOTA_EXCEEDED / INSUFFICIENT_CREDITS pour que
311
+ // l'écran d'erreur affiche un message dédié (les autres erreurs
312
+ // gardent leur comportement existant).
313
+ predictions: serviceErrorCode
313
314
  ? [
314
315
  {
315
- code: analysisErrors.QUOTA_EXCEEDED_CODE,
316
- codeName: analysisErrors.QUOTA_EXCEEDED_CODE,
316
+ code: serviceErrorCode,
317
+ codeName: serviceErrorCode,
317
318
  codeDescription: (apiError === null || apiError === void 0 ? void 0 : apiError.message) || "",
318
319
  type: "document",
319
320
  },
320
321
  ]
321
322
  : undefined,
322
- canRetry: isNetworkError || isUploadNotConfirmed || isQuotaExceeded,
323
+ canRetry: isNetworkError || isUploadNotConfirmed || !!serviceErrorCode,
323
324
  blockContinue: isUploadNotConfirmed,
324
325
  });
325
326
  setIsComplete(true);
@@ -1 +1 @@
1
- {"version":3,"file":"JDIProcessing.js","sources":["../../../../../src/components/jdi/JDIProcessing.tsx"],"sourcesContent":["import { useEffect, useRef, useState, useMemo, useCallback, memo } from \"react\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport type { onUploadFiles } from \"../../types/uploadFiles\";\nimport type { ProcessingStep } from \"../../types/session\";\nimport type { Prediction } from \"../../utils/apiAnalysis\";\nimport type { JDIProcessingResult } from \"./types\";\nimport {\n analyzeFiles,\n uploadConvertedIdCardImage,\n} from \"../../services/analysis\";\nimport { getActiveSessionId } from \"../../services/sessionMemoryStore\";\nimport {\n convertPdfToPng,\n convertJpegToPng,\n dataUrlToFile,\n isPdf,\n isJpeg,\n isPng,\n} from \"../../utils/imageConverter\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport { requiresTwoSides } from \"../../utils/documentLabels\";\nimport {\n isS3UploadNotConfirmedError,\n isQuotaExceededError,\n QUOTA_EXCEEDED_CODE,\n} from \"../../utils/analysisErrors\";\nimport { isBlockingCode } from \"../../utils/jdiCodes\";\n\ninterface JDIProcessingProps {\n onProcessingComplete: (\n success: boolean,\n retryCount?: number,\n analysisData?: Prediction[] | null,\n blockContinue?: boolean,\n ) => void;\n documentType: string;\n fileUploaded: onUploadFiles | null; // Fichiers uploadés\n documentTypeId: string; // ID du type de document (jdd, income-proof, etc.)\n retryCount?: number; // Nombre de tentatives de retry déjà effectuées\n documentTemplateId?: string; // ID du modèle de document associé\n nodeId: string; // ID du nœud associé\n /** Codes JDI exacts considérés comme bloquants pour ce nœud (cf. node.blockingCodes). Absent = liste par défaut. */\n blockingCodes?: string[];\n}\n\ninterface AnalysisProgress {\n progress: number;\n currentStep: string;\n message: string;\n}\n\n// Fonction pour obtenir les étapes de traitement traduites\nconst getProcessingSteps = (t: (key: string) => string): ProcessingStep[] => [\n {\n title: t(\"jdi.processing.steps.document_reception.title\"),\n subtitle: t(\"jdi.processing.steps.document_reception.subtitle\"),\n hasError: false,\n },\n {\n title: t(\"jdi.processing.steps.quality_analysis.title\"),\n subtitle: t(\"jdi.processing.steps.quality_analysis.subtitle\"),\n hasError: false,\n },\n {\n title: t(\"jdi.processing.steps.data_extraction.title\"),\n subtitle: t(\"jdi.processing.steps.data_extraction.subtitle\"),\n hasError: false,\n },\n {\n title: t(\"jdi.processing.steps.final_verification.title\"),\n subtitle: t(\"jdi.processing.steps.final_verification.subtitle\"),\n hasError: false,\n },\n];\n\nconst JDIProcessing = memo(\n ({\n onProcessingComplete,\n documentType,\n fileUploaded,\n documentTypeId,\n retryCount = 0,\n documentTemplateId,\n nodeId,\n blockingCodes,\n }: JDIProcessingProps) => {\n const { t } = useI18n();\n const [isProcessing, setIsProcessing] = useState(false);\n const [currentStep, setCurrentStep] = useState(0);\n const [processingSteps, setProcessingSteps] = useState<ProcessingStep[]>(\n () => getProcessingSteps(t),\n );\n const [isComplete, setIsComplete] = useState(false);\n const [analysisResult, setAnalysisResult] =\n useState<JDIProcessingResult | null>(null);\n const [analysisProgress, setAnalysisProgress] = useState<AnalysisProgress>({\n progress: 0,\n currentStep: \"\",\n message: \"\",\n });\n\n const processingStartedRef = useRef(false);\n const processedFilesRef = useRef<string | null>(null);\n\n // Créer une clé stable pour les fichiers uploadés\n const filesKey = useMemo(() => {\n if (!fileUploaded) return null;\n return `${fileUploaded.front?.substring(0, 50) || \"no-front\"}-${\n fileUploaded.back?.substring(0, 50) || \"no-back\"\n }`;\n }, [fileUploaded]);\n\n // Callback stable pour onProcessingComplete\n const stableOnProcessingComplete = useCallback(\n (\n success: boolean,\n retryCount?: number,\n analysisData?: Prediction[] | null,\n blockContinue?: boolean,\n ) => {\n if (blockContinue === true) {\n onProcessingComplete(success, retryCount, analysisData, true);\n } else {\n onProcessingComplete(success, retryCount, analysisData);\n }\n },\n [onProcessingComplete],\n );\n\n useEffect(() => {\n // Empêcher les appels multiples\n if (\n !fileUploaded ||\n !filesKey ||\n isProcessing ||\n processingStartedRef.current\n ) {\n return;\n }\n\n const sessionId = getActiveSessionId();\n if (!sessionId) {\n stableOnProcessingComplete(false);\n return;\n }\n\n // Vérifier si on a déjà traité ces mêmes fichiers\n if (processedFilesRef.current === filesKey) {\n return;\n }\n\n // Fonction pour gérer la conversion et l'upload des fichiers\n const handleFileConversionAndUpload = async (\n sessionId: string,\n fileUploaded: onUploadFiles,\n ) => {\n const frontImage = fileUploaded.front;\n if (!frontImage) return;\n\n try {\n if (isPdf(frontImage)) {\n const convertedFile = await convertPdfToPng(frontImage);\n await uploadConvertedIdCardImage(sessionId, convertedFile, nodeId);\n } else if (isJpeg(frontImage)) {\n const convertedFile = await convertJpegToPng(frontImage);\n await uploadConvertedIdCardImage(sessionId, convertedFile, nodeId);\n } else if (isPng(frontImage)) {\n const file = dataUrlToFile(frontImage, \"converted_id_card.png\");\n await uploadConvertedIdCardImage(sessionId, file, nodeId);\n }\n } catch (error) {\n console.error(\"Erreur lors de la conversion/upload:\", error);\n // Ne pas bloquer le processus, continuer avec l'analyse normale\n }\n };\n\n const processFiles = async () => {\n try {\n // Marquer le début du traitement\n setIsProcessing(true);\n processingStartedRef.current = true;\n processedFilesRef.current = filesKey;\n\n // Animation des étapes avec appel API réel à la fin\n for (let i = 0; i < processingSteps.length; i++) {\n setCurrentStep(i);\n\n if (i < processingSteps.length - 1) {\n // Délai entre les étapes (sauf la dernière)\n await new Promise((resolve) => setTimeout(resolve, 800));\n } else {\n // Dernière étape : conversion et upload si nécessaire, puis appel API réel\n await handleFileConversionAndUpload(sessionId, fileUploaded);\n\n const response = await analyzeFiles(\n sessionId,\n nodeId,\n fileUploaded,\n documentTemplateId || \"\",\n {\n save: false, // don't save to session yet\n incrementAnalysis: false, // don't auto-progress session\n documentTypeKey: documentType,\n requiresTwoSides: requiresTwoSides(documentType),\n enablePolling: true, // Enable polling for progress\n pollingOptions: {\n interval: 2000, // Poll every 2 seconds (backend optimized timing)\n maxAttempts: 30, // 30 * 2s = max 60s polling duration\n timeout: 600000,\n onProgress: (status) => {\n // Update analysis progress state for display\n setAnalysisProgress({\n progress: status.progress,\n currentStep: status.currentStep,\n message: status.message,\n });\n\n // Update UI based on progress percentage\n // 50% = Analyzing (steps 0-2)\n // 100% = Completed (step 3)\n if (status.progress === 50) {\n // Analysis in progress - show steps 0-2 progressively\n const elapsed =\n Date.now() -\n (Date.parse(status.startedAt || \"\") || Date.now());\n const elapsedSeconds = elapsed / 1000;\n\n // Progress through first 3 steps based on elapsed time\n if (elapsedSeconds < 3) {\n setCurrentStep((prev) => Math.max(prev, 0));\n } else if (elapsedSeconds < 6) {\n setCurrentStep((prev) => Math.max(prev, 1));\n } else {\n setCurrentStep((prev) => Math.max(prev, 2));\n }\n } else if (status.progress === 100) {\n // Analysis complete - move to final step\n setCurrentStep(processingSteps.length - 1);\n }\n },\n onComplete: (status) => {\n // Update final progress state\n setAnalysisProgress({\n progress: status.progress,\n currentStep: status.currentStep,\n message: status.message,\n });\n\n // Ensure we're at the final step\n setCurrentStep(processingSteps.length - 1);\n\n // Mark the final step based on analysis result\n const isFailed =\n status.currentStep === \"failed\" ||\n status.currentStep === \"error\";\n\n if (isFailed) {\n setProcessingSteps((prev) =>\n prev.map((step, index) =>\n index === processingSteps.length - 1\n ? { ...step, hasError: true }\n : step,\n ),\n );\n }\n },\n onFailed: (status, error) => {\n console.error(\n \"❌ [JDIProcessing] Analysis polling failed:\",\n error,\n );\n\n // Update error state\n setAnalysisProgress({\n progress: 100,\n currentStep: \"failed\",\n message: `Analysis failed: ${error}`,\n });\n\n // Mark current step as error\n setProcessingSteps((prev) =>\n prev.map((step, index) =>\n index === currentStep\n ? { ...step, hasError: true }\n : step,\n ),\n );\n },\n },\n },\n );\n\n const extractedCode = String(response.code);\n const codeName = response?.codeName;\n const codeDescription = response?.codeDescription;\n const mismatchDetails = response?.mismatchDetails;\n\n // Construct predictions array from the response\n const predictions: Prediction[] = [];\n if (extractedCode && codeName) {\n predictions.push({\n code: extractedCode,\n codeName: codeName,\n codeDescription: codeDescription || \"\",\n type: \"document\",\n ...(mismatchDetails ? { mismatchDetails } : {}),\n });\n }\n\n // Determine success based on the node's configured blocking codes\n // (blockingCodes absent → DEFAULT_BLOCKING_CODES, legacy behavior\n // unchanged). Code 8.x (specimen) is always blocking.\n const isSuccess = !isBlockingCode(extractedCode, blockingCodes);\n const canRetry = isSuccess === false;\n\n setAnalysisResult({\n success: isSuccess,\n code: extractedCode,\n canRetry,\n data: response,\n predictions: predictions,\n });\n\n // Mark the final step based on analysis result\n if (!isSuccess) {\n setProcessingSteps((prev) =>\n prev.map((step, index) =>\n index === processingSteps.length - 1\n ? { ...step, hasError: true }\n : step,\n ),\n );\n }\n\n // délai pour voir le résultat\n await new Promise((resolve) => setTimeout(resolve, 500));\n }\n }\n\n setCurrentStep(processingSteps.length);\n setIsComplete(true);\n } catch (error) {\n console.error(\"❌ Erreur lors de l'analyse des fichiers:\", error);\n\n // Determine which step failed\n let failedStepIndex = currentStep;\n\n // If error occurred during analysis, mark the final verification step as failed\n if (currentStep >= processingSteps.length - 1) {\n failedStepIndex = processingSteps.length - 1;\n }\n\n // Mark the failed step as error\n setProcessingSteps((prev) =>\n prev.map((step, index) =>\n index === failedStepIndex ? { ...step, hasError: true } : step,\n ),\n );\n\n // Move to the failed step to show error\n setCurrentStep(failedStepIndex);\n\n // Determine if retry is allowed based on error type\n const errorMessage =\n error instanceof Error ? error.message : String(error);\n const isNetworkError =\n errorMessage.includes(\"network\") ||\n errorMessage.includes(\"CORS\") ||\n errorMessage.includes(\"timeout\");\n const isUploadNotConfirmed = isS3UploadNotConfirmedError(error);\n const isQuotaExceeded = isQuotaExceededError(error);\n const apiError = error as { code?: string; message?: string };\n\n setAnalysisResult({\n success: false,\n data: null,\n // Propage le code/message QUOTA_EXCEEDED pour que l'écran\n // d'erreur puisse afficher un message dédié (limité au cas\n // quota : les autres erreurs gardent leur comportement existant).\n predictions: isQuotaExceeded\n ? [\n {\n code: QUOTA_EXCEEDED_CODE,\n codeName: QUOTA_EXCEEDED_CODE,\n codeDescription: apiError?.message || \"\",\n type: \"document\",\n },\n ]\n : undefined,\n canRetry: isNetworkError || isUploadNotConfirmed || isQuotaExceeded,\n blockContinue: isUploadNotConfirmed,\n });\n setIsComplete(true);\n } finally {\n setIsProcessing(false);\n }\n };\n\n processFiles();\n }, [\n fileUploaded,\n filesKey,\n documentTypeId,\n documentTemplateId,\n documentType,\n isProcessing,\n stableOnProcessingComplete,\n processingSteps.length,\n currentStep,\n blockingCodes,\n ]);\n\n // Auto-complete when analysis is done\n useEffect(() => {\n if (isComplete && analysisResult) {\n setTimeout(() => {\n const allowRetry =\n analysisResult.success || analysisResult.canRetry === true;\n // Pass predictions array instead of raw data\n stableOnProcessingComplete(\n analysisResult.success,\n allowRetry ? retryCount : undefined,\n analysisResult.predictions || null,\n analysisResult.blockContinue,\n );\n }, 1000);\n }\n }, [isComplete, analysisResult, stableOnProcessingComplete, retryCount]);\n\n return (\n <div className=\"flex flex-col justify-between h-full w-full\">\n {/* Main content area */}\n <div className=\"flex-1 px-4 py-6 pt-11 md:px-8 md:py-8\">\n <div className=\"w-full max-w-md mx-auto space-y-6\">\n {/* Header */}\n <div className=\"text-center space-y-4\">\n <Title className=\"text-xl md:text-2xl lg:text-3xl\">\n {t(\"jdi.processing.title\")}\n </Title>\n <Subtitle className=\"text-sm text-gray-600 leading-relaxed\">\n {t(\"jdi.processing.subtitle\", {\n document: t(\"documentTypes.\" + documentType),\n })}\n </Subtitle>\n </div>\n\n {/* Processing steps with status indicators */}\n <div className=\"w-full flex justify-center\">\n <div className=\"space-y-5\">\n {processingSteps.map((step, index: number) => (\n <div key={index} className=\"flex items-start\">\n {/* Status indicator */}\n <div className=\"mr-4 mt-1 flex-shrink-0\">\n {index < currentStep ? (\n step.hasError ? (\n // Error indicator - Red X\n <div className=\"flex items-center justify-center w-6 h-6 rounded-full bg-red-500 text-white text-xs\">\n ✕\n </div>\n ) : (\n // Success indicator - Green checkmark\n <div className=\"flex items-center justify-center w-6 h-6 rounded-full bg-[#11E5C5] text-white text-xs\">\n ✓\n </div>\n )\n ) : index === currentStep ? (\n // Loading spinner only for the current step\n <div className=\"w-6 h-6 rounded-full border-2 border-t-[#11E5C5] border-r-[#11E5C5] border-b-[#11E5C5] border-l-transparent animate-spin\"></div>\n ) : (\n // Empty circle for future steps\n <div className=\"w-6 h-6 rounded-full border-2 border-gray-300\"></div>\n )}\n </div>\n\n {/* Step content */}\n <div className=\"flex-1 min-w-0\">\n <p className=\"font-medium text-[#3C3C40] text-sm\">\n {step.title}\n </p>\n <p className=\"text-xs text-gray-500 mt-1\">\n {step.subtitle}\n </p>\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n },\n);\n\nJDIProcessing.displayName = \"JDIProcessing\";\n\nexport default JDIProcessing;\n"],"names":["memo","useI18n","useState","useRef","useMemo","useCallback","useEffect","getActiveSessionId","__awaiter","isPdf","convertPdfToPng","uploadConvertedIdCardImage","isJpeg","convertJpegToPng","isPng","dataUrlToFile","analyzeFiles","requiresTwoSides","__assign","isBlockingCode","isS3UploadNotConfirmedError","isQuotaExceededError","QUOTA_EXCEEDED_CODE","_jsx","_jsxs","Title","Subtitle"],"mappings":";;;;;;;;;;;;;;;;;AAoDA;AACA,IAAM,kBAAkB,GAAG,UAAC,CAA0B,IAAuB,OAAA;AAC3E,IAAA;AACE,QAAA,KAAK,EAAE,CAAC,CAAC,+CAA+C,CAAC;AACzD,QAAA,QAAQ,EAAE,CAAC,CAAC,kDAAkD,CAAC;AAC/D,QAAA,QAAQ,EAAE,KAAK;AAChB,KAAA;AACD,IAAA;AACE,QAAA,KAAK,EAAE,CAAC,CAAC,6CAA6C,CAAC;AACvD,QAAA,QAAQ,EAAE,CAAC,CAAC,gDAAgD,CAAC;AAC7D,QAAA,QAAQ,EAAE,KAAK;AAChB,KAAA;AACD,IAAA;AACE,QAAA,KAAK,EAAE,CAAC,CAAC,4CAA4C,CAAC;AACtD,QAAA,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"sourcesContent":["import { useEffect, useRef, useState, useMemo, useCallback, memo } from \"react\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport type { onUploadFiles } from \"../../types/uploadFiles\";\nimport type { ProcessingStep } from \"../../types/session\";\nimport type { Prediction } from \"../../utils/apiAnalysis\";\nimport type { JDIProcessingResult } from \"./types\";\nimport {\n analyzeFiles,\n uploadConvertedIdCardImage,\n} from \"../../services/analysis\";\nimport { getActiveSessionId } from \"../../services/sessionMemoryStore\";\nimport {\n convertPdfToPng,\n convertJpegToPng,\n dataUrlToFile,\n isPdf,\n isJpeg,\n isPng,\n} from \"../../utils/imageConverter\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport { requiresTwoSides } from \"../../utils/documentLabels\";\nimport {\n isS3UploadNotConfirmedError,\n getServiceErrorCode,\n getServiceErrorCodeFromCodeName,\n} from \"../../utils/analysisErrors\";\nimport { isBlockingCode } from \"../../utils/jdiCodes\";\n\ninterface JDIProcessingProps {\n onProcessingComplete: (\n success: boolean,\n retryCount?: number,\n analysisData?: Prediction[] | null,\n blockContinue?: boolean,\n ) => void;\n documentType: string;\n fileUploaded: onUploadFiles | null; // Fichiers uploadés\n documentTypeId: string; // ID du type de document (jdd, income-proof, etc.)\n retryCount?: number; // Nombre de tentatives de retry déjà effectuées\n documentTemplateId?: string; // ID du modèle de document associé\n nodeId: string; // ID du nœud associé\n /** Codes JDI exacts considérés comme bloquants pour ce nœud (cf. node.blockingCodes). Absent = liste par défaut. */\n blockingCodes?: string[];\n}\n\ninterface AnalysisProgress {\n progress: number;\n currentStep: string;\n message: string;\n}\n\n// Fonction pour obtenir les étapes de traitement traduites\nconst getProcessingSteps = (t: (key: string) => string): ProcessingStep[] => [\n {\n title: t(\"jdi.processing.steps.document_reception.title\"),\n subtitle: t(\"jdi.processing.steps.document_reception.subtitle\"),\n hasError: false,\n },\n {\n title: t(\"jdi.processing.steps.quality_analysis.title\"),\n subtitle: t(\"jdi.processing.steps.quality_analysis.subtitle\"),\n hasError: false,\n },\n {\n title: t(\"jdi.processing.steps.data_extraction.title\"),\n subtitle: t(\"jdi.processing.steps.data_extraction.subtitle\"),\n hasError: false,\n },\n {\n title: t(\"jdi.processing.steps.final_verification.title\"),\n subtitle: t(\"jdi.processing.steps.final_verification.subtitle\"),\n hasError: false,\n },\n];\n\nconst JDIProcessing = memo(\n ({\n onProcessingComplete,\n documentType,\n fileUploaded,\n documentTypeId,\n retryCount = 0,\n documentTemplateId,\n nodeId,\n blockingCodes,\n }: JDIProcessingProps) => {\n const { t } = useI18n();\n const [isProcessing, setIsProcessing] = useState(false);\n const [currentStep, setCurrentStep] = useState(0);\n const [processingSteps, setProcessingSteps] = useState<ProcessingStep[]>(\n () => getProcessingSteps(t),\n );\n const [isComplete, setIsComplete] = useState(false);\n const [analysisResult, setAnalysisResult] =\n useState<JDIProcessingResult | null>(null);\n const [analysisProgress, setAnalysisProgress] = useState<AnalysisProgress>({\n progress: 0,\n currentStep: \"\",\n message: \"\",\n });\n\n const processingStartedRef = useRef(false);\n const processedFilesRef = useRef<string | null>(null);\n\n // Créer une clé stable pour les fichiers uploadés\n const filesKey = useMemo(() => {\n if (!fileUploaded) return null;\n return `${fileUploaded.front?.substring(0, 50) || \"no-front\"}-${\n fileUploaded.back?.substring(0, 50) || \"no-back\"\n }`;\n }, [fileUploaded]);\n\n // Callback stable pour onProcessingComplete\n const stableOnProcessingComplete = useCallback(\n (\n success: boolean,\n retryCount?: number,\n analysisData?: Prediction[] | null,\n blockContinue?: boolean,\n ) => {\n if (blockContinue === true) {\n onProcessingComplete(success, retryCount, analysisData, true);\n } else {\n onProcessingComplete(success, retryCount, analysisData);\n }\n },\n [onProcessingComplete],\n );\n\n useEffect(() => {\n // Empêcher les appels multiples\n if (\n !fileUploaded ||\n !filesKey ||\n isProcessing ||\n processingStartedRef.current\n ) {\n return;\n }\n\n const sessionId = getActiveSessionId();\n if (!sessionId) {\n stableOnProcessingComplete(false);\n return;\n }\n\n // Vérifier si on a déjà traité ces mêmes fichiers\n if (processedFilesRef.current === filesKey) {\n return;\n }\n\n // Fonction pour gérer la conversion et l'upload des fichiers\n const handleFileConversionAndUpload = async (\n sessionId: string,\n fileUploaded: onUploadFiles,\n ) => {\n const frontImage = fileUploaded.front;\n if (!frontImage) return;\n\n try {\n if (isPdf(frontImage)) {\n const convertedFile = await convertPdfToPng(frontImage);\n await uploadConvertedIdCardImage(sessionId, convertedFile, nodeId);\n } else if (isJpeg(frontImage)) {\n const convertedFile = await convertJpegToPng(frontImage);\n await uploadConvertedIdCardImage(sessionId, convertedFile, nodeId);\n } else if (isPng(frontImage)) {\n const file = dataUrlToFile(frontImage, \"converted_id_card.png\");\n await uploadConvertedIdCardImage(sessionId, file, nodeId);\n }\n } catch (error) {\n console.error(\"Erreur lors de la conversion/upload:\", error);\n // Ne pas bloquer le processus, continuer avec l'analyse normale\n }\n };\n\n const processFiles = async () => {\n try {\n // Marquer le début du traitement\n setIsProcessing(true);\n processingStartedRef.current = true;\n processedFilesRef.current = filesKey;\n\n // Animation des étapes avec appel API réel à la fin\n for (let i = 0; i < processingSteps.length; i++) {\n setCurrentStep(i);\n\n if (i < processingSteps.length - 1) {\n // Délai entre les étapes (sauf la dernière)\n await new Promise((resolve) => setTimeout(resolve, 800));\n } else {\n // Dernière étape : conversion et upload si nécessaire, puis appel API réel\n await handleFileConversionAndUpload(sessionId, fileUploaded);\n\n const response = await analyzeFiles(\n sessionId,\n nodeId,\n fileUploaded,\n documentTemplateId || \"\",\n {\n save: false, // don't save to session yet\n incrementAnalysis: false, // don't auto-progress session\n documentTypeKey: documentType,\n requiresTwoSides: requiresTwoSides(documentType),\n enablePolling: true, // Enable polling for progress\n pollingOptions: {\n interval: 2000, // Poll every 2 seconds (backend optimized timing)\n maxAttempts: 30, // 30 * 2s = max 60s polling duration\n timeout: 600000,\n onProgress: (status) => {\n // Update analysis progress state for display\n setAnalysisProgress({\n progress: status.progress,\n currentStep: status.currentStep,\n message: status.message,\n });\n\n // Update UI based on progress percentage\n // 50% = Analyzing (steps 0-2)\n // 100% = Completed (step 3)\n if (status.progress === 50) {\n // Analysis in progress - show steps 0-2 progressively\n const elapsed =\n Date.now() -\n (Date.parse(status.startedAt || \"\") || Date.now());\n const elapsedSeconds = elapsed / 1000;\n\n // Progress through first 3 steps based on elapsed time\n if (elapsedSeconds < 3) {\n setCurrentStep((prev) => Math.max(prev, 0));\n } else if (elapsedSeconds < 6) {\n setCurrentStep((prev) => Math.max(prev, 1));\n } else {\n setCurrentStep((prev) => Math.max(prev, 2));\n }\n } else if (status.progress === 100) {\n // Analysis complete - move to final step\n setCurrentStep(processingSteps.length - 1);\n }\n },\n onComplete: (status) => {\n // Update final progress state\n setAnalysisProgress({\n progress: status.progress,\n currentStep: status.currentStep,\n message: status.message,\n });\n\n // Ensure we're at the final step\n setCurrentStep(processingSteps.length - 1);\n\n // Mark the final step based on analysis result\n const isFailed =\n status.currentStep === \"failed\" ||\n status.currentStep === \"error\";\n\n if (isFailed) {\n setProcessingSteps((prev) =>\n prev.map((step, index) =>\n index === processingSteps.length - 1\n ? { ...step, hasError: true }\n : step,\n ),\n );\n }\n },\n onFailed: (status, error) => {\n console.error(\n \"❌ [JDIProcessing] Analysis polling failed:\",\n error,\n );\n\n // Update error state\n setAnalysisProgress({\n progress: 100,\n currentStep: \"failed\",\n message: `Analysis failed: ${error}`,\n });\n\n // Mark current step as error\n setProcessingSteps((prev) =>\n prev.map((step, index) =>\n index === currentStep\n ? { ...step, hasError: true }\n : step,\n ),\n );\n },\n },\n },\n );\n\n // Refused async analysis (quota / no credits): show its SDK code.\n const serviceErrorCode = getServiceErrorCodeFromCodeName(\n response?.codeName,\n );\n const extractedCode = serviceErrorCode || String(response.code);\n const codeName = response?.codeName;\n const codeDescription = response?.codeDescription;\n const mismatchDetails = response?.mismatchDetails;\n\n // Construct predictions array from the response\n const predictions: Prediction[] = [];\n if (extractedCode && codeName) {\n predictions.push({\n code: extractedCode,\n codeName: codeName,\n codeDescription: codeDescription || \"\",\n type: \"document\",\n ...(mismatchDetails ? { mismatchDetails } : {}),\n });\n }\n\n // Determine success based on the node's configured blocking codes\n // (blockingCodes absent → DEFAULT_BLOCKING_CODES, legacy behavior\n // unchanged). Code 8.x (specimen) is always blocking.\n const isSuccess =\n !serviceErrorCode && !isBlockingCode(extractedCode, blockingCodes);\n const canRetry = isSuccess === false;\n\n setAnalysisResult({\n success: isSuccess,\n code: extractedCode,\n canRetry,\n data: response,\n predictions: predictions,\n });\n\n // Mark the final step based on analysis result\n if (!isSuccess) {\n setProcessingSteps((prev) =>\n prev.map((step, index) =>\n index === processingSteps.length - 1\n ? { ...step, hasError: true }\n : step,\n ),\n );\n }\n\n // délai pour voir le résultat\n await new Promise((resolve) => setTimeout(resolve, 500));\n }\n }\n\n setCurrentStep(processingSteps.length);\n setIsComplete(true);\n } catch (error) {\n console.error(\"❌ Erreur lors de l'analyse des fichiers:\", error);\n\n // Determine which step failed\n let failedStepIndex = currentStep;\n\n // If error occurred during analysis, mark the final verification step as failed\n if (currentStep >= processingSteps.length - 1) {\n failedStepIndex = processingSteps.length - 1;\n }\n\n // Mark the failed step as error\n setProcessingSteps((prev) =>\n prev.map((step, index) =>\n index === failedStepIndex ? { ...step, hasError: true } : step,\n ),\n );\n\n // Move to the failed step to show error\n setCurrentStep(failedStepIndex);\n\n // Determine if retry is allowed based on error type\n const errorMessage =\n error instanceof Error ? error.message : String(error);\n const isNetworkError =\n errorMessage.includes(\"network\") ||\n errorMessage.includes(\"CORS\") ||\n errorMessage.includes(\"timeout\");\n const isUploadNotConfirmed = isS3UploadNotConfirmedError(error);\n const serviceErrorCode = getServiceErrorCode(error);\n const apiError = error as { code?: string; message?: string };\n\n setAnalysisResult({\n success: false,\n data: null,\n // Propage le code QUOTA_EXCEEDED / INSUFFICIENT_CREDITS pour que\n // l'écran d'erreur affiche un message dédié (les autres erreurs\n // gardent leur comportement existant).\n predictions: serviceErrorCode\n ? [\n {\n code: serviceErrorCode,\n codeName: serviceErrorCode,\n codeDescription: apiError?.message || \"\",\n type: \"document\",\n },\n ]\n : undefined,\n canRetry: isNetworkError || isUploadNotConfirmed || !!serviceErrorCode,\n blockContinue: isUploadNotConfirmed,\n });\n setIsComplete(true);\n } finally {\n setIsProcessing(false);\n }\n };\n\n processFiles();\n }, [\n fileUploaded,\n filesKey,\n documentTypeId,\n documentTemplateId,\n documentType,\n isProcessing,\n stableOnProcessingComplete,\n processingSteps.length,\n currentStep,\n blockingCodes,\n ]);\n\n // Auto-complete when analysis is done\n useEffect(() => {\n if (isComplete && analysisResult) {\n setTimeout(() => {\n const allowRetry =\n analysisResult.success || analysisResult.canRetry === true;\n // Pass predictions array instead of raw data\n stableOnProcessingComplete(\n analysisResult.success,\n allowRetry ? retryCount : undefined,\n analysisResult.predictions || null,\n analysisResult.blockContinue,\n );\n }, 1000);\n }\n }, [isComplete, analysisResult, stableOnProcessingComplete, retryCount]);\n\n return (\n <div className=\"flex flex-col justify-between h-full w-full\">\n {/* Main content area */}\n <div className=\"flex-1 px-4 py-6 pt-11 md:px-8 md:py-8\">\n <div className=\"w-full max-w-md mx-auto space-y-6\">\n {/* Header */}\n <div className=\"text-center space-y-4\">\n <Title className=\"text-xl md:text-2xl lg:text-3xl\">\n {t(\"jdi.processing.title\")}\n </Title>\n <Subtitle className=\"text-sm text-gray-600 leading-relaxed\">\n {t(\"jdi.processing.subtitle\", {\n document: t(\"documentTypes.\" + documentType),\n })}\n </Subtitle>\n </div>\n\n {/* Processing steps with status indicators */}\n <div className=\"w-full flex justify-center\">\n <div className=\"space-y-5\">\n {processingSteps.map((step, index: number) => (\n <div key={index} className=\"flex items-start\">\n {/* Status indicator */}\n <div className=\"mr-4 mt-1 flex-shrink-0\">\n {index < currentStep ? (\n step.hasError ? (\n // Error indicator - Red X\n <div className=\"flex items-center justify-center w-6 h-6 rounded-full bg-red-500 text-white text-xs\">\n ✕\n </div>\n ) : (\n // Success indicator - Green checkmark\n <div className=\"flex items-center justify-center w-6 h-6 rounded-full bg-[#11E5C5] text-white text-xs\">\n ✓\n </div>\n )\n ) : index === currentStep ? (\n // Loading spinner only for the current step\n <div className=\"w-6 h-6 rounded-full border-2 border-t-[#11E5C5] border-r-[#11E5C5] border-b-[#11E5C5] border-l-transparent animate-spin\"></div>\n ) : (\n // Empty circle for future steps\n <div className=\"w-6 h-6 rounded-full border-2 border-gray-300\"></div>\n )}\n </div>\n\n {/* Step content */}\n <div className=\"flex-1 min-w-0\">\n <p className=\"font-medium text-[#3C3C40] text-sm\">\n {step.title}\n </p>\n <p className=\"text-xs text-gray-500 mt-1\">\n {step.subtitle}\n </p>\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n },\n);\n\nJDIProcessing.displayName = \"JDIProcessing\";\n\nexport default JDIProcessing;\n"],"names":["memo","useI18n","useState","useRef","useMemo","useCallback","useEffect","getActiveSessionId","__awaiter","isPdf","convertPdfToPng","uploadConvertedIdCardImage","isJpeg","convertJpegToPng","isPng","dataUrlToFile","analyzeFiles","requiresTwoSides","__assign","getServiceErrorCodeFromCodeName","isBlockingCode","isS3UploadNotConfirmedError","getServiceErrorCode","_jsx","_jsxs","Title","Subtitle"],"mappings":";;;;;;;;;;;;;;;;;AAoDA;AACA,IAAM,kBAAkB,GAAG,UAAC,CAA0B,IAAuB,OAAA;AAC3E,IAAA;AACE,QAAA,KAAK,EAAE,CAAC,CAAC,+CAA+C,CAAC;AACzD,QAAA,QAAQ,EAAE,CAAC,CAAC,kDAAkD,CAAC;AAC/D,QAAA,QAAQ,EAAE,KAAK;AAChB,KAAA;AACD,IAAA;AACE,QAAA,KAAK,EAAE,CAAC,CAAC,6CAA6C,CAAC;AACvD,QAAA,QAAQ,EAAE,CAAC,CAAC,gDAAgD,CAAC;AAC7D,QAAA,QAAQ,EAAE,KAAK;AAChB,KAAA;AACD,IAAA;AACE,QAAA,KAAK,EAAE,CAAC,CAAC,4CAA4C,CAAC;AACtD,QAAA,QAAQ,EAAE,CAAC,CAAC,+CA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AA,CACF,EAAA,CACF;AAEV,CAAC;AAGH,aAAa,CAAC,WAAW,GAAG,eAAe;;;;"}
@@ -133,7 +133,8 @@ var user_guidance = {
133
133
  "2.2": "The photo is not clear. Avoid any blur or reflection",
134
134
  "2.4": "The photo is not clear. Avoid any blur or reflection",
135
135
  "2.6": "The document submitted is not the expected one",
136
- QUOTA_EXCEEDED: "Your organisation has reached its verification quota. Please try again later or contact the organisation that sent you this link."
136
+ QUOTA_EXCEEDED: "Your organisation has reached its verification quota. Please try again later or contact the organisation that sent you this link.",
137
+ INSUFFICIENT_CREDITS: "The organisation that sent you this link has run out of verification credits. Please contact them to complete your verification."
137
138
  };
138
139
  var validation_points = {
139
140
  "1.0": {
@@ -271,6 +272,7 @@ var errors = {
271
272
  verification_failed_subtitle_no_retry: "We could not validate your {{documentType}}. Please check the points below.",
272
273
  problems_detected: "Problems Detected",
273
274
  improvement_tips: "Improvement Tips",
275
+ service_refusal_title: "Verification temporarily unavailable",
274
276
  image_quality_insufficient: "• Image quality: Insufficient",
275
277
  readability_problematic: "• Information readability: Problematic",
276
278
  authenticity_not_verified: "• Authenticity: Not verified",
@@ -1 +1 @@
1
- {"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -133,7 +133,8 @@ var user_guidance = {
133
133
  "2.2": "La foto no es clara. Evita desenfoques y reflejos",
134
134
  "2.4": "La foto no es clara. Evita desenfoques y reflejos",
135
135
  "2.6": "El documento enviado no es el esperado",
136
- QUOTA_EXCEEDED: "Su organización ha alcanzado su cuota de verificaciones. Inténtelo de nuevo más tarde o póngase en contacto con la organización que le envió este enlace."
136
+ QUOTA_EXCEEDED: "Su organización ha alcanzado su cuota de verificaciones. Inténtelo de nuevo más tarde o póngase en contacto con la organización que le envió este enlace.",
137
+ INSUFFICIENT_CREDITS: "La organización que le envió este enlace no tiene más créditos de verificación. Póngase en contacto con ella para completar su trámite."
137
138
  };
138
139
  var validation_points = {
139
140
  "1.0": {
@@ -271,6 +272,7 @@ var errors = {
271
272
  verification_failed_subtitle_no_retry: "No hemos podido validar tu {{documentType}}. Revisa los puntos siguientes.",
272
273
  problems_detected: "Problemas detectados",
273
274
  improvement_tips: "Consejos de mejora",
275
+ service_refusal_title: "Verificación temporalmente no disponible",
274
276
  image_quality_insufficient: "• Calidad de imagen: insuficiente",
275
277
  readability_problematic: "• Legibilidad de la información: problemática",
276
278
  authenticity_not_verified: "• Autenticidad: no verificada",
@@ -1 +1 @@
1
- {"version":3,"file":"es.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -133,7 +133,8 @@ var user_guidance = {
133
133
  "2.2": "La photo n'est pas nette. Évitez tout flou ou reflet",
134
134
  "2.4": "La photo n'est pas nette. Évitez tout flou ou reflet",
135
135
  "2.6": "Le document déposé n'est pas celui attendu",
136
- QUOTA_EXCEEDED: "Le quota de vérifications de votre organisation est atteint. Veuillez réessayer plus tard ou contacter l'organisation qui vous a envoyé ce lien."
136
+ QUOTA_EXCEEDED: "Le quota de vérifications de votre organisation est atteint. Veuillez réessayer plus tard ou contacter l'organisation qui vous a envoyé ce lien.",
137
+ INSUFFICIENT_CREDITS: "L'organisation qui vous a envoyé ce lien n'a plus de crédits de vérification. Veuillez la contacter pour finaliser votre démarche."
137
138
  };
138
139
  var validation_points = {
139
140
  "1.0": {
@@ -271,6 +272,7 @@ var errors = {
271
272
  verification_failed_subtitle_no_retry: "Nous n'avons pas pu valider votre {{documentType}}. Veuillez vérifier les points ci-dessous.",
272
273
  problems_detected: "Problèmes détectés",
273
274
  improvement_tips: "Conseils d'amélioration",
275
+ service_refusal_title: "Vérification momentanément impossible",
274
276
  image_quality_insufficient: "• Qualité des images : Insuffisante",
275
277
  readability_problematic: "• Lisibilité des informations : Problématique",
276
278
  authenticity_not_verified: "• Authenticité : Non vérifiée",
@@ -1 +1 @@
1
- {"version":3,"file":"fr.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -19,22 +19,43 @@ var isS3UploadNotConfirmedError = function (error) {
19
19
  // Must stay aligned with QUOTA_EXCEEDED_CODE in the backend
20
20
  // (src/common/constants/quota-exceeded.constant.ts).
21
21
  var QUOTA_EXCEEDED_CODE = "QUOTA_EXCEEDED";
22
- var isQuotaExceededError = function (error) {
23
- if (typeof error !== "object" || error === null) {
24
- return false;
25
- }
22
+ // Must stay aligned with INSUFFICIENT_CREDITS_CODE in the backend
23
+ // (src/common/constants/quota-exceeded.constant.ts): overdraft cap reached.
24
+ var INSUFFICIENT_CREDITS_CODE = "INSUFFICIENT_CREDITS";
25
+ var SERVICE_ERROR_CODES = [QUOTA_EXCEEDED_CODE, INSUFFICIENT_CREDITS_CODE];
26
+ // codeName of the backend fallback document (origin api_failure) returned by
27
+ // analysis-status polling when the async analysis was refused.
28
+ var SERVICE_ERROR_CODE_NAMES = {
29
+ quota_exceeded: QUOTA_EXCEEDED_CODE,
30
+ insufficient_credits: INSUFFICIENT_CREDITS_CODE,
31
+ };
32
+ /**
33
+ * Code of a service refusal (engine quota / organisation out of credits) carried
34
+ * by an ApiError (`code` or `details.code`), else null. Screens show it through
35
+ * `user_guidance.<code>`.
36
+ */
37
+ var getServiceErrorCode = function (error) {
38
+ if (typeof error !== "object" || error === null)
39
+ return null;
26
40
  var apiError = error;
27
- if (apiError.code === QUOTA_EXCEEDED_CODE) {
28
- return true;
29
- }
30
- if (typeof apiError.details !== "object" || apiError.details === null) {
31
- return false;
32
- }
33
- return (apiError.details.code === QUOTA_EXCEEDED_CODE);
41
+ var details = typeof apiError.details === "object" && apiError.details !== null
42
+ ? apiError.details
43
+ : undefined;
44
+ if (isServiceErrorCode(apiError.code))
45
+ return apiError.code;
46
+ return isServiceErrorCode(details === null || details === void 0 ? void 0 : details.code) ? details.code : null;
47
+ };
48
+ var isServiceErrorCode = function (code) {
49
+ return SERVICE_ERROR_CODES.includes(code);
34
50
  };
51
+ /** Same as getServiceErrorCode, from the polled fallback document codeName. */
52
+ var getServiceErrorCodeFromCodeName = function (codeName) { var _a; return typeof codeName === "string" ? (_a = SERVICE_ERROR_CODE_NAMES[codeName]) !== null && _a !== void 0 ? _a : null : null; };
35
53
 
54
+ exports.INSUFFICIENT_CREDITS_CODE = INSUFFICIENT_CREDITS_CODE;
36
55
  exports.QUOTA_EXCEEDED_CODE = QUOTA_EXCEEDED_CODE;
37
56
  exports.S3_UPLOAD_NOT_CONFIRMED_CODE = S3_UPLOAD_NOT_CONFIRMED_CODE;
38
- exports.isQuotaExceededError = isQuotaExceededError;
57
+ exports.getServiceErrorCode = getServiceErrorCode;
58
+ exports.getServiceErrorCodeFromCodeName = getServiceErrorCodeFromCodeName;
39
59
  exports.isS3UploadNotConfirmedError = isS3UploadNotConfirmedError;
60
+ exports.isServiceErrorCode = isServiceErrorCode;
40
61
  //# sourceMappingURL=analysisErrors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"analysisErrors.js","sources":["../../../../src/utils/analysisErrors.ts"],"sourcesContent":["// Must stay aligned with the public error code returned by the backend AnalysisService.\nexport const S3_UPLOAD_NOT_CONFIRMED_CODE = \"S3_UPLOAD_NOT_CONFIRMED\";\n\nexport const isS3UploadNotConfirmedError = (error: unknown): boolean => {\n if (typeof error !== \"object\" || error === null) {\n return false;\n }\n\n const apiError = error as { code?: unknown; details?: unknown };\n if (apiError.code === S3_UPLOAD_NOT_CONFIRMED_CODE) {\n return true;\n }\n\n if (typeof apiError.details !== \"object\" || apiError.details === null) {\n return false;\n }\n\n return (\n (apiError.details as { code?: unknown }).code ===\n S3_UPLOAD_NOT_CONFIRMED_CODE\n );\n};\n\n// Must stay aligned with QUOTA_EXCEEDED_CODE in the backend\n// (src/common/constants/quota-exceeded.constant.ts).\nexport const QUOTA_EXCEEDED_CODE = \"QUOTA_EXCEEDED\";\n\nexport const isQuotaExceededError = (error: unknown): boolean => {\n if (typeof error !== \"object\" || error === null) {\n return false;\n }\n\n const apiError = error as { code?: unknown; details?: unknown };\n if (apiError.code === QUOTA_EXCEEDED_CODE) {\n return true;\n }\n\n if (typeof apiError.details !== \"object\" || apiError.details === null) {\n return false;\n }\n\n return (\n (apiError.details as { code?: unknown }).code === QUOTA_EXCEEDED_CODE\n );\n};\n"],"names":[],"mappings":";;AAAA;AACO,IAAM,4BAA4B,GAAG;AAErC,IAAM,2BAA2B,GAAG,UAAC,KAAc,EAAA;IACxD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE;AAC/C,QAAA,OAAO,KAAK;IACd;IAEA,IAAM,QAAQ,GAAG,KAA8C;AAC/D,IAAA,IAAI,QAAQ,CAAC,IAAI,KAAK,4BAA4B,EAAE;AAClD,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,IAAI,OAAO,QAAQ,CAAC,OAAO,KAAK,QAAQ,IAAI,QAAQ,CAAC,OAAO,KAAK,IAAI,EAAE;AACrE,QAAA,OAAO,KAAK;IACd;AAEA,IAAA,QACG,QAAQ,CAAC,OAA8B,CAAC,IAAI;AAC7C,QAAA,4BAA4B;AAEhC;AAEA;AACA;AACO,IAAM,mBAAmB,GAAG;AAE5B,IAAM,oBAAoB,GAAG,UAAC,KAAc,EAAA;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE;AAC/C,QAAA,OAAO,KAAK;IACd;IAEA,IAAM,QAAQ,GAAG,KAA8C;AAC/D,IAAA,IAAI,QAAQ,CAAC,IAAI,KAAK,mBAAmB,EAAE;AACzC,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,IAAI,OAAO,QAAQ,CAAC,OAAO,KAAK,QAAQ,IAAI,QAAQ,CAAC,OAAO,KAAK,IAAI,EAAE;AACrE,QAAA,OAAO,KAAK;IACd;IAEA,QACG,QAAQ,CAAC,OAA8B,CAAC,IAAI,KAAK,mBAAmB;AAEzE;;;;;;;"}
1
+ {"version":3,"file":"analysisErrors.js","sources":["../../../../src/utils/analysisErrors.ts"],"sourcesContent":["// Must stay aligned with the public error code returned by the backend AnalysisService.\nexport const S3_UPLOAD_NOT_CONFIRMED_CODE = \"S3_UPLOAD_NOT_CONFIRMED\";\n\nexport const isS3UploadNotConfirmedError = (error: unknown): boolean => {\n if (typeof error !== \"object\" || error === null) {\n return false;\n }\n\n const apiError = error as { code?: unknown; details?: unknown };\n if (apiError.code === S3_UPLOAD_NOT_CONFIRMED_CODE) {\n return true;\n }\n\n if (typeof apiError.details !== \"object\" || apiError.details === null) {\n return false;\n }\n\n return (\n (apiError.details as { code?: unknown }).code ===\n S3_UPLOAD_NOT_CONFIRMED_CODE\n );\n};\n\n// Must stay aligned with QUOTA_EXCEEDED_CODE in the backend\n// (src/common/constants/quota-exceeded.constant.ts).\nexport const QUOTA_EXCEEDED_CODE = \"QUOTA_EXCEEDED\";\n\nexport const isQuotaExceededError = (error: unknown): boolean => {\n if (typeof error !== \"object\" || error === null) {\n return false;\n }\n\n const apiError = error as { code?: unknown; details?: unknown };\n if (apiError.code === QUOTA_EXCEEDED_CODE) {\n return true;\n }\n\n if (typeof apiError.details !== \"object\" || apiError.details === null) {\n return false;\n }\n\n return (\n (apiError.details as { code?: unknown }).code === QUOTA_EXCEEDED_CODE\n );\n};\n\n// Must stay aligned with INSUFFICIENT_CREDITS_CODE in the backend\n// (src/common/constants/quota-exceeded.constant.ts): overdraft cap reached.\nexport const INSUFFICIENT_CREDITS_CODE = \"INSUFFICIENT_CREDITS\";\n\nconst SERVICE_ERROR_CODES = [QUOTA_EXCEEDED_CODE, INSUFFICIENT_CREDITS_CODE];\n\n// codeName of the backend fallback document (origin api_failure) returned by\n// analysis-status polling when the async analysis was refused.\nconst SERVICE_ERROR_CODE_NAMES: Record<string, string> = {\n quota_exceeded: QUOTA_EXCEEDED_CODE,\n insufficient_credits: INSUFFICIENT_CREDITS_CODE,\n};\n\n/**\n * Code of a service refusal (engine quota / organisation out of credits) carried\n * by an ApiError (`code` or `details.code`), else null. Screens show it through\n * `user_guidance.<code>`.\n */\nexport const getServiceErrorCode = (error: unknown): string | null => {\n if (typeof error !== \"object\" || error === null) return null;\n const apiError = error as { code?: unknown; details?: unknown };\n const details =\n typeof apiError.details === \"object\" && apiError.details !== null\n ? (apiError.details as { code?: unknown })\n : undefined;\n if (isServiceErrorCode(apiError.code)) return apiError.code;\n return isServiceErrorCode(details?.code) ? details.code : null;\n};\n\nexport const isServiceErrorCode = (code: unknown): code is string =>\n SERVICE_ERROR_CODES.includes(code as string);\n\n/** Same as getServiceErrorCode, from the polled fallback document codeName. */\nexport const getServiceErrorCodeFromCodeName = (\n codeName: unknown,\n): string | null =>\n typeof codeName === \"string\" ? SERVICE_ERROR_CODE_NAMES[codeName] ?? null : null;\n"],"names":[],"mappings":";;AAAA;AACO,IAAM,4BAA4B,GAAG;AAErC,IAAM,2BAA2B,GAAG,UAAC,KAAc,EAAA;IACxD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE;AAC/C,QAAA,OAAO,KAAK;IACd;IAEA,IAAM,QAAQ,GAAG,KAA8C;AAC/D,IAAA,IAAI,QAAQ,CAAC,IAAI,KAAK,4BAA4B,EAAE;AAClD,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,IAAI,OAAO,QAAQ,CAAC,OAAO,KAAK,QAAQ,IAAI,QAAQ,CAAC,OAAO,KAAK,IAAI,EAAE;AACrE,QAAA,OAAO,KAAK;IACd;AAEA,IAAA,QACG,QAAQ,CAAC,OAA8B,CAAC,IAAI;AAC7C,QAAA,4BAA4B;AAEhC;AAEA;AACA;AACO,IAAM,mBAAmB,GAAG;AAqBnC;AACA;AACO,IAAM,yBA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
7
7
  import { getValidationPoints } from '../../utils/validationUtils.js';
8
+ import { isServiceErrorCode } from '../../utils/analysisErrors.js';
8
9
 
9
10
  var DocumentError = function (_a) {
10
11
  var documentType = _a.documentType, documentTypeLabel = _a.documentTypeLabel, onRetry = _a.onRetry, onContinueAnyway = _a.onContinueAnyway, onBackToUserInput = _a.onBackToUserInput, _b = _a.retryCount, retryCount = _b === void 0 ? 0 : _b, _c = _a.predictions, predictions = _c === void 0 ? [] : _c; _a.errorDetails; _a.allowResubmission; var maxResubmissionAttempts = _a.maxResubmissionAttempts, _d = _a.isRetryAllowed, isRetryAllowed = _d === void 0 ? true : _d, errorCode = _a.errorCode, _e = _a.blockContinue, blockContinue = _e === void 0 ? false : _e;
@@ -54,7 +55,10 @@ var DocumentError = function (_a) {
54
55
  defaultValue: "Nous n'avons pas pu valider votre {{documentType}}. Veuillez vérifier les points ci-dessous.",
55
56
  }) })] }), !blockContinue && (jsxs("div", { className: "bg-red-50 border border-red-200 rounded-lg p-4", children: [jsx("h3", { className: "font-medium text-red-900 mb-2", children: t("errors.problems_detected", "Problèmes détectés") }), jsx("div", { className: "text-sm text-red-800 space-y-1", children: validationPoints.map(function (point, index) { return (jsx("p", { children: point }, index)); }) })] })), !blockContinue && !isRetryAllowed && (jsxs("div", { className: "bg-orange-50 border border-orange-200 rounded-lg p-4", children: [jsx("h3", { className: "font-medium text-orange-900 mb-2", children: t("errors.resubmission.max_attempts_reached", "Nombre maximum de tentatives atteint") }), jsx("p", { className: "text-sm text-orange-800", children: maxResubmissionAttempts !== undefined
56
57
  ? t("errors.resubmission.max_attempts_reached_description")
57
- : t("errors.resubmission.no_resubmission_allowed") })] })), !blockContinue && getUserGuidance() && (jsxs("div", { className: "bg-yellow-50 border border-yellow-200 rounded-lg p-4", children: [jsxs("h3", { className: "font-medium text-yellow-900 mb-2", children: ["\uD83D\uDCA1 ", t("errors.improvement_tips", "Conseils d'amélioration")] }), jsx("p", { className: "text-sm text-yellow-800", children: getUserGuidance() })] })), !blockContinue && isRetryAllowed && (jsxs("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4", children: [jsx("h3", { className: "font-medium text-blue-900 mb-2", children: t("errors.next_steps", "Prochaines étapes") }), jsx("p", { className: "text-sm text-blue-800", children: t("errors.next_steps_description", "Veuillez reprendre les photos de votre document en suivant les conseils d'amélioration pour une meilleure qualité.") })] }))] }) }), jsx("div", { className: "sticky bottom-0 md:static bg-white border-t md:border-t-0 p-4 md:p-0 md:pb-8", children: jsxs("div", { className: "w-full max-w-md mx-auto", children: [jsx("div", { className: "flex flex-col space-y-3 md:hidden", children: blockContinue ? (jsx(ButtonDesktop, { onClick: onRetry, type: "continue", children: t("errors.retry_verification", "Recommencer la vérification") })) : (jsxs(Fragment, { children: [onBackToUserInput && (jsx(ButtonDesktop, { onClick: onBackToUserInput, type: "back", children: t("errors.back_to_user_input", "Retour aux informations d'identité") })), retryCount >= 1 && isRetryAllowed && onContinueAnyway && (jsx(ButtonDesktop, { onClick: onContinueAnyway, type: "back", children: t("errors.continue_anyway", "Poursuivre tout de même") })), isRetryAllowed && (jsx(ButtonDesktop, { onClick: onRetry, type: "continue", children: t("errors.retry_verification", "Recommencer la vérification") })), !isRetryAllowed && onContinueAnyway && (jsx(ButtonDesktop, { onClick: onContinueAnyway, type: "back", children: t("errors.continue_anyway", "Poursuivre tout de même") }))] })) }), jsx("div", { className: "hidden md:flex flex-col space-y-3", children: jsx("div", { className: "flex justify-center space-x-3", children: blockContinue ? (jsx(ButtonDesktop, { onClick: onRetry, type: "continue", children: t("errors.retry_verification", "Recommencer la vérification") })) : (jsxs(Fragment, { children: [onBackToUserInput && (jsx(ButtonDesktop, { onClick: onBackToUserInput, type: "back", children: t("errors.back_to_user_input", "Retour aux informations d'identité") })), retryCount >= 1 && isRetryAllowed && onContinueAnyway && (jsx(ButtonDesktop, { onClick: onContinueAnyway, type: "back", children: t("errors.continue_anyway", "Poursuivre tout de même") })), isRetryAllowed && (jsx(ButtonDesktop, { onClick: onRetry, type: "continue", children: t("errors.retry_verification", "Recommencer la vérification") })), !isRetryAllowed && onContinueAnyway && (jsx(ButtonDesktop, { onClick: onContinueAnyway, type: "continue", children: t("errors.continue_anyway", "Poursuivre tout de même") }))] })) }) })] }) })] }));
58
+ : t("errors.resubmission.no_resubmission_allowed") })] })), !blockContinue && getUserGuidance() && (jsxs("div", { className: "bg-yellow-50 border border-yellow-200 rounded-lg p-4", children: [jsx("h3", { className: "font-medium text-yellow-900 mb-2", children: isServiceErrorCode(errorCode)
59
+ ? // Quota / out of credits: nothing for the end user to improve.
60
+ t("errors.service_refusal_title")
61
+ : "\uD83D\uDCA1 ".concat(t("errors.improvement_tips", "Conseils d'amélioration")) }), jsx("p", { className: "text-sm text-yellow-800", children: getUserGuidance() })] })), !blockContinue && isRetryAllowed && (jsxs("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4", children: [jsx("h3", { className: "font-medium text-blue-900 mb-2", children: t("errors.next_steps", "Prochaines étapes") }), jsx("p", { className: "text-sm text-blue-800", children: t("errors.next_steps_description", "Veuillez reprendre les photos de votre document en suivant les conseils d'amélioration pour une meilleure qualité.") })] }))] }) }), jsx("div", { className: "sticky bottom-0 md:static bg-white border-t md:border-t-0 p-4 md:p-0 md:pb-8", children: jsxs("div", { className: "w-full max-w-md mx-auto", children: [jsx("div", { className: "flex flex-col space-y-3 md:hidden", children: blockContinue ? (jsx(ButtonDesktop, { onClick: onRetry, type: "continue", children: t("errors.retry_verification", "Recommencer la vérification") })) : (jsxs(Fragment, { children: [onBackToUserInput && (jsx(ButtonDesktop, { onClick: onBackToUserInput, type: "back", children: t("errors.back_to_user_input", "Retour aux informations d'identité") })), retryCount >= 1 && isRetryAllowed && onContinueAnyway && (jsx(ButtonDesktop, { onClick: onContinueAnyway, type: "back", children: t("errors.continue_anyway", "Poursuivre tout de même") })), isRetryAllowed && (jsx(ButtonDesktop, { onClick: onRetry, type: "continue", children: t("errors.retry_verification", "Recommencer la vérification") })), !isRetryAllowed && onContinueAnyway && (jsx(ButtonDesktop, { onClick: onContinueAnyway, type: "back", children: t("errors.continue_anyway", "Poursuivre tout de même") }))] })) }), jsx("div", { className: "hidden md:flex flex-col space-y-3", children: jsx("div", { className: "flex justify-center space-x-3", children: blockContinue ? (jsx(ButtonDesktop, { onClick: onRetry, type: "continue", children: t("errors.retry_verification", "Recommencer la vérification") })) : (jsxs(Fragment, { children: [onBackToUserInput && (jsx(ButtonDesktop, { onClick: onBackToUserInput, type: "back", children: t("errors.back_to_user_input", "Retour aux informations d'identité") })), retryCount >= 1 && isRetryAllowed && onContinueAnyway && (jsx(ButtonDesktop, { onClick: onContinueAnyway, type: "back", children: t("errors.continue_anyway", "Poursuivre tout de même") })), isRetryAllowed && (jsx(ButtonDesktop, { onClick: onRetry, type: "continue", children: t("errors.retry_verification", "Recommencer la vérification") })), !isRetryAllowed && onContinueAnyway && (jsx(ButtonDesktop, { onClick: onContinueAnyway, type: "continue", children: t("errors.continue_anyway", "Poursuivre tout de même") }))] })) }) })] }) })] }));
58
62
  };
59
63
 
60
64
  export { DocumentError as default };