import { i as ClientContext, n as Frame, o as UserAgentContext } from "./types-o_AGFuBA.cjs"; //#region src/events.d.ts /** * Mirrors rrweb's serialized-node types but decoupled — we own the enum. */ declare enum SerializedNodeType { Document = 0, DocumentType = 1, Element = 2, Text = 3, CDATA = 4, Comment = 5 } /** * Mirrors rrweb event types but decoupled — we own the enum. */ declare enum RecordingEventType { DomContentLoaded = 0, Load = 1, FullSnapshot = 2, IncrementalSnapshot = 3, Meta = 4, Custom = 5, Plugin = 6 } declare const RecordingCustomEventTag: { readonly RageClick: "csr:rageClick"; readonly FormFieldReEdit: "csr:formFieldReEdit"; readonly ScrollBack: "csr:scrollBack"; readonly Click: "csr:click"; readonly Input: "csr:input"; readonly DeadClick: "csr:deadClick"; readonly TabUnfocus: "csr:tabUnfocus"; readonly TabRefocus: "csr:tabRefocus"; readonly RouteChange: "csr:routeChange"; readonly ErrorMessage: "csr:errorMessage"; readonly DialogOpened: "csr:dialogOpened"; readonly IdleGap: "csr:idleGap"; readonly AwayGap: "csr:awayGap"; }; declare const RecordingPluginName: { readonly BlockedElementLabels: "csr/blocked-element-labels@1"; readonly Clipboard: "csr/clipboard@1"; readonly ClickModifiers: "csr/click-modifiers@1"; readonly TabVisibility: "csr:tabVisibility"; readonly ConsoleLog: "rrweb/console@1"; readonly NetworkRequest: "csr:networkRequest"; readonly RouteChange: "csr:routeChange"; readonly Tag: "csr:tag"; readonly Measure: "csr:measure"; readonly FlagEvaluation: "csr:flagEvaluation"; }; /** * Incremental snapshot sub-types. */ declare enum IncrementalSource { Mutation = 0, MouseMove = 1, MouseInteraction = 2, Scroll = 3, ViewportResize = 4, Input = 5, TouchMove = 6, MediaInteraction = 7, StyleSheetRule = 8, CanvasMutation = 9, Font = 10, Log = 11, Drag = 12, StyleDeclaration = 13, Selection = 14, AdoptedStyleSheet = 15 } /** * From rrweb MouseInteractions. */ declare enum MouseInteractions { MouseUp = 0, MouseDown = 1, Click = 2, ContextMenu = 3, DblClick = 4, Focus = 5, Blur = 6, TouchStart = 7, TouchMove_Departed = 8, TouchEnd = 9, TouchCancel = 10 } /** * Incremental mouse-interaction data emitted by rrweb. */ type MouseInteractionData = { source: IncrementalSource.MouseInteraction; type: MouseInteractions; id: number; x?: number; y?: number; pointerType?: number; /** Mouse button and modifier keys present on click events. */ button?: number; altKey?: boolean; ctrlKey?: boolean; metaKey?: boolean; shiftKey?: boolean; }; type SelectionRange = { start: number; startOffset: number; end: number; endOffset: number; }; /** * Incremental text-selection data emitted by rrweb. */ type SelectionData = { source: IncrementalSource.Selection; ranges: SelectionRange[]; }; /** * Incremental sources that csr-common does not model yet. The source remains * discriminated so consumers can narrow the known mouse and selection shapes. */ type OpaqueIncrementalData = { source: Exclude; [key: string]: unknown; }; type IncrementalSnapshotData = MouseInteractionData | SelectionData | OpaqueIncrementalData; type RageClickCustomData = { tag: typeof RecordingCustomEventTag.RageClick; payload: { eventId?: string; targetId: number; clickCount: number; durationMs: number; element?: ElementDescriptor; pathname?: string; }; }; type FormFieldReEditCustomData = { tag: typeof RecordingCustomEventTag.FormFieldReEdit; payload: { eventId?: string; targetId: number; editCount: number; element?: ElementDescriptor; pathname?: string; }; }; type ScrollBackCustomData = { tag: typeof RecordingCustomEventTag.ScrollBack; payload: { eventId?: string; scrollBackPx: number; fromY: number; toY: number; pathname?: string; }; }; type ElementDescriptor = { tagName: string; classes?: string[]; textContent?: string; attributes?: Record; }; type ClickCustomData = { tag: typeof RecordingCustomEventTag.Click; payload: { eventId?: string; targetId: number; element?: ElementDescriptor; pathname?: string; button?: number; altKey?: boolean; ctrlKey?: boolean; metaKey?: boolean; shiftKey?: boolean; }; }; type InputCustomData = { tag: typeof RecordingCustomEventTag.Input; payload: { eventId?: string; targetId: number; element?: ElementDescriptor; pathname?: string; fieldType?: string; hasValue?: boolean; source?: "paste"; }; }; type ClipboardAction = "copy" | "cut" | "paste"; type ClipboardPluginData = { plugin: typeof RecordingPluginName.Clipboard; payload: { action: ClipboardAction; targetId: number; }; }; type DeadClickCustomData = { tag: typeof RecordingCustomEventTag.DeadClick; payload: { eventId?: string; targetId: number; element?: ElementDescriptor; pathname?: string; }; }; type TabUnfocusCustomData = { tag: typeof RecordingCustomEventTag.TabUnfocus; payload: { eventId?: string; pathname?: string; }; }; type TabRefocusCustomData = { tag: typeof RecordingCustomEventTag.TabRefocus; payload: { eventId?: string; awayDurationMs: number; pathname?: string; }; }; type RouteChangeTrigger = "pushState" | "replaceState" | "popstate" | "navigation"; type RouteChangePayload = { from: string; to: string; trigger: RouteChangeTrigger; }; type RouteChangeCustomData = { tag: typeof RecordingCustomEventTag.RouteChange; payload: RouteChangePayload & { eventId?: string; }; }; /** * Plugin event data emitted by the recorder for tab visibility changes. */ type TabVisibilityPluginData = { plugin: typeof RecordingPluginName.TabVisibility; payload: { hidden: boolean; }; }; type ConsoleLogLevel = "log" | "warn" | "error" | "debug" | "info"; /** * Plugin event data emitted by rrweb's console record plugin. * Shape matches `@rrweb/rrweb-plugin-console-record` LogData. */ type ConsoleLogPluginData = { plugin: typeof RecordingPluginName.ConsoleLog; payload: { level: ConsoleLogLevel; payload: string[]; trace: string[]; }; }; type NetworkRequestInitiator = "fetch" | "xhr"; type GraphQLRequestMetadata = { operationName: string; }; /** * Plugin event data emitted by the recorder for network requests. */ type NetworkRequestPluginData = { plugin: typeof RecordingPluginName.NetworkRequest; payload: { initiator: NetworkRequestInitiator; method: string; url: string; status: number; durationMs: number; requestSize?: number; responseSize?: number; graphql?: GraphQLRequestMetadata; }; }; type RouteChangePluginData = { plugin: typeof RecordingPluginName.RouteChange; payload: RouteChangePayload; }; type TagPluginData = { plugin: typeof RecordingPluginName.Tag; payload: { key: string; value?: string; }; }; type MeasurePluginData = { plugin: typeof RecordingPluginName.Measure; payload: { key: string; value?: number; }; }; type FlagEvaluationPluginData = { plugin: typeof RecordingPluginName.FlagEvaluation; payload: { flagKey: string; variant: string; assignmentOrigin: string; }; }; type PluginEventData = ClipboardPluginData | TabVisibilityPluginData | ConsoleLogPluginData | NetworkRequestPluginData | RouteChangePluginData | TagPluginData | MeasurePluginData | FlagEvaluationPluginData; type ErrorMessageCustomData = { tag: typeof RecordingCustomEventTag.ErrorMessage; payload: { eventId?: string; text: string; }; }; type DialogOpenedCustomData = { tag: typeof RecordingCustomEventTag.DialogOpened; payload: { eventId?: string; content: string[]; }; }; type IdleGapCustomData = { tag: typeof RecordingCustomEventTag.IdleGap; payload: { eventId?: string; visibleGapS: number; totalGapS: number; hiddenS: number; trailing: boolean; }; }; type AwayGapCustomData = { tag: typeof RecordingCustomEventTag.AwayGap; payload: { eventId?: string; totalGapS: number; hiddenS: number; }; }; /** * Closed union of every Custom event we emit. Add a new variant here when * introducing a new tag — emitting an unregistered tag is a TS error. * * Every payload carries an optional `eventId`: a per-event identity stamped * at emission by the analyzer (uuid). It is inert metadata — players ignore * it — and exists so downstream review tooling can reference and remove * individual generated events without patching untyped data. */ type CustomEventData = ClickCustomData | InputCustomData | RageClickCustomData | FormFieldReEditCustomData | ScrollBackCustomData | DeadClickCustomData | TabUnfocusCustomData | TabRefocusCustomData | RouteChangeCustomData | ErrorMessageCustomData | DialogOpenedCustomData | IdleGapCustomData | AwayGapCustomData; /** * A single recorded event. * * For non-Custom events `data` is `unknown` (decoupled from rrweb internals). * For Custom events `data.tag` discriminates the payload across the closed * `CustomEventData` union. */ type RecordingEvent = { type: RecordingEventType.Custom; timestamp: number; data: CustomEventData; } | { type: RecordingEventType.IncrementalSnapshot; timestamp: number; data: IncrementalSnapshotData; } | { type: RecordingEventType.Plugin; timestamp: number; data: PluginEventData; } | { type: Exclude; timestamp: number; data: unknown; }; //#endregion //#region src/url.d.ts /** Remove query strings and fragments, including from relative or malformed URLs. */ declare function stripUrlQueryAndHash(url: string): string; /** * Extract only the pathname from a URL, stripping origin, query string, and * hash. Used across recorder and analyzer to avoid capturing PII in route data. */ declare function stripUrl(url: string): string; //#endregion //#region src/metrics.d.ts declare const RecordingMetricKey: { readonly Click: "clicks"; readonly Input: "inputs"; readonly RageClick: "rageClicks"; readonly FormFieldReEdit: "formFieldReEdits"; readonly DeadClick: "deadClicks"; readonly ScrollBack: "scrollBacks"; readonly TabUnfocus: "tabUnfocuses"; readonly ErrorMessage: "errorMessages"; readonly FailedNetworkRequest: "networkRequestsFailed"; readonly NetworkRequest: "networkRequests"; readonly ConsoleLog: "consoleLogs"; readonly ConsoleWarning: "consoleWarnings"; readonly ConsoleError: "consoleErrors"; readonly RouteChange: "routeChanges"; }; //#endregion //#region src/session-activity.d.ts declare const isUserInteractionEvent: (event: unknown) => boolean; declare const isUserInteractionMetric: (metricKey: string) => boolean; declare const isSessionActivityEvent: (event: unknown) => boolean; //#endregion //#region src/custom-event-limits.d.ts declare const MAX_KEY_LENGTH = 128; declare const MAX_TAG_VALUE_LENGTH = 256; declare const MAX_DISTINCT_KEYS = 100; declare const MAX_VALUES_PER_KEY = 1e3; declare function validateKey(key: string): string | null; declare function validateTagValue(value: string | undefined): string | null; declare function validateMeasureValue(value: number | undefined): string | null; //#endregion export { type AwayGapCustomData, type ClickCustomData, type ClientContext, type ClipboardAction, type ClipboardPluginData, type ConsoleLogLevel, type ConsoleLogPluginData, type CustomEventData, type DeadClickCustomData, type DialogOpenedCustomData, type ElementDescriptor, type ErrorMessageCustomData, type FlagEvaluationPluginData, type FormFieldReEditCustomData, type Frame, type GraphQLRequestMetadata, type IdleGapCustomData, type IncrementalSnapshotData, IncrementalSource, type InputCustomData, MAX_DISTINCT_KEYS, MAX_KEY_LENGTH, MAX_TAG_VALUE_LENGTH, MAX_VALUES_PER_KEY, type MeasurePluginData, type MouseInteractionData, MouseInteractions, type NetworkRequestInitiator, type NetworkRequestPluginData, type OpaqueIncrementalData, type PluginEventData, type RageClickCustomData, RecordingCustomEventTag, type RecordingEvent, RecordingEventType, RecordingMetricKey, RecordingPluginName, type RouteChangeCustomData, type RouteChangePayload, type RouteChangePluginData, type RouteChangeTrigger, type ScrollBackCustomData, type SelectionData, type SelectionRange, SerializedNodeType, type TabRefocusCustomData, type TabUnfocusCustomData, type TabVisibilityPluginData, type TagPluginData, type UserAgentContext, isSessionActivityEvent, isUserInteractionEvent, isUserInteractionMetric, stripUrl, stripUrlQueryAndHash, validateKey, validateMeasureValue, validateTagValue };