@incodetech/core 0.0.0-dev-20260421-ac38ea9 → 0.0.0-dev-20260421-c950692

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.
@@ -2,10 +2,10 @@ import { t as Manager } from "./Manager-C1r-74H0.js";
2
2
  import "./Actor-Cqaw-2DF.js";
3
3
  import "./camera-C1Lz6NFz.js";
4
4
  import { n as DocumentUploadContext, r as DocumentUploadInput, t as DocumentUploadConfig } from "./types-DGwsRYfm.js";
5
- import * as xstate648 from "xstate";
5
+ import * as xstate0 from "xstate";
6
6
 
7
7
  //#region src/modules/document-upload/documentUploadStateMachine.d.ts
8
- declare const documentUploadMachine: xstate648.StateMachine<DocumentUploadContext, {
8
+ declare const documentUploadMachine: xstate0.StateMachine<DocumentUploadContext, {
9
9
  type: "START";
10
10
  } | {
11
11
  type: "CAPTURE";
@@ -18,52 +18,52 @@ declare const documentUploadMachine: xstate648.StateMachine<DocumentUploadContex
18
18
  } | {
19
19
  type: "CLOSE";
20
20
  }, {
21
- [x: string]: xstate648.ActorRefFromLogic<xstate648.PromiseActorLogic<MediaStream, void, xstate648.EventObject>> | xstate648.ActorRefFromLogic<xstate648.PromiseActorLogic<void, {
21
+ [x: string]: xstate0.ActorRefFromLogic<xstate0.PromiseActorLogic<void, {
22
22
  imageBase64: string;
23
23
  documentType: string;
24
24
  onProgress: (progress: number) => void;
25
- }, xstate648.EventObject>> | undefined;
26
- }, xstate648.Values<{
25
+ }, xstate0.EventObject>> | xstate0.ActorRefFromLogic<xstate0.PromiseActorLogic<MediaStream, void, xstate0.EventObject>> | undefined;
26
+ }, xstate0.Values<{
27
27
  uploadDocument: {
28
28
  src: "uploadDocument";
29
- logic: xstate648.PromiseActorLogic<void, {
29
+ logic: xstate0.PromiseActorLogic<void, {
30
30
  imageBase64: string;
31
31
  documentType: string;
32
32
  onProgress: (progress: number) => void;
33
- }, xstate648.EventObject>;
33
+ }, xstate0.EventObject>;
34
34
  id: string | undefined;
35
35
  };
36
36
  initCamera: {
37
37
  src: "initCamera";
38
- logic: xstate648.PromiseActorLogic<MediaStream, void, xstate648.EventObject>;
38
+ logic: xstate0.PromiseActorLogic<MediaStream, void, xstate0.EventObject>;
39
39
  id: string | undefined;
40
40
  };
41
- }>, xstate648.Values<{
41
+ }>, xstate0.Values<{
42
42
  setStream: {
43
43
  type: "setStream";
44
- params: xstate648.NonReducibleUnknown;
44
+ params: xstate0.NonReducibleUnknown;
45
+ };
46
+ setImageAndClearError: {
47
+ type: "setImageAndClearError";
48
+ params: xstate0.NonReducibleUnknown;
45
49
  };
46
50
  setProgress: {
47
51
  type: "setProgress";
48
- params: xstate648.NonReducibleUnknown;
52
+ params: xstate0.NonReducibleUnknown;
53
+ };
54
+ setError: {
55
+ type: "setError";
56
+ params: xstate0.NonReducibleUnknown;
49
57
  };
50
58
  clearError: {
51
59
  type: "clearError";
52
- params: xstate648.NonReducibleUnknown;
60
+ params: xstate0.NonReducibleUnknown;
53
61
  };
54
62
  stopStream: {
55
63
  type: "stopStream";
56
- params: xstate648.NonReducibleUnknown;
57
- };
58
- setError: {
59
- type: "setError";
60
- params: xstate648.NonReducibleUnknown;
61
- };
62
- setImageAndClearError: {
63
- type: "setImageAndClearError";
64
- params: xstate648.NonReducibleUnknown;
64
+ params: xstate0.NonReducibleUnknown;
65
65
  };
66
- }>, never, never, "error" | "idle" | "uploading" | "closed" | "finished" | "initCamera" | "capturing", string, DocumentUploadInput, xstate648.NonReducibleUnknown, xstate648.EventObject, xstate648.MetaObject, {
66
+ }>, never, never, "error" | "idle" | "uploading" | "closed" | "finished" | "initCamera" | "capturing", string, DocumentUploadInput, xstate0.NonReducibleUnknown, xstate0.EventObject, xstate0.MetaObject, {
67
67
  readonly id: "documentUpload";
68
68
  readonly initial: "idle";
69
69
  readonly context: ({
@@ -72,67 +72,67 @@ declare const documentUploadMachine: xstate648.StateMachine<DocumentUploadContex
72
72
  spawn: {
73
73
  <TSrc extends "uploadDocument" | "initCamera">(logic: TSrc, ...[options]: ({
74
74
  src: "uploadDocument";
75
- logic: xstate648.PromiseActorLogic<void, {
75
+ logic: xstate0.PromiseActorLogic<void, {
76
76
  imageBase64: string;
77
77
  documentType: string;
78
78
  onProgress: (progress: number) => void;
79
- }, xstate648.EventObject>;
79
+ }, xstate0.EventObject>;
80
80
  id: string | undefined;
81
81
  } extends infer T ? T extends {
82
82
  src: "uploadDocument";
83
- logic: xstate648.PromiseActorLogic<void, {
83
+ logic: xstate0.PromiseActorLogic<void, {
84
84
  imageBase64: string;
85
85
  documentType: string;
86
86
  onProgress: (progress: number) => void;
87
- }, xstate648.EventObject>;
87
+ }, xstate0.EventObject>;
88
88
  id: string | undefined;
89
89
  } ? T extends {
90
90
  src: TSrc;
91
- } ? xstate648.ConditionalRequired<[options?: ({
91
+ } ? xstate0.ConditionalRequired<[options?: ({
92
92
  id?: T["id"] | undefined;
93
93
  systemId?: string;
94
- input?: xstate648.InputFrom<T["logic"]> | undefined;
94
+ input?: xstate0.InputFrom<T["logic"]> | undefined;
95
95
  syncSnapshot?: boolean;
96
- } & { [K in xstate648.RequiredActorOptions<T>]: unknown }) | undefined], xstate648.IsNotNever<xstate648.RequiredActorOptions<T>>> : never : never : never) | ({
96
+ } & { [K in xstate0.RequiredActorOptions<T>]: unknown }) | undefined], xstate0.IsNotNever<xstate0.RequiredActorOptions<T>>> : never : never : never) | ({
97
97
  src: "initCamera";
98
- logic: xstate648.PromiseActorLogic<MediaStream, void, xstate648.EventObject>;
98
+ logic: xstate0.PromiseActorLogic<MediaStream, void, xstate0.EventObject>;
99
99
  id: string | undefined;
100
100
  } extends infer T_1 ? T_1 extends {
101
101
  src: "initCamera";
102
- logic: xstate648.PromiseActorLogic<MediaStream, void, xstate648.EventObject>;
102
+ logic: xstate0.PromiseActorLogic<MediaStream, void, xstate0.EventObject>;
103
103
  id: string | undefined;
104
104
  } ? T_1 extends {
105
105
  src: TSrc;
106
- } ? xstate648.ConditionalRequired<[options?: ({
106
+ } ? xstate0.ConditionalRequired<[options?: ({
107
107
  id?: T_1["id"] | undefined;
108
108
  systemId?: string;
109
- input?: xstate648.InputFrom<T_1["logic"]> | undefined;
109
+ input?: xstate0.InputFrom<T_1["logic"]> | undefined;
110
110
  syncSnapshot?: boolean;
111
- } & { [K_1 in xstate648.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate648.IsNotNever<xstate648.RequiredActorOptions<T_1>>> : never : never : never)): xstate648.ActorRefFromLogic<xstate648.GetConcreteByKey<xstate648.Values<{
111
+ } & { [K_1 in xstate0.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate0.IsNotNever<xstate0.RequiredActorOptions<T_1>>> : never : never : never)): xstate0.ActorRefFromLogic<xstate0.GetConcreteByKey<xstate0.Values<{
112
112
  uploadDocument: {
113
113
  src: "uploadDocument";
114
- logic: xstate648.PromiseActorLogic<void, {
114
+ logic: xstate0.PromiseActorLogic<void, {
115
115
  imageBase64: string;
116
116
  documentType: string;
117
117
  onProgress: (progress: number) => void;
118
- }, xstate648.EventObject>;
118
+ }, xstate0.EventObject>;
119
119
  id: string | undefined;
120
120
  };
121
121
  initCamera: {
122
122
  src: "initCamera";
123
- logic: xstate648.PromiseActorLogic<MediaStream, void, xstate648.EventObject>;
123
+ logic: xstate0.PromiseActorLogic<MediaStream, void, xstate0.EventObject>;
124
124
  id: string | undefined;
125
125
  };
126
126
  }>, "src", TSrc>["logic"]>;
127
- <TLogic extends xstate648.AnyActorLogic>(src: TLogic, ...[options]: xstate648.ConditionalRequired<[options?: ({
127
+ <TLogic extends xstate0.AnyActorLogic>(src: TLogic, ...[options]: xstate0.ConditionalRequired<[options?: ({
128
128
  id?: never;
129
129
  systemId?: string;
130
- input?: xstate648.InputFrom<TLogic> | undefined;
130
+ input?: xstate0.InputFrom<TLogic> | undefined;
131
131
  syncSnapshot?: boolean;
132
- } & { [K in xstate648.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate648.IsNotNever<xstate648.RequiredLogicInput<TLogic>>>): xstate648.ActorRefFromLogic<TLogic>;
132
+ } & { [K in xstate0.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate0.IsNotNever<xstate0.RequiredLogicInput<TLogic>>>): xstate0.ActorRefFromLogic<TLogic>;
133
133
  };
134
134
  input: DocumentUploadInput;
135
- self: xstate648.ActorRef<xstate648.MachineSnapshot<DocumentUploadContext, {
135
+ self: xstate0.ActorRef<xstate0.MachineSnapshot<DocumentUploadContext, {
136
136
  type: "START";
137
137
  } | {
138
138
  type: "CAPTURE";
@@ -144,7 +144,7 @@ declare const documentUploadMachine: xstate648.StateMachine<DocumentUploadContex
144
144
  type: "RETRY";
145
145
  } | {
146
146
  type: "CLOSE";
147
- }, Record<string, xstate648.AnyActorRef | undefined>, xstate648.StateValue, string, unknown, any, any>, {
147
+ }, Record<string, xstate0.AnyActorRef | undefined>, xstate0.StateValue, string, unknown, any, any>, {
148
148
  type: "START";
149
149
  } | {
150
150
  type: "CAPTURE";
@@ -156,7 +156,7 @@ declare const documentUploadMachine: xstate648.StateMachine<DocumentUploadContex
156
156
  type: "RETRY";
157
157
  } | {
158
158
  type: "CLOSE";
159
- }, xstate648.AnyEventObject>;
159
+ }, xstate0.AnyEventObject>;
160
160
  }) => {
161
161
  config: DocumentUploadConfig;
162
162
  stream: undefined;
@@ -226,7 +226,7 @@ declare const documentUploadMachine: xstate648.StateMachine<DocumentUploadContex
226
226
  } | {
227
227
  type: "CLOSE";
228
228
  };
229
- self: xstate648.ActorRef<xstate648.MachineSnapshot<DocumentUploadContext, {
229
+ self: xstate0.ActorRef<xstate0.MachineSnapshot<DocumentUploadContext, {
230
230
  type: "START";
231
231
  } | {
232
232
  type: "CAPTURE";
@@ -238,7 +238,7 @@ declare const documentUploadMachine: xstate648.StateMachine<DocumentUploadContex
238
238
  type: "RETRY";
239
239
  } | {
240
240
  type: "CLOSE";
241
- }, Record<string, xstate648.AnyActorRef>, xstate648.StateValue, string, unknown, any, any>, {
241
+ }, Record<string, xstate0.AnyActorRef>, xstate0.StateValue, string, unknown, any, any>, {
242
242
  type: "START";
243
243
  } | {
244
244
  type: "CAPTURE";
@@ -250,7 +250,7 @@ declare const documentUploadMachine: xstate648.StateMachine<DocumentUploadContex
250
250
  type: "RETRY";
251
251
  } | {
252
252
  type: "CLOSE";
253
- }, xstate648.AnyEventObject>;
253
+ }, xstate0.AnyEventObject>;
254
254
  }) => {
255
255
  imageBase64: string;
256
256
  documentType: string;
@@ -1,4 +1,4 @@
1
1
  import "./Manager-C1r-74H0.js";
2
2
  import "./Actor-Cqaw-2DF.js";
3
- import { a as AE_CONSENT_KEYS, c as ConsentKey, d as ElectronicSignatureVariant, f as QE_CONSENT_KEYS, g as getDefaultConsentChecks, h as getConsentKeys, i as electronicSignatureMachine, l as ElectronicSignatureConfig, m as areAllConsented, n as ElectronicSignatureState, o as AeConsentKey, p as QeConsentKey, r as createElectronicSignatureManager, s as ConsentChecks, t as ElectronicSignatureManager, u as ElectronicSignatureDocument } from "./index-9p9VlHBc.js";
3
+ import { a as AE_CONSENT_KEYS, c as ConsentKey, d as ElectronicSignatureVariant, f as QE_CONSENT_KEYS, g as getDefaultConsentChecks, h as getConsentKeys, i as electronicSignatureMachine, l as ElectronicSignatureConfig, m as areAllConsented, n as ElectronicSignatureState, o as AeConsentKey, p as QeConsentKey, r as createElectronicSignatureManager, s as ConsentChecks, t as ElectronicSignatureManager, u as ElectronicSignatureDocument } from "./index-Crq0BK0w.js";
4
4
  export { AE_CONSENT_KEYS, AeConsentKey, ConsentChecks, ConsentKey, ElectronicSignatureConfig, ElectronicSignatureDocument, ElectronicSignatureManager, ElectronicSignatureState, ElectronicSignatureVariant, QE_CONSENT_KEYS, QeConsentKey, areAllConsented, createElectronicSignatureManager, electronicSignatureMachine, getConsentKeys, getDefaultConsentChecks };
@@ -27,8 +27,8 @@ import "./emailStateMachine-CSyUXPrM.esm.js";
27
27
  import { n as createEmailManagerFromActor } from "./emailManager-DZ1bKeHd.esm.js";
28
28
  import "./selfieStateMachine-CYcGwdw6.esm.js";
29
29
  import { n as createSelfieManagerFromActor } from "./selfieManager-BzQvkdCk.esm.js";
30
- import "./idCaptureStateMachine-CkDMgCTu.esm.js";
31
- import { n as createIdCaptureManagerFromActor } from "./idCaptureManager-CxTrbaj_.esm.js";
30
+ import "./idCaptureStateMachine-BBf5lODM.esm.js";
31
+ import { n as createIdCaptureManagerFromActor } from "./idCaptureManager-B-rA65qY.esm.js";
32
32
  import "./phoneStateMachine-BjhtmUGF.esm.js";
33
33
  import { n as createPhoneManagerFromActor } from "./phoneManager-BFinSDdo.esm.js";
34
34
 
package/dist/home.d.ts CHANGED
@@ -2,7 +2,7 @@ import { t as Manager } from "./Manager-C1r-74H0.js";
2
2
  import "./camera-C1Lz6NFz.js";
3
3
  import "./types-DGwsRYfm.js";
4
4
  import { t as EmptyConfig } from "./types-x6tue2ld.js";
5
- import * as xstate631 from "xstate";
5
+ import * as xstate519 from "xstate";
6
6
 
7
7
  //#region src/modules/home/types.d.ts
8
8
  type HomeConfig = EmptyConfig;
@@ -34,41 +34,41 @@ type HomeContext = {
34
34
  type HomeInput = {
35
35
  config: EmptyConfig;
36
36
  };
37
- declare const homeMachine: xstate631.StateMachine<HomeContext, {
37
+ declare const homeMachine: xstate519.StateMachine<HomeContext, {
38
38
  type: "LOAD";
39
39
  } | {
40
40
  type: "COMPLETE";
41
41
  } | {
42
42
  type: "RESET";
43
- }, {}, never, never, never, never, "idle" | "finished" | "main", string, HomeInput, xstate631.NonReducibleUnknown, xstate631.EventObject, xstate631.MetaObject, {
43
+ }, {}, never, never, never, never, "idle" | "finished" | "main", string, HomeInput, xstate519.NonReducibleUnknown, xstate519.EventObject, xstate519.MetaObject, {
44
44
  readonly id: "home";
45
45
  readonly initial: "idle";
46
46
  readonly context: ({
47
47
  input
48
48
  }: {
49
49
  spawn: {
50
- <TSrc extends never>(logic: TSrc, ...[options]: never): xstate631.ActorRefFromLogic<never>;
51
- <TLogic extends xstate631.AnyActorLogic>(src: TLogic, ...[options]: xstate631.ConditionalRequired<[options?: ({
50
+ <TSrc extends never>(logic: TSrc, ...[options]: never): xstate519.ActorRefFromLogic<never>;
51
+ <TLogic extends xstate519.AnyActorLogic>(src: TLogic, ...[options]: xstate519.ConditionalRequired<[options?: ({
52
52
  id?: never;
53
53
  systemId?: string;
54
- input?: xstate631.InputFrom<TLogic> | undefined;
54
+ input?: xstate519.InputFrom<TLogic> | undefined;
55
55
  syncSnapshot?: boolean;
56
- } & { [K in xstate631.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate631.IsNotNever<xstate631.RequiredLogicInput<TLogic>>>): xstate631.ActorRefFromLogic<TLogic>;
56
+ } & { [K in xstate519.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate519.IsNotNever<xstate519.RequiredLogicInput<TLogic>>>): xstate519.ActorRefFromLogic<TLogic>;
57
57
  };
58
58
  input: HomeInput;
59
- self: xstate631.ActorRef<xstate631.MachineSnapshot<HomeContext, {
59
+ self: xstate519.ActorRef<xstate519.MachineSnapshot<HomeContext, {
60
60
  type: "LOAD";
61
61
  } | {
62
62
  type: "COMPLETE";
63
63
  } | {
64
64
  type: "RESET";
65
- }, Record<string, xstate631.AnyActorRef | undefined>, xstate631.StateValue, string, unknown, any, any>, {
65
+ }, Record<string, xstate519.AnyActorRef | undefined>, xstate519.StateValue, string, unknown, any, any>, {
66
66
  type: "LOAD";
67
67
  } | {
68
68
  type: "COMPLETE";
69
69
  } | {
70
70
  type: "RESET";
71
- }, xstate631.AnyEventObject>;
71
+ }, xstate519.AnyEventObject>;
72
72
  }) => {
73
73
  config: EmptyConfig;
74
74
  };
package/dist/id.esm.js CHANGED
@@ -18,7 +18,7 @@ import "./ITimerCapability-6rqYcRcc.esm.js";
18
18
  import "./backCameraStream-BXfdKlzB.esm.js";
19
19
  import "./getDeviceClass-BiqKa0Vc.esm.js";
20
20
  import "./BrowserTimerProvider-DDCqhG2g.esm.js";
21
- import { a as startRecordingSession, c as uploadIdImage, d as ID_ERROR_CODES, f as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, i as processId, l as uploadManualIdFile, m as MANUAL_UPLOAD_MAX_RETRIES, n as initializeIdCapture, o as stopRecording, p as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, r as preloadIdRecordingProvider, s as stopStream, t as idCaptureMachine, u as validateUploadResponse } from "./idCaptureStateMachine-CkDMgCTu.esm.js";
22
- import { r as createIdCaptureActor, t as createIdCaptureManager } from "./idCaptureManager-CxTrbaj_.esm.js";
21
+ import { a as startRecordingSession, c as uploadIdImage, d as ID_ERROR_CODES, f as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, i as processId, l as uploadManualIdFile, m as MANUAL_UPLOAD_MAX_RETRIES, n as initializeIdCapture, o as stopRecording, p as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, r as preloadIdRecordingProvider, s as stopStream, t as idCaptureMachine, u as validateUploadResponse } from "./idCaptureStateMachine-BBf5lODM.esm.js";
22
+ import { r as createIdCaptureActor, t as createIdCaptureManager } from "./idCaptureManager-B-rA65qY.esm.js";
23
23
 
24
24
  export { ID_ERROR_CODES, MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, MANUAL_UPLOAD_MAX_RETRIES, createIdCaptureActor, createIdCaptureManager, idCaptureMachine, initializeIdCapture, preloadIdRecordingProvider, processId, startRecordingSession, stopRecording, stopStream, uploadIdImage, uploadManualIdFile, validateUploadResponse };
@@ -1,7 +1,7 @@
1
1
  import { n as eventModuleNames, o as createManagerInstrumentation, r as eventScreenNames } from "./events-CLo0CBD5.esm.js";
2
2
  import { a as createActor, o as createManager } from "./xstate.esm-BlgyVBVv.esm.js";
3
3
  import { t as BrowserStorageProvider } from "./BrowserStorageProvider-DOp7HlOV.esm.js";
4
- import { t as idCaptureMachine } from "./idCaptureStateMachine-CkDMgCTu.esm.js";
4
+ import { t as idCaptureMachine } from "./idCaptureStateMachine-BBf5lODM.esm.js";
5
5
 
6
6
  //#region src/modules/id/idCaptureActor.ts
7
7
  function createIdCaptureActor(options) {
@@ -550,7 +550,16 @@ const runDetectionActor = fromCallback(({ input, sendBack }) => {
550
550
  const timer = BrowserTimerProvider.getInstance();
551
551
  let notificationTimeout = null;
552
552
  let currentNotificationStatus = null;
553
+ let lastReportedSide = null;
553
554
  const NOTIFICATION_DURATION_MS = 500;
555
+ const isReportedSideWrong = () => {
556
+ if (!lastReportedSide) return false;
557
+ const detectedSide = lastReportedSide.toLowerCase();
558
+ if (detectedSide === "wrong") return true;
559
+ const isBackDetected = detectedSide.includes("back") && !detectedSide.includes("front");
560
+ const isFrontDetected = detectedSide.includes("front") && !detectedSide.includes("back");
561
+ return input.currentMode === "front" && isBackDetected || input.currentMode === "back" && isFrontDetected;
562
+ };
554
563
  const clearNotificationTimeout = () => {
555
564
  if (notificationTimeout) {
556
565
  timer.clearTimeout(notificationTimeout);
@@ -559,6 +568,7 @@ const runDetectionActor = fromCallback(({ input, sendBack }) => {
559
568
  }
560
569
  };
561
570
  const sendNotification = (status) => {
571
+ if (isReportedSideWrong()) return;
562
572
  if (notificationTimeout && currentNotificationStatus !== status) return;
563
573
  if (notificationTimeout && currentNotificationStatus === status) timer.clearTimeout(notificationTimeout);
564
574
  currentNotificationStatus = status;
@@ -650,6 +660,7 @@ const runDetectionActor = fromCallback(({ input, sendBack }) => {
650
660
  },
651
661
  onCapturing: () => {
652
662
  clearNotificationTimeout();
663
+ lastReportedSide = null;
653
664
  isCapturing = true;
654
665
  sendBack({
655
666
  type: "DETECTION_UPDATE",
@@ -690,6 +701,8 @@ const runDetectionActor = fromCallback(({ input, sendBack }) => {
690
701
  },
691
702
  onIdSideChange: (side) => {
692
703
  if (isCapturing) return;
704
+ lastReportedSide = side;
705
+ if (isReportedSideWrong()) clearNotificationTimeout();
693
706
  sendBack({
694
707
  type: "ID_SIDE_CHANGE",
695
708
  side
@@ -727,6 +740,7 @@ const runDetectionActor = fromCallback(({ input, sendBack }) => {
727
740
  bestCanvas = null;
728
741
  storedQualityElements = {};
729
742
  isCapturing = false;
743
+ lastReportedSide = null;
730
744
  provider.reset();
731
745
  }
732
746
  },
@@ -1129,7 +1143,11 @@ function getDetectionStatusFromUpdate(context, event) {
1129
1143
  if (event.type === "DETECTION_UPDATE") {
1130
1144
  const newStatus = event.status;
1131
1145
  const currentStatus = context.detectionStatus;
1132
- if ((newStatus === "blur" || newStatus === "glare") && (currentStatus === "wrongSide" || currentStatus === "farAway")) return currentStatus;
1146
+ if (currentStatus === "wrongSide") {
1147
+ if (!(newStatus === "capturing" || newStatus === "manualCapture" || newStatus === "offline")) return currentStatus;
1148
+ return newStatus;
1149
+ }
1150
+ if ((newStatus === "blur" || newStatus === "glare") && currentStatus === "farAway") return currentStatus;
1133
1151
  if ((newStatus === "wrongSide" || newStatus === "farAway") && (currentStatus === "blur" || currentStatus === "glare")) return newStatus;
1134
1152
  return newStatus;
1135
1153
  }
@@ -1,6 +1,6 @@
1
1
  import { t as Manager } from "./Manager-C1r-74H0.js";
2
2
  import { t as ActorRefFrom } from "./Actor-Cqaw-2DF.js";
3
- import * as xstate558 from "xstate";
3
+ import * as xstate228 from "xstate";
4
4
 
5
5
  //#region src/modules/identity-reuse/types.d.ts
6
6
 
@@ -32,7 +32,7 @@ type IdentityReuseContext = {
32
32
  type IdentityReuseInput = {
33
33
  config: IdentityReuseConfig;
34
34
  };
35
- declare const identityReuseMachine: xstate558.StateMachine<IdentityReuseContext, {
35
+ declare const identityReuseMachine: xstate228.StateMachine<IdentityReuseContext, {
36
36
  type: "LOAD";
37
37
  } | {
38
38
  type: "START_SELECTION";
@@ -48,49 +48,49 @@ declare const identityReuseMachine: xstate558.StateMachine<IdentityReuseContext,
48
48
  } | {
49
49
  type: "RETRY";
50
50
  }, {
51
- [x: string]: xstate558.ActorRefFromLogic<xstate558.PromiseActorLogic<FetchCandidatesResponse, void, xstate558.EventObject>> | xstate558.ActorRefFromLogic<xstate558.PromiseActorLogic<SubmitResponse, void, xstate558.EventObject>> | undefined;
52
- }, xstate558.Values<{
51
+ [x: string]: xstate228.ActorRefFromLogic<xstate228.PromiseActorLogic<FetchCandidatesResponse, void, xstate228.EventObject>> | xstate228.ActorRefFromLogic<xstate228.PromiseActorLogic<SubmitResponse, void, xstate228.EventObject>> | undefined;
52
+ }, xstate228.Values<{
53
53
  fetchCandidates: {
54
54
  src: "fetchCandidates";
55
- logic: xstate558.PromiseActorLogic<FetchCandidatesResponse, void, xstate558.EventObject>;
55
+ logic: xstate228.PromiseActorLogic<FetchCandidatesResponse, void, xstate228.EventObject>;
56
56
  id: string | undefined;
57
57
  };
58
58
  submitContinue: {
59
59
  src: "submitContinue";
60
- logic: xstate558.PromiseActorLogic<SubmitResponse, void, xstate558.EventObject>;
60
+ logic: xstate228.PromiseActorLogic<SubmitResponse, void, xstate228.EventObject>;
61
61
  id: string | undefined;
62
62
  };
63
63
  submitSkip: {
64
64
  src: "submitSkip";
65
- logic: xstate558.PromiseActorLogic<SubmitResponse, void, xstate558.EventObject>;
65
+ logic: xstate228.PromiseActorLogic<SubmitResponse, void, xstate228.EventObject>;
66
66
  id: string | undefined;
67
67
  };
68
- }>, xstate558.Values<{
69
- clearError: {
70
- type: "clearError";
71
- params: xstate558.NonReducibleUnknown;
72
- };
68
+ }>, xstate228.Values<{
73
69
  setError: {
74
70
  type: "setError";
75
- params: xstate558.NonReducibleUnknown;
71
+ params: xstate228.NonReducibleUnknown;
72
+ };
73
+ clearError: {
74
+ type: "clearError";
75
+ params: xstate228.NonReducibleUnknown;
76
76
  };
77
77
  setCandidates: {
78
78
  type: "setCandidates";
79
- params: xstate558.NonReducibleUnknown;
79
+ params: xstate228.NonReducibleUnknown;
80
80
  };
81
81
  setSelectedCandidate: {
82
82
  type: "setSelectedCandidate";
83
- params: xstate558.NonReducibleUnknown;
83
+ params: xstate228.NonReducibleUnknown;
84
84
  };
85
85
  autoSelectSingleCandidate: {
86
86
  type: "autoSelectSingleCandidate";
87
- params: xstate558.NonReducibleUnknown;
87
+ params: xstate228.NonReducibleUnknown;
88
88
  };
89
89
  clearSelection: {
90
90
  type: "clearSelection";
91
- params: xstate558.NonReducibleUnknown;
91
+ params: xstate228.NonReducibleUnknown;
92
92
  };
93
- }>, xstate558.Values<{
93
+ }>, xstate228.Values<{
94
94
  hasMultipleCandidates: {
95
95
  type: "hasMultipleCandidates";
96
96
  params: unknown;
@@ -105,7 +105,7 @@ declare const identityReuseMachine: xstate558.StateMachine<IdentityReuseContext,
105
105
  };
106
106
  }>, never, "error" | "idle" | "finished" | "loading" | "submitContinue" | "submitSkip" | "oneCandidateFound" | "noCandidatesFound" | {
107
107
  multiCandidatesFound: "noCandidateSelected" | "choosingCandidate" | "candidateSelected";
108
- }, string, IdentityReuseInput, xstate558.NonReducibleUnknown, xstate558.EventObject, xstate558.MetaObject, {
108
+ }, string, IdentityReuseInput, xstate228.NonReducibleUnknown, xstate228.EventObject, xstate228.MetaObject, {
109
109
  readonly id: "identityReuse";
110
110
  readonly initial: "idle";
111
111
  readonly context: ({
@@ -114,75 +114,75 @@ declare const identityReuseMachine: xstate558.StateMachine<IdentityReuseContext,
114
114
  spawn: {
115
115
  <TSrc extends "fetchCandidates" | "submitContinue" | "submitSkip">(logic: TSrc, ...[options]: ({
116
116
  src: "fetchCandidates";
117
- logic: xstate558.PromiseActorLogic<FetchCandidatesResponse, void, xstate558.EventObject>;
117
+ logic: xstate228.PromiseActorLogic<FetchCandidatesResponse, void, xstate228.EventObject>;
118
118
  id: string | undefined;
119
119
  } extends infer T ? T extends {
120
120
  src: "fetchCandidates";
121
- logic: xstate558.PromiseActorLogic<FetchCandidatesResponse, void, xstate558.EventObject>;
121
+ logic: xstate228.PromiseActorLogic<FetchCandidatesResponse, void, xstate228.EventObject>;
122
122
  id: string | undefined;
123
123
  } ? T extends {
124
124
  src: TSrc;
125
- } ? xstate558.ConditionalRequired<[options?: ({
125
+ } ? xstate228.ConditionalRequired<[options?: ({
126
126
  id?: T["id"] | undefined;
127
127
  systemId?: string;
128
- input?: xstate558.InputFrom<T["logic"]> | undefined;
128
+ input?: xstate228.InputFrom<T["logic"]> | undefined;
129
129
  syncSnapshot?: boolean;
130
- } & { [K in xstate558.RequiredActorOptions<T>]: unknown }) | undefined], xstate558.IsNotNever<xstate558.RequiredActorOptions<T>>> : never : never : never) | ({
130
+ } & { [K in xstate228.RequiredActorOptions<T>]: unknown }) | undefined], xstate228.IsNotNever<xstate228.RequiredActorOptions<T>>> : never : never : never) | ({
131
131
  src: "submitContinue";
132
- logic: xstate558.PromiseActorLogic<SubmitResponse, void, xstate558.EventObject>;
132
+ logic: xstate228.PromiseActorLogic<SubmitResponse, void, xstate228.EventObject>;
133
133
  id: string | undefined;
134
134
  } extends infer T_1 ? T_1 extends {
135
135
  src: "submitContinue";
136
- logic: xstate558.PromiseActorLogic<SubmitResponse, void, xstate558.EventObject>;
136
+ logic: xstate228.PromiseActorLogic<SubmitResponse, void, xstate228.EventObject>;
137
137
  id: string | undefined;
138
138
  } ? T_1 extends {
139
139
  src: TSrc;
140
- } ? xstate558.ConditionalRequired<[options?: ({
140
+ } ? xstate228.ConditionalRequired<[options?: ({
141
141
  id?: T_1["id"] | undefined;
142
142
  systemId?: string;
143
- input?: xstate558.InputFrom<T_1["logic"]> | undefined;
143
+ input?: xstate228.InputFrom<T_1["logic"]> | undefined;
144
144
  syncSnapshot?: boolean;
145
- } & { [K_1 in xstate558.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate558.IsNotNever<xstate558.RequiredActorOptions<T_1>>> : never : never : never) | ({
145
+ } & { [K_1 in xstate228.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate228.IsNotNever<xstate228.RequiredActorOptions<T_1>>> : never : never : never) | ({
146
146
  src: "submitSkip";
147
- logic: xstate558.PromiseActorLogic<SubmitResponse, void, xstate558.EventObject>;
147
+ logic: xstate228.PromiseActorLogic<SubmitResponse, void, xstate228.EventObject>;
148
148
  id: string | undefined;
149
149
  } extends infer T_2 ? T_2 extends {
150
150
  src: "submitSkip";
151
- logic: xstate558.PromiseActorLogic<SubmitResponse, void, xstate558.EventObject>;
151
+ logic: xstate228.PromiseActorLogic<SubmitResponse, void, xstate228.EventObject>;
152
152
  id: string | undefined;
153
153
  } ? T_2 extends {
154
154
  src: TSrc;
155
- } ? xstate558.ConditionalRequired<[options?: ({
155
+ } ? xstate228.ConditionalRequired<[options?: ({
156
156
  id?: T_2["id"] | undefined;
157
157
  systemId?: string;
158
- input?: xstate558.InputFrom<T_2["logic"]> | undefined;
158
+ input?: xstate228.InputFrom<T_2["logic"]> | undefined;
159
159
  syncSnapshot?: boolean;
160
- } & { [K_2 in xstate558.RequiredActorOptions<T_2>]: unknown }) | undefined], xstate558.IsNotNever<xstate558.RequiredActorOptions<T_2>>> : never : never : never)): xstate558.ActorRefFromLogic<xstate558.GetConcreteByKey<xstate558.Values<{
160
+ } & { [K_2 in xstate228.RequiredActorOptions<T_2>]: unknown }) | undefined], xstate228.IsNotNever<xstate228.RequiredActorOptions<T_2>>> : never : never : never)): xstate228.ActorRefFromLogic<xstate228.GetConcreteByKey<xstate228.Values<{
161
161
  fetchCandidates: {
162
162
  src: "fetchCandidates";
163
- logic: xstate558.PromiseActorLogic<FetchCandidatesResponse, void, xstate558.EventObject>;
163
+ logic: xstate228.PromiseActorLogic<FetchCandidatesResponse, void, xstate228.EventObject>;
164
164
  id: string | undefined;
165
165
  };
166
166
  submitContinue: {
167
167
  src: "submitContinue";
168
- logic: xstate558.PromiseActorLogic<SubmitResponse, void, xstate558.EventObject>;
168
+ logic: xstate228.PromiseActorLogic<SubmitResponse, void, xstate228.EventObject>;
169
169
  id: string | undefined;
170
170
  };
171
171
  submitSkip: {
172
172
  src: "submitSkip";
173
- logic: xstate558.PromiseActorLogic<SubmitResponse, void, xstate558.EventObject>;
173
+ logic: xstate228.PromiseActorLogic<SubmitResponse, void, xstate228.EventObject>;
174
174
  id: string | undefined;
175
175
  };
176
176
  }>, "src", TSrc>["logic"]>;
177
- <TLogic extends xstate558.AnyActorLogic>(src: TLogic, ...[options]: xstate558.ConditionalRequired<[options?: ({
177
+ <TLogic extends xstate228.AnyActorLogic>(src: TLogic, ...[options]: xstate228.ConditionalRequired<[options?: ({
178
178
  id?: never;
179
179
  systemId?: string;
180
- input?: xstate558.InputFrom<TLogic> | undefined;
180
+ input?: xstate228.InputFrom<TLogic> | undefined;
181
181
  syncSnapshot?: boolean;
182
- } & { [K in xstate558.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate558.IsNotNever<xstate558.RequiredLogicInput<TLogic>>>): xstate558.ActorRefFromLogic<TLogic>;
182
+ } & { [K in xstate228.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate228.IsNotNever<xstate228.RequiredLogicInput<TLogic>>>): xstate228.ActorRefFromLogic<TLogic>;
183
183
  };
184
184
  input: IdentityReuseInput;
185
- self: xstate558.ActorRef<xstate558.MachineSnapshot<IdentityReuseContext, {
185
+ self: xstate228.ActorRef<xstate228.MachineSnapshot<IdentityReuseContext, {
186
186
  type: "LOAD";
187
187
  } | {
188
188
  type: "START_SELECTION";
@@ -197,7 +197,7 @@ declare const identityReuseMachine: xstate558.StateMachine<IdentityReuseContext,
197
197
  type: "SKIP";
198
198
  } | {
199
199
  type: "RETRY";
200
- }, Record<string, xstate558.AnyActorRef | undefined>, xstate558.StateValue, string, unknown, any, any>, {
200
+ }, Record<string, xstate228.AnyActorRef | undefined>, xstate228.StateValue, string, unknown, any, any>, {
201
201
  type: "LOAD";
202
202
  } | {
203
203
  type: "START_SELECTION";
@@ -212,7 +212,7 @@ declare const identityReuseMachine: xstate558.StateMachine<IdentityReuseContext,
212
212
  type: "SKIP";
213
213
  } | {
214
214
  type: "RETRY";
215
- }, xstate558.AnyEventObject>;
215
+ }, xstate228.AnyEventObject>;
216
216
  }) => {
217
217
  config: IdentityReuseConfig;
218
218
  currentOrganizationName: undefined;