{"version":3,"file":"index.cjs","names":["ast","Diagnostics","ast","containsCircularRef","File","Const","Type","Function","syncSchemaRef","ast","containsCircularRef","ast","syncSchemaRef","extractRefName","ast","defineGenerator","jsxRenderer","File","ast","createResolver","defineExtension","Resolver"],"sources":["../../../internals/shared/src/operation.ts","../../../internals/shared/src/adapter.ts","../../../internals/utils/src/casing.ts","../../../internals/utils/src/reserved.ts","../../../internals/utils/src/strings.ts","../../../internals/utils/src/codegen.ts","../../../internals/utils/src/fs.ts","../../../internals/shared/src/resolver.ts","../../../internals/shared/src/group.ts","../../../internals/shared/src/schemaTraversal.ts","../src/components/Zod.tsx","../src/utils.ts","../src/printers/printerZod.ts","../src/printers/printerZodMini.ts","../src/generators/zodGenerator.tsx","../kubb-extension.json","../package.json","../src/resolvers/resolverZod.ts","../src/plugin.ts"],"sourcesContent":["import { ast, type Group, type NodeCache, type Output, type Resolver, type ResolverFileParams, Url } from 'kubb/kit'\n\n/**\n * Builds the `ResolverFileParams` every operation generator passes to\n * `resolver.file`: a file named `name`, tagged by the operation's first\n * tag (or `'default'`), at the operation's path. Centralizes the entry object\n * that was repeated at dozens of call sites across the client and query plugins.\n *\n * @example\n * ```ts\n * resolver.file(operationFileEntry(node, node.operationId), { root, output, group })\n * ```\n */\nexport function operationFileEntry(node: ast.OperationNode, name: string, extname: ResolverFileParams['extname'] = '.ts'): ResolverFileParams {\n  return {\n    name,\n    extname,\n    tag: node.tags[0] ?? 'default',\n    path: node.path,\n  }\n}\n\n/**\n * Resolves a dependency plugin's generated file for `node.operationId`, cached in `cache` (the\n * current node's `ctx.cache`) under the resolver's own plugin name. Several dependents reading the\n * same dependency for the same operation in one pass (a query plugin's several hook generators, the\n * MCP handler, ...) share one computed name and path instead of each calling `resolver.file` again.\n *\n * @example Cache `plugin-ts`'s file for the current operation\n * ```ts\n * const fileTs = resolveDependencyOperationFile({ cache: ctx.cache, node, resolver: tsResolver, root, output })\n * ```\n */\nexport function resolveDependencyOperationFile(options: {\n  cache: NodeCache\n  node: ast.OperationNode\n  resolver: Pick<Resolver, 'file' | 'pluginName'>\n  root: string\n  output: Output\n  group?: Group | null\n}): ast.FileNode {\n  const { cache, node, resolver, root, output, group } = options\n\n  return cache.ensureItem(`${resolver.pluginName}:operationFile`, () =>\n    resolver.file({ ...operationFileEntry(node, node.operationId), root, output, group: group ?? undefined }),\n  )\n}\n\nexport type ContentTypeInfo = {\n  contentTypes: string[]\n  isMultipleContentTypes: boolean\n  contentTypeUnion: string\n  defaultContentType: string\n  hasFormData: boolean\n}\n\nexport type RequestConfigResolver = {\n  response: {\n    body(node: ast.OperationNode): string\n  }\n}\n\nexport type ResponseStatusNameResolver = {\n  response: {\n    status(node: ast.OperationNode, statusCode: ast.StatusCode): string\n  }\n}\n\nexport type ResponseNameResolver = ResponseStatusNameResolver & {\n  response: {\n    response(node: ast.OperationNode): string\n  }\n}\n\nexport type OperationTypeNameResolver = RequestConfigResolver &\n  ResponseNameResolver & {\n    param: {\n      path(node: ast.OperationNode, param: ast.ParameterNode): string\n      query(node: ast.OperationNode, param: ast.ParameterNode): string\n      headers(node: ast.OperationNode, param: ast.ParameterNode): string\n    }\n  }\n\nexport type OperationCommentLink = 'pathTemplate' | 'urlPath' | false | ((node: ast.OperationNode) => string | undefined)\n\nexport type BuildOperationCommentsOptions = {\n  link?: OperationCommentLink\n  linkPosition?: 'beforeDeprecated' | 'afterDeprecated'\n  splitLines?: boolean\n}\n\ntype ResponseLike = {\n  statusCode: ast.StatusCode | number | string\n}\n\nexport type OperationParameterGroups = Record<ast.ParameterNode['in'], Array<ast.ParameterNode>>\n\nexport type ResolveOperationTypeNameOptions = {\n  responseStatusNames?: boolean | 'error'\n  exclude?: ReadonlyArray<string | undefined>\n  order?: 'params-first' | 'body-response-first'\n  /**\n   * Include the individual `Path`/`Query`/`Headers` group type names. Set to `false` for clients\n   * that reference the grouped `Options` type instead of the per-group types.\n   */\n  includeParams?: boolean\n}\n\nfunction getOperationLink(node: ast.OperationNode, link: OperationCommentLink): string | null {\n  if (!link) {\n    return null\n  }\n\n  if (typeof link === 'function') {\n    return link(node) ?? null\n  }\n\n  return node.path ? `{@link ${Url.toPath(node.path)}}` : null\n}\n\n/**\n * Derives the shared `ContentTypeInfo` shape from a list of content types, tracking whether several\n * are present and the union, default, and form-data flags the client uses to pick one.\n */\nfunction buildContentTypeInfo(contentTypes: string[]): ContentTypeInfo {\n  const isMultipleContentTypes = contentTypes.length > 1\n\n  return {\n    contentTypes,\n    isMultipleContentTypes,\n    contentTypeUnion: isMultipleContentTypes ? contentTypes.map((ct) => JSON.stringify(ct)).join(' | ') : '',\n    defaultContentType: contentTypes[0] ?? 'application/json',\n    hasFormData: contentTypes.some((ct) => ct === 'multipart/form-data'),\n  }\n}\n\nexport function getContentTypeInfo(node: ast.OperationNode): ContentTypeInfo {\n  return buildContentTypeInfo(node.requestBody?.content?.map((e) => e.contentType) ?? [])\n}\n\n/**\n * The request-body counterpart for the primary success response: the content types it documents and\n * whether several are present, so the client can let a caller pick which one to accept.\n */\nexport function getResponseContentTypeInfo(node: ast.OperationNode): ContentTypeInfo {\n  return buildContentTypeInfo(getPrimarySuccessResponse(node)?.content?.map((e) => e.contentType) ?? [])\n}\n\nexport type ResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'\n\n/**\n * Reads the single base content type of an operation's primary success response, lowercased and\n * stripped of any `; charset=...` suffix. Returns `undefined` when the response declares zero or\n * more than one content type, since neither case has a single type to act on.\n */\nfunction getPrimarySuccessContentType(node: ast.OperationNode): string | undefined {\n  const contentTypes = getPrimarySuccessResponse(node)?.content?.map((entry) => entry.contentType) ?? []\n  if (contentTypes.length !== 1) return undefined\n  return contentTypes[0]!.split(';')[0]!.trim().toLowerCase()\n}\n\n/**\n * Whether an operation streams its primary success response as Server-Sent Events\n * (`text/event-stream`). The client generator uses this to return a typed event stream instead of a\n * one-shot `RequestResult`.\n */\nexport function isEventStream(node: ast.OperationNode): boolean {\n  return getPrimarySuccessContentType(node) === 'text/event-stream'\n}\n\n/**\n * Derives the default `responseType` for an operation from its primary success response.\n *\n * Returns a value only when that response declares a single non-JSON content type. `text/event-stream`\n * and other binary types (`application/octet-stream`, `application/pdf`, `image/*`, `audio/*`,\n * `video/*`) map to a stream or `'blob'`, and other `text/*` maps to `'text'`. Otherwise `undefined`,\n * leaving the runtime client's `Content-Type` auto-detection in charge.\n */\nexport function getResponseType(node: ast.OperationNode): ResponseType | undefined {\n  const baseType = getPrimarySuccessContentType(node)\n  if (!baseType) return undefined\n\n  if (baseType === 'application/json' || baseType.endsWith('+json') || baseType === 'text/json') return undefined\n  if (baseType === 'text/event-stream') return 'stream'\n  if (baseType.startsWith('text/')) return 'text'\n  if (baseType === 'application/octet-stream' || baseType === 'application/pdf' || /^(image|audio|video)\\//.test(baseType)) return 'blob'\n  return undefined\n}\n\n/**\n * Maps a content type to the PascalCase suffix used to name per-content-type variants\n * (e.g. `application/json` → `Json`, `application/xml` → `Xml`, `multipart/form-data` → `FormData`).\n */\nfunction getContentTypeSuffix(contentType: string): string {\n  const baseType = contentType.split(';')[0]!.trim()\n  if (baseType === 'application/json') return 'Json'\n  if (baseType === 'multipart/form-data') return 'FormData'\n  if (baseType === 'application/x-www-form-urlencoded') return 'FormUrlEncoded'\n  const subtype = baseType.split('/').pop() ?? baseType\n  const parts = subtype.split(/[^a-zA-Z0-9]+/).filter(Boolean)\n  if (parts.length === 0) return 'Unknown'\n  return parts.map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join('')\n}\n\n/**\n * Appends a content-type suffix to a base name, keeping a trailing `Data` segment last\n * (e.g. `AddPetData` + `Json` → `AddPetJsonData`, `AddPetStatus200` + `Xml` → `AddPetStatus200Xml`).\n */\nexport function getPerContentTypeName(baseName: string, suffix: string): string {\n  if (baseName.endsWith('Data')) {\n    return suffix.endsWith('Data') ? baseName.slice(0, -4) + suffix : `${baseName.slice(0, -4)}${suffix}Data`\n  }\n  return baseName + suffix\n}\n\nexport type ContentVariantInput = { contentType: string; schema?: ast.SchemaNode | null; keysToOmit?: Array<string> | null }\nexport type ContentVariant = { name: string; suffix: string; schema: ast.SchemaNode; keysToOmit?: Array<string> | null; contentType: string }\n\n/**\n * Resolves per-content-type variant names for a set of content entries, deduplicating suffix\n * collisions with a numeric counter. Entries without a schema are skipped. The returned `suffix` is\n * the final (possibly counter-augmented) value, so callers can derive parallel names in another\n * namespace (e.g. plugin-faker deriving the matching plugin-ts type name).\n */\nexport function resolveContentTypeVariants(entries: Array<ContentVariantInput>, baseName: string): Array<ContentVariant> {\n  const usedNames = new Set<string>()\n  return entries\n    .filter((entry) => entry.schema)\n    .map((entry) => {\n      const baseSuffix = getContentTypeSuffix(entry.contentType)\n      let suffix = baseSuffix\n      let name = getPerContentTypeName(baseName, suffix)\n      let counter = 2\n      while (usedNames.has(name)) {\n        suffix = `${baseSuffix}${counter++}`\n        name = getPerContentTypeName(baseName, suffix)\n      }\n      usedNames.add(name)\n      return { name, suffix, schema: entry.schema!, keysToOmit: entry.keysToOmit, contentType: entry.contentType }\n    })\n}\n\n// The request groups come from the grouped params, so `config` drops the data-shape keys to stay\n// assignable to `Options`, which omits them from `RequestConfig`.\nconst requestConfigBaseType = `Partial<Omit<RequestConfig, 'path' | 'query' | 'body' | 'headers' | 'url'>>`\n\nexport function buildRequestConfigType(node: ast.OperationNode): string {\n  const request = getContentTypeInfo(node)\n  const response = getResponseContentTypeInfo(node)\n\n  // Only the ambiguous side is offered: a single-type side has nothing to pick, so it stays baked in\n  // the generated call.\n  const members = [\n    request.isMultipleContentTypes ? `request?: ${request.contentTypeUnion}` : null,\n    response.isMultipleContentTypes ? `response?: ${response.contentTypeUnion}` : null,\n  ].filter(Boolean)\n\n  return members.length ? `${requestConfigBaseType} & { contentType?: { ${members.join('; ')} } }` : requestConfigBaseType\n}\n\n/**\n * Builds the `client?:` option type shared by the generated query hooks (`useQuery`,\n * `useInfiniteQuery`, `useSWR`, ...). Unlike {@link buildRequestConfigType}, it never adds a\n * `contentType?:` member: query hooks wrap GET operations, which carry no request body to select a\n * content type for.\n */\nexport function buildClientOptionType(): string {\n  return requestConfigBaseType\n}\n\nexport type RequestGroups = {\n  path: boolean\n  query: boolean\n  body: boolean\n  headers: boolean\n}\n\n/**\n * Which of the grouped request options an operation carries.\n */\nexport function getRequestGroups(node: ast.OperationNode): RequestGroups {\n  const { path, query, header } = getOperationParameters(node)\n  return {\n    path: path.length > 0,\n    query: query.length > 0,\n    body: Boolean(node.requestBody?.content?.[0]?.schema),\n    headers: header.length > 0,\n  }\n}\n\nexport type RequestGroupOptionality = {\n  groups: RequestGroups\n  hasRequiredPath: boolean\n  hasRequiredQuery: boolean\n  hasRequiredHeader: boolean\n  /**\n   * Whether the grouped request parameter can default to `{}`. True only when no group carries a\n   * required member, so every member is safe to omit.\n   */\n  isOptional: boolean\n}\n\n/**\n * Resolves which grouped request options an operation carries together with whether each group\n * holds a required member. The grouped parameter stays optional only when nothing inside it is\n * required, matching the generated `RequestConfig` type.\n */\nexport function getRequestGroupOptionality(node: ast.OperationNode): RequestGroupOptionality {\n  const groups = getRequestGroups(node)\n  const { path, query, header } = getOperationParameters(node)\n  const hasRequiredPath = path.some((param) => param.required)\n  const hasRequiredQuery = query.some((param) => param.required)\n  const hasRequiredHeader = header.some((param) => param.required)\n\n  return {\n    groups,\n    hasRequiredPath,\n    hasRequiredQuery,\n    hasRequiredHeader,\n    isOptional: !hasRequiredPath && !hasRequiredQuery && !hasRequiredHeader && !groups.body,\n  }\n}\n\nexport type RequestOptionsNameResolver = RequestConfigResolver & {\n  response: {\n    options(node: ast.OperationNode): string\n  }\n}\n\n/**\n * Builds the grouped `{ path, query, body, headers }` parameter for a generated client\n * function, typed from the operation's `Options` (minus `url`). Only the groups the\n * operation actually has are destructured. The trailing `config` parameter carries the\n * runtime `RequestConfig` overrides plus `client`.\n */\nexport function buildRequestParamsSignature(\n  node: ast.OperationNode,\n  resolver: RequestOptionsNameResolver,\n  options: { isConfigurable?: boolean } = {},\n): { signature: string; groups: RequestGroups } {\n  const { isConfigurable = true } = options\n  const { groups, isOptional } = getRequestGroupOptionality(node)\n\n  const names = (['path', 'query', 'body', 'headers'] as const).filter((key) => groups[key])\n\n  const firstParam = names.length > 0 ? `{ ${names.join(', ')} }: ${resolver.response.options(node)}${isOptional ? ' = {}' : ''}` : null\n  const configParam = isConfigurable ? `config: ${buildRequestConfigType(node)} = {}` : null\n\n  return {\n    signature: [firstParam, configParam].filter(Boolean).join(', '),\n    groups,\n  }\n}\n\nexport function buildOperationComments(node: ast.OperationNode, options: BuildOperationCommentsOptions = {}): Array<string> {\n  const { link = 'pathTemplate', linkPosition = 'afterDeprecated', splitLines = false } = options\n  const linkComment = getOperationLink(node, link)\n  const comments =\n    linkPosition === 'beforeDeprecated'\n      ? [node.description && `@description ${node.description}`, node.summary && `@summary ${node.summary}`, linkComment, node.deprecated && '@deprecated']\n      : [node.description && `@description ${node.description}`, node.summary && `@summary ${node.summary}`, node.deprecated && '@deprecated', linkComment]\n\n  const filteredComments = comments.filter((comment): comment is string => Boolean(comment))\n\n  if (!splitLines) {\n    return filteredComments\n  }\n\n  return filteredComments.flatMap((text) => text.split(/\\r?\\n/).map((line) => line.trim())).filter((comment): comment is string => Boolean(comment))\n}\n\nconst operationParameterGroupsByNode = new WeakMap<ast.OperationNode, OperationParameterGroups>()\n\n/**\n * Groups an operation's parameters by location (`path`/`query`/`header`/`cookie`), deduping each\n * group by name. Every plugin generator visiting the same `OperationNode` shares one AST instance\n * (see `KubbDriver`), so the result is cached per node to avoid re-filtering and re-deduping the\n * same parameters once per plugin.\n */\nexport function getOperationParameters(node: ast.OperationNode): OperationParameterGroups {\n  const cached = operationParameterGroupsByNode.get(node)\n  if (cached) return cached\n\n  // A malformed spec can declare the same name twice within one location. Both would resolve to the\n  // same output property, so emitting both would yield an object type with a duplicate member,\n  // which TypeScript rejects. Keep the first.\n  const group = (location: ast.ParameterNode['in']) => {\n    const seen = new Set<string>()\n\n    return node.parameters.filter((param) => {\n      if (param.in !== location || seen.has(param.name)) return false\n      seen.add(param.name)\n      return true\n    })\n  }\n\n  const groups: OperationParameterGroups = { path: group('path'), query: group('query'), header: group('header'), cookie: group('cookie') }\n\n  operationParameterGroupsByNode.set(node, groups)\n  return groups\n}\n\n/**\n * Builds the combined `{ body, path, query, headers }` options object schema for an operation,\n * referencing the already-resolved body and grouped param names. Shared by `@kubb/plugin-ts`'s\n * `Options` type and `@kubb/plugin-zod`'s inferred options schema, so both printers emit the same\n * shape from the same inputs. `primitive: 'object'` is a no-op for the TS printer and tells the Zod\n * printer to emit `z.object(…)` rather than a record.\n */\nexport function buildOptionsSchema(node: ast.OperationNode, resolver: OperationTypeNameResolver): ast.SchemaNode {\n  const { path, query, header } = getOperationParameters(node)\n  const hasBody = Boolean(node.requestBody?.content?.[0]?.schema)\n  const createNever = () => ast.factory.createSchema({ type: 'never', primitive: undefined, optional: true })\n  const groups = [\n    { name: 'path', params: path, resolve: resolver.param.path },\n    { name: 'query', params: query, resolve: resolver.param.query },\n    { name: 'headers', params: header, resolve: resolver.param.headers },\n  ] as const\n\n  // NOTE(v5-stable): the fields were renamed from the legacy beta shape\n  // (`data`/`pathParams`/`queryParams`/`headerParams`) to `body`/`path`/`query`/`headers` so the\n  // type matches the runtime client. Drop this note once v5 leaves beta.\n  return ast.factory.createSchema({\n    type: 'object',\n    primitive: 'object',\n    deprecated: node.deprecated,\n    properties: [\n      ast.factory.createProperty({\n        name: 'body',\n        required: hasBody,\n        schema: hasBody ? ast.factory.createSchema({ type: 'ref', name: resolver.response.body(node) }) : createNever(),\n      }),\n      ...groups.map(({ name, params, resolve }) => {\n        const required = params.some((param) => param.required)\n\n        return ast.factory.createProperty({\n          name,\n          required,\n          schema:\n            params.length > 0\n              ? ast.factory.createSchema({ type: 'ref', name: resolve.call(resolver.param, node, params[0]!), optional: !required })\n              : createNever(),\n        })\n      }),\n    ],\n  })\n}\n\n/**\n * The schema a status occupies in the `<Name>Responses` record. A status that documents several\n * content types becomes a `{ contentType; data }` union so the runtime can surface the negotiated type\n * on `result.parsed`, while the standalone `<Name>StatusNNN` alias stays the plain body union that the\n * query hooks and `result.data` use.\n */\nfunction buildResponseRecordEntry(node: ast.OperationNode, res: ast.ResponseNode, resolver: ResponseStatusNameResolver): ast.SchemaNode {\n  const statusName = resolver.response.status(node, res.statusCode)\n  const variants = (res.content ?? []).filter((entry) => entry.schema)\n  if (variants.length <= 1) {\n    return ast.factory.createSchema({ type: 'ref', name: statusName })\n  }\n\n  return ast.factory.createSchema({\n    type: 'union',\n    members: resolveContentTypeVariants(variants, statusName).map((variant) =>\n      ast.factory.createSchema({\n        type: 'object',\n        primitive: 'object',\n        properties: [\n          ast.factory.createProperty({\n            name: 'contentType',\n            required: true,\n            schema: ast.factory.createSchema({ type: 'enum', enumValues: [variant.contentType] }),\n          }),\n          ast.factory.createProperty({\n            name: 'data',\n            required: true,\n            schema: ast.factory.createSchema({ type: 'ref', name: variant.name }),\n          }),\n        ],\n      }),\n    ),\n  })\n}\n\n/**\n * Builds the per-status `<Name>Responses` record for an operation, referencing the already-resolved\n * `<Name>StatusNNN` names. Shared by `@kubb/plugin-ts`'s `Responses` type and `@kubb/plugin-zod`'s\n * inferred responses schema, so both emit the same shape from the same inputs.\n *\n * Always emits the keyed record, even when an operation declares no responses. An operation with no\n * responses renders as an empty object, which keeps every consumer's import (for example the axios\n * SDK's `RequestResult<XResponses>`) resolvable instead of pointing at a missing export.\n */\nexport function buildResponses(node: ast.OperationNode, resolver: ResponseStatusNameResolver): ast.SchemaNode {\n  return ast.factory.createSchema({\n    type: 'object',\n    primitive: 'object',\n    properties: node.responses.map((res) =>\n      ast.factory.createProperty({\n        name: String(res.statusCode),\n        required: true,\n        schema: buildResponseRecordEntry(node, res, resolver),\n      }),\n    ),\n  })\n}\n\nexport function getStatusCodeNumber(statusCode: ast.StatusCode | number | string): number | null {\n  const code = Number(statusCode)\n\n  return Number.isNaN(code) ? null : code\n}\n\nexport function isSuccessStatusCode(statusCode: ast.StatusCode | number | string): boolean {\n  const code = getStatusCodeNumber(statusCode)\n\n  return code !== null && code >= 200 && code < 300\n}\n\nexport function isErrorStatusCode(statusCode: ast.StatusCode | number | string): boolean {\n  const code = getStatusCodeNumber(statusCode)\n\n  return code !== null && code >= 400\n}\n\nexport function getSuccessResponses<TResponse extends ResponseLike>(responses: ReadonlyArray<TResponse>): Array<TResponse> {\n  return responses.filter((response) => isSuccessStatusCode(response.statusCode))\n}\n\nexport function getOperationSuccessResponses(node: ast.OperationNode): Array<ast.ResponseNode> {\n  return getSuccessResponses(node.responses)\n}\n\nexport function getPrimarySuccessResponse(node: ast.OperationNode): ast.ResponseNode | null {\n  return getOperationSuccessResponses(node)[0] ?? null\n}\n\nexport function resolveErrorNames(node: ast.OperationNode, resolver: ResponseStatusNameResolver): string[] {\n  return node.responses.filter((response) => isErrorStatusCode(response.statusCode)).map((response) => resolver.response.status(node, response.statusCode))\n}\n\nexport function resolveSuccessNames(node: ast.OperationNode, resolver: ResponseStatusNameResolver): string[] {\n  return node.responses.filter((response) => isSuccessStatusCode(response.statusCode)).map((response) => resolver.response.status(node, response.statusCode))\n}\n\nexport function resolveStatusCodeNames(node: ast.OperationNode, resolver: ResponseStatusNameResolver): string[] {\n  return node.responses.map((response) => resolver.response.status(node, response.statusCode))\n}\n\nconst typeNamesByResolver = new WeakMap<OperationTypeNameResolver, Map<string, string[]>>()\n\nexport function resolveOperationTypeNames(\n  node: ast.OperationNode,\n  resolver: OperationTypeNameResolver,\n  options: ResolveOperationTypeNameOptions = {},\n): string[] {\n  const cacheKey = `${node.operationId}\\0${options.order ?? ''}\\0${options.responseStatusNames ?? ''}\\0${options.includeParams === false ? 'noparams' : ''}\\0${(options.exclude ?? []).join(',')}`\n  let byResolver = typeNamesByResolver.get(resolver)\n  if (byResolver) {\n    const cached = byResolver.get(cacheKey)\n    if (cached) return cached\n  } else {\n    byResolver = new Map()\n    typeNamesByResolver.set(resolver, byResolver)\n  }\n\n  const { path, query, header } = getOperationParameters(node)\n  const responseStatusNames =\n    options.responseStatusNames === 'error'\n      ? resolveErrorNames(node, resolver)\n      : options.responseStatusNames === false\n        ? []\n        : resolveStatusCodeNames(node, resolver)\n  const exclude = new Set(options.exclude ?? [])\n  const paramNames =\n    options.includeParams === false\n      ? []\n      : [\n          ...path.map((param) => resolver.param.path(node, param)),\n          ...query.map((param) => resolver.param.query(node, param)),\n          ...header.map((param) => resolver.param.headers(node, param)),\n        ]\n  const bodyAndResponseNames = [node.requestBody?.content?.[0]?.schema ? resolver.response.body(node) : null, resolver.response.response(node)]\n  const names =\n    options.order === 'body-response-first'\n      ? [...bodyAndResponseNames, ...paramNames, ...responseStatusNames]\n      : [...paramNames, ...bodyAndResponseNames, ...responseStatusNames]\n\n  const result = names.filter((name): name is string => Boolean(name) && !exclude.has(name as string))\n  byResolver.set(cacheKey, result)\n  return result\n}\n\nexport function resolveResponseTypes(node: ast.OperationNode, resolver: ResponseNameResolver): Array<[statusCode: number | 'default', typeName: string]> {\n  const types: Array<[number | 'default', string]> = []\n\n  for (const response of node.responses) {\n    if (response.statusCode === 'default') {\n      types.push(['default', resolver.response.response(node)])\n      continue\n    }\n\n    const code = getStatusCodeNumber(response.statusCode)\n    if (code === null) {\n      continue\n    }\n\n    types.push([code, isSuccessStatusCode(code) ? resolver.response.response(node) : resolver.response.status(node, response.statusCode)])\n  }\n\n  return types\n}\n","import { type Adapter, Diagnostics } from 'kubb/kit'\nimport type { AdapterOas } from '@kubb/adapter-oas'\n\n/**\n * Narrows the generic `Adapter` from a generator context to the OpenAPI adapter,\n * so OAS-only options (`dateType`, `enums`) and the parsed `document` are typed.\n *\n * Throws when a non-OAS adapter is configured, turning a silently wrong cast into a\n * clear, actionable error at the point of use.\n *\n * @example\n * ```ts\n * const { dateType } = getOasAdapter(ctx.adapter).options\n * ```\n */\nexport function getOasAdapter(adapter: Adapter): Adapter<AdapterOas> {\n  if (adapter.name !== 'oas') {\n    throw new Diagnostics.Error({\n      code: Diagnostics.code.adapterRequired,\n      severity: 'error',\n      message: `Expected the OpenAPI adapter (adapterOas), but received \"${adapter.name}\".`,\n      help: 'Set `adapter: adapterOas()` in kubb.config.ts.',\n      location: { kind: 'config' },\n    })\n  }\n\n  return adapter as Adapter<AdapterOas>\n}\n","type Options = {\n  /**\n   * Text prepended before casing is applied.\n   */\n  prefix?: string\n  /**\n   * Text appended before casing is applied.\n   */\n  suffix?: string\n}\n\n/**\n * Shared implementation for camelCase and PascalCase conversion.\n * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)\n * and capitalizes each word according to `pascal`.\n *\n * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.\n */\nfunction convert(text: string, pascal: boolean): string {\n  return text\n    .trim()\n    .replace(/([a-z\\d])([A-Z])/g, '$1 $2')\n    .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n    .replace(/(\\d)([a-z])/g, '$1 $2')\n    .split(/[\\s\\-_./\\\\:]+/)\n    .filter(Boolean)\n    .map((word, i) => {\n      if (word.length > 1 && word === word.toUpperCase()) return word\n      const head = i === 0 && !pascal ? word.charAt(0).toLowerCase() : word.charAt(0).toUpperCase()\n      return head + word.slice(1)\n    })\n    .join('')\n    .replace(/[^a-zA-Z0-9]/g, '')\n}\n\n// Plugins resolve the same names over and over (about 47,000 calls for a 1,000 schema spec), so\n// results are kept. Clearing at the limit bounds the memory a long-running process spends on it.\nconst cache = new Map<string, string>()\nconst cacheLimit = 10_000\n\nfunction toCamelOrPascal(text: string, pascal: boolean): string {\n  const key = `${pascal ? 'P' : 'c'}${text}`\n  const cached = cache.get(key)\n  if (cached !== undefined) return cached\n\n  const result = convert(text, pascal)\n  if (cache.size >= cacheLimit) cache.clear()\n  cache.set(key, result)\n  return result\n}\n\n/**\n * Converts `text` to camelCase.\n *\n * @example Word boundaries\n * `camelCase('hello-world') // 'helloWorld'`\n *\n * @example With a prefix\n * `camelCase('tag', { prefix: 'create' }) // 'createTag'`\n */\nexport function camelCase(text: string, { prefix = '', suffix = '' }: Options = {}): string {\n  return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false)\n}\n\n/**\n * Converts `text` to PascalCase.\n *\n * @example Word boundaries\n * `pascalCase('hello-world') // 'HelloWorld'`\n *\n * @example With a suffix\n * `pascalCase('tag', { suffix: 'schema' }) // 'TagSchema'`\n */\nexport function pascalCase(text: string, { prefix = '', suffix = '' }: Options = {}): string {\n  return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true)\n}\n\n/**\n * Uppercases only the first character of `text`, leaving the rest untouched.\n * Unlike {@link pascalCase} it never re-splits word boundaries or strips characters.\n *\n * @example\n * `capitalize('getPetById') // 'GetPetById'`\n */\nexport function capitalize(text: string): string {\n  return `${text.charAt(0).toUpperCase()}${text.slice(1)}`\n}\n\n/**\n * Converts `text` to snake_case.\n *\n * @example From camelCase\n * `snakeCase('helloWorld') // 'hello_world'`\n *\n * @example From mixed separators\n * `snakeCase('Hello-World') // 'hello_world'`\n */\nexport function snakeCase(text: string, { prefix = '', suffix = '' }: Options = {}): string {\n  const processed = `${prefix} ${text} ${suffix}`.trim()\n  return processed\n    .replace(/([a-z])([A-Z])/g, '$1_$2')\n    .replace(/[\\s\\-.]+/g, '_')\n    .replace(/[^a-zA-Z0-9_]/g, '')\n    .toLowerCase()\n    .split('_')\n    .filter(Boolean)\n    .join('_')\n}\n\n/**\n * Converts `text` to SCREAMING_SNAKE_CASE.\n *\n * @example From camelCase\n * `screamingSnakeCase('helloWorld') // 'HELLO_WORLD'`\n */\nexport function screamingSnakeCase(text: string, { prefix = '', suffix = '' }: Options = {}): string {\n  return snakeCase(text, { prefix, suffix }).toUpperCase()\n}\n","/**\n * JavaScript and Java reserved words.\n * @link https://github.com/jonschlinkert/reserved/blob/master/index.js\n */\nconst reservedWords = new Set([\n  'abstract',\n  'arguments',\n  'boolean',\n  'break',\n  'byte',\n  'case',\n  'catch',\n  'char',\n  'class',\n  'const',\n  'continue',\n  'debugger',\n  'default',\n  'delete',\n  'do',\n  'double',\n  'else',\n  'enum',\n  'eval',\n  'export',\n  'extends',\n  'false',\n  'final',\n  'finally',\n  'float',\n  'for',\n  'function',\n  'goto',\n  'if',\n  'implements',\n  'import',\n  'in',\n  'instanceof',\n  'int',\n  'interface',\n  'let',\n  'long',\n  'native',\n  'new',\n  'null',\n  'package',\n  'private',\n  'protected',\n  'public',\n  'return',\n  'short',\n  'static',\n  'super',\n  'switch',\n  'synchronized',\n  'this',\n  'throw',\n  'throws',\n  'transient',\n  'true',\n  'try',\n  'typeof',\n  'var',\n  'void',\n  'volatile',\n  'while',\n  'with',\n  'yield',\n  'Array',\n  'Date',\n  'hasOwnProperty',\n  'Infinity',\n  'isFinite',\n  'isNaN',\n  'isPrototypeOf',\n  'length',\n  'Math',\n  'name',\n  'NaN',\n  'Number',\n  'Object',\n  'prototype',\n  'String',\n  'toString',\n  'undefined',\n  'valueOf',\n] as const)\n\n/**\n * Returns `true` when `name` is a syntactically valid JavaScript variable name.\n *\n * @example\n * ```ts\n * isValidVarName('status')  // true\n * isValidVarName('class')   // false (reserved word)\n * isValidVarName('42foo')   // false (starts with digit)\n * ```\n */\nexport function isValidVarName(name: string): boolean {\n  if (!name || reservedWords.has(name as 'valueOf')) {\n    return false\n  }\n  return isIdentifier(name)\n}\n\n/**\n * Returns `name` when it's a syntactically valid JavaScript variable name,\n * otherwise prefixes it with `_` so the result is a valid identifier.\n *\n * Useful for sanitizing OpenAPI schema names or operation IDs that start with\n * a digit (e.g. `409`, `504AccountCancel`) before using them as exported\n * variable, type, or function names.\n *\n * @example\n * ```ts\n * ensureValidVarName('409')             // '_409'\n * ensureValidVarName('504AccountCancel') // '_504AccountCancel'\n * ensureValidVarName('Pet')              // 'Pet'\n * ensureValidVarName('class')            // '_class'\n * ```\n */\nexport function ensureValidVarName(name: string): string {\n  if (!name || isValidVarName(name)) {\n    return name\n  }\n  return `_${name}`\n}\n\n/**\n * Returns `true` when `name` is syntactically a valid identifier, ignoring reserved words.\n *\n * Reserved words and globals (`class`, `name`, `Date`, …) are valid as bare object-literal keys\n * even though they are not valid variable names, so use this (not {@link isValidVarName}) when\n * deciding whether an object key needs quoting.\n *\n * @example\n * ```ts\n * isIdentifier('name')   // true\n * isIdentifier('x-total')// false\n * ```\n */\nexport function isIdentifier(name: string): boolean {\n  return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(name)\n}\n","/**\n * Wraps a value in single quotes for emitting a single-quoted JavaScript string literal, escaping\n * any backslash or single quote in the content.\n *\n * @example\n * ```ts\n * singleQuote('foo')      // \"'foo'\"\n * singleQuote(\"o'clock\")  // \"'o\\\\'clock'\"\n * ```\n */\nexport function singleQuote(value: string | number | boolean | undefined | null): string {\n  if (value === undefined || value === null) return \"''\"\n  const escaped = String(value).replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")\n\n  return `'${escaped}'`\n}\n\n/**\n * Strips a single matching pair of `\"...\"`, `'...'`, or `` `...` `` from both ends of `text`.\n * Returns the string unchanged when no balanced quote pair is found.\n *\n * @example\n * ```ts\n * trimQuotes('\"hello\"') // 'hello'\n * trimQuotes('hello')   // 'hello'\n * ```\n */\nexport function trimQuotes(text: string): string {\n  if (text.length >= 2) {\n    const first = text[0]\n    const last = text[text.length - 1]\n    if ((first === '\"' && last === '\"') || (first === \"'\" && last === \"'\") || (first === '`' && last === '`')) {\n      return text.slice(1, -1)\n    }\n  }\n  return text\n}\n\n/**\n * Serializes a primitive to a single-quoted string literal, stripping any surrounding quotes first.\n *\n * Escaping runs through `JSON.stringify`, then the result switches to single quotes so the generated\n * code matches the repo style without a formatter.\n *\n * @example\n * ```ts\n * stringify('hello')   // \"'hello'\"\n * stringify('\"hello\"') // \"'hello'\"\n * ```\n */\nexport function stringify(value: string | number | boolean | undefined): string {\n  if (value === undefined || value === null) return \"''\"\n  const json = JSON.stringify(trimQuotes(value.toString()))\n  const inner = json.slice(1, -1).replace(/\\\\\"/g, '\"').replace(/'/g, \"\\\\'\")\n  return `'${inner}'`\n}\n\n/**\n * Escapes an `@` at the start of a line, so a multi-line description can't start a new JSDoc tag.\n * Editors render `\\@` as `@` in hovers.\n *\n * @example\n * ```ts\n * jsDocEscape('intro\\n@example value') // 'intro\\n\\\\@example value'\n * ```\n */\nexport function jsDocEscape(input: unknown): string {\n  return `${input}`.replace(/^(\\s*)@/gm, '$1\\\\@')\n}\n\n/**\n * Escapes characters that are not allowed inside JS string literals, covering quotes, backslashes,\n * and the Unicode line terminators U+2028 and U+2029.\n *\n * @see http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.4\n *\n * @example\n * ```ts\n * jsStringEscape('say \"hi\"\\nbye') // 'say \\\\\"hi\\\\\"\\\\nbye'\n * ```\n */\nexport function jsStringEscape(input: unknown): string {\n  return `${input}`.replace(/[\"'\\\\\\n\\r\\u2028\\u2029]/g, (character) => {\n    switch (character) {\n      case '\"':\n      case \"'\":\n      case '\\\\':\n        return `\\\\${character}`\n      case '\\n':\n        return '\\\\n'\n      case '\\r':\n        return '\\\\r'\n      case '\\u2028':\n        return '\\\\u2028'\n      case '\\u2029':\n        return '\\\\u2029'\n      default:\n        return ''\n    }\n  })\n}\n\n/**\n * Converts a pattern string into a `new RegExp(...)` constructor call or a regex literal string.\n * Inline flags expressed as a `^(?im)` prefix are extracted and applied to the resulting expression.\n * Pass `null` as the second argument to emit a `/pattern/flags` literal instead.\n *\n * @example\n * ```ts\n * toRegExpString('^(?im)foo')       // 'new RegExp(\"^foo\", \"im\")'\n * toRegExpString('^(?im)foo', null) // '/^foo/im'\n * ```\n */\nexport function toRegExpString(text: string, func: string | null = 'RegExp'): string {\n  const raw = trimQuotes(text)\n\n  const match = raw.match(/^\\^(\\(\\?([igmsuy]+)\\))/i)\n  const replacementTarget = match?.[1] ?? ''\n  const matchedFlags = match?.[2]\n  const cleaned = raw\n    .replace(/^\\\\?\\//, '')\n    .replace(/\\\\?\\/$/, '')\n    .replace(replacementTarget, '')\n\n  const { source, flags } = new RegExp(cleaned, matchedFlags)\n\n  if (func === null) return `/${source}/${flags}`\n\n  return `new ${func}(${JSON.stringify(source)}${flags ? `, ${JSON.stringify(flags)}` : ''})`\n}\n\n/**\n * Renders a dotted path or string array as an optional-chaining accessor expression rooted at\n * `accessor`. Returns `null` for an empty path.\n *\n * @example\n * ```ts\n * getNestedAccessor('pagination.next.id', 'lastPage')\n * // \"lastPage?.['pagination']?.['next']?.['id']\"\n * ```\n */\nexport function getNestedAccessor(param: string | Array<string>, accessor: string): string | null {\n  const parts = Array.isArray(param) ? param : param.split('.')\n  if (parts.length === 0 || (parts.length === 1 && parts[0] === '')) return null\n  return `${accessor}?.['${`${parts.join(\"']?.['\")}']`}`\n}\n","import { isIdentifier } from './reserved.ts'\nimport { singleQuote } from './strings.ts'\n\nconst INDENT = '  '\n\n/**\n * Builds a JSDoc comment block from an array of lines. Returns `fallback` when there are no\n * comments.\n *\n * @example\n * ```ts\n * buildJSDoc(['@type string', '@example hello'])\n * // '/**\\n   * @type string\\n   * @example hello\\n   *\\/\\n  '\n * ```\n */\nexport function buildJSDoc(\n  comments: Array<string>,\n  options: {\n    /**\n     * String used to indent each comment line.\n     * @default '   * '\n     */\n    indent?: string\n    /**\n     * String appended after the closing tag.\n     * @default '\\n  '\n     */\n    suffix?: string\n    /**\n     * Returned as-is when `comments` is empty.\n     * @default '  '\n     */\n    fallback?: string\n  } = {},\n): string {\n  const { indent = '   * ', suffix = '\\n  ', fallback = '  ' } = options\n\n  if (comments.length === 0) return fallback\n\n  return `/**\\n${comments.map((c) => `${indent}${c}`).join('\\n')}\\n   */${suffix}`\n}\n\n/**\n * Indents every non-empty line of `text` by one indent level, leaving blank lines empty.\n */\nfunction indentLines(text: string): string {\n  if (!text) return ''\n  return text\n    .split('\\n')\n    .map((line) => (line.trim() ? `${INDENT}${line}` : ''))\n    .join('\\n')\n}\n\n/**\n * Renders an object key, quoting it with single quotes only when it is not a valid identifier.\n * Reserved words and globals (`name`, `class`, …) are valid bare keys and stay unquoted.\n *\n * @example\n * ```ts\n * objectKey('name')    // 'name'\n * objectKey('x-total') // \"'x-total'\"\n * ```\n */\nexport function objectKey(name: string): string {\n  return isIdentifier(name) ? name : singleQuote(name)\n}\n\n/**\n * Assembles a multi-line object literal from already-rendered `entries`, indenting each entry one\n * level and closing the brace at column zero. Entries that are themselves multi-line objects indent\n * cumulatively. Each entry ends with a trailing comma to match the formatter's multi-line style.\n *\n * @example\n * ```ts\n * buildObject(['id: z.number()', 'name: z.string()'])\n * // '{\\n  id: z.number(),\\n  name: z.string(),\\n}'\n * ```\n */\nexport function buildObject(entries: Array<string>): string {\n  if (entries.length === 0) return '{}'\n  const body = entries.map((entry) => `${indentLines(entry)},`).join('\\n')\n\n  return `{\\n${body}\\n}`\n}\n\n/**\n * Assembles a bracketed list (array by default) from already-rendered `items`. Keeps everything on\n * one line when no item spans multiple lines, and otherwise puts each item on its own line, indented\n * one level with a trailing comma and the closing bracket at column zero. Used for member lists such\n * as `z.union([…])` and `z.array([…])`.\n *\n * @example\n * ```ts\n * buildList(['z.string()', 'z.number()'])\n * // '[z.string(), z.number()]'\n * ```\n */\nexport function buildList(items: Array<string>, brackets: [open: string, close: string] = ['[', ']']): string {\n  const [open, close] = brackets\n  if (items.length === 0) return `${open}${close}`\n  if (!items.some((item) => item.includes('\\n'))) return `${open}${items.join(', ')}${close}`\n  const body = items.map((item) => `${indentLines(item)},`).join('\\n')\n\n  return `${open}\\n${body}\\n${close}`\n}\n\n/**\n * Emits a lazy getter for a circular-ref property position, `get name() { return body }`. The key\n * is quoted only when it is not a valid identifier. Used by the string printers to defer evaluation\n * of a recursive schema until first access.\n *\n * @example\n * ```ts\n * lazyGetter({ name: 'parent', body: 'z.lazy(() => Pet)' })\n * // \"get parent() { return z.lazy(() => Pet) }\"\n * ```\n */\nexport function lazyGetter({ name, body }: { name: string; body: string }): string {\n  return `get ${objectKey(name)}() { return ${body} }`\n}\n","import { posix } from 'node:path'\nimport { camelCase } from './casing.ts'\n\nfunction toSlash(p: string): string {\n  if (p.startsWith('\\\\\\\\?\\\\')) return p\n  return p.replaceAll('\\\\', '/')\n}\n\n/**\n * Returns the relative path from `rootDir` to `filePath`, always using forward slashes\n * and prefixed with `./` when not already traversing upward.\n *\n * @example\n * ```ts\n * getRelativePath('/src/components', '/src/components/Button.tsx') // './Button.tsx'\n * getRelativePath('/src/components', '/src/utils/helpers.ts')      // '../utils/helpers.ts'\n * ```\n */\nexport function getRelativePath(rootDir: string, filePath: string): string {\n  const relativePath = posix.relative(toSlash(rootDir), toSlash(filePath))\n\n  return relativePath.startsWith('../') ? relativePath : `./${relativePath}`\n}\n\n/**\n * Builds a nested file path from a dotted name. Splits on dots that precede a letter\n * (so version numbers embedded in operationIds like `v2025.0` stay intact), camelCases\n * every earlier segment, applies `caseLast` to the final segment, and joins with `/`.\n *\n * Empty segments are dropped before joining. They arise when the name starts with a dot\n * followed by a letter (e.g. `..Schema` splits into `['..', 'Schema']` and `'..'` cases to\n * an empty string). Without this a leading `/` would form, which `path.resolve` reads as an\n * absolute path, letting generated files escape the configured output directory.\n *\n * @example Nested path from a dotted name\n * `toFilePath('pet.petId') // 'pet/petId'`\n *\n * @example PascalCase the final segment\n * `toFilePath('pet.Pet', pascalCase) // 'pet/Pet'`\n *\n * @example Suffix applied to the final segment only\n * `toFilePath('tag.tag', (part) => camelCase(part, { suffix: 'schema' })) // 'tag/tagSchema'`\n */\nexport function toFilePath(name: string, caseLast: (part: string) => string = camelCase): string {\n  const parts = name.split(/\\.(?=[a-zA-Z])/)\n  return parts\n    .map((part, i) => (i === parts.length - 1 ? caseLast(part) : camelCase(part)))\n    .filter(Boolean)\n    .join('/')\n}\n","import { toFilePath } from '@internals/utils'\nimport type { ast, Resolver, ResolverFile } from 'kubb/kit'\n\n/**\n * The `param` namespace shared by the schema-producing plugins (ts, zod, faker):\n * per-parameter names plus the grouped `Path`/`Query`/`Headers` names, all routed\n * through the plugin's top-level `name` casing.\n */\nexport type OperationParamResolver = {\n  name(this: Resolver, node: ast.OperationNode, param: ast.ParameterNode): string\n  path(this: Resolver, node: ast.OperationNode): string\n  query(this: Resolver, node: ast.OperationNode): string\n  headers(this: Resolver, node: ast.OperationNode): string\n}\n\n/**\n * The `response` namespace shared by the schema-producing plugins: per-status,\n * body, and combined response names, all routed through the plugin's top-level\n * `name` casing.\n */\nexport type OperationResponseResolver = {\n  status(this: Resolver, node: ast.OperationNode, statusCode: ast.StatusCode): string\n  body(this: Resolver, node: ast.OperationNode): string\n  responses(this: Resolver, node: ast.OperationNode): string\n  response(this: Resolver, node: ast.OperationNode): string\n}\n\n/**\n * Resolves a single operation parameter name with the\n * `<operationId> <in> <name>` template.\n *\n * @example\n * `operationParamName.call(resolver, node, param) // → 'DeletePetPathPetId'`\n */\nfunction operationParamName(this: Resolver, node: ast.OperationNode, param: ast.ParameterNode): string {\n  return this.name(`${node.operationId} ${param.in} ${param.name}`)\n}\n\n/**\n * Builds the shared `param` namespace. Spread the result into `createResolver`\n * and override individual methods next to it when a plugin deviates.\n *\n * @example\n * ```ts\n * createResolver<PluginTs>({ param: createOperationParamResolver(), ... })\n * ```\n */\nexport function createOperationParamResolver(): OperationParamResolver {\n  return {\n    name: operationParamName,\n    path(node) {\n      return this.name(`${node.operationId} Path`)\n    },\n    query(node) {\n      return this.name(`${node.operationId} Query`)\n    },\n    headers(node) {\n      return this.name(`${node.operationId} Headers`)\n    },\n  }\n}\n\n/**\n * Builds the shared `response` namespace. Spread the result into\n * `createResolver` and add plugin-specific methods (`options`, `error`) next\n * to it.\n *\n * @example\n * ```ts\n * createResolver<PluginTs>({ response: { ...createOperationResponseResolver(), options(node) {...} }, ... })\n * ```\n */\nexport function createOperationResponseResolver(): OperationResponseResolver {\n  return {\n    status(node, statusCode) {\n      return this.name(`${node.operationId} Status ${statusCode}`)\n    },\n    body(node) {\n      return this.name(`${node.operationId} Body`)\n    },\n    responses(node) {\n      return this.name(`${node.operationId} Responses`)\n    },\n    response(node) {\n      return this.name(`${node.operationId} Response`)\n    },\n  }\n}\n\n/**\n * Builds a resolver `file` override whose base name runs every path segment\n * through `toFilePath`, casing the final segment with `caseLast`.\n *\n * @example\n * ```ts\n * createResolver<PluginTs>({ file: createCasedFile(pascalCase), ... })\n * ```\n */\nexport function createCasedFile(caseLast: (part: string) => string): ResolverFile {\n  return {\n    baseName({ name, extname }) {\n      return `${toFilePath(name, caseLast)}${extname}`\n    },\n  }\n}\n","import { camelCase } from '@internals/utils'\nimport type { Group } from 'kubb/kit'\n\n/**\n * Builds the `group` config a Kubb plugin passes to `ctx.setOptions`, applying the\n * shared default naming so every plugin groups output consistently:\n *\n * - `path` groups use the second path segment (`/pet/findByStatus` → `pet`).\n * - other groups use the camelCased group (`pet store` → `petStore`).\n *\n * A user-provided `group.name` always wins over the default namer, so callers stay in\n * control of their output folders. Returns `null` when grouping is disabled, matching the\n * per-plugin convention.\n *\n * @param group - The user-supplied group option, or `undefined` to disable grouping.\n *\n * @example\n * ```ts\n * createGroupConfig(group) // shared across every plugin\n * ```\n */\nexport function createGroupConfig(group: Group | undefined): Group | null {\n  if (!group) {\n    return null\n  }\n\n  const defaultName = (ctx: { group: string }): string => {\n    if (group.type === 'path') {\n      return `${ctx.group.split('/')[1]}`\n    }\n\n    return camelCase(ctx.group)\n  }\n\n  return {\n    ...group,\n    name: group.name ? group.name : defaultName,\n  } satisfies Group\n}\n","import type { ast } from 'kubb/kit'\n\n/**\n * Converts a child schema to printer output. Plugins instantiate it with their own output type:\n * `string` for the zod and faker printers, `ts.TypeNode` for the TypeScript printer. A printer's\n * `this.transform` fits directly, so its `null` for an empty result carries through to `output`.\n */\nexport type SchemaTransform<TOutput> = (schema: ast.SchemaNode) => TOutput\n\n/**\n * A union or intersection member, or an array or tuple item, paired with its transformed output.\n */\nexport type MappedSchema<TOutput> = {\n  /**\n   * The original child schema, kept so the printer can read its metadata for leaf formatting.\n   */\n  schema: ast.SchemaNode\n  /**\n   * The child schema after being run through the transform.\n   */\n  output: TOutput\n}\n\n/**\n * An object property paired with its transformed output.\n */\nexport type MappedProperty<TOutput> = {\n  /**\n   * The property name as written on the schema, before any identifier quoting.\n   */\n  name: string\n  /**\n   * The original property node, kept so the printer can read `required`, `schema`, and metadata.\n   */\n  property: ast.PropertyNode\n  /**\n   * The property schema after being run through the transform.\n   */\n  output: TOutput\n}\n\n/**\n * Maps each property of an object schema to its transformed output. Pairs every result with the\n * original property so the printer keeps full control over modifiers, getters, and key syntax.\n *\n * @example\n * ```ts\n * const entries = mapSchemaProperties(node, (schema) => this.transform(schema))\n * // entries: [{ name: 'id', property, output: 'z.number()' }, ...]\n * ```\n */\nexport function mapSchemaProperties<TOutput>(node: ast.ObjectSchemaNode, transform: SchemaTransform<TOutput>): Array<MappedProperty<TOutput>> {\n  return node.properties.map((property) => ({ name: property.name, property, output: transform(property.schema) }))\n}\n\n/**\n * Maps each member of a union or intersection schema to its transformed output, pairing every\n * result with the original member.\n */\nexport function mapSchemaMembers<TOutput>(\n  node: ast.UnionSchemaNode | ast.IntersectionSchemaNode,\n  transform: SchemaTransform<TOutput>,\n): Array<MappedSchema<TOutput>> {\n  return (node.members ?? []).map((schema) => ({ schema, output: transform(schema) }))\n}\n\n/**\n * Maps each item of an array or tuple schema to its transformed output, pairing every result with\n * the original item.\n */\nexport function mapSchemaItems<TOutput>(node: ast.ArraySchemaNode, transform: SchemaTransform<TOutput>): Array<MappedSchema<TOutput>> {\n  return (node.items ?? []).map((schema) => ({ schema, output: transform(schema) }))\n}\n","import { ast, containsCircularRef } from 'kubb/kit'\nimport { Const, File, Function, Type } from 'kubb/jsx'\nimport type { KubbReactNode } from 'kubb/jsx'\nimport type { PrinterZodFactory } from '../printers/printerZod.ts'\nimport type { PrinterZodMiniFactory } from '../printers/printerZodMini.ts'\n\nimport type { CompileOptions } from '../types.ts'\n\ntype Props = {\n  name: string\n  node: ast.SchemaNode\n  /**\n   * Pre-configured printer instance created by the generator.\n   * The generator selects `printerZod` or `printerZodMini` based on the `mini` option,\n   * then merges in any user-supplied `printer.nodes` overrides.\n   */\n  printer: ast.Printer<PrinterZodFactory> | ast.Printer<PrinterZodMiniFactory>\n  inferTypeName?: string | null\n  typeGuards?: boolean | { is?: boolean; assert?: boolean }\n  isName?: string | null\n  assertName?: string | null\n  mini?: boolean\n  /**\n   * Set when the schema references itself. A self-referential initializer (e.g. a `z.lazy(() => …)`\n   * back to the same const) is implicitly `any` under `strict`, so the const is annotated with an\n   * explicit `z.ZodType` to break the inference cycle.\n   */\n  cyclic?: boolean\n  /**\n   * Wrap the schema initializer in `z.compile(...)` for fast-path validation.\n   * Pass `{ strict: true }` to enforce strict compilation without silent fallback.\n   *\n   * @note Only compatible with Zod v4.5.0 or above.\n   */\n  compile?: boolean | CompileOptions\n}\n\nexport function Zod({ name, node, printer, inferTypeName, typeGuards, isName, assertName, mini, cyclic, compile }: Props): KubbReactNode {\n  const output = printer.print(node)\n  const printerImports = printer.drainImports()\n\n  if (!output) {\n    return\n  }\n\n  // A cyclic object emits its self-references as deferred getters (`get prop() { … }`), so its\n  // initializer never references itself directly and TypeScript infers it fine — annotating it would\n  // only strip the `ZodObject` methods (`.omit()`, `.strict()`). Only non-object cyclic schemas (a\n  // union/array with a top-level `z.lazy(() => self)`) are implicitly `any` and need the annotation.\n  const needsAnnotation = cyclic && node.type !== 'object'\n  const isBare = ast.isBareRef(node, printer.options.keysToOmit)\n  const isCyclic = Boolean(cyclic || (printer.options.cyclicSchemas && containsCircularRef(node, { circularSchemas: printer.options.cyclicSchemas })))\n  const shouldCompile = Boolean(compile) && !isBare && !isCyclic\n  const value = shouldCompile ? (typeof compile === 'object' && compile.strict ? `z.compile(${output}, { strict: true })` : `z.compile(${output})`) : output\n\n  const targetType = inferTypeName ?? `z.infer<typeof ${name}>`\n  const shouldGenerateIs = isName && (typeof typeGuards === 'object' ? (typeGuards.is ?? true) : Boolean(typeGuards))\n  const shouldGenerateAssert = assertName && (typeof typeGuards === 'object' ? (typeGuards.assert ?? true) : Boolean(typeGuards))\n\n  return (\n    <>\n      {printerImports.map((imp) => (\n        <File.Import\n          key={[name, imp.path, imp.name].join('-')}\n          name={imp.name}\n          path={imp.path}\n          root={imp.root}\n          isTypeOnly={imp.isTypeOnly}\n          isNameSpace={imp.isNameSpace}\n        />\n      ))}\n      <File.Source name={name} isExportable isIndexable>\n        <Const export name={name} type={needsAnnotation ? 'z.ZodType' : undefined}>\n          {value}\n        </Const>\n      </File.Source>\n      {inferTypeName && (\n        <File.Source name={inferTypeName} isExportable isIndexable isTypeOnly>\n          <Type export name={inferTypeName}>\n            {`z.infer<typeof ${name}>`}\n          </Type>\n        </File.Source>\n      )}\n      {shouldGenerateIs && (\n        <File.Source name={isName} isExportable isIndexable>\n          <Const export name={isName} JSDoc={{ comments: [`Type guard for {@link ${name}}`] }}>\n            {mini ? `(data: unknown): data is ${targetType} => z.validate(${name}, data)` : `(data: unknown): data is ${targetType} => ${name}.validate(data)`}\n          </Const>\n        </File.Source>\n      )}\n      {shouldGenerateAssert && (\n        <File.Source name={assertName} isExportable isIndexable>\n          <Function\n            export\n            name={assertName}\n            params=\"data: unknown\"\n            returnType={`asserts data is ${targetType}`}\n            JSDoc={{ comments: [`Asserter for {@link ${name}}`, '@throws {z.ZodError} If data is invalid'] }}\n          >\n            {mini ? `if (!z.validate(${name}, data)) {\\n  z.parse(${name}, data)\\n}` : `if (!${name}.validate(data)) {\\n  ${name}.parse(data)\\n}`}\n          </Function>\n        </File.Source>\n      )}\n    </>\n  )\n}\n","import { buildObject, lazyGetter, objectKey, stringify, toRegExpString } from '@internals/utils'\nimport { mapSchemaProperties } from '@internals/shared'\nimport { ast, containsCircularRef, syncSchemaRef } from 'kubb/kit'\nimport type { PluginZod } from './types.ts'\n\n/**\n * Returns `true` when the given coercion option enables coercion for the specified type.\n */\nexport function shouldCoerce(coercion: PluginZod['resolvedOptions']['coercion'] | undefined, type: 'dates' | 'strings' | 'numbers'): boolean {\n  if (coercion === undefined || coercion === false) return false\n  if (coercion === true) return true\n\n  return !!coercion[type]\n}\n\nexport function propertyNamesOf(node: ast.SchemaNode): ast.SchemaNode | undefined {\n  return 'propertyNames' in node ? (node as { propertyNames?: ast.SchemaNode }).propertyNames : undefined\n}\n\n/**\n * Whether the schema node represents a closed or finite set of keys (e.g. enum, literal,\n * or union of enums/literals).\n *\n * In Zod v4, passing a closed key schema to `z.record()` enforces exhaustiveness (all keys\n * must exist in the input). OpenAPI 3.1 `propertyNames` only validates present keys without\n * requiring all keys to exist, so closed key schemas use `z.partialRecord()` instead.\n */\nexport function isClosedKeySchema(node: ast.SchemaNode | undefined): boolean {\n  if (!node) return false\n  const resolved = syncSchemaRef(node)\n  if (resolved.type === 'enum') return true\n  if (resolved.type === 'union') {\n    const members = resolved.members ?? []\n    return members.length > 0 && members.every(isClosedKeySchema)\n  }\n  return false\n}\n\n/**\n * Whether the node is a plain inline object whose shape can be lifted into an `.extend({ … })`\n * argument. A catchall, `patternProperties`, or a nullable/optional wrapper cannot, so those stay\n * on `.and(…)`.\n */\nexport function isPlainInlineObject(node: ast.SchemaNode): boolean {\n  if (node.type !== 'object') return false\n  if (node.nullable || node.optional || node.nullish) return false\n\n  const hasAdditionalProperties = node.additionalProperties !== undefined\n  const hasPatternProperties = Boolean(node.patternProperties)\n\n  return !hasAdditionalProperties && !hasPatternProperties && !propertyNamesOf(node)\n}\n\n/**\n * Whether a node renders as a bare Zod object — one that accepts `.extend(…)` and can be a\n * `z.discriminatedUnion` option. Covers object nodes, `$ref`s that resolve to (or are still\n * unresolved) objects, single-member unions of an object, and object-composable `allOf`.\n *\n * `cyclicSchemas` bounds the recursion: a ref into a cycle renders as `z.lazy(…)`, not an object.\n */\nexport function isObjectSchemaNode(node: ast.SchemaNode, cyclicSchemas?: ReadonlySet<string>): boolean {\n  if (node.nullable || node.optional || node.nullish) return false\n  if (node.type === 'object') {\n    const hasProperties = Boolean(node.properties?.length)\n    const hasTypedAdditionalProperties = Boolean(node.additionalProperties && node.additionalProperties !== true)\n    const hasPatternProperties = Boolean(node.patternProperties)\n\n    const isRecord = !hasProperties && (hasTypedAdditionalProperties || hasPatternProperties || propertyNamesOf(node))\n\n    return !isRecord\n  }\n\n  if (node.type === 'ref') {\n    const refName = ast.resolveRefName(node)\n    if (refName && cyclicSchemas?.has(refName)) return false\n    const resolved = syncSchemaRef(node)\n    // An unresolved ref keeps its `ref` type; assume it resolves to an object (matches the printer's\n    // prior optimism that only a resolved intersection blocks a discriminated union).\n    return resolved.type === 'ref' || isObjectSchemaNode(resolved, cyclicSchemas)\n  }\n\n  if (node.type === 'union') {\n    const members = node.members ?? []\n    return members.length === 1 && isObjectSchemaNode(members[0]!, cyclicSchemas)\n  }\n\n  return isObjectComposableIntersection(node, cyclicSchemas)\n}\n\n/**\n * Whether an `allOf` is a pure object composition — an object base plus inline object members whose\n * shapes merge with `.extend(…)`. These stay a Zod object instead of a `ZodIntersection`, which\n * `z.discriminatedUnion` rejects.\n */\nexport function isObjectComposableIntersection(node: ast.SchemaNode, cyclicSchemas?: ReadonlySet<string>): boolean {\n  if (node.type !== 'intersection') return false\n  const [first, ...rest] = node.members ?? []\n  return !!first && isObjectSchemaNode(first, cyclicSchemas) && rest.every(isPlainInlineObject)\n}\n\n/**\n * Format a default value as a code-level literal.\n * Arrays and objects keep their contents as a JSON literal, primitives become their string\n * representation, strings are quoted.\n */\nexport function formatDefault(value: unknown): string {\n  if (typeof value === 'string') return stringify(value)\n  if (typeof value === 'object' && value !== null) return JSON.stringify(value)\n\n  return String(value ?? '')\n}\n\n/**\n * Format a default for `.default(...)` so the literal matches the generated schema's type.\n *\n * An OpenAPI `default` does not always agree with the schema it sits on: a `bigint` field\n * (`format: int64`) carries a `number` default, and a spec may put `default: {}` on an `array`.\n * Emitting those verbatim produces a Zod schema that does not typecheck, so coerce the bigint case\n * to a `BigInt(...)` literal and emit an array literal for arrays (dropping a non-array default).\n * Returns `null` when no `.default(...)` should be emitted. Keys off the schema node's type.\n */\nexport function defaultLiteral(node: ast.SchemaNode | undefined, value: unknown): string | null {\n  // A `null` default is invalid on a non-nullable schema and redundant on a nullish one, and emitting\n  // it produces a bare `.default()` (no argument). Drop it.\n  if (value === null) return null\n  const resolved = node ? syncSchemaRef(node) : undefined\n  if (resolved && ast.narrowSchema(resolved, 'bigint')) {\n    if (typeof value === 'bigint') return `BigInt(${value})`\n    if (typeof value === 'number' && Number.isInteger(value)) return `BigInt(${value})`\n    return null\n  }\n  if (resolved && ast.narrowSchema(resolved, 'array')) {\n    return Array.isArray(value) ? JSON.stringify(value) : null\n  }\n  // An enum/literal schema narrows to its members (e.g. `1 | 3`), but the spec default may not match\n  // that type (`default: '1'` on a numeric enum). Emit the matching member's typed literal so the\n  // default agrees with the schema, or drop a default that matches no member.\n  const enumNode = resolved ? ast.narrowSchema(resolved, 'enum') : undefined\n  if (enumNode) {\n    const values = enumNode.namedEnumValues?.map((member) => member.value) ?? enumNode.enumValues ?? []\n    if (values.length) {\n      const match = values.find((member) => member === value || String(member) === String(value))\n      return match != null ? formatDefault(match) : null\n    }\n  }\n  return formatDefault(value)\n}\n\n/**\n * Build the Zod schema for a set of literal enum values.\n * `z.enum()` only accepts string members in Zod v4, so a numeric, boolean, or\n * mixed set is emitted as a single `z.literal(…)` or a `z.union([z.literal(…), …])`.\n * An all-string set keeps the more compact `z.enum([…])`.\n */\nexport function buildEnum(values: Array<string | number | boolean>): string {\n  const allStrings = values.every((v) => typeof v === 'string')\n  if (allStrings) return `z.enum([${values.map((v) => formatDefault(v)).join(', ')}])`\n\n  const literals = values.map((v) => `z.literal(${formatDefault(v)})`)\n  if (literals.length === 1) return literals[0]!\n\n  return `z.union([${literals.join(', ')}])`\n}\n\n/**\n * Numeric constraint limits for Zod schemas (min, max, and exclusive bounds).\n */\nexport type NumericConstraints = {\n  min?: number\n  max?: number\n  exclusiveMinimum?: number\n  exclusiveMaximum?: number\n  multipleOf?: number\n}\n\n/**\n * Length constraint limits for string and array schemas (min, max, and regex pattern).\n */\nexport type LengthConstraints = {\n  min?: number\n  max?: number\n  pattern?: string\n  /**\n   * Output form for the `pattern` regex. `'literal'` emits a regex literal,\n   * `'constructor'` emits `new RegExp(...)`.\n   *\n   * @default 'literal'\n   */\n  regexType?: PluginZod['resolvedOptions']['regexType']\n}\n\n/**\n * Digit pattern for a `type: 'string'` schema that carries an integer `format`, the way ProtoJSON\n * encodes 64-bit integers. Returns `undefined` for every other format, and a `pattern` from the\n * spec takes precedence over this fallback.\n *\n * @example\n * ```ts\n * integerFormatPattern('uint64') // '^\\\\d+$'\n * ```\n */\nexport function integerFormatPattern(format: string | undefined): string | undefined {\n  if (format === 'int32' || format === 'int64') return '^-?\\\\d+$'\n  if (format === 'uint64') return '^\\\\d+$'\n\n  return undefined\n}\n\n/**\n * Renders a `pattern` as a regex literal, or as `new RegExp(...)` when `regexType` is `'constructor'`.\n */\nfunction regexSource(pattern: string, regexType: PluginZod['resolvedOptions']['regexType'] | undefined): string {\n  return toRegExpString(pattern, regexType === 'constructor' ? 'RegExp' : null)\n}\n\nfunction joinPatterns(patterns: Array<string>): string {\n  return patterns.length === 1 ? patterns[0]! : patterns.map((pattern) => `(${pattern})`).join('|')\n}\n\n/**\n * Builds a Zod record key schema that enforces the `patternProperties` regexes a plain\n * `.catchall()` would drop.\n */\nexport function patternKeySchema({ patterns, regexType }: { patterns: Array<string>; regexType?: PluginZod['resolvedOptions']['regexType'] }): string {\n  return `z.string().regex(${regexSource(joinPatterns(patterns), regexType)})`\n}\n\n/**\n * `zod/mini` variant of {@link patternKeySchema}, wrapping the regex in `.check(z.regex(...))`.\n */\nexport function patternKeySchemaMini({ patterns, regexType }: { patterns: Array<string>; regexType?: PluginZod['resolvedOptions']['regexType'] }): string {\n  return `z.string().check(z.regex(${regexSource(joinPatterns(patterns), regexType)}))`\n}\n\n/**\n * Modifier options for applying chainable methods to Zod schema values.\n */\nexport type ModifierOptions = {\n  value: string\n  schema?: ast.SchemaNode\n  nullable?: boolean\n  optional?: boolean\n  nullish?: boolean\n  defaultValue?: unknown\n  description?: string\n  examples?: Array<unknown>\n}\n\n/**\n * Build `.min()` / `.max()` / `.gt()` / `.lt()` constraint chains for numbers\n * using the standard chainable Zod v4 API.\n */\nexport function numberConstraints({ min, max, exclusiveMinimum, exclusiveMaximum, multipleOf }: NumericConstraints): string {\n  return [\n    min !== undefined ? `.min(${min})` : '',\n    max !== undefined ? `.max(${max})` : '',\n    exclusiveMinimum !== undefined ? `.gt(${exclusiveMinimum})` : '',\n    exclusiveMaximum !== undefined ? `.lt(${exclusiveMaximum})` : '',\n    multipleOf !== undefined ? `.multipleOf(${multipleOf})` : '',\n  ].join('')\n}\n\n/**\n * Build `.min()` / `.max()` / `.regex()` chains for strings/arrays\n * using the standard chainable Zod v4 API.\n */\nexport function lengthConstraints({ min, max, pattern, regexType }: LengthConstraints): string {\n  return [\n    min !== undefined ? `.min(${min})` : '',\n    max !== undefined ? `.max(${max})` : '',\n    pattern !== undefined ? `.regex(${regexSource(pattern, regexType)})` : '',\n  ].join('')\n}\n\n/**\n * Build `.check(z.minimum(), z.maximum())` for `zod/mini` numeric constraints.\n */\nexport function numberChecksMini({ min, max, exclusiveMinimum, exclusiveMaximum, multipleOf }: NumericConstraints): string {\n  const checks: Array<string> = []\n  if (min !== undefined) checks.push(`z.minimum(${min})`)\n  if (max !== undefined) checks.push(`z.maximum(${max})`)\n  if (exclusiveMinimum !== undefined) checks.push(`z.minimum(${exclusiveMinimum}, { exclusive: true })`)\n  if (exclusiveMaximum !== undefined) checks.push(`z.maximum(${exclusiveMaximum}, { exclusive: true })`)\n  if (multipleOf !== undefined) checks.push(`z.multipleOf(${multipleOf})`)\n  return checks.length ? `.check(${checks.join(', ')})` : ''\n}\n\n/**\n * Build `.check(z.minLength(), z.maxLength(), z.regex())` for `zod/mini` length constraints.\n */\nexport function lengthChecksMini({ min, max, pattern, regexType }: LengthConstraints): string {\n  const checks: Array<string> = []\n  if (min !== undefined) checks.push(`z.minLength(${min})`)\n  if (max !== undefined) checks.push(`z.maxLength(${max})`)\n  if (pattern !== undefined) checks.push(`z.regex(${regexSource(pattern, regexType)})`)\n  return checks.length ? `.check(${checks.join(', ')})` : ''\n}\n\n/**\n * Apply nullable / optional / nullish modifiers, an optional `.describe()` call, and an\n * optional `.meta({ examples })` call to a schema value string using the chainable Zod v4 API.\n */\nexport function applyModifiers({ value, schema, nullable, optional, nullish, defaultValue, description, examples }: ModifierOptions): string {\n  const withModifier = (() => {\n    if (nullish || (nullable && optional)) return `${value}.nullish()`\n    if (optional) return `${value}.optional()`\n    if (nullable) return `${value}.nullable()`\n    return value\n  })()\n  const literal = defaultValue !== undefined ? defaultLiteral(schema, defaultValue) : null\n  const withDefault = literal !== null ? `${withModifier}.default(${literal})` : withModifier\n  const withDescription = description ? `${withDefault}.describe(${stringify(description)})` : withDefault\n  return examples?.length ? `${withDescription}.meta({ examples: [${examples.map(formatDefault).join(', ')}] })` : withDescription\n}\n\nfunction modifierDepth(schema: ast.SchemaNode): number {\n  if (schema.nullish || (schema.nullable && schema.optional)) return 2\n  if (schema.nullable || schema.optional) return 1\n  return 0\n}\n\n/**\n * Build the `.unwrap()` chain to insert before `.omit()` when the schema is a `$ref`.\n *\n * A `$ref` resolves to a named schema variable that already carries its own `.nullable()` /\n * `.optional()` / `.nullish()` / `.default()` wrappers. `.omit()` lives on the inner `ZodObject`,\n * not on those `ZodNullable` / `ZodOptional` / `ZodDefault` wrappers, so the omit has to unwrap\n * down to the object first. This mirrors plugin-ts emitting `Omit<NonNullable<T>, …>`. Inline\n * objects need no unwrap because the printer adds their modifiers after `.omit()`. Zod Mini has no\n * `.unwrap()`, so its printer passes `._zod.def.innerType` as the `step`.\n */\nexport function omitUnwrapChain(node: ast.SchemaNode, step = '.unwrap()'): string {\n  const ref = ast.narrowSchema(node, 'ref')\n  if (!ref) return ''\n\n  const target = ref.schema ?? ref\n  const depth = modifierDepth(target) + (target.default !== undefined ? 1 : 0)\n  return step.repeat(depth)\n}\n\n/**\n * Apply nullable / optional / nullish modifiers using the functional `zod/mini` API\n * (`z.nullable()`, `z.optional()`, `z.nullish()`).\n */\nexport function applyMiniModifiers({ value, schema, nullable, optional, nullish, defaultValue }: Omit<ModifierOptions, 'description'>): string {\n  const withModifier = (() => {\n    if (nullish) return `z.nullish(${value})`\n    const withNullable = nullable ? `z.nullable(${value})` : value\n    return optional ? `z.optional(${withNullable})` : withNullable\n  })()\n  const literal = defaultValue !== undefined ? defaultLiteral(schema, defaultValue) : null\n  return literal !== null ? `z._default(${withModifier}, ${literal})` : withModifier\n}\n\n/**\n * Calls for string `format`s with a dedicated Zod constructor; a `Map` so `constructor` cannot hit `Object.prototype`.\n */\nexport const STRING_FORMAT_CALLS = new Map<string | undefined, string>([\n  ['byte', 'z.base64()'],\n  ['base64', 'z.base64()'],\n  ['base64url', 'z.base64url()'],\n  ['jwt', 'z.jwt()'],\n  ['ulid', 'z.ulid()'],\n  ['iban', 'z.iban()'],\n  ['duration', 'z.iso.duration()'],\n  ['hostname', 'z.hostname()'],\n])\n\n/**\n * Marks an inline `oneOf` object strict, so `object()` builds `z.strictObject(...)` and no eager `.shape` read hits a deferred getter.\n */\nexport function strictOneOfNode(node: ast.SchemaNode): ast.SchemaNode {\n  return node.type === 'object' && node.additionalProperties === undefined ? { ...node, additionalProperties: false } : node\n}\n\n/**\n * The constraint chain an `allOf` member adds to a bare string, number or array; each printer passes its own renderers.\n */\nexport function getMemberConstraint({\n  member,\n  regexType,\n  lengths,\n  numbers,\n}: {\n  member: ast.SchemaNode\n  regexType?: LengthConstraints['regexType']\n  lengths: (constraints: LengthConstraints) => string\n  numbers: (constraints: NumericConstraints) => string\n}): string | undefined {\n  if (member.primitive === 'string') return lengths({ ...(ast.narrowSchema(member, 'string') ?? {}), regexType }) || undefined\n  if (member.primitive === 'number' || member.primitive === 'integer')\n    return numbers(ast.narrowSchema(member, 'number') ?? ast.narrowSchema(member, 'integer') ?? {}) || undefined\n  if (member.primitive === 'array') return lengths({ ...(ast.narrowSchema(member, 'array') ?? {}), regexType }) || undefined\n}\n\ntype PrinterContext = {\n  transform: (node: ast.SchemaNode) => string | null\n  options: { cyclicSchemas?: ReadonlySet<string> }\n}\n\n/**\n * Builds the `{ key: value, … }` shape shared by the `z.object(...)` and `.extend(...)` renderings.\n */\nexport function buildObjectShape(\n  ctx: PrinterContext,\n  node: ast.SchemaNode,\n  modify: (args: { value: string; schema: ast.SchemaNode; required?: boolean; meta: ReturnType<typeof syncSchemaRef> }) => string,\n): string {\n  const objectNode = ast.narrowSchema(node, 'object')\n  if (!objectNode) return '{}'\n\n  const isCyclic = (schema: ast.SchemaNode): boolean =>\n    ctx.options.cyclicSchemas != null && containsCircularRef(schema, { circularSchemas: ctx.options.cyclicSchemas })\n\n  const entries = mapSchemaProperties(objectNode, (schema) => {\n    // A getter defers evaluation, so clear cyclicSchemas to skip z.lazy() on nested refs.\n    const hasSelfRef = isCyclic(schema)\n    const savedCyclicSchemas = ctx.options.cyclicSchemas\n    if (hasSelfRef) ctx.options.cyclicSchemas = undefined\n    const baseOutput = ctx.transform(schema) ?? ctx.transform(ast.factory.createSchema({ type: 'unknown' }))!\n    if (hasSelfRef) ctx.options.cyclicSchemas = savedCyclicSchemas\n    return baseOutput\n  }).map(({ name: propName, property, output: baseOutput }) => {\n    const { schema } = property\n    const value = modify({ value: baseOutput, schema, required: property.required, meta: syncSchemaRef(schema) })\n\n    return isCyclic(schema) ? lazyGetter({ name: propName, body: value }) : `${objectKey(propName)}: ${value}`\n  })\n\n  return buildObject(entries)\n}\n\n/**\n * Shared `print` body: transforms the node, applies `keysToOmit` as `.omit(...)` (or `z.omit(...)` when `mini`), then `modify` adds the modifiers.\n */\nexport function printWithOmit(\n  ctx: { transform: (node: ast.SchemaNode) => string | null; options: { keysToOmit?: Array<string> | null } },\n  node: ast.SchemaNode,\n  modify: (value: string, meta: ReturnType<typeof syncSchemaRef>) => string,\n  mini = false,\n): string | null {\n  const { keysToOmit } = ctx.options\n\n  const transformed = ctx.transform(node)\n  if (!transformed) return null\n\n  const meta = syncSchemaRef(node)\n\n  const base = (() => {\n    if (!keysToOmit?.length || meta.primitive !== 'object' || (meta.type === 'union' && meta.discriminatorPropertyName)) return transformed\n\n    // A ref resolves to a wrapper variable; unwrap to the inner object before omitting.\n    // Zod Mini schemas have no `.unwrap()` / `.omit()`, so walk `_zod.def.innerType` and call `z.omit()`.\n    const unwrap = omitUnwrapChain(node, mini ? '._zod.def.innerType' : '.unwrap()')\n    const mask = `{ ${keysToOmit.map((k: string) => `\"${k}\": true`).join(', ')} }`\n    const omit = (target: string) => (mini ? `z.omit(${target}${unwrap}, ${mask})` : `${target}${unwrap}.omit(${mask})`)\n\n    const lazyMatch = transformed.match(/^z\\.lazy\\(\\(\\)\\s*=>\\s*(.+)\\)$/)\n    if (lazyMatch) return `z.lazy(() => ${omit(lazyMatch[1]!)})`\n    return omit(transformed)\n  })()\n\n  return modify(base, meta)\n}\n","import { mapSchemaItems, mapSchemaMembers } from '@internals/shared'\nimport { buildList, stringify } from '@internals/utils'\nimport { ast, extractRefName, syncSchemaRef } from 'kubb/kit'\nimport type { PluginZod, ResolverZod } from '../types.ts'\nimport {\n  applyModifiers,\n  buildEnum,\n  buildObjectShape,\n  formatDefault,\n  getMemberConstraint,\n  integerFormatPattern,\n  isClosedKeySchema,\n  isObjectComposableIntersection,\n  isObjectSchemaNode,\n  lengthConstraints,\n  numberConstraints,\n  patternKeySchema,\n  printWithOmit,\n  propertyNamesOf,\n  shouldCoerce,\n  strictOneOfNode,\n  STRING_FORMAT_CALLS,\n} from '../utils.ts'\n\n/**\n * Partial map of node-type overrides for the Zod printer.\n *\n * Each key is a `SchemaType` string (e.g. `'date'`, `'string'`). The function\n * replaces the built-in handler for that node type. Use `this.transform` to\n * recurse into nested schema nodes, `this.base` to reuse the output of the\n * handler being replaced, and `this.options` to read printer options.\n *\n * @example Override the `date` handler\n * ```ts\n * pluginZod({\n *   printer: {\n *     nodes: {\n *       date(node) {\n *         return 'z.iso.date()'\n *       },\n *     },\n *   },\n * })\n * ```\n *\n * @example Wrap the built-in output\n * ```ts\n * pluginZod({\n *   printer: {\n *     nodes: {\n *       object(node) {\n *         return `${this.base(node)}.openapi(${JSON.stringify({ description: node.description })})`\n *       },\n *     },\n *   },\n * })\n * ```\n */\nexport type PrinterZodNodes = ast.PrinterPartial<string, PrinterZodOptions>\n\nexport type PrinterZodOptions = {\n  /**\n   * Enable automatic type coercion for strings, numbers, and dates.\n   */\n  coercion?: PluginZod['resolvedOptions']['coercion']\n  /**\n   * Use `z.guid()` or `z.uuid()` for UUID/GUID validation.\n   *\n   * @default 'uuid'\n   */\n  guidType?: PluginZod['resolvedOptions']['guidType']\n  /**\n   * Output form for an OpenAPI `pattern` inside `.regex(...)`: a regex literal\n   * (`'literal'`) or the `RegExp` constructor (`'constructor'`).\n   *\n   * @default 'literal'\n   */\n  regexType?: PluginZod['resolvedOptions']['regexType']\n  /**\n   * How a non-discriminated `oneOf` is printed: `z.union` with strict members or `z.xor`.\n   *\n   * @default 'union'\n   */\n  oneOfType?: PluginZod['resolvedOptions']['oneOfType']\n  /**\n   * Date format in the OpenAPI spec (`'date'` or `'date-time'`).\n   */\n  dateType?: ast.ParserOptions['dateType']\n  /**\n   * Transforms raw schema names into valid JavaScript identifiers.\n   */\n  resolver?: ResolverZod\n  /**\n   * Properties to exclude using `.omit({ key: true })`.\n   */\n  keysToOmit?: Array<string> | null\n  /**\n   * Schema names that form circular dependency chains.\n   * Properties referencing these emit lazy getters wrapping refs in `z.lazy(() => …)`.\n   */\n  cyclicSchemas?: ReadonlySet<string>\n  /**\n   * Which way a node converts between its wire type and its runtime type:\n   * - `'decode'` (default): wire into runtime, used by response schemas.\n   * - `'encode'`: runtime back to wire, used by request bodies and parameters.\n   *\n   * Named for the conversion rather than the slot, since Zod's own `z.input` and `z.output`\n   * describe a different axis and read inverted here: the `'decode'` schema is the one whose\n   * `z.input` is the wire type.\n   *\n   * A handler returning different output per direction makes the generator emit an\n   * `${name}InputSchema` variant for that component.\n   */\n  direction?: 'encode' | 'decode'\n  /**\n   * Custom handler map for node type overrides.\n   */\n  nodes?: PrinterZodNodes\n}\n\n/**\n * Factory options for the Zod printer, defining input/output types and configuration.\n */\nexport type PrinterZodFactory = ast.PrinterFactoryOptions<'zod', PrinterZodOptions, string, string>\n\nfunction strictOneOfMember(member: string, node: ast.SchemaNode, cyclicSchemas?: ReadonlySet<string>): string {\n  // Inline objects are already strict through their node; only a ref needs the runtime call.\n\n  if (node.type === 'ref') {\n    if (member.startsWith('z.lazy(')) {\n      return member\n    }\n\n    // A cyclic ref is annotated `z.ZodType`, and a nullable/optional ref is wrapped in\n    // ZodNullable/ZodOptional, and neither exposes `.strict()`. Only a bare `ZodObject` ref takes it.\n    const refName = ast.resolveRefName(node)\n    if (refName && cyclicSchemas?.has(refName)) {\n      return member\n    }\n\n    const schema = syncSchemaRef(node)\n\n    if (schema.nullable || schema.optional || node.nullable || node.optional) {\n      return member\n    }\n\n    if (schema.type === 'object' && (schema.additionalProperties === undefined || schema.additionalProperties === false)) {\n      return `${member}.strict()`\n    }\n  }\n\n  return member\n}\n\n/**\n * Builds the `{ key: value, … }` shape for an object node with the chainable modifiers.\n */\nfunction buildZodObjectShape(ctx: Parameters<typeof buildObjectShape>[0], node: ast.SchemaNode): string {\n  return buildObjectShape(ctx, node, ({ value, schema, required, meta }) =>\n    applyModifiers({\n      value,\n      schema,\n      nullable: meta.nullable,\n      optional: schema.optional || required === false,\n      nullish: schema.nullish,\n      defaultValue: meta.default,\n      // When a property schema is not a ref but the metadata is from a ref (e.g., discriminator\n      // property override), skip applying the description from the ref target to avoid applying\n      // metadata from a replaced schema.\n      description: schema.type !== 'ref' && meta.type === 'ref' ? undefined : meta.description,\n      examples: meta.examples,\n    }),\n  )\n}\n\n/**\n * Types the direction probe skips. They delegate to their children rather than reading\n * `direction` themselves, so {@link containsDirectionalNode} walks into the children instead.\n */\nconst CONTAINER_TYPES = new Set<ast.SchemaType>(['object', 'array', 'tuple', 'union', 'intersection', 'ref'])\n\ntype DirectionProbeContext = { options: PrinterZodOptions; transform: () => null; base: () => null; import: () => void }\n\n/**\n * Runs the node's effective handler (a `printer.nodes` override, else the built-in) once per\n * direction and reports whether the two disagree. That difference is what makes a component\n * need an `${name}InputSchema` variant.\n */\nfunction variesByDirection({ node, printerOptions }: { node: ast.SchemaNode; printerOptions: PrinterZodOptions }): boolean {\n  if (CONTAINER_TYPES.has(node.type)) return false\n\n  const handler = printerOptions.nodes?.[node.type] ?? scalarNodes[node.type]\n  if (!handler) return false\n\n  const call = (direction: 'encode' | 'decode') => {\n    const context: DirectionProbeContext = { options: { ...printerOptions, direction }, transform: () => null, base: () => null, import: () => {} }\n    return (handler as (this: DirectionProbeContext, node: ast.SchemaNode) => string | null).call(context, node)\n  }\n\n  return call('decode') !== call('encode')\n}\n\n/**\n * Whether the schema transitively contains a node that prints differently per direction, so it\n * must decode on responses and encode on requests. Follows `$ref`s through their resolved\n * schema, with `seen` guarding cycles.\n */\nexport function containsDirectionalNode({\n  node,\n  printerOptions,\n  seen = new Set(),\n}: {\n  node: ast.SchemaNode | undefined\n  printerOptions: PrinterZodOptions\n  seen?: Set<string>\n}): boolean {\n  if (!node) return false\n\n  if (node.type === 'ref') {\n    if (!node.ref) return false\n    const refName = extractRefName(node.ref)\n    if (refName) {\n      if (seen.has(refName)) return false\n      seen.add(refName)\n    }\n    const resolved = syncSchemaRef(node)\n    if (resolved.type === 'ref') return false\n    return containsDirectionalNode({ node: resolved, printerOptions, seen })\n  }\n\n  if (variesByDirection({ node, printerOptions })) return true\n\n  const children: Array<ast.SchemaNode | undefined> = []\n  if ('properties' in node && node.properties) children.push(...node.properties.map((prop) => prop.schema))\n  if ('items' in node && node.items) children.push(...node.items)\n  if ('members' in node && node.members) children.push(...node.members)\n  if ('additionalProperties' in node && node.additionalProperties && node.additionalProperties !== true) children.push(node.additionalProperties)\n  const propertyNames = propertyNamesOf(node)\n  if (propertyNames) children.push(propertyNames)\n\n  return children.some((child) => containsDirectionalNode({ node: child, printerOptions, seen }))\n}\n\n/**\n * Names of the `$ref` schemas the generator should route to their input (encode) variant.\n */\nexport function collectDirectionalRefNames({ node, printerOptions }: { node: ast.SchemaNode; printerOptions: PrinterZodOptions }): Array<string> {\n  return ast.collectSync<string>(node, {\n    schema: (n) => (n.type === 'ref' && n.ref && containsDirectionalNode({ node: n, printerOptions }) ? (ast.resolveRefName(n) ?? undefined) : undefined),\n  })\n}\n\n/**\n * Handlers that never recurse into children, so {@link variesByDirection} can call one directly\n * to probe both directions without building a printer.\n *\n * `date` and `time` are the built-in two-way conversions, decoding `string → Date` on responses\n * and encoding back on requests. `date` keeps `date` and `date-time` precision apart. `time` has\n * no date component, so it decodes onto `1970-01-01` UTC and encodes back to `HH:mm:ss`, dropping\n * fractional seconds. Only `representation: 'date'` fields convert; ISO-string fields print the\n * matching `z.iso.*()` either way. A `printer.nodes.date` or `printer.nodes.time` override\n * replaces the whole handler, direction branch included.\n */\nconst scalarNodes: PrinterZodNodes = {\n  any: () => 'z.any()',\n  unknown: () => 'z.unknown()',\n  void: () => 'z.void()',\n  never: () => 'z.never()',\n  boolean: () => 'z.boolean()',\n  null: () => 'z.null()',\n  string(node) {\n    const call = shouldCoerce(this.options.coercion, 'strings') ? undefined : STRING_FORMAT_CALLS.get(node.format)\n    if (call) return `${call}${lengthConstraints({ ...node, regexType: this.options.regexType })}`\n\n    const base = shouldCoerce(this.options.coercion, 'strings') ? 'z.coerce.string()' : 'z.string()'\n    const pattern = node.pattern ?? integerFormatPattern(node.format)\n\n    return `${base}${lengthConstraints({ ...node, pattern, regexType: this.options.regexType })}`\n  },\n  number(node) {\n    const base = shouldCoerce(this.options.coercion, 'numbers') ? 'z.coerce.number()' : 'z.number()'\n\n    return `${base}${numberConstraints(node)}`\n  },\n  integer(node) {\n    if (!shouldCoerce(this.options.coercion, 'numbers')) {\n      if (node.format === 'int32') {\n        return `z.int32()${numberConstraints(node)}`\n      }\n      if (node.format === 'uint32') {\n        return `z.uint32()${numberConstraints(node)}`\n      }\n    }\n\n    const base = shouldCoerce(this.options.coercion, 'numbers') ? 'z.coerce.number().int()' : 'z.int()'\n\n    return `${base}${numberConstraints(node)}`\n  },\n  bigint() {\n    return 'z.coerce.bigint()'\n  },\n  date(node) {\n    if (node.representation !== 'date') return 'z.iso.date()'\n\n    if (this.options.direction === 'encode') {\n      return node.format === 'date' ? 'z.date().transform((value) => value.toISOString().slice(0, 10))' : 'z.date().transform((value) => value.toISOString())'\n    }\n\n    const decoded = node.format === 'date' ? 'z.iso.date().transform((value) => new Date(value))' : 'z.iso.datetime().transform((value) => new Date(value))'\n    return shouldCoerce(this.options.coercion, 'dates') ? 'z.coerce.date()' : decoded\n  },\n  datetime(node) {\n    const offset = node.offset || this.options.dateType === 'stringOffset'\n    const local = node.local || this.options.dateType === 'stringLocal'\n\n    if (offset) return 'z.iso.datetime({ offset: true })'\n    if (local) return 'z.iso.datetime({ local: true })'\n\n    return 'z.iso.datetime()'\n  },\n  time(node) {\n    if (node.representation === 'string') {\n      return 'z.iso.time()'\n    }\n\n    if (this.options.direction === 'encode') {\n      return 'z.date().transform((value) => value.toISOString().slice(11, 19))'\n    }\n\n    // No `z.coerce.date()` branch: `new Date('13:45:00')` is an Invalid Date, so coercion cannot parse a wire time.\n    return 'z.iso.time().transform((value) => new Date(`1970-01-01T${value}Z`))'\n  },\n  uuid(node) {\n    const base = this.options.guidType === 'guid' ? 'z.guid()' : 'z.uuid()'\n\n    return `${base}${lengthConstraints({ ...node, regexType: this.options.regexType })}`\n  },\n  email(node) {\n    return `z.email()${lengthConstraints({ ...node, regexType: this.options.regexType })}`\n  },\n  url(node) {\n    return `z.url()${lengthConstraints({ ...node, regexType: this.options.regexType })}`\n  },\n  ipv4: () => 'z.ipv4()',\n  ipv6: () => 'z.ipv6()',\n  blob: () => 'z.instanceof(File)',\n  enum(node) {\n    const values = node.namedEnumValues?.map((v) => v.value) ?? node.enumValues ?? []\n    const nonNullValues = values.filter((v): v is string | number | boolean => v !== null)\n\n    // asConst-style enum: use z.union([z.literal(…), …])\n    if (node.namedEnumValues?.length) {\n      const literals = nonNullValues.map((v) => `z.literal(${formatDefault(v)})`)\n\n      if (literals.length === 1) return literals[0]!\n      return `z.union([${literals.join(', ')}])`\n    }\n\n    // Regular enum: z.enum for all-string sets, z.literal/z.union otherwise\n    return buildEnum(nonNullValues)\n  },\n}\n\n/**\n * Zod v4 printer built with `definePrinter`.\n *\n * Converts a `SchemaNode` AST into a Zod v4 code string using the chainable API\n * (`.optional()`, `.nullable()`, `.omit()`, etc.). For improved tree-shaking, see {@link printerZodMini}.\n *\n * @example Chainable API\n * ```ts\n * const printer = printerZod({ coercion: false })\n * const code = printer.print(stringNode) // \"z.string()\"\n * ```\n */\nexport const printerZod = ast.createPrinter<PrinterZodFactory>((options) => {\n  // The object handler temporarily reassigns `options.cyclicSchemas` to `undefined` while rendering a\n  // getter body (to suppress nested `z.lazy()`), so capture a stable reference for the `.strict()`\n  // skip decision, which must still see cyclic members inside those getter bodies.\n  const cyclicSchemaNames = options.cyclicSchemas\n  const nodes: PrinterZodNodes = {\n    ...scalarNodes,\n    ref(node) {\n      if (!node.name) return null\n      const refName = ast.resolveRefName(node)\n      if (!refName) return null\n\n      // In the input direction, a component whose fields print differently by direction resolves\n      // to its `${name}InputSchema` variant so request bodies encode instead of decoding.\n      const useInputVariant = node.ref != null && this.options.direction === 'encode' && containsDirectionalNode({ node, printerOptions: this.options })\n      const resolvedName = node.ref\n        ? useInputVariant\n          ? (this.options.resolver?.schema.inputName(refName) ?? refName)\n          : (this.options.resolver?.name(refName) ?? refName)\n        : node.name\n\n      if (node.ref && this.options.cyclicSchemas?.has(refName)) {\n        return `z.lazy(() => ${resolvedName})`\n      }\n\n      return resolvedName\n    },\n    object(node) {\n      const entries = node.properties ?? []\n      const patterns = node.patternProperties ? Object.entries(node.patternProperties) : []\n      const propertyNamesNode = propertyNamesOf(node)\n      const propertyNamesKeySchema = propertyNamesNode ? this.transform(propertyNamesNode) : null\n\n      // `additionalProperties: false` still permits patternProperties keys, so only a pattern-free object is strict.\n      // `z.strictObject(...)` rather than `z.object(...).strict()`: `.strict()` reads `.shape` eagerly, which runs a\n      // self-reference's deferred getter while its own `const` is still in the temporal dead zone.\n      const isStrict = node.additionalProperties === false && patterns.length === 0\n      const isLoose = node.additionalProperties === true\n      const ctor = isStrict ? 'z.strictObject' : isLoose ? 'z.looseObject' : 'z.object'\n      const shape = buildZodObjectShape(this, node)\n      const objectBase = `${ctor}(${shape})`\n\n      const result = (() => {\n        // Closed key schemas (enums, literals) use z.partialRecord() so missing keys do not fail exhaustiveness.\n        const recordFn = isClosedKeySchema(propertyNamesNode) ? 'z.partialRecord' : 'z.record'\n\n        if (node.additionalProperties && node.additionalProperties !== true) {\n          const catchallType = this.transform(node.additionalProperties)\n          if (entries.length === 0) {\n            return catchallType ? `${recordFn}(${propertyNamesKeySchema || 'z.string()'}, ${catchallType})` : objectBase\n          }\n          return catchallType ? `${objectBase}.catchall(${catchallType})` : objectBase\n        }\n        if (entries.length === 0 && patterns.length === 0 && propertyNamesKeySchema && !isStrict) {\n          const unknownType = this.transform(ast.factory.createSchema({ type: 'unknown' }))!\n          return `${recordFn}(${propertyNamesKeySchema}, ${unknownType})`\n        }\n        if (node.additionalProperties === true) return objectBase\n        if (isStrict) return objectBase\n\n        // No fixed properties: z.record enforces the key pattern. With fixed properties a record would\n        // reject the declared keys, so fall back to .catchall (value validated, key pattern not).\n        if (patterns.length > 0) {\n          const values = patterns.map(([, valueSchema]) => {\n            const valueType = this.transform(valueSchema) ?? this.transform(ast.factory.createSchema({ type: 'unknown' }))!\n            return valueSchema.nullable ? `${valueType}.nullable()` : valueType\n          })\n          const distinct = [...new Set(values)]\n          const value = distinct.length === 1 ? distinct[0]! : `z.union([${distinct.join(', ')}])`\n\n          if (entries.length > 0) return `${objectBase}.catchall(${value})`\n          return `z.record(${patternKeySchema({ patterns: patterns.map(([pattern]) => pattern), regexType: this.options.regexType })}, ${value})`\n        }\n\n        return objectBase\n      })()\n\n      return result\n    },\n    array(node) {\n      const items = mapSchemaItems(node, (item) => this.transform(item))\n        .map(({ output }) => output)\n        .filter(Boolean)\n      const inner = items.join(', ') || this.transform(ast.factory.createSchema({ type: 'unknown' }))!\n      const base = `z.array(${inner})${lengthConstraints({ ...node, regexType: this.options.regexType })}`\n\n      return node.unique ? `${base}.refine(items => new Set(items).size === items.length, { message: \"Array entries must be unique\" })` : base\n    },\n    tuple(node) {\n      const items = mapSchemaItems(node, (item) => this.transform(item))\n        .map(({ output }) => output)\n        .filter(Boolean)\n\n      return `z.tuple(${buildList(items)})`\n    },\n    union(node) {\n      const nodeMembers = node.members ?? []\n      // z.discriminatedUnion needs every option to be a ZodObject. Object variants (refs or\n      // `.extend(…)`-composed `allOf`) qualify; intersections, cyclic `z.lazy(…)` refs, and\n      // non-objects fall back to z.union.\n      const isDiscriminated = !!node.discriminatorPropertyName && nodeMembers.every((m) => isObjectSchemaNode(m, cyclicSchemaNames))\n      const isXor = node.strategy === 'one' && !isDiscriminated && this.options.oneOfType === 'xor'\n      // `z.xor` already rejects a value matching several members, so its members stay as declared.\n      const isStrict = node.strategy === 'one' && !isXor\n      const members = mapSchemaMembers(node, (memberNode) => this.transform(isStrict ? strictOneOfNode(memberNode) : memberNode))\n        .map(({ schema, output }) => (output && isStrict ? strictOneOfMember(output, schema, cyclicSchemaNames) : output))\n        .filter(Boolean)\n      if (members.length === 0) return ''\n      if (members.length === 1) return members[0]!\n      if (isDiscriminated) {\n        return `z.discriminatedUnion(${stringify(node.discriminatorPropertyName)}, ${buildList(members)})`\n      }\n      if (isXor) return `z.xor(${buildList(members)})`\n\n      return `z.union(${buildList(members)})`\n    },\n    intersection(node) {\n      const members = node.members ?? []\n      if (members.length === 0) return ''\n\n      const [first, ...rest] = members\n      if (!first) return ''\n\n      const firstBase = this.transform(first)\n      if (!firstBase) return ''\n\n      // An object `allOf` is a merge, not a runtime intersection: `.extend({ … })` keeps it a\n      // ZodObject (usable in z.discriminatedUnion) instead of the non-discriminable `.and(…)`.\n      if (rest.length > 0 && isObjectComposableIntersection(node, cyclicSchemaNames)) {\n        return rest.reduce((acc, member) => `${acc}.extend(${buildZodObjectShape(this, member)})`, firstBase)\n      }\n\n      return rest.reduce((acc, member) => {\n        const constraint = getMemberConstraint({ member, regexType: this.options.regexType, lengths: lengthConstraints, numbers: numberConstraints })\n        if (constraint) return acc + constraint\n        const transformed = this.transform(member)\n        return transformed ? `${acc}.and(${transformed})` : acc\n      }, firstBase)\n    },\n  }\n\n  return {\n    name: 'zod',\n    options,\n    nodes,\n    overrides: options.nodes,\n    print(node) {\n      return printWithOmit(this, node, (value, meta) =>\n        applyModifiers({\n          value,\n          schema: node,\n          nullable: meta.nullable,\n          optional: meta.optional,\n          nullish: meta.nullish,\n          defaultValue: meta.default,\n          description: meta.description,\n          examples: meta.examples,\n        }),\n      )\n    },\n  }\n})\n","import { mapSchemaItems, mapSchemaMembers } from '@internals/shared'\nimport { buildList, stringify } from '@internals/utils'\nimport { ast } from 'kubb/kit'\nimport type { PluginZod, ResolverZod } from '../types.ts'\nimport {\n  applyMiniModifiers,\n  buildEnum,\n  buildObjectShape,\n  formatDefault,\n  getMemberConstraint,\n  integerFormatPattern,\n  isClosedKeySchema,\n  isObjectComposableIntersection,\n  isObjectSchemaNode,\n  lengthChecksMini,\n  numberChecksMini,\n  patternKeySchemaMini,\n  printWithOmit,\n  propertyNamesOf,\n  shouldCoerce,\n  strictOneOfNode,\n  STRING_FORMAT_CALLS,\n} from '../utils.ts'\n\n/**\n * Partial map of node-type overrides for the Zod Mini printer.\n *\n * Each key is a `SchemaType` string (e.g. `'date'`, `'string'`). The function\n * replaces the built-in handler for that node type. Use `this.transform` to\n * recurse into nested schema nodes, `this.base` to reuse the output of the\n * handler being replaced, and `this.options` to read printer options.\n *\n * @example Override the `date` handler\n * ```ts\n * pluginZod({\n *   mini: true,\n *   printer: {\n *     nodes: {\n *       date(node) {\n *         return 'z.iso.date()'\n *       },\n *     },\n *   },\n * })\n * ```\n */\nexport type PrinterZodMiniNodes = ast.PrinterPartial<string, PrinterZodMiniOptions>\n\nexport type PrinterZodMiniOptions = {\n  /**\n   * Enable automatic type coercion for strings, numbers, and dates through `z.coerce.*()`.\n   */\n  coercion?: PluginZod['resolvedOptions']['coercion']\n  /**\n   * Use `z.guid()` or `z.uuid()` for UUID/GUID validation.\n   *\n   * @default 'uuid'\n   */\n  guidType?: PluginZod['resolvedOptions']['guidType']\n  /**\n   * Output form for an OpenAPI `pattern` inside `z.regex(...)`: a regex literal\n   * (`'literal'`) or the `RegExp` constructor (`'constructor'`).\n   *\n   * @default 'literal'\n   */\n  regexType?: PluginZod['resolvedOptions']['regexType']\n  /**\n   * How a non-discriminated `oneOf` is printed: `z.union` with strict members or `z.xor`.\n   *\n   * @default 'union'\n   */\n  oneOfType?: PluginZod['resolvedOptions']['oneOfType']\n  /**\n   * Transforms raw schema names into valid JavaScript identifiers.\n   */\n  resolver?: ResolverZod\n  /**\n   * Properties to exclude using `.omit({ key: true })`.\n   */\n  keysToOmit?: Array<string> | null\n  /**\n   * Schema names that form circular dependency chains.\n   * Properties referencing these emit lazy getters wrapping refs in `z.lazy(() => …)`.\n   */\n  cyclicSchemas?: ReadonlySet<string>\n  /**\n   * Custom handler map for node type overrides.\n   */\n  nodes?: PrinterZodMiniNodes\n}\n\n/**\n * Factory options for the Zod Mini printer, defining input/output types and configuration.\n */\nexport type PrinterZodMiniFactory = ast.PrinterFactoryOptions<'zod-mini', PrinterZodMiniOptions, string, string>\n\n/**\n * Builds the `{ key: value, … }` shape for an object node with the functional `zod/mini` modifiers.\n */\nfunction buildZodMiniObjectShape(ctx: Parameters<typeof buildObjectShape>[0], node: ast.SchemaNode): string {\n  return buildObjectShape(ctx, node, ({ value, schema, required, meta }) =>\n    applyMiniModifiers({\n      value,\n      schema,\n      nullable: meta.nullable,\n      optional: schema.optional || required === false,\n      nullish: schema.nullish,\n      defaultValue: meta.default,\n    }),\n  )\n}\n\n/**\n * Zod v4 Mini printer built with `definePrinter`.\n *\n * Converts a `SchemaNode` AST into a Zod v4 code string using the functional API\n * (`z.optional(z.string())`) for improved tree-shaking. See {@link printerZod} for the chainable API.\n *\n * @example Functional Mini API\n * ```ts\n * const printer = printerZodMini({})\n * const code = printer.print(optionalStringNode) // \"z.optional(z.string())\"\n * ```\n */\nexport const printerZodMini = ast.createPrinter<PrinterZodMiniFactory>((options) => {\n  // The object handler temporarily clears `options.cyclicSchemas` while rendering a getter body, so\n  // capture a stable reference for the intersection/union discriminability decisions.\n  const cyclicSchemaNames = options.cyclicSchemas\n  return {\n    name: 'zod-mini',\n    options,\n    nodes: {\n      any: () => 'z.any()',\n      unknown: () => 'z.unknown()',\n      void: () => 'z.void()',\n      never: () => 'z.never()',\n      boolean: () => 'z.boolean()',\n      null: () => 'z.null()',\n      string(node) {\n        const coerce = shouldCoerce(this.options.coercion, 'strings')\n\n        const call = coerce ? undefined : STRING_FORMAT_CALLS.get(node.format)\n        if (call) return `${call}${lengthChecksMini({ ...node, regexType: this.options.regexType })}`\n\n        const base = coerce ? 'z.coerce.string()' : 'z.string()'\n        const pattern = node.pattern ?? integerFormatPattern(node.format)\n\n        return `${base}${lengthChecksMini({ ...node, pattern, regexType: this.options.regexType })}`\n      },\n      number(node) {\n        const base = shouldCoerce(this.options.coercion, 'numbers') ? 'z.coerce.number()' : 'z.number()'\n\n        return `${base}${numberChecksMini(node)}`\n      },\n      integer(node) {\n        if (shouldCoerce(this.options.coercion, 'numbers')) {\n          return `z.coerce.number().check(z.int())${numberChecksMini(node)}`\n        }\n        if (node.format === 'int32') {\n          return `z.int32()${numberChecksMini(node)}`\n        }\n        if (node.format === 'uint32') {\n          return `z.uint32()${numberChecksMini(node)}`\n        }\n\n        return `z.int()${numberChecksMini(node)}`\n      },\n      bigint(node) {\n        return `z.coerce.bigint()${numberChecksMini(node)}`\n      },\n      date(node) {\n        if (node.representation === 'string') {\n          return 'z.iso.date()'\n        }\n\n        return shouldCoerce(this.options.coercion, 'dates') ? 'z.coerce.date()' : 'z.date()'\n      },\n      datetime() {\n        // Mini mode: datetime validation via z.string() (z.iso.datetime not available in mini)\n        return 'z.string()'\n      },\n      time(node) {\n        if (node.representation === 'string') {\n          return 'z.iso.time()'\n        }\n\n        return 'z.date()'\n      },\n      uuid(node) {\n        const base = this.options.guidType === 'guid' ? 'z.guid()' : 'z.uuid()'\n\n        return `${base}${lengthChecksMini({ ...node, regexType: this.options.regexType })}`\n      },\n      email(node) {\n        return `z.email()${lengthChecksMini({ ...node, regexType: this.options.regexType })}`\n      },\n      url(node) {\n        return `z.url()${lengthChecksMini({ ...node, regexType: this.options.regexType })}`\n      },\n      ipv4: () => 'z.ipv4()',\n      ipv6: () => 'z.ipv6()',\n      blob: () => 'z.instanceof(File)',\n      enum(node) {\n        const values = node.namedEnumValues?.map((v) => v.value) ?? node.enumValues ?? []\n        const nonNullValues = values.filter((v): v is string | number | boolean => v !== null)\n\n        // asConst-style enum: use z.union([z.literal(…), …])\n        if (node.namedEnumValues?.length) {\n          const literals = nonNullValues.map((v) => `z.literal(${formatDefault(v)})`)\n          if (literals.length === 1) return literals[0]!\n          return `z.union([${literals.join(', ')}])`\n        }\n\n        // Regular enum: z.enum for all-string sets, z.literal/z.union otherwise\n        return buildEnum(nonNullValues)\n      },\n\n      ref(node) {\n        if (!node.name) return null\n        const refName = ast.resolveRefName(node)\n        if (!refName) return null\n        const resolvedName = node.ref ? (this.options.resolver?.name(refName) ?? refName) : node.name\n\n        if (node.ref && this.options.cyclicSchemas?.has(refName)) {\n          return `z.lazy(() => ${resolvedName})`\n        }\n\n        return resolvedName\n      },\n      object(node) {\n        const entries = node.properties ?? []\n        // zod/mini has no chainable `.catchall()`/`.strict()`, so route through the functional forms.\n        const patterns = node.patternProperties ? Object.entries(node.patternProperties) : []\n        const propertyNamesNode = propertyNamesOf(node)\n        const propertyNamesKeySchema = propertyNamesNode ? this.transform(propertyNamesNode) : null\n\n        // `additionalProperties: false` still permits patternProperties keys, so only a pattern-free object is strict.\n        const isStrict = node.additionalProperties === false && patterns.length === 0\n        const isLoose = node.additionalProperties === true\n        const ctor = isStrict ? 'z.strictObject' : isLoose ? 'z.looseObject' : 'z.object'\n        const shape = buildZodMiniObjectShape(this, node)\n        const objectBase = `${ctor}(${shape})`\n\n        // Closed key schemas (enums, literals) use z.partialRecord() so missing keys do not fail exhaustiveness.\n        const recordFn = isClosedKeySchema(propertyNamesNode) ? 'z.partialRecord' : 'z.record'\n\n        if (node.additionalProperties && node.additionalProperties !== true) {\n          const catchallType = this.transform(node.additionalProperties)\n          if (entries.length === 0) {\n            return catchallType ? `${recordFn}(${propertyNamesKeySchema || 'z.string()'}, ${catchallType})` : objectBase\n          }\n          return catchallType ? `z.catchall(${objectBase}, ${catchallType})` : objectBase\n        }\n        if (entries.length === 0 && patterns.length === 0 && propertyNamesKeySchema && !isStrict) {\n          const unknownType = this.transform(ast.factory.createSchema({ type: 'unknown' }))!\n          return `${recordFn}(${propertyNamesKeySchema}, ${unknownType})`\n        }\n        if (node.additionalProperties === true) return objectBase\n        if (isStrict) return objectBase\n\n        if (patterns.length > 0) {\n          const values = patterns.map(([, valueSchema]) => {\n            const valueType = this.transform(valueSchema) ?? this.transform(ast.factory.createSchema({ type: 'unknown' }))!\n            return valueSchema.nullable ? `z.nullable(${valueType})` : valueType\n          })\n          const distinct = [...new Set(values)]\n          const value = distinct.length === 1 ? distinct[0]! : `z.union([${distinct.join(', ')}])`\n\n          if (entries.length > 0) return `z.catchall(${objectBase}, ${value})`\n          return `z.record(${patternKeySchemaMini({ patterns: patterns.map(([pattern]) => pattern), regexType: this.options.regexType })}, ${value})`\n        }\n\n        return objectBase\n      },\n      array(node) {\n        const items = mapSchemaItems(node, (item) => this.transform(item))\n          .map(({ output }) => output)\n          .filter(Boolean)\n        const inner = items.join(', ') || this.transform(ast.factory.createSchema({ type: 'unknown' }))!\n        const base = `z.array(${inner})${lengthChecksMini({ ...node, regexType: this.options.regexType })}`\n\n        return node.unique ? `${base}.check(z.refine(items => new Set(items).size === items.length, { message: \"Array entries must be unique\" }))` : base\n      },\n      tuple(node) {\n        const items = mapSchemaItems(node, (item) => this.transform(item))\n          .map(({ output }) => output)\n          .filter(Boolean)\n\n        return `z.tuple(${buildList(items)})`\n      },\n      union(node) {\n        const nodeMembers = node.members ?? []\n        // z.discriminatedUnion needs every option to be a Zod object. Object variants (refs or\n        // `z.extend(…)`-composed `allOf`) qualify; intersections, cyclic `z.lazy(…)` refs, and\n        // non-objects fall back to z.union.\n        const isDiscriminated = !!node.discriminatorPropertyName && nodeMembers.every((m) => isObjectSchemaNode(m, cyclicSchemaNames))\n        const isXor = node.strategy === 'one' && !isDiscriminated && this.options.oneOfType === 'xor'\n        // `z.xor` already rejects a value matching several members, so its members stay as declared.\n        const isStrict = node.strategy === 'one' && !isXor\n        const members = mapSchemaMembers(node, (memberNode) => this.transform(isStrict ? strictOneOfNode(memberNode) : memberNode))\n          .map(({ output }) => output)\n          .filter(Boolean)\n        if (members.length === 0) return ''\n        if (members.length === 1) return members[0]!\n        if (isDiscriminated) {\n          return `z.discriminatedUnion(${stringify(node.discriminatorPropertyName)}, ${buildList(members)})`\n        }\n        if (isXor) return `z.xor(${buildList(members)})`\n\n        return `z.union(${buildList(members)})`\n      },\n      intersection(node) {\n        const members = node.members ?? []\n        if (members.length === 0) return ''\n\n        const [first, ...rest] = members\n        if (!first) return ''\n\n        const firstBase = this.transform(first)\n        if (!firstBase) return ''\n\n        // An object `allOf` is a merge, not a runtime intersection: `z.extend(base, { … })` keeps it\n        // a Zod object (usable in z.discriminatedUnion) instead of a non-discriminable `z.intersection`.\n        if (rest.length > 0 && isObjectComposableIntersection(node, cyclicSchemaNames)) {\n          return rest.reduce((acc, member) => `z.extend(${acc}, ${buildZodMiniObjectShape(this, member)})`, firstBase)\n        }\n\n        return rest.reduce((acc, member) => {\n          const constraint = getMemberConstraint({ member, regexType: this.options.regexType, lengths: lengthChecksMini, numbers: numberChecksMini })\n          if (constraint) return acc + constraint\n          const transformed = this.transform(member)\n          return transformed ? `z.intersection(${acc}, ${transformed})` : acc\n        }, firstBase)\n      },\n    },\n    overrides: options.nodes,\n    print(node) {\n      return printWithOmit(\n        this,\n        node,\n        (value, meta) =>\n          applyMiniModifiers({ value, schema: node, nullable: meta.nullable, optional: meta.optional, nullish: meta.nullish, defaultValue: meta.default }),\n        true,\n      )\n    },\n  }\n})\n","import {\n  buildOptionsSchema,\n  buildResponses,\n  getOasAdapter,\n  getOperationParameters,\n  getSuccessResponses,\n  isSuccessStatusCode,\n  resolveContentTypeVariants,\n} from '@internals/shared'\nimport { ast, defineGenerator } from 'kubb/kit'\nimport { File, jsxRenderer } from 'kubb/jsx'\nimport { Zod } from '../components/Zod.tsx'\nimport { collectDirectionalRefNames, containsDirectionalNode, printerZod } from '../printers/printerZod.ts'\nimport type { PrinterZodOptions } from '../printers/printerZod.ts'\nimport { printerZodMini } from '../printers/printerZodMini.ts'\nimport type { PluginZod, ResolverZod } from '../types'\n\ntype StdPrinters = { decode: ReturnType<typeof printerZod>; encode: ReturnType<typeof printerZod> }\ntype ZodPrinterEntry = StdPrinters & { coercion: unknown; guidType: unknown; regexType: unknown; oneOfType: unknown; dateType: unknown; nodes: unknown }\ntype ZodMiniPrinterEntry = {\n  printer: ReturnType<typeof printerZodMini>\n  coercion: unknown\n  guidType: unknown\n  regexType: unknown\n  oneOfType: unknown\n  nodes: unknown\n}\n\n// Per-build caches: keyed on resolver (unique per plugin instance per build, GC'd when released)\nconst zodPrinterCache = new WeakMap<ResolverZod, ZodPrinterEntry>()\nconst zodMiniPrinterCache = new WeakMap<ResolverZod, ZodMiniPrinterEntry>()\n\ntype StdPrinterParams = {\n  coercion: unknown\n  guidType: unknown\n  regexType: unknown\n  oneOfType: unknown\n  dateType: unknown\n  cyclicSchemas: ReadonlySet<string>\n  nodes: unknown\n}\n\ntype BuildResponseUnionParams = {\n  responses: Array<ast.ResponseNode>\n  name: string\n  fallbackUnknown: boolean\n}\n\n/**\n * Cached printer per direction for a resolver, built on first use. Schemas holding nothing that\n * converts print the same either way.\n */\nfunction getStdPrinters(resolver: ResolverZod, params: StdPrinterParams): StdPrinters {\n  const cached = zodPrinterCache.get(resolver)\n  if (\n    cached &&\n    cached.coercion === params.coercion &&\n    cached.guidType === params.guidType &&\n    cached.regexType === params.regexType &&\n    cached.oneOfType === params.oneOfType &&\n    cached.dateType === params.dateType &&\n    cached.nodes === params.nodes\n  ) {\n    return { decode: cached.decode, encode: cached.encode }\n  }\n  const decode = printerZod({ ...params, resolver, direction: 'decode' } as Parameters<typeof printerZod>[0])\n  const encode = printerZod({ ...params, resolver, direction: 'encode' } as Parameters<typeof printerZod>[0])\n  zodPrinterCache.set(resolver, {\n    decode,\n    encode,\n    coercion: params.coercion,\n    guidType: params.guidType,\n    regexType: params.regexType,\n    oneOfType: params.oneOfType,\n    dateType: params.dateType,\n    nodes: params.nodes,\n  })\n  return { decode, encode }\n}\n\nfunction getMiniPrinter(\n  resolver: ResolverZod,\n  params: {\n    coercion: unknown\n    guidType: unknown\n    regexType: unknown\n    oneOfType: unknown\n    cyclicSchemas: ReadonlySet<string>\n    nodes: unknown\n  },\n) {\n  const cached = zodMiniPrinterCache.get(resolver)\n  if (\n    cached &&\n    cached.coercion === params.coercion &&\n    cached.guidType === params.guidType &&\n    cached.regexType === params.regexType &&\n    cached.oneOfType === params.oneOfType &&\n    cached.nodes === params.nodes\n  )\n    return cached.printer\n  const p = printerZodMini({ ...params, resolver } as Parameters<typeof printerZodMini>[0])\n  zodMiniPrinterCache.set(resolver, {\n    printer: p,\n    coercion: params.coercion,\n    guidType: params.guidType,\n    regexType: params.regexType,\n    oneOfType: params.oneOfType,\n    nodes: params.nodes,\n  })\n  return p\n}\n\n/**\n * Built-in generator for `@kubb/plugin-zod`. Emits one Zod schema per\n * schema in the spec plus per-operation request/response/parameter schemas.\n * When `mini: true`, schemas use the Zod Mini functional API instead of\n * chainable methods.\n */\nexport const zodGenerator = defineGenerator<PluginZod>({\n  name: 'zod',\n  renderer: jsxRenderer,\n  schema(node, ctx) {\n    const { adapter, config, resolver, root } = ctx\n    const { output, coercion, guidType, regexType, oneOfType, compile, mini, inferred, typeGuards, importPath, group, printer } = ctx.options\n    const dateType = getOasAdapter(adapter).options.dateType\n\n    if (!node.name) {\n      return\n    }\n\n    const isZodImport = importPath === 'zod' || importPath === 'zod/mini'\n    const cyclicSchemas = new Set<string>(ctx.meta.circularNames)\n    const printerOptions: PrinterZodOptions = { coercion, guidType, regexType, oneOfType, dateType, resolver, cyclicSchemas, nodes: printer?.nodes }\n\n    // Rendered twice: the canonical schema decodes, the `${name}InputSchema` variant encodes.\n    const hasDirectionalNode = !mini && containsDirectionalNode({ node, printerOptions })\n\n    const directionalRefNames = new Set(hasDirectionalNode ? collectDirectionalRefNames({ node, printerOptions }) : [])\n    const importEntries = resolver.imports({ node, root, output, group: group ?? undefined })\n    const inputImportEntries = hasDirectionalNode\n      ? [...directionalRefNames].map((schemaName) => ({\n          name: [resolver.schema.inputName(schemaName)],\n          path: resolver.file({ name: schemaName, extname: '.ts', root, output, group: group ?? undefined }).path,\n        }))\n      : []\n    const imports = [\n      ...new Map(\n        [...importEntries, ...inputImportEntries].map((imp) => [`${Array.isArray(imp.name) ? imp.name.join(',') : imp.name}|${imp.path}`, imp] as const),\n      ).values(),\n    ]\n\n    const meta = {\n      name: resolver.name(node.name),\n      file: resolver.file({ name: node.name, extname: '.ts', root, output, group: group ?? undefined }),\n    } as const\n\n    const inferTypeName = inferred ? resolver.schema.typeName(node.name) : null\n    const isName = typeGuards ? resolver.schema.isName(node.name) : null\n    const assertName = typeGuards ? resolver.schema.assertName(node.name) : null\n\n    const stdPrinters = mini ? null : getStdPrinters(resolver, { coercion, guidType, regexType, oneOfType, dateType, cyclicSchemas, nodes: printer?.nodes })\n    const schemaPrinter = mini\n      ? getMiniPrinter(resolver, { coercion, guidType, regexType, oneOfType, cyclicSchemas, nodes: printer?.nodes })\n      : stdPrinters!.decode\n\n    return (\n      <File\n        baseName={meta.file.baseName}\n        path={meta.file.path}\n        meta={meta.file.meta}\n        banner={resolver.default.banner(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n        footer={resolver.default.footer(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n      >\n        <File.Import name={isZodImport ? 'z' : ['z']} path={importPath} isNameSpace={isZodImport} />\n        {imports.map((imp) => (\n          <File.Import key={[node.name, imp.path, imp.name].join('-')} root={meta.file.path} path={imp.path} name={imp.name} />\n        ))}\n\n        <Zod\n          name={meta.name}\n          node={node}\n          printer={schemaPrinter}\n          inferTypeName={inferTypeName}\n          typeGuards={typeGuards}\n          isName={isName}\n          assertName={assertName}\n          mini={mini}\n          cyclic={cyclicSchemas.has(node.name)}\n          compile={compile}\n        />\n        {hasDirectionalNode && stdPrinters && (\n          <Zod\n            name={resolver.schema.inputName(node.name)}\n            node={node}\n            printer={stdPrinters.encode}\n            inferTypeName={inferred ? resolver.schema.inputTypeName(node.name) : null}\n            typeGuards={typeGuards}\n            isName={typeGuards ? resolver.schema.isName(resolver.schema.inputName(node.name)) : null}\n            assertName={typeGuards ? resolver.schema.assertName(resolver.schema.inputName(node.name)) : null}\n            mini={mini}\n            cyclic={cyclicSchemas.has(node.name)}\n            compile={compile}\n          />\n        )}\n      </File>\n    )\n  },\n  operation(node, ctx) {\n    if (!ast.isHttpOperationNode(node)) return null\n    const { adapter, config, resolver, root } = ctx\n    const { output, coercion, guidType, regexType, oneOfType, compile, mini, inferred, importPath, group, printer } = ctx.options\n    const dateType = getOasAdapter(adapter).options.dateType\n\n    const isZodImport = importPath === 'zod' || importPath === 'zod/mini'\n\n    const meta = {\n      file: resolver.file({ name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path, root, output, group: group ?? undefined }),\n    } as const\n\n    const cyclicSchemas = new Set<string>(ctx.meta.circularNames)\n    const printerOptions: PrinterZodOptions = { coercion, guidType, regexType, oneOfType, dateType, resolver, cyclicSchemas, nodes: printer?.nodes }\n\n    function renderSchemaEntry({\n      schema,\n      name,\n      keysToOmit,\n      direction = 'decode',\n    }: {\n      schema: ast.SchemaNode | null\n      name: string\n      keysToOmit?: Array<string> | null\n      direction?: 'encode' | 'decode'\n    }) {\n      if (!schema) return null\n\n      const inferTypeName = inferred ? resolver.schema.type(name) : null\n\n      const directionalRefNames = direction === 'encode' && !mini ? new Set(collectDirectionalRefNames({ node: schema, printerOptions })) : null\n      const imports = resolver.imports({\n        node: schema,\n        root,\n        output,\n        group: group ?? undefined,\n        name: (schemaName) => (directionalRefNames?.has(schemaName) ? resolver.schema.inputName(schemaName) : resolver.name(schemaName)),\n      })\n\n      const schemaPrinter = mini\n        ? keysToOmit?.length\n          ? printerZodMini({ coercion, guidType, regexType, oneOfType, resolver, keysToOmit, cyclicSchemas, nodes: printer?.nodes })\n          : getMiniPrinter(resolver, { coercion, guidType, regexType, oneOfType, cyclicSchemas, nodes: printer?.nodes })\n        : keysToOmit?.length\n          ? printerZod({\n              coercion,\n              guidType,\n              regexType,\n              oneOfType,\n              dateType,\n              resolver,\n              keysToOmit,\n              cyclicSchemas,\n              nodes: printer?.nodes,\n              direction,\n            })\n          : getStdPrinters(resolver, { coercion, guidType, regexType, oneOfType, dateType, cyclicSchemas, nodes: printer?.nodes })[direction]\n\n      return (\n        <>\n          {imports.map((imp) => (\n            <File.Import key={[name, imp.path, imp.name].join('-')} root={meta.file.path} path={imp.path} name={imp.name} />\n          ))}\n          {/* Operation schemas reference (and import) the component schemas, which carry the\n              `z.ZodType` annotation at their own definition when cyclic. Annotating the operation\n              schema too would only erase its inferred type to `unknown`, breaking typed consumers\n              (e.g. the MCP server's request types), so it is never marked cyclic here. */}\n          <Zod name={name} node={schema} printer={schemaPrinter} inferTypeName={inferTypeName} cyclic={false} compile={compile} />\n        </>\n      )\n    }\n\n    // Multiple content types for a single name: emit one schema per content type plus a union alias.\n    function buildContentTypeVariants(\n      entries: Array<{ contentType: string; schema?: ast.SchemaNode | null; keysToOmit?: Array<string> | null }>,\n      baseName: string,\n      decorate?: (schema: ast.SchemaNode) => ast.SchemaNode,\n      direction?: 'encode' | 'decode',\n    ) {\n      const variants = resolveContentTypeVariants(entries, baseName)\n      const unionSchema = ast.factory.createSchema({\n        type: 'union',\n        members: variants.map((variant) => ast.factory.createSchema({ type: 'ref', name: variant.name })),\n      })\n      return (\n        <>\n          {variants.map((variant) =>\n            renderSchemaEntry({\n              schema: decorate ? decorate(variant.schema) : variant.schema,\n              name: variant.name,\n              keysToOmit: variant.keysToOmit,\n              direction,\n            }),\n          )}\n          {renderSchemaEntry({ schema: unionSchema, name: baseName, direction })}\n        </>\n      )\n    }\n\n    // Builds a response/error union schema: one schema per member response, aliased under `name`.\n    function buildResponseUnion({ responses, name, fallbackUnknown }: BuildResponseUnionParams) {\n      // Collect import names from the response schemas to detect naming collisions. When a response\n      // is a $ref to a component schema whose resolved name matches `name`, skip generation to avoid\n      // redeclaration errors.\n      const importedNames = new Set(\n        responses.flatMap((res) =>\n          (res.content ?? []).flatMap((entry) => (entry.schema ? ast.collectImportedRefNames(entry.schema).map((refName) => resolver.name(refName)) : [])),\n        ),\n      )\n\n      if (importedNames.has(name)) {\n        return null\n      }\n\n      const members = responses.map((res) => ast.factory.createSchema({ type: 'ref', name: resolver.response.status(node, res.statusCode) }))\n\n      // No documented schema: fall back to an unknown schema so the name still resolves for\n      // consumers that parse those bodies.\n      if (fallbackUnknown && members.length === 0) {\n        return renderSchemaEntry({ schema: ast.factory.createSchema({ type: 'unknown' }), name })\n      }\n\n      const unionNode = members.length === 1 ? members[0]! : ast.factory.createSchema({ type: 'union', members })\n\n      return renderSchemaEntry({\n        schema: unionNode,\n        name,\n      })\n    }\n\n    const paramSchemas = node.parameters.map((param) =>\n      renderSchemaEntry({ schema: param.schema, name: resolver.param.name(node, param), direction: 'encode' }),\n    )\n\n    const responseSchemas = node.responses.map((res) => {\n      const variants = (res.content ?? []).filter((entry) => entry.schema)\n      if (variants.length > 1) {\n        return buildContentTypeVariants(res.content!, resolver.response.status(node, res.statusCode))\n      }\n      const primary = variants[0] ?? res.content?.[0]\n      return renderSchemaEntry({\n        schema: primary?.schema ?? null,\n        name: resolver.response.status(node, res.statusCode),\n        keysToOmit: primary?.keysToOmit,\n      })\n    })\n\n    const responsesWithSchema = node.responses.filter((res) => res.content?.some((entry) => entry.schema))\n    // Validate success (2xx) bodies only. Error bodies are surfaced unparsed, typed by plugin-ts (#369).\n    const successResponsesWithSchema = getSuccessResponses(responsesWithSchema)\n    const responseUnionSchema =\n      responsesWithSchema.length > 0\n        ? buildResponseUnion({ responses: successResponsesWithSchema, name: resolver.response.response(node), fallbackUnknown: true })\n        : null\n\n    // Validate error bodies on the non-throw path. Mirrors the success union but selects every\n    // non-2xx response (including the OpenAPI `default`) so it lines up with plugin-ts `ErrorOf` (#369).\n    const errorResponsesWithSchema = responsesWithSchema.filter((res) => !isSuccessStatusCode(res.statusCode))\n    const errorUnionSchema =\n      errorResponsesWithSchema.length > 0\n        ? buildResponseUnion({ responses: errorResponsesWithSchema, name: resolver.response.error(node), fallbackUnknown: false })\n        : null\n\n    const requestBodyContent = node.requestBody?.content ?? []\n    const requestSchema = (() => {\n      if (requestBodyContent.length === 0) return null\n      if (requestBodyContent.length === 1) {\n        const entry = requestBodyContent[0]!\n        if (!entry.schema) return null\n        return renderSchemaEntry({\n          schema: { ...entry.schema, description: node.requestBody!.description ?? entry.schema.description },\n          name: resolver.response.body(node),\n          keysToOmit: entry.keysToOmit,\n          direction: 'encode',\n        })\n      }\n      return buildContentTypeVariants(\n        requestBodyContent,\n        resolver.response.body(node),\n        (schema) => ({\n          ...schema,\n          description: node.requestBody!.description ?? schema.description,\n        }),\n        'encode',\n      )\n    })()\n\n    // Grouped path/query/headers schemas plus the combined `{ body, path, query, headers }` options\n    // and per-status `responses` schemas exist only to back `resolver.response.options(node)` and\n    // `resolver.response.responses(node)` for consumers sourcing types from this plugin instead of\n    // `plugin-ts`. Not worth generating when nothing will import them.\n    const { path, query, header } = getOperationParameters(node)\n\n    const paramGroupSchemas = inferred\n      ? (\n          [\n            { kind: 'path', params: path },\n            { kind: 'query', params: query },\n            { kind: 'headers', params: header },\n          ] as const\n        )\n          .filter(({ params }) => params.length > 0)\n          .map(({ kind, params }) =>\n            renderSchemaEntry({\n              schema: ast.factory.createSchema({\n                type: 'object',\n                // `primitive: 'object'` makes the printer emit `z.object(…)` rather than a record.\n                primitive: 'object',\n                properties: params.map((param) => ast.factory.createProperty({ name: param.name, required: param.required, schema: param.schema })),\n              }),\n              name: resolver.param[kind](node, params[0]!),\n              direction: 'encode',\n            }),\n          )\n      : []\n\n    const optionsSchema = inferred\n      ? renderSchemaEntry({ schema: buildOptionsSchema(node, resolver), name: resolver.name(`${node.operationId} Options`), direction: 'encode' })\n      : null\n\n    // The per-status record a client's `RequestResult` is keyed on. Response bodies, so `output`.\n    const responsesSchema = inferred ? renderSchemaEntry({ schema: buildResponses(node, resolver), name: resolver.response.responses(node) }) : null\n\n    return (\n      <File\n        baseName={meta.file.baseName}\n        path={meta.file.path}\n        meta={meta.file.meta}\n        banner={resolver.default.banner(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n        footer={resolver.default.footer(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n      >\n        <File.Import name={isZodImport ? 'z' : ['z']} path={importPath} isNameSpace={isZodImport} />\n        {paramSchemas}\n        {responseSchemas}\n        {responseUnionSchema}\n        {errorUnionSchema}\n        {requestSchema}\n        {paramGroupSchemas}\n        {optionsSchema}\n        {responsesSchema}\n      </File>\n    )\n  },\n})\n","","","import { createCasedFile, createOperationParamResolver, createOperationResponseResolver } from '@internals/shared'\nimport { camelCase, ensureValidVarName, pascalCase } from '@internals/utils'\nimport { createResolver } from 'kubb/kit'\nimport type { PluginZod } from '../types.ts'\n\n/**\n * Default resolver used by `@kubb/plugin-zod`. Decides the names and file\n * paths for every generated Zod schema. Schemas use camelCase with a\n * `Schema` suffix (`listPetsSchema`); their inferred types use PascalCase\n * with a `SchemaType` suffix (`PetSchemaType`), so the value and the type\n * never share an identifier even when the schema name is all-uppercase.\n *\n * @example Resolve schema and type names\n * ```ts\n * import { resolverZod } from '@kubb/plugin-zod'\n *\n * resolverZod.name('list pets')          // 'listPetsSchema'\n * resolverZod.schema.typeName('pet')     // 'PetSchemaType'\n * ```\n */\nexport const resolverZod = createResolver<PluginZod>({\n  pluginName: 'plugin-zod',\n  name(name) {\n    return ensureValidVarName(camelCase(name, { suffix: 'schema' }))\n  },\n  file: createCasedFile((part) => camelCase(part, { suffix: 'schema' })),\n  schema: {\n    typeName(name) {\n      return ensureValidVarName(pascalCase(name, { suffix: 'schema type' }))\n    },\n    type(name) {\n      return ensureValidVarName(pascalCase(name, { suffix: 'type' }))\n    },\n    inputName(name) {\n      return this.name(`${name} input`)\n    },\n    inputTypeName(name) {\n      return this.schema.typeName(`${name} input`)\n    },\n    isName(name) {\n      return ensureValidVarName(camelCase(name, { prefix: 'is' }))\n    },\n    assertName(name) {\n      return ensureValidVarName(camelCase(name, { prefix: 'assert' }))\n    },\n  },\n  param: createOperationParamResolver(),\n  response: {\n    ...createOperationResponseResolver(),\n    error(node) {\n      return this.name(`${node.operationId} Error`)\n    },\n    options(node) {\n      return this.schema.type(this.name(`${node.operationId} Options`))\n    },\n  },\n})\n","import { createGroupConfig } from '@internals/shared'\nimport { addGenerator, defineExtension, Resolver, setMacros, setResolver } from 'kubb/kit'\nimport { compatibility } from '../kubb-extension.json'\nimport { version } from '../package.json'\nimport { zodGenerator } from './generators/zodGenerator.tsx'\nimport { resolverZod } from './resolvers/resolverZod.ts'\nimport type { PluginZod } from './types.ts'\n\n/**\n * Canonical plugin name for `@kubb/plugin-zod`. Used for driver lookups and\n * cross-plugin dependency references.\n */\nexport const pluginZodName = 'plugin-zod' satisfies PluginZod['name']\n\n/**\n * Generates Zod v4 schemas from an OpenAPI spec. Use them to validate API\n * responses at runtime, build form schemas, or feed back into router libraries\n * that consume Zod (tRPC, Hono, Elysia). Pair with `@kubb/plugin-axios` or\n * `@kubb/plugin-fetch` and set the client's `validator: 'zod'` to validate every response\n * automatically.\n *\n * @example\n * ```ts\n * import { defineConfig } from 'kubb/config'\n * import { pluginTs } from '@kubb/plugin-ts'\n * import { pluginZod } from '@kubb/plugin-zod'\n *\n * export default defineConfig({\n *   input: './petStore.yaml',\n *   output: { path: './src/gen' },\n *   plugins: [\n *     pluginTs(),\n *     pluginZod({\n *       output: { path: './zod' },\n *       inferred: true,\n *     }),\n *   ],\n * })\n * ```\n */\nexport const pluginZod = defineExtension<PluginZod>({\n  kind: 'plugin',\n  meta: { name: pluginZodName, version, compatibility },\n  setup(options) {\n    const {\n      output = { path: 'zod', barrel: { type: 'named' } },\n      group,\n      exclude = [],\n      include,\n      override = [],\n      compile = false,\n      mini = false,\n      guidType = 'uuid',\n      regexType = 'literal',\n      oneOfType = 'union',\n      importPath = mini ? 'zod/mini' : 'zod',\n      coercion = false,\n      inferred = false,\n      typeGuards = false,\n      printer,\n      resolver: userResolver,\n      macros: userMacros,\n    } = options\n\n    setResolver(userResolver ? Resolver.merge(resolverZod, userResolver) : resolverZod)\n    if (userMacros?.length) {\n      setMacros(userMacros)\n    }\n    addGenerator(zodGenerator)\n\n    return {\n      output,\n      exclude,\n      include,\n      override,\n      group: createGroupConfig(group),\n      importPath,\n      coercion,\n      inferred,\n      guidType,\n      regexType,\n      oneOfType,\n      compile,\n      mini,\n      typeGuards,\n      printer,\n    }\n  },\n})\n\nexport default pluginZod\n"],"mappings":";;;;;;;;;;;;;AAiMA,SAAS,qBAAqB,aAA6B;CACzD,MAAM,WAAW,YAAY,MAAM,GAAG,CAAC,CAAC,EAAE,CAAE,KAAK;CACjD,IAAI,aAAa,oBAAoB,OAAO;CAC5C,IAAI,aAAa,uBAAuB,OAAO;CAC/C,IAAI,aAAa,qCAAqC,OAAO;CAE7D,MAAM,SADU,SAAS,MAAM,GAAG,CAAC,CAAC,IAAI,KAAK,SAAA,CACvB,MAAM,eAAe,CAAC,CAAC,OAAO,OAAO;CAC3D,IAAI,MAAM,WAAW,GAAG,OAAO;CAC/B,OAAO,MAAM,KAAK,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,I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