gbc-kyc-kit 2.2.3 → 2.2.5

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.
@@ -39083,8 +39083,11 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
39083
39083
  aspectRatio: {
39084
39084
  ideal: isPortrait ? 16 / 9 : 9 / 16
39085
39085
  },
39086
+ frameRate: {
39087
+ ideal: 30
39088
+ },
39086
39089
  advanced: [{
39087
- focusMode: "continuous"
39090
+ focusMode: "single-shot"
39088
39091
  }],
39089
39092
  facingMode: "environment"
39090
39093
  }), [isPortrait]);
@@ -39128,6 +39131,7 @@ function UploadDocument2({
39128
39131
  streamRef,
39129
39132
  onTapToFocus
39130
39133
  }) {
39134
+ console.log(videoConstraints);
39131
39135
  useEffect(() => {
39132
39136
  if (activateCamera && videoRef.current) {
39133
39137
  navigator.mediaDevices.getUserMedia({
@@ -39281,37 +39285,52 @@ function SideDocsSelector({
39281
39285
  onUploadImage2(side, imageData);
39282
39286
  };
39283
39287
  const handleTapToFocus = async () => {
39284
- var _a;
39288
+ var _a, _b;
39285
39289
  if (!streamRef.current)
39286
39290
  return;
39287
39291
  const [track] = streamRef.current.getVideoTracks();
39288
- const capabilities = track.getCapabilities();
39289
- track.getSettings();
39290
- if (capabilities.focusMode && capabilities.focusMode.includes("manual")) {
39291
- try {
39292
+ const capabilities = (_a = track.getCapabilities) == null ? void 0 : _a.call(track);
39293
+ const settings = (_b = track.getSettings) == null ? void 0 : _b.call(track);
39294
+ console.log("focus capabilities:", capabilities);
39295
+ console.log("focus settings:", settings);
39296
+ if (!capabilities || !capabilities.focusMode) {
39297
+ console.warn("No se puede acceder a las capacidades de enfoque");
39298
+ return;
39299
+ }
39300
+ try {
39301
+ if (capabilities.focusMode.includes("continuous")) {
39292
39302
  await track.applyConstraints({
39303
+ frameRate: {
39304
+ ideal: 30
39305
+ },
39293
39306
  advanced: [{
39294
- focusMode: "manual",
39295
- focusDistance: (_a = capabilities.focusDistance) == null ? void 0 : _a.min
39307
+ focusMode: "continuous"
39296
39308
  }]
39297
39309
  });
39298
- console.log("Enfoque manual aplicado");
39299
- } catch (err) {
39300
- console.error("Error al aplicar enfoque manual:", err);
39301
- }
39302
- } else if (capabilities.focusMode && capabilities.focusMode.includes("continuous")) {
39303
- try {
39310
+ } else if (capabilities.focusMode.includes("single-shot")) {
39304
39311
  await track.applyConstraints({
39312
+ frameRate: {
39313
+ ideal: 30
39314
+ },
39305
39315
  advanced: [{
39306
- focusMode: "continuous"
39316
+ focusMode: "single-shot"
39307
39317
  }]
39308
39318
  });
39309
- console.log("Enfoque autom\xE1tico reiniciado");
39310
- } catch (err) {
39311
- console.error("Error al reiniciar enfoque autom\xE1tico:", err);
39319
+ } else if (capabilities.focusMode.includes("manual") && capabilities.focusDistance) {
39320
+ await track.applyConstraints({
39321
+ frameRate: {
39322
+ ideal: 30
39323
+ },
39324
+ advanced: [{
39325
+ focusMode: "manual",
39326
+ focusDistance: capabilities.focusDistance.min
39327
+ }]
39328
+ });
39329
+ } else {
39330
+ console.warn("No hay modo de enfoque compatible");
39312
39331
  }
39313
- } else {
39314
- console.warn("El dispositivo no permite controlar el enfoque");
39332
+ } catch (err) {
39333
+ console.error("Error al aplicar constraints de enfoque:", err);
39315
39334
  }
39316
39335
  };
39317
39336
  return /* @__PURE__ */ jsxs(Box$1, {
@@ -39362,7 +39381,8 @@ function SideDocsSelector({
39362
39381
  alt: "thumbnail",
39363
39382
  style: {
39364
39383
  width: "100%",
39365
- height: "100%"
39384
+ height: "100%",
39385
+ objectFit: "cover"
39366
39386
  }
39367
39387
  }), /* @__PURE__ */ jsxs(Box$1, {
39368
39388
  style: {
@@ -39468,7 +39488,8 @@ function SideDocsSelector({
39468
39488
  alt: "thumbnail",
39469
39489
  style: {
39470
39490
  width: "100%",
39471
- height: "100%"
39491
+ height: "100%",
39492
+ objectFit: "cover"
39472
39493
  }
39473
39494
  }), /* @__PURE__ */ jsxs(Box$1, {
39474
39495
  style: {