{"version":3,"file":"native-node2.mjs","names":["languageScopes","loadDefaultPlatformNativePackage","nativePackageVersionWithBinding","convertExternalDetectionBatchWithBinding","normalizeForSearchWithBinding","prepareSearchPackageWithBinding","loadPreparedPackageWithBinding","redactTextWithBinding","redactTextJsonWithBinding","redactTextStreamJsonWithBinding","diagnosticsJsonWithBinding","diagnosticsStreamJsonWithBinding","summaryDiagnosticsJsonWithBinding"],"sources":["../src/bun-version.ts","../src/context.ts","../src/types.ts","../src/util/language-selection.ts","../src/pipeline-cache-key.ts","../src/native-pipeline.ts","../src/native-default-config.ts","../src/pipeline-language.ts","../src/create-pipeline.ts","../src/native-node.ts"],"sourcesContent":["const MINIMUM_BUN_MAJOR = 1;\nconst MINIMUM_BUN_MINOR = 4;\nconst MINIMUM_BUN_PATCH = 1;\nconst BUN_VERSION_PATTERN =\n  /^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)(?:-(?<prerelease>[0-9A-Za-z.-]+))?(?:\\+[0-9A-Za-z.-]+)?$/u;\n\nexport const MINIMUM_SUPPORTED_BUN_VERSION = \"1.4.1\";\n\nexport const assertSupportedBunVersion = (bunVersion?: string): void => {\n  if (bunVersion === undefined) {\n    return;\n  }\n\n  const match = BUN_VERSION_PATTERN.exec(bunVersion);\n  const { major, minor, patch, prerelease } = match?.groups ?? {};\n  if (major === undefined || minor === undefined || patch === undefined) {\n    throw unsupportedBunVersionError(bunVersion);\n  }\n\n  const majorNumber = Number(major);\n  const minorNumber = Number(minor);\n  const patchNumber = Number(patch);\n  if (\n    !Number.isSafeInteger(majorNumber) ||\n    !Number.isSafeInteger(minorNumber) ||\n    !Number.isSafeInteger(patchNumber)\n  ) {\n    throw unsupportedBunVersionError(bunVersion);\n  }\n\n  const coreVersionIsNewer =\n    majorNumber > MINIMUM_BUN_MAJOR ||\n    (majorNumber === MINIMUM_BUN_MAJOR &&\n      (minorNumber > MINIMUM_BUN_MINOR ||\n        (minorNumber === MINIMUM_BUN_MINOR &&\n          patchNumber > MINIMUM_BUN_PATCH)));\n  const minimumReleaseIsSupported =\n    majorNumber === MINIMUM_BUN_MAJOR &&\n    minorNumber === MINIMUM_BUN_MINOR &&\n    patchNumber === MINIMUM_BUN_PATCH &&\n    prerelease === undefined;\n  if (!coreVersionIsNewer && !minimumReleaseIsSupported) {\n    throw unsupportedBunVersionError(bunVersion);\n  }\n};\n\nexport const assertSupportedBunRuntime = (): void => {\n  const runtime: unknown = globalThis;\n  if (!hasBunRuntime(runtime)) {\n    return;\n  }\n  const bun = runtime.Bun;\n  if (\n    typeof bun !== \"object\" ||\n    bun === null ||\n    !(\"version\" in bun) ||\n    typeof bun.version !== \"string\"\n  ) {\n    throw unsupportedBunVersionError(\"unknown\");\n  }\n  assertSupportedBunVersion(bun.version);\n};\n\nconst hasBunRuntime = (runtime: unknown): runtime is { Bun: unknown } =>\n  typeof runtime === \"object\" && runtime !== null && \"Bun\" in runtime;\n\nconst unsupportedBunVersionError = (bunVersion: string): Error =>\n  new Error(\n    `Bun ${bunVersion} is unsupported; @stll/anonymize requires Bun >=${MINIMUM_SUPPORTED_BUN_VERSION}. Upgrade Bun before loading the native SDK.`,\n  );\n","/**\n * Cached state for a single pipeline run (or a sequence of runs sharing the\n * same config). The native pipeline builds its prepared package once and reuses\n * it across calls with the same config; the package bytes and the key/promise\n * that guard concurrent builds live here so callers can share one warmed\n * context.\n */\nexport type PipelineContext = {\n  // ── Native prepared-package cache ─────────────\n  nativePipelinePackage: Uint8Array | null;\n  nativePipelinePackageKey: string;\n  nativePipelinePackagePromise: Promise<Uint8Array> | null;\n};\n\n/** Create a fresh, empty pipeline context. */\nexport const createPipelineContext = (): PipelineContext => ({\n  nativePipelinePackage: null,\n  nativePipelinePackageKey: \"\",\n  nativePipelinePackagePromise: null,\n});\n\n/**\n * Module-level default context. Used when callers\n * don't provide an explicit context, preserving full\n * backward compatibility with the existing API.\n */\nexport const defaultContext: PipelineContext = createPipelineContext();\n","// Runtime-free constants live in `./constants`; re-exported\n// here for back-compat with existing call sites that import\n// from `@stll/anonymize` directly.\n//\n// `verbatimModuleSyntax` requires an explicit type-only\n// import for any name used locally as a type even when it\n// is also re-exported below — applies to `DetectionSource`\n// (used by `Entity`) and `OperatorType` (used by\n// `OperatorConfig`).\nimport type { DetectionSource, OperatorType } from \"./constants\";\nimport { DETECTION_SOURCES } from \"./constants\";\n\nexport {\n  DETECTION_SOURCES,\n  DETECTOR_PRIORITY,\n  type DetectionSource,\n} from \"./constants\";\n\n/**\n * Fields shared by every entity span in the source text.\n */\ntype EntityBase = {\n  start: number;\n  end: number;\n  label: string;\n  text: string;\n  score: number;\n  sourceDetail?: \"custom-deny-list\" | \"custom-regex\" | \"gazetteer-extension\";\n};\n\n/**\n * A PII entity span found by a primary detection layer\n * (regex, NER, legal forms, deny list, ...).\n */\nexport type DetectedEntity = EntityBase & {\n  source: Exclude<DetectionSource, typeof DETECTION_SOURCES.COREFERENCE>;\n};\n\n/**\n * An alias mention of a previously detected entity: a\n * defined term (\"the Seller\") or a propagated bare\n * mention (\"Acme\" after \"Acme Corp.\").\n *\n * `corefSourceText` is required by construction, so an\n * alias cannot exist without the link back to its source\n * entity. Placeholder numbering reads it to give the\n * alias the same placeholder as the source. The link\n * travels with the entity instead of living in a\n * side-channel map that a producer could forget to\n * write — or that a later pass could clear.\n */\nexport type CorefAliasEntity = EntityBase & {\n  source: typeof DETECTION_SOURCES.COREFERENCE;\n  /** Full text of the source entity this alias refers to. */\n  corefSourceText: string;\n};\n\n/**\n * A detected PII entity span in the source text.\n * Every detection layer produces these.\n */\nexport type Entity = DetectedEntity | CorefAliasEntity;\n\n/**\n * Entity after human review. Extends the base Entity\n * with a review decision.\n */\nexport type ReviewDecision = \"confirmed\" | \"rejected\" | \"relabeled\";\n\nexport type ReviewedEntity = Entity & {\n  decision?: ReviewDecision;\n  originalLabel?: string;\n};\n\n/**\n * A single entry in the workspace-scoped gazetteer\n * (deny list). Persisted in IndexedDB.\n */\nexport type GazetteerEntry = {\n  id: string;\n  canonical: string;\n  label: string;\n  variants: string[];\n  workspaceId: string;\n  createdAt: number;\n  source: \"manual\" | \"confirmed-from-model\";\n};\n\n/** Extraction strategy — closed discriminated union. */\nexport type TriggerStrategy =\n  | {\n      type: \"to-next-comma\";\n      /**\n       * Optional list of lowercase keywords that terminate\n       * the value scan, in addition to commas/newlines. Useful\n       * for triggers like court names that may continue past\n       * a missing comma into adjacent clause text (\"Městským\n       * soudem v Praze dne 1. 1. 2020\"); listing `\"dne\"` here\n       * stops the scan at the date boundary. Matched on a\n       * word-boundary, case-insensitive.\n       */\n      stopWords?: string[];\n      /**\n       * Hard cap on the captured span length, in characters,\n       * regardless of where the next comma / stop char sits.\n       * Use for triggers that label short formulaic phrases\n       * (\"State of Delaware\") and must not absorb the rest\n       * of a long forum-selection clause when the comma is\n       * sentences away. Falls back to the default 100-char\n       * fallback when omitted.\n       */\n      maxLength?: number;\n    }\n  | { type: \"to-end-of-line\" }\n  | { type: \"n-words\"; count: number }\n  | { type: \"company-id-value\" }\n  | { type: \"address\"; maxChars?: number }\n  | {\n      /**\n       * Extract the first regex match in the value text.\n       * Useful for shape-bounded values that follow a\n       * label on the same line as other fields, where\n       * `to-end-of-line` would over-capture. The pattern\n       * is anchored to the start of the (already\n       * leading-whitespace-stripped) value, so use\n       * `(?:.*?)` prefix only when intentional.\n       */\n      type: \"match-pattern\";\n      pattern: string;\n      flags?: string;\n    };\n\n/** Validation rules — closed discriminated union. */\nexport type TriggerValidation =\n  | { type: \"starts-uppercase\" }\n  | { type: \"min-length\"; min: number }\n  | { type: \"max-length\"; max: number }\n  | { type: \"no-digits\" }\n  | { type: \"has-digits\" }\n  | {\n      type: \"matches-pattern\";\n      pattern: string;\n      flags?: string;\n    }\n  /**\n   * Run a named stdnum validator (checksum + length)\n   * against the captured value. Keeps the trigger\n   * path symmetrical with the formatted-regex\n   * detectors so e.g. `CPF nº 00000000000` does not\n   * survive as a tax-ID entity.\n   */\n  | { type: \"valid-id\"; validator: ValidIdValidator };\n\n/** Built-in stdnum validators that can be referenced\n *  by `valid-id` validations. */\nexport type ValidIdValidator = \"br.cpf\" | \"br.cnpj\" | \"us.rtn\";\n\n/** Auto-generated trigger variants — closed set. */\nexport type TriggerExtension =\n  | \"add-colon\"\n  | \"add-trailing-space\"\n  | \"add-colon-space\"\n  | \"normalize-spaces\";\n\n/** V2 trigger config entry (JSON shape). */\nexport type TriggerGroupConfig = {\n  id?: string;\n  triggers: string[];\n  label: string;\n  strategy: TriggerStrategy;\n  extensions?: TriggerExtension[];\n  validations?: TriggerValidation[];\n  /** When true, include the trigger text in the\n   *  entity span (e.g., court names). */\n  includeTrigger?: boolean;\n};\n\n/** Compiled validation with pre-built regex. */\nexport type CompiledValidation =\n  | { type: \"starts-uppercase\"; re: RegExp }\n  | { type: \"min-length\"; min: number }\n  | { type: \"max-length\"; max: number }\n  | { type: \"no-digits\"; re: RegExp }\n  | { type: \"has-digits\"; re: RegExp }\n  | { type: \"matches-pattern\"; re: RegExp }\n  | {\n      type: \"valid-id\";\n      validator: ValidIdValidator;\n      check: (value: string) => boolean;\n    };\n\n/**\n * Runtime rule — one per trigger string after\n * expansion. Fed to the Aho-Corasick automaton.\n */\nexport type TriggerRule = {\n  trigger: string;\n  label: string;\n  strategy: TriggerStrategy;\n  validations: CompiledValidation[];\n  includeTrigger: boolean;\n};\n\nexport {\n  ENTITY_CAPABILITIES,\n  ENTITY_LABELS,\n  ENTITY_SELECTIONS,\n  OPERATOR_TYPES,\n  type DefaultEntityLabel,\n  type EntityCapability,\n  type EntityLabel,\n  type EntitySelection,\n  type OperatorType,\n} from \"./constants\";\n\n/** Per-label operator selection. Key is the entity label. */\nexport type MaskDirection = \"start\" | \"end\";\n\nexport type MaskOperatorConfig = {\n  type: \"mask\";\n  maskingCharacter: string;\n  charactersToMask: number;\n  direction: MaskDirection;\n};\n\nexport type OperatorSelection =\n  | Exclude<OperatorType, \"mask\">\n  | MaskOperatorConfig;\n\nexport type OperatorConfig = {\n  /** Operator per label. Missing labels default to \"replace\". */\n  operators: Record<string, OperatorSelection>;\n  /** Custom replacement string for the redact operator. */\n  redactString: string;\n};\n\n/** Whether an operator produces a reversible redaction entry. */\ntype OperatorReversibility = \"reversible\" | \"irreversible\" | \"preserving\";\n\nexport type AnonymisationOperator = {\n  type: OperatorType;\n  reversibility: OperatorReversibility;\n  /**\n   * Apply the operator to a single entity occurrence.\n   * Returns the replacement string to embed in the document.\n   */\n  apply: (\n    text: string,\n    label: string,\n    placeholder: string,\n    redactString: string,\n    selection: OperatorSelection,\n  ) => string;\n};\n\n/**\n * Redacted document output with stable entity mapping.\n */\nexport type RedactionResult = {\n  redactedText: string;\n  /**\n   * Maps placeholder to original text. Only populated for\n   * reversible operators (replace). Empty for redact, keep, and mask.\n   */\n  redactionMap: Map<string, string>;\n  /** Maps placeholder to the operator that produced it. */\n  operatorMap: Map<string, OperatorType>;\n  entityCount: number;\n};\n\n/**\n * Configuration for the detection pipeline.\n */\nexport type DenyListCategory =\n  | \"Names\"\n  | \"Places\"\n  | \"Addresses\"\n  | \"Courts\"\n  | \"Financial\"\n  | \"Government\"\n  | \"Healthcare\"\n  | \"Education\"\n  | \"Political\"\n  | \"Organizations\"\n  | \"International\";\n\n/**\n * Metadata for a single dictionary entry in the\n * deny-list system. Mirrors the shape from\n * the anonymize-data package so consumers can pass\n * pre-loaded data without a runtime dependency.\n */\nexport type DictionaryMeta = {\n  label: string;\n  category: DenyListCategory;\n  country: string | null;\n};\n\n/**\n * Caller-supplied exact terms for deny-list matching.\n * These entries are merged with the published deny-list\n * dictionaries when `enableDenyList` is enabled.\n */\nexport type CustomDenyListEntry = {\n  value: string;\n  label: string;\n  variants?: readonly string[];\n};\n\n/**\n * Caller-supplied regex detector. The pattern is passed\n * to the native Rust regex engine, so use its supported\n * regex syntax. Inline flags such as `(?i)` are accepted\n * when supported by that engine.\n */\nexport type CustomRegexPattern = {\n  pattern: string;\n  label: string;\n  score?: number;\n  preparedArtifactPolicy?: \"include\" | \"omit\";\n};\n\n/**\n * Pre-loaded dictionary data for dependency injection.\n * Consumers that want name/city/deny-list detection\n * load dictionaries themselves (e.g. from the\n * anonymize-data package) and pass them here; the\n * anonymize package has zero cross-package imports.\n *\n * All fields are optional. When a field is absent,\n * the corresponding detection path is skipped (same\n * behavior as when no dictionaries are available).\n */\nexport type Dictionaries = {\n  /**\n   * First names per language code (e.g., \"cs\", \"de\").\n   */\n  firstNames?: Readonly<Record<string, readonly string[]>>;\n  /**\n   * Surnames per language code.\n   */\n  surnames?: Readonly<Record<string, readonly string[]>>;\n  /**\n   * Non-Western name tokens per locale code\n   * (e.g., \"in\", \"ar\", \"ja-latn\", \"ko\", \"zh-latn\",\n   * \"th\", \"vi\", \"fil\", \"id\"). Merged with bundled\n   * names-nw-*.json data at init time.\n   */\n  nonWesternNames?: Readonly<Record<string, readonly string[]>>;\n  /**\n   * Pre-loaded deny-list dictionaries keyed by\n   * dictionary ID (e.g., \"courts/CZ\", \"banks/DE\").\n   * Each value is the array of terms for that\n   * dictionary.\n   */\n  denyList?: Readonly<Record<string, readonly string[]>>;\n  /**\n   * Metadata per dictionary ID. Required when\n   * `denyList` is provided so the pipeline knows\n   * labels, categories, and country filters.\n   */\n  denyListMeta?: Readonly<Record<string, DictionaryMeta>>;\n  /**\n   * Pre-loaded city names, already merged across\n   * all desired countries.\n   *\n   * Prefer `citiesByCountry` when callers also pass\n   * `denyListCountries` / `denyListRegions`; merged\n   * city arrays cannot be scoped after injection.\n   */\n  cities?: readonly string[];\n  /**\n   * Pre-loaded city names keyed by ISO 3166-1 alpha-2\n   * country code. When provided, the deny-list builder\n   * applies `denyListCountries` / `denyListRegions`\n   * before adding city patterns to the search automaton.\n   */\n  citiesByCountry?: Readonly<Record<string, readonly string[]>>;\n};\n\n/**\n * Street-address detection without a known-city anchor.\n */\nexport type StandaloneStreetDetection = \"off\" | \"houseNumberAnchored\";\n\nexport type PipelineConfig = {\n  threshold: number;\n  enableTriggerPhrases: boolean;\n  enableRegex: boolean;\n  /**\n   * Expected content language codes. When present, these\n   * derive default dictionary scopes for name corpus and\n   * deny-list matching unless the lower-level scope fields\n   * below are set explicitly.\n   */\n  languages?: string[];\n  /**\n   * Convenience form for single-language documents. Ignored\n   * when `languages` is also provided.\n   */\n  language?: string;\n  /**\n   * Enables legal-form organization detection.\n   * Required for typed callers; legacy untyped\n   * callers that omit this field are treated as\n   * enabled at runtime for backward compatibility.\n   */\n  enableLegalForms: boolean;\n  /**\n   * Enables first-name/surname/title corpus matching.\n   * When deny-list mode is enabled, this also controls\n   * whether name-corpus entries are injected into the\n   * deny-list search automaton.\n   */\n  enableNameCorpus: boolean;\n  /**\n   * Optional language scope for first-name/surname\n   * dictionaries, using the keys present in\n   * `dictionaries.firstNames` / `dictionaries.surnames`\n   * (for example `[\"en\", \"de\"]`). When omitted, all\n   * injected name languages are used for backward\n   * compatibility.\n   */\n  nameCorpusLanguages?: string[];\n  enableDenyList: boolean;\n  denyListCountries?: string[];\n  denyListRegions?: string[];\n  denyListExcludeCategories?: string[];\n  /**\n   * Caller-owned exact terms to match through the\n   * deny-list layer. Requires `enableDenyList: true`.\n   */\n  customDenyList?: readonly CustomDenyListEntry[];\n  /**\n   * Caller-owned regex detectors. Requires\n   * `enableRegex: true`.\n   */\n  customRegexes?: readonly CustomRegexPattern[];\n  enableGazetteer: boolean;\n  /**\n   * Detect country names (ISO 3166-1 names, curated\n   * aliases, alpha-3 codes). Defaults to true. Names\n   * span all manifest languages plus widely-used\n   * additions (Dutch, Russian, Chinese, Arabic, etc.).\n   */\n  enableCountries?: boolean;\n  enableConfidenceBoost: boolean;\n  enableCoreference: boolean;\n  enableZoneClassification?: boolean;\n  enableHotwordRules?: boolean;\n  /**\n   * Detect a street address that carries no known-city\n   * anchor. Defaults to `\"off\"`.\n   *\n   * `\"houseNumberAnchored\"` accepts a street-type word\n   * with a house number directly beside it, in either\n   * order (\"14 Rue de la Paix\", \"Hauptstraße 5\",\n   * \"123 Main Street\"). A bare street name with no\n   * number never fires.\n   *\n   * A street-type word plus a nearby number is a much\n   * weaker signal than a city-anchored address and does\n   * fire on contract prose (\"District Court 2019\"), so\n   * this stays opt-in per workspace.\n   */\n  standaloneStreetDetection?: StandaloneStreetDetection;\n  /**\n   * Requested output labels. An empty array means\n   * \"do not filter by label\" for deterministic detectors.\n   */\n  labels: string[];\n  workspaceId: string;\n  /**\n   * Pre-loaded dictionary data for name, deny-list,\n   * and city detection. When omitted, dictionary-based\n   * detection paths are skipped. Consumers load from\n   * the anonymize-data package and pass the data here.\n   */\n  dictionaries?: Dictionaries;\n};\n\nexport { DEFAULT_ENTITY_LABELS } from \"./constants\";\n\nexport const isLegalFormsEnabled = (\n  config: Pick<PipelineConfig, \"enableLegalForms\">,\n): boolean => config.enableLegalForms !== false;\n","const normalizeLanguageCode = (language: string): string =>\n  language.trim().toLowerCase();\n\nconst normalizeLanguageSelection = (\n  languages: readonly string[] | undefined,\n): string[] =>\n  languages === undefined\n    ? []\n    : languages\n        .map(normalizeLanguageCode)\n        .filter((language) => language.length > 0);\n\nexport const languageSelectionKey = (\n  languages: readonly string[] | undefined,\n): string => {\n  const normalized = normalizeLanguageSelection(languages).toSorted();\n  return normalized.length === 0 ? \"*\" : normalized.join(\",\");\n};\n\nconst baseLanguage = (language: string): string => {\n  const index = language.indexOf(\"-\");\n  return index === -1 ? language : language.slice(0, index);\n};\n\nexport const languageConfigMatches = (\n  configLanguage: string,\n  selectedLanguages: readonly string[] | undefined,\n): boolean => {\n  if (selectedLanguages === undefined || selectedLanguages.length === 0) {\n    return true;\n  }\n  const normalizedSelectedLanguages =\n    normalizeLanguageSelection(selectedLanguages);\n  if (normalizedSelectedLanguages.length === 0) {\n    return true;\n  }\n\n  const normalizedConfigLanguage = normalizeLanguageCode(configLanguage);\n  if (normalizedConfigLanguage.length === 0) {\n    return false;\n  }\n\n  const genericConfig =\n    baseLanguage(normalizedConfigLanguage) === normalizedConfigLanguage;\n  for (const normalizedLanguage of normalizedSelectedLanguages) {\n    if (normalizedLanguage === normalizedConfigLanguage) {\n      return true;\n    }\n    if (\n      genericConfig &&\n      baseLanguage(normalizedLanguage) === normalizedConfigLanguage\n    ) {\n      return true;\n    }\n  }\n\n  return false;\n};\n","import {\n  isLegalFormsEnabled,\n  type GazetteerEntry,\n  type PipelineConfig,\n} from \"./types\";\nimport { languageSelectionKey } from \"./util/language-selection\";\n\nconst DEFAULT_CUSTOM_REGEX_SCORE = 0.9;\n\nconst contentLanguageFingerprint = (\n  config: Pick<PipelineConfig, \"language\" | \"languages\">,\n): string => {\n  const languages =\n    config.languages ??\n    (config.language === undefined ? [] : [config.language]);\n  return languageSelectionKey(languages);\n};\n\nexport const pipelineConfigKey = (\n  config: PipelineConfig,\n  gazetteerEntries: readonly GazetteerEntry[],\n): string => {\n  const legalFormsEnabled = isLegalFormsEnabled(config);\n  const customDenyFingerprint =\n    config.enableDenyList && config.customDenyList\n      ? config.customDenyList\n          .map((entry) =>\n            JSON.stringify({\n              label: entry.label,\n              value: entry.value,\n              variants: [...(entry.variants ?? [])].sort(),\n            }),\n          )\n          .sort()\n          .join(\"\\n\")\n      : \"\";\n  const customRegexFingerprint =\n    config.enableRegex && config.customRegexes\n      ? config.customRegexes\n          .map((entry) =>\n            JSON.stringify({\n              label: entry.label,\n              pattern: entry.pattern,\n              preparedArtifactPolicy: entry.preparedArtifactPolicy ?? null,\n              score: entry.score ?? DEFAULT_CUSTOM_REGEX_SCORE,\n            }),\n          )\n          .sort()\n          .join(\"\\n\")\n      : \"\";\n  const gazFingerprint =\n    config.enableGazetteer && gazetteerEntries.length > 0\n      ? gazetteerEntries\n          .map(\n            (entry) =>\n              `${entry.id}:${entry.canonical}:${entry.label}:${[\n                ...entry.variants,\n              ]\n                .sort()\n                .join(\",\")}`,\n          )\n          .toSorted()\n          .join(\";\")\n      : \"\";\n\n  return (\n    `${config.enableDenyList}:` +\n    `${config.enableTriggerPhrases}:` +\n    `${legalFormsEnabled}:` +\n    `${config.enableNameCorpus}:` +\n    `${contentLanguageFingerprint(config)}:` +\n    `${config.nameCorpusLanguages?.toSorted().join(\",\") ?? \"\"}:` +\n    `${config.enableRegex}:` +\n    `${config.threshold}:` +\n    `${config.enableConfidenceBoost}:` +\n    `${config.enableHotwordRules === true}:` +\n    `${config.enableCoreference === true}:` +\n    `${config.enableZoneClassification === true}:` +\n    `${config.labels.toSorted().join(\",\")}:` +\n    `${config.denyListCountries?.toSorted().join(\",\") ?? \"\"}:` +\n    `${config.denyListRegions?.toSorted().join(\",\") ?? \"\"}:` +\n    `${config.denyListExcludeCategories?.toSorted().join(\",\") ?? \"\"}:` +\n    `${customDenyFingerprint}:` +\n    `${customRegexFingerprint}:` +\n    `${config.enableGazetteer}:${gazFingerprint}:` +\n    `${config.enableCountries !== false}:` +\n    `${config.standaloneStreetDetection ?? \"off\"}`\n  );\n};\n","import type { PipelineContext } from \"./context\";\nimport { defaultContext } from \"./context\";\nimport { applyPipelineLanguageScope } from \"./language-scope\";\nimport type { NativePreparedSearchConfig } from \"./native-search-config\";\nimport { pipelineConfigKey } from \"./pipeline-cache-key\";\nimport type { Dictionaries, GazetteerEntry, PipelineConfig } from \"./types\";\nimport {\n  createNativePipelineFromPackage,\n  PreparedNativePipeline,\n  type NativeAnonymizeBinding,\n} from \"./native\";\n\nexport {\n  PreparedNativePipeline,\n  createNativePipelineFromPackage,\n} from \"./native\";\n\nexport type NativePipelineUnsupportedFeature = \"enableNer\";\n\nexport type NativePipelineCompatibility =\n  | { status: \"supported\" }\n  | {\n      status: \"unsupported\";\n      unsupportedFeatures: NativePipelineUnsupportedFeature[];\n    };\n\nexport type NativePipelineBuildOptions = {\n  binding: NativeAnonymizeBinding;\n  config: PipelineConfig;\n  gazetteerEntries?: GazetteerEntry[];\n  context?: PipelineContext;\n};\n\nexport type NativePipelinePackageOptions = NativePipelineBuildOptions & {\n  compressed?: boolean;\n};\n\nexport type { NativePipelineFromPackageOptions } from \"./native\";\n\ntype NativePipelinePackageCacheValue = Promise<Uint8Array> | Uint8Array;\n\n// Bounds each shared package cache (the dictionary-less bucket below, and\n// each per-`Dictionaries` bucket handed out by `sharedPackageCacheFor`) to a\n// fixed number of entries. `nativePackageCacheKey` fingerprints\n// caller-suppliable config (custom deny lists, custom regexes, gazetteer\n// entries) via `pipelineConfigKey`, so without a cap a caller that varies\n// those fields grows a bucket — and the multi-MB assembled packages it\n// holds — without limit.\nexport const SHARED_PACKAGE_CACHE_MAX_ENTRIES = 32;\n\nconst sharedPackageByDictionaries = new WeakMap<\n  Dictionaries,\n  Map<string, NativePipelinePackageCacheValue>\n>();\nconst sharedPackageWithoutDictionaries = new Map<\n  string,\n  NativePipelinePackageCacheValue\n>();\nconst dictionaryCacheIds = new WeakMap<Dictionaries, number>();\nlet nextDictionaryCacheId = 0;\n\n/** Record `key` as most-recently-used in `cache`, evicting the\n * least-recently-used entry first once the cache is at capacity. A `Map`'s\n * insertion order doubles as recency order here: touching an existing key\n * deletes then re-sets it to move it to the end, and eviction drops the\n * first (oldest) key.\n *\n * Evicting a still-in-flight build only drops the cache's reference to its\n * promise; the caller that started the build (and any concurrent caller that\n * already read the promise before eviction) still resolves it correctly via\n * the guarded `sharedCache.get(key) === promise` checks in\n * `getCachedNativePipelinePackage`. A later caller for the same key just\n * misses the dedupe and starts a fresh build — bounded memory takes priority\n * over perfect dedupe under cache pressure. */\nconst touchSharedPackageCacheEntry = (\n  cache: Map<string, NativePipelinePackageCacheValue>,\n  key: string,\n  value: NativePipelinePackageCacheValue,\n): void => {\n  cache.delete(key);\n  if (cache.size >= SHARED_PACKAGE_CACHE_MAX_ENTRIES) {\n    const oldestKey = cache.keys().next().value;\n    if (oldestKey !== undefined) {\n      cache.delete(oldestKey);\n    }\n  }\n  cache.set(key, value);\n};\n\nconst dictionaryCacheKey = (dictionaries: Dictionaries | undefined): string => {\n  if (dictionaries === undefined) {\n    return \"none\";\n  }\n  const existing = dictionaryCacheIds.get(dictionaries);\n  if (existing !== undefined) {\n    return `dict:${existing}`;\n  }\n  nextDictionaryCacheId += 1;\n  dictionaryCacheIds.set(dictionaries, nextDictionaryCacheId);\n  return `dict:${nextDictionaryCacheId}`;\n};\n\nconst sharedPackageCacheFor = (\n  dictionaries: Dictionaries | undefined,\n): Map<string, NativePipelinePackageCacheValue> => {\n  if (dictionaries === undefined) {\n    return sharedPackageWithoutDictionaries;\n  }\n  const cached = sharedPackageByDictionaries.get(dictionaries);\n  if (cached !== undefined) {\n    return cached;\n  }\n  const created = new Map<string, NativePipelinePackageCacheValue>();\n  sharedPackageByDictionaries.set(dictionaries, created);\n  return created;\n};\n\nexport const getNativePipelineCompatibility = (\n  config: PipelineConfig,\n): NativePipelineCompatibility => {\n  const unsupportedFeatures: NativePipelineUnsupportedFeature[] = [];\n\n  // `enableNer` is no longer part of `PipelineConfig`; untyped callers that\n  // still request it (any truthy value, e.g. `1` or `\"true\"` from loose\n  // JSON) must fail fast instead of silently losing NER spans.\n  if (\"enableNer\" in config && Boolean(config.enableNer)) {\n    unsupportedFeatures.push(\"enableNer\");\n  }\n  if (unsupportedFeatures.length === 0) {\n    return { status: \"supported\" };\n  }\n  return { status: \"unsupported\", unsupportedFeatures };\n};\n\nexport const assertNativePipelineSupported = (config: PipelineConfig): void => {\n  const compatibility = getNativePipelineCompatibility(config);\n  if (compatibility.status === \"supported\") {\n    return;\n  }\n  throw new Error(\n    `Native pipeline does not yet support: ${compatibility.unsupportedFeatures.join(\", \")}`,\n  );\n};\n\nconst encoder = new TextEncoder();\n\ntype AssembleInputs = {\n  pipelineConfigJson: Uint8Array;\n  dictionariesJson: Uint8Array | undefined;\n  gazetteerJson: Uint8Array | undefined;\n};\n\n/**\n * Serialize the assembler inputs the Rust binding expects. Dictionaries are\n * stripped from the pipeline config and passed out of band: the assembler reads\n * the separate bundle preferentially, and keeping the (large) dictionaries out\n * of the config JSON avoids serializing them twice.\n */\nconst toAssembleInputs = (\n  { dictionaries, ...config }: PipelineConfig,\n  gazetteerEntries: readonly GazetteerEntry[],\n): AssembleInputs => ({\n  pipelineConfigJson: encoder.encode(JSON.stringify(config)),\n  dictionariesJson:\n    dictionaries === undefined\n      ? undefined\n      : encoder.encode(JSON.stringify(dictionaries)),\n  gazetteerJson:\n    gazetteerEntries.length === 0\n      ? undefined\n      : encoder.encode(JSON.stringify(gazetteerEntries)),\n});\n\nconst assemblePackageBytes = (\n  binding: NativeAnonymizeBinding,\n  { pipelineConfigJson, dictionariesJson, gazetteerJson }: AssembleInputs,\n  compressed: boolean,\n): Uint8Array => {\n  const assemble = compressed\n    ? binding.assembleStaticSearchCompressedPackageBytes\n    : binding.assembleStaticSearchPackageBytes;\n  if (assemble === undefined) {\n    throw new Error(\n      \"Native anonymize binding does not support static-search config assembly\",\n    );\n  }\n  return assemble(pipelineConfigJson, dictionariesJson, gazetteerJson);\n};\n\nexport const prepareNativePipelineConfig = async ({\n  binding,\n  config,\n  gazetteerEntries = [],\n}: Omit<\n  NativePipelineBuildOptions,\n  \"context\"\n>): Promise<NativePreparedSearchConfig> => {\n  const scopedConfig = applyPipelineLanguageScope(config);\n  assertNativePipelineSupported(scopedConfig);\n  const assemble = binding.assembleStaticSearchConfigJson;\n  if (assemble === undefined) {\n    throw new Error(\n      \"Native anonymize binding does not support static-search config assembly\",\n    );\n  }\n  const { pipelineConfigJson, dictionariesJson, gazetteerJson } =\n    toAssembleInputs(scopedConfig, gazetteerEntries);\n  const configJson = assemble(\n    pipelineConfigJson,\n    dictionariesJson,\n    gazetteerJson,\n  );\n  return JSON.parse(new TextDecoder().decode(configJson));\n};\n\nexport const prepareNativePipelinePackage = async ({\n  binding,\n  config,\n  gazetteerEntries = [],\n  context,\n  compressed = false,\n}: NativePipelinePackageOptions): Promise<Uint8Array> => {\n  const packageBytes = await getCachedNativePipelinePackage({\n    config,\n    binding,\n    gazetteerEntries,\n    ...(context ? { context } : {}),\n    compressed,\n  });\n  // Return a genuine copy: with the real NAPI binding packageBytes is a Node\n  // Buffer, and Buffer.prototype.slice() yields a memory-sharing view, so a\n  // caller mutating it would corrupt the shared cache and ctx.nativePipelinePackage.\n  return new Uint8Array(packageBytes);\n};\n\nexport const createNativePipelineFromConfig = async ({\n  binding,\n  config,\n  gazetteerEntries = [],\n  context,\n}: NativePipelineBuildOptions): Promise<PreparedNativePipeline> => {\n  const packageBytes = await getCachedNativePipelinePackage({\n    binding,\n    config,\n    gazetteerEntries,\n    ...(context ? { context } : {}),\n  });\n  return createNativePipelineFromPackage({ binding, packageBytes });\n};\n\nconst getCachedNativePipelinePackage = async ({\n  binding,\n  config,\n  gazetteerEntries = [],\n  context,\n  compressed = false,\n}: NativePipelinePackageOptions): Promise<Uint8Array> => {\n  const scopedConfig = applyPipelineLanguageScope(config);\n  assertNativePipelineSupported(scopedConfig);\n  const ctx = context ?? defaultContext;\n  const key = nativePackageCacheKey({\n    binding,\n    config: scopedConfig,\n    gazetteerEntries,\n    compressed,\n  });\n  if (ctx.nativePipelinePackage && ctx.nativePipelinePackageKey === key) {\n    return ctx.nativePipelinePackage;\n  }\n  if (\n    ctx.nativePipelinePackagePromise &&\n    ctx.nativePipelinePackageKey === key\n  ) {\n    return ctx.nativePipelinePackagePromise;\n  }\n\n  const sharedCache = sharedPackageCacheFor(scopedConfig.dictionaries);\n  const shared = sharedCache.get(key);\n  if (shared !== undefined) {\n    touchSharedPackageCacheEntry(sharedCache, key, shared);\n    const packageBytes = await shared;\n    ctx.nativePipelinePackage = packageBytes;\n    ctx.nativePipelinePackageKey = key;\n    ctx.nativePipelinePackagePromise = null;\n    return packageBytes;\n  }\n\n  ctx.nativePipelinePackage = null;\n  ctx.nativePipelinePackageKey = key;\n  const promise = buildNativePipelinePackage({\n    binding,\n    config: scopedConfig,\n    gazetteerEntries,\n    compressed,\n  });\n  ctx.nativePipelinePackagePromise = promise;\n  touchSharedPackageCacheEntry(sharedCache, key, promise);\n  let packageBytes: Uint8Array;\n  try {\n    packageBytes = await promise;\n  } catch (error) {\n    if (sharedCache.get(key) === promise) {\n      sharedCache.delete(key);\n    }\n    if (\n      ctx.nativePipelinePackageKey === key &&\n      ctx.nativePipelinePackagePromise === promise\n    ) {\n      ctx.nativePipelinePackage = null;\n      ctx.nativePipelinePackagePromise = null;\n    }\n    throw error;\n  }\n  if (sharedCache.get(key) === promise) {\n    sharedCache.set(key, packageBytes);\n  }\n  if (ctx.nativePipelinePackageKey === key) {\n    ctx.nativePipelinePackage = packageBytes;\n    ctx.nativePipelinePackagePromise = null;\n  }\n  return packageBytes;\n};\n\n// `async` so the shared package cache can store the in-flight value and dedupe\n// concurrent builds for the same key, and so assembly failures (an older\n// binding without the assemble functions, or a config the assembler rejects)\n// surface as a rejected promise rather than a synchronous throw mid-cache-flow.\nconst buildNativePipelinePackage = async ({\n  binding,\n  config,\n  gazetteerEntries,\n  compressed,\n}: Required<\n  Omit<NativePipelinePackageOptions, \"context\">\n>): Promise<Uint8Array> =>\n  assemblePackageBytes(\n    binding,\n    toAssembleInputs(config, gazetteerEntries),\n    compressed,\n  );\n\ntype NativePackageCacheKeyOptions = {\n  binding: NativeAnonymizeBinding;\n  config: PipelineConfig;\n  gazetteerEntries: readonly GazetteerEntry[];\n  compressed: boolean;\n};\n\nconst nativePackageCacheKey = ({\n  binding,\n  config,\n  gazetteerEntries,\n  compressed,\n}: NativePackageCacheKeyOptions): string =>\n  [\n    binding.nativePackageVersion(),\n    compressed ? \"compressed\" : \"raw\",\n    dictionaryCacheKey(config.dictionaries),\n    pipelineConfigKey(config, gazetteerEntries),\n  ].join(\":\");\n","import { DEFAULT_ENTITY_LABELS } from \"./constants\";\nimport type { PipelineConfig } from \"./types\";\n\nexport const DEFAULT_NATIVE_PIPELINE_CONFIG: PipelineConfig = {\n  threshold: 0.3,\n  enableTriggerPhrases: true,\n  enableRegex: true,\n  enableLegalForms: true,\n  enableNameCorpus: true,\n  enableDenyList: true,\n  enableGazetteer: false,\n  enableCountries: true,\n  enableConfidenceBoost: true,\n  enableCoreference: true,\n  enableHotwordRules: true,\n  enableZoneClassification: true,\n  standaloneStreetDetection: \"off\",\n  labels: [...DEFAULT_ENTITY_LABELS],\n  workspaceId: \"native-pipeline-default\",\n};\n","import languageScopes from \"./data/language-scopes.json\";\n\nexport type SupportedLanguage =\n  | \"cs\"\n  | \"de\"\n  | \"en\"\n  | \"es\"\n  | \"fr\"\n  | \"hu\"\n  | \"it\"\n  | \"lv\"\n  | \"pl\"\n  | \"pt-br\"\n  | \"ro\"\n  | \"sk\"\n  | \"sv\";\n\nconst isSupportedLanguage = (language: string): language is SupportedLanguage =>\n  Object.hasOwn(languageScopes.languages, language);\n\nexport const SUPPORTED_LANGUAGES = Object.freeze(\n  Object.keys(languageScopes.languages).filter(isSupportedLanguage).toSorted(),\n);\n\nexport type PipelineLanguageSelection =\n  | SupportedLanguage\n  | readonly [SupportedLanguage, ...SupportedLanguage[]]\n  | \"all\";\n\nexport type NormalizedPipelineLanguageSelection =\n  | { type: \"all\" }\n  | {\n      type: \"languages\";\n      languages: readonly [SupportedLanguage, ...SupportedLanguage[]];\n    };\n\nconst normalizeLanguage = (language: unknown): SupportedLanguage => {\n  if (typeof language !== \"string\") {\n    throw new TypeError(\"Pipeline language codes must be strings\");\n  }\n  const normalized = language.trim().toLowerCase();\n  if (!isSupportedLanguage(normalized)) {\n    throw new RangeError(\n      `Unsupported pipeline language ${JSON.stringify(language)}; expected one of: ${SUPPORTED_LANGUAGES.join(\", \")}`,\n    );\n  }\n  return normalized;\n};\n\nexport const normalizePipelineLanguageSelection = (\n  selection: PipelineLanguageSelection | undefined,\n): NormalizedPipelineLanguageSelection => {\n  if (\n    selection === undefined ||\n    (typeof selection === \"string\" && selection.trim().toLowerCase() === \"all\")\n  ) {\n    return { type: \"all\" };\n  }\n  const requested = Array.isArray(selection) ? selection : [selection];\n  if (requested.length === 0) {\n    throw new RangeError(\"Pipeline language selection must not be empty\");\n  }\n  const normalized = [...new Set(requested.map(normalizeLanguage))].toSorted();\n  const first = normalized.at(0);\n  if (first === undefined) {\n    throw new RangeError(\"Pipeline language selection must not be empty\");\n  }\n  return { type: \"languages\", languages: [first, ...normalized.slice(1)] };\n};\n\nexport const pipelineLanguageSelectionKey = (\n  selection: NormalizedPipelineLanguageSelection,\n): string => (selection.type === \"all\" ? \"all\" : selection.languages.join(\",\"));\n","import type { Dictionaries, PipelineConfig } from \"./types\";\nimport type { NativeAnonymizeBinding, PreparedNativePipeline } from \"./native\";\nimport { defaultDictionaryBundleOptions } from \"./build-native-package\";\nimport { createNativePipelineFromConfig } from \"./native-pipeline\";\nimport { DEFAULT_NATIVE_PIPELINE_CONFIG } from \"./native-default-config\";\nimport { applyPipelineLanguageScope } from \"./language-scope\";\nimport {\n  pipelineLanguageSelectionKey,\n  type NormalizedPipelineLanguageSelection,\n} from \"./pipeline-language\";\n\ntype CreateSemanticPipelineOptions = {\n  binding: NativeAnonymizeBinding;\n  selection: NormalizedPipelineLanguageSelection;\n};\n\ntype AnonymizeDataModule = {\n  loadDictionaryBundle: (options?: {\n    countries?: readonly string[];\n    cityCountries?: readonly string[];\n    nameLanguages?: readonly string[];\n  }) => Promise<Dictionaries>;\n};\n\nconst dictionaryCache = new Map<string, Promise<Dictionaries>>();\nconst semanticPipelineCache = new WeakMap<\n  NativeAnonymizeBinding,\n  Map<string, Promise<PreparedNativePipeline>>\n>();\nconst MAX_SEMANTIC_PIPELINE_CACHE_ENTRIES = 8;\n\nconst getCachedEntry = <Value>(\n  cache: Map<string, Value>,\n  key: string,\n): Value | undefined => {\n  const cached = cache.get(key);\n  if (cached === undefined) {\n    return undefined;\n  }\n  cache.delete(key);\n  cache.set(key, cached);\n  return cached;\n};\n\nconst setCachedEntry = <Value>(\n  cache: Map<string, Value>,\n  key: string,\n  value: Value,\n): void => {\n  cache.set(key, value);\n  if (cache.size <= MAX_SEMANTIC_PIPELINE_CACHE_ENTRIES) {\n    return;\n  }\n  const oldestKey = cache.keys().next().value;\n  if (oldestKey !== undefined) {\n    cache.delete(oldestKey);\n  }\n};\n\nconst loadSemanticDictionaries = (\n  key: string,\n  config: PipelineConfig,\n): Promise<Dictionaries> => {\n  const cached = getCachedEntry(dictionaryCache, key);\n  if (cached !== undefined) {\n    return cached;\n  }\n  // Keep dictionary chunks out of the default-package import path. Bundlers\n  // load only the chunks needed to assemble an unbundled semantic scope.\n  let dictionaries: Promise<Dictionaries>;\n  dictionaries = import(\"@stll/anonymize-data/cities\")\n    .then(({ loadDictionaryBundle }: AnonymizeDataModule) =>\n      loadDictionaryBundle(defaultDictionaryBundleOptions(config)),\n    )\n    .catch((error: unknown) => {\n      if (dictionaryCache.get(key) === dictionaries) {\n        dictionaryCache.delete(key);\n      }\n      throw error;\n    });\n  setCachedEntry(dictionaryCache, key, dictionaries);\n  return dictionaries;\n};\n\nconst pipelineConfigFor = (\n  selection: NormalizedPipelineLanguageSelection,\n): PipelineConfig => {\n  if (selection.type === \"all\") {\n    return {\n      ...DEFAULT_NATIVE_PIPELINE_CONFIG,\n      labels: [...DEFAULT_NATIVE_PIPELINE_CONFIG.labels],\n    };\n  }\n  const [language, ...languages] = selection.languages;\n  return applyPipelineLanguageScope({\n    ...DEFAULT_NATIVE_PIPELINE_CONFIG,\n    labels: [...DEFAULT_NATIVE_PIPELINE_CONFIG.labels],\n    workspaceId: `default-pipeline:${pipelineLanguageSelectionKey(selection)}`,\n    ...(languages.length === 0\n      ? { language }\n      : { languages: [language, ...languages] }),\n  });\n};\n\nconst semanticPipelineCacheFor = (\n  binding: NativeAnonymizeBinding,\n): Map<string, Promise<PreparedNativePipeline>> => {\n  const cached = semanticPipelineCache.get(binding);\n  if (cached !== undefined) {\n    return cached;\n  }\n  const created = new Map<string, Promise<PreparedNativePipeline>>();\n  semanticPipelineCache.set(binding, created);\n  return created;\n};\n\nexport const createSemanticPipeline = ({\n  binding,\n  selection,\n}: CreateSemanticPipelineOptions): Promise<PreparedNativePipeline> => {\n  const key = pipelineLanguageSelectionKey(selection);\n  const cache = semanticPipelineCacheFor(binding);\n  const cached = getCachedEntry(cache, key);\n  if (cached !== undefined) {\n    return cached;\n  }\n  const config = pipelineConfigFor(selection);\n  let pipeline: Promise<PreparedNativePipeline>;\n  pipeline = loadSemanticDictionaries(key, config)\n    .then((dictionaries) =>\n      createNativePipelineFromConfig({\n        binding,\n        config: { ...config, dictionaries },\n      }),\n    )\n    .catch((error: unknown) => {\n      if (cache.get(key) === pipeline) {\n        cache.delete(key);\n      }\n      throw error;\n    });\n  setCachedEntry(cache, key, pipeline);\n  return pipeline;\n};\n","import { createRequire } from \"node:module\";\nimport { existsSync, readFileSync, readdirSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport process from \"node:process\";\nimport { loadNativeBinding as loadDefaultPlatformNativePackage } from \"../index.cjs\";\n\nimport {\n  assertNativeBindingVersion,\n  createNativePipelineFromPackage,\n  isNativeAnonymizeBinding,\n  type NativeOperatorConfig,\n  type NativeAnonymizeBinding,\n  type NativeNormalizeOptions,\n  type NativeSearchPackageInput,\n  PreparedNativeAnonymizer,\n  PreparedNativePipeline,\n  type NativeStaticRedactionResult,\n  diagnostics_json as diagnosticsJsonWithBinding,\n  convert_external_detection_batch as convertExternalDetectionBatchWithBinding,\n  diagnostics_stream_json as diagnosticsStreamJsonWithBinding,\n  load_prepared_package as loadPreparedPackageWithBinding,\n  native_package_version as nativePackageVersionWithBinding,\n  normalize_for_search as normalizeForSearchWithBinding,\n  prepare_search_package as prepareSearchPackageWithBinding,\n  redact_text as redactTextWithBinding,\n  redact_text_json as redactTextJsonWithBinding,\n  redact_text_stream_json as redactTextStreamJsonWithBinding,\n  summary_diagnostics_json as summaryDiagnosticsJsonWithBinding,\n} from \"./native\";\nimport { assertSupportedBunRuntime } from \"./bun-version\";\nimport { createSemanticPipeline } from \"./create-pipeline\";\nimport {\n  normalizePipelineLanguageSelection,\n  type PipelineLanguageSelection,\n} from \"./pipeline-language\";\n\nexport { SUPPORTED_LANGUAGES } from \"./pipeline-language\";\nexport type {\n  PipelineLanguageSelection,\n  SupportedLanguage,\n} from \"./pipeline-language\";\n\nexport * from \"./native\";\nexport {\n  assertNativePipelineSupported,\n  createNativePipelineFromConfig,\n  getNativePipelineCompatibility,\n  prepareNativePipelineConfig,\n  prepareNativePipelinePackage,\n} from \"./native-pipeline\";\nexport type {\n  NativePipelineBuildOptions,\n  NativePipelineCompatibility,\n  NativePipelinePackageOptions,\n  NativePipelineUnsupportedFeature,\n} from \"./native-pipeline\";\n\nexport type NativeRequire = (specifier: string) => unknown;\n\nexport type NativeLibc = \"gnu\" | \"musl\";\n\nexport type LoadNativeBindingOptions = {\n  expectedVersion?: string;\n  platform?: string;\n  arch?: string;\n  libc?: NativeLibc;\n  env?: Record<string, string | undefined>;\n  requireModule?: NativeRequire;\n};\n\nexport type NativePipelinePackageFileOptions = LoadNativeBindingOptions & {\n  binding?: NativeAnonymizeBinding;\n  packagePath: string;\n};\n\nexport type NativeSdkOptions = LoadNativeBindingOptions & {\n  binding?: NativeAnonymizeBinding;\n};\n\nexport type NativeSdkPackageOptions = NativeSdkOptions & {\n  compressed?: boolean;\n};\n\nexport type CreatePipelineOptions = NativeSdkOptions & {\n  language?: PipelineLanguageSelection;\n  warmup?: DefaultNativePipelineWarmup;\n};\n\nexport type DefaultNativePipelinePackageOptions = LoadNativeBindingOptions & {\n  binding?: NativeAnonymizeBinding;\n  language?: string;\n  packagePath?: string;\n  warmup?: DefaultNativePipelineWarmup;\n};\n\ntype ResolvedDefaultNativePipelineOptions = {\n  binding: NativeAnonymizeBinding;\n  language?: string;\n  packagePath?: string;\n  warmup: DefaultNativePipelineWarmup;\n};\n\nexport const DEFAULT_NATIVE_PIPELINE_WARMUPS = {\n  lazyRegex: \"lazy-regex\",\n  none: \"none\",\n} as const;\n\nexport type DefaultNativePipelineWarmup =\n  (typeof DEFAULT_NATIVE_PIPELINE_WARMUPS)[keyof typeof DEFAULT_NATIVE_PIPELINE_WARMUPS];\n\nexport type DefaultNativePipelinePackageFileOptions = {\n  language?: string;\n};\n\nconst PACKAGE_SPECIFIC_NATIVE_PATH = \"STELLA_ANONYMIZE_NATIVE_LIBRARY_PATH\";\nconst DEFAULT_NATIVE_PIPELINE_PACKAGE_URL = new URL(\n  \"../native-pipeline.stlanonpkg\",\n  import.meta.url,\n);\nconst DEFAULT_NATIVE_PIPELINE_PACKAGE_DIR_URL = new URL(\"../\", import.meta.url);\nconst DEFAULT_NATIVE_PIPELINE_LANGUAGE_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/u;\nconst DEFAULT_NATIVE_PIPELINE_LANGUAGE_PACKAGE_PATTERN =\n  /^native-pipeline\\.([a-z0-9]+(?:-[a-z0-9]+)*)\\.stlanonpkg$/u;\nconst DEFAULT_NATIVE_PIPELINE_PACKAGE_CACHE_KEY = \"<default>\";\nconst defaultNativePipelineCache = new WeakMap<\n  NativeAnonymizeBinding,\n  Map<string, PreparedNativePipeline>\n>();\nconst warmedDefaultNativePipelines = new WeakSet<PreparedNativePipeline>();\nconst defaultNativePipelineInflightCache = new WeakMap<\n  NativeAnonymizeBinding,\n  Map<string, Promise<PreparedNativePipeline>>\n>();\n\nexport { DEFAULT_NATIVE_PIPELINE_CONFIG } from \"./native-default-config\";\n\n/**\n * An explicit binding override for embedded runtimes and tests. Undefined by\n * default, so Node.js and Bun load their platform N-API package.\n */\nlet nativeBindingOverride: NativeAnonymizeBinding | undefined;\n\nexport const setNativeBindingOverride = (\n  binding: NativeAnonymizeBinding | undefined,\n): void => {\n  nativeBindingOverride = binding;\n};\n\nexport const loadNativeAnonymizeBinding = (\n  options: LoadNativeBindingOptions = {},\n): NativeAnonymizeBinding => {\n  assertSupportedBunRuntime();\n  if (nativeBindingOverride !== undefined) {\n    if (options.expectedVersion !== undefined) {\n      assertNativeBindingVersion({\n        binding: nativeBindingOverride,\n        expectedVersion: options.expectedVersion,\n      });\n    }\n    return nativeBindingOverride;\n  }\n  const requireModule = options.requireModule ?? createRequire(import.meta.url);\n  const platform = options.platform ?? process.platform;\n  const arch = options.arch ?? process.arch;\n  const libc = options.libc ?? detectNativeLibc(platform);\n  const env = options.env ?? process.env;\n  const specifiers = nativeBindingSpecifiers({ arch, env, libc, platform });\n  const platformPackage = nativeBindingPackageName({ arch, libc, platform });\n  const errors: string[] = [];\n\n  for (const specifier of specifiers) {\n    const loadModule =\n      options.requireModule === undefined &&\n      specifier === platformPackage &&\n      isHostNativeTarget({ arch, libc, platform })\n        ? loadDefaultPlatformNativePackage\n        : () => requireModule(specifier);\n    const binding = tryLoadNativeBinding({\n      specifier,\n      loadModule,\n      errors,\n    });\n    if (!binding) {\n      continue;\n    }\n    if (options.expectedVersion !== undefined) {\n      assertNativeBindingVersion({\n        binding,\n        expectedVersion: options.expectedVersion,\n      });\n    }\n    return binding;\n  }\n\n  if (nativeBindingPackageName({ arch, libc, platform }) === null) {\n    throw unsupportedNativeTargetError({ arch, errors, libc, platform });\n  }\n  throw new Error(\n    `Unable to load native anonymize binding for ${platform}/${arch}:\\n${errors.join(\"\\n\")}`,\n  );\n};\n\nexport const readNativePipelinePackageFile = (\n  packagePath: string,\n): Uint8Array => readFileSync(packagePath);\n\nexport const readNativePipelinePackageFileAsync = async (\n  packagePath: string,\n): Promise<Uint8Array> => readFile(packagePath);\n\nexport const native_package_version = (\n  options: NativeSdkOptions = {},\n): string => nativePackageVersionWithBinding(resolveNativeSdkBinding(options));\n\nexport const convert_external_detection_batch = (\n  document: Uint8Array,\n  batch: import(\"./native\").ExternalDetectionBatch | string,\n  options: NativeSdkOptions = {},\n): import(\"./native\").NativeCallerDetection[] =>\n  convertExternalDetectionBatchWithBinding({\n    binding: resolveNativeSdkBinding(options),\n    document,\n    batch,\n  });\n\nexport const normalize_for_search = (\n  text: string,\n  options: NativeSdkOptions = {},\n): string => {\n  const args: NativeNormalizeOptions = {\n    binding: resolveNativeSdkBinding(options),\n    text,\n  };\n  return normalizeForSearchWithBinding(args);\n};\n\nexport const prepare_search_package = (\n  config: NativeSearchPackageInput,\n  { compressed = false, ...options }: NativeSdkPackageOptions = {},\n): Uint8Array =>\n  prepareSearchPackageWithBinding({\n    binding: resolveNativeSdkBinding(options),\n    config,\n    compressed,\n  });\n\nexport const load_prepared_package = (\n  packageBytes: Uint8Array,\n  options: NativeSdkOptions = {},\n) =>\n  loadPreparedPackageWithBinding({\n    binding: resolveNativeSdkBinding(options),\n    packageBytes,\n  });\n\nexport const load_prepared_package_file = (\n  packagePath: string,\n  options: NativeSdkOptions = {},\n) => load_prepared_package(readNativePipelinePackageFile(packagePath), options);\n\nexport const redact_text = (\n  config: NativeSearchPackageInput,\n  fullText: string,\n  operators?: NativeOperatorConfig,\n  options: NativeSdkOptions = {},\n): NativeStaticRedactionResult =>\n  redactTextWithBinding({\n    binding: resolveNativeSdkBinding(options),\n    config,\n    fullText,\n    ...(operators !== undefined ? { operators } : {}),\n  });\n\nexport const redact_text_json = (\n  config: NativeSearchPackageInput,\n  fullText: string,\n  operators?: NativeOperatorConfig,\n  options: NativeSdkOptions = {},\n): string =>\n  redactTextJsonWithBinding({\n    binding: resolveNativeSdkBinding(options),\n    config,\n    fullText,\n    ...(operators !== undefined ? { operators } : {}),\n  });\n\nexport const redact_text_stream_json = (\n  config: NativeSearchPackageInput,\n  fullText: string,\n  onEvent: (eventJson: string) => void,\n  operators?: NativeOperatorConfig,\n  options: NativeSdkOptions = {},\n): string =>\n  redactTextStreamJsonWithBinding({\n    binding: resolveNativeSdkBinding(options),\n    config,\n    fullText,\n    onEvent,\n    ...(operators !== undefined ? { operators } : {}),\n  });\n\nexport const diagnostics_json = (\n  config: NativeSearchPackageInput,\n  fullText: string,\n  operators?: NativeOperatorConfig,\n  options: NativeSdkOptions = {},\n): string =>\n  diagnosticsJsonWithBinding({\n    binding: resolveNativeSdkBinding(options),\n    config,\n    fullText,\n    ...(operators !== undefined ? { operators } : {}),\n  });\n\nexport const diagnostics_stream_json = (\n  config: NativeSearchPackageInput,\n  fullText: string,\n  onBatch: (diagnosticsJson: string) => void,\n  operators?: NativeOperatorConfig,\n  options: NativeSdkOptions = {},\n): string =>\n  diagnosticsStreamJsonWithBinding({\n    binding: resolveNativeSdkBinding(options),\n    config,\n    fullText,\n    onBatch,\n    ...(operators !== undefined ? { operators } : {}),\n  });\n\nexport const summary_diagnostics_json = (\n  config: NativeSearchPackageInput,\n  fullText: string,\n  operators?: NativeOperatorConfig,\n  options: NativeSdkOptions = {},\n): string =>\n  summaryDiagnosticsJsonWithBinding({\n    binding: resolveNativeSdkBinding(options),\n    config,\n    fullText,\n    ...(operators !== undefined ? { operators } : {}),\n  });\n\nexport const readDefaultNativePipelinePackageFile = ({\n  language,\n}: DefaultNativePipelinePackageFileOptions = {}): Uint8Array => {\n  const packageUrl = defaultNativePipelinePackageUrl(language);\n  try {\n    return readFileSync(packageUrl);\n  } catch (error) {\n    throw new Error(\n      `${defaultNativePipelinePackageDescription(language)} is unavailable: ${formatLoadError(error)}`,\n    );\n  }\n};\n\nexport const read_default_native_pipeline_package_file = (\n  options: DefaultNativePipelinePackageFileOptions = {},\n): Uint8Array => readDefaultNativePipelinePackageFile(options);\n\nexport const availableDefaultNativePipelineLanguages = (): string[] => {\n  const languages = new Set<string>();\n  try {\n    for (const fileName of readdirSync(\n      DEFAULT_NATIVE_PIPELINE_PACKAGE_DIR_URL,\n    )) {\n      const match = fileName.match(\n        DEFAULT_NATIVE_PIPELINE_LANGUAGE_PACKAGE_PATTERN,\n      );\n      if (match?.[1] !== undefined) {\n        languages.add(match[1]);\n      }\n    }\n  } catch (error) {\n    throw new Error(\n      `Default native pipeline package directory is unavailable: ${formatLoadError(error)}`,\n    );\n  }\n  return [...languages].toSorted();\n};\n\nexport const available_default_native_pipeline_languages =\n  availableDefaultNativePipelineLanguages;\n\nexport const readDefaultNativePipelinePackageFileAsync = async ({\n  language,\n}: DefaultNativePipelinePackageFileOptions = {}): Promise<Uint8Array> => {\n  const packageUrl = defaultNativePipelinePackageUrl(language);\n  try {\n    return await readFile(packageUrl);\n  } catch (error) {\n    throw new Error(\n      `${defaultNativePipelinePackageDescription(language)} is unavailable: ${formatLoadError(error)}`,\n    );\n  }\n};\n\nexport const createNativePipelineFromPackageFile = ({\n  binding,\n  packagePath,\n  expectedVersion,\n  ...loadOptions\n}: NativePipelinePackageFileOptions): PreparedNativePipeline => {\n  const resolvedBinding =\n    binding ??\n    loadNativeAnonymizeBinding({\n      ...loadOptions,\n      ...(expectedVersion !== undefined ? { expectedVersion } : {}),\n    });\n  if (binding && expectedVersion !== undefined) {\n    assertNativeBindingVersion({ binding, expectedVersion });\n  }\n  return createNativePipelineFromPackage({\n    binding: resolvedBinding,\n    packageBytes: readNativePipelinePackageFile(packagePath),\n  });\n};\n\nexport const createNativePipelineFromDefaultPackage = (\n  options: DefaultNativePipelinePackageOptions = {},\n): PreparedNativePipeline => {\n  const resolvedOptions = resolveDefaultNativePipelineOptions(options);\n  return applyDefaultNativePipelineWarmup(\n    createNativePipelineFromResolvedDefaultPackage(resolvedOptions),\n    resolvedOptions.warmup,\n  );\n};\n\nexport const create_native_pipeline_from_default_package = (\n  options: DefaultNativePipelinePackageOptions = {},\n): PreparedNativePipeline => createNativePipelineFromDefaultPackage(options);\n\nexport const getDefaultNativePipeline = (\n  options: DefaultNativePipelinePackageOptions = {},\n): PreparedNativePipeline => {\n  const resolvedOptions = resolveDefaultNativePipelineOptions(options);\n  const cache = defaultPipelineCacheFor(resolvedOptions.binding);\n  const key = defaultPipelineCacheKey(resolvedOptions);\n  const cached = cache.get(key);\n  if (cached !== undefined) {\n    return applyDefaultNativePipelineWarmup(cached, resolvedOptions.warmup);\n  }\n  const pipeline =\n    createNativePipelineFromResolvedDefaultPackage(resolvedOptions);\n  cache.set(key, pipeline);\n  return applyDefaultNativePipelineWarmup(pipeline, resolvedOptions.warmup);\n};\n\nexport const get_default_native_pipeline = (\n  options: DefaultNativePipelinePackageOptions = {},\n): PreparedNativePipeline => getDefaultNativePipeline(options);\n\nexport const createPipeline = async ({\n  language,\n  warmup,\n  ...bindingOptions\n}: CreatePipelineOptions = {}): Promise<PreparedNativePipeline> => {\n  const selection = normalizePipelineLanguageSelection(language);\n  if (selection.type === \"all\") {\n    return getDefaultNativePipeline({\n      ...bindingOptions,\n      ...(warmup !== undefined ? { warmup } : {}),\n    });\n  }\n  const [singleLanguage, ...additionalLanguages] = selection.languages;\n  if (\n    additionalLanguages.length === 0 &&\n    existsSync(defaultNativePipelineLanguagePackageUrl(singleLanguage))\n  ) {\n    return getDefaultNativePipeline({\n      ...bindingOptions,\n      language: singleLanguage,\n      ...(warmup !== undefined ? { warmup } : {}),\n    });\n  }\n  const resolvedWarmup = normalizeDefaultNativePipelineWarmup(warmup);\n  const pipeline = await createSemanticPipeline({\n    binding: resolveNativeSdkBinding(bindingOptions),\n    selection,\n  });\n  return applyDefaultNativePipelineWarmup(pipeline, resolvedWarmup);\n};\n\nexport const create_pipeline = createPipeline;\n\nexport const preloadDefaultNativePipeline = (\n  options: DefaultNativePipelinePackageOptions = {},\n): PreparedNativePipeline => {\n  const pipeline = getDefaultNativePipeline(options);\n  return applyDefaultNativePipelineWarmup(\n    pipeline,\n    DEFAULT_NATIVE_PIPELINE_WARMUPS.lazyRegex,\n  );\n};\n\nexport const preload_default_native_pipeline = (\n  options: DefaultNativePipelinePackageOptions = {},\n): PreparedNativePipeline => preloadDefaultNativePipeline(options);\n\nexport const redactDefaultText = (\n  fullText: string,\n  operators?: NativeOperatorConfig,\n  options: DefaultNativePipelinePackageOptions = {},\n): NativeStaticRedactionResult =>\n  getDefaultNativePipeline(options).redactText(fullText, operators);\n\nexport const redact_default_text = (\n  fullText: string,\n  operators?: NativeOperatorConfig,\n  options: DefaultNativePipelinePackageOptions = {},\n): NativeStaticRedactionResult =>\n  redactDefaultText(fullText, operators, options);\n\nexport const redactDefaultTextJson = (\n  fullText: string,\n  operators?: NativeOperatorConfig,\n  options: DefaultNativePipelinePackageOptions = {},\n): string =>\n  getDefaultNativePipeline(options).redact_text_json(fullText, operators);\n\nexport const redact_default_text_json = (\n  fullText: string,\n  operators?: NativeOperatorConfig,\n  options: DefaultNativePipelinePackageOptions = {},\n): string => redactDefaultTextJson(fullText, operators, options);\n\nexport const preloadDefaultNativePipelineAsync = (\n  options: DefaultNativePipelinePackageOptions = {},\n): Promise<PreparedNativePipeline> => {\n  const resolvedOptions = {\n    ...resolveDefaultNativePipelineOptions(options),\n    warmup: DEFAULT_NATIVE_PIPELINE_WARMUPS.lazyRegex,\n  };\n  const cache = defaultPipelineCacheFor(resolvedOptions.binding);\n  const key = defaultPipelineCacheKey(resolvedOptions);\n  const cached = cache.get(key);\n  if (cached !== undefined) {\n    return Promise.resolve(\n      applyDefaultNativePipelineWarmup(cached, resolvedOptions.warmup),\n    );\n  }\n\n  const inflightCache = defaultPipelineInflightCacheFor(\n    resolvedOptions.binding,\n  );\n  const inflight = inflightCache.get(key);\n  if (inflight !== undefined) {\n    return inflight;\n  }\n\n  const promise = createNativePipelineFromResolvedDefaultPackageAsync(\n    resolvedOptions,\n  )\n    .then((pipeline) => {\n      cache.set(key, pipeline);\n      return applyDefaultNativePipelineWarmup(pipeline, resolvedOptions.warmup);\n    })\n    .finally(() => {\n      inflightCache.delete(key);\n    });\n  inflightCache.set(key, promise);\n  return promise;\n};\n\nconst resolveDefaultNativePipelineOptions = ({\n  binding,\n  language,\n  packagePath,\n  warmup,\n  expectedVersion,\n  ...loadOptions\n}: DefaultNativePipelinePackageOptions = {}): ResolvedDefaultNativePipelineOptions => {\n  if (language !== undefined && packagePath !== undefined) {\n    throw new Error(\"Use either language or packagePath, not both\");\n  }\n  const resolvedBinding =\n    binding ??\n    loadNativeAnonymizeBinding({\n      ...loadOptions,\n      ...(expectedVersion !== undefined ? { expectedVersion } : {}),\n    });\n  if (binding && expectedVersion !== undefined) {\n    assertNativeBindingVersion({ binding, expectedVersion });\n  }\n  return {\n    binding: resolvedBinding,\n    warmup: normalizeDefaultNativePipelineWarmup(warmup),\n    ...(language !== undefined\n      ? { language: resolveDefaultNativePipelineLanguage(language) }\n      : {}),\n    ...(packagePath !== undefined ? { packagePath } : {}),\n  };\n};\n\nconst applyDefaultNativePipelineWarmup = (\n  pipeline: PreparedNativePipeline,\n  warmup: DefaultNativePipelineWarmup,\n): PreparedNativePipeline => {\n  if (warmup !== DEFAULT_NATIVE_PIPELINE_WARMUPS.lazyRegex) {\n    return pipeline;\n  }\n  if (!warmedDefaultNativePipelines.has(pipeline)) {\n    pipeline.warmLazyRegex();\n    warmedDefaultNativePipelines.add(pipeline);\n  }\n  return pipeline;\n};\n\nconst createNativePipelineFromResolvedDefaultPackage = ({\n  binding,\n  language,\n  packagePath,\n}: ResolvedDefaultNativePipelineOptions): PreparedNativePipeline => {\n  const packageBytes =\n    packagePath === undefined\n      ? readDefaultNativePipelinePackageFile(\n          defaultPackageFileOptions(language),\n        )\n      : readNativePipelinePackageFile(packagePath);\n  return createNativePipelineFromTrustedDefaultPackage(binding, packageBytes);\n};\n\nconst createNativePipelineFromResolvedDefaultPackageAsync = async ({\n  binding,\n  language,\n  packagePath,\n}: ResolvedDefaultNativePipelineOptions): Promise<PreparedNativePipeline> => {\n  const packageBytes =\n    packagePath === undefined\n      ? await readDefaultNativePipelinePackageFileAsync(\n          defaultPackageFileOptions(language),\n        )\n      : await readNativePipelinePackageFileAsync(packagePath);\n  return createNativePipelineFromTrustedDefaultPackage(binding, packageBytes);\n};\n\nconst createNativePipelineFromTrustedDefaultPackage = (\n  binding: NativeAnonymizeBinding,\n  packageBytes: Uint8Array,\n): PreparedNativePipeline =>\n  new PreparedNativePipeline(\n    new PreparedNativeAnonymizer(\n      binding.NativePreparedSearch.fromTrustedPreparedPackageBytesWithoutCache(\n        packageBytes,\n      ),\n    ),\n  );\n\nconst defaultPackageFileOptions = (\n  language: string | undefined,\n): DefaultNativePipelinePackageFileOptions =>\n  language === undefined ? {} : { language };\n\nconst normalizeDefaultNativePipelineWarmup = (\n  warmup: DefaultNativePipelineWarmup | undefined,\n): DefaultNativePipelineWarmup => {\n  if (warmup === undefined) {\n    return DEFAULT_NATIVE_PIPELINE_WARMUPS.none;\n  }\n  switch (warmup) {\n    case DEFAULT_NATIVE_PIPELINE_WARMUPS.lazyRegex:\n    case DEFAULT_NATIVE_PIPELINE_WARMUPS.none:\n      return warmup;\n  }\n  throw new Error(\n    'Default native pipeline warmup must be \"lazy-regex\" or \"none\"',\n  );\n};\n\nconst resolveNativeSdkBinding = ({\n  binding,\n  expectedVersion,\n  ...loadOptions\n}: NativeSdkOptions): NativeAnonymizeBinding => {\n  const resolvedBinding =\n    binding ??\n    loadNativeAnonymizeBinding({\n      ...loadOptions,\n      ...(expectedVersion !== undefined ? { expectedVersion } : {}),\n    });\n  if (binding && expectedVersion !== undefined) {\n    assertNativeBindingVersion({ binding, expectedVersion });\n  }\n  return resolvedBinding;\n};\n\nconst defaultPipelineCacheFor = (\n  binding: NativeAnonymizeBinding,\n): Map<string, PreparedNativePipeline> => {\n  const cached = defaultNativePipelineCache.get(binding);\n  if (cached !== undefined) {\n    return cached;\n  }\n  const created = new Map<string, PreparedNativePipeline>();\n  defaultNativePipelineCache.set(binding, created);\n  return created;\n};\n\nconst defaultPipelineInflightCacheFor = (\n  binding: NativeAnonymizeBinding,\n): Map<string, Promise<PreparedNativePipeline>> => {\n  const cached = defaultNativePipelineInflightCache.get(binding);\n  if (cached !== undefined) {\n    return cached;\n  }\n  const created = new Map<string, Promise<PreparedNativePipeline>>();\n  defaultNativePipelineInflightCache.set(binding, created);\n  return created;\n};\n\nconst defaultPipelineCacheKey = ({\n  binding,\n  language,\n  packagePath,\n}: ResolvedDefaultNativePipelineOptions): string =>\n  [\n    binding.nativePackageVersion(),\n    packagePath ??\n      (language === undefined\n        ? DEFAULT_NATIVE_PIPELINE_PACKAGE_CACHE_KEY\n        : `language:${language}`),\n  ].join(\"\\0\");\n\nconst defaultNativePipelinePackageUrl = (language: string | undefined): URL => {\n  if (language === undefined) {\n    return DEFAULT_NATIVE_PIPELINE_PACKAGE_URL;\n  }\n  const normalized = resolveDefaultNativePipelineLanguage(language);\n  return defaultNativePipelineLanguagePackageUrl(normalized);\n};\n\nconst defaultNativePipelineLanguagePackageUrl = (language: string): URL =>\n  new URL(`../native-pipeline.${language}.stlanonpkg`, import.meta.url);\n\nconst resolveDefaultNativePipelineLanguage = (language: string): string => {\n  const normalized = normalizeDefaultNativePipelineLanguage(language);\n  const exactUrl = defaultNativePipelineLanguagePackageUrl(normalized);\n  if (existsSync(exactUrl)) {\n    return normalized;\n  }\n  const baseLanguage = normalized.split(\"-\").at(0);\n  if (baseLanguage === undefined || baseLanguage === normalized) {\n    return normalized;\n  }\n  const baseUrl = defaultNativePipelineLanguagePackageUrl(baseLanguage);\n  if (existsSync(baseUrl)) {\n    return baseLanguage;\n  }\n  return normalized;\n};\n\nconst defaultNativePipelinePackageDescription = (\n  language: string | undefined,\n): string =>\n  language === undefined\n    ? \"Default native pipeline package\"\n    : `Default native pipeline package for language \"${resolveDefaultNativePipelineLanguage(language)}\"`;\n\nconst normalizeDefaultNativePipelineLanguage = (language: string): string => {\n  const normalized = language.trim().toLowerCase();\n  if (!DEFAULT_NATIVE_PIPELINE_LANGUAGE_PATTERN.test(normalized)) {\n    throw new Error(\n      `Default native pipeline language must match ${DEFAULT_NATIVE_PIPELINE_LANGUAGE_PATTERN.source}`,\n    );\n  }\n  return normalized;\n};\n\ntype NativeBindingSpecifiersOptions = {\n  arch: string;\n  env: Record<string, string | undefined>;\n  libc: NativeLibc | undefined;\n  platform: string;\n};\n\nconst nativeBindingSpecifiers = ({\n  arch,\n  env,\n  libc,\n  platform,\n}: NativeBindingSpecifiersOptions): string[] => {\n  const specifiers: string[] = [];\n  const overridePath = env[PACKAGE_SPECIFIC_NATIVE_PATH];\n  if (overridePath) {\n    specifiers.push(overridePath);\n  }\n  const platformPackage = nativeBindingPackageName({ arch, libc, platform });\n  if (platformPackage !== null) {\n    specifiers.push(platformPackage);\n  }\n  return specifiers;\n};\n\ntype NativeBindingTarget = {\n  platform: string;\n  arch: string;\n  libc?: NativeLibc;\n  package: string;\n};\n\n// Single source of truth for published native sidecars. Both the runtime\n// package lookup and the \"unsupported target\" error message derive from this\n// table, so a target is never advertised as supported without a package (and\n// vice versa). musl Linux is intentionally absent: no musl sidecar is shipped.\nconst NATIVE_BINDING_TARGETS: readonly NativeBindingTarget[] = [\n  {\n    platform: \"darwin\",\n    arch: \"arm64\",\n    package: \"@stll/anonymize-darwin-arm64\",\n  },\n  { platform: \"darwin\", arch: \"x64\", package: \"@stll/anonymize-darwin-x64\" },\n  {\n    platform: \"linux\",\n    arch: \"arm64\",\n    libc: \"gnu\",\n    package: \"@stll/anonymize-linux-arm64-gnu\",\n  },\n  {\n    platform: \"linux\",\n    arch: \"x64\",\n    libc: \"gnu\",\n    package: \"@stll/anonymize-linux-x64-gnu\",\n  },\n  { platform: \"win32\", arch: \"x64\", package: \"@stll/anonymize-win32-x64-msvc\" },\n];\n\ntype NativeBindingPackageNameOptions = {\n  arch: string;\n  libc: NativeLibc | undefined;\n  platform: string;\n};\n\ntype DescribeNativeTargetOptions = {\n  arch: string;\n  libc?: NativeLibc | undefined;\n  platform: string;\n};\n\nconst describeNativeTarget = ({\n  arch,\n  libc,\n  platform,\n}: DescribeNativeTargetOptions): string =>\n  libc === undefined ? `${platform}-${arch}` : `${platform}-${arch}-${libc}`;\n\nconst SUPPORTED_NATIVE_TARGETS: readonly string[] = NATIVE_BINDING_TARGETS.map(\n  (target) => describeNativeTarget(target),\n);\n\nconst nativeBindingPackageName = ({\n  arch,\n  libc,\n  platform,\n}: NativeBindingPackageNameOptions): string | null => {\n  const match = NATIVE_BINDING_TARGETS.find(\n    (target) =>\n      target.platform === platform &&\n      target.arch === arch &&\n      (target.libc === undefined || target.libc === libc),\n  );\n  return match?.package ?? null;\n};\n\nconst unsupportedNativeTargetError = ({\n  arch,\n  errors,\n  libc,\n  platform,\n}: NativeBindingPackageNameOptions & { errors: string[] }): Error => {\n  const target = describeNativeTarget({ arch, libc, platform });\n  const supported = SUPPORTED_NATIVE_TARGETS.join(\", \");\n  const attempts = errors.length > 0 ? `\\n${errors.join(\"\\n\")}` : \"\";\n  return new Error(\n    `No native anonymize binding is published for ${target}; supported targets: ${supported}. Set ${PACKAGE_SPECIFIC_NATIVE_PATH} to a locally built binding to run on this platform.${attempts}`,\n  );\n};\n\nconst detectNativeLibc = (platform: string): NativeLibc | undefined => {\n  if (platform !== \"linux\") {\n    return undefined;\n  }\n  const report = process.report?.getReport();\n  const header =\n    isPropertyBag(report) && isPropertyBag(report[\"header\"])\n      ? report[\"header\"]\n      : null;\n  return typeof header?.[\"glibcVersionRuntime\"] === \"string\" ? \"gnu\" : \"musl\";\n};\n\nconst isHostNativeTarget = ({\n  arch,\n  libc,\n  platform,\n}: NativeBindingPackageNameOptions): boolean =>\n  platform === process.platform &&\n  arch === process.arch &&\n  (platform !== \"linux\" || libc === detectNativeLibc(process.platform));\n\ntype TryLoadNativeBindingOptions = {\n  specifier: string;\n  loadModule: () => unknown;\n  errors: string[];\n};\n\nconst tryLoadNativeBinding = ({\n  specifier,\n  loadModule,\n  errors,\n}: TryLoadNativeBindingOptions): NativeAnonymizeBinding | null => {\n  try {\n    const loaded = loadModule();\n    const binding = toNativeAnonymizeBinding(loaded);\n    if (binding) {\n      return binding;\n    }\n    errors.push(`${specifier}: module does not match native binding shape`);\n  } catch (error) {\n    errors.push(`${specifier}: ${formatLoadError(error)}`);\n  }\n  return null;\n};\n\nconst toNativeAnonymizeBinding = (\n  value: unknown,\n): NativeAnonymizeBinding | null => {\n  const candidate =\n    isPropertyBag(value) && isPropertyBag(value[\"default\"])\n      ? value[\"default\"]\n      : value;\n  return isNativeAnonymizeBinding(candidate) ? candidate : null;\n};\n\nconst isPropertyBag = (value: unknown): value is Record<string, unknown> =>\n  (typeof value === \"object\" && value !== null) || typeof value === \"function\";\n\nconst formatLoadError = (error: unknown): string => {\n  if (error instanceof Error) {\n    return error.message;\n  }\n  return String(error);\n};\n"],"mappings":";;;;;;;;;AAAA,MAAM,oBAAoB;AAC1B,MAAM,oBAAoB;AAC1B,MAAM,oBAAoB;AAC1B,MAAM,sBACJ;AAEF,MAAa,gCAAgC;AAE7C,MAAa,6BAA6B,eAA8B;CACtE,IAAI,eAAe,KAAA,GACjB;CAIF,MAAM,EA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