{"version":3,"file":"index.mjs","names":["getHeader","getContentTypeReturnType"],"sources":["../src/base-url.ts","../src/constants.ts","../src/types.ts","../src/utils.ts","../src/http-client.ts","../src/http-resource.ts","../src/index.ts"],"sourcesContent":["import {\n  type AngularBaseUrlOptions,\n  type ClientExtraFilesBuilder,\n  type ClientFileBuilder,\n  type ContextSpec,\n  getFileInfo,\n  getImportExtension,\n  jsDoc,\n  type NormalizedOutputOptions,\n  type OpenApiInfoObject,\n  pascal,\n  resolveServerUrl,\n  snake,\n  upath,\n} from '@orval/core';\n\n/**\n * Reads the file-level JSDoc header configured via `output.override.header`.\n *\n * Mirrors the identically-named helper in `http-resource.ts` — duplicated\n * (rather than imported) to keep this module free of a dependency on the\n * httpResource generator.\n */\nconst getHeader = (\n  option: false | ((info: OpenApiInfoObject) => string | string[]),\n  info: OpenApiInfoObject | undefined,\n): string => {\n  if (!option || !info) {\n    return '';\n  }\n\n  const header = option(info);\n\n  return Array.isArray(header) ? jsDoc({ description: header }) : header;\n};\n\n/** `example-api` -> `EXAMPLE_API` — the shared constant-case prefix for every generated identifier. */\nexport const getBaseUrlConstantPrefix = (apiId: string): string =>\n  snake(apiId).toUpperCase();\n\n/** `example-api` -> `EXAMPLE_API_SERVER_URL` */\nexport const getBaseUrlServerUrlConstantName = (apiId: string): string =>\n  `${getBaseUrlConstantPrefix(apiId)}_SERVER_URL`;\n\n/** `example-api` -> `EXAMPLE_API_BASE_URL` */\nexport const getBaseUrlTokenName = (apiId: string): string =>\n  `${getBaseUrlConstantPrefix(apiId)}_BASE_URL`;\n\n/** `example-api` -> `EXAMPLE_API_BASE_URL_RESOLVER` */\nexport const getBaseUrlResolverTokenName = (apiId: string): string =>\n  `${getBaseUrlConstantPrefix(apiId)}_BASE_URL_RESOLVER`;\n\n/** `example-api` -> `ExampleApiBaseUrlResolver` (resolver function type name) */\nexport const getBaseUrlResolverTypeName = (apiId: string): string =>\n  `${pascal(apiId)}BaseUrlResolver`;\n\n/** `example-api` -> `ExampleApiBaseUrlResolverContext` (resolver context type name) */\nexport const getBaseUrlResolverContextTypeName = (apiId: string): string =>\n  `${pascal(apiId)}BaseUrlResolverContext`;\n\n/** `example-api` -> `provideExampleApiBaseUrl` */\nexport const getProvideBaseUrlName = (apiId: string): string =>\n  `provide${pascal(apiId)}BaseUrl`;\n\n/** `example-api` -> `provideExampleApiBaseUrlResolver` */\nexport const getProvideBaseUrlResolverName = (apiId: string): string =>\n  `provide${pascal(apiId)}BaseUrlResolver`;\n\n/**\n * Builds the full generated source for a `<target>.base-url.ts` file.\n *\n * The emitted module exposes, purely through Angular DI, the precedence chain\n * documented in `override.angular.baseUrl`'s guide:\n *\n * 1. A directly provided `<API_ID>_BASE_URL` token value (`provideXBaseUrl`) —\n *    wins outright; the resolver below is never invoked.\n * 2. A directly provided `<API_ID>_BASE_URL_RESOLVER` (`provideXBaseUrlResolver`).\n * 3. The default resolver factory, which returns the embedded spec server URL.\n * 4. The embedded `<API_ID>_SERVER_URL` constant (`''` when the specification\n *    has no `servers` entry), passed to whichever resolver above ends up running.\n *\n * All exported members carry explicit return types and no `any`, matching the\n * rest of the generated Angular output.\n */\nexport const buildAngularBaseUrlFileContent = ({\n  apiId,\n  serverUrl,\n}: {\n  apiId: string;\n  serverUrl: string;\n}): string => {\n  const serverUrlConstantName = getBaseUrlServerUrlConstantName(apiId);\n  const tokenName = getBaseUrlTokenName(apiId);\n  const resolverTokenName = getBaseUrlResolverTokenName(apiId);\n  const resolverTypeName = getBaseUrlResolverTypeName(apiId);\n  const contextTypeName = getBaseUrlResolverContextTypeName(apiId);\n  const provideBaseUrlName = getProvideBaseUrlName(apiId);\n  const provideBaseUrlResolverName = getProvideBaseUrlResolverName(apiId);\n\n  return `import { InjectionToken, inject, type Provider } from '@angular/core';\n\n/**\n * Embedded fallback base URL for the \\`${apiId}\\` API, resolved at generation\n * time from the OpenAPI specification's \\`servers\\` field (\\`''\\` when the\n * specification has no servers).\n */\nexport const ${serverUrlConstantName}: string = ${JSON.stringify(serverUrl)};\n\n/**\n * Strips trailing slashes from a base URL.\n *\n * Generated routes always start with \\`/\\`, so normalizing here at the token\n * boundary guarantees \\`\\${baseUrl}\\${route}\\` can never double or drop the\n * separator between them, for either \\`HttpClient\\` services or \\`httpResource\\`\n * functions.\n */\nexport function normalizeBaseUrl(baseUrl: string): string {\n  return baseUrl.replace(/\\\\/+$/, '');\n}\n\n/** Context passed to a \\`${resolverTypeName}\\` when it is invoked. */\nexport interface ${contextTypeName} {\n  /** The explicit \\`apiId\\` configured via \\`override.angular.baseUrl\\`. */\n  readonly apiId: ${JSON.stringify(apiId)};\n  /** The embedded fallback server URL (\\`${serverUrlConstantName}\\`). */\n  readonly serverUrl: string;\n}\n\n/** Resolves the runtime base URL for the \\`${apiId}\\` API. */\nexport type ${resolverTypeName} = (context: ${contextTypeName}) => string;\n\n/**\n * Injectable hook for resolving the \\`${apiId}\\` API's base URL at runtime\n * (e.g. from a gateway route registry). Overridden via\n * \\`${provideBaseUrlResolverName}\\`; defaults to the embedded specification\n * server URL.\n */\nexport const ${resolverTokenName} = new InjectionToken<${resolverTypeName}>(\n  ${JSON.stringify(resolverTokenName)},\n  {\n    providedIn: 'root',\n    factory: (): ${resolverTypeName} => (context) => context.serverUrl,\n  },\n);\n\n/**\n * Runtime base URL for the \\`${apiId}\\` API, composed via Angular DI.\n *\n * Precedence: a directly provided value (\\`${provideBaseUrlName}\\`) wins\n * outright; otherwise the \\`${resolverTokenName}\\` resolver (default or\n * provided via \\`${provideBaseUrlResolverName}\\`) is invoked with the embedded\n * \\`${serverUrlConstantName}\\` fallback. The result is always normalized.\n */\nexport const ${tokenName} = new InjectionToken<string>(${JSON.stringify(tokenName)}, {\n  providedIn: 'root',\n  factory: (): string => {\n    const resolver = inject(${resolverTokenName});\n    return normalizeBaseUrl(\n      resolver({ apiId: ${JSON.stringify(apiId)}, serverUrl: ${serverUrlConstantName} }),\n    );\n  },\n});\n\n/** Directly provides the \\`${apiId}\\` API's base URL, bypassing the resolver. */\nexport function ${provideBaseUrlName}(baseUrl: string): Provider {\n  return { provide: ${tokenName}, useValue: normalizeBaseUrl(baseUrl) };\n}\n\n/** Provides a custom resolver for the \\`${apiId}\\` API's base URL. */\nexport function ${provideBaseUrlResolverName}(\n  resolver: ${resolverTypeName},\n): Provider {\n  return { provide: ${resolverTokenName}, useValue: resolver };\n}\n`;\n};\n\n/**\n * Path of the generated `<target>.base-url.ts` file for the current output.\n *\n * Unlike the `httpResource` extra-file mechanism (one sibling file per tag in\n * `tags` / `tags-split` mode), there is exactly one base-URL file per output —\n * the DI tokens it exports are shared by every generated file regardless of mode.\n */\nexport const getAngularBaseUrlFilePath = (\n  output: NormalizedOutputOptions,\n): string => {\n  const { dirname, filename, extension } = getFileInfo(output.target, {\n    extension: output.fileExtension,\n  });\n\n  return upath.joinSafe(dirname, `${filename}.base-url${extension}`);\n};\n\n/**\n * Import specifier a generated implementation file uses to reach the\n * base-URL file produced by {@link getAngularBaseUrlFilePath}.\n *\n * Always authored as if the importing file sat next to the base-URL file\n * (i.e. directly in `<dirname>`) — this matches `single`/`split`/`tags` mode,\n * where implementation files are in fact siblings. `tags-split` mode nests\n * implementation files one directory below (`<dirname>/<tag>/<tag>.ts`), but\n * the `tags-split` writer (`writers/split-tags-mode.ts`) already generically\n * re-resolves every relative `GeneratorImport.importPath` — originally\n * authored relative to `dirname` — against the operation's actual nested\n * file location. Special-casing `'../'` here as well would double-apply that\n * shift and produce a broken `../../` import.\n */\nexport const getAngularBaseUrlImportSpecifier = (\n  output: NormalizedOutputOptions,\n): string => {\n  const { filename, extension } = getFileInfo(output.target, {\n    extension: output.fileExtension,\n  });\n  const importExtension = getImportExtension(extension, output.tsconfig);\n\n  return `./${filename}.base-url${importExtension}`;\n};\n\nconst buildBaseUrlExtraFile = (\n  baseUrl: AngularBaseUrlOptions,\n  output: NormalizedOutputOptions,\n  context: ContextSpec,\n  header: string,\n): ClientFileBuilder => {\n  const serverUrl = resolveServerUrl(context.spec.servers, {\n    index: baseUrl.index,\n    variables: baseUrl.variables,\n  });\n\n  return {\n    path: getAngularBaseUrlFilePath(output),\n    content: `${header}${buildAngularBaseUrlFileContent({ apiId: baseUrl.apiId, serverUrl })}`,\n  };\n};\n\n/**\n * Emits the opt-in `<target>.base-url.ts` extra file when\n * `override.angular.baseUrl` is configured; a zero-cost no-op (`[]`) otherwise.\n *\n * @returns Zero or one `ClientFileBuilder` describing the generated base-URL file.\n */\nexport const generateAngularBaseUrlExtraFiles: ClientExtraFilesBuilder = (\n  _verbOptions,\n  output,\n  context,\n) => {\n  const baseUrl = output.override.angular.baseUrl;\n  if (!baseUrl) {\n    return Promise.resolve([]);\n  }\n\n  const header = getHeader(output.override.header, context.spec.info);\n\n  return Promise.resolve([\n    buildBaseUrlExtraFile(baseUrl, output, context, header),\n  ]);\n};\n","import type { GeneratorDependency } from '@orval/core';\n\nexport const ANGULAR_HTTP_CLIENT_DEPENDENCIES = [\n  {\n    // `HttpHeaders` and `HttpResponse` are not listed here: whether an\n    // operation needs them as values (`instanceof` narrowing) or only as\n    // types is decided per operation in `generateAngular`.\n    exports: [\n      { name: 'HttpClient', values: true },\n      { name: 'HttpParams' },\n      { name: 'HttpContext' },\n      { name: 'HttpEvent' },\n    ],\n    dependency: '@angular/common/http',\n  },\n  {\n    exports: [\n      { name: 'Injectable', values: true },\n      { name: 'inject', values: true },\n    ],\n    dependency: '@angular/core',\n  },\n  {\n    // Only ever a return type; generated code never constructs one.\n    exports: [{ name: 'Observable' }],\n    dependency: 'rxjs',\n  },\n] as const satisfies readonly GeneratorDependency[];\n\nexport const ANGULAR_HTTP_RESOURCE_DEPENDENCIES = [\n  {\n    exports: [\n      { name: 'httpResource', values: true },\n      { name: 'HttpResourceOptions' },\n      { name: 'HttpResourceRef' },\n      { name: 'HttpResourceRequest' },\n      { name: 'HttpHeaders', values: true },\n      { name: 'HttpParams' },\n      { name: 'HttpContext' },\n    ],\n    dependency: '@angular/common/http',\n  },\n  {\n    exports: [\n      { name: 'Signal' },\n      { name: 'ResourceStatus' },\n      { name: 'inject', values: true },\n    ],\n    dependency: '@angular/core',\n  },\n] as const satisfies readonly GeneratorDependency[];\n","/**\n * Code template for the `HttpClientOptions` interface emitted into generated files.\n *\n * This is NOT an import of Angular's type — Angular's HttpClient methods accept\n * inline option objects, not a single unified interface. Orval generates this\n * convenience wrapper so users have a single referenceable type.\n *\n * Properties sourced from Angular HttpClient public API (angular/angular\n * packages/common/http/src/client.ts).\n */\nexport const HTTP_CLIENT_OPTIONS_TEMPLATE = `interface HttpClientOptions {\n  readonly headers?: HttpHeaders | Record<string, string | string[]>;\n  readonly context?: HttpContext;\n  readonly params?:\n        | HttpParams\n      | Record<string, string | number | boolean | Array<string | number | boolean>>;\n  readonly reportProgress?: boolean;\n  readonly withCredentials?: boolean;\n  readonly credentials?: RequestCredentials;\n  readonly keepalive?: boolean;\n  readonly priority?: RequestPriority;\n  readonly cache?: RequestCache;\n  readonly mode?: RequestMode;\n  readonly redirect?: RequestRedirect;\n  readonly referrer?: string;\n  readonly integrity?: string;\n  readonly referrerPolicy?: ReferrerPolicy;\n  readonly transferCache?: {includeHeaders?: string[]} | boolean;\n  readonly timeout?: number;\n}`;\n\n/**\n * Code templates for reusable observe option helpers emitted into generated files.\n */\nexport const HTTP_CLIENT_OBSERVE_OPTIONS_TEMPLATE = `type HttpClientBodyOptions = HttpClientOptions & {\n  readonly observe?: 'body';\n};\n\ntype HttpClientEventOptions = HttpClientOptions & {\n  readonly observe: 'events';\n};\n\ntype HttpClientResponseOptions = HttpClientOptions & {\n  readonly observe: 'response';\n};\n\ntype HttpClientObserveOptions = HttpClientOptions & {\n  readonly observe?: 'body' | 'events' | 'response';\n};`;\n\n/**\n * Code template for the `ThirdParameter` utility type used with custom mutators.\n */\nexport const THIRD_PARAMETER_TEMPLATE = `// eslint-disable-next-line\n    type ThirdParameter<T extends (...args: never[]) => unknown> = T extends (\n  config: unknown,\n  httpClient: unknown,\n  args: infer P,\n) => unknown\n  ? P\n  : never;`;\n","import {\n  type GeneratorVerbOptions,\n  getAngularFilteredParamsHelperBody,\n  getDefaultContentType,\n  isBoolean,\n  isObject,\n  isOperationInTagBucket,\n  type NormalizedOutputOptions,\n  pascal,\n  type ResReqTypesValue,\n  sanitize,\n  type Verbs,\n} from '@orval/core';\n\nimport {\n  HTTP_CLIENT_OBSERVE_OPTIONS_TEMPLATE,\n  HTTP_CLIENT_OPTIONS_TEMPLATE,\n  THIRD_PARAMETER_TEMPLATE,\n} from './types';\n\nexport type ClientOverride = 'httpClient' | 'httpResource' | 'both';\n\nconst PRIMITIVE_TYPE_VALUES = [\n  'string',\n  'number',\n  'boolean',\n  'void',\n  'unknown',\n] as const;\n\nexport type PrimitiveType = (typeof PRIMITIVE_TYPE_VALUES)[number];\n\nexport const PRIMITIVE_TYPES = new Set(PRIMITIVE_TYPE_VALUES);\n\nconst PRIMITIVE_TYPE_LOOKUP = {\n  string: true,\n  number: true,\n  boolean: true,\n  void: true,\n  unknown: true,\n} as const satisfies Record<PrimitiveType, true>;\n\n/**\n * Narrows a schema type string to the primitive set supported by the Angular\n * generators' query/header helpers.\n */\nexport const isPrimitiveType = (t: string | undefined): t is PrimitiveType =>\n  t != undefined &&\n  Object.prototype.hasOwnProperty.call(PRIMITIVE_TYPE_LOOKUP, t);\n\n/**\n * Indicates whether the configured schema output target is Zod-based.\n */\nexport const isZodSchemaOutput = (output: NormalizedOutputOptions): boolean =>\n  isObject(output.schemas) && output.schemas.type === 'zod';\n\n/**\n * Removes `null` and `undefined` from a value in a type-safe way.\n */\nexport const isDefined = <T>(v: T | null | undefined): v is T => v != undefined;\n\n/**\n * Maps a schema type name to its Zod output-type reference (`${typeName}Output`).\n */\nexport const getSchemaOutputTypeRef = (typeName: string): string =>\n  `${typeName}Output`;\n\n/**\n * Converts an operation/tag title into the generated Angular service class name.\n */\nexport const generateAngularTitle = (title: string) => {\n  const sanTitle = sanitize(title);\n  return `${pascal(sanTitle)}Service`;\n};\n\n/**\n * Builds the opening of an @Injectable Angular service class.\n * Shared between httpClient-only mode and the mutation section of httpResource mode.\n */\nexport const buildServiceClassOpen = ({\n  title,\n  isRequestOptions,\n  isMutator,\n  isGlobalMutator,\n  provideIn,\n  hasQueryParams,\n  baseUrlFieldInitializer,\n  hasObjectParams = false,\n}: {\n  title: string;\n  isRequestOptions: boolean;\n  isMutator: boolean;\n  isGlobalMutator: boolean;\n  provideIn: string | boolean | undefined;\n  hasQueryParams: boolean;\n  /**\n   * When set, injected as an additional `private readonly baseUrl = ...;`\n   * class field — used by `httpResource`-mode mutation-service classes to\n   * pick up the same base-URL DI token as their sibling `HttpClient` output.\n   */\n  baseUrlFieldInitializer?: string;\n  /**\n   * Whether the emitted helper needs the object-serialization overload\n   * (issue #3705). Only meaningful when `hasQueryParams` is `true`.\n   */\n  hasObjectParams?: boolean;\n}): string => {\n  const provideInValue = provideIn\n    ? `{ providedIn: '${isBoolean(provideIn) ? 'root' : provideIn}' }`\n    : '';\n\n  return `\n${\n  isRequestOptions && !isGlobalMutator\n    ? `${HTTP_CLIENT_OPTIONS_TEMPLATE}\n\n${HTTP_CLIENT_OBSERVE_OPTIONS_TEMPLATE}\n\n${hasQueryParams ? getAngularFilteredParamsHelperBody({ hasObjectParams }) : ''}`\n    : ''\n}\n\n${isRequestOptions && isMutator ? THIRD_PARAMETER_TEMPLATE : ''}\n\n@Injectable(${provideInValue})\nexport class ${title} {\n  private readonly http = inject(HttpClient);\n${baseUrlFieldInitializer ? `  ${baseUrlFieldInitializer}\\n` : ''}`;\n};\n\n/**\n * Registry that maps operationName → full route (with baseUrl).\n *\n * Populated during client builder calls (which receive the full route via\n * GeneratorOptions.route) and read during header/footer builder calls\n * (which only receive verbOptions without routes).\n *\n * This avoids monkey-patching verbOptions with a non-standard `fullRoute` property.\n */\nexport const createRouteRegistry = () => {\n  const routes = new Map<string, string>();\n\n  return {\n    reset() {\n      routes.clear();\n    },\n    set(operationName: string, route: string) {\n      routes.set(operationName, route);\n    },\n    get(operationName: string, fallback: string): string {\n      return routes.get(operationName) ?? fallback;\n    },\n  };\n};\n/**\n * Returns only the operations that belong to the current tag output.\n *\n * Tag matching is delegated to {@link isOperationInTagBucket}, the single source\n * of truth for tag-bucket identity. Untagged operations resolve to the implicit\n * `default` bucket, matching how the core writer routes them in\n * `tags` / `tags-split` mode.\n */\nexport const getRelevantVerbOptionsForTag = (\n  verbOptions: Record<string, GeneratorVerbOptions>,\n  tag?: string,\n): GeneratorVerbOptions[] => {\n  const allVerbOptions = Object.values(verbOptions);\n  // Only an absent tag means \"no filter\"; an empty/whitespace tag is a real\n  // bucket key that `isOperationInTagBucket` normalises to `default`, matching\n  // the core writer instead of silently matching every operation.\n  if (tag == null) return allVerbOptions;\n\n  return allVerbOptions.filter((verbOption) =>\n    isOperationInTagBucket(verbOption, tag),\n  );\n};\n\nexport const createReturnTypesRegistry = () => {\n  const returnTypesToWrite = new Map<string, string>();\n\n  return {\n    reset() {\n      returnTypesToWrite.clear();\n    },\n    set(operationName: string, typeDefinition: string) {\n      returnTypesToWrite.set(operationName, typeDefinition);\n    },\n    getFooter(operationNames: string[]) {\n      const collected: string[] = [];\n      for (const operationName of operationNames) {\n        const value = returnTypesToWrite.get(operationName);\n        if (value) {\n          collected.push(value);\n        }\n      }\n      return collected.join('\\n');\n    },\n  };\n};\n\n/**\n * Determines whether an operation should be generated as an `httpResource()`\n * (retrieval) or as an `HttpClient` method in a service class (mutation).\n *\n * Resolution order:\n * 1. **Per-operation override** — `override.operations.<operationId>.angular.client`\n *    in the orval config. `httpResource` forces retrieval, `httpClient` forces mutation.\n * 2. **HTTP verb** — absent a per-operation override, `GET` is treated as a retrieval.\n * 3. **Name heuristic** — For `POST`, if the operationName starts with a\n *    retrieval-like prefix (search, list, find, query, get, fetch, lookup)\n *    it is treated as a retrieval. This handles common patterns like\n *    `POST /search` or `POST /graphql` with query-style operation names.\n *\n * If the heuristic misclassifies an operation, users can override it\n * per-operation in their orval config:\n *\n * ```ts\n * override: {\n *   operations: {\n *     myPostSearch: { angular: { retrievalClient: 'httpResource' } },\n *     getOrCreateUser: { angular: { retrievalClient: 'httpClient' } },\n *   }\n * }\n * ```\n */\nexport function isRetrievalVerb(\n  verb: Verbs,\n  operationName?: string,\n  clientOverride?: ClientOverride,\n): boolean {\n  // Per-operation override takes precedence\n  if (clientOverride === 'httpResource') return true;\n  if (clientOverride === 'httpClient') return false;\n\n  // Absent a per-operation override, safe retrieval verbs stay in httpResource.\n  if (verb === 'get' || verb === 'query') return true;\n\n  // POST with a retrieval-like operation name\n  if (verb === 'post' && operationName) {\n    const lower = operationName.toLowerCase();\n    return /^(search|list|find|query|get|fetch|lookup|filter)/.test(lower);\n  }\n  return false;\n}\n\nexport function isMutationVerb(\n  verb: Verbs,\n  operationName?: string,\n  clientOverride?: ClientOverride,\n): boolean {\n  return !isRetrievalVerb(verb, operationName, clientOverride);\n}\n\n/**\n * Selects the preferred success payload type for Angular `httpResource`\n * generation, favouring JSON responses and otherwise falling back to the\n * generator's default content-type rules.\n */\nexport function getDefaultSuccessType(\n  successTypes: ResReqTypesValue[],\n  fallback: string,\n) {\n  const uniqueContentTypes = [\n    ...new Set(successTypes.map((t) => t.contentType).filter(Boolean)),\n  ];\n  const jsonContentType = uniqueContentTypes.find((contentType) =>\n    contentType.includes('json'),\n  );\n  const defaultContentType =\n    jsonContentType ??\n    (uniqueContentTypes.length > 1\n      ? getDefaultContentType(uniqueContentTypes)\n      : (uniqueContentTypes[0] ?? 'application/json'));\n  const defaultType = successTypes.find(\n    (t) => t.contentType === defaultContentType,\n  );\n\n  return {\n    contentType: defaultContentType,\n    value: defaultType?.value ?? fallback,\n  };\n}\n","import {\n  buildAngularParamsFilterExpression,\n  type ClientBuilder,\n  type ClientDependenciesBuilder,\n  type ClientFooterBuilder,\n  type ClientHeaderBuilder,\n  type ContextSpec,\n  type GeneratorImport,\n  type NormalizedOutputOptions,\n  emitResponseValidation,\n  generateBodyOptions,\n  generateFormDataAndUrlEncodedFunction,\n  generateMutatorConfig,\n  generateMutatorRequestOptions,\n  generateOptions,\n  generateVerbImports,\n  type GeneratorVerbOptions,\n  getAngularFilteredParamsHelperBody,\n  getAngularObjectParamStrategies,\n  getDefaultContentType,\n  getEnumImplementation,\n  getIsBodyVerb,\n  type GetterProp,\n  GetterPropType,\n  isBoolean,\n  jsStringLiteralEscape,\n  makeRouteSafe,\n  pascal,\n  toObjectString,\n  type EnumMember,\n  EnumGeneration,\n} from '@orval/core';\n\nimport {\n  getAngularBaseUrlImportSpecifier,\n  getBaseUrlTokenName,\n} from './base-url';\nimport { ANGULAR_HTTP_CLIENT_DEPENDENCIES } from './constants';\nimport {\n  HTTP_CLIENT_OBSERVE_OPTIONS_TEMPLATE,\n  HTTP_CLIENT_OPTIONS_TEMPLATE,\n  THIRD_PARAMETER_TEMPLATE,\n} from './types';\nimport {\n  createReturnTypesRegistry,\n  getRelevantVerbOptionsForTag,\n  getSchemaOutputTypeRef,\n  isPrimitiveType,\n  isZodSchemaOutput,\n} from './utils';\n\n/**\n * Narrowed context for `generateHttpClientImplementation`.\n *\n * The implementation only reads `context.output`, so callers don't need\n * to supply a full `ContextSpec` (which also requires `target`, `workspace`,\n * `spec`, etc.).\n *\n * @remarks\n * This keeps the call sites lightweight when `http-resource.ts` delegates\n * mutation generation back to the shared `HttpClient` implementation builder.\n */\nexport interface HttpClientGeneratorContext {\n  route: string;\n  context: Pick<ContextSpec, 'output'>;\n}\n\n// NOTE: Module-level singleton — reset() is called at the start of each\n// header builder invocation (generateAngularHeader). Must stay in sync with\n// the generation lifecycle.\nconst returnTypesRegistry = createReturnTypesRegistry();\n\nconst hasSchemaImport = (\n  imports: readonly { name: string }[],\n  typeName: string | undefined,\n): boolean =>\n  typeName != undefined && imports.some((imp) => imp.name === typeName);\n\nconst getSchemaValueRef = (typeName: string): string =>\n  typeName === 'Error' ? 'ErrorSchema' : typeName;\n\n/**\n * Partition props into the three buckets used by per-content-type overload\n * rendering: required non-body params, body params, and optional non-body\n * params. The body always sits between the required and optional non-body\n * params so that the per-content-type overloads can insert a required\n * `accept` literal immediately after the body without violating TS1016\n * (required parameter cannot follow an optional one).\n */\nconst partitionPropsForMultiContent = (\n  props: readonly GetterProp[],\n): {\n  requiredNonBody: GetterProp[];\n  body: GetterProp[];\n  optionalNonBody: GetterProp[];\n} => {\n  const requiredNonBody: GetterProp[] = [];\n  const body: GetterProp[] = [];\n  const optionalNonBody: GetterProp[] = [];\n  for (const p of props) {\n    if (p.type === GetterPropType.BODY) {\n      body.push(p);\n    } else if (p.required && !p.default) {\n      requiredNonBody.push(p);\n    } else {\n      optionalNonBody.push(p);\n    }\n  }\n  return { requiredNonBody, body, optionalNonBody };\n};\n\nconst getContentTypeReturnType = (\n  contentType: string | undefined,\n  value: string,\n): string => {\n  if (!contentType) return value;\n  if (contentType.includes('json') || contentType.includes('+json')) {\n    return value;\n  }\n  if (contentType.startsWith('text/') || contentType.includes('xml')) {\n    return 'string';\n  }\n  return 'Blob';\n};\n\n/**\n * Returns the dependency list required by the Angular `HttpClient` generator.\n *\n * These imports are consumed by Orval's generic dependency-import emitter when\n * composing the generated Angular client file.\n *\n * @returns The Angular `HttpClient` dependency descriptors used during import generation.\n */\nexport const getAngularDependencies: ClientDependenciesBuilder = () => [\n  ...ANGULAR_HTTP_CLIENT_DEPENDENCIES,\n];\n\n/**\n * Builds the generated TypeScript helper name used for multi-content-type\n * `Accept` header unions.\n *\n * Example: `listPets` -> `ListPetsAccept`.\n *\n * @returns A PascalCase helper type/const name for the operation's `Accept` values.\n */\nexport const getAcceptHelperName = (typeName: string) =>\n  `${pascal(typeName)}Accept`;\n\n/**\n * Collects the distinct successful response content types for a single\n * operation.\n *\n * The Angular generators use this to decide whether they need `Accept`\n * overloads or content-type-specific branching logic.\n *\n * @returns A de-duplicated list of response content types, excluding empty entries.\n */\nexport const getUniqueContentTypes = (\n  successTypes: GeneratorVerbOptions['response']['types']['success'],\n) => [...new Set(successTypes.map((t) => t.contentType).filter(Boolean))];\n\nconst toAcceptHelperKey = (contentType: string): string =>\n  contentType\n    .replaceAll(/[^A-Za-z0-9]+/g, '_')\n    .replaceAll(/^_+|_+$/g, '')\n    .toLowerCase();\n\nconst buildAcceptHelper = (\n  typeName: string,\n  contentTypes: string[],\n  output: ContextSpec['output'],\n): string => {\n  const acceptHelperName = getAcceptHelperName(typeName);\n\n  const enumMembers: EnumMember[] = contentTypes.map((contentType) => ({\n    value: contentType,\n    name: toAcceptHelperKey(contentType),\n  }));\n\n  const implementation = getEnumImplementation(enumMembers, {\n    enumNamingConvention: output.override.namingConvention.enum,\n    enumGenerationType: EnumGeneration.CONST,\n  });\n\n  return `export type ${acceptHelperName} = typeof ${acceptHelperName}[keyof typeof ${acceptHelperName}];\n  \nexport const ${acceptHelperName} = {\n${implementation}} as const;`;\n};\n\n/**\n * Builds the shared `Accept` helper declarations for all operations in the\n * current Angular generation scope.\n *\n * @remarks\n * Helpers are emitted only for operations with more than one successful\n * response content type.\n *\n * @returns Concatenated type/const declarations or an empty string when no helpers are needed.\n */\nexport const buildAcceptHelpers = (\n  verbOptions: readonly GeneratorVerbOptions[],\n  output: ContextSpec['output'],\n): string =>\n  verbOptions\n    .flatMap((verbOption) => {\n      const contentTypes = getUniqueContentTypes(\n        verbOption.response.types.success,\n      );\n      if (contentTypes.length <= 1) return [];\n\n      return [buildAcceptHelper(verbOption.typeName, contentTypes, output)];\n    })\n    .join('\\n\\n');\n\n/**\n * Generates the static header section for Angular `HttpClient` output.\n *\n * Depending on the current generation options this may include:\n * - reusable request option helper types\n * - filtered query-param helper utilities\n * - mutator support types\n * - `Accept` helper unions/constants for multi-content-type operations\n * - the `@Injectable()` service class shell\n *\n * @returns A string containing the prelude and service class opening for the generated file.\n */\nexport const generateAngularHeader: ClientHeaderBuilder = ({\n  title,\n  isRequestOptions,\n  isMutator,\n  isGlobalMutator,\n  provideIn,\n  verbOptions,\n  tag,\n  output,\n}) => {\n  returnTypesRegistry.reset();\n\n  const relevantVerbs = getRelevantVerbOptionsForTag(verbOptions, tag);\n  // Only emit the shared `filterParams` helper when at least one operation in\n  // this file will actually call it. If every operation with queryParams has\n  // its own `paramsFilter` mutator, the helper would be dead code.\n  const hasBuiltInFilteredQueryParams = relevantVerbs.some(\n    (v) => v.queryParams && !v.paramsFilter,\n  );\n  // The helper only needs the object-serialization overload (issue #3705)\n  // when at least one relevant operation actually has a gated strategy to\n  // apply — keeping the base helper byte-identical everywhere else.\n  const hasObjectParams = relevantVerbs.some(\n    (v) =>\n      Object.keys(\n        getAngularObjectParamStrategies({\n          queryParams: v.queryParams,\n          paramsSerializer: v.paramsSerializer,\n          paramsFilter: v.paramsFilter,\n          queryObjectSerialization: v.override.angular.queryObjectSerialization,\n        }),\n      ).length > 0,\n  );\n  const acceptHelpers = buildAcceptHelpers(relevantVerbs, output);\n\n  return `\n${\n  isRequestOptions && !isGlobalMutator\n    ? `${HTTP_CLIENT_OPTIONS_TEMPLATE}\n\n${HTTP_CLIENT_OBSERVE_OPTIONS_TEMPLATE}\n\n${hasBuiltInFilteredQueryParams ? getAngularFilteredParamsHelperBody({ hasObjectParams }) : ''}`\n    : ''\n}\n\n${isRequestOptions && isMutator ? THIRD_PARAMETER_TEMPLATE : ''}\n\n${acceptHelpers}\n\n@Injectable(${provideIn ? `{ providedIn: '${isBoolean(provideIn) ? 'root' : provideIn}' }` : ''})\nexport class ${title} {\n  private readonly http = inject(HttpClient);\n${\n  output.override.angular.baseUrl\n    ? `  private readonly baseUrl = inject(${getBaseUrlTokenName(output.override.angular.baseUrl.apiId)});\n`\n    : ''\n}`;\n};\n\n/**\n * Generates the closing section for Angular `HttpClient` output.\n *\n * @remarks\n * Besides closing the generated service class, this appends any collected\n * `ClientResult` aliases registered while individual operations were emitted.\n *\n * @returns The footer text for the generated Angular client file.\n */\nexport const generateAngularFooter: ClientFooterBuilder = ({\n  operationNames,\n}) => {\n  let footer = '};\\n\\n';\n\n  const returnTypes = returnTypesRegistry.getFooter(operationNames);\n  if (returnTypes) {\n    footer += `${returnTypes}\\n`;\n  }\n\n  return footer;\n};\n\n/**\n * Generates the Angular `HttpClient` method implementation for a single\n * OpenAPI operation.\n *\n * This function is responsible for:\n * - method signatures and overloads\n * - observe-mode branching\n * - multi-content-type `Accept` handling\n * - mutator integration\n * - runtime Zod validation hooks for Angular output\n * - registering the operation's `ClientResult` alias for footer emission\n *\n * @remarks\n * This is the central implementation builder shared by the dedicated\n * `httpClient` mode and the mutation side of Angular `both` / `httpResource`\n * generation.\n *\n * @returns The complete TypeScript method declaration and implementation for the operation.\n */\nexport const generateHttpClientImplementation = (\n  {\n    headers,\n    queryParams,\n    operationName,\n    typeName,\n    response,\n    mutator,\n    body,\n    props,\n    verb,\n    override,\n    formData,\n    formUrlEncoded,\n    paramsSerializer,\n    paramsFilter,\n    params,\n  }: GeneratorVerbOptions,\n  { route: _route, context }: HttpClientGeneratorContext,\n) => {\n  // Opt-in URL-encoding of path parameters (`urlEncodeParameters`), applied once\n  // at the single point the route enters this builder so the mutator config and\n  // every inline interpolation below stay consistent. `makeRouteSafe` is not\n  // idempotent — applying it more than once double-encodes — so it must run here\n  // exactly once and nowhere downstream.\n  let route = _route;\n  if (context.output.urlEncodeParameters) {\n    const skip = new Set(\n      params.filter((p) => p.allowReserved).map((p) => p.name),\n    );\n    route = makeRouteSafe(route, skip);\n  }\n  // MUST run after the urlEncodeParameters/makeRouteSafe step above:\n  // wrapRouteParameters (invoked by makeRouteSafe) rewrites every `${...}`\n  // segment of the route, so prefixing before it would wrap `this.baseUrl`\n  // in `encodeURIComponent(String(...))`.\n  if (context.output.override.angular.baseUrl) {\n    route = '${this.baseUrl}' + route;\n  }\n\n  const isRequestOptions = override.requestOptions !== false;\n  const isFormData = !override.formData.disabled;\n  const isFormUrlEncoded = override.formUrlEncoded !== false;\n  const isExactOptionalPropertyTypes =\n    !!context.output.tsconfig?.compilerOptions?.exactOptionalPropertyTypes;\n  const bodyForm = generateFormDataAndUrlEncodedFunction({\n    formData,\n    formUrlEncoded,\n    body,\n    isFormData,\n    isFormUrlEncoded,\n  });\n\n  const dataType = response.definition.success || 'unknown';\n  const isPrimitive = isPrimitiveType(dataType);\n  const hasSchema = hasSchemaImport(response.imports, dataType);\n  const isZodOutput = isZodSchemaOutput(context.output);\n  const shouldValidateResponse =\n    override.angular.runtimeValidation.enabled &&\n    isZodOutput &&\n    !isPrimitive &&\n    hasSchema;\n  const parsedDataType = shouldValidateResponse\n    ? getSchemaOutputTypeRef(dataType)\n    : dataType;\n  const getGeneratedResponseType = (\n    value: string,\n    contentType: string | undefined,\n  ): string => {\n    if (\n      override.angular.runtimeValidation.enabled &&\n      isZodOutput &&\n      !!contentType &&\n      (contentType.includes('json') || contentType.includes('+json')) &&\n      !isPrimitiveType(value) &&\n      hasSchemaImport(response.imports, value)\n    ) {\n      return getSchemaOutputTypeRef(value);\n    }\n\n    return getContentTypeReturnType(contentType, value);\n  };\n  const resultAliasType = mutator\n    ? dataType\n    : response.types.success.length <= 1\n      ? parsedDataType\n      : [\n          ...new Set(\n            response.types.success.map(({ value, contentType }) =>\n              getGeneratedResponseType(value, contentType),\n            ),\n          ),\n        ].join(' | ') || parsedDataType;\n  const schemaValueRef = shouldValidateResponse\n    ? getSchemaValueRef(dataType)\n    : dataType;\n  // When Zod runtime validation is enabled the emitted method signature exposes\n  // `parsedDataType` (e.g. `PetsOutput`) directly instead of a caller-overridable\n  // `TData` generic. Casting `Schema.parse(data)` to `TData` is unsound because\n  // `TData` can be widened/narrowed by callers while the runtime value is always\n  // `PetsOutput`. We therefore drop the cast on the validation path and let the\n  // inferred return type flow naturally.\n  const validationStrategy = override.angular.runtimeValidation.strategy;\n  const validationPipe = shouldValidateResponse\n    ? emitResponseValidation({\n        schemaRef: schemaValueRef,\n        operationName,\n        strategy: validationStrategy,\n        context: 'rxjs-map',\n      })\n    : '';\n  const responseValidationPipe = shouldValidateResponse\n    ? `.pipe(map(response => response.clone({ body: ${emitResponseValidation({\n        schemaRef: schemaValueRef,\n        operationName,\n        strategy: validationStrategy,\n        context: 'clone-expression',\n        inputExpression: 'response.body',\n      })} })))`\n    : '';\n  const eventValidationPipe = shouldValidateResponse\n    ? `.pipe(map(event => event instanceof AngularHttpResponse ? event.clone({ body: ${emitResponseValidation(\n        {\n          schemaRef: schemaValueRef,\n          operationName,\n          strategy: validationStrategy,\n          context: 'clone-expression',\n          inputExpression: 'event.body',\n        },\n      )} }) : event))`\n    : '';\n\n  returnTypesRegistry.set(\n    operationName,\n    `export type ${pascal(\n      typeName,\n    )}ClientResult = NonNullable<${resultAliasType}>`,\n  );\n\n  if (mutator) {\n    const mutatorConfig = generateMutatorConfig({\n      route,\n      body,\n      headers,\n      queryParams,\n      response,\n      verb,\n      isFormData,\n      isFormUrlEncoded,\n      hasSignal: false,\n      isExactOptionalPropertyTypes,\n      isAngular: true,\n      paramsFilter,\n    });\n\n    const requestOptions = isRequestOptions\n      ? generateMutatorRequestOptions(\n          override.requestOptions,\n          mutator.hasThirdArg,\n        )\n      : '';\n\n    const propsImplementation =\n      mutator.bodyTypeName && body.definition\n        ? toObjectString(props, 'implementation').replace(\n            new RegExp(String.raw`(\\\\w*):\\\\s?${body.definition}`),\n            `$1: ${mutator.bodyTypeName}<${body.definition}>`,\n          )\n        : toObjectString(props, 'implementation');\n\n    return ` ${operationName}<TData = ${dataType}>(\\n    ${propsImplementation}\\n ${\n      isRequestOptions && mutator.hasThirdArg\n        ? `options?: ThirdParameter<typeof ${mutator.name}>`\n        : ''\n    }) {${bodyForm}\n      return ${mutator.name}<TData>(\n      ${mutatorConfig},\n      this.http,\n      ${requestOptions});\n    }\n  `;\n  }\n\n  // Object-typed query param serialization (issue #3705), already gated for\n  // `override.angular.queryObjectSerialization`, `paramsFilter`, and\n  // `paramsSerializer` — computed once and forwarded verbatim everywhere a\n  // filter expression is built below.\n  const objectParamStrategies = getAngularObjectParamStrategies({\n    queryParams,\n    paramsSerializer,\n    paramsFilter,\n    queryObjectSerialization: override.angular.queryObjectSerialization,\n  });\n\n  const optionsBase = {\n    route,\n    body,\n    headers,\n    queryParams,\n    objectQueryParamStrategies: objectParamStrategies,\n    response,\n    verb,\n    requestOptions: override.requestOptions,\n    isFormData,\n    isFormUrlEncoded,\n    paramsSerializer,\n    paramsSerializerOptions: override.paramsSerializerOptions,\n    paramsFilter,\n    isAngular: true,\n    isExactOptionalPropertyTypes,\n    hasSignal: false,\n  } as const;\n\n  const propsDefinition = toObjectString(props, 'definition');\n\n  const successTypes = response.types.success;\n  const uniqueContentTypes = getUniqueContentTypes(successTypes);\n  const hasMultipleContentTypes = uniqueContentTypes.length > 1;\n  const acceptTypeName = hasMultipleContentTypes\n    ? getAcceptHelperName(typeName)\n    : undefined;\n\n  const needsObserveBranching = isRequestOptions && !hasMultipleContentTypes;\n  const angularParamsRef = queryParams ? 'filteredParams' : undefined;\n\n  let paramsDeclaration = '';\n  if (angularParamsRef && queryParams) {\n    const filterExpr = buildAngularParamsFilterExpression({\n      paramsExpression: isRequestOptions\n        ? '{...params, ...options?.params}'\n        : 'params ?? {}',\n      requiredNullableParamKeys: queryParams.requiredNullableKeys ?? [],\n      preserveRequiredNullables: !!paramsSerializer,\n      // Only pass non-primitive params through the built-in `filterParams`\n      // when a `paramsSerializer` can legally consume the raw object/array.\n      // Without one, Angular's `HttpParams` would stringify it to\n      // `[object Object]` and the helper's `unknown` return type is not\n      // assignable to `HttpClient`'s params — so keep them filtered out.\n      // The `paramsFilter` branch bypasses the built-in helper entirely.\n      nonPrimitiveKeys: paramsSerializer\n        ? (queryParams.nonPrimitiveKeys ?? [])\n        : [],\n      objectParamStrategies,\n      paramsFilter,\n      // Request-options path uses the shared `filterParams` helper emitted in\n      // the file header; the non-request-options path inlines an IIFE.\n      useSharedHelper: isRequestOptions,\n    });\n    paramsDeclaration = paramsSerializer\n      ? `const ${angularParamsRef} = ${paramsSerializer.name}(${filterExpr});\\n\\n    `\n      : `const ${angularParamsRef} = ${filterExpr};\\n\\n    `;\n  }\n\n  const optionsInput = {\n    ...optionsBase,\n    ...(angularParamsRef ? { angularParamsRef } : {}),\n  } as const;\n\n  const options = generateOptions(optionsInput);\n\n  const defaultContentType = hasMultipleContentTypes\n    ? (successTypes.find(\n        ({ contentType }) =>\n          !!contentType &&\n          (contentType.includes('json') || contentType.includes('+json')),\n      )?.contentType ?? getDefaultContentType(uniqueContentTypes))\n    : (uniqueContentTypes[0] ?? 'application/json');\n\n  const jsonSuccessValues = [\n    ...new Set(\n      successTypes\n        .filter(\n          ({ contentType }) =>\n            !!contentType &&\n            (contentType.includes('json') || contentType.includes('+json')),\n        )\n        .map(({ value }) => value),\n    ),\n  ];\n\n  const jsonReturnType =\n    jsonSuccessValues.length > 0 ? jsonSuccessValues.join(' | ') : 'unknown';\n  const parsedJsonReturnType =\n    jsonSuccessValues.length === 1 &&\n    override.angular.runtimeValidation.enabled &&\n    isZodOutput &&\n    !isPrimitiveType(jsonSuccessValues[0]) &&\n    hasSchemaImport(response.imports, jsonSuccessValues[0])\n      ? getSchemaOutputTypeRef(jsonSuccessValues[0])\n      : jsonReturnType;\n\n  let jsonValidationPipe = shouldValidateResponse\n    ? emitResponseValidation({\n        schemaRef: schemaValueRef,\n        operationName,\n        strategy: validationStrategy,\n        context: 'rxjs-map',\n      })\n    : '';\n  if (\n    hasMultipleContentTypes &&\n    !shouldValidateResponse &&\n    override.angular.runtimeValidation.enabled &&\n    isZodOutput &&\n    jsonSuccessValues.length === 1\n  ) {\n    const jsonType = jsonSuccessValues[0];\n    const jsonIsPrimitive = isPrimitiveType(jsonType);\n    const jsonHasSchema = hasSchemaImport(response.imports, jsonType);\n    if (!jsonIsPrimitive && jsonHasSchema) {\n      const jsonSchemaRef = getSchemaValueRef(jsonType);\n      jsonValidationPipe = emitResponseValidation({\n        schemaRef: jsonSchemaRef,\n        operationName,\n        strategy: validationStrategy,\n        context: 'rxjs-map',\n      });\n    }\n  }\n\n  const textSuccessTypes = successTypes.filter(\n    ({ contentType, value }) =>\n      !!contentType &&\n      (contentType.startsWith('text/') ||\n        contentType.includes('xml') ||\n        value === 'string'),\n  );\n  const blobSuccessTypes = successTypes.filter(\n    ({ contentType }) =>\n      !!contentType &&\n      !contentType.includes('json') &&\n      !contentType.includes('+json') &&\n      !contentType.startsWith('text/') &&\n      !contentType.includes('xml'),\n  );\n  const multiReturnMembers = [\n    parsedJsonReturnType,\n    ...(textSuccessTypes.length > 0 ? ['string'] : []),\n    ...(blobSuccessTypes.length > 0 ? ['Blob'] : []),\n  ];\n  const uniqueMultiReturnMembers = [...new Set(multiReturnMembers)];\n  const refinedMultiImplementationReturnType = `Observable<${uniqueMultiReturnMembers.join(' | ')}>`;\n\n  const observeOptions = needsObserveBranching\n    ? {\n        body: generateOptions({ ...optionsInput, angularObserve: 'body' }),\n        events: generateOptions({ ...optionsInput, angularObserve: 'events' }),\n        response: generateOptions({\n          ...optionsInput,\n          angularObserve: 'response',\n        }),\n      }\n    : undefined;\n\n  const isModelType =\n    dataType !== 'Blob' && dataType !== 'string' && dataType !== 'ArrayBuffer';\n  // When the response goes through a Zod runtime validation pipe the runtime\n  // value is fixed to `parsedDataType` (e.g. `PetsOutput`), so we avoid\n  // exposing a caller-overridable `<TData>` generic on that path.\n  const hasTDataGeneric =\n    isModelType && !hasMultipleContentTypes && !shouldValidateResponse;\n  let functionName = operationName;\n  if (hasTDataGeneric) {\n    functionName += `<TData = ${parsedDataType}>`;\n  }\n\n  let contentTypeOverloads = '';\n  if (hasMultipleContentTypes && isRequestOptions) {\n    const {\n      requiredNonBody: requiredNonBodyProps,\n      body: bodyProps,\n      optionalNonBody: optionalNonBodyProps,\n    } = partitionPropsForMultiContent(props);\n    const requiredNonBodyPart = requiredNonBodyProps\n      .map((p) => p.definition)\n      .join(',\\n    ');\n    const bodyPart = bodyProps.map((p) => p.definition).join(',\\n    ');\n    // Per-content-type overloads have a required `accept` literal after the body.\n    // TS1016 forbids required params after optional ones, so optional body params\n    // are rendered as positionally required (`name: Type | undefined`) here.\n    // The `?` is removed via an identifier-anchored replacement so we only\n    // affect the parameter's own optional marker, never a `?:` that may appear\n    // elsewhere in the type (e.g. mapped or conditional types).\n    const bodyOverloadPart = bodyProps\n      .map((p) => {\n        const optionalMarker = `${p.name}?:`;\n        if (!p.required && p.definition.startsWith(optionalMarker)) {\n          const required = `${p.name}:${p.definition.slice(optionalMarker.length)}`;\n          return /\\bundefined\\b/.test(required)\n            ? required\n            : `${required} | undefined`;\n        }\n        return p.definition;\n      })\n      .join(',\\n    ');\n    const optionalNonBodyPart = optionalNonBodyProps\n      .map((p) => p.definition)\n      .join(',\\n    ');\n    const branchOverloads = successTypes\n      .filter(({ contentType }) => !!contentType)\n      .map(({ contentType, value }) => {\n        const returnType = getGeneratedResponseType(value, contentType);\n        const overloadParams = [\n          requiredNonBodyPart,\n          bodyOverloadPart,\n          `accept: '${jsStringLiteralEscape(contentType ?? '')}'`,\n          optionalNonBodyPart,\n        ]\n          .filter(Boolean)\n          .join(',\\n    ');\n\n        return `${operationName}(${overloadParams}, options?: HttpClientOptions): Observable<${returnType}>;`;\n      })\n      .join('\\n  ');\n    const allParams = [\n      requiredNonBodyPart,\n      bodyPart,\n      `accept?: ${acceptTypeName ?? 'string'}`,\n      optionalNonBodyPart,\n    ]\n      .filter(Boolean)\n      .join(',\\n    ');\n    contentTypeOverloads = `${branchOverloads}\\n  ${operationName}(${allParams}, options?: HttpClientOptions): ${refinedMultiImplementationReturnType};`;\n  }\n\n  const observeOverloads =\n    isRequestOptions && !hasMultipleContentTypes\n      ? `${functionName}(${propsDefinition} options?: HttpClientBodyOptions): Observable<${hasTDataGeneric ? 'TData' : parsedDataType}>;\\n ${functionName}(${propsDefinition} options?: HttpClientEventOptions): Observable<HttpEvent<${hasTDataGeneric ? 'TData' : parsedDataType}>>;\\n ${functionName}(${propsDefinition} options?: HttpClientResponseOptions): Observable<AngularHttpResponse<${hasTDataGeneric ? 'TData' : parsedDataType}>>;`\n      : '';\n\n  const overloads = contentTypeOverloads || observeOverloads;\n\n  const observableDataType = hasTDataGeneric ? 'TData' : parsedDataType;\n  const singleImplementationReturnType = isRequestOptions\n    ? `Observable<${observableDataType} | HttpEvent<${observableDataType}> | AngularHttpResponse<${observableDataType}>>`\n    : `Observable<${observableDataType}>`;\n\n  if (hasMultipleContentTypes) {\n    const bodyIdentifier = generateBodyOptions(\n      body,\n      isFormData,\n      isFormUrlEncoded,\n    );\n    const deleteBodyOption =\n      verb === 'delete' && bodyIdentifier ? `body: ${bodyIdentifier}` : '';\n    const buildOptionsObject = (responseType: string) => `{\n        ...options,\n        responseType: '${responseType}',\n        headers,\n        ${angularParamsRef ? `params: ${angularParamsRef},` : ''}\n        ${deleteBodyOption ? `${deleteBodyOption},` : ''}\n      }`;\n    const buildHttpClientCall = (typeArg: string, optionsObject: string) =>\n      getIsBodyVerb(verb) && verb !== 'delete'\n        ? `this.http.${verb}${typeArg}(\\`${route}\\`, ${bodyIdentifier ?? 'undefined'}, ${optionsObject})`\n        : `this.http.${verb}${typeArg}(\\`${route}\\`, ${optionsObject})`;\n\n    const {\n      requiredNonBody: requiredNonBodyImplProps,\n      body: bodyImplProps,\n      optionalNonBody: optionalNonBodyImplProps,\n    } = partitionPropsForMultiContent(props);\n    const requiredNonBodyImplPart = requiredNonBodyImplProps\n      .map((p) => p.implementation)\n      .join(',\\n    ');\n    const bodyImplPart = bodyImplProps\n      .map((p) => p.implementation)\n      .join(',\\n    ');\n    const optionalNonBodyImplPart = optionalNonBodyImplProps\n      .map((p) => p.implementation)\n      .join(',\\n    ');\n    const allParams = [\n      requiredNonBodyImplPart,\n      bodyImplPart,\n      `accept: ${acceptTypeName ?? 'string'} = '${jsStringLiteralEscape(\n        defaultContentType,\n      )}'`,\n      optionalNonBodyImplPart,\n    ]\n      .filter(Boolean)\n      .join(',\\n    ');\n\n    return ` ${overloads}\n  ${operationName}(\n    ${allParams},\n    ${isRequestOptions ? 'options?: HttpClientOptions' : ''}\n  ): ${refinedMultiImplementationReturnType} {${bodyForm}\n    ${paramsDeclaration}const headers = options?.headers instanceof HttpHeaders\n      ? options.headers.set('Accept', accept)\n      : { ...(options?.headers ?? {}), Accept: accept };\n\n    if (accept.includes('json') || accept.includes('+json')) {\n      return ${buildHttpClientCall(`<${parsedJsonReturnType}>`, buildOptionsObject('json'))}${jsonValidationPipe};\n    }${\n      textSuccessTypes.length > 0\n        ? ` else if (accept.startsWith('text/') || accept.includes('xml')) {\n      return ${buildHttpClientCall('', buildOptionsObject('text'))} as Observable<string>;\n    }`\n        : ''\n    }${\n      blobSuccessTypes.length > 0\n        ? ` else {\n      return ${buildHttpClientCall('', buildOptionsObject('blob'))} as Observable<Blob>;\n    }`\n        : `\n\n    return ${buildHttpClientCall(`<${parsedJsonReturnType}>`, buildOptionsObject('json'))}${jsonValidationPipe};`\n    }\n  }\n`;\n  }\n\n  // Angular's HttpClient overloads conflict when both a type generic and an\n  // injected `responseType` (e.g. `'blob'` / `'text'`) are present — omit the\n  // generic and cast instead. JSON primitives still need `<string>` (etc.) because\n  // they use the default JSON overload without a custom `responseType`.\n  const hasInjectedResponseType = (optionsArgument: string) =>\n    typeof optionsArgument === 'string' &&\n    /\\bresponseType:\\s*['\"]/.test(optionsArgument);\n  const httpCallExpr = (\n    optionsArgument: string,\n    observeKind: 'body' | 'events' | 'response',\n  ) => {\n    if (hasInjectedResponseType(optionsArgument)) {\n      const castType =\n        observeKind === 'events'\n          ? `HttpEvent<${observableDataType}>`\n          : observeKind === 'response'\n            ? `AngularHttpResponse<${observableDataType}>`\n            : observableDataType;\n      return `this.http.${verb}(${optionsArgument}) as Observable<${castType}>`;\n    }\n\n    return `this.http.${verb}<${observableDataType}>(${optionsArgument})`;\n  };\n  const observeImplementation = isRequestOptions\n    ? `${paramsDeclaration}if (options?.observe === 'events') {\n      return ${httpCallExpr(observeOptions?.events ?? options, 'events')}${eventValidationPipe};\n    }\n\n    if (options?.observe === 'response') {\n      return ${httpCallExpr(observeOptions?.response ?? options, 'response')}${responseValidationPipe};\n    }\n\n    return ${httpCallExpr(observeOptions?.body ?? options, 'body')}${validationPipe};`\n    : `return ${httpCallExpr(options, 'body')}${validationPipe};`;\n\n  return ` ${overloads}\n  ${functionName}(\n    ${toObjectString(props, 'implementation')} ${\n      isRequestOptions ? `options?: HttpClientObserveOptions` : ''\n    }): ${singleImplementationReturnType} {${bodyForm}\n    ${observeImplementation}\n  }\n`;\n};\n\nconst ANGULAR_HTTP_IMPORT_PATH = '@angular/common/http';\n\n/**\n * Whether the rendered HttpClient method narrows `HttpEvent`s with\n * `instanceof AngularHttpResponse`. Mirrors `generateHttpClientImplementation`:\n * the `observe` branches exist only with request options and a single content\n * type, and the narrowing is part of the runtime-validation pipe. Lets callers\n * decide the `HttpResponse` import without rendering the method, which would\n * also register its `ClientResult` alias ahead of the footer.\n */\nexport const narrowsResponseEvents = (\n  { response, override }: Pick<GeneratorVerbOptions, 'response' | 'override'>,\n  output: NormalizedOutputOptions,\n): boolean => {\n  const dataType = response.definition.success || 'unknown';\n  const hasMultipleContentTypes =\n    getUniqueContentTypes(response.types.success).length > 1;\n  return (\n    override.requestOptions !== false &&\n    !hasMultipleContentTypes &&\n    override.angular.runtimeValidation.enabled &&\n    isZodSchemaOutput(output) &&\n    !isPrimitiveType(dataType) &&\n    hasSchemaImport(response.imports, dataType)\n  );\n};\n\n/**\n * An `@angular/common/http` import that is a value only when `isValue`,\n * otherwise type-only. A value import of a binding that is only used as a\n * type fails `consistent-type-imports` in a consumer's lint setup (#3932).\n */\nconst angularHttpImport = (\n  binding: Pick<GeneratorImport, 'name' | 'alias'>,\n  isValue: boolean,\n): GeneratorImport => ({\n  ...binding,\n  importPath: ANGULAR_HTTP_IMPORT_PATH,\n  ...(isValue ? { values: true } : {}),\n});\n\n/** `HttpResponse` (aliased `AngularHttpResponse`), a value only where events are narrowed. */\nexport const getAngularHttpResponseImport = (\n  narrowsEvents: boolean,\n): GeneratorImport =>\n  angularHttpImport(\n    { name: 'HttpResponse', alias: 'AngularHttpResponse' },\n    narrowsEvents,\n  );\n\n/**\n * The `@angular/common/http` bindings whose value-or-type status depends on\n * the operation: `HttpHeaders` (multi-content `Accept` dispatch narrows on it\n * in the rendered body) and `HttpResponse` (see `narrowsResponseEvents`).\n */\nexport const getAngularHttpImports = (\n  implementation: string,\n  narrowsEvents: boolean,\n): GeneratorImport[] => [\n  angularHttpImport(\n    { name: 'HttpHeaders' },\n    implementation.includes('instanceof HttpHeaders'),\n  ),\n  getAngularHttpResponseImport(narrowsEvents),\n];\n\n/**\n * Orval client builder entry point for Angular `HttpClient` output.\n *\n * It normalizes imports needed for runtime validation, delegates the actual\n * method implementation to `generateHttpClientImplementation`, and returns the\n * generated code plus imports for the current operation.\n *\n * @returns The generated implementation fragment and imports for one operation.\n */\nexport const generateAngular: ClientBuilder = (verbOptions, options) => {\n  const isZodOutput = isZodSchemaOutput(options.context.output);\n  const responseType = verbOptions.response.definition.success;\n  const isPrimitiveResponse = isPrimitiveType(responseType);\n  const shouldUseRuntimeValidation =\n    verbOptions.override.angular.runtimeValidation.enabled && isZodOutput;\n\n  const normalizedVerbOptions = (() => {\n    if (!shouldUseRuntimeValidation) return verbOptions;\n\n    let result: GeneratorVerbOptions = {\n      ...verbOptions,\n      response: {\n        ...verbOptions.response,\n        imports: verbOptions.response.imports.map((imp) => ({\n          ...imp,\n          values: true,\n        })),\n      },\n    };\n\n    if (\n      !isPrimitiveResponse &&\n      hasSchemaImport(result.response.imports, responseType)\n    ) {\n      result = {\n        ...result,\n        response: {\n          ...result.response,\n          imports: [\n            ...result.response.imports.map((imp) =>\n              imp.name === responseType ? { ...imp, values: true } : imp,\n            ),\n            { name: getSchemaOutputTypeRef(responseType) },\n          ],\n        },\n      };\n    }\n\n    const successTypes = result.response.types.success;\n    const uniqueContentTypes = [\n      ...new Set(successTypes.map((t) => t.contentType).filter(Boolean)),\n    ];\n    if (uniqueContentTypes.length > 1) {\n      const jsonSchemaNames = [\n        ...new Set(\n          successTypes\n            .filter(\n              ({ contentType }) =>\n                !!contentType &&\n                (contentType.includes('json') || contentType.includes('+json')),\n            )\n            .map(({ value }) => value),\n        ),\n      ];\n      if (jsonSchemaNames.length === 1) {\n        const jsonType = jsonSchemaNames[0];\n        const jsonIsPrimitive = isPrimitiveType(jsonType);\n        if (\n          !jsonIsPrimitive &&\n          hasSchemaImport(result.response.imports, jsonType)\n        ) {\n          result = {\n            ...result,\n            response: {\n              ...result.response,\n              imports: [\n                ...result.response.imports.map((imp) =>\n                  imp.name === jsonType ? { ...imp, values: true } : imp,\n                ),\n                { name: getSchemaOutputTypeRef(jsonType) },\n              ],\n            },\n          };\n        }\n      }\n    }\n\n    return result;\n  })();\n\n  const implementation = generateHttpClientImplementation(\n    normalizedVerbOptions,\n    options,\n  );\n\n  const baseUrl = options.context.output.override.angular.baseUrl;\n\n  const imports = [\n    ...generateVerbImports(normalizedVerbOptions),\n    ...getAngularHttpImports(\n      implementation,\n      narrowsResponseEvents(normalizedVerbOptions, options.context.output),\n    ),\n    ...(implementation.includes('.pipe(map(')\n      ? [{ name: 'map', values: true, importPath: 'rxjs' }]\n      : []),\n    ...(baseUrl\n      ? [\n          {\n            name: getBaseUrlTokenName(baseUrl.apiId),\n            values: true,\n            importPath: getAngularBaseUrlImportSpecifier(\n              options.context.output,\n            ),\n          },\n        ]\n      : []),\n  ];\n\n  return { implementation, imports };\n};\n\n/**\n * Returns the footer aliases collected for the provided operation names.\n *\n * The Angular generators use these aliases to expose stable `ClientResult`\n * helper types such as `ListPetsClientResult`.\n *\n * @returns Concatenated `ClientResult` aliases for the requested operation names.\n */\nexport const getHttpClientReturnTypes = (operationNames: string[]) =>\n  returnTypesRegistry.getFooter(operationNames);\n\n/**\n * Clears the module-level return type registry used during Angular client\n * generation.\n *\n * This must be called at the start of each generation pass to avoid leaking\n * aliases across files or tags.\n *\n * @returns Nothing.\n */\nexport const resetHttpClientReturnTypes = () => {\n  returnTypesRegistry.reset();\n};\n\nexport { generateAngularTitle } from './utils';\n","import {\n  buildAngularParamsFilterExpression,\n  type ClientBuilder,\n  type ClientDependenciesBuilder,\n  type ClientExtraFilesBuilder,\n  type ClientFooterBuilder,\n  type ClientHeaderBuilder,\n  type ContextSpec,\n  dedupeSchemaImports,\n  emitResponseValidation,\n  escapeRegExp,\n  generateDependencyImports,\n  generateFormDataAndUrlEncodedFunction,\n  generateMutatorImports,\n  type GeneratorDependency,\n  type GeneratorImport,\n  type GeneratorVerbOptions,\n  getAngularFilteredParamsHelperBody,\n  getAngularObjectParamStrategies,\n  getFileInfo,\n  getFullRoute,\n  GetterPropType,\n  getOperationTagKey,\n  getSchemasImportPath,\n  getTagKey,\n  isObject,\n  isSyntheticDefaultImportsAllow,\n  jsDoc,\n  jsStringLiteralEscape,\n  makeRouteSafe,\n  mapTemplateExpressions,\n  type NormalizedOutputOptions,\n  type OpenApiInfoObject,\n  OutputMode,\n  pascal,\n  type ResReqTypesValue,\n  resolveSchemaImportDependencies,\n  type SchemaOutputPlan,\n  type SharedExports,\n  toObjectString,\n  upath,\n} from '@orval/core';\n\nimport {\n  getAngularBaseUrlFilePath,\n  getAngularBaseUrlImportSpecifier,\n  getBaseUrlTokenName,\n} from './base-url';\nimport {\n  ANGULAR_HTTP_CLIENT_DEPENDENCIES,\n  ANGULAR_HTTP_RESOURCE_DEPENDENCIES,\n} from './constants';\nimport {\n  buildAcceptHelpers,\n  generateHttpClientImplementation,\n  getAngularHttpResponseImport,\n  narrowsResponseEvents,\n  getAcceptHelperName,\n  getHttpClientReturnTypes,\n  getUniqueContentTypes,\n  type HttpClientGeneratorContext,\n  resetHttpClientReturnTypes,\n} from './http-client';\nimport {\n  buildServiceClassOpen,\n  type ClientOverride,\n  createReturnTypesRegistry,\n  createRouteRegistry,\n  getDefaultSuccessType,\n  getRelevantVerbOptionsForTag,\n  getSchemaOutputTypeRef,\n  isMutationVerb,\n  isPrimitiveType,\n  isRetrievalVerb,\n  isZodSchemaOutput,\n} from './utils';\n\n/**\n * Reads the per-operation angular client override from the orval config.\n *\n * Mirrors the pattern used by `@orval/query` for `operationQueryOptions`:\n * ```ts\n * override: {\n *   operations: {\n *     myPostSearch: { angular: { retrievalClient: 'httpResource' } },\n *   }\n * }\n * ```\n */\ninterface AngularOperationOverride {\n  readonly client?: ClientOverride;\n  readonly httpResource?: AngularHttpResourceOptionsConfig;\n}\n\ninterface AngularHttpResourceOptionsConfig {\n  defaultValue?: unknown;\n  debugName?: string;\n  injector?: string;\n  equal?: string;\n}\n\nconst isAngularHttpResourceOptions = (\n  value: unknown,\n): value is AngularHttpResourceOptionsConfig =>\n  value === undefined ||\n  (isObject(value) &&\n    (value.defaultValue === undefined ||\n      typeof value.defaultValue === 'string' ||\n      typeof value.defaultValue === 'number' ||\n      typeof value.defaultValue === 'boolean' ||\n      value.defaultValue === null ||\n      Array.isArray(value.defaultValue) ||\n      isObject(value.defaultValue)) &&\n    (value.debugName === undefined || typeof value.debugName === 'string') &&\n    (value.injector === undefined || typeof value.injector === 'string') &&\n    (value.equal === undefined || typeof value.equal === 'string'));\n\nconst isAngularOperationOverride = (\n  value: unknown,\n): value is AngularOperationOverride =>\n  value !== undefined &&\n  typeof value === 'object' &&\n  value !== null &&\n  (!('client' in value) ||\n    value.client === 'httpClient' ||\n    value.client === 'httpResource' ||\n    value.client === 'both') &&\n  (!('httpResource' in value) ||\n    isAngularHttpResourceOptions(value.httpResource));\n\nconst getClientOverride = (\n  verbOption: GeneratorVerbOptions,\n): ClientOverride | undefined => {\n  const angular =\n    verbOption.override.operations[verbOption.operationId]?.angular;\n\n  return isAngularOperationOverride(angular) ? angular.client : undefined;\n};\n\n/**\n * Resolves the effective `httpResource` option override for an operation.\n *\n * Operation-level configuration takes precedence over the global\n * `override.angular.httpResource` block while still inheriting unspecified\n * values from the global configuration.\n *\n * @returns The merged resource options for the operation, or `undefined` when no override exists.\n */\nconst getHttpResourceOverride = (\n  verbOption: GeneratorVerbOptions,\n  output: NormalizedOutputOptions,\n): AngularHttpResourceOptionsConfig | undefined => {\n  const operationAngular =\n    verbOption.override.operations[verbOption.operationId]?.angular;\n  const operationOverride = isAngularOperationOverride(operationAngular)\n    ? operationAngular.httpResource\n    : undefined;\n  const angularOverride = output.override.angular as unknown;\n  const globalOverride =\n    isObject(angularOverride) &&\n    'httpResource' in angularOverride &&\n    isAngularHttpResourceOptions(angularOverride.httpResource)\n      ? angularOverride.httpResource\n      : undefined;\n\n  if (globalOverride === undefined) return operationOverride;\n  if (operationOverride === undefined) return globalOverride;\n\n  return {\n    ...globalOverride,\n    ...operationOverride,\n  };\n};\n\n// NOTE: Module-level singletons — reset() is called by the header builder\n// (generateAngularHttpResourceHeader) at the start of each generation pass.\nconst resourceReturnTypesRegistry = createReturnTypesRegistry();\n\n/** @internal Exported for testing only */\nexport const routeRegistry = createRouteRegistry();\n\nconst getVerbOptionsRecord = (\n  verbOptions: readonly GeneratorVerbOptions[],\n): Record<string, GeneratorVerbOptions> =>\n  Object.fromEntries(\n    verbOptions.map((verbOption) => [verbOption.operationId, verbOption]),\n  );\n\nconst getPrimaryTag = (verbOption: GeneratorVerbOptions): string =>\n  getOperationTagKey(verbOption);\n\nconst hasRetrievalOperations = (\n  verbOptions: Record<string, GeneratorVerbOptions>,\n): boolean =>\n  Object.values(verbOptions).some((verbOption) =>\n    isRetrievalVerb(\n      verbOption.verb,\n      verbOption.operationName,\n      getClientOverride(verbOption),\n    ),\n  );\n\nconst getHeader = (\n  option: false | ((info: OpenApiInfoObject) => string | string[]),\n  info: OpenApiInfoObject | undefined,\n): string => {\n  if (!option || !info) {\n    return '';\n  }\n\n  const header = option(info);\n\n  return Array.isArray(header) ? jsDoc({ description: header }) : header;\n};\n\nconst mergeDependencies = (\n  deps: GeneratorDependency[],\n): GeneratorDependency[] => {\n  const merged = new Map<\n    string,\n    { exports: GeneratorImport[]; dependency: string }\n  >();\n\n  for (const dep of deps) {\n    const existing = merged.get(dep.dependency);\n    if (!existing) {\n      merged.set(dep.dependency, {\n        exports: [...dep.exports],\n        dependency: dep.dependency,\n      });\n      continue;\n    }\n\n    for (const exp of dep.exports) {\n      if (\n        !existing.exports.some(\n          (current) => current.name === exp.name && current.alias === exp.alias,\n        )\n      ) {\n        existing.exports.push(exp);\n      }\n    }\n  }\n\n  return [...merged.values()];\n};\n\nconst cloneDependencies = (\n  deps: readonly GeneratorDependency[],\n): GeneratorDependency[] =>\n  deps.map((dep) => ({\n    ...dep,\n    exports: [...dep.exports],\n  }));\n\n/**\n * Returns the merged dependency list required when Angular `httpResource`\n * output coexists with Angular `HttpClient` service generation.\n *\n * This is used for pure `httpResource` mode as well as mixed generation paths\n * that still need Angular common HTTP symbols and service helpers.\n *\n * @returns The de-duplicated dependency descriptors for Angular resource generation.\n */\nexport const getAngularHttpResourceDependencies: ClientDependenciesBuilder =\n  () =>\n    mergeDependencies([\n      ...ANGULAR_HTTP_CLIENT_DEPENDENCIES,\n      ...ANGULAR_HTTP_RESOURCE_DEPENDENCIES,\n    ]);\n\n/**\n * Returns only the dependencies required by standalone generated resource\n * files, such as the sibling `*.resource.ts` output used in `both` mode.\n *\n * @returns The dependency descriptors required by resource-only files.\n */\nexport const getAngularHttpResourceOnlyDependencies: ClientDependenciesBuilder =\n  () => cloneDependencies(ANGULAR_HTTP_RESOURCE_DEPENDENCIES);\n\nconst isResponseText = (\n  contentType: string | undefined,\n  dataType: string,\n): boolean => {\n  if (dataType === 'string') return true;\n  if (!contentType) return false;\n  return contentType.startsWith('text/') || contentType.includes('xml');\n};\n\nconst isResponseArrayBuffer = (contentType: string | undefined): boolean => {\n  if (!contentType) return false;\n  return (\n    contentType.includes('application/octet-stream') ||\n    contentType.includes('application/pdf')\n  );\n};\n\nconst isResponseBlob = (\n  contentType: string | undefined,\n  isBlob: boolean,\n): boolean => {\n  if (isBlob) return true;\n  if (!contentType) return false;\n  return contentType.startsWith('image/') || contentType.includes('blob');\n};\n\ntype HttpResourceFactoryName =\n  | 'httpResource'\n  | 'httpResource.text'\n  | 'httpResource.arrayBuffer'\n  | 'httpResource.blob';\n\nconst HTTP_RESOURCE_OPTIONS_TYPE_NAME = 'OrvalHttpResourceOptions';\nconst HTTP_RESOURCE_REQUEST_EXTENSION_TYPE_NAME =\n  'OrvalHttpResourceRequestExtension';\nconst RESOURCE_STATE_TYPE_NAME = 'ResourceState';\nconst RESOLVED_RESOURCE_STATE_TYPE_NAME = 'ResolvedResourceState';\nconst APPLY_REQUEST_EXTENSION_FUNCTION_NAME = 'applyOrvalRequestExtension';\nconst TO_RESOURCE_STATE_FUNCTION_NAME = 'toResourceState';\n\n/**\n * Boilerplate that every generated `*.resource.ts` declares. In a tag-based\n * mode each tag repeats it. The barrel writer needs the list to prevent\n * TS2308. See `buildBarrelReExports`.\n *\n * These are the same constants that the templates interpolate, so a rename\n * cannot desynchronise the two.\n */\nconst HTTP_RESOURCE_SHARED_EXPORTS: SharedExports = {\n  types: [\n    HTTP_RESOURCE_OPTIONS_TYPE_NAME,\n    HTTP_RESOURCE_REQUEST_EXTENSION_TYPE_NAME,\n    RESOURCE_STATE_TYPE_NAME,\n    RESOLVED_RESOURCE_STATE_TYPE_NAME,\n  ],\n  values: [\n    APPLY_REQUEST_EXTENSION_FUNCTION_NAME,\n    TO_RESOURCE_STATE_FUNCTION_NAME,\n  ],\n};\n\nconst getHttpResourceFactory = (\n  response: { readonly isBlob: boolean },\n  contentType: string | undefined,\n  dataType: string,\n): HttpResourceFactoryName => {\n  if (isResponseText(contentType, dataType)) return 'httpResource.text';\n  if (isResponseBlob(contentType, response.isBlob)) return 'httpResource.blob';\n  if (isResponseArrayBuffer(contentType)) return 'httpResource.arrayBuffer';\n  return 'httpResource';\n};\n\nconst getHttpResourceRawType = (factory: HttpResourceFactoryName): string => {\n  switch (factory) {\n    case 'httpResource.text': {\n      return 'string';\n    }\n    case 'httpResource.arrayBuffer': {\n      return 'ArrayBuffer';\n    }\n    case 'httpResource.blob': {\n      return 'Blob';\n    }\n    default: {\n      return 'unknown';\n    }\n  }\n};\n\nconst getTypeWithoutDefault = (definition: string): string => {\n  const match = /^([^:]+):\\s*(.+)$/.exec(definition);\n  if (!match) return definition;\n  return match[2].replace(/\\s*=\\s*.*$/, '').trim();\n};\n\nconst getDefaultValueFromImplementation = (\n  implementation: string,\n): string | undefined => {\n  const match = /=\\s*(.+)$/.exec(implementation);\n  return match ? match[1].trim() : undefined;\n};\n\ninterface SignalProp {\n  readonly definition: string;\n  readonly implementation: string;\n}\n\nconst withSignal = (\n  prop: GeneratorVerbOptions['props'][number],\n  options: { readonly hasDefault?: boolean } = {},\n): SignalProp => {\n  const type = getTypeWithoutDefault(prop.definition);\n  // `prop.default` is `unknown`: for QUERY_PARAM/BODY/HEADER props (the only\n  // ones that reach this fallback — PARAM always supplies `options.hasDefault`\n  // explicitly) core always sets it to the sentinel `false`, never a real\n  // default value, so checking `!== undefined` is always (wrongly) true.\n  // Guard against the boolean sentinel so only a genuine default value counts.\n  const derivedDefault =\n    getDefaultValueFromImplementation(prop.implementation) !== undefined ||\n    (typeof prop.default !== 'boolean' && prop.default !== undefined);\n  const hasDefault = options.hasDefault ?? derivedDefault;\n  const nameMatch = /^([^:]+):/.exec(prop.definition);\n  const namePart = nameMatch ? nameMatch[1] : prop.name;\n  const hasOptionalMark = namePart.includes('?');\n  const optional = prop.required && !hasDefault && !hasOptionalMark ? '' : '?';\n  const definition = `${prop.name}${optional}: Signal<${type}>`;\n\n  return {\n    definition,\n    implementation: definition,\n  };\n};\n\nconst buildSignalProps = (\n  props: GeneratorVerbOptions['props'],\n  params: GeneratorVerbOptions['params'],\n): GeneratorVerbOptions['props'] => {\n  const paramDefaults = new Map<string, boolean>();\n  for (const param of params) {\n    const hasDefault =\n      getDefaultValueFromImplementation(param.implementation) !== undefined ||\n      param.default !== undefined;\n    paramDefaults.set(param.name, hasDefault);\n  }\n\n  return props.map((prop) => {\n    switch (prop.type) {\n      case GetterPropType.NAMED_PATH_PARAMS: {\n        return {\n          ...prop,\n          name: 'pathParams',\n          definition: `pathParams: Signal<${prop.schema.name}>`,\n          implementation: `pathParams: Signal<${prop.schema.name}>`,\n        };\n      }\n      case GetterPropType.PARAM:\n      case GetterPropType.QUERY_PARAM:\n      case GetterPropType.BODY:\n      case GetterPropType.HEADER: {\n        // QUERY_PARAM / BODY / HEADER props never encode a real default\n        // value — `getProps()` hardcodes their `unknown`-typed `default`\n        // field to the boolean sentinel `false` (never a real default), so\n        // falling through to `withSignal`'s `prop.default !== undefined`\n        // derivation would treat every one of them as \"has a default\"\n        // (`false !== undefined` is always true) and silently render\n        // required props as optional Signals. Pass `false` explicitly so\n        // only PARAM derives a real default from `paramDefaults`.\n        const hasDefault =\n          prop.type === GetterPropType.PARAM\n            ? (paramDefaults.get(prop.name) ?? false)\n            : false;\n        const signalProp = withSignal(prop, { hasDefault });\n        return {\n          ...prop,\n          definition: signalProp.definition,\n          implementation: signalProp.implementation,\n        };\n      }\n      default: {\n        return prop;\n      }\n    }\n  });\n};\n\nconst applySignalRoute = (\n  route: string,\n  params: GeneratorVerbOptions['params'],\n  useNamedParams: boolean,\n): string => {\n  const paramsByName = new Map(params.map((param) => [param.name, param]));\n  // Rewrite the route's interpolations only. A plain `replaceAll('${x}', ...)`\n  // would also hit escaped static text such as `\\${x}` coming from a spec path\n  // like `/foo${x}` (#3703).\n  return mapTemplateExpressions(route, (expression) => {\n    const param = paramsByName.get(expression);\n    if (!param) return expression;\n\n    const defaultValue = getDefaultValueFromImplementation(\n      param.implementation,\n    );\n    if (useNamedParams) {\n      return defaultValue === undefined\n        ? 'pathParams().' + param.name\n        : 'pathParams()?.' + param.name + ' ?? ' + defaultValue;\n    }\n    return defaultValue === undefined\n      ? param.name + '()'\n      : param.name + '?.() ?? ' + defaultValue;\n  });\n};\n\ninterface ResourceRequest {\n  readonly bodyForm: string;\n  readonly request: string;\n  readonly isUrlOnly: boolean;\n  readonly bodyGuard?: string;\n}\n\n/**\n * Whether a single operation has at least one gated object-serialization\n * strategy (issue #3705) to apply. Used to decide whether the shared\n * `filterParams` helper needs its object-serialization overload.\n */\nconst hasGatedObjectQueryParamStrategies = (\n  verbOption: GeneratorVerbOptions,\n): boolean =>\n  Object.keys(\n    getAngularObjectParamStrategies({\n      queryParams: verbOption.queryParams,\n      paramsSerializer: verbOption.paramsSerializer,\n      paramsFilter: verbOption.paramsFilter,\n      queryObjectSerialization:\n        verbOption.override.angular.queryObjectSerialization,\n    }),\n  ).length > 0;\n\nconst buildResourceRequest = (\n  {\n    verb,\n    body,\n    headers,\n    queryParams,\n    paramsSerializer,\n    paramsFilter,\n    override,\n    formData,\n    formUrlEncoded,\n  }: GeneratorVerbOptions,\n  route: string,\n  { supportsIdleGuard }: { readonly supportsIdleGuard: boolean },\n): ResourceRequest => {\n  const isFormData = !override.formData.disabled;\n  const isFormUrlEncoded = override.formUrlEncoded !== false;\n\n  const bodyForm = generateFormDataAndUrlEncodedFunction({\n    formData,\n    formUrlEncoded,\n    body,\n    isFormData,\n    isFormUrlEncoded,\n  });\n\n  const hasFormData = isFormData && body.formData;\n  const hasFormUrlEncoded = isFormUrlEncoded && body.formUrlEncoded;\n\n  // An optional request body is exposed as an optional `Signal` parameter. When\n  // the caller omits it, the `httpResource` request factory must return\n  // `undefined` so the resource stays idle, rather than firing a request with an\n  // undefined body. This mirrors Angular's `undefined`-request contract (#3700).\n  //\n  // The guard is only emitted where the request is built lazily inside the\n  // factory (single response content-type). The multi-content path builds the\n  // request eagerly at the function-body level, where returning `undefined`\n  // would violate the function's `HttpResourceRef` return type — there we keep\n  // the optional-call (`?.()`) form, which is already runtime-safe.\n  const isDirectBody = !!body.definition && !hasFormData && !hasFormUrlEncoded;\n  const bodyGuard =\n    supportsIdleGuard && isDirectBody && body.isOptional\n      ? `if (!${body.implementation}) return undefined;`\n      : undefined;\n\n  const bodyAccess = body.definition\n    ? body.isOptional && !bodyGuard\n      ? `${body.implementation}?.()`\n      : `${body.implementation}()`\n    : undefined;\n  const bodyValue = hasFormData\n    ? 'formData'\n    : hasFormUrlEncoded\n      ? 'formUrlEncoded'\n      : bodyAccess;\n\n  const paramsAccess = queryParams ? 'params?.()' : undefined;\n  const headersAccess = headers ? 'headers?.()' : undefined;\n  // Object-typed query param serialization (issue #3705), gated for\n  // `override.angular.queryObjectSerialization`, `paramsFilter`, and\n  // `paramsSerializer`.\n  const objectParamStrategies = getAngularObjectParamStrategies({\n    queryParams,\n    paramsSerializer,\n    paramsFilter,\n    queryObjectSerialization: override.angular.queryObjectSerialization,\n  });\n  const filteredParamsValue = paramsAccess\n    ? buildAngularParamsFilterExpression({\n        paramsExpression: `${paramsAccess} ?? {}`,\n        requiredNullableParamKeys: queryParams?.requiredNullableKeys ?? [],\n        preserveRequiredNullables: !!paramsSerializer,\n        // Only pass non-primitive params through the built-in `filterParams`\n        // when a `paramsSerializer` can legally consume the raw object/array.\n        // Without one, the helper's `unknown` return type is not assignable\n        // to `HttpClient`'s params, so keep them filtered out. The\n        // `paramsFilter` branch bypasses the built-in helper entirely.\n        nonPrimitiveKeys: paramsSerializer\n          ? (queryParams?.nonPrimitiveKeys ?? [])\n          : [],\n        objectParamStrategies,\n        paramsFilter,\n        useSharedHelper: true,\n      })\n    : undefined;\n  const paramsValue = paramsAccess\n    ? paramsSerializer\n      ? `params?.() ? ${paramsSerializer.name}(${filteredParamsValue}) : undefined`\n      : filteredParamsValue\n    : undefined;\n\n  const isGet = verb === 'get';\n  const hasExtras = !isGet || !!bodyValue || !!paramsValue || !!headersAccess;\n  const isUrlOnly = !hasExtras && !bodyForm;\n\n  const requestLines = [\n    `url: \\`${route}\\``,\n    isGet ? undefined : `method: '${verb.toUpperCase()}'`,\n    bodyValue ? `body: ${bodyValue}` : undefined,\n    paramsValue ? `params: ${paramsValue}` : undefined,\n    headersAccess ? `headers: ${headersAccess}` : undefined,\n  ].filter(Boolean);\n\n  const request = isUrlOnly\n    ? `\\`${route}\\``\n    : `({\\n      ${requestLines.join(',\\n      ')}\\n    })`;\n\n  return {\n    bodyForm,\n    request,\n    isUrlOnly,\n    bodyGuard,\n  };\n};\n\nconst getHttpResourceResponseImports = (\n  response: GeneratorVerbOptions['response'],\n): GeneratorImport[] => {\n  const successDefinition = response.definition.success;\n  if (!successDefinition) return [];\n\n  return response.imports.filter((imp) => {\n    const name = imp.alias ?? imp.name;\n    const pattern = new RegExp(String.raw`\\b${escapeRegExp(name)}\\b`, 'g');\n    return pattern.test(successDefinition);\n  });\n};\n\nconst getParseSchemaName = (\n  response: {\n    readonly imports: readonly { name: string; isZodSchema?: boolean }[];\n    readonly definition: { readonly success?: string };\n  },\n  factory: HttpResourceFactoryName,\n  output: NormalizedOutputOptions,\n  responseTypeOverride?: string,\n): string | undefined => {\n  if (factory !== 'httpResource') return undefined;\n\n  // Explicit isZodSchema flag on imports (forward-compatible)\n  const zodSchema = response.imports.find((imp) => imp.isZodSchema);\n  if (zodSchema) return zodSchema.name;\n\n  // Check if runtime validation is disabled\n  if (!output.override.angular.runtimeValidation.enabled) return undefined;\n\n  // Auto-detect: when schemas.type === 'zod', use the response type as the schema name\n  if (!isZodSchemaOutput(output)) return undefined;\n\n  const responseType = responseTypeOverride ?? response.definition.success;\n  if (!responseType) return undefined;\n  if (isPrimitiveType(responseType)) return undefined;\n\n  // Verify a matching import exists (the response type name resolves to a zod schema)\n  const hasMatchingImport = response.imports.some(\n    (imp) => imp.name === responseType,\n  );\n  if (!hasMatchingImport) return undefined;\n\n  return responseType;\n};\n\nconst getHttpResourceZodParsedImportNames = (\n  response: GeneratorVerbOptions['response'],\n  output: NormalizedOutputOptions,\n): Set<string> => {\n  const names = new Set<string>();\n\n  for (const successType of response.types.success) {\n    const schemaName = getParseSchemaName(\n      response,\n      getHttpResourceFactory(\n        response,\n        successType.contentType,\n        successType.value,\n      ),\n      output,\n      successType.value,\n    );\n\n    if (schemaName) {\n      names.add(schemaName);\n    }\n  }\n\n  return names;\n};\n\nconst getHttpResourceVerbImports = (\n  verbOptions: GeneratorVerbOptions,\n  output: NormalizedOutputOptions,\n): GeneratorImport[] => {\n  const { response, body, queryParams, props, headers, params } = verbOptions;\n  const responseImports = getHttpResourceResponseImports(response);\n  const parsedZodImportNames = isZodSchemaOutput(output)\n    ? getHttpResourceZodParsedImportNames(response, output)\n    : new Set<string>();\n  const parsedZodImports = responseImports.filter((imp) =>\n    parsedZodImportNames.has(imp.name),\n  );\n\n  return [\n    ...responseImports.map((imp) =>\n      parsedZodImportNames.has(imp.name) ? { ...imp, values: true } : imp,\n    ),\n    ...parsedZodImports\n      .filter((imp) => !isPrimitiveType(imp.name))\n      .map((imp) => ({\n        name: getSchemaOutputTypeRef(imp.name),\n        zodBaseName: imp.name,\n      })),\n    ...body.imports,\n    ...props.flatMap((prop) =>\n      prop.type === GetterPropType.NAMED_PATH_PARAMS\n        ? [{ name: prop.schema.name }]\n        : [],\n    ),\n    ...(queryParams ? [{ name: queryParams.schema.name }] : []),\n    ...(headers ? [{ name: headers.schema.name }] : []),\n    ...params.flatMap<GeneratorImport>(({ imports }) => imports),\n    { name: 'map', values: true, importPath: 'rxjs' },\n  ];\n};\n\nconst getParseExpression = (\n  response: {\n    readonly imports: readonly { name: string; isZodSchema?: boolean }[];\n    readonly definition: { readonly success?: string };\n  },\n  factory: HttpResourceFactoryName,\n  output: NormalizedOutputOptions,\n  operationName: string,\n  responseTypeOverride?: string,\n): string | undefined => {\n  const schemaName = getParseSchemaName(\n    response,\n    factory,\n    output,\n    responseTypeOverride,\n  );\n\n  return schemaName\n    ? emitResponseValidation({\n        schemaRef: schemaName,\n        operationName,\n        strategy: output.override.angular.runtimeValidation.strategy,\n        context: 'parse-fn',\n      })\n    : undefined;\n};\n\n/**\n * Builds the literal option entries that Orval injects into generated\n * `httpResource()` calls.\n *\n * This merges user-supplied generator configuration such as `defaultValue` or\n * `debugName` with automatically derived runtime-validation hooks like\n * `parse: Schema.parse`.\n *\n * @returns The option entries plus metadata about whether a configured default value exists.\n */\nconst buildHttpResourceOptionsLiteral = (\n  verbOption: GeneratorVerbOptions,\n  factory: HttpResourceFactoryName,\n  output: NormalizedOutputOptions,\n  responseTypeOverride?: string,\n): { entries: string[]; hasDefaultValue: boolean } => {\n  const override = getHttpResourceOverride(verbOption, output);\n  const parseExpression = getParseExpression(\n    verbOption.response,\n    factory,\n    output,\n    verbOption.operationName,\n    responseTypeOverride,\n  );\n\n  const defaultValueLiteral =\n    override?.defaultValue === undefined\n      ? undefined\n      : JSON.stringify(override.defaultValue);\n\n  const optionEntries = [\n    parseExpression ? `parse: ${parseExpression}` : undefined,\n    defaultValueLiteral ? `defaultValue: ${defaultValueLiteral}` : undefined,\n    override?.debugName === undefined\n      ? undefined\n      : `debugName: ${JSON.stringify(override.debugName)}`,\n    override?.injector ? `injector: ${override.injector}` : undefined,\n    override?.equal ? `equal: ${override.equal}` : undefined,\n  ].filter((value): value is string => value !== undefined);\n\n  return {\n    entries: optionEntries,\n    hasDefaultValue: defaultValueLiteral !== undefined,\n  };\n};\n\nconst appendArgument = (args: string, argument: string): string => {\n  const normalizedArgs = args.trim().replace(/,\\s*$/, '');\n\n  return normalizedArgs.length > 0\n    ? `${normalizedArgs},\n  ${argument}`\n    : argument;\n};\n\nconst normalizeOptionalParametersForRequiredTrailingArg = (\n  args: string,\n): string =>\n  args.replaceAll(/(\\w+)\\?:\\s*([^,\\n]+)(,?)/g, '$1: $2 | undefined$3');\n\nconst buildHttpResourceOptionsArgument = (\n  valueType: string,\n  rawType: string,\n  options: { readonly requiresDefaultValue: boolean },\n  omitParse = false,\n): string => {\n  const baseType = `${HTTP_RESOURCE_OPTIONS_TYPE_NAME}<${valueType}, ${rawType}${omitParse ? ', true' : ''}>`;\n  return options.requiresDefaultValue\n    ? `options: ${baseType} & { defaultValue: NoInfer<${valueType}> }`\n    : `options?: ${baseType}`;\n};\n\nconst buildHttpResourceOptionsExpression = (\n  configuredEntries: readonly string[],\n): string | undefined => {\n  if (configuredEntries.length === 0) {\n    return 'options';\n  }\n\n  return `{\n    ...(options ?? {}),\n    ${configuredEntries.join(',\\n    ')}\n  }`;\n};\n\nconst buildHttpResourceFunctionSignatures = (\n  resourceName: string,\n  args: string,\n  valueType: string,\n  rawType: string,\n  hasConfiguredDefaultValue: boolean,\n  omitParse = false,\n): string => {\n  if (hasConfiguredDefaultValue) {\n    return `export function ${resourceName}(${appendArgument(\n      args,\n      buildHttpResourceOptionsArgument(\n        valueType,\n        rawType,\n        {\n          requiresDefaultValue: false,\n        },\n        omitParse,\n      ),\n    )}): HttpResourceRef<${valueType}>`;\n  }\n\n  const overloadArgs = appendArgument(\n    normalizeOptionalParametersForRequiredTrailingArg(args),\n    buildHttpResourceOptionsArgument(\n      valueType,\n      rawType,\n      {\n        requiresDefaultValue: true,\n      },\n      omitParse,\n    ),\n  );\n  const implementationArgs = appendArgument(\n    args,\n    buildHttpResourceOptionsArgument(\n      valueType,\n      rawType,\n      {\n        requiresDefaultValue: false,\n      },\n      omitParse,\n    ),\n  );\n\n  return `export function ${resourceName}(${overloadArgs}): HttpResourceRef<${valueType}>;\nexport function ${resourceName}(${implementationArgs}): HttpResourceRef<${valueType} | undefined>`;\n};\n\n/**\n * Generates a single Angular `httpResource` helper function for an operation.\n *\n * The generated output handles signal-wrapped parameters, route interpolation,\n * request-body construction, content-type branching, runtime validation, and\n * optional mutator integration when the mutator is compatible with standalone\n * resource functions.\n *\n * @remarks\n * This function emits overloads when content negotiation or caller-supplied\n * `defaultValue` support requires multiple signatures.\n *\n * @returns A string containing the complete generated resource helper.\n */\nconst buildHttpResourceFunction = (\n  verbOption: GeneratorVerbOptions,\n  route: string,\n  output: NormalizedOutputOptions,\n): string => {\n  const { operationName, typeName, response, props, params, mutator } =\n    verbOption;\n\n  const dataType = response.definition.success || 'unknown';\n  const omitParse = isZodSchemaOutput(output);\n  const responseSchemaImports = getHttpResourceResponseImports(response);\n  const hasResponseSchemaImport = responseSchemaImports.some(\n    (imp) => imp.name === dataType,\n  );\n  const resourceName = `${operationName}Resource`;\n  const parsedDataType =\n    omitParse &&\n    output.override.angular.runtimeValidation.enabled &&\n    !isPrimitiveType(dataType) &&\n    hasResponseSchemaImport\n      ? getSchemaOutputTypeRef(dataType)\n      : dataType;\n  const successTypes = response.types.success;\n  const overallReturnType =\n    successTypes.length <= 1\n      ? parsedDataType\n      : [\n          ...new Set(\n            successTypes.map((type) =>\n              getHttpResourceGeneratedResponseType(\n                type.value,\n                type.contentType,\n                responseSchemaImports,\n                output,\n              ),\n            ),\n          ),\n        ].join(' | ') || parsedDataType;\n  resourceReturnTypesRegistry.set(\n    operationName,\n    `export type ${pascal(\n      typeName,\n    )}ResourceResult = NonNullable<${overallReturnType}>`,\n  );\n  const uniqueContentTypes = getUniqueContentTypes(successTypes);\n  const defaultSuccess = getDefaultSuccessType(successTypes, dataType);\n  const jsonContentType = successTypes.find((type) =>\n    type.contentType.includes('json'),\n  )?.contentType;\n  const preferredContentType = jsonContentType ?? defaultSuccess.contentType;\n  const resourceFactory = getHttpResourceFactory(\n    response,\n    preferredContentType,\n    dataType,\n  );\n\n  const hasNamedParams = props.some(\n    (prop) => prop.type === GetterPropType.NAMED_PATH_PARAMS,\n  );\n  const signalRoute = applySignalRoute(route, params, hasNamedParams);\n  // Opt-in URL-encoding of path parameters (`urlEncodeParameters`). Must run\n  // AFTER `applySignalRoute`: that step matches the literal `${param}` template\n  // to rewrite it to its signal form (e.g. `${param()}`), so encoding first\n  // would stop the substitution from matching. Wrapping the already-rewritten\n  // form yields `${encodeURIComponent(String(param()))}`, which is correct.\n  let encodedRoute = output.urlEncodeParameters\n    ? makeRouteSafe(\n        signalRoute,\n        new Set(params.filter((p) => p.allowReserved).map((p) => p.name)),\n      )\n    : signalRoute;\n  // MUST run after the urlEncodeParameters/makeRouteSafe step above (see the\n  // comment on `encodedRoute` for why): prefixing before it would wrap\n  // `baseUrl` in `encodeURIComponent(String(...))`.\n  const baseUrlOption = output.override.angular.baseUrl;\n  if (baseUrlOption) {\n    encodedRoute = '${baseUrl}' + encodedRoute;\n  }\n  const baseUrlDeclaration = baseUrlOption\n    ? `const baseUrl = options?.injector ? options.injector.get(${getBaseUrlTokenName(baseUrlOption.apiId)}) : inject(${getBaseUrlTokenName(baseUrlOption.apiId)});\\n  `\n    : '';\n\n  const signalProps = buildSignalProps(props, params);\n  const args = toObjectString(signalProps, 'implementation');\n\n  const { bodyForm, request, isUrlOnly, bodyGuard } = buildResourceRequest(\n    verbOption,\n    encodedRoute,\n    { supportsIdleGuard: uniqueContentTypes.length <= 1 },\n  );\n\n  if (uniqueContentTypes.length > 1) {\n    const defaultContentType = jsonContentType ?? defaultSuccess.contentType;\n    const acceptTypeName = getAcceptHelperName(typeName);\n    const requiredProps = signalProps.filter(\n      (_, index) => props[index]?.required && !props[index]?.default,\n    );\n    const optionalProps = signalProps.filter(\n      (_, index) => !props[index]?.required || props[index]?.default,\n    );\n    const requiredPart = requiredProps\n      .map((prop) => prop.implementation)\n      .join(',\\n    ');\n    const optionalPart = optionalProps\n      .map((prop) => prop.implementation)\n      .join(',\\n    ');\n    const getBranchReturnType = (type: ResReqTypesValue) =>\n      getHttpResourceGeneratedResponseType(\n        type.value,\n        type.contentType,\n        responseSchemaImports,\n        output,\n      );\n    const unionReturnType = [\n      ...new Set(\n        successTypes\n          .filter((type) => type.contentType)\n          .map((type) => getBranchReturnType(type)),\n      ),\n    ].join(' | ');\n    const getBranchRawType = (type: ResReqTypesValue): string =>\n      getHttpResourceRawType(\n        getHttpResourceFactory(response, type.contentType, type.value),\n      );\n    // Per-branch options types (one per distinct content-type branch).\n    // Deduped so text-like content types (text/plain, application/xml) that\n    // share the same factory don't produce duplicate union members.\n    const branchOptionsTypes = [\n      ...new Set(\n        successTypes\n          .filter((type) => type.contentType)\n          .map((type) =>\n            buildBranchOptionsType(\n              getBranchReturnType(type),\n              getBranchRawType(type),\n              omitParse,\n            ),\n          ),\n      ),\n    ];\n    // The implementation signature accepts the union of branch option types.\n    // This keeps each overload's narrow `options` assignable to the\n    // implementation signature (required for TS overload compatibility) while\n    // preventing mismatched `defaultValue`/`parse` across content types.\n    const implementationOptionsType = branchOptionsTypes.join(' | ');\n    // Per-accept overloads pin `options` to the branch-specific value/raw\n    // types so `defaultValue` / `parse` type-check against the actual content\n    // type — e.g. passing a `string` default to the `application/json`\n    // overload is now a type error.\n    const branchOverloads = successTypes\n      .filter((type) => type.contentType)\n      .map((type) => {\n        const returnType = getBranchReturnType(type);\n        const overloadArgs = [\n          requiredPart,\n          `accept: '${jsStringLiteralEscape(type.contentType ?? '')}'`,\n          optionalPart,\n          `options?: ${buildBranchOptionsType(returnType, getBranchRawType(type), omitParse)}`,\n        ]\n          .filter(Boolean)\n          .join(',\\n    ');\n\n        return `export function ${resourceName}(${overloadArgs}): HttpResourceRef<${returnType} | undefined>;`;\n      })\n      .join('\\n');\n    const implementationArgsWithDefault = [\n      requiredPart,\n      `accept: ${acceptTypeName} = '${jsStringLiteralEscape(\n        defaultContentType,\n      )}'`,\n      optionalPart,\n      `options?: ${implementationOptionsType}`,\n    ]\n      .filter(Boolean)\n      .join(',\\n    ');\n\n    const getBranchOptions = (type?: ResReqTypesValue) => {\n      if (!type) {\n        return `options as ${buildBranchOptionsType(unionReturnType, 'unknown', omitParse)}`;\n      }\n\n      const factory = getHttpResourceFactory(\n        response,\n        type.contentType,\n        type.value,\n      );\n      const branchOptions = buildHttpResourceOptionsLiteral(\n        verbOption,\n        factory,\n        output,\n        type.value,\n      );\n      const branchOptionsExpression = buildHttpResourceOptionsExpression(\n        branchOptions.entries,\n      );\n\n      return `${branchOptionsExpression ?? 'options'} as unknown as ${buildBranchOptionsType(\n        getBranchReturnType(type),\n        getHttpResourceRawType(factory),\n        omitParse,\n      )}`;\n    };\n\n    const jsonType = successTypes.find(\n      (type) =>\n        type.contentType.includes('json') || type.contentType.includes('+json'),\n    );\n    const textType = successTypes.find((type) =>\n      isResponseText(type.contentType, type.value),\n    );\n    const arrayBufferType = successTypes.find((type) =>\n      isResponseArrayBuffer(type.contentType),\n    );\n    const blobType = successTypes.find((type) =>\n      isResponseBlob(type.contentType, response.isBlob),\n    );\n\n    // Fallback path for unknown accept values must match the branch the\n    // default `accept` argument targets — pick the success type whose content\n    // type is `defaultContentType`, then fall back to the remaining branches\n    // in the same priority order as the runtime dispatch above.\n    const fallbackType =\n      successTypes.find((type) => type.contentType === defaultContentType) ??\n      jsonType ??\n      textType ??\n      arrayBufferType ??\n      blobType;\n\n    const buildFallbackReturn = (type: ResReqTypesValue): string => {\n      const factory = getHttpResourceFactory(\n        response,\n        type.contentType,\n        type.value,\n      );\n      const returnType =\n        factory === 'httpResource'\n          ? getBranchReturnType(type)\n          : getHttpResourceRawType(factory);\n      return `return ${factory}<${returnType}>(buildRequest, ${getBranchOptions(type)});`;\n    };\n\n    const fallbackReturn = fallbackType\n      ? buildFallbackReturn(fallbackType)\n      : `return httpResource<${parsedDataType}>(buildRequest, ${getBranchOptions()});`;\n\n    const normalizeRequest = isUrlOnly\n      ? `const normalizedRequest: HttpResourceRequest = { url: request };`\n      : `const normalizedRequest: HttpResourceRequest = request;`;\n\n    return `/**\n * @remarks httpResource is available in Angular 19.2 and later.\n */\n${branchOverloads}\nexport function ${resourceName}(\n    ${implementationArgsWithDefault}\n): HttpResourceRef<${unionReturnType} | undefined> {\n  ${baseUrlDeclaration}const buildRequest = (): HttpResourceRequest => {\n    ${bodyForm ? `${bodyForm};` : ''}\n    const request = ${request};\n    ${normalizeRequest}\n    const extendedRequest = applyOrvalRequestExtension(normalizedRequest, options);\n    return {\n      ...extendedRequest,\n      headers: extendedRequest.headers instanceof HttpHeaders\n        ? extendedRequest.headers.set('Accept', accept)\n        : { ...(extendedRequest.headers ?? {}), Accept: accept },\n    };\n  };\n\n  if (accept.includes('json') || accept.includes('+json')) {\n    return httpResource<${jsonType ? getBranchReturnType(jsonType) : parsedDataType}>(buildRequest, ${getBranchOptions(jsonType)});\n  }\n\n  if (accept.startsWith('text/') || accept.includes('xml')) {\n    return httpResource.text<string>(buildRequest, ${getBranchOptions(textType)});\n  }\n\n  ${\n    blobType\n      ? `if (accept.startsWith('image/') || accept.includes('blob')) {\n    return httpResource.blob<Blob>(buildRequest, ${getBranchOptions(blobType)});\n  }\n\n  `\n      : ''\n  }${\n    arrayBufferType\n      ? `if (accept.includes('octet-stream') || accept.includes('pdf')) {\n    return httpResource.arrayBuffer<ArrayBuffer>(buildRequest, ${getBranchOptions(arrayBufferType)});\n  }\n\n  `\n      : ''\n  }${fallbackReturn}\n}\n`;\n  }\n\n  const resourceOptions = buildHttpResourceOptionsLiteral(\n    verbOption,\n    resourceFactory,\n    output,\n  );\n  const rawType = getHttpResourceRawType(resourceFactory);\n  const resourceValueType = resourceOptions.hasDefaultValue\n    ? parsedDataType\n    : `${parsedDataType} | undefined`;\n  const functionSignatures = buildHttpResourceFunctionSignatures(\n    resourceName,\n    args,\n    parsedDataType,\n    rawType,\n    resourceOptions.hasDefaultValue,\n    omitParse,\n  );\n  const implementationArgs = appendArgument(\n    args,\n    buildHttpResourceOptionsArgument(\n      parsedDataType,\n      rawType,\n      {\n        requiresDefaultValue: false,\n      },\n      omitParse,\n    ),\n  );\n  const optionsExpression = buildHttpResourceOptionsExpression(\n    resourceOptions.entries,\n  );\n  const resourceCallOptions = optionsExpression ? `, ${optionsExpression}` : '';\n\n  // HttpClient-style mutators expect (config, httpClient) — incompatible with\n  // standalone httpResource functions which have no HttpClient instance.\n  // Only apply mutators that accept a single argument (request config only).\n  const isResourceCompatibleMutator =\n    mutator !== undefined && !mutator.hasSecondArg;\n  const returnExpression = isResourceCompatibleMutator\n    ? `${mutator.name}(request)`\n    : 'request';\n\n  if (isUrlOnly && !isResourceCompatibleMutator) {\n    return `/**\n * @remarks httpResource is available in Angular 19.2 and later.\n */\n${functionSignatures};\nexport function ${resourceName}(${implementationArgs}): HttpResourceRef<${resourceValueType}> {\n  ${baseUrlDeclaration}return ${resourceFactory}<${parsedDataType}>(() => applyOrvalRequestExtension(${request}, options)${resourceCallOptions});\n}\n`;\n  }\n\n  // Statements emitted at the top of the request factory, before the request\n  // object is assembled: the optional-body idle guard (when present) followed by\n  // any form-data/url-encoded body construction.\n  const factoryPrelude = [bodyGuard, bodyForm ? `${bodyForm};` : undefined]\n    .filter(Boolean)\n    .join('\\n    ');\n\n  return `/**\n * @remarks httpResource is available in Angular 19.2 and later.\n */\n${functionSignatures};\nexport function ${resourceName}(${implementationArgs}): HttpResourceRef<${resourceValueType}> {\n  ${baseUrlDeclaration}return ${resourceFactory}<${parsedDataType}>(() => {\n    ${factoryPrelude}\n    const request = ${request};\n    return applyOrvalRequestExtension(${returnExpression}, options);\n  }${resourceCallOptions});\n}\n`;\n};\n\nconst buildHttpResourceOptionsUtilities = (omitParse: boolean): string => `\nexport interface ${HTTP_RESOURCE_REQUEST_EXTENSION_TYPE_NAME} {\n  /** Extra headers merged over generated headers. Pass a function to read signals reactively. */\n  headers?: HttpResourceRequest['headers'] | (() => HttpResourceRequest['headers']);\n  /** Angular HttpContext forwarded to the underlying request. Pass a function to derive it reactively. */\n  context?: HttpContext | (() => HttpContext);\n  /** Last-resort escape hatch: transform the final request descriptor. Runs inside the resource's reactive context. */\n  request?: (request: HttpResourceRequest) => HttpResourceRequest;\n}\n\nexport type ${HTTP_RESOURCE_OPTIONS_TYPE_NAME}<TValue, TRaw = unknown, TOmitParse extends boolean = ${omitParse}> =\n  (TOmitParse extends true\n    ? Omit<HttpResourceOptions<TValue, TRaw>, 'parse'>\n    : HttpResourceOptions<TValue, TRaw>) &\n  ${HTTP_RESOURCE_REQUEST_EXTENSION_TYPE_NAME};\n\nfunction mergeOrvalResourceHeaders(\n  base: HttpResourceRequest['headers'],\n  extra: NonNullable<HttpResourceRequest['headers']>,\n): NonNullable<HttpResourceRequest['headers']> {\n  if (!base) return extra;\n  if (base instanceof HttpHeaders || extra instanceof HttpHeaders) {\n    const toHeaderValue = (\n      value: string | readonly string[],\n    ): string | string[] =>\n      Array.isArray(value) ? Array.from(value, String) : String(value);\n    let merged =\n      base instanceof HttpHeaders\n        ? base\n        : Object.entries(base).reduce(\n            (headers, [key, value]) => headers.set(key, toHeaderValue(value)),\n            new HttpHeaders(),\n          );\n    const extraRecord =\n      extra instanceof HttpHeaders\n        ? extra.keys().reduce<Record<string, string[]>>((record, key) => {\n            const values = extra.getAll(key);\n            if (values) record[key] = values;\n            return record;\n          }, {})\n        : extra;\n    for (const [key, value] of Object.entries(extraRecord)) {\n      merged = merged.set(key, toHeaderValue(value));\n    }\n    return merged;\n  }\n  return { ...base, ...extra };\n}\n\nexport function ${APPLY_REQUEST_EXTENSION_FUNCTION_NAME}(\n  request: string | HttpResourceRequest,\n  options?: ${HTTP_RESOURCE_REQUEST_EXTENSION_TYPE_NAME},\n): HttpResourceRequest {\n  const base: HttpResourceRequest = typeof request === 'string' ? { url: request } : request;\n  if (\n    !options ||\n    (options.headers === undefined &&\n      options.context === undefined &&\n      options.request === undefined)\n  ) {\n    return base;\n  }\n  let next: HttpResourceRequest = { ...base };\n  const extraHeaders =\n    typeof options.headers === 'function' ? options.headers() : options.headers;\n  if (extraHeaders) {\n    next = { ...next, headers: mergeOrvalResourceHeaders(next.headers, extraHeaders) };\n  }\n  const context =\n    typeof options.context === 'function' ? options.context() : options.context;\n  if (context !== undefined) {\n    next = { ...next, context };\n  }\n  return options.request ? options.request(next) : next;\n}\n`;\n\nconst getContentTypeReturnType = (\n  contentType: string | undefined,\n  value: string,\n): string => {\n  if (!contentType) return value;\n  if (contentType.includes('json') || contentType.includes('+json')) {\n    return value;\n  }\n  if (contentType.startsWith('text/') || contentType.includes('xml')) {\n    return 'string';\n  }\n  if (isResponseArrayBuffer(contentType)) {\n    return 'ArrayBuffer';\n  }\n  return 'Blob';\n};\n\nconst getHttpResourceGeneratedResponseType = (\n  value: string,\n  contentType: string | undefined,\n  responseImports: readonly { name: string }[],\n  output: NormalizedOutputOptions,\n): string => {\n  if (\n    isZodSchemaOutput(output) &&\n    output.override.angular.runtimeValidation.enabled &&\n    !!contentType &&\n    (contentType.includes('json') || contentType.includes('+json')) &&\n    !isPrimitiveType(value) &&\n    responseImports.some((imp) => imp.name === value)\n  ) {\n    return getSchemaOutputTypeRef(value);\n  }\n\n  return getContentTypeReturnType(contentType, value);\n};\n\nconst buildBranchOptionsType = (\n  valueType: string,\n  rawType: string,\n  omitParse: boolean,\n) =>\n  `${HTTP_RESOURCE_OPTIONS_TYPE_NAME}<${valueType}, ${rawType}${omitParse ? ', true' : ''}>`;\n\nconst buildResourceStateUtilities = (): string => `\n/**\n * Utility type for httpResource results with status tracking.\n * Inspired by @angular-architects/ngrx-toolkit withResource pattern.\n *\n * Uses \\`globalThis.Error\\` to avoid collision with API model types named \\`Error\\`.\n */\nexport interface ${RESOURCE_STATE_TYPE_NAME}<T> {\n  readonly value: Signal<T | undefined>;\n  readonly status: Signal<ResourceStatus>;\n  readonly error: Signal<globalThis.Error | undefined>;\n  readonly isLoading: Signal<boolean>;\n  /** Guard reads of \\`value()\\` with this call: \\`value()\\` throws in the error state. */\n  readonly hasValue: () => this is ${RESOLVED_RESOURCE_STATE_TYPE_NAME}<T>;\n  readonly reload: () => boolean;\n}\n\nexport interface ${RESOLVED_RESOURCE_STATE_TYPE_NAME}<T> extends ${RESOURCE_STATE_TYPE_NAME}<T> {\n  readonly value: Signal<Exclude<T, undefined>>;\n}\n\n/**\n * Wraps an HttpResourceRef to expose a consistent ResourceState interface.\n * Useful when integrating with NgRx SignalStore via withResource().\n */\nexport function ${TO_RESOURCE_STATE_FUNCTION_NAME}<T>(ref: HttpResourceRef<T>): ${RESOURCE_STATE_TYPE_NAME}<T> {\n  return {\n    value: ref.value,\n    status: ref.status,\n    error: ref.error,\n    isLoading: ref.isLoading,\n    hasValue(this: ${RESOURCE_STATE_TYPE_NAME}<T>): this is ${RESOLVED_RESOURCE_STATE_TYPE_NAME}<T> {\n      return ref.hasValue();\n    },\n    reload: () => ref.reload(),\n  };\n}\n`;\n\n/**\n * Generates the header section for Angular `httpResource` output.\n *\n * @remarks\n * Resource functions are emitted in the header phase because their final shape\n * depends on the full set of operations in scope, including generated `Accept`\n * helpers and any shared mutation service methods.\n *\n * @returns The generated header, resource helpers, optional mutation service class, and resource result aliases.\n */\nexport const generateHttpResourceHeader: ClientHeaderBuilder = ({\n  title,\n  isRequestOptions,\n  isMutator,\n  isGlobalMutator,\n  provideIn,\n  output,\n  verbOptions,\n  tag,\n}) => {\n  resetHttpClientReturnTypes();\n  resourceReturnTypesRegistry.reset();\n\n  // When the output is emitted per-tag (modes: `tags`, `tags-split`) each file\n  // must only reference operations that belong to the current tag — otherwise\n  // the shared header duplicates helpers across every tag file and pulls in\n  // type names the file-local `imports` filter never sees, producing missing\n  // schema imports in the generated output.\n  const relevantVerbOptions = getRelevantVerbOptionsForTag(verbOptions, tag);\n\n  const retrievals = relevantVerbOptions.filter((verbOption) =>\n    isRetrievalVerb(\n      verbOption.verb,\n      verbOption.operationName,\n      getClientOverride(verbOption),\n    ),\n  );\n  // Emit the shared `filterParams` helper only when at least one retrieval\n  // with query params lacks its own `paramsFilter` mutator — otherwise the\n  // helper would be dead code.\n  const hasBuiltInFilteredQueryParams = retrievals.some(\n    (verbOption) => !!verbOption.queryParams && !verbOption.paramsFilter,\n  );\n  const resources = retrievals\n    .map((verbOption) => {\n      const fullRoute = routeRegistry.get(\n        verbOption.operationName,\n        verbOption.route,\n      );\n      return buildHttpResourceFunction(verbOption, fullRoute, output);\n    })\n    .join('\\n');\n  const resourceTypes = resourceReturnTypesRegistry.getFooter(\n    retrievals.map((verbOption) => verbOption.operationName),\n  );\n\n  const mutations = relevantVerbOptions.filter((verbOption) =>\n    isMutationVerb(\n      verbOption.verb,\n      verbOption.operationName,\n      getClientOverride(verbOption),\n    ),\n  );\n  const acceptHelpers = buildAcceptHelpers(\n    [...retrievals, ...mutations],\n    output,\n  );\n  // Mutations need the built-in helper only when at least one mutation lacks\n  // its own `paramsFilter`. If the resource section already emits the helper\n  // for retrievals, we suppress the mutation-side emission to avoid duplication.\n  const hasMutationBuiltInFilteredQueryParams = mutations.some(\n    (verbOption) => !!verbOption.queryParams && !verbOption.paramsFilter,\n  );\n  // The single shared helper emitted below is used by both retrievals and\n  // mutations, so its object-serialization overload (issue #3705) must be\n  // gated across both groups.\n  const hasObjectParams = [...retrievals, ...mutations].some(\n    hasGatedObjectQueryParamStrategies,\n  );\n  const filterParamsHelper = hasBuiltInFilteredQueryParams\n    ? `\\n${getAngularFilteredParamsHelperBody({ hasObjectParams })}\\n`\n    : '';\n\n  const mutationImplementation = mutations\n    .map((verbOption) => {\n      const fullRoute = routeRegistry.get(\n        verbOption.operationName,\n        verbOption.route,\n      );\n      const generatorOptions: HttpClientGeneratorContext = {\n        route: fullRoute,\n        context: { output },\n      };\n\n      return generateHttpClientImplementation(verbOption, generatorOptions);\n    })\n    .join('\\n');\n\n  const baseUrlOption = output.override.angular.baseUrl;\n  const classImplementation = mutationImplementation\n    ? `\n${buildServiceClassOpen({\n  title,\n  isRequestOptions,\n  isMutator,\n  isGlobalMutator,\n  provideIn,\n  hasQueryParams:\n    hasMutationBuiltInFilteredQueryParams && !hasBuiltInFilteredQueryParams,\n  baseUrlFieldInitializer: baseUrlOption\n    ? `private readonly baseUrl = inject(${getBaseUrlTokenName(baseUrlOption.apiId)});`\n    : undefined,\n  hasObjectParams: mutations.some(hasGatedObjectQueryParamStrategies),\n})}\n${mutationImplementation}\n};\n`\n    : '';\n\n  return `${buildHttpResourceOptionsUtilities(isZodSchemaOutput(output))}${filterParamsHelper}${acceptHelpers ? `${acceptHelpers}\\n\\n` : ''}${resources}${classImplementation}${resourceTypes ? `\\n${resourceTypes}\\n` : ''}`;\n};\n\n/**\n * Generates the footer for Angular `httpResource` output.\n *\n * The footer appends any registered `ClientResult` aliases coming from shared\n * `HttpClient` mutation methods and the resource-state helper utilities emitted\n * for generated Angular resources.\n *\n * @returns The footer text for the generated Angular resource file.\n */\nexport const generateHttpResourceFooter: ClientFooterBuilder = ({\n  operationNames,\n}) => {\n  const clientTypes = getHttpClientReturnTypes(operationNames);\n  const utilities = buildResourceStateUtilities();\n\n  return `${clientTypes ? `${clientTypes}\\n` : ''}${utilities}`;\n};\n\n/**\n * Per-operation builder used during Angular `httpResource` generation.\n *\n * Unlike the `HttpClient` builder, the actual implementation body is emitted in\n * the header phase after all operations are known. This function mainly records\n * the resolved route and returns the imports required by the current operation.\n *\n * @returns An empty implementation plus the imports required by the operation.\n */\nexport const generateHttpResourceClient: ClientBuilder = (\n  verbOptions,\n  options,\n) => {\n  routeRegistry.set(verbOptions.operationName, options.route);\n  const baseUrlOption = options.context.output.override.angular.baseUrl;\n  // Mutation verbs render through the HttpClient generator (see\n  // `generateHttpResourceHeader`), so they need its `HttpResponse` import;\n  // whether as a value or a type depends on the method body. `HttpHeaders`\n  // is already a value import in `ANGULAR_HTTP_RESOURCE_DEPENDENCIES`.\n  const mutationImports = isMutationVerb(\n    verbOptions.verb,\n    verbOptions.operationName,\n    getClientOverride(verbOptions),\n  )\n    ? [\n        getAngularHttpResponseImport(\n          narrowsResponseEvents(verbOptions, options.context.output),\n        ),\n      ]\n    : [];\n  const imports = [\n    ...getHttpResourceVerbImports(verbOptions, options.context.output),\n    ...mutationImports,\n    ...(baseUrlOption\n      ? [\n          {\n            name: getBaseUrlTokenName(baseUrlOption.apiId),\n            values: true,\n            importPath: getAngularBaseUrlImportSpecifier(\n              options.context.output,\n            ),\n          },\n        ]\n      : []),\n  ];\n\n  return { implementation: '\\n', imports };\n};\n\nconst buildHttpResourceFile = (\n  verbOptions: Record<string, GeneratorVerbOptions>,\n  output: NormalizedOutputOptions,\n  context: ContextSpec,\n) => {\n  resourceReturnTypesRegistry.reset();\n\n  const retrievals = Object.values(verbOptions).filter((verbOption) =>\n    isRetrievalVerb(\n      verbOption.verb,\n      verbOption.operationName,\n      getClientOverride(verbOption),\n    ),\n  );\n\n  // Emit the shared `filterParams` helper only when at least one retrieval\n  // with query params lacks its own `paramsFilter` mutator — otherwise the\n  // helper would be dead code.\n  const hasBuiltInFilteredQueryParams = retrievals.some(\n    (verbOption) => !!verbOption.queryParams && !verbOption.paramsFilter,\n  );\n  const hasObjectParams = retrievals.some(hasGatedObjectQueryParamStrategies);\n  const filterParamsHelper = hasBuiltInFilteredQueryParams\n    ? `\\n${getAngularFilteredParamsHelperBody({ hasObjectParams })}\\n`\n    : '';\n\n  const resources = retrievals\n    .map((verbOption) => {\n      const fullRoute = getFullRoute(\n        verbOption.route,\n        context.spec.servers,\n        output.baseUrl,\n      );\n      return buildHttpResourceFunction(verbOption, fullRoute, output);\n    })\n    .join('\\n');\n\n  const resourceTypes = resourceReturnTypesRegistry.getFooter(\n    Object.values(verbOptions).map((verbOption) => verbOption.operationName),\n  );\n  const utilities = buildResourceStateUtilities();\n\n  // The `Accept` helpers are not declared here: the service sibling already\n  // exports them, and the resource file imports them (see\n  // `buildAcceptHelperImports`).\n  return `${buildHttpResourceOptionsUtilities(isZodSchemaOutput(output))}${filterParamsHelper}${resources}\\n${resourceTypes ? `${resourceTypes}\\n` : ''}${utilities}`;\n};\n\n/**\n * Names of the `Accept` helpers the resource file uses but does not declare.\n *\n * @remarks\n * In `both` mode the service sibling (`HttpClient` output) covers every\n * operation of the same scope and already exports one `<Op>Accept` helper per\n * multi-content-type operation. The resource file must not redeclare them:\n * the `tags-split` barrel does `export *` from both siblings, and two\n * declarations of one name make that ambiguous (TS2308). One declaration,\n * one owner — the resource file imports the helper instead.\n *\n * @returns The helper names to import from the service sibling.\n */\nconst buildAcceptHelperImports = (\n  retrievals: readonly GeneratorVerbOptions[],\n): GeneratorImport[] =>\n  retrievals\n    .filter(\n      (verbOption) =>\n        getUniqueContentTypes(verbOption.response.types.success).length > 1,\n    )\n    .map((verbOption) => ({ name: getAcceptHelperName(verbOption.typeName) }));\n\n/**\n * Resolves the schema imports of a generated `*.resource.ts` file. Uses core's\n * {@link resolveSchemaImportDependencies} so a resource file and its sibling\n * service file agree on the module that exports each schema.\n */\nconst buildSchemaImportDependencies = (\n  output: NormalizedOutputOptions,\n  imports: GeneratorImport[],\n  relativeSchemasPath: string,\n  schemaTagMap?: Map<string, string>,\n  schemaOutputPlan?: SchemaOutputPlan,\n): GeneratorDependency[] => {\n  const isZod = isZodSchemaOutput(output);\n\n  // Without emitted schemas, `relativeSchemasPath` is the single generated\n  // `*.schemas` file and not a directory, so per-schema routing does not apply.\n  //\n  // Imports arrive already tagged: an operation that parses a schema at runtime\n  // sets `values: true` (see `getHttpResourceVerbImports`); everything else —\n  // params, headers, body, `<Name>Output` aliases — stays type-only even in Zod\n  // mode (#3937). `dedupeSchemaImports` merges a type-only entry into its value\n  // twin, so the tag wins for the whole binding.\n  return output.schemas\n    ? resolveSchemaImportDependencies(output, imports, relativeSchemasPath, {\n        isZod,\n        schemaTagMap,\n        schemaOutputPlan,\n      })\n    : [\n        {\n          exports: dedupeSchemaImports(imports),\n          dependency: relativeSchemasPath,\n        },\n      ];\n};\n\nconst getHttpResourceExtraFilePath = (\n  output: NormalizedOutputOptions,\n  tag?: string,\n): string => {\n  const { extension, dirname, filename } = getFileInfo(output.target, {\n    extension: output.fileExtension,\n  });\n\n  switch (output.mode) {\n    case OutputMode.TAGS: {\n      const normalizedTag = getTagKey(tag);\n      return upath.joinSafe(dirname, `${normalizedTag}.resource${extension}`);\n    }\n    case OutputMode.TAGS_SPLIT: {\n      const normalizedTag = getTagKey(tag);\n      return upath.joinSafe(\n        dirname,\n        normalizedTag,\n        `${normalizedTag}.resource${extension}`,\n      );\n    }\n    default: {\n      return upath.joinSafe(dirname, `${filename}.resource${extension}`);\n    }\n  }\n};\n\n/**\n * Path of the `HttpClient` service file that sits next to the resource file\n * produced by {@link getHttpResourceExtraFilePath}.\n *\n * @remarks\n * Mirrors the core writers: `split` and `tags-split` add a `.service` suffix\n * for the Angular client, `single` and `tags` do not.\n */\nconst getHttpResourceServiceFilePath = (\n  output: NormalizedOutputOptions,\n  tag?: string,\n): string => {\n  const { extension, dirname, filename } = getFileInfo(output.target, {\n    extension: output.fileExtension,\n  });\n\n  switch (output.mode) {\n    case OutputMode.TAGS: {\n      return upath.joinSafe(dirname, `${getTagKey(tag)}${extension}`);\n    }\n    case OutputMode.TAGS_SPLIT: {\n      const normalizedTag = getTagKey(tag);\n      return upath.joinSafe(\n        dirname,\n        normalizedTag,\n        `${normalizedTag}.service${extension}`,\n      );\n    }\n    case OutputMode.SPLIT: {\n      return upath.joinSafe(dirname, `${filename}.service${extension}`);\n    }\n    default: {\n      return upath.joinSafe(dirname, `${filename}${extension}`);\n    }\n  }\n};\n\nconst getHttpResourceSchemasModule = (\n  output: NormalizedOutputOptions,\n  outputPath: string,\n): string => {\n  // `schemas.importPath` is a package specifier (e.g. `@acme/models`), not a\n  // filesystem path, so emit it as it is. This mirrors the split-mode writers.\n  const customImportPath = getSchemasImportPath(output.schemas);\n  if (customImportPath) {\n    return customImportPath;\n  }\n\n  const schemasPath =\n    typeof output.schemas === 'string' ? output.schemas : output.schemas?.path;\n\n  if (schemasPath) {\n    // Mirror the split-mode writers: resolve the import directly to the schemas\n    // directory (extension kept) so a dotted name like `*.schemas` is not\n    // collapsed to `./.` for the `both`-mode resource files (#3624).\n    return upath.getRelativeImportPath(outputPath, schemasPath, true);\n  }\n\n  const { dirname, filename, extension } = getFileInfo(output.target, {\n    extension: output.fileExtension,\n  });\n  return upath.getRelativeImportPath(\n    outputPath,\n    upath.joinSafe(dirname, `${filename}.schemas${extension}`),\n    output.fileExtension !== '.ts',\n  );\n};\n\nconst buildHttpResourceExtraFile = (\n  verbOptions: Record<string, GeneratorVerbOptions>,\n  outputPath: string,\n  servicePath: string,\n  output: NormalizedOutputOptions,\n  context: ContextSpec,\n  header: string,\n  schemaTagMap?: Map<string, string>,\n  schemaOutputPlan?: SchemaOutputPlan,\n) => {\n  const implementation = buildHttpResourceFile(verbOptions, output, context);\n  const retrievals = Object.values(verbOptions).filter((verbOption) =>\n    isRetrievalVerb(\n      verbOption.verb,\n      verbOption.operationName,\n      getClientOverride(verbOption),\n    ),\n  );\n  const verbImports = retrievals.flatMap((verbOption) =>\n    getHttpResourceVerbImports(verbOption, output),\n  );\n  // Type-only (no `values`): the helpers appear in parameter annotations\n  // only. Extension handling mirrors the base-URL dependency below.\n  const acceptHelperImports = buildAcceptHelperImports(retrievals);\n  const serviceDependency =\n    acceptHelperImports.length > 0\n      ? [\n          {\n            exports: acceptHelperImports,\n            dependency: upath.getRelativeImportPath(\n              outputPath,\n              servicePath,\n              output.fileExtension !== '.ts',\n            ),\n          },\n        ]\n      : [];\n\n  // Imports that declare an explicit `importPath` (e.g. rxjs's `map`\n  // operator, pulled in by `getHttpResourceVerbImports`) come from an\n  // external package, not the generated schemas module.\n  // `buildSchemaImportDependencies` has no concept of `importPath` and would\n  // otherwise bucket every import — including these — under the schemas\n  // dependency alongside real model types. Route them through the standard\n  // dependency merge instead, which resolves each import from its own path.\n  const schemaVerbImports = verbImports.filter((imp) => !imp.importPath);\n  const externalVerbImports = mergeDependencies(\n    verbImports\n      .filter(\n        (imp): imp is GeneratorImport & { importPath: string } =>\n          !!imp.importPath,\n      )\n      .map((imp) => ({ exports: [imp], dependency: imp.importPath })),\n  );\n\n  const schemaImports = buildSchemaImportDependencies(\n    output,\n    schemaVerbImports,\n    getHttpResourceSchemasModule(output, outputPath),\n    schemaTagMap,\n    schemaOutputPlan,\n  );\n\n  const dependencies = getAngularHttpResourceOnlyDependencies(false, false);\n  const baseUrlOption = output.override.angular.baseUrl;\n  const baseUrlDependency = baseUrlOption\n    ? [\n        {\n          exports: [\n            { name: getBaseUrlTokenName(baseUrlOption.apiId), values: true },\n          ],\n          // Only include a literal extension for non-`.ts` output (mirrors\n          // `getHttpResourceRelativeSchemasPath` above): TS5097 forbids a\n          // `.ts` import specifier unless `allowImportingTsExtensions` is set.\n          dependency: upath.getRelativeImportPath(\n            outputPath,\n            getAngularBaseUrlFilePath(output),\n            output.fileExtension !== '.ts',\n          ),\n        },\n      ]\n    : [];\n  const importImplementation = generateDependencyImports(\n    implementation,\n    [\n      ...schemaImports,\n      ...externalVerbImports,\n      ...serviceDependency,\n      ...dependencies,\n      ...baseUrlDependency,\n    ],\n    context.projectName,\n    !!output.schemas,\n    isSyntheticDefaultImportsAllow(output.tsconfig),\n  );\n\n  const mutators = Object.values(verbOptions)\n    .filter((verbOption) =>\n      isRetrievalVerb(\n        verbOption.verb,\n        verbOption.operationName,\n        getClientOverride(verbOption),\n      ),\n    )\n    .flatMap((verbOption) => {\n      // Only include mutators that are compatible with httpResource (single-arg).\n      // HttpClient mutators that require (config, httpClient) are skipped.\n      const resourceMutator =\n        verbOption.mutator && !verbOption.mutator.hasSecondArg\n          ? verbOption.mutator\n          : undefined;\n\n      return [\n        resourceMutator,\n        verbOption.formData,\n        verbOption.formUrlEncoded,\n        verbOption.paramsSerializer,\n        verbOption.paramsFilter,\n      ].filter(\n        (value): value is NonNullable<typeof value> => value !== undefined,\n      );\n    });\n\n  const mutatorImports =\n    mutators.length > 0\n      ? generateMutatorImports({\n          mutators,\n          oneMore: output.mode === OutputMode.TAGS_SPLIT,\n        })\n      : '';\n\n  return {\n    content: `${header}${importImplementation}${mutatorImports}${implementation}`,\n    path: outputPath,\n    // Part of the public client surface, so the `tags-split` barrel re-exports\n    // it.\n    barrelExport: true,\n    sharedExports: HTTP_RESOURCE_SHARED_EXPORTS,\n  };\n};\n\n/**\n * Generates the extra sibling resource files used by Angular `both` mode.\n *\n * @remarks\n * The main generated file keeps the `HttpClient` service class while retrieval\n * resources are emitted into `*.resource.ts` so consumers can opt into both\n * access patterns without mixing the generated surfaces. In tag-based output\n * modes this emits one sibling resource file per generated tag file.\n *\n * @returns One or more extra file descriptors representing generated resource files.\n */\nexport const generateHttpResourceExtraFiles: ClientExtraFilesBuilder = (\n  verbOptions,\n  output,\n  context,\n  schemaTagMap,\n  schemaOutputPlan,\n) => {\n  const header = getHeader(output.override.header, context.spec.info);\n\n  if (!hasRetrievalOperations(verbOptions)) {\n    return Promise.resolve([]);\n  }\n\n  if (\n    output.mode === OutputMode.TAGS ||\n    output.mode === OutputMode.TAGS_SPLIT\n  ) {\n    const groupedVerbOptions = new Map<\n      string,\n      Record<string, GeneratorVerbOptions>\n    >();\n\n    for (const verbOption of Object.values(verbOptions)) {\n      const tag = getPrimaryTag(verbOption);\n      const currentGroup = groupedVerbOptions.get(tag) ?? {};\n      currentGroup[verbOption.operationId] = verbOption;\n      groupedVerbOptions.set(tag, currentGroup);\n    }\n\n    return Promise.resolve(\n      [...groupedVerbOptions.entries()]\n        .filter(([, tagVerbOptions]) => hasRetrievalOperations(tagVerbOptions))\n        .map(([tag, tagVerbOptions]) =>\n          buildHttpResourceExtraFile(\n            tagVerbOptions,\n            getHttpResourceExtraFilePath(output, tag),\n            getHttpResourceServiceFilePath(output, tag),\n            output,\n            context,\n            header,\n            schemaTagMap,\n            schemaOutputPlan,\n          ),\n        ),\n    );\n  }\n\n  return Promise.resolve([\n    buildHttpResourceExtraFile(\n      getVerbOptionsRecord(getRelevantVerbOptionsForTag(verbOptions)),\n      getHttpResourceExtraFilePath(output),\n      getHttpResourceServiceFilePath(output),\n      output,\n      context,\n      header,\n      schemaTagMap,\n      schemaOutputPlan,\n    ),\n  ]);\n};\n\nexport { generateAngularTitle } from './utils';\n","import type { AngularOptions, ClientGeneratorsBuilder } from '@orval/core';\n\nimport { generateAngularBaseUrlExtraFiles } from './base-url';\nimport {\n  generateAngular,\n  generateAngularFooter,\n  generateAngularHeader,\n  generateAngularTitle,\n  getAngularDependencies,\n} from './http-client';\nimport {\n  generateHttpResourceClient,\n  generateHttpResourceExtraFiles,\n  generateHttpResourceFooter,\n  generateHttpResourceHeader,\n  getAngularHttpResourceDependencies,\n} from './http-resource';\n\nexport * from './base-url';\nexport * from './constants';\nexport * from './http-client';\nexport * from './http-resource';\nexport * from './types';\nexport * from './utils';\n\nconst httpClientBuilder: ClientGeneratorsBuilder = {\n  client: generateAngular,\n  header: generateAngularHeader,\n  dependencies: getAngularDependencies,\n  footer: generateAngularFooter,\n  title: generateAngularTitle,\n  extraFiles: generateAngularBaseUrlExtraFiles,\n};\n\nconst httpResourceBuilder: ClientGeneratorsBuilder = {\n  client: generateHttpResourceClient,\n  header: generateHttpResourceHeader,\n  dependencies: getAngularHttpResourceDependencies,\n  footer: generateHttpResourceFooter,\n  title: generateAngularTitle,\n  extraFiles: generateAngularBaseUrlExtraFiles,\n};\n\nconst bothClientBuilder: ClientGeneratorsBuilder = {\n  ...httpClientBuilder,\n  extraFiles: async (\n    verbOptions,\n    output,\n    context,\n    schemaTagMap,\n    schemaOutputPlan,\n  ) => [\n    ...(await generateHttpResourceExtraFiles(\n      verbOptions,\n      output,\n      context,\n      schemaTagMap,\n      schemaOutputPlan,\n    )),\n    ...(await generateAngularBaseUrlExtraFiles(verbOptions, output, context)),\n  ],\n};\n\nexport const builder = () => (options?: AngularOptions) => {\n  switch (options?.client) {\n    case 'httpResource': {\n      return httpResourceBuilder;\n    }\n    case 'both': {\n      return bothClientBuilder;\n    }\n    default: {\n      return httpClientBuilder;\n    }\n  }\n};\n\nexport default builder;\n"],"mappings":";;;;;;;;;AAuBA,MAAMA,eACJ,QACA,SACW;CACX,IAAI,CAAC,UAAU,CAAC,MACd,OAAO;CAGT,MAAM,SAAS,OAAO,IAAI;CAE1B,OAAO,MAAM,QAAQ,MAAM,IAAI,MAAM,EAAE,aAAa,OAAO,CAAC,IAAI;AAClE;;AAGA,MAAa,4BAA4B,UACvC,MAAM,KAAK,CAAC,CAAC,YAAY;;AAG3B,MAAa,mCAAmC,UAC9C,GAAG,yBAAyB,KAAK,EAAE;;AAGrC,MAAa,uBAAuB,UAClC,GAAG,yBAAyB,KAAK,EAAE;;AAGrC,MAAa,+BAA+B,UAC1C,GAAG,yBAAyB,KAAK,EAAE;;AAGrC,MAAa,8BAA8B,UACzC,GAAG,OAAO,KAAK,EAAE;;AAGnB,MAAa,qCAAqC,UAChD,GAAG,OAAO,KAAK,EAAE;;AAGnB,MAAa,yBAAyB,UACpC,UAAU,OAAO,KAAK,EAAE;;AAG1B,MAAa,iCAAiC,UAC5C,UAAU,OAAO,KAAK,EAAE;;;;;;;;;;;;;;;;;AAkB1B,MAAa,kCAAkC,EAC7C,OACA,gBAIY;CACZ,MAAM,wBAAwB,gCAAgC,KAAK;CACnE,MAAM,YAAY,oBAAoB,KAAK;CAC3C,MAAM,oBAAoB,4BAA4B,KAAK;CAC3D,MAAM,mBAAmB,2BAA2B,KAAK;CACzD,MAAM,kBAAkB,kCAAkC,KAAK;CAC/D,MAAM,qBAAqB,sBAAs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