import { s as FlagConditionGroup, t as FlagConditionLeaf } from '../types-DdEZ8iqq.mjs'; import './metrics.mjs'; import './flag-types.mjs'; declare const MAX_REGEX_PATTERN_LENGTH = 128; declare const MAX_REGEX_INPUT_LENGTH = 4096; declare const MAX_CONDITION_DEPTH = 12; declare const MAX_CONDITION_NODES = 100; /** * Flag and segment keys that are forbidden because they would clobber * Object.prototype members when used as map keys downstream. */ declare const FORBIDDEN_KEYS: Set; declare function isSafeRegexPattern(pattern: unknown): pattern is string; declare function safeRegexTest(pattern: unknown, actual: unknown): boolean; declare function assertSafeConditionGroup(group: FlagConditionGroup, label?: string): void; declare function findUnsafeConditionIssue(group: FlagConditionGroup, label?: string): string | null; /** * Walks a condition group depth-first, invoking `visitor` for every leaf. * Returning `true` from the visitor short-circuits the walk. * * Reused by the safety check (walkConditionGroup) and by segment-usage scanning * so we don't string-match a serialized JSON blob (which yields false positives). */ declare function walkConditions(group: FlagConditionGroup | undefined, visitor: (leaf: FlagConditionLeaf) => boolean | void): boolean; /** * Returns true when the condition group references the given segment key as a * `{ dimension: 'segment', value: ... }` leaf. Compares segment-key strings * exactly (in/eq operators), unlike the prior `JSON.stringify().includes()` * approach which produced false positives when the key happened to appear in * unrelated string values. */ declare function conditionReferencesSegment(group: FlagConditionGroup | undefined, segmentKey: string): boolean; /** * Validates a flag, segment, or namespace key. Allowed characters are * lowercase alphanumerics, dots, hyphens, and underscores. Forbidden names * (Object.prototype members, etc.) are rejected to prevent prototype-pollution * when keys are used as object keys downstream. */ declare function isSafeFlagKey(key: unknown): key is string; declare function assertSafeFlagKey(key: unknown, label?: string): asserts key is string; /** * Resolves the override file path against the current working directory and * rejects anything that escapes it (path traversal) or points at an absolute * location. Returns the resolved absolute path on success. */ declare function validateOverridePath(filePath: string, cwd: string): string; export { FORBIDDEN_KEYS, MAX_CONDITION_DEPTH, MAX_CONDITION_NODES, MAX_REGEX_INPUT_LENGTH, MAX_REGEX_PATTERN_LENGTH, assertSafeConditionGroup, assertSafeFlagKey, conditionReferencesSegment, findUnsafeConditionIssue, isSafeFlagKey, isSafeRegexPattern, safeRegexTest, validateOverridePath, walkConditions };