import "./index-B8weJxmL.js"; //#region src/internal/events/types.d.ts /** * Raw SDK analytics event used by dashboard tracking and custom analytics. * * This event stream can include detailed/noisy tracking such as screen opens, * element clicks, capture attempts, and errors. For curated flow milestones, * use `FlowEvent` from `@incodetech/core/flow-events`. */ type Event = { code: string; module?: string; screen?: string; payload?: Record; clientTimestamp?: number; }; declare const eventModuleNames: { readonly selfie: "SELFIE"; readonly faceCapture: "faceCapture"; readonly authentication: "AUTHENTICATION"; readonly authFace: "authFace"; readonly mlConsent: "ML_CONSENT"; readonly combinedConsent: "datasharingconsent"; readonly curpValidation: "CURP"; readonly faceMatch: "FACE_MATCH"; readonly qr: "QR"; readonly videoSelfie: "VIDEO_ONBOARDING"; readonly passport: "ID"; readonly front: "ID"; readonly back: "ID"; readonly id: "ID"; readonly idCapture: "idCapture"; readonly idVerification: "ID_VERIFICATION"; readonly idOcr: "ID_OCR"; readonly document: "documentCapture"; readonly creditCard: "CREDIT_CARD_FRONT"; readonly creditCardBack: "CREDIT_CARD_BACK"; readonly conference: "CONFERENCE"; readonly otp: "OTP"; readonly signature: "eSign"; readonly ekyc: "eKYC"; readonly watchlist: "watchlist"; readonly globalWatchList: "GLOBAL_WATCHLIST"; readonly customWatchList: "customWatchlist"; readonly email: "email"; readonly phone: "phoneNumber"; readonly instantVerifyEmail: "INSTANT_VERIFY_EMAIL"; readonly instantVerifyConsent: "INSTANT_VERIFY_CONSENT"; readonly forms: "forms"; readonly customModule: "CUSTOM_MODULE"; readonly geolocation: "Geolocation"; readonly ekyb: "eKYB"; readonly identityReuse: "IDENTITY_REUSE"; readonly antifraud: "antifraud"; readonly aeSignature: "AdSign"; readonly qeSignature: "QSign"; readonly crossDocumentDataMatch: "CROSS_DOCUMENT_DATA_MATCH"; readonly customFields: "CUSTOM_FIELDS"; readonly fieldComparison: "FIELD_COMPARISON"; readonly personhood: "PERSONHOOD"; readonly watchlistForBusiness: "watchlistForBusiness"; readonly trustGraph: "TRUST_GRAPH"; readonly certificateIssuance: "CERTIFICATE_ISSUANCE"; readonly governmentValidation: "GovernmentRecordValidation"; readonly documentUpload: "document-upload"; readonly home: "home"; readonly workflow: "workflow"; readonly fiscalQr: "FISCAL_QR"; }; declare const eventScreenNames: { readonly faceMatch: "FACE_MATCH"; readonly faceCaptureTutorial: "SELFIE_CAPTURE_TUTORIAL"; readonly faceCaptureCamera: "SELFIE_CAMERA_CAPTURE"; readonly faceCaptureError: "SELFIE_ATTEMPT_FAILED"; readonly faceCaptureSuccess: "SELFIE_UPLOAD_SUCCEEDED"; readonly faceCaptureUpload: "SELFIE_UPLOAD_PROGRESS"; readonly mlConsent: "MACHINE_LEARNING_CONSENT"; readonly combinedConsent: "COMBINED_CONSENT"; readonly curpEnter: "ENTER_CURP"; readonly curpValidate: "VALIDATE_CURP"; readonly curpGenerate: "GENERATE_CURP"; readonly curpValidation: "CURP_VALIDATION_PROGRESS"; readonly curpValidationFailed: "CURP_VALIDATION_FAILED"; readonly curpValidationSuccess: "CURP_VALIDATION_SUCCEEDED"; readonly qrTutorial: "QR_TUTORIAL"; readonly qrScan: "QR_SCAN"; readonly smsOtp: "OTP"; readonly simpleOTP: "OTP"; readonly signatureInput: "SIGNATURE_INPUT"; readonly frontTutorial: "FRONT_ID_CAPTURE_TUTORIAL"; readonly frontCameraCapture: "FRONT_ID_CAMERA_CAPTURE"; readonly frontHelp: "FRONT_ID_HELP"; readonly frontReviewPhoto: "FRONT_ID_REVIEW_PHOTO"; readonly frontUploadProgress: "FRONT_ID_UPLOAD_PROGRESS"; readonly frontAttemptFailed: "FRONT_ID_ATTEMPT_FAILED"; readonly frontUploadSuccess: "FRONT_ID_UPLOAD_SUCCEEDED"; readonly backTutorial: "BACK_ID_CAPTURE_TUTORIAL"; readonly backCameraCapture: "BACK_ID_CAMERA_CAPTURE"; readonly backReviewPhoto: "BACK_ID_REVIEW_PHOTO"; readonly backUploadProgress: "BACK_ID_UPLOAD_PROGRESS"; readonly backAttemptFailed: "BACK_ID_ATTEMPT_FAILED"; readonly backUploadSuccess: "BACK_ID_UPLOAD_SUCCEEDED"; readonly backHelp: "BACK_ID_HELP"; readonly passportTutorial: "TUTORIAL_PASSPORT"; readonly documentTutorial: "DOCUMENT_CAPTURE_TUTORIAL"; readonly documentCameraCapture: "DOCUMENT_CAMERA_CAPTURE"; readonly documentHelp: "DOCUMENT_HELP"; readonly documentReviewPhoto: "DOCUMENT_REVIEW_PHOTO"; readonly documentUploadProgress: "DOCUMENT_UPLOAD_IN_PROGRESS"; readonly documentAttemptFailed: "DOCUMENT_ATTEMPT_FAILED"; readonly documentUploadSuccess: "DOCUMENT_UPLOAD_SUCCEEDED"; readonly conferenceWait: "CONFERENCE_WAIT"; readonly conferenceVideoChat: "CONFERENCE_VIDEO_CHAT"; readonly conferenceMessageChat: "CONFERENCE_MESSAGE_CHAT"; readonly videoSelfieTutorial: "VIDEO_SELFIE_TUTORIAL"; readonly videoSelfie: "VIDEO_SELFIE"; readonly videoSelfieFaceCapture: "VIDEO_SELFIE_FACE_CAPTURE"; readonly videoSelfieFaceUploadProgress: "VIDEO_SELFIE_FACE_UPLOAD_PROGRESS"; readonly videoSelfieFaceAttemptFailed: "VIDEO_SELFIE_FACE_ATTEMPT_FAILED"; readonly videoSelfieFaceUploadSucceeded: "VIDEO_SELFIE_FACE_UPLOAD_SUCCEEDED"; readonly videoSelfieFrontIdCapture: "VIDEO_SELFIE_FRONT_ID_CAPTURE"; readonly videoSelfieFrontIdUploadProgress: "VIDEO_SELFIE_FRONT_ID_UPLOAD_PROGRESS"; readonly videoSelfieFrontIdAttemptFailed: "VIDEO_SELFIE_FRONT_ID_ATTEMPT_FAILED"; readonly videoSelfieFrontIdUploadSucceeded: "VIDEO_SELFIE_FRONT_ID_UPLOAD_SUCCEEDED"; readonly videoSelfieBackIdCapture: "VIDEO_SELFIE_BACK_ID_CAPTURE"; readonly videoSelfieBackIdUploadProgress: "VIDEO_SELFIE_BACK_ID_UPLOAD_PROGRESS"; readonly videoSelfieBackIdAttemptFailed: "VIDEO_SELFIE_BACK_ID_ATTEMPT_FAILED"; readonly videoSelfieBackIdUploadSucceeded: "VIDEO_SELFIE_BACK_ID_UPLOAD_SUCCEEDED"; readonly videoSelfieDocumentCapture: "VIDEO_SELFIE_DOCUMENT_CAPTURE"; readonly videoSelfieVoiceQuestion: "VIDEO_SELFIE_VOICE_QUESTION"; readonly videoSelfieVoiceFinalQuestion: "VIDEO_SELFIE_VOICE_FINAL_QUESTION"; readonly videoSelfieVideoUpload: "VIDEO SELFIE VIDEO UPLOAD"; readonly ekycInput: "EKYC_INPUT"; readonly ekycProgress: "EKYC_PROGRESS"; readonly ekycSucceeded: "EKYC_SUCCEEDED"; readonly ekycFailed: "EKYC_FAILED"; readonly forms: "FORMS"; readonly globalWatchListInput: "GLOBAL_WATCHLIST_INPUT"; readonly globalWatchListProgress: "GLOBAL_WATCHLIST_PROGRESS"; readonly globalWatchListSuccess: "GLOBAL_WATCHLIST_SUCCEEDED"; readonly globalWatchListFailed: "GLOBAL_WATCHLIST_FAILED"; readonly customWatchListInput: "CUSTOM_WATCHLIST_INPUT"; readonly customWatchListProgress: "CUSTOM_WATCHLIST_PROGRESS"; readonly customWatchListSuccess: "CUSTOM_WATCHLIST_SUCCEEDED"; readonly customWatchListFailed: "CUSTOM_WATCHLIST_FAILED"; readonly emailInput: "EMAIL_INPUT"; readonly phoneInput: "PHONE_INPUT"; readonly instantVerify: "INSTANT_VERIFY"; readonly authFace: "AUTH_FACE"; readonly authFaceError: "AUTH_FACE_ATTEMPT_FAILED"; readonly authFaceUpload: "AUTH_FACE_UPLOAD_PROGRESS"; readonly authFaceUploadSuccess: "AUTH_FACE_UPLOAD_SUCCEEDED"; readonly authFaceUploadFailed: "AUTH_FACE_UPLOAD_FAILED"; readonly authFaceTutorial: "AUTH_FACE_TUTORIAL"; readonly customModuleCallback: "CUSTOM_MODULE_CALLBACK"; readonly customModuleProcessing: "CUSTOM_MODULE_PROCESSING"; readonly digitalIdFileSelection: "DIGITAL_ID_FILE_SELECTION"; readonly digitalIdFileReview: "DIGITAL_ID_FILE_REVIEW"; readonly digitalIdUploadProgress: "DIGITAL_ID_UPLOAD_PROGRESS"; readonly digitalIdUploadSuccess: "DIGITAL_ID_UPLOAD_SUCCEEDED"; readonly digitalIdUploadFailed: "DIGITAL_ID_UPLOAD_FAILED"; readonly digitalIdAnalysisProgress: "DIGITAL_ID_ANALYSIS_PROGRESS"; readonly digitalIdVerificationSuccess: "DIGITAL_ID_VERIFICATION_SUCCESS"; readonly digitalIdVerificationFailed: "DIGITAL_ID_VERIFICATION_FAILED"; readonly ekybForm: "EKYB_FORM"; }; declare const videoSelfieEvents: { readonly imageTooBlurry: "imageTooBlurry"; readonly fillFrame: "fillFrame"; readonly checkCameraOrLighting: "checkCameraOrLighting"; readonly frontIdCaptureStarted: "frontIdCaptureStarted"; readonly lookAtCamera: "lookAtCamera"; readonly moveCloser: "moveCloser"; readonly lookingForFrontId: "lookingForFrontId"; readonly lookingForBackId: "lookingForBackId"; readonly cameraSwitchToBack: "cameraSwitchToBack"; readonly cameraSwitchToFront: "cameraSwitchToFront"; readonly audioStreamOpened: "audioStreamOpened"; readonly audioStreamClosed: "audioStreamClosed"; readonly videoSelfieQuestionAnswered: "videoSelfieQuestionAnswered"; readonly videoSelfieVideoUploadInProgress: "videoSelfieVideoUploadInProgress"; readonly videoSelfieTosNotAccepted: "videoSelfieTosNotAccepted"; readonly videoSelfieTosAccepted: "videoSelfieTosAccepted"; readonly videoSelfieStreamCreated: "videoSelfieStreamCreated"; readonly videoSelfieStreamDestroyed: "videoSelfieStreamDestroyed"; readonly videoSelfieReconnecting: "videoSelfieReconnecting"; readonly videoSelfieReconnected: "videoSelfieReconnected"; }; declare const tutorialScreenNamesMapper: { readonly passport: "TUTORIAL_PASSPORT"; readonly front: "FRONT_ID_CAPTURE_TUTORIAL"; readonly back: "BACK_ID_CAPTURE_TUTORIAL"; readonly selfie: "SELFIE_CAPTURE_TUTORIAL"; }; declare const cameraScreenNamesMapper: { readonly front: "front"; readonly back: "back"; readonly passport: "passport"; readonly creditCard: "front"; readonly creditCardBack: "back"; readonly document: "document"; }; type EventModule = (typeof eventModuleNames)[keyof typeof eventModuleNames]; type EventScreen = (typeof eventScreenNames)[keyof typeof eventScreenNames]; //#endregion //#region src/internal/events/addEvent.d.ts type EventSubscriber = (event: Event) => void; /** * Subscribes to raw SDK analytics events. * * This stream includes noisy tracking events such as `screenOpened`, * `elementClicked`, and `captureAttemptFinished`. These events are also used by * the SDK analytics pipeline and may be queued or posted to the interview-events * API. * * For curated flow milestones such as `flow.started`, `flow.ready`, and * `flow.completed`, use `manager.subscribeFlowEvent()`. The `FlowEvent` type is * exported from `@incodetech/core/flow-events`. * * @param listener - Callback function that receives each event * @returns Unsubscribe function to remove the listener * * @example * ```typescript * const unsubscribe = subscribeEvent((event) => { * console.log('[Event]', event.code, event.module); * }); * * // Later * unsubscribe(); * ``` */ declare function subscribeEvent(listener: EventSubscriber): () => void; /** * Sends an event to the dashboard for tracking. * Fire-and-forget: never blocks, never throws. * Subscribers always receive the event at emit time. When a batcher is * registered, the event is enqueued for batched delivery. Before any batcher * is registered (events fired pre-`setup()`), the event is buffered in a * one-shot pending queue and drained into the batcher when it's registered. */ declare function addEvent(event: Event): void; //#endregion //#region src/internal/events/helpers.d.ts type ScreenEventParams = { module: EventModule | string; screen?: EventScreen | string; code: string; payload?: Record; }; type ElementClickedPayload = { element: string; action?: string; metadata?: Record; }; type CaptureAttemptFinishedPayload = { logs: string; }; type StateChangedPayload = { /** * The Figma sub-section name for the in-screen state, e.g. * `idCapture.frontCapture.livecue-glare`. Emitted verbatim. */ stateName: string; }; /** * Verbatim copy of the console-supplied `analytics` block for a resolved * experiment, plus any caller-supplied `conditions`. No field is required or * validated by the SDK — the analytics team controls this shape entirely. * `module` is reserved: `experimentAssigned` always sets it after the * spread, so a console payload can never override it. */ type ExperimentAssignedPayload = Record & { conditions?: Record; }; declare function screenEvent(params: ScreenEventParams): void; declare function moduleOpened(module: EventModule | string, screen?: EventScreen | string, payload?: Record): void; declare function moduleClosed(module: EventModule | string, screen?: EventScreen | string, payload?: Record): void; declare function screenOpened(module: EventModule | string, screen: EventScreen | string, payload?: Record): void; declare function screenClosed(module: EventModule | string, screen: EventScreen | string, payload?: Record): void; declare function stateChanged(module: EventModule | string, screen: EventScreen | string | undefined, payload: StateChangedPayload): void; declare function elementClicked(module: EventModule | string, screen: EventScreen | string | undefined, payload: ElementClickedPayload): void; declare function captureAttemptFinished(module: EventModule | string, screen: EventScreen | string | undefined, payload: CaptureAttemptFinishedPayload): void; declare function experimentAssigned(module: EventModule | string, payload: ExperimentAssignedPayload, screen?: EventScreen | string): void; //#endregion //#region src/internal/events/experimentAssignment.d.ts /** * Records an `experimentsAssigned` interview-event, but only the first time * for a given `dedupeKey` (pass the experiment's `storeParam`) since the * last `resetExperimentAssignments()` call. */ declare function recordExperimentAssignmentOnce(module: EventModule | string, dedupeKey: string, payload: ExperimentAssignedPayload, screenName?: EventScreen | string): void; //#endregion export { type CaptureAttemptFinishedPayload, type ElementClickedPayload, type Event, type EventModule, type EventScreen, type ExperimentAssignedPayload, type StateChangedPayload, addEvent, cameraScreenNamesMapper, captureAttemptFinished, elementClicked, eventModuleNames, eventScreenNames, experimentAssigned, moduleClosed, moduleOpened, recordExperimentAssignmentOnce, screenClosed, screenEvent, screenOpened, stateChanged, subscribeEvent, tutorialScreenNamesMapper, videoSelfieEvents };