@leitwerk-dev/gitlab-repo-change 0.5.2 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/launcher.ts","../../../node_modules/valibot/dist/index.mjs","../../../packages/domain/src/string-normalize.ts","../../../packages/domain/src/domain-model.ts","../../../packages/domain/src/actor.ts","../../../packages/domain/src/dependency-order.ts","../../../packages/domain/src/execution-inspection.ts","../../../packages/domain/src/json-pointer.ts","../../../packages/domain/src/launcher-recent-values.ts","../../../packages/domain/src/markdown-normalize.ts","../../../packages/domain/src/number-normalize.ts","../../../packages/domain/src/process-model-config.ts","../../../packages/domain/src/process-path.ts","../../../packages/domain/src/process-row-slots.ts","../../../packages/domain/src/unknown-record.ts","../../../packages/domain/src/semantic-entry-refs.ts","../../../packages/domain/src/process-state-json.ts","../../../packages/domain/src/repo-locator.ts","../../../packages/domain/src/startup-observation.ts","../../../packages/domain/src/turn-annotations.ts","../../../packages/domain/src/turn-recovery.ts","../../../packages/domain/src/turn-start-resolution.ts","../src/process.ts","../src/params.ts"],"sourcesContent":["import { gitSshIntegration } from \"@leitwerk-dev/git-ssh\";\nimport { gitlabIntegration } from \"@leitwerk-dev/gitlab\";\nimport type { LeitwerkExtensionModule } from \"@leitwerk-dev/process-sdk\";\nimport { createGitLabRepoChangeLauncher } from \"./launcher.js\";\nimport { createGitLabRepoChangeProcess, registerGitLabRepoChangeMaintenance } from \"./process.js\";\n\n/** @public */\nexport const manifest = {\n\t/** @public */\n\tid: \"gitlab-repo-change\",\n\n\t/** @public */\n\tversion: \"0.1.9\",\n\n\t/** @public */\n\trequires: [\"gitlab\", \"coding\", \"git-ssh\"],\n} as const;\n\n/** @public */\n/** @public */\nexport function createGitLabRepoChange(options: {\n\t/** @public */\n\tdocker: boolean;\n}) {\n\tif (typeof options.docker !== \"boolean\") throw new Error(\"docker must be a boolean\");\n\tconst launcher = createGitLabRepoChangeLauncher();\n\tconst process = createGitLabRepoChangeProcess(launcher, options.docker);\n\tconst extension: LeitwerkExtensionModule = {\n\t\tmanifest,\n\t\tsetupCatalog(api) {\n\t\t\tapi.registerProcess(process);\n\t\t},\n\t\tsetupServer(api) {\n\t\t\tregisterGitLabRepoChangeMaintenance(api, process);\n\t\t\tconst integration = api.require(gitlabIntegration);\n\t\t\tif (Array.isArray(integration)) throw new Error(\"GitLab integration must be singular\");\n\t\t\tconst ssh = api.require(gitSshIntegration);\n\t\t\tif (Array.isArray(ssh)) throw new Error(\"Git SSH integration must be singular\");\n\t\t\tlauncher.configure(integration, ssh);\n\t\t\tapi.onStop(() => launcher.configure(null));\n\t\t},\n\t};\n\n\t/** @public */\n\t/** @public */\n\treturn {\n\t\t/** @public */\n\t\textension,\n\n\t\t/** @public */\n\t\tprocess,\n\n\t\t/** @public */\n\t\tlauncher,\n\t};\n}\n\n/** @public */\nexport const {\n\textension: defaultExtension,\n\tprocess: gitlabRepoChangeProcess,\n\tlauncher: defaultGitLabRepoChangeLauncher,\n} = createGitLabRepoChange({ docker: true });\nexport * from \"./launcher.js\";\nexport * from \"./params.js\";\nexport * from \"./process.js\";\nexport default defaultExtension;\n","import { buildAutoWorkBranchFromSeed } from \"@leitwerk-dev/coding/auto-work-branch\";\nimport {\n\trepositoryChangeOptionFields,\n\trepositoryChangeOptions,\n\trepositoryChangeWorkflow,\n} from \"@leitwerk-dev/coding/repository-change-launch\";\nimport { trimString } from \"@leitwerk-dev/domain\";\nimport { createGitSshPreparationCheck, type GitSshIntegration } from \"@leitwerk-dev/git-ssh\";\nimport {\n\ttype GitLabIntegration,\n\ttype GitLabIssueWatcherEvent,\n\ttype GitLabProject,\n\tgitlabIssueExternalId,\n\tresolveGitLabLaunchProject,\n} from \"@leitwerk-dev/gitlab\";\nimport {\n\ttype LaunchPreparationCheck,\n\ttype ProcessLaunchConfig,\n\ttype ProcessLauncherDefinition,\n\tSafeLaunchPreparationError,\n} from \"@leitwerk-dev/process-sdk\";\nimport type { GitLabRepoChangeParams } from \"./params.js\";\n\n/** @public */\nexport function createGitLabRepoChangeLauncher() {\n\tlet integration: GitLabIntegration | null = null;\n\tlet ssh: GitSshIntegration | null = null;\n\tconst requireIntegration = () => {\n\t\tif (!integration) throw new Error(\"GitLab repository launcher is not configured\");\n\t\treturn integration;\n\t};\n\tconst configure = (\n\t\tvalue: GitLabIntegration | null,\n\t\tsshIntegration: GitSshIntegration | null = null,\n\t) => {\n\t\tintegration = value;\n\t\tssh = sshIntegration;\n\t};\n\tasync function launch(\n\t\trepository: GitLabProject,\n\t\tprofile: string,\n\t\tprompt: string,\n\t\tissue?: GitLabIssueWatcherEvent,\n\t\toptions: {\n\t\t\tskipPlanDecision?: boolean;\n\t\t\tskipSimplification?: boolean;\n\t\t\tgitSshProfile?: string;\n\t\t} = {},\n\t): Promise<ProcessLaunchConfig<GitLabRepoChangeParams>> {\n\t\tconst service = requireIntegration();\n\t\tif (!service.profiles().includes(profile)) throw new Error(\"GitLab profile is unavailable\");\n\t\tconst client = service.client(profile);\n\t\tconst gitSshProfile =\n\t\t\toptions.gitSshProfile ??\n\t\t\tissue?.gitSshProfile ??\n\t\t\t(ssh?.profiles().length === 1 ? ssh.profiles()[0] : \"\");\n\t\tif (!gitSshProfile || !ssh?.profiles().includes(gitSshProfile))\n\t\t\tthrow new Error(\"Select a matching Git SSH profile\");\n\t\tconst { params: binding, project } = await resolveGitLabLaunchProject(\n\t\t\tclient,\n\t\t\tprofile,\n\t\t\trepository,\n\t\t\tissue\n\t\t\t\t? `leitwerk/issue-${issue.issue.iid}`\n\t\t\t\t: buildAutoWorkBranchFromSeed(\n\t\t\t\t\t\tprompt,\n\t\t\t\t\t\t`${repository.http_url_to_repo}:${repository.default_branch}`,\n\t\t\t\t\t),\n\t\t);\n\t\tproject.settingsRepository.origin = new URL(repository.web_url).origin;\n\t\tif (issue) Object.assign(project.metadata.gitlab, { issueIid: issue.issue.iid });\n\t\tconst common = { ...binding, gitSshProfile, ...repositoryChangeOptions(options), prompt };\n\t\tconst params: GitLabRepoChangeParams = issue\n\t\t\t? {\n\t\t\t\t\t...common,\n\t\t\t\t\torigin: \"issue\",\n\t\t\t\t\tissueNumber: issue.issue.iid,\n\t\t\t\t\tissueUrl: issue.issue.web_url,\n\t\t\t\t\ttriggerLabel: issue.labels.trigger,\n\t\t\t\t\tdoneLabel: issue.labels.done,\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\t...common,\n\t\t\t\t\torigin: \"ui\",\n\t\t\t\t\tissueNumber: null,\n\t\t\t\t\tissueUrl: null,\n\t\t\t\t\ttriggerLabel: null,\n\t\t\t\t\tdoneLabel: null,\n\t\t\t\t};\n\t\treturn {\n\t\t\tprocessId: \"gitlab_repo_change_process\",\n\t\t\ttitle: issue?.issue.title ?? prompt,\n\t\t\tparams,\n\t\t\tstartTurnId: \"generate_plan\",\n\t\t\t...(issue\n\t\t\t\t? {\n\t\t\t\t\t\texternalId: gitlabIssueExternalId(client.baseUrl, repository.id, issue.issue.iid),\n\t\t\t\t\t\texternalUrl: issue.issue.web_url,\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t\tprojects: [project],\n\t\t};\n\t}\n\tconst preparationChecks = (\n\t\t_input: unknown,\n\t\t{ params }: ProcessLaunchConfig<GitLabRepoChangeParams>,\n\t): readonly LaunchPreparationCheck<GitLabRepoChangeParams>[] => [\n\t\t{\n\t\t\tid: \"gitlab_repository_access\",\n\t\t\tlabel: \"Verify GitLab repository access\",\n\t\t\tasync run({ signal }) {\n\t\t\t\tconst client = requireIntegration().client(params.gitlabProfile);\n\t\t\t\tconst repository = await client.getProject(params.projectId, signal);\n\t\t\t\tif (\n\t\t\t\t\trepository.archived ||\n\t\t\t\t\trepository.ssh_url_to_repo !== params.repoLocator ||\n\t\t\t\t\trepository.default_branch !== params.baseBranch\n\t\t\t\t)\n\t\t\t\t\tthrow new SafeLaunchPreparationError(\n\t\t\t\t\t\t\"Repository changed or is archived\",\n\t\t\t\t\t\t\"Select an active GitLab project and launch again.\",\n\t\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\tcreateGitSshPreparationCheck(\n\t\t\t\"write\",\n\t\t\t{ ...params, sshCredentialRef: params.gitSshProfile ?? \"\" },\n\t\t\t() => {\n\t\t\t\tif (!params.gitSshProfile || !ssh) throw new Error(\"Git SSH profile is unavailable\");\n\t\t\t\treturn ssh;\n\t\t\t},\n\t\t),\n\t];\n\tconst launcher: ProcessLauncherDefinition<GitLabRepoChangeParams> = {\n\t\tid: \"gitlab_repo_change_process.ui_launcher\",\n\t\tlabel: \"GitLab Repo Change\",\n\t\tdescription: \"Plan, implement, review, and publish a GitLab merge request\",\n\t\tvisibility: \"ui\",\n\t\tui: {\n\t\t\tcard: {\n\t\t\t\ttitle: \"GitLab Repo Change\",\n\t\t\t\tdescription: \"Start a repository change and publish a merge request.\",\n\t\t\t},\n\t\t\tlaunchConfigSchema: {\n\t\t\t\tid: \"gitlab_repo_change_form\",\n\t\t\t\ttitle: \"GitLab Repo Change\",\n\t\t\t\tfields: [\n\t\t\t\t\t{ id: \"gitlabProfile\", label: \"GitLab profile\", kind: \"select\", required: true },\n\t\t\t\t\t{ id: \"repository\", label: \"Project\", kind: \"select\", required: true },\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"gitSshProfile\",\n\t\t\t\t\t\tlabel: \"Git SSH profile\",\n\t\t\t\t\t\tkind: \"select\",\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\toptions: [],\n\t\t\t\t\t},\n\t\t\t\t\t{ id: \"prompt\", label: \"Requested change\", kind: \"textarea\", required: true },\n\t\t\t\t\t...repositoryChangeOptionFields,\n\t\t\t\t],\n\t\t\t\tsubmitLabel: \"Start change\",\n\t\t\t},\n\t\t\tresolveDefaults() {\n\t\t\t\treturn {\n\t\t\t\t\tgitlabProfile: requireIntegration().profiles()[0] ?? \"\",\n\t\t\t\t\trepository: \"\",\n\t\t\t\t\tgitSshProfile: ssh?.profiles()[0] ?? \"\",\n\t\t\t\t\tprompt: \"\",\n\t\t\t\t\t...repositoryChangeOptions({}),\n\t\t\t\t};\n\t\t\t},\n\t\t\tasync resolveOptions(input) {\n\t\t\t\tconst i = requireIntegration();\n\t\t\t\tconst profile = trimString(input.gitlabProfile);\n\t\t\t\treturn {\n\t\t\t\t\tgitSshProfile: (ssh?.profiles() ?? []).map((value) => ({ value, label: value })),\n\t\t\t\t\tgitlabProfile: i.profiles().map((value) => ({ value, label: value })),\n\t\t\t\t\trepository: (i.profiles().includes(profile) ? await i.client(profile).listProjects() : [])\n\t\t\t\t\t\t.filter((p) => !p.archived && p.default_branch)\n\t\t\t\t\t\t.map((p) => ({\n\t\t\t\t\t\t\tvalue: String(p.id),\n\t\t\t\t\t\t\tlabel: p.path_with_namespace,\n\t\t\t\t\t\t\tdescription: p.web_url,\n\t\t\t\t\t\t})),\n\t\t\t\t};\n\t\t\t},\n\t\t\tpreparationChecks,\n\t\t\tresolveRelaunchInput(input) {\n\t\t\t\treturn {\n\t\t\t\t\tgitlabProfile: trimString(input.gitlabProfile),\n\t\t\t\t\trepository: trimString(input.repository),\n\t\t\t\t\tprompt: trimString(input.prompt),\n\t\t\t\t\tgitSshProfile: trimString(input.gitSshProfile),\n\t\t\t\t\t...repositoryChangeOptions(input),\n\t\t\t\t};\n\t\t\t},\n\t\t\tasync resolveLaunchConfig(input) {\n\t\t\t\tconst profile = trimString(input.gitlabProfile);\n\t\t\t\tconst projectId = Number(input.repository);\n\t\t\t\tconst prompt = trimString(input.prompt);\n\t\t\t\tconst errors = [];\n\t\t\t\tif (!ssh?.profiles().includes(trimString(input.gitSshProfile)))\n\t\t\t\t\terrors.push({\n\t\t\t\t\t\tfieldId: \"gitSshProfile\",\n\t\t\t\t\t\tmessage: \"Select an available Git SSH profile\",\n\t\t\t\t\t\tcode: \"custom_rule\" as const,\n\t\t\t\t\t});\n\t\t\t\tif (!requireIntegration().profiles().includes(profile))\n\t\t\t\t\terrors.push({\n\t\t\t\t\t\tfieldId: \"gitlabProfile\",\n\t\t\t\t\t\tmessage: \"Select an available GitLab profile\",\n\t\t\t\t\t\tcode: \"custom_rule\" as const,\n\t\t\t\t\t});\n\t\t\t\tif (!Number.isSafeInteger(projectId) || projectId <= 0)\n\t\t\t\t\terrors.push({\n\t\t\t\t\t\tfieldId: \"repository\",\n\t\t\t\t\t\tmessage: \"Select a project\",\n\t\t\t\t\t\tcode: \"required\" as const,\n\t\t\t\t\t});\n\t\t\t\tif (!prompt)\n\t\t\t\t\terrors.push({\n\t\t\t\t\t\tfieldId: \"prompt\",\n\t\t\t\t\t\tmessage: \"Describe the requested change\",\n\t\t\t\t\t\tcode: \"required\" as const,\n\t\t\t\t\t});\n\t\t\t\tif (errors.length) return { ok: false, errors };\n\t\t\t\tconst repository = await requireIntegration().client(profile).getProject(projectId);\n\t\t\t\tif (repository.archived || !repository.default_branch)\n\t\t\t\t\treturn {\n\t\t\t\t\t\tok: false,\n\t\t\t\t\t\terrors: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfieldId: \"repository\",\n\t\t\t\t\t\t\t\tmessage: \"Project is archived or has no default branch\",\n\t\t\t\t\t\t\t\tcode: \"custom_rule\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\tok: true,\n\t\t\t\t\tlaunchConfig: await launch(repository, profile, prompt, undefined, {\n\t\t\t\t\t\tgitSshProfile: trimString(input.gitSshProfile),\n\t\t\t\t\t\t...repositoryChangeOptions(input),\n\t\t\t\t\t}),\n\t\t\t\t};\n\t\t\t},\n\t\t},\n\t};\n\treturn {\n\t\t/** @public */\n\t\tconfigure,\n\n\t\t/** @public */\n\t\tlauncher,\n\t\t/** Server-side routing policies. @public */\n\t\tworkflow: repositoryChangeWorkflow(async (params: GitLabRepoChangeParams) => {\n\t\t\tif (params.origin !== \"issue\") throw new Error(\"Missing GitLab source issue\");\n\t\t\tconst client = requireIntegration().client(params.gitlabProfile);\n\t\t\tif (client.baseUrl !== params.gitlabOrigin)\n\t\t\t\tthrow new Error(\"GitLab profile installation changed from the source issue\");\n\t\t\treturn (await client.getIssue(params.projectId, params.issueNumber)).labels;\n\t\t}),\n\n\t\t/** @public */\n\t\tpreparationChecks,\n\n\t\t/** @public */\n\t\tasync fromIssue(event: GitLabIssueWatcherEvent) {\n\t\t\treturn launch(\n\t\t\t\tevent.repository,\n\t\t\t\tevent.profile,\n\t\t\t\t`${event.issue.title}${event.issue.description ? `\\n\\n${event.issue.description}` : \"\"}`,\n\t\t\t\tevent,\n\t\t\t);\n\t\t},\n\t};\n}\n","//#region src/storages/globalConfig/globalConfig.ts\nlet store$4;\n/**\n* Sets the global configuration.\n*\n* @param config The configuration.\n*/\nfunction setGlobalConfig(config$1) {\n\tstore$4 = {\n\t\t...store$4,\n\t\t...config$1\n\t};\n}\n/**\n* Returns the global configuration.\n*\n* @param config The config to merge.\n*\n* @returns The configuration.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getGlobalConfig(config$1) {\n\treturn {\n\t\tlang: config$1?.lang ?? store$4?.lang,\n\t\tmessage: config$1?.message,\n\t\tabortEarly: config$1?.abortEarly ?? store$4?.abortEarly,\n\t\tabortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly\n\t};\n}\n/**\n* Deletes the global configuration.\n*/\nfunction deleteGlobalConfig() {\n\tstore$4 = void 0;\n}\n\n//#endregion\n//#region src/storages/globalMessage/globalMessage.ts\nlet store$3;\n/**\n* Sets a global error message.\n*\n* @param message The error message.\n* @param lang The language of the message.\n*/\nfunction setGlobalMessage(message$1, lang) {\n\tif (!store$3) store$3 = /* @__PURE__ */ new Map();\n\tstore$3.set(lang, message$1);\n}\n/**\n* Returns a global error message.\n*\n* @param lang The language of the message.\n*\n* @returns The error message.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getGlobalMessage(lang) {\n\treturn store$3?.get(lang);\n}\n/**\n* Deletes a global error message.\n*\n* @param lang The language of the message.\n*/\nfunction deleteGlobalMessage(lang) {\n\tstore$3?.delete(lang);\n}\n\n//#endregion\n//#region src/storages/schemaMessage/schemaMessage.ts\nlet store$2;\n/**\n* Sets a schema error message.\n*\n* @param message The error message.\n* @param lang The language of the message.\n*/\nfunction setSchemaMessage(message$1, lang) {\n\tif (!store$2) store$2 = /* @__PURE__ */ new Map();\n\tstore$2.set(lang, message$1);\n}\n/**\n* Returns a schema error message.\n*\n* @param lang The language of the message.\n*\n* @returns The error message.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getSchemaMessage(lang) {\n\treturn store$2?.get(lang);\n}\n/**\n* Deletes a schema error message.\n*\n* @param lang The language of the message.\n*/\nfunction deleteSchemaMessage(lang) {\n\tstore$2?.delete(lang);\n}\n\n//#endregion\n//#region src/storages/specificMessage/specificMessage.ts\nlet store$1;\n/**\n* Sets a specific error message.\n*\n* @param reference The identifier reference.\n* @param message The error message.\n* @param lang The language of the message.\n*/\nfunction setSpecificMessage(reference, message$1, lang) {\n\tif (!store$1) store$1 = /* @__PURE__ */ new Map();\n\tif (!store$1.get(reference)) store$1.set(reference, /* @__PURE__ */ new Map());\n\tstore$1.get(reference).set(lang, message$1);\n}\n/**\n* Returns a specific error message.\n*\n* @param reference The identifier reference.\n* @param lang The language of the message.\n*\n* @returns The error message.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getSpecificMessage(reference, lang) {\n\treturn store$1?.get(reference)?.get(lang);\n}\n/**\n* Deletes a specific error message.\n*\n* @param reference The identifier reference.\n* @param lang The language of the message.\n*/\nfunction deleteSpecificMessage(reference, lang) {\n\tstore$1?.get(reference)?.delete(lang);\n}\n\n//#endregion\n//#region src/utils/_stringify/_stringify.ts\n/**\n* Stringifies an unknown input to a literal or type string.\n*\n* @param input The unknown input.\n*\n* @returns A literal or type string.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _stringify(input) {\n\tconst type = typeof input;\n\tif (type === \"string\") return `\"${input}\"`;\n\tif (type === \"number\" || type === \"bigint\" || type === \"boolean\") return `${input}`;\n\tif (type === \"object\" || type === \"function\") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? \"null\";\n\treturn type;\n}\n\n//#endregion\n//#region src/utils/_addIssue/_addIssue.ts\n/**\n* Adds an issue to the dataset.\n*\n* @param context The issue context.\n* @param label The issue label.\n* @param dataset The input dataset.\n* @param config The configuration.\n* @param other The optional props.\n*\n* @internal\n*/\nfunction _addIssue(context, label, dataset, config$1, other) {\n\tconst input = other && \"input\" in other ? other.input : dataset.value;\n\tconst expected = other?.expected ?? context.expects ?? null;\n\tconst received = other?.received ?? /* @__PURE__ */ _stringify(input);\n\tconst issue = {\n\t\tkind: context.kind,\n\t\ttype: context.type,\n\t\tinput,\n\t\texpected,\n\t\treceived,\n\t\tmessage: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : \"R\"}eceived ${received}`,\n\t\trequirement: context.requirement,\n\t\tpath: other?.path,\n\t\tissues: other?.issues,\n\t\tlang: config$1.lang,\n\t\tabortEarly: config$1.abortEarly,\n\t\tabortPipeEarly: config$1.abortPipeEarly\n\t};\n\tconst isSchema = context.kind === \"schema\";\n\tconst message$1 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config$1.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang);\n\tif (message$1 !== void 0) issue.message = typeof message$1 === \"function\" ? message$1(issue) : message$1;\n\tif (isSchema) dataset.typed = false;\n\tif (dataset.issues) dataset.issues.push(issue);\n\telse dataset.issues = [issue];\n}\n\n//#endregion\n//#region src/utils/_cloneDataset/_cloneDataset.ts\n/**\n* Creates a shallow copy of a dataset.\n*\n* Hint: The `value` is copied by reference, but the `issues` array is cloned\n* to avoid reusing mutable dataset state across multiple runs. Mutating a\n* returned object or array value can therefore affect later cache hits that\n* reuse the same cached output.\n*\n* @param dataset The output dataset.\n*\n* @returns The copied output dataset.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _cloneDataset(dataset) {\n\treturn {\n\t\ttyped: dataset.typed,\n\t\tvalue: dataset.value,\n\t\tissues: dataset.issues && [...dataset.issues]\n\t};\n}\n\n//#endregion\n//#region src/utils/_getByteCount/_getByteCount.ts\nlet textEncoder;\n/**\n* Returns the byte count of the input.\n*\n* @param input The input to be measured.\n*\n* @returns The byte count.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getByteCount(input) {\n\tif (!textEncoder) textEncoder = new TextEncoder();\n\treturn textEncoder.encode(input).length;\n}\n\n//#endregion\n//#region src/utils/_getGraphemeCount/_getGraphemeCount.ts\nlet segmenter;\n/**\n* Returns the grapheme count of the input.\n*\n* @param input The input to be measured.\n*\n* @returns The grapheme count.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getGraphemeCount(input) {\n\tif (!segmenter) segmenter = new Intl.Segmenter();\n\tconst segments = segmenter.segment(input);\n\tlet count = 0;\n\tfor (const _ of segments) count++;\n\treturn count;\n}\n\n//#endregion\n//#region src/utils/_getLastMetadata/_getLastMetadata.ts\n/**\n* Returns the last top-level value of a given metadata type from a schema\n* using a breadth-first search that starts with the last item in the pipeline.\n*\n* @param schema The schema to search.\n* @param type The metadata type.\n*\n* @returns The value, if any.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getLastMetadata(schema, type) {\n\tif (\"pipe\" in schema) {\n\t\tconst nestedSchemas = [];\n\t\tfor (let index = schema.pipe.length - 1; index >= 0; index--) {\n\t\t\tconst item = schema.pipe[index];\n\t\t\tif (item.kind === \"schema\" && \"pipe\" in item) nestedSchemas.push(item);\n\t\t\telse if (item.kind === \"metadata\" && item.type === type) return item[type];\n\t\t}\n\t\tfor (const nestedSchema of nestedSchemas) {\n\t\t\tconst result = /* @__PURE__ */ _getLastMetadata(nestedSchema, type);\n\t\t\tif (result !== void 0) return result;\n\t\t}\n\t}\n}\n\n//#endregion\n//#region src/utils/_getStandardProps/_getStandardProps.ts\n/**\n* Returns the Standard Schema properties.\n*\n* @param context The schema context.\n*\n* @returns The Standard Schema properties.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getStandardProps(context) {\n\treturn {\n\t\tversion: 1,\n\t\tvendor: \"valibot\",\n\t\tvalidate(value$1) {\n\t\t\treturn context[\"~run\"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig());\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/utils/_getWordCount/_getWordCount.ts\nlet store;\n/**\n* Returns the word count of the input.\n*\n* @param locales The locales to be used.\n* @param input The input to be measured.\n*\n* @returns The word count.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getWordCount(locales, input) {\n\tif (!store) store = /* @__PURE__ */ new Map();\n\tif (!store.get(locales)) store.set(locales, new Intl.Segmenter(locales, { granularity: \"word\" }));\n\tconst segments = store.get(locales).segment(input);\n\tlet count = 0;\n\tfor (const segment of segments) if (segment.isWordLike) count++;\n\treturn count;\n}\n\n//#endregion\n//#region src/utils/_isLuhnAlgo/_isLuhnAlgo.ts\n/**\n* Non-digit regex.\n*/\nconst NON_DIGIT_REGEX = /\\D/gu;\n/**\n* Checks whether a string with numbers corresponds to the luhn algorithm.\n*\n* @param input The input to be checked.\n*\n* @returns Whether input is valid.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _isLuhnAlgo(input) {\n\tconst number$1 = input.replace(NON_DIGIT_REGEX, \"\");\n\tlet length$1 = number$1.length;\n\tlet bit = 1;\n\tlet sum = 0;\n\twhile (length$1) {\n\t\tconst value$1 = +number$1[--length$1];\n\t\tbit ^= 1;\n\t\tsum += bit ? [\n\t\t\t0,\n\t\t\t2,\n\t\t\t4,\n\t\t\t6,\n\t\t\t8,\n\t\t\t1,\n\t\t\t3,\n\t\t\t5,\n\t\t\t7,\n\t\t\t9\n\t\t][value$1] : value$1;\n\t}\n\treturn sum % 10 === 0;\n}\n\n//#endregion\n//#region src/utils/_isValidObjectKey/_isValidObjectKey.ts\n/**\n* Disallows inherited object properties and prevents object prototype\n* pollution by disallowing certain keys.\n*\n* @param object The object to check.\n* @param key The key to check.\n*\n* @returns Whether the key is allowed.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _isValidObjectKey(object$1, key) {\n\treturn Object.hasOwn(object$1, key) && key !== \"__proto__\" && key !== \"prototype\" && key !== \"constructor\";\n}\n\n//#endregion\n//#region src/utils/_joinExpects/_joinExpects.ts\n/**\n* Joins multiple `expects` values with the given separator.\n*\n* @param values The `expects` values.\n* @param separator The separator.\n*\n* @returns The joined `expects` property.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _joinExpects(values$1, separator) {\n\tconst list = [...new Set(values$1)];\n\tif (list.length > 1) return `(${list.join(` ${separator} `)})`;\n\treturn list[0] ?? \"never\";\n}\n\n//#endregion\n//#region src/utils/entriesFromList/entriesFromList.ts\n/**\n* Creates an object entries definition from a list of keys and a schema.\n*\n* @param list A list of keys.\n* @param schema The schema of the keys.\n*\n* @returns The object entries.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction entriesFromList(list, schema) {\n\tconst entries$1 = {};\n\tfor (const key of list) entries$1[key] = schema;\n\treturn entries$1;\n}\n\n//#endregion\n//#region src/utils/entriesFromObjects/entriesFromObjects.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction entriesFromObjects(schemas) {\n\tconst entries$1 = {};\n\tfor (const schema of schemas) Object.assign(entries$1, schema.entries);\n\treturn entries$1;\n}\n\n//#endregion\n//#region src/utils/getDotPath/getDotPath.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction getDotPath(issue) {\n\tif (issue.path) {\n\t\tlet key = \"\";\n\t\tfor (const item of issue.path) if (typeof item.key === \"string\" || typeof item.key === \"number\") if (key) key += `.${item.key}`;\n\t\telse key += item.key;\n\t\telse return null;\n\t\treturn key;\n\t}\n\treturn null;\n}\n\n//#endregion\n//#region src/utils/isOfKind/isOfKind.ts\n/**\n* A generic type guard to check the kind of an object.\n*\n* @param kind The kind to check for.\n* @param object The object to check.\n*\n* @returns Whether it matches.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction isOfKind(kind, object$1) {\n\treturn object$1.kind === kind;\n}\n\n//#endregion\n//#region src/utils/isOfType/isOfType.ts\n/**\n* A generic type guard to check the type of an object.\n*\n* @param type The type to check for.\n* @param object The object to check.\n*\n* @returns Whether it matches.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction isOfType(type, object$1) {\n\treturn object$1.type === type;\n}\n\n//#endregion\n//#region src/utils/isValiError/isValiError.ts\n/**\n* A type guard to check if an error is a ValiError.\n*\n* @param error The error to check.\n*\n* @returns Whether its a ValiError.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction isValiError(error) {\n\treturn error instanceof ValiError;\n}\n\n//#endregion\n//#region src/utils/ValiError/ValiError.ts\n/**\n* A Valibot error with useful information.\n*/\nvar ValiError = class extends Error {\n\t/**\n\t* Creates a Valibot error with useful information.\n\t*\n\t* @param issues The error issues.\n\t*/\n\tconstructor(issues) {\n\t\tsuper(issues[0].message);\n\t\tthis.name = \"ValiError\";\n\t\tthis.issues = issues;\n\t}\n};\n\n//#endregion\n//#region src/actions/args/args.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction args(schema) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"args\",\n\t\treference: args,\n\t\tasync: false,\n\t\tschema,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst func = dataset.value;\n\t\t\tdataset.value = (...args_) => {\n\t\t\t\tconst argsDataset = this.schema[\"~run\"]({ value: args_ }, config$1);\n\t\t\t\tif (argsDataset.issues) throw new ValiError(argsDataset.issues);\n\t\t\t\treturn func(...argsDataset.value);\n\t\t\t};\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/args/argsAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction argsAsync(schema) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"args\",\n\t\treference: argsAsync,\n\t\tasync: false,\n\t\tschema,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst func = dataset.value;\n\t\t\tdataset.value = async (...args$1) => {\n\t\t\t\tconst argsDataset = await schema[\"~run\"]({ value: args$1 }, config$1);\n\t\t\t\tif (argsDataset.issues) throw new ValiError(argsDataset.issues);\n\t\t\t\treturn func(...argsDataset.value);\n\t\t\t};\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/await/awaitAsync.ts\n/**\n* Creates an await transformation action.\n*\n* @returns An await action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction awaitAsync() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"await\",\n\t\treference: awaitAsync,\n\t\tasync: true,\n\t\tasync \"~run\"(dataset) {\n\t\t\tdataset.value = await dataset.value;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/regex.ts\n/**\n* [Base64](https://en.wikipedia.org/wiki/Base64) regex.\n*/\nconst BASE64_REGEX = /^(?:[\\da-z+/]{4})*(?:[\\da-z+/]{2}==|[\\da-z+/]{3}=)?$/iu;\n/**\n* [BIC](https://en.wikipedia.org/wiki/ISO_9362) regex.\n*/\nconst BIC_REGEX = /^[A-Z]{6}(?!00)[\\dA-Z]{2}(?:[\\dA-Z]{3})?$/u;\n/**\n* [Cuid2](https://github.com/paralleldrive/cuid2) regex.\n*/\nconst CUID2_REGEX = /^[a-z][\\da-z]*$/u;\n/**\n* [Decimal](https://en.wikipedia.org/wiki/Decimal) regex.\n*/\nconst DECIMAL_REGEX = /^[+-]?(?:\\d*\\.)?\\d+$/u;\n/**\n* [Digits](https://en.wikipedia.org/wiki/Numerical_digit) regex.\n*/\nconst DIGITS_REGEX = /^\\d+$/u;\n/**\n* [Domain name](https://en.wikipedia.org/wiki/Domain_name) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n* ASCII-only validation. Internationalized domain names (IDNs) are not\n* supported, including Punycode-encoded labels.\n*/\nconst DOMAIN_REGEX = /^(?=.{1,253}$)(?:(?![Xx][Nn]--)[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63}$/u;\n/**\n* [Email address](https://en.wikipedia.org/wiki/Email_address) regex.\n*/\nconst EMAIL_REGEX = /^[\\w+-]+(?:\\.[\\w+-]+)*@[\\da-z]+(?:[.-][\\da-z]+)*\\.[a-z]{2,}$/iu;\n/**\n* Emoji regex from [emoji-regex-xs](https://github.com/slevithan/emoji-regex-xs) v1.0.0 (MIT license).\n*\n* Hint: We decided against the newer `/^\\p{RGI_Emoji}+$/v` regex because it is\n* not supported in older runtimes and does not match all emoji.\n*/\nconst EMOJI_REGEX = /^(?:[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|(?![\\p{Emoji_Modifier_Base}\\u{1F1E6}-\\u{1F1FF}])\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|(?![\\p{Emoji_Modifier_Base}\\u{1F1E6}-\\u{1F1FF}])\\p{Emoji_Presentation}))*)+$/u;\n/**\n* [Hexadecimal](https://en.wikipedia.org/wiki/Hexadecimal) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst HEXADECIMAL_REGEX = /^(?:0[hx])?[\\da-fA-F]+$/u;\n/**\n* [Hex color](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst HEX_COLOR_REGEX = /^#(?:[\\da-fA-F]{3,4}|[\\da-fA-F]{6}|[\\da-fA-F]{8})$/u;\n/**\n* [IMEI](https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity) regex.\n*/\nconst IMEI_REGEX = /^\\d{15}$|^\\d{2}-\\d{6}-\\d{6}-\\d$/u;\n/**\n* [IPv4](https://en.wikipedia.org/wiki/IPv4) regex.\n*/\nconst IPV4_REGEX = /^(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])(?:\\.(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])){3}$/u;\n/**\n* [IPv6](https://en.wikipedia.org/wiki/IPv6) regex.\n*/\nconst IPV6_REGEX = /^(?:(?:[\\da-f]{1,4}:){7}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,7}:|(?:[\\da-f]{1,4}:){1,6}:[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,5}(?::[\\da-f]{1,4}){1,2}|(?:[\\da-f]{1,4}:){1,4}(?::[\\da-f]{1,4}){1,3}|(?:[\\da-f]{1,4}:){1,3}(?::[\\da-f]{1,4}){1,4}|(?:[\\da-f]{1,4}:){1,2}(?::[\\da-f]{1,4}){1,5}|[\\da-f]{1,4}:(?::[\\da-f]{1,4}){1,6}|:(?:(?::[\\da-f]{1,4}){1,7}|:)|fe80:(?::[\\da-f]{0,4}){0,4}%[\\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)|(?:[\\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d))$/iu;\n/**\n* [IP](https://en.wikipedia.org/wiki/IP_address) regex.\n*/\nconst IP_REGEX = /^(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])(?:\\.(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])){3}$|^(?:(?:[\\da-f]{1,4}:){7}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,7}:|(?:[\\da-f]{1,4}:){1,6}:[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,5}(?::[\\da-f]{1,4}){1,2}|(?:[\\da-f]{1,4}:){1,4}(?::[\\da-f]{1,4}){1,3}|(?:[\\da-f]{1,4}:){1,3}(?::[\\da-f]{1,4}){1,4}|(?:[\\da-f]{1,4}:){1,2}(?::[\\da-f]{1,4}){1,5}|[\\da-f]{1,4}:(?::[\\da-f]{1,4}){1,6}|:(?:(?::[\\da-f]{1,4}){1,7}|:)|fe80:(?::[\\da-f]{0,4}){0,4}%[\\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)|(?:[\\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d))$/iu;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date regex.\n*/\nconst ISO_DATE_REGEX = /^\\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\\d|0[1-9]|3[01])$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time regex.\n*/\nconst ISO_DATE_TIME_REGEX = /^\\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\\d|0[1-9]|3[01])[T ](?:0\\d|1\\d|2[0-3]):[0-5]\\d$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time regex.\n*/\nconst ISO_TIME_REGEX = /^(?:0\\d|1\\d|2[0-3]):[0-5]\\d$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time with seconds regex.\n*/\nconst ISO_TIME_SECOND_REGEX = /^(?:0\\d|1\\d|2[0-3])(?::[0-5]\\d){2}$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp regex. Allows a\n* space as a date/time separator and an optional space before the UTC offset.\n*/\nconst ISO_TIMESTAMP_REGEX = /^\\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\\d|0[1-9]|3[01])[T ](?:0\\d|1\\d|2[0-3])(?::[0-5]\\d){2}(?:\\.\\d{1,9})?(?:Z| ?[+-](?:0\\d|1\\d|2[0-3])(?::?[0-5]\\d)?)$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) week regex.\n*/\nconst ISO_WEEK_REGEX = /^\\d{4}-W(?:0[1-9]|[1-4]\\d|5[0-3])$/u;\n/**\n* [JWS compact serialization](https://datatracker.ietf.org/doc/html/rfc7515#section-3.1)\n* regex.\n*\n* Hint: Empty payload and signature segments are allowed because the\n* Base64URL-encoded representation of an empty octet sequence is an empty\n* string.\n*/\nconst JWS_COMPACT_REGEX = /^(?:[\\w-]{2,3}|(?:[\\w-]{4})+(?:[\\w-]{2,3})?)\\.(?:[\\w-]{2,3}|(?:[\\w-]{4})+(?:[\\w-]{2,3})?)?\\.(?:[\\w-]{2,3}|(?:[\\w-]{4})+(?:[\\w-]{2,3})?)?$/u;\n/**\n* [ISRC](https://en.wikipedia.org/wiki/International_Standard_Recording_Code) regex.\n*/\nconst ISRC_REGEX = /^(?:[A-Z]{2}[A-Z\\d]{3}\\d{7}|[A-Z]{2}-[A-Z\\d]{3}-\\d{2}-\\d{5})$/u;\n/**\n* [MAC](https://en.wikipedia.org/wiki/MAC_address) 48 bit regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst MAC48_REGEX = /^(?:[\\da-fA-F]{2}:){5}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{2}-){5}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{4}\\.){2}[\\da-fA-F]{4}$/u;\n/**\n* [MAC](https://en.wikipedia.org/wiki/MAC_address) 64 bit regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst MAC64_REGEX = /^(?:[\\da-fA-F]{2}:){7}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{2}-){7}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{4}\\.){3}[\\da-fA-F]{4}$|^(?:[\\da-fA-F]{4}:){3}[\\da-fA-F]{4}$/u;\n/**\n* [MAC](https://en.wikipedia.org/wiki/MAC_address) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst MAC_REGEX = /^(?:[\\da-fA-F]{2}:){5}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{2}-){5}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{4}\\.){2}[\\da-fA-F]{4}$|^(?:[\\da-fA-F]{2}:){7}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{2}-){7}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{4}\\.){3}[\\da-fA-F]{4}$|^(?:[\\da-fA-F]{4}:){3}[\\da-fA-F]{4}$/u;\n/**\n* [Nano ID](https://github.com/ai/nanoid) regex.\n*/\nconst NANO_ID_REGEX = /^[\\w-]+$/u;\n/**\n* [Octal](https://en.wikipedia.org/wiki/Octal) regex.\n*/\nconst OCTAL_REGEX = /^(?:0o)?[0-7]+$/u;\n/**\n* [RFC 5322 email address](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1) regex.\n*\n* Hint: This regex was taken from the [HTML Living Standard Specification](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) and does not perfectly represent RFC 5322.\n*/\nconst RFC_EMAIL_REGEX = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n/**\n* [Slug](https://en.wikipedia.org/wiki/Clean_URL#Slug) regex.\n*/\nconst SLUG_REGEX = /^[\\da-z]+(?:[-_][\\da-z]+)*$/u;\n/**\n* [ULID](https://github.com/ulid/spec) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst ULID_REGEX = /^[\\da-hjkmnp-tv-zA-HJKMNP-TV-Z]{26}$/u;\n/**\n* [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) regex.\n*/\nconst UUID_REGEX = /^[\\da-f]{8}(?:-[\\da-f]{4}){3}-[\\da-f]{12}$/iu;\n\n//#endregion\n//#region src/actions/base64/base64.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction base64(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"base64\",\n\t\treference: base64,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: BASE64_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"Base64\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/bic/bic.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction bic(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"bic\",\n\t\treference: bic,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: BIC_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"BIC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/brand/brand.ts\n/**\n* Creates a brand transformation action.\n*\n* @param name The brand name.\n*\n* @returns A brand action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction brand(name) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"brand\",\n\t\treference: brand,\n\t\tasync: false,\n\t\tname,\n\t\t\"~run\"(dataset) {\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/bytes/bytes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction bytes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"bytes\",\n\t\treference: bytes,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst length$1 = /* @__PURE__ */ _getByteCount(dataset.value);\n\t\t\t\tif (length$1 !== this.requirement) _addIssue(this, \"bytes\", dataset, config$1, { received: `${length$1}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/check/check.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction check(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"check\",\n\t\treference: check,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"input\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/check/checkAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction checkAsync(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"check\",\n\t\treference: checkAsync,\n\t\tasync: true,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !await this.requirement(dataset.value)) _addIssue(this, \"input\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/checkItems/checkItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction checkItems(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"check_items\",\n\t\treference: checkItems,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) for (let index = 0; index < dataset.value.length; index++) {\n\t\t\t\tconst item = dataset.value[index];\n\t\t\t\tif (!this.requirement(item, index, dataset.value)) _addIssue(this, \"item\", dataset, config$1, {\n\t\t\t\t\tinput: item,\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput: dataset.value,\n\t\t\t\t\t\tkey: index,\n\t\t\t\t\t\tvalue: item\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/checkItems/checkItemsAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction checkItemsAsync(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"check_items\",\n\t\treference: checkItemsAsync,\n\t\tasync: true,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst requirementResults = await Promise.all(dataset.value.map(this.requirement));\n\t\t\t\tfor (let index = 0; index < dataset.value.length; index++) if (!requirementResults[index]) {\n\t\t\t\t\tconst item = dataset.value[index];\n\t\t\t\t\t_addIssue(this, \"item\", dataset, config$1, {\n\t\t\t\t\t\tinput: item,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput: dataset.value,\n\t\t\t\t\t\t\tkey: index,\n\t\t\t\t\t\t\tvalue: item\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/creditCard/creditCard.ts\n/**\n* Credit card regex.\n*/\nconst CREDIT_CARD_REGEX = /^(?:\\d{13,19}|\\d{4}(?: \\d{3,6}){2,4}|\\d{4}(?:-\\d{3,6}){2,4})$/u;\n/**\n* Sanitize regex.\n*/\nconst SANITIZE_REGEX = /[- ]/gu;\n/**\n* Provider regex list.\n*/\nconst PROVIDER_REGEX_LIST = [\n\t/^3[47]\\d{13}$/u,\n\t/^3(?:0[0-5]|[68]\\d)\\d{11,13}$/u,\n\t/^6(?:011|5\\d{2})\\d{12,15}$/u,\n\t/^(?:2131|1800|35\\d{3})\\d{11}$/u,\n\t/^5[1-5]\\d{2}|(?:222\\d|22[3-9]\\d|2[3-6]\\d{2}|27[01]\\d|2720)\\d{12}$/u,\n\t/^(?:6[27]\\d{14,17}|81\\d{14,17})$/u,\n\t/^4\\d{12}(?:\\d{3,6})?$/u\n];\n/* @__NO_SIDE_EFFECTS__ */\nfunction creditCard(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"credit_card\",\n\t\treference: creditCard,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement(input) {\n\t\t\tlet sanitized;\n\t\t\treturn CREDIT_CARD_REGEX.test(input) && (sanitized = input.replace(SANITIZE_REGEX, \"\")) && PROVIDER_REGEX_LIST.some((regex$1) => regex$1.test(sanitized)) && /* @__PURE__ */ _isLuhnAlgo(sanitized);\n\t\t},\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"credit card\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/cuid2/cuid2.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction cuid2(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"cuid2\",\n\t\treference: cuid2,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: CUID2_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"Cuid2\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/decimal/decimal.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction decimal(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"decimal\",\n\t\treference: decimal,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: DECIMAL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"decimal\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/description/description.ts\n/**\n* Creates a description metadata action.\n*\n* @param description_ The description text.\n*\n* @returns A description action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction description(description_) {\n\treturn {\n\t\tkind: \"metadata\",\n\t\ttype: \"description\",\n\t\treference: description,\n\t\tdescription: description_\n\t};\n}\n\n//#endregion\n//#region src/actions/digits/digits.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction digits(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"digits\",\n\t\treference: digits,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: DIGITS_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"digits\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/domain/domain.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction domain(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"domain\",\n\t\treference: domain,\n\t\texpects: null,\n\t\tasync: false,\n\t\trequirement: DOMAIN_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"domain\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/email/email.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction email(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"email\",\n\t\treference: email,\n\t\texpects: null,\n\t\tasync: false,\n\t\trequirement: EMAIL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"email\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/emoji/emoji.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction emoji(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"emoji\",\n\t\treference: emoji,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: EMOJI_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"emoji\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/empty/empty.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction empty(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"empty\",\n\t\treference: empty,\n\t\tasync: false,\n\t\texpects: \"0\",\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length > 0) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/endsWith/endsWith.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction endsWith(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ends_with\",\n\t\treference: endsWith,\n\t\tasync: false,\n\t\texpects: `\"${requirement}\"`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.endsWith(this.requirement)) _addIssue(this, \"end\", dataset, config$1, { received: `\"${dataset.value.slice(-this.requirement.length)}\"` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/entries/entries.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction entries(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"entries\",\n\t\treference: entries,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!dataset.typed) return dataset;\n\t\t\tconst count = Object.keys(dataset.value).length;\n\t\t\tif (dataset.typed && count !== this.requirement) _addIssue(this, \"entries\", dataset, config$1, { received: `${count}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/everyItem/everyItem.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction everyItem(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"every_item\",\n\t\treference: everyItem,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.every(this.requirement)) _addIssue(this, \"item\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/examples/examples.ts\n/**\n* Creates an examples metadata action.\n*\n* @param examples_ The examples.\n*\n* @returns An examples action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction examples(examples_) {\n\treturn {\n\t\tkind: \"metadata\",\n\t\ttype: \"examples\",\n\t\treference: examples,\n\t\texamples: examples_\n\t};\n}\n\n//#endregion\n//#region src/actions/excludes/excludes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction excludes(requirement, message$1) {\n\tconst received = /* @__PURE__ */ _stringify(requirement);\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"excludes\",\n\t\treference: excludes,\n\t\tasync: false,\n\t\texpects: `!${received}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.includes(this.requirement)) _addIssue(this, \"content\", dataset, config$1, { received });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/filterItems/filterItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction filterItems(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"filter_items\",\n\t\treference: filterItems,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.filter(this.operation);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/findItem/findItem.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction findItem(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"find_item\",\n\t\treference: findItem,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.find(this.operation);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/finite/finite.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction finite(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"finite\",\n\t\treference: finite,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: Number.isFinite,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"finite\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/flavor/flavor.ts\n/**\n* Creates a flavor transformation action.\n*\n* @param name The flavor name.\n*\n* @returns A flavor action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction flavor(name) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"flavor\",\n\t\treference: flavor,\n\t\tasync: false,\n\t\tname,\n\t\t\"~run\"(dataset) {\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/graphemes/graphemes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction graphemes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"graphemes\",\n\t\treference: graphemes,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getGraphemeCount(dataset.value);\n\t\t\t\tif (count !== this.requirement) _addIssue(this, \"graphemes\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/gtValue/gtValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction gtValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"gt_value\",\n\t\treference: gtValue,\n\t\tasync: false,\n\t\texpects: `>${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !(dataset.value > this.requirement)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/guard/guard.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction guard(requirement, message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"guard\",\n\t\treference: guard,\n\t\tasync: false,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) {\n\t\t\t\t_addIssue(this, \"input\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/hash/hash.ts\n/**\n* Hash lengths object.\n*/\nconst HASH_LENGTHS = {\n\tmd4: 32,\n\tmd5: 32,\n\tsha1: 40,\n\tsha256: 64,\n\tsha384: 96,\n\tsha512: 128,\n\tripemd128: 32,\n\tripemd160: 40,\n\ttiger128: 32,\n\ttiger160: 40,\n\ttiger192: 48,\n\tcrc32: 8,\n\tcrc32b: 8,\n\tadler32: 8\n};\n/* @__NO_SIDE_EFFECTS__ */\nfunction hash(types, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"hash\",\n\t\treference: hash,\n\t\texpects: null,\n\t\tasync: false,\n\t\trequirement: RegExp(types.map((type) => `^[a-fA-F0-9]{${HASH_LENGTHS[type]}}$`).join(\"|\"), \"u\"),\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"hash\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/hexadecimal/hexadecimal.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction hexadecimal(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"hexadecimal\",\n\t\treference: hexadecimal,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: HEXADECIMAL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"hexadecimal\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/hexColor/hexColor.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction hexColor(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"hex_color\",\n\t\treference: hexColor,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: HEX_COLOR_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"hex color\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/imei/imei.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction imei(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"imei\",\n\t\treference: imei,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement(input) {\n\t\t\treturn IMEI_REGEX.test(input) && /* @__PURE__ */ _isLuhnAlgo(input);\n\t\t},\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"IMEI\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/includes/includes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction includes(requirement, message$1) {\n\tconst expects = /* @__PURE__ */ _stringify(requirement);\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"includes\",\n\t\treference: includes,\n\t\tasync: false,\n\t\texpects,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.includes(this.requirement)) _addIssue(this, \"content\", dataset, config$1, { received: `!${expects}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/integer/integer.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction integer(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"integer\",\n\t\treference: integer,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: Number.isInteger,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"integer\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ip/ip.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ip(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ip\",\n\t\treference: ip,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: IP_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"IP\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ipv4/ipv4.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ipv4(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ipv4\",\n\t\treference: ipv4,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: IPV4_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"IPv4\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ipv6/ipv6.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ipv6(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ipv6\",\n\t\treference: ipv6,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: IPV6_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"IPv6\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isbn/utils/_isIsbn10.ts\n/**\n* [Validates an ISBN-10](https://en.wikipedia.org/wiki/ISBN#ISBN-10_check_digits).\n*\n* @param input The input value.\n*\n* @returns `true` if the input is a valid ISBN-10, `false` otherwise.\n*\n* @internal\n*/\nfunction _isIsbn10(input) {\n\tconst digits$1 = input.split(\"\").map((c) => c === \"X\" ? 10 : parseInt(c));\n\tlet sum = 0;\n\tfor (let i = 0; i < 10; i++) sum += digits$1[i] * (10 - i);\n\treturn sum % 11 === 0;\n}\n\n//#endregion\n//#region src/actions/isbn/utils/_isIsbn13.ts\n/**\n* [Validates an ISBN-13](https://en.wikipedia.org/wiki/ISBN#ISBN-13_check_digit_calculation).\n*\n* @param input The input value.\n*\n* @returns `true` if the input is a valid ISBN-13, `false` otherwise.\n*\n* @internal\n*/\nfunction _isIsbn13(input) {\n\tconst digits$1 = input.split(\"\").map((c) => parseInt(c));\n\tlet sum = 0;\n\tfor (let i = 0; i < 13; i++) sum += digits$1[i] * (i % 2 === 0 ? 1 : 3);\n\treturn sum % 10 === 0;\n}\n\n//#endregion\n//#region src/actions/isbn/isbn.ts\n/**\n* ISBN separator regex.\n*/\nconst ISBN_SEPARATOR_REGEX = /[- ]/gu;\n/**\n* ISBN-10 detection regex.\n*/\nconst ISBN_10_DETECTION_REGEX = /^\\d{9}[\\dX]$/u;\n/**\n* ISBN-13 detection regex.\n*/\nconst ISBN_13_DETECTION_REGEX = /^\\d{13}$/u;\n/* @__NO_SIDE_EFFECTS__ */\nfunction isbn(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"isbn\",\n\t\treference: isbn,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement(input) {\n\t\t\tconst replacedInput = input.replace(ISBN_SEPARATOR_REGEX, \"\");\n\t\t\tif (ISBN_10_DETECTION_REGEX.test(replacedInput)) return _isIsbn10(replacedInput);\n\t\t\telse if (ISBN_13_DETECTION_REGEX.test(replacedInput)) return _isIsbn13(replacedInput);\n\t\t\treturn false;\n\t\t},\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"ISBN\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isrc/isrc.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isrc(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"isrc\",\n\t\treference: isrc,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISRC_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"ISRC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoDate/isoDate.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoDate(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_date\",\n\t\treference: isoDate,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_DATE_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"date\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoDateTime/isoDateTime.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoDateTime(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_date_time\",\n\t\treference: isoDateTime,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_DATE_TIME_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"date-time\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoTime/isoTime.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoTime(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_time\",\n\t\treference: isoTime,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_TIME_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"time\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoTimeSecond/isoTimeSecond.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoTimeSecond(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_time_second\",\n\t\treference: isoTimeSecond,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_TIME_SECOND_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"time-second\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoTimestamp/isoTimestamp.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoTimestamp(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_timestamp\",\n\t\treference: isoTimestamp,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_TIMESTAMP_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"timestamp\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoWeek/isoWeek.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoWeek(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_week\",\n\t\treference: isoWeek,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_WEEK_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"week\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/jwsCompact/jwsCompact.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction jwsCompact(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"jws_compact\",\n\t\treference: jwsCompact,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: JWS_COMPACT_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"JWS compact\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/length/length.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction length(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"length\",\n\t\treference: length,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length !== this.requirement) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ltValue/ltValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ltValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"lt_value\",\n\t\treference: ltValue,\n\t\tasync: false,\n\t\texpects: `<${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !(dataset.value < this.requirement)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/mac/mac.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mac(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"mac\",\n\t\treference: mac,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: MAC_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"MAC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/mac48/mac48.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mac48(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"mac48\",\n\t\treference: mac48,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: MAC48_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"48-bit MAC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/mac64/mac64.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mac64(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"mac64\",\n\t\treference: mac64,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: MAC64_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"64-bit MAC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/mapItems/mapItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mapItems(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"map_items\",\n\t\treference: mapItems,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.map(this.operation);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxBytes/maxBytes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxBytes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_bytes\",\n\t\treference: maxBytes,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst length$1 = /* @__PURE__ */ _getByteCount(dataset.value);\n\t\t\t\tif (length$1 > this.requirement) _addIssue(this, \"bytes\", dataset, config$1, { received: `${length$1}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxEntries/maxEntries.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxEntries(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_entries\",\n\t\treference: maxEntries,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!dataset.typed) return dataset;\n\t\t\tconst count = Object.keys(dataset.value).length;\n\t\t\tif (dataset.typed && count > this.requirement) _addIssue(this, \"entries\", dataset, config$1, { received: `${count}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxGraphemes/maxGraphemes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxGraphemes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_graphemes\",\n\t\treference: maxGraphemes,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getGraphemeCount(dataset.value);\n\t\t\t\tif (count > this.requirement) _addIssue(this, \"graphemes\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxLength/maxLength.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxLength(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_length\",\n\t\treference: maxLength,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length > this.requirement) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxSize/maxSize.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxSize(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_size\",\n\t\treference: maxSize,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.size > this.requirement) _addIssue(this, \"size\", dataset, config$1, { received: `${dataset.value.size}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxValue/maxValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_value\",\n\t\treference: maxValue,\n\t\tasync: false,\n\t\texpects: `<=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !(dataset.value <= this.requirement)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxWords/maxWords.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxWords(locales, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_words\",\n\t\treference: maxWords,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\tlocales,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value);\n\t\t\t\tif (count > this.requirement) _addIssue(this, \"words\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/metadata/metadata.ts\n/**\n* Creates a custom metadata action.\n*\n* @param metadata_ The metadata object.\n*\n* @returns A metadata action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction metadata(metadata_) {\n\treturn {\n\t\tkind: \"metadata\",\n\t\ttype: \"metadata\",\n\t\treference: metadata,\n\t\tmetadata: metadata_\n\t};\n}\n\n//#endregion\n//#region src/actions/mimeType/mimeType.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mimeType(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"mime_type\",\n\t\treference: mimeType,\n\t\tasync: false,\n\t\texpects: /* @__PURE__ */ _joinExpects(requirement.map((option) => `\"${option}\"`), \"|\"),\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.includes(dataset.value.type)) _addIssue(this, \"MIME type\", dataset, config$1, { received: `\"${dataset.value.type}\"` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minBytes/minBytes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minBytes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_bytes\",\n\t\treference: minBytes,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst length$1 = /* @__PURE__ */ _getByteCount(dataset.value);\n\t\t\t\tif (length$1 < this.requirement) _addIssue(this, \"bytes\", dataset, config$1, { received: `${length$1}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minEntries/minEntries.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minEntries(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_entries\",\n\t\treference: minEntries,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!dataset.typed) return dataset;\n\t\t\tconst count = Object.keys(dataset.value).length;\n\t\t\tif (dataset.typed && count < this.requirement) _addIssue(this, \"entries\", dataset, config$1, { received: `${count}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minGraphemes/minGraphemes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minGraphemes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_graphemes\",\n\t\treference: minGraphemes,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getGraphemeCount(dataset.value);\n\t\t\t\tif (count < this.requirement) _addIssue(this, \"graphemes\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minLength/minLength.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minLength(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_length\",\n\t\treference: minLength,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length < this.requirement) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minSize/minSize.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minSize(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_size\",\n\t\treference: minSize,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.size < this.requirement) _addIssue(this, \"size\", dataset, config$1, { received: `${dataset.value.size}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minValue/minValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_value\",\n\t\treference: minValue,\n\t\tasync: false,\n\t\texpects: `>=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !(dataset.value >= this.requirement)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minWords/minWords.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minWords(locales, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_words\",\n\t\treference: minWords,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\tlocales,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value);\n\t\t\t\tif (count < this.requirement) _addIssue(this, \"words\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/multipleOf/multipleOf.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction multipleOf(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"multiple_of\",\n\t\treference: multipleOf,\n\t\tasync: false,\n\t\texpects: `%${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value % this.requirement != 0) _addIssue(this, \"multiple\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/nanoid/nanoid.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nanoid(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"nanoid\",\n\t\treference: nanoid,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: NANO_ID_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"Nano ID\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/nonEmpty/nonEmpty.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonEmpty(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"non_empty\",\n\t\treference: nonEmpty,\n\t\tasync: false,\n\t\texpects: \"!0\",\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length === 0) _addIssue(this, \"length\", dataset, config$1, { received: \"0\" });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/normalize/normalize.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction normalize(form) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"normalize\",\n\t\treference: normalize,\n\t\tasync: false,\n\t\tform,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.normalize(this.form);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notBytes/notBytes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notBytes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_bytes\",\n\t\treference: notBytes,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst length$1 = /* @__PURE__ */ _getByteCount(dataset.value);\n\t\t\t\tif (length$1 === this.requirement) _addIssue(this, \"bytes\", dataset, config$1, { received: `${length$1}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notEntries/notEntries.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notEntries(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_entries\",\n\t\treference: notEntries,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!dataset.typed) return dataset;\n\t\t\tconst count = Object.keys(dataset.value).length;\n\t\t\tif (dataset.typed && count === this.requirement) _addIssue(this, \"entries\", dataset, config$1, { received: `${count}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notGraphemes/notGraphemes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notGraphemes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_graphemes\",\n\t\treference: notGraphemes,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getGraphemeCount(dataset.value);\n\t\t\t\tif (count === this.requirement) _addIssue(this, \"graphemes\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notLength/notLength.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notLength(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_length\",\n\t\treference: notLength,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length === this.requirement) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notSize/notSize.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notSize(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_size\",\n\t\treference: notSize,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.size === this.requirement) _addIssue(this, \"size\", dataset, config$1, { received: `${dataset.value.size}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notValue/notValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_value\",\n\t\treference: notValue,\n\t\tasync: false,\n\t\texpects: requirement instanceof Date ? `!${requirement.toJSON()}` : `!${/* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && this.requirement <= dataset.value && this.requirement >= dataset.value) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notValues/notValues.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notValues(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_values\",\n\t\treference: notValues,\n\t\tasync: false,\n\t\texpects: `!${/* @__PURE__ */ _joinExpects(requirement.map((value$1) => value$1 instanceof Date ? value$1.toJSON() : /* @__PURE__ */ _stringify(value$1)), \"|\")}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && this.requirement.some((value$1) => value$1 <= dataset.value && value$1 >= dataset.value)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notWords/notWords.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notWords(locales, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_words\",\n\t\treference: notWords,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\tlocales,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value);\n\t\t\t\tif (count === this.requirement) _addIssue(this, \"words\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/octal/octal.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction octal(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"octal\",\n\t\treference: octal,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: OCTAL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"octal\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/parseBoolean/parseBoolean.ts\nconst TRUTHY = [\n\ttrue,\n\t1,\n\t\"true\",\n\t\"1\",\n\t\"yes\",\n\t\"y\",\n\t\"on\",\n\t\"enabled\"\n];\nconst FALSY = [\n\tfalse,\n\t0,\n\t\"false\",\n\t\"0\",\n\t\"no\",\n\t\"n\",\n\t\"off\",\n\t\"disabled\"\n];\n/* @__NO_SIDE_EFFECTS__ */\nfunction parseBoolean(config$1, message$1) {\n\tconst normalize$1 = (v) => typeof v === \"string\" ? v.toLowerCase() : v;\n\tconst truthyRaw = config$1?.truthy ?? TRUTHY;\n\tconst falsyRaw = config$1?.falsy ?? FALSY;\n\tconst truthy = config$1?.truthy ? config$1.truthy.map(normalize$1) : TRUTHY;\n\tconst falsy = config$1?.falsy ? config$1.falsy.map(normalize$1) : FALSY;\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"parse_boolean\",\n\t\treference: parseBoolean,\n\t\texpects: /* @__PURE__ */ _joinExpects([...truthyRaw, ...falsyRaw].map(_stringify), \"|\"),\n\t\tconfig: config$1,\n\t\tmessage: message$1,\n\t\tasync: false,\n\t\t\"~run\"(dataset, config$2) {\n\t\t\tconst input = normalize$1(dataset.value);\n\t\t\tif (truthy.includes(input)) dataset.value = true;\n\t\t\telse if (falsy.includes(input)) dataset.value = false;\n\t\t\telse {\n\t\t\t\t_addIssue(this, \"boolean\", dataset, config$2);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/parseJson/parseJson.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction parseJson(config$1, message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"parse_json\",\n\t\treference: parseJson,\n\t\tconfig: config$1,\n\t\tmessage: message$1,\n\t\tasync: false,\n\t\t\"~run\"(dataset, config$2) {\n\t\t\ttry {\n\t\t\t\tdataset.value = JSON.parse(dataset.value, this.config?.reviver);\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof Error) {\n\t\t\t\t\t_addIssue(this, \"JSON\", dataset, config$2, { received: `\"${error.message}\"` });\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t} else throw error;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/partialCheck/utils/_isPartiallyTyped/_isPartiallyTyped.ts\n/**\n* Checks if a dataset is partially typed.\n*\n* @param dataset The dataset to check.\n* @param paths The paths to check.\n*\n* @returns Whether it is partially typed.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _isPartiallyTyped(dataset, paths) {\n\tif (dataset.issues) for (const path of paths) for (const issue of dataset.issues) {\n\t\tlet typed = false;\n\t\tconst bound = Math.min(path.length, issue.path?.length ?? 0);\n\t\tfor (let index = 0; index < bound; index++) if (path[index] !== issue.path[index].key && (path[index] !== \"$\" || issue.path[index].type !== \"array\")) {\n\t\t\ttyped = true;\n\t\t\tbreak;\n\t\t}\n\t\tif (!typed) return false;\n\t}\n\treturn true;\n}\n\n//#endregion\n//#region src/actions/partialCheck/partialCheck.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction partialCheck(paths, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"partial_check\",\n\t\treference: partialCheck,\n\t\tasync: false,\n\t\texpects: null,\n\t\tpaths,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif ((dataset.typed || /* @__PURE__ */ _isPartiallyTyped(dataset, paths)) && !this.requirement(dataset.value)) _addIssue(this, \"input\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/partialCheck/partialCheckAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction partialCheckAsync(paths, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"partial_check\",\n\t\treference: partialCheckAsync,\n\t\tasync: true,\n\t\texpects: null,\n\t\tpaths,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif ((dataset.typed || /* @__PURE__ */ _isPartiallyTyped(dataset, paths)) && !await this.requirement(dataset.value)) _addIssue(this, \"input\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rawCheck/rawCheck.ts\n/**\n* Creates a raw check validation action.\n*\n* @param action The validation action.\n*\n* @returns A raw check action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction rawCheck(action) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"raw_check\",\n\t\treference: rawCheck,\n\t\tasync: false,\n\t\texpects: null,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\taction({\n\t\t\t\tdataset,\n\t\t\t\tconfig: config$1,\n\t\t\t\taddIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config$1, info)\n\t\t\t});\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rawCheck/rawCheckAsync.ts\n/**\n* Creates a raw check validation action.\n*\n* @param action The validation action.\n*\n* @returns A raw check action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction rawCheckAsync(action) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"raw_check\",\n\t\treference: rawCheckAsync,\n\t\tasync: true,\n\t\texpects: null,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tawait action({\n\t\t\t\tdataset,\n\t\t\t\tconfig: config$1,\n\t\t\t\taddIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config$1, info)\n\t\t\t});\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rawTransform/rawTransform.ts\n/**\n* Creates a raw transformation action.\n*\n* @param action The transformation action.\n*\n* @returns A raw transform action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction rawTransform(action) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"raw_transform\",\n\t\treference: rawTransform,\n\t\tasync: false,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst output = action({\n\t\t\t\tdataset,\n\t\t\t\tconfig: config$1,\n\t\t\t\taddIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config$1, info),\n\t\t\t\tNEVER: null\n\t\t\t});\n\t\t\tif (dataset.issues) dataset.typed = false;\n\t\t\telse dataset.value = output;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rawTransform/rawTransformAsync.ts\n/**\n* Creates a raw transformation action.\n*\n* @param action The transformation action.\n*\n* @returns A raw transform action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction rawTransformAsync(action) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"raw_transform\",\n\t\treference: rawTransformAsync,\n\t\tasync: true,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst output = await action({\n\t\t\t\tdataset,\n\t\t\t\tconfig: config$1,\n\t\t\t\taddIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config$1, info),\n\t\t\t\tNEVER: null\n\t\t\t});\n\t\t\tif (dataset.issues) dataset.typed = false;\n\t\t\telse dataset.value = output;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/readonly/readonly.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction readonly() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"readonly\",\n\t\treference: readonly,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/reduceItems/reduceItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction reduceItems(operation, initial) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"reduce_items\",\n\t\treference: reduceItems,\n\t\tasync: false,\n\t\toperation,\n\t\tinitial,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.reduce(this.operation, this.initial);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/regex/regex.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction regex(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"regex\",\n\t\treference: regex,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"format\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/returns/returns.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction returns(schema) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"returns\",\n\t\treference: returns,\n\t\tasync: false,\n\t\tschema,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst func = dataset.value;\n\t\t\tdataset.value = (...args_) => {\n\t\t\t\tconst returnsDataset = this.schema[\"~run\"]({ value: func(...args_) }, config$1);\n\t\t\t\tif (returnsDataset.issues) throw new ValiError(returnsDataset.issues);\n\t\t\t\treturn returnsDataset.value;\n\t\t\t};\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/returns/returnsAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction returnsAsync(schema) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"returns\",\n\t\treference: returnsAsync,\n\t\tasync: false,\n\t\tschema,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst func = dataset.value;\n\t\t\tdataset.value = async (...args_) => {\n\t\t\t\tconst returnsDataset = await this.schema[\"~run\"]({ value: await func(...args_) }, config$1);\n\t\t\t\tif (returnsDataset.issues) throw new ValiError(returnsDataset.issues);\n\t\t\t\treturn returnsDataset.value;\n\t\t\t};\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rfcEmail/rfcEmail.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction rfcEmail(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"rfc_email\",\n\t\treference: rfcEmail,\n\t\texpects: null,\n\t\tasync: false,\n\t\trequirement: RFC_EMAIL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"email\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/safeInteger/safeInteger.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction safeInteger(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"safe_integer\",\n\t\treference: safeInteger,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: Number.isSafeInteger,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"safe integer\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/size/size.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction size(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"size\",\n\t\treference: size,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.size !== this.requirement) _addIssue(this, \"size\", dataset, config$1, { received: `${dataset.value.size}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/slug/slug.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction slug(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"slug\",\n\t\treference: slug,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: SLUG_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"slug\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/someItem/someItem.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction someItem(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"some_item\",\n\t\treference: someItem,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.some(this.requirement)) _addIssue(this, \"item\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/sortItems/sortItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction sortItems(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"sort_items\",\n\t\treference: sortItems,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.sort(this.operation);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/startsWith/startsWith.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction startsWith(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"starts_with\",\n\t\treference: startsWith,\n\t\tasync: false,\n\t\texpects: `\"${requirement}\"`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.startsWith(this.requirement)) _addIssue(this, \"start\", dataset, config$1, { received: `\"${dataset.value.slice(0, this.requirement.length)}\"` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/stringifyJson/stringifyJson.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction stringifyJson(config$1, message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"stringify_json\",\n\t\treference: stringifyJson,\n\t\tmessage: message$1,\n\t\tconfig: config$1,\n\t\tasync: false,\n\t\t\"~run\"(dataset, config$2) {\n\t\t\ttry {\n\t\t\t\tconst output = JSON.stringify(dataset.value, this.config?.replacer, this.config?.space);\n\t\t\t\tif (output === void 0) {\n\t\t\t\t\t_addIssue(this, \"JSON\", dataset, config$2);\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t}\n\t\t\t\tdataset.value = output;\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof Error) {\n\t\t\t\t\t_addIssue(this, \"JSON\", dataset, config$2, { received: `\"${error.message}\"` });\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t} else throw error;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/title/title.ts\n/**\n* Creates a title metadata action.\n*\n* @param title_ The title text.\n*\n* @returns A title action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction title(title_) {\n\treturn {\n\t\tkind: \"metadata\",\n\t\ttype: \"title\",\n\t\treference: title,\n\t\ttitle: title_\n\t};\n}\n\n//#endregion\n//#region src/actions/toBigint/toBigint.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction toBigint(message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_bigint\",\n\t\treference: toBigint,\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\ttry {\n\t\t\t\tdataset.value = BigInt(dataset.value);\n\t\t\t} catch {\n\t\t\t\t_addIssue(this, \"bigint\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toBoolean/toBoolean.ts\n/**\n* Creates a to boolean transformation action.\n*\n* @returns A to boolean action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toBoolean() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_boolean\",\n\t\treference: toBoolean,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = Boolean(dataset.value);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toDate/toDate.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction toDate(message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_date\",\n\t\treference: toDate,\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\ttry {\n\t\t\t\tdataset.value = new Date(dataset.value);\n\t\t\t\tif (isNaN(dataset.value)) {\n\t\t\t\t\t_addIssue(this, \"date\", dataset, config$1, { received: \"\\\"Invalid Date\\\"\" });\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t_addIssue(this, \"date\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toLowerCase/toLowerCase.ts\n/**\n* Creates a to lower case transformation action.\n*\n* @returns A to lower case action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toLowerCase() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_lower_case\",\n\t\treference: toLowerCase,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.toLowerCase();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toMaxValue/toMaxValue.ts\n/**\n* Creates a to max value transformation action.\n*\n* @param requirement The maximum value.\n*\n* @returns A to max value action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toMaxValue(requirement) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_max_value\",\n\t\treference: toMaxValue,\n\t\tasync: false,\n\t\trequirement,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value > this.requirement ? this.requirement : dataset.value;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toMinValue/toMinValue.ts\n/**\n* Creates a to min value transformation action.\n*\n* @param requirement The minimum value.\n*\n* @returns A to min value action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toMinValue(requirement) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_min_value\",\n\t\treference: toMinValue,\n\t\tasync: false,\n\t\trequirement,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value < this.requirement ? this.requirement : dataset.value;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toNumber/toNumber.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction toNumber(message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_number\",\n\t\treference: toNumber,\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\ttry {\n\t\t\t\tdataset.value = Number(dataset.value);\n\t\t\t\tif (isNaN(dataset.value)) {\n\t\t\t\t\t_addIssue(this, \"number\", dataset, config$1);\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t_addIssue(this, \"number\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toString/toString.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction toString(message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_string\",\n\t\treference: toString,\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\ttry {\n\t\t\t\tdataset.value = String(dataset.value);\n\t\t\t} catch {\n\t\t\t\t_addIssue(this, \"string\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toUpperCase/toUpperCase.ts\n/**\n* Creates a to upper case transformation action.\n*\n* @returns A to upper case action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toUpperCase() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_upper_case\",\n\t\treference: toUpperCase,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.toUpperCase();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/transform/transform.ts\n/**\n* Creates a custom transformation action.\n*\n* @param operation The transformation operation.\n*\n* @returns A transform action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction transform(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"transform\",\n\t\treference: transform,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = this.operation(dataset.value);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/transform/transformAsync.ts\n/**\n* Creates a custom transformation action.\n*\n* @param operation The transformation operation.\n*\n* @returns A transform action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction transformAsync(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"transform\",\n\t\treference: transformAsync,\n\t\tasync: true,\n\t\toperation,\n\t\tasync \"~run\"(dataset) {\n\t\t\tdataset.value = await this.operation(dataset.value);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/trim/trim.ts\n/**\n* Creates a trim transformation action.\n*\n* @returns A trim action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction trim() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"trim\",\n\t\treference: trim,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.trim();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/trimEnd/trimEnd.ts\n/**\n* Creates a trim end transformation action.\n*\n* @returns A trim end action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction trimEnd() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"trim_end\",\n\t\treference: trimEnd,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.trimEnd();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/trimStart/trimStart.ts\n/**\n* Creates a trim start transformation action.\n*\n* @returns A trim start action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction trimStart() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"trim_start\",\n\t\treference: trimStart,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.trimStart();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ulid/ulid.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ulid(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ulid\",\n\t\treference: ulid,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ULID_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"ULID\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/url/url.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction url(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"url\",\n\t\treference: url,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement(input) {\n\t\t\ttry {\n\t\t\t\tnew URL(input);\n\t\t\t\treturn true;\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"URL\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/uuid/uuid.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction uuid(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"uuid\",\n\t\treference: uuid,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: UUID_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"UUID\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/value/value.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction value(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"value\",\n\t\treference: value,\n\t\tasync: false,\n\t\texpects: requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement),\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !(this.requirement <= dataset.value && this.requirement >= dataset.value)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/values/values.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction values(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"values\",\n\t\treference: values,\n\t\tasync: false,\n\t\texpects: `${/* @__PURE__ */ _joinExpects(requirement.map((value$1) => value$1 instanceof Date ? value$1.toJSON() : /* @__PURE__ */ _stringify(value$1)), \"|\")}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.some((value$1) => value$1 <= dataset.value && value$1 >= dataset.value)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/words/words.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction words(locales, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"words\",\n\t\treference: words,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\tlocales,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value);\n\t\t\t\tif (count !== this.requirement) _addIssue(this, \"words\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/assert/assert.ts\n/**\n* Checks if the input matches the schema. As this is an assertion function, it\n* can be used as a type guard.\n*\n* @param schema The schema to be used.\n* @param input The input to be tested.\n*/\nfunction assert(schema, input) {\n\tconst issues = schema[\"~run\"]({ value: input }, { abortEarly: true }).issues;\n\tif (issues) throw new ValiError(issues);\n}\n\n//#endregion\n//#region src/methods/cache/_LruCache.ts\n/**\n* Efficient LRU cache using Map iteration order.\n*/\nvar _LruCache = class {\n\tconstructor(config$1) {\n\t\tthis.refCount = 0;\n\t\tthis.maxSize = config$1?.maxSize ?? 1e3;\n\t\tthis.maxAge = config$1?.maxAge ?? Infinity;\n\t\tthis.hasMaxAge = isFinite(this.maxAge);\n\t}\n\t/**\n\t* Stringifies an unknown input to a cache key component.\n\t*\n\t* @param input The unknown input.\n\t*\n\t* @returns A cache key component.\n\t*/\n\t#stringify(input) {\n\t\tconst type = typeof input;\n\t\tif (type === \"string\") return `\"${input}\"`;\n\t\tif (type === \"number\" || type === \"boolean\") return `${input}`;\n\t\tif (type === \"bigint\") return `${input}n`;\n\t\tif (type === \"object\" || type === \"function\") {\n\t\t\tif (input) {\n\t\t\t\tthis.refIds ??= /* @__PURE__ */ new WeakMap();\n\t\t\t\tlet id = this.refIds.get(input);\n\t\t\t\tif (!id) {\n\t\t\t\t\tid = ++this.refCount;\n\t\t\t\t\tthis.refIds.set(input, id);\n\t\t\t\t}\n\t\t\t\treturn `#${id}`;\n\t\t\t}\n\t\t\treturn \"null\";\n\t\t}\n\t\treturn type;\n\t}\n\t/**\n\t* Creates a cache key from input and config.\n\t*\n\t* @param input The input value.\n\t* @param config The parse configuration.\n\t*\n\t* @returns The cache key.\n\t*/\n\tkey(input, config$1 = {}) {\n\t\treturn `${this.#stringify(input)}|${this.#stringify(config$1.lang)}|${this.#stringify(config$1.message)}|${this.#stringify(config$1.abortEarly)}|${this.#stringify(config$1.abortPipeEarly)}`;\n\t}\n\t/**\n\t* Gets a value from the cache by key.\n\t*\n\t* @param key The cache key.\n\t*\n\t* @returns The cached value.\n\t*/\n\tget(key) {\n\t\tif (!this.store) return void 0;\n\t\tconst entry = this.store.get(key);\n\t\tif (!entry) return void 0;\n\t\tif (this.hasMaxAge && Date.now() - entry[1] > this.maxAge) {\n\t\t\tthis.store.delete(key);\n\t\t\treturn;\n\t\t}\n\t\tthis.store.delete(key);\n\t\tthis.store.set(key, entry);\n\t\treturn entry[0];\n\t}\n\t/**\n\t* Sets a value in the cache by key.\n\t*\n\t* @param key The cache key.\n\t* @param value The cached value.\n\t*/\n\tset(key, value$1) {\n\t\tthis.store ??= /* @__PURE__ */ new Map();\n\t\tthis.store.delete(key);\n\t\tconst timestamp = this.hasMaxAge ? Date.now() : 0;\n\t\tthis.store.set(key, [value$1, timestamp]);\n\t\tif (this.store.size > this.maxSize) this.store.delete(this.store.keys().next().value);\n\t}\n\t/**\n\t* Clears all entries from the cache.\n\t*/\n\tclear() {\n\t\tthis.store?.clear();\n\t}\n};\n\n//#endregion\n//#region src/methods/cache/cache.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction cache(schema, config$1) {\n\treturn {\n\t\t...schema,\n\t\tcacheConfig: config$1,\n\t\tcache: new _LruCache(config$1),\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, runConfig) {\n\t\t\tconst key = this.cache.key(dataset.value, runConfig);\n\t\t\tlet outputDataset = this.cache.get(key);\n\t\t\tif (!outputDataset) this.cache.set(key, outputDataset = schema[\"~run\"](dataset, runConfig));\n\t\t\treturn /* @__PURE__ */ _cloneDataset(outputDataset);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/cache/cacheAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction cacheAsync(schema, config$1) {\n\tlet activeRuns;\n\treturn {\n\t\t...schema,\n\t\tasync: true,\n\t\tcacheConfig: config$1,\n\t\tcache: new _LruCache(config$1),\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, runConfig) {\n\t\t\tconst key = this.cache.key(dataset.value, runConfig);\n\t\t\tconst cached = this.cache.get(key);\n\t\t\tif (cached) return /* @__PURE__ */ _cloneDataset(cached);\n\t\t\tlet promise$1 = activeRuns?.get(key);\n\t\t\tif (!promise$1) {\n\t\t\t\tactiveRuns ??= /* @__PURE__ */ new Map();\n\t\t\t\tpromise$1 = Promise.resolve(schema[\"~run\"](dataset, runConfig));\n\t\t\t\tactiveRuns.set(key, promise$1);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst outputDataset = await promise$1;\n\t\t\t\tthis.cache.set(key, outputDataset);\n\t\t\t\treturn /* @__PURE__ */ _cloneDataset(outputDataset);\n\t\t\t} finally {\n\t\t\t\tactiveRuns?.delete(key);\n\t\t\t}\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/config/config.ts\n/**\n* Changes the local configuration of a schema.\n*\n* @param schema The schema to configure.\n* @param config The parse configuration.\n*\n* @returns The configured schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction config(schema, config$1) {\n\treturn {\n\t\t...schema,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config_) {\n\t\t\treturn schema[\"~run\"](dataset, {\n\t\t\t\t...config_,\n\t\t\t\t...config$1\n\t\t\t});\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/getFallback/getFallback.ts\n/**\n* Returns the fallback value of the schema.\n*\n* @param schema The schema to get it from.\n* @param dataset The output dataset if available.\n* @param config The config if available.\n*\n* @returns The fallback value.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getFallback(schema, dataset, config$1) {\n\treturn typeof schema.fallback === \"function\" ? schema.fallback(dataset, config$1) : schema.fallback;\n}\n\n//#endregion\n//#region src/methods/fallback/fallback.ts\n/**\n* Returns a fallback value as output if the input does not match the schema.\n*\n* @param schema The schema to catch.\n* @param fallback The fallback value.\n*\n* @returns The passed schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction fallback(schema, fallback$1) {\n\treturn {\n\t\t...schema,\n\t\tfallback: fallback$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst outputDataset = schema[\"~run\"](dataset, config$1);\n\t\t\treturn outputDataset.issues ? {\n\t\t\t\ttyped: true,\n\t\t\t\tvalue: /* @__PURE__ */ getFallback(this, outputDataset, config$1)\n\t\t\t} : outputDataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/fallback/fallbackAsync.ts\n/**\n* Returns a fallback value as output if the input does not match the schema.\n*\n* @param schema The schema to catch.\n* @param fallback The fallback value.\n*\n* @returns The passed schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction fallbackAsync(schema, fallback$1) {\n\treturn {\n\t\t...schema,\n\t\tfallback: fallback$1,\n\t\tasync: true,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst outputDataset = await schema[\"~run\"](dataset, config$1);\n\t\t\treturn outputDataset.issues ? {\n\t\t\t\ttyped: true,\n\t\t\t\tvalue: await /* @__PURE__ */ getFallback(this, outputDataset, config$1)\n\t\t\t} : outputDataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/flatten/flatten.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction flatten(issues) {\n\tconst flatErrors = {};\n\tfor (const issue of issues) if (issue.path) {\n\t\tconst dotPath = /* @__PURE__ */ getDotPath(issue);\n\t\tif (dotPath) {\n\t\t\tif (!flatErrors.nested) flatErrors.nested = {};\n\t\t\tif (flatErrors.nested[dotPath]) flatErrors.nested[dotPath].push(issue.message);\n\t\t\telse flatErrors.nested[dotPath] = [issue.message];\n\t\t} else if (flatErrors.other) flatErrors.other.push(issue.message);\n\t\telse flatErrors.other = [issue.message];\n\t} else if (flatErrors.root) flatErrors.root.push(issue.message);\n\telse flatErrors.root = [issue.message];\n\treturn flatErrors;\n}\n\n//#endregion\n//#region src/methods/forward/forward.ts\n/**\n* Forwards the issues of the passed validation action.\n*\n* @param action The validation action.\n* @param path The path to forward the issues to.\n*\n* @returns The modified action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction forward(action, path) {\n\treturn {\n\t\t...action,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst prevIssues = dataset.issues && [...dataset.issues];\n\t\t\tdataset = action[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.issues) {\n\t\t\t\tfor (const issue of dataset.issues) if (!prevIssues?.includes(issue)) {\n\t\t\t\t\tlet pathInput = dataset.value;\n\t\t\t\t\tfor (const key of path) {\n\t\t\t\t\t\tconst pathValue = pathInput[key];\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"unknown\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput: pathInput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: pathValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (issue.path) issue.path.push(pathItem);\n\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\tif (!pathValue) break;\n\t\t\t\t\t\tpathInput = pathValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/forward/forwardAsync.ts\n/**\n* Forwards the issues of the passed validation action.\n*\n* @param action The validation action.\n* @param path The path to forward the issues to.\n*\n* @returns The modified action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction forwardAsync(action, path) {\n\treturn {\n\t\t...action,\n\t\tasync: true,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst prevIssues = dataset.issues && [...dataset.issues];\n\t\t\tdataset = await action[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.issues) {\n\t\t\t\tfor (const issue of dataset.issues) if (!prevIssues?.includes(issue)) {\n\t\t\t\t\tlet pathInput = dataset.value;\n\t\t\t\t\tfor (const key of path) {\n\t\t\t\t\t\tconst pathValue = pathInput[key];\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"unknown\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput: pathInput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: pathValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (issue.path) issue.path.push(pathItem);\n\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\tif (!pathValue) break;\n\t\t\t\t\t\tpathInput = pathValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/getDefault/getDefault.ts\n/**\n* Returns the default value of the schema.\n*\n* @param schema The schema to get it from.\n* @param dataset The input dataset if available.\n* @param config The config if available.\n*\n* @returns The default value.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getDefault(schema, dataset, config$1) {\n\treturn typeof schema.default === \"function\" ? schema.default(dataset, config$1) : schema.default;\n}\n\n//#endregion\n//#region src/methods/getDefaults/getDefaults.ts\n/**\n* Returns the default values of the schema.\n*\n* Hint: The difference to `getDefault` is that for object and tuple schemas\n* this function recursively returns the default values of the subschemas\n* instead of `undefined`.\n*\n* @param schema The schema to get them from.\n*\n* @returns The default values.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getDefaults(schema) {\n\tif (\"entries\" in schema) {\n\t\tconst object$1 = {};\n\t\tfor (const key in schema.entries) object$1[key] = /* @__PURE__ */ getDefaults(schema.entries[key]);\n\t\treturn object$1;\n\t}\n\tif (\"items\" in schema) return schema.items.map(getDefaults);\n\treturn /* @__PURE__ */ getDefault(schema);\n}\n\n//#endregion\n//#region src/methods/getDefaults/getDefaultsAsync.ts\n/**\n* Returns the default values of the schema.\n*\n* Hint: The difference to `getDefault` is that for object and tuple schemas\n* this function recursively returns the default values of the subschemas\n* instead of `undefined`.\n*\n* @param schema The schema to get them from.\n*\n* @returns The default values.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nasync function getDefaultsAsync(schema) {\n\tif (\"entries\" in schema) return Object.fromEntries(await Promise.all(Object.entries(schema.entries).map(async ([key, value$1]) => [key, await /* @__PURE__ */ getDefaultsAsync(value$1)])));\n\tif (\"items\" in schema) return Promise.all(schema.items.map(getDefaultsAsync));\n\treturn /* @__PURE__ */ getDefault(schema);\n}\n\n//#endregion\n//#region src/methods/getDescription/getDescription.ts\n/**\n* Returns the description of the schema.\n*\n* If multiple descriptions are defined, the last one of the highest level is\n* returned. If no description is defined, `undefined` is returned.\n*\n* @param schema The schema to get the description from.\n*\n* @returns The description, if any.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getDescription(schema) {\n\treturn /* @__PURE__ */ _getLastMetadata(schema, \"description\");\n}\n\n//#endregion\n//#region src/methods/getExamples/getExamples.ts\n/**\n* Returns the examples of a schema.\n*\n* If multiple examples are defined, it concatenates them using depth-first\n* search. If no examples are defined, an empty array is returned.\n*\n* @param schema The schema to get the examples from.\n*\n* @returns The examples, if any.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getExamples(schema) {\n\tconst examples$1 = [];\n\tfunction depthFirstCollect(schema$1) {\n\t\tif (\"pipe\" in schema$1) {\n\t\t\tfor (const item of schema$1.pipe) if (item.kind === \"schema\" && \"pipe\" in item) depthFirstCollect(item);\n\t\t\telse if (item.kind === \"metadata\" && item.type === \"examples\") examples$1.push(...item.examples);\n\t\t}\n\t}\n\tdepthFirstCollect(schema);\n\treturn examples$1;\n}\n\n//#endregion\n//#region src/methods/getFallbacks/getFallbacks.ts\n/**\n* Returns the fallback values of the schema.\n*\n* Hint: The difference to `getFallback` is that for object and tuple schemas\n* this function recursively returns the fallback values of the subschemas\n* instead of `undefined`.\n*\n* @param schema The schema to get them from.\n*\n* @returns The fallback values.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getFallbacks(schema) {\n\tif (\"entries\" in schema) {\n\t\tconst object$1 = {};\n\t\tfor (const key in schema.entries) object$1[key] = /* @__PURE__ */ getFallbacks(schema.entries[key]);\n\t\treturn object$1;\n\t}\n\tif (\"items\" in schema) return schema.items.map(getFallbacks);\n\treturn /* @__PURE__ */ getFallback(schema);\n}\n\n//#endregion\n//#region src/methods/getFallbacks/getFallbacksAsync.ts\n/**\n* Returns the fallback values of the schema.\n*\n* Hint: The difference to `getFallback` is that for object and tuple schemas\n* this function recursively returns the fallback values of the subschemas\n* instead of `undefined`.\n*\n* @param schema The schema to get them from.\n*\n* @returns The fallback values.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nasync function getFallbacksAsync(schema) {\n\tif (\"entries\" in schema) return Object.fromEntries(await Promise.all(Object.entries(schema.entries).map(async ([key, value$1]) => [key, await /* @__PURE__ */ getFallbacksAsync(value$1)])));\n\tif (\"items\" in schema) return Promise.all(schema.items.map(getFallbacksAsync));\n\treturn /* @__PURE__ */ getFallback(schema);\n}\n\n//#endregion\n//#region src/methods/getMetadata/getMetadata.ts\n/**\n* Returns the metadata of a schema.\n*\n* If multiple metadata are defined, it shallowly merges them using depth-first\n* search. If no metadata is defined, an empty object is returned.\n*\n* @param schema Schema to get the metadata from.\n*\n* @returns The metadata, if any.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getMetadata(schema) {\n\tconst result = {};\n\tfunction depthFirstMerge(schema$1) {\n\t\tif (\"pipe\" in schema$1) {\n\t\t\tfor (const item of schema$1.pipe) if (item.kind === \"schema\" && \"pipe\" in item) depthFirstMerge(item);\n\t\t\telse if (item.kind === \"metadata\" && item.type === \"metadata\") Object.assign(result, item.metadata);\n\t\t}\n\t}\n\tdepthFirstMerge(schema);\n\treturn result;\n}\n\n//#endregion\n//#region src/methods/getTitle/getTitle.ts\n/**\n* Returns the title of the schema.\n*\n* If multiple titles are defined, the last one of the highest level is\n* returned. If no title is defined, `undefined` is returned.\n*\n* @param schema The schema to get the title from.\n*\n* @returns The title, if any.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getTitle(schema) {\n\treturn /* @__PURE__ */ _getLastMetadata(schema, \"title\");\n}\n\n//#endregion\n//#region src/methods/is/is.ts\n/**\n* Checks if the input matches the schema. By using a type predicate, this\n* function can be used as a type guard.\n*\n* @param schema The schema to be used.\n* @param input The input to be tested.\n*\n* @returns Whether the input matches the schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction is(schema, input) {\n\treturn !schema[\"~run\"]({ value: input }, { abortEarly: true }).issues;\n}\n\n//#endregion\n//#region src/schemas/any/any.ts\n/**\n* Creates an any schema.\n*\n* Hint: This schema function exists only for completeness and is not\n* recommended in practice. Instead, `unknown` should be used to accept\n* unknown data.\n*\n* @returns An any schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction any() {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"any\",\n\t\treference: any,\n\t\texpects: \"any\",\n\t\tasync: false,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.typed = true;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/array/array.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction array(item, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"array\",\n\t\treference: array,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titem,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < input.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.item[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/array/arrayAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction arrayAsync(item, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"array\",\n\t\treference: arrayAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titem,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst itemDatasets = await Promise.all(input.map((value$1) => this.item[\"~run\"]({ value: value$1 }, config$1)));\n\t\t\t\tfor (let key = 0; key < itemDatasets.length; key++) {\n\t\t\t\t\tconst itemDataset = itemDatasets[key];\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/bigint/bigint.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction bigint(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"bigint\",\n\t\treference: bigint,\n\t\texpects: \"bigint\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"bigint\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/blob/blob.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction blob(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"blob\",\n\t\treference: blob,\n\t\texpects: \"Blob\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof Blob) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/boolean/boolean.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction boolean(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"boolean\",\n\t\treference: boolean,\n\t\texpects: \"boolean\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"boolean\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/custom/custom.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction custom(check$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"custom\",\n\t\treference: custom,\n\t\texpects: \"unknown\",\n\t\tasync: false,\n\t\tcheck: check$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (this.check(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/custom/customAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction customAsync(check$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"custom\",\n\t\treference: customAsync,\n\t\texpects: \"unknown\",\n\t\tasync: true,\n\t\tcheck: check$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (await this.check(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/date/date.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction date(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"date\",\n\t\treference: date,\n\t\texpects: \"Date\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof Date) if (!isNaN(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1, { received: \"\\\"Invalid Date\\\"\" });\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/enum/enum.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction enum_(enum__, message$1) {\n\tconst options = [];\n\tfor (const key in enum__) if (`${+key}` !== key || typeof enum__[key] !== \"string\" || !Object.is(enum__[enum__[key]], +key)) options.push(enum__[key]);\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"enum\",\n\t\treference: enum_,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map(_stringify), \"|\"),\n\t\tasync: false,\n\t\tenum: enum__,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (this.options.includes(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/exactOptional/exactOptional.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction exactOptional(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"exact_optional\",\n\t\treference: exactOptional,\n\t\texpects: wrapped.expects,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/exactOptional/exactOptionalAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction exactOptionalAsync(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"exact_optional\",\n\t\treference: exactOptionalAsync,\n\t\texpects: wrapped.expects,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/file/file.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction file(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"file\",\n\t\treference: file,\n\t\texpects: \"File\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof File) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/function/function.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction function_(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"function\",\n\t\treference: function_,\n\t\texpects: \"Function\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"function\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/instance/instance.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction instance(class_, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"instance\",\n\t\treference: instance,\n\t\texpects: class_.name,\n\t\tasync: false,\n\t\tclass: class_,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof this.class) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/intersect/utils/_merge/_merge.ts\n/**\n* Merges two values into one single output.\n*\n* @param value1 First value.\n* @param value2 Second value.\n*\n* @returns The merge dataset.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _merge(value1, value2) {\n\tif (typeof value1 === typeof value2) {\n\t\tif (value1 === value2 || value1 instanceof Date && value2 instanceof Date && +value1 === +value2) return { value: value1 };\n\t\tif (value1 && value2 && value1.constructor === Object && value2.constructor === Object) {\n\t\t\tfor (const key in value2) if (key in value1) {\n\t\t\t\tconst dataset = /* @__PURE__ */ _merge(value1[key], value2[key]);\n\t\t\t\tif (dataset.issue) return dataset;\n\t\t\t\tvalue1[key] = dataset.value;\n\t\t\t} else value1[key] = value2[key];\n\t\t\treturn { value: value1 };\n\t\t}\n\t\tif (Array.isArray(value1) && Array.isArray(value2)) {\n\t\t\tif (value1.length === value2.length) {\n\t\t\t\tfor (let index = 0; index < value1.length; index++) {\n\t\t\t\t\tconst dataset = /* @__PURE__ */ _merge(value1[index], value2[index]);\n\t\t\t\t\tif (dataset.issue) return dataset;\n\t\t\t\t\tvalue1[index] = dataset.value;\n\t\t\t\t}\n\t\t\t\treturn { value: value1 };\n\t\t\t}\n\t\t}\n\t}\n\treturn { issue: true };\n}\n\n//#endregion\n//#region src/schemas/intersect/intersect.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction intersect(options, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"intersect\",\n\t\treference: intersect,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), \"&\"),\n\t\tasync: false,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (this.options.length) {\n\t\t\t\tconst input = dataset.value;\n\t\t\t\tlet outputs;\n\t\t\t\tdataset.typed = true;\n\t\t\t\tfor (const schema of this.options) {\n\t\t\t\t\tconst optionDataset = schema[\"~run\"]({ value: input }, config$1);\n\t\t\t\t\tif (optionDataset.issues) {\n\t\t\t\t\t\tif (dataset.issues) dataset.issues.push(...optionDataset.issues);\n\t\t\t\t\t\telse dataset.issues = optionDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!optionDataset.typed) dataset.typed = false;\n\t\t\t\t\tif (dataset.typed) if (outputs) outputs.push(optionDataset.value);\n\t\t\t\t\telse outputs = [optionDataset.value];\n\t\t\t\t}\n\t\t\t\tif (dataset.typed) {\n\t\t\t\t\tdataset.value = outputs[0];\n\t\t\t\t\tfor (let index = 1; index < outputs.length; index++) {\n\t\t\t\t\t\tconst mergeDataset = /* @__PURE__ */ _merge(dataset.value, outputs[index]);\n\t\t\t\t\t\tif (mergeDataset.issue) {\n\t\t\t\t\t\t\t_addIssue(this, \"type\", dataset, config$1, { received: \"unknown\" });\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdataset.value = mergeDataset.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/intersect/intersectAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction intersectAsync(options, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"intersect\",\n\t\treference: intersectAsync,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), \"&\"),\n\t\tasync: true,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (this.options.length) {\n\t\t\t\tconst input = dataset.value;\n\t\t\t\tlet outputs;\n\t\t\t\tdataset.typed = true;\n\t\t\t\tconst optionDatasets = await Promise.all(this.options.map((schema) => schema[\"~run\"]({ value: input }, config$1)));\n\t\t\t\tfor (const optionDataset of optionDatasets) {\n\t\t\t\t\tif (optionDataset.issues) {\n\t\t\t\t\t\tif (dataset.issues) dataset.issues.push(...optionDataset.issues);\n\t\t\t\t\t\telse dataset.issues = optionDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!optionDataset.typed) dataset.typed = false;\n\t\t\t\t\tif (dataset.typed) if (outputs) outputs.push(optionDataset.value);\n\t\t\t\t\telse outputs = [optionDataset.value];\n\t\t\t\t}\n\t\t\t\tif (dataset.typed) {\n\t\t\t\t\tdataset.value = outputs[0];\n\t\t\t\t\tfor (let index = 1; index < outputs.length; index++) {\n\t\t\t\t\t\tconst mergeDataset = /* @__PURE__ */ _merge(dataset.value, outputs[index]);\n\t\t\t\t\t\tif (mergeDataset.issue) {\n\t\t\t\t\t\t\t_addIssue(this, \"type\", dataset, config$1, { received: \"unknown\" });\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdataset.value = mergeDataset.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/lazy/lazy.ts\n/**\n* Creates a lazy schema.\n*\n* @param getter The schema getter.\n*\n* @returns A lazy schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction lazy(getter) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"lazy\",\n\t\treference: lazy,\n\t\texpects: \"unknown\",\n\t\tasync: false,\n\t\tgetter,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\treturn this.getter(dataset.value)[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/lazy/lazyAsync.ts\n/**\n* Creates a lazy schema.\n*\n* @param getter The schema getter.\n*\n* @returns A lazy schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction lazyAsync(getter) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"lazy\",\n\t\treference: lazyAsync,\n\t\texpects: \"unknown\",\n\t\tasync: true,\n\t\tgetter,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\treturn (await this.getter(dataset.value))[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/literal/literal.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction literal(literal_, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"literal\",\n\t\treference: literal,\n\t\texpects: /* @__PURE__ */ _stringify(literal_),\n\t\tasync: false,\n\t\tliteral: literal_,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === this.literal) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/looseObject/looseObject.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction looseObject(entries$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"loose_object\",\n\t\treference: looseObject,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const key in this.entries) {\n\t\t\t\t\tconst valueSchema = this.entries[key];\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\tconst valueDataset = valueSchema[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key];\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/looseObject/looseObjectAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction looseObjectAsync(entries$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"loose_object\",\n\t\treference: looseObjectAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => {\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\t\tawait valueSchema[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tinput[key],\n\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\tnull\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key];\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/looseTuple/looseTuple.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction looseTuple(items, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"loose_tuple\",\n\t\treference: looseTuple,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titems,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < this.items.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.items[key][\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) dataset.value.push(input[key]);\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/looseTuple/looseTupleAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction looseTupleAsync(items, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"loose_tuple\",\n\t\treference: looseTupleAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titems,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst itemDatasets = await Promise.all(this.items.map(async (item, key) => {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait item[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, itemDataset] of itemDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) dataset.value.push(input[key]);\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/map/map.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction map(key, value$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"map\",\n\t\treference: map,\n\t\texpects: \"Map\",\n\t\tasync: false,\n\t\tkey,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input instanceof Map) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = /* @__PURE__ */ new Map();\n\t\t\t\tfor (const [inputKey, inputValue] of input) {\n\t\t\t\t\tconst keyDataset = this.key[\"~run\"]({ value: inputKey }, config$1);\n\t\t\t\t\tif (keyDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"map\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: inputKey,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of keyDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = keyDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst valueDataset = this.value[\"~run\"]({ value: inputValue }, config$1);\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"map\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: inputKey,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.set(keyDataset.value, valueDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/map/mapAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mapAsync(key, value$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"map\",\n\t\treference: mapAsync,\n\t\texpects: \"Map\",\n\t\tasync: true,\n\t\tkey,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input instanceof Map) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = /* @__PURE__ */ new Map();\n\t\t\t\tconst datasets = await Promise.all([...input].map(([inputKey, inputValue]) => Promise.all([\n\t\t\t\t\tinputKey,\n\t\t\t\t\tinputValue,\n\t\t\t\t\tthis.key[\"~run\"]({ value: inputKey }, config$1),\n\t\t\t\t\tthis.value[\"~run\"]({ value: inputValue }, config$1)\n\t\t\t\t])));\n\t\t\t\tfor (const [inputKey, inputValue, keyDataset, valueDataset] of datasets) {\n\t\t\t\t\tif (keyDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"map\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: inputKey,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of keyDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = keyDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"map\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: inputKey,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.set(keyDataset.value, valueDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nan/nan.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nan(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"nan\",\n\t\treference: nan,\n\t\texpects: \"NaN\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (Number.isNaN(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/never/never.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction never(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"never\",\n\t\treference: never,\n\t\texpects: \"never\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\t_addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nonNullable/nonNullable.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonNullable(wrapped, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"non_nullable\",\n\t\treference: nonNullable,\n\t\texpects: \"!null\",\n\t\tasync: false,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value !== null) dataset = this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === null) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nonNullable/nonNullableAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonNullableAsync(wrapped, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"non_nullable\",\n\t\treference: nonNullableAsync,\n\t\texpects: \"!null\",\n\t\tasync: true,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value !== null) dataset = await this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === null) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nonNullish/nonNullish.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonNullish(wrapped, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"non_nullish\",\n\t\treference: nonNullish,\n\t\texpects: \"(!null & !undefined)\",\n\t\tasync: false,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!(dataset.value === null || dataset.value === void 0)) dataset = this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === null || dataset.value === void 0) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nonNullish/nonNullishAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonNullishAsync(wrapped, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"non_nullish\",\n\t\treference: nonNullishAsync,\n\t\texpects: \"(!null & !undefined)\",\n\t\tasync: true,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (!(dataset.value === null || dataset.value === void 0)) dataset = await this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === null || dataset.value === void 0) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nonOptional/nonOptional.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonOptional(wrapped, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"non_optional\",\n\t\treference: nonOptional,\n\t\texpects: \"!undefined\",\n\t\tasync: false,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value !== void 0) dataset = this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === void 0) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nonOptional/nonOptionalAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonOptionalAsync(wrapped, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"non_optional\",\n\t\treference: nonOptionalAsync,\n\t\texpects: \"!undefined\",\n\t\tasync: true,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value !== void 0) dataset = await this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === void 0) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/null/null.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction null_(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"null\",\n\t\treference: null_,\n\t\texpects: \"null\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nullable/nullable.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nullable(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"nullable\",\n\t\treference: nullable,\n\t\texpects: `(${wrapped.expects} | null)`,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null) {\n\t\t\t\tif (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === null) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nullable/nullableAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nullableAsync(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"nullable\",\n\t\treference: nullableAsync,\n\t\texpects: `(${wrapped.expects} | null)`,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null) {\n\t\t\t\tif (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === null) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nullish/nullish.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nullish(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"nullish\",\n\t\treference: nullish,\n\t\texpects: `(${wrapped.expects} | null | undefined)`,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null || dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === null || dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nullish/nullishAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nullishAsync(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"nullish\",\n\t\treference: nullishAsync,\n\t\texpects: `(${wrapped.expects} | null | undefined)`,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null || dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === null || dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/number/number.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction number(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"number\",\n\t\treference: number,\n\t\texpects: \"number\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"number\" && !isNaN(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/object/object.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction object(entries$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"object\",\n\t\treference: object,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const key in this.entries) {\n\t\t\t\t\tconst valueSchema = this.entries[key];\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\tconst valueDataset = valueSchema[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/object/objectAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction objectAsync(entries$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"object\",\n\t\treference: objectAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => {\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\t\tawait valueSchema[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tinput[key],\n\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\tnull\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/objectWithRest/objectWithRest.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction objectWithRest(entries$1, rest, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"object_with_rest\",\n\t\treference: objectWithRest,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tentries: entries$1,\n\t\trest,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const key in this.entries) {\n\t\t\t\t\tconst valueSchema = this.entries[key];\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\tconst valueDataset = valueSchema[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) {\n\t\t\t\t\t\tconst valueDataset = this.rest[\"~run\"]({ value: input[key] }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/objectWithRest/objectWithRestAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction objectWithRestAsync(entries$1, rest, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"object_with_rest\",\n\t\treference: objectWithRestAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tentries: entries$1,\n\t\trest,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst [normalDatasets, restDatasets] = await Promise.all([Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => {\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\t\tawait valueSchema[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tinput[key],\n\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\tnull\n\t\t\t\t\t];\n\t\t\t\t})), Promise.all(Object.entries(input).filter(([key]) => /* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)).map(async ([key, value$1]) => [\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue$1,\n\t\t\t\t\tawait this.rest[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t]))]);\n\t\t\t\tfor (const [key, value$1, valueSchema, valueDataset] of normalDatasets) if (valueDataset) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (const [key, value$1, valueDataset] of restDatasets) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/optional/optional.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction optional(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"optional\",\n\t\treference: optional,\n\t\texpects: `(${wrapped.expects} | undefined)`,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/optional/optionalAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction optionalAsync(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"optional\",\n\t\treference: optionalAsync,\n\t\texpects: `(${wrapped.expects} | undefined)`,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/picklist/picklist.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction picklist(options, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"picklist\",\n\t\treference: picklist,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map(_stringify), \"|\"),\n\t\tasync: false,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (this.options.includes(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/promise/promise.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction promise(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"promise\",\n\t\treference: promise,\n\t\texpects: \"Promise\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof Promise) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/record/record.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction record(key, value$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"record\",\n\t\treference: record,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tkey,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const entryKey in input) if (/* @__PURE__ */ _isValidObjectKey(input, entryKey)) {\n\t\t\t\t\tconst entryValue = input[entryKey];\n\t\t\t\t\tconst keyDataset = this.key[\"~run\"]({ value: entryKey }, config$1);\n\t\t\t\t\tif (keyDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: entryKey,\n\t\t\t\t\t\t\tvalue: entryValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of keyDataset.issues) {\n\t\t\t\t\t\t\tissue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = keyDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst valueDataset = this.value[\"~run\"]({ value: entryValue }, config$1);\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: entryKey,\n\t\t\t\t\t\t\tvalue: entryValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tif (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value;\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/record/recordAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction recordAsync(key, value$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"record\",\n\t\treference: recordAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tkey,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst datasets = await Promise.all(Object.entries(input).filter(([key$1]) => /* @__PURE__ */ _isValidObjectKey(input, key$1)).map(([entryKey, entryValue]) => Promise.all([\n\t\t\t\t\tentryKey,\n\t\t\t\t\tentryValue,\n\t\t\t\t\tthis.key[\"~run\"]({ value: entryKey }, config$1),\n\t\t\t\t\tthis.value[\"~run\"]({ value: entryValue }, config$1)\n\t\t\t\t])));\n\t\t\t\tfor (const [entryKey, entryValue, keyDataset, valueDataset] of datasets) {\n\t\t\t\t\tif (keyDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: entryKey,\n\t\t\t\t\t\t\tvalue: entryValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of keyDataset.issues) {\n\t\t\t\t\t\t\tissue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = keyDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: entryKey,\n\t\t\t\t\t\t\tvalue: entryValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tif (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value;\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/set/set.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction set(value$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"set\",\n\t\treference: set,\n\t\texpects: \"Set\",\n\t\tasync: false,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input instanceof Set) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = /* @__PURE__ */ new Set();\n\t\t\t\tfor (const inputValue of input) {\n\t\t\t\t\tconst valueDataset = this.value[\"~run\"]({ value: inputValue }, config$1);\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"set\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: null,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.add(valueDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/set/setAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction setAsync(value$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"set\",\n\t\treference: setAsync,\n\t\texpects: \"Set\",\n\t\tasync: true,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input instanceof Set) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = /* @__PURE__ */ new Set();\n\t\t\t\tconst valueDatasets = await Promise.all([...input].map(async (inputValue) => [inputValue, await this.value[\"~run\"]({ value: inputValue }, config$1)]));\n\t\t\t\tfor (const [inputValue, valueDataset] of valueDatasets) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"set\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: null,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.add(valueDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/strictObject/strictObject.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction strictObject(entries$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"strict_object\",\n\t\treference: strictObject,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const key in this.entries) {\n\t\t\t\t\tconst valueSchema = this.entries[key];\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\tconst valueDataset = valueSchema[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (!(key in this.entries)) {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: key,\n\t\t\t\t\t\t\texpected: \"never\",\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/strictObject/strictObjectAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction strictObjectAsync(entries$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"strict_object\",\n\t\treference: strictObjectAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => {\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\t\tawait valueSchema[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tinput[key],\n\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\tnull\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (!(key in this.entries)) {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: key,\n\t\t\t\t\t\t\texpected: \"never\",\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/strictTuple/strictTuple.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction strictTuple(items, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"strict_tuple\",\n\t\treference: strictTuple,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titems,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < this.items.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.items[key][\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!(dataset.issues && config$1.abortEarly) && this.items.length < input.length) _addIssue(this, \"type\", dataset, config$1, {\n\t\t\t\t\tinput: input[this.items.length],\n\t\t\t\t\texpected: \"never\",\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tkey: this.items.length,\n\t\t\t\t\t\tvalue: input[this.items.length]\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/strictTuple/strictTupleAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction strictTupleAsync(items, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"strict_tuple\",\n\t\treference: strictTupleAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titems,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst itemDatasets = await Promise.all(this.items.map(async (item, key) => {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait item[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, itemDataset] of itemDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!(dataset.issues && config$1.abortEarly) && this.items.length < input.length) _addIssue(this, \"type\", dataset, config$1, {\n\t\t\t\t\tinput: input[this.items.length],\n\t\t\t\t\texpected: \"never\",\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tkey: this.items.length,\n\t\t\t\t\t\tvalue: input[this.items.length]\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/string/string.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction string(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"string\",\n\t\treference: string,\n\t\texpects: \"string\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"string\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/symbol/symbol.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction symbol(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"symbol\",\n\t\treference: symbol,\n\t\texpects: \"symbol\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"symbol\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/tuple/tuple.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction tuple(items, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"tuple\",\n\t\treference: tuple,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titems,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < this.items.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.items[key][\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/tuple/tupleAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction tupleAsync(items, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"tuple\",\n\t\treference: tupleAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titems,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst itemDatasets = await Promise.all(this.items.map(async (item, key) => {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait item[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, itemDataset] of itemDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/tupleWithRest/tupleWithRest.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction tupleWithRest(items, rest, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"tuple_with_rest\",\n\t\treference: tupleWithRest,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titems,\n\t\trest,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < this.items.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.items[key][\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.rest[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/tupleWithRest/tupleWithRestAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction tupleWithRestAsync(items, rest, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"tuple_with_rest\",\n\t\treference: tupleWithRestAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titems,\n\t\trest,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst [normalDatasets, restDatasets] = await Promise.all([Promise.all(this.items.map(async (item, key) => {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait item[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t})), Promise.all(input.slice(this.items.length).map(async (value$1, key) => {\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey + this.items.length,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait this.rest[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t}))]);\n\t\t\t\tfor (const [key, value$1, itemDataset] of normalDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (const [key, value$1, itemDataset] of restDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/undefined/undefined.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction undefined_(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"undefined\",\n\t\treference: undefined_,\n\t\texpects: \"undefined\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/undefinedable/undefinedable.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction undefinedable(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"undefinedable\",\n\t\treference: undefinedable,\n\t\texpects: `(${wrapped.expects} | undefined)`,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/undefinedable/undefinedableAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction undefinedableAsync(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"undefinedable\",\n\t\treference: undefinedableAsync,\n\t\texpects: `(${wrapped.expects} | undefined)`,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/union/utils/_subIssues/_subIssues.ts\n/**\n* Returns the sub issues of the provided datasets for the union issue.\n*\n* @param datasets The datasets.\n*\n* @returns The sub issues.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _subIssues(datasets) {\n\tlet issues;\n\tif (datasets) for (const dataset of datasets) if (issues) issues.push(...dataset.issues);\n\telse issues = dataset.issues;\n\treturn issues;\n}\n\n//#endregion\n//#region src/schemas/union/union.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction union(options, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"union\",\n\t\treference: union,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), \"|\"),\n\t\tasync: false,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tlet validDataset;\n\t\t\tlet typedDatasets;\n\t\t\tlet untypedDatasets;\n\t\t\tfor (const schema of this.options) {\n\t\t\t\tconst optionDataset = schema[\"~run\"]({ value: dataset.value }, config$1);\n\t\t\t\tif (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);\n\t\t\t\telse typedDatasets = [optionDataset];\n\t\t\t\telse {\n\t\t\t\t\tvalidDataset = optionDataset;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if (untypedDatasets) untypedDatasets.push(optionDataset);\n\t\t\t\telse untypedDatasets = [optionDataset];\n\t\t\t}\n\t\t\tif (validDataset) return validDataset;\n\t\t\tif (typedDatasets) {\n\t\t\t\tif (typedDatasets.length === 1) return typedDatasets[0];\n\t\t\t\t_addIssue(this, \"type\", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });\n\t\t\t\tdataset.typed = true;\n\t\t\t} else if (untypedDatasets?.length === 1) return untypedDatasets[0];\n\t\t\telse _addIssue(this, \"type\", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/union/unionAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction unionAsync(options, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"union\",\n\t\treference: unionAsync,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), \"|\"),\n\t\tasync: true,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tlet validDataset;\n\t\t\tlet typedDatasets;\n\t\t\tlet untypedDatasets;\n\t\t\tfor (const schema of this.options) {\n\t\t\t\tconst optionDataset = await schema[\"~run\"]({ value: dataset.value }, config$1);\n\t\t\t\tif (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);\n\t\t\t\telse typedDatasets = [optionDataset];\n\t\t\t\telse {\n\t\t\t\t\tvalidDataset = optionDataset;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if (untypedDatasets) untypedDatasets.push(optionDataset);\n\t\t\t\telse untypedDatasets = [optionDataset];\n\t\t\t}\n\t\t\tif (validDataset) return validDataset;\n\t\t\tif (typedDatasets) {\n\t\t\t\tif (typedDatasets.length === 1) return typedDatasets[0];\n\t\t\t\t_addIssue(this, \"type\", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });\n\t\t\t\tdataset.typed = true;\n\t\t\t} else if (untypedDatasets?.length === 1) return untypedDatasets[0];\n\t\t\telse _addIssue(this, \"type\", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/unknown/unknown.ts\n/**\n* Creates a unknown schema.\n*\n* @returns A unknown schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction unknown() {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"unknown\",\n\t\treference: unknown,\n\t\texpects: \"unknown\",\n\t\tasync: false,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.typed = true;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/variant/variant.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction variant(key, options, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"variant\",\n\t\treference: variant,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tkey,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tlet outputDataset;\n\t\t\t\tlet maxDiscriminatorPriority = 0;\n\t\t\t\tlet invalidDiscriminatorKey = this.key;\n\t\t\t\tlet expectedDiscriminators = [];\n\t\t\t\tconst parseOptions = (variant$1, allKeys) => {\n\t\t\t\t\tfor (const schema of variant$1.options) {\n\t\t\t\t\t\tif (schema.type === \"variant\") parseOptions(schema, new Set(allKeys).add(schema.key));\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tlet keysAreValid = true;\n\t\t\t\t\t\t\tlet currentPriority = 0;\n\t\t\t\t\t\t\tfor (const currentKey of allKeys) {\n\t\t\t\t\t\t\t\tconst discriminatorSchema = schema.entries[currentKey];\n\t\t\t\t\t\t\t\tif (currentKey in input ? discriminatorSchema[\"~run\"]({\n\t\t\t\t\t\t\t\t\ttyped: false,\n\t\t\t\t\t\t\t\t\tvalue: input[currentKey]\n\t\t\t\t\t\t\t\t}, { abortEarly: true }).issues : discriminatorSchema.type !== \"exact_optional\" && discriminatorSchema.type !== \"optional\" && discriminatorSchema.type !== \"nullish\") {\n\t\t\t\t\t\t\t\t\tkeysAreValid = false;\n\t\t\t\t\t\t\t\t\tif (invalidDiscriminatorKey !== currentKey && (maxDiscriminatorPriority < currentPriority || maxDiscriminatorPriority === currentPriority && currentKey in input && !(invalidDiscriminatorKey in input))) {\n\t\t\t\t\t\t\t\t\t\tmaxDiscriminatorPriority = currentPriority;\n\t\t\t\t\t\t\t\t\t\tinvalidDiscriminatorKey = currentKey;\n\t\t\t\t\t\t\t\t\t\texpectedDiscriminators = [];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (invalidDiscriminatorKey === currentKey) expectedDiscriminators.push(schema.entries[currentKey].expects);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcurrentPriority++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (keysAreValid) {\n\t\t\t\t\t\t\t\tconst optionDataset = schema[\"~run\"]({ value: input }, config$1);\n\t\t\t\t\t\t\t\tif (!outputDataset || !outputDataset.typed && optionDataset.typed) outputDataset = optionDataset;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (outputDataset && !outputDataset.issues) break;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tparseOptions(this, new Set([this.key]));\n\t\t\t\tif (outputDataset) return outputDataset;\n\t\t\t\t_addIssue(this, \"type\", dataset, config$1, {\n\t\t\t\t\tinput: input[invalidDiscriminatorKey],\n\t\t\t\t\texpected: /* @__PURE__ */ _joinExpects(expectedDiscriminators, \"|\"),\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tkey: invalidDiscriminatorKey,\n\t\t\t\t\t\tvalue: input[invalidDiscriminatorKey]\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/variant/variantAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction variantAsync(key, options, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"variant\",\n\t\treference: variantAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tkey,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tlet outputDataset;\n\t\t\t\tlet maxDiscriminatorPriority = 0;\n\t\t\t\tlet invalidDiscriminatorKey = this.key;\n\t\t\t\tlet expectedDiscriminators = [];\n\t\t\t\tconst parseOptions = async (variant$1, allKeys) => {\n\t\t\t\t\tfor (const schema of variant$1.options) {\n\t\t\t\t\t\tif (schema.type === \"variant\") await parseOptions(schema, new Set(allKeys).add(schema.key));\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tlet keysAreValid = true;\n\t\t\t\t\t\t\tlet currentPriority = 0;\n\t\t\t\t\t\t\tfor (const currentKey of allKeys) {\n\t\t\t\t\t\t\t\tconst discriminatorSchema = schema.entries[currentKey];\n\t\t\t\t\t\t\t\tif (currentKey in input ? (await discriminatorSchema[\"~run\"]({\n\t\t\t\t\t\t\t\t\ttyped: false,\n\t\t\t\t\t\t\t\t\tvalue: input[currentKey]\n\t\t\t\t\t\t\t\t}, { abortEarly: true })).issues : discriminatorSchema.type !== \"exact_optional\" && discriminatorSchema.type !== \"optional\" && discriminatorSchema.type !== \"nullish\") {\n\t\t\t\t\t\t\t\t\tkeysAreValid = false;\n\t\t\t\t\t\t\t\t\tif (invalidDiscriminatorKey !== currentKey && (maxDiscriminatorPriority < currentPriority || maxDiscriminatorPriority === currentPriority && currentKey in input && !(invalidDiscriminatorKey in input))) {\n\t\t\t\t\t\t\t\t\t\tmaxDiscriminatorPriority = currentPriority;\n\t\t\t\t\t\t\t\t\t\tinvalidDiscriminatorKey = currentKey;\n\t\t\t\t\t\t\t\t\t\texpectedDiscriminators = [];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (invalidDiscriminatorKey === currentKey) expectedDiscriminators.push(schema.entries[currentKey].expects);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcurrentPriority++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (keysAreValid) {\n\t\t\t\t\t\t\t\tconst optionDataset = await schema[\"~run\"]({ value: input }, config$1);\n\t\t\t\t\t\t\t\tif (!outputDataset || !outputDataset.typed && optionDataset.typed) outputDataset = optionDataset;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (outputDataset && !outputDataset.issues) break;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tawait parseOptions(this, new Set([this.key]));\n\t\t\t\tif (outputDataset) return outputDataset;\n\t\t\t\t_addIssue(this, \"type\", dataset, config$1, {\n\t\t\t\t\tinput: input[invalidDiscriminatorKey],\n\t\t\t\t\texpected: /* @__PURE__ */ _joinExpects(expectedDiscriminators, \"|\"),\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tkey: invalidDiscriminatorKey,\n\t\t\t\t\t\tvalue: input[invalidDiscriminatorKey]\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/void/void.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction void_(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"void\",\n\t\treference: void_,\n\t\texpects: \"void\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/keyof/keyof.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction keyof(schema, message$1) {\n\treturn /* @__PURE__ */ picklist(Object.keys(schema.entries), message$1);\n}\n\n//#endregion\n//#region src/methods/message/message.ts\n/**\n* Changes the local message configuration of a schema.\n*\n* @param schema The schema to configure.\n* @param message_ The error message.\n*\n* @returns The configured schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction message(schema, message_) {\n\treturn {\n\t\t...schema,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\treturn schema[\"~run\"](dataset, {\n\t\t\t\t...config$1,\n\t\t\t\tmessage: message_\n\t\t\t});\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/omit/omit.ts\n/**\n* Creates a modified copy of an object schema that does not contain the\n* selected entries.\n*\n* @param schema The schema to omit from.\n* @param keys The selected entries.\n*\n* @returns An object schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction omit(schema, keys) {\n\tconst entries$1 = { ...schema.entries };\n\tfor (const key of keys) delete entries$1[key];\n\treturn {\n\t\t...schema,\n\t\tentries: entries$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/parse/parse.ts\n/**\n* Parses an unknown input based on a schema.\n*\n* @param schema The schema to be used.\n* @param input The input to be parsed.\n* @param config The parse configuration.\n*\n* @returns The parsed input.\n*/\nfunction parse(schema, input, config$1) {\n\tconst dataset = schema[\"~run\"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));\n\tif (dataset.issues) throw new ValiError(dataset.issues);\n\treturn dataset.value;\n}\n\n//#endregion\n//#region src/methods/parse/parseAsync.ts\n/**\n* Parses an unknown input based on a schema.\n*\n* @param schema The schema to be used.\n* @param input The input to be parsed.\n* @param config The parse configuration.\n*\n* @returns The parsed input.\n*/\nasync function parseAsync(schema, input, config$1) {\n\tconst dataset = await schema[\"~run\"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));\n\tif (dataset.issues) throw new ValiError(dataset.issues);\n\treturn dataset.value;\n}\n\n//#endregion\n//#region src/methods/parser/parser.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction parser(schema, config$1) {\n\tconst func = (input) => parse(schema, input, config$1);\n\tfunc.schema = schema;\n\tfunc.config = config$1;\n\treturn func;\n}\n\n//#endregion\n//#region src/methods/parser/parserAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction parserAsync(schema, config$1) {\n\tconst func = (input) => parseAsync(schema, input, config$1);\n\tfunc.schema = schema;\n\tfunc.config = config$1;\n\treturn func;\n}\n\n//#endregion\n//#region src/methods/partial/partial.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction partial(schema, keys) {\n\tconst entries$1 = {};\n\tfor (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ optional(schema.entries[key]) : schema.entries[key];\n\treturn {\n\t\t...schema,\n\t\tentries: entries$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/partial/partialAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction partialAsync(schema, keys) {\n\tconst entries$1 = {};\n\tfor (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ optionalAsync(schema.entries[key]) : schema.entries[key];\n\treturn {\n\t\t...schema,\n\t\tentries: entries$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/pick/pick.ts\n/**\n* Creates a modified copy of an object schema that contains only the selected\n* entries.\n*\n* @param schema The schema to pick from.\n* @param keys The selected entries.\n*\n* @returns An object schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction pick(schema, keys) {\n\tconst entries$1 = {};\n\tfor (const key of keys) entries$1[key] = schema.entries[key];\n\treturn {\n\t\t...schema,\n\t\tentries: entries$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/pipe/pipe.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction pipe(...pipe$1) {\n\treturn {\n\t\t...pipe$1[0],\n\t\tpipe: pipe$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tfor (const item of pipe$1) if (item.kind !== \"metadata\") {\n\t\t\t\tif (dataset.issues && (item.kind === \"schema\" || item.kind === \"transformation\")) {\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item[\"~run\"](dataset, config$1);\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/pipe/pipeAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction pipeAsync(...pipe$1) {\n\treturn {\n\t\t...pipe$1[0],\n\t\tpipe: pipe$1,\n\t\tasync: true,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tfor (const item of pipe$1) if (item.kind !== \"metadata\") {\n\t\t\t\tif (dataset.issues && (item.kind === \"schema\" || item.kind === \"transformation\")) {\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = await item[\"~run\"](dataset, config$1);\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/required/required.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction required(schema, arg2, arg3) {\n\tconst keys = Array.isArray(arg2) ? arg2 : void 0;\n\tconst message$1 = Array.isArray(arg2) ? arg3 : arg2;\n\tconst entries$1 = {};\n\tfor (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ nonOptional(schema.entries[key], message$1) : schema.entries[key];\n\treturn {\n\t\t...schema,\n\t\tentries: entries$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/required/requiredAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction requiredAsync(schema, arg2, arg3) {\n\tconst keys = Array.isArray(arg2) ? arg2 : void 0;\n\tconst message$1 = Array.isArray(arg2) ? arg3 : arg2;\n\tconst entries$1 = {};\n\tfor (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ nonOptionalAsync(schema.entries[key], message$1) : schema.entries[key];\n\treturn {\n\t\t...schema,\n\t\tentries: entries$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/safeParse/safeParse.ts\n/**\n* Parses an unknown input based on a schema.\n*\n* @param schema The schema to be used.\n* @param input The input to be parsed.\n* @param config The parse configuration.\n*\n* @returns The parse result.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction safeParse(schema, input, config$1) {\n\tconst dataset = schema[\"~run\"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));\n\treturn {\n\t\ttyped: dataset.typed,\n\t\tsuccess: !dataset.issues,\n\t\toutput: dataset.value,\n\t\tissues: dataset.issues\n\t};\n}\n\n//#endregion\n//#region src/methods/safeParse/safeParseAsync.ts\n/**\n* Parses an unknown input based on a schema.\n*\n* @param schema The schema to be used.\n* @param input The input to be parsed.\n* @param config The parse configuration.\n*\n* @returns The parse result.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nasync function safeParseAsync(schema, input, config$1) {\n\tconst dataset = await schema[\"~run\"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));\n\treturn {\n\t\ttyped: dataset.typed,\n\t\tsuccess: !dataset.issues,\n\t\toutput: dataset.value,\n\t\tissues: dataset.issues\n\t};\n}\n\n//#endregion\n//#region src/methods/safeParser/safeParser.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction safeParser(schema, config$1) {\n\tconst func = (input) => /* @__PURE__ */ safeParse(schema, input, config$1);\n\tfunc.schema = schema;\n\tfunc.config = config$1;\n\treturn func;\n}\n\n//#endregion\n//#region src/methods/safeParser/safeParserAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction safeParserAsync(schema, config$1) {\n\tconst func = (input) => /* @__PURE__ */ safeParseAsync(schema, input, config$1);\n\tfunc.schema = schema;\n\tfunc.config = config$1;\n\treturn func;\n}\n\n//#endregion\n//#region src/methods/summarize/summarize.ts\n/**\n* Summarize the error messages of issues in a pretty-printable multi-line string.\n*\n* @param issues The list of issues.\n*\n* @returns A summary of the issues.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction summarize(issues) {\n\tlet summary = \"\";\n\tfor (const issue of issues) {\n\t\tif (summary) summary += \"\\n\";\n\t\tsummary += `× ${issue.message}`;\n\t\tconst dotPath = /* @__PURE__ */ getDotPath(issue);\n\t\tif (dotPath) summary += `\\n → at ${dotPath}`;\n\t}\n\treturn summary;\n}\n\n//#endregion\n//#region src/methods/unwrap/unwrap.ts\n/**\n* Unwraps the wrapped schema.\n*\n* @param schema The schema to be unwrapped.\n*\n* @returns The unwrapped schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction unwrap(schema) {\n\treturn schema.wrapped;\n}\n\n//#endregion\nexport { BASE64_REGEX, BIC_REGEX, CUID2_REGEX, DECIMAL_REGEX, DIGITS_REGEX, DOMAIN_REGEX, EMAIL_REGEX, EMOJI_REGEX, HEXADECIMAL_REGEX, HEX_COLOR_REGEX, IMEI_REGEX, IPV4_REGEX, IPV6_REGEX, IP_REGEX, ISO_DATE_REGEX, ISO_DATE_TIME_REGEX, ISO_TIMESTAMP_REGEX, ISO_TIME_REGEX, ISO_TIME_SECOND_REGEX, ISO_WEEK_REGEX, ISRC_REGEX, JWS_COMPACT_REGEX, MAC48_REGEX, MAC64_REGEX, MAC_REGEX, NANO_ID_REGEX, OCTAL_REGEX, RFC_EMAIL_REGEX, SLUG_REGEX, ULID_REGEX, UUID_REGEX, ValiError, _addIssue, _cloneDataset, _getByteCount, _getGraphemeCount, _getLastMetadata, _getStandardProps, _getWordCount, _isLuhnAlgo, _isValidObjectKey, _joinExpects, _stringify, any, args, argsAsync, array, arrayAsync, assert, awaitAsync, base64, bic, bigint, blob, boolean, brand, bytes, cache, cacheAsync, check, checkAsync, checkItems, checkItemsAsync, config, creditCard, cuid2, custom, customAsync, date, decimal, deleteGlobalConfig, deleteGlobalMessage, deleteSchemaMessage, deleteSpecificMessage, description, digits, domain, email, emoji, empty, endsWith, entries, entriesFromList, entriesFromObjects, enum_ as enum, enum_, everyItem, exactOptional, exactOptionalAsync, examples, excludes, fallback, fallbackAsync, file, filterItems, findItem, finite, flatten, flavor, forward, forwardAsync, function_ as function, function_, getDefault, getDefaults, getDefaultsAsync, getDescription, getDotPath, getExamples, getFallback, getFallbacks, getFallbacksAsync, getGlobalConfig, getGlobalMessage, getMetadata, getSchemaMessage, getSpecificMessage, getTitle, graphemes, gtValue, guard, hash, hexColor, hexadecimal, imei, includes, instance, integer, intersect, intersectAsync, ip, ipv4, ipv6, is, isOfKind, isOfType, isValiError, isbn, isoDate, isoDateTime, isoTime, isoTimeSecond, isoTimestamp, isoWeek, isrc, jwsCompact, keyof, lazy, lazyAsync, length, literal, looseObject, looseObjectAsync, looseTuple, looseTupleAsync, ltValue, mac, mac48, mac64, map, mapAsync, mapItems, maxBytes, maxEntries, maxGraphemes, maxLength, maxSize, maxValue, maxWords, message, metadata, mimeType, minBytes, minEntries, minGraphemes, minLength, minSize, minValue, minWords, multipleOf, nan, nanoid, never, nonEmpty, nonNullable, nonNullableAsync, nonNullish, nonNullishAsync, nonOptional, nonOptionalAsync, normalize, notBytes, notEntries, notGraphemes, notLength, notSize, notValue, notValues, notWords, null_ as null, null_, nullable, nullableAsync, nullish, nullishAsync, number, object, objectAsync, objectWithRest, objectWithRestAsync, octal, omit, optional, optionalAsync, parse, parseAsync, parseBoolean, parseJson, parser, parserAsync, partial, partialAsync, partialCheck, partialCheckAsync, pick, picklist, pipe, pipeAsync, promise, rawCheck, rawCheckAsync, rawTransform, rawTransformAsync, readonly, record, recordAsync, reduceItems, regex, required, requiredAsync, returns, returnsAsync, rfcEmail, safeInteger, safeParse, safeParseAsync, safeParser, safeParserAsync, set, setAsync, setGlobalConfig, setGlobalMessage, setSchemaMessage, setSpecificMessage, size, slug, someItem, sortItems, startsWith, strictObject, strictObjectAsync, strictTuple, strictTupleAsync, string, stringifyJson, summarize, symbol, title, toBigint, toBoolean, toDate, toLowerCase, toMaxValue, toMinValue, toNumber, toString, toUpperCase, transform, transformAsync, trim, trimEnd, trimStart, tuple, tupleAsync, tupleWithRest, tupleWithRestAsync, ulid, undefined_ as undefined, undefined_, undefinedable, undefinedableAsync, union, unionAsync, unknown, unwrap, url, uuid, value, values, variant, variantAsync, void_ as void, void_, words };","/** @internal */\nexport function toErrorMessage(error: unknown): string {\n\tif (error instanceof Error && error.message.trim() !== \"\") {\n\t\treturn error.message;\n\t}\n\treturn String(error);\n}\n\n/** Return non-blank strings verbatim; unlike trimToNull, preserve surrounding whitespace. @internal */\nexport function readNonBlankString(value: unknown): string | null {\n\treturn typeof value === \"string\" && value.trim() !== \"\" ? value : null;\n}\n\n/** @internal */\nexport function trimString(value: unknown): string {\n\treturn typeof value === \"string\" ? value.trim() : \"\";\n}\n\n/** @internal */\nexport function trimToNull(value: unknown): string | null {\n\tconst trimmed = trimString(value);\n\treturn trimmed === \"\" ? null : trimmed;\n}\n\n/** @internal */\nexport function normalizeStringArray(value: unknown): string[] {\n\tif (!Array.isArray(value)) {\n\t\treturn [];\n\t}\n\treturn value.map((entry) => trimString(entry)).filter((entry) => entry.length > 0);\n}\n\n/**\n * Single source of truth for turning an internal identifier (an action id,\n * outcome id, or trigger) into a human-readable Title Case label, e.g.\n * `approve_plan` -> `Approve Plan`. All operator-facing surfaces (action forms,\n * flow diagrams) must route through this so the translation lives in one place\n * and can later be swapped for a localized lookup.\n */\n/** @internal */\nexport function humanizeProcessLabel(identifier: unknown): string {\n\treturn trimString(identifier)\n\t\t.replace(/[_-]+/g, \" \")\n\t\t.replace(/\\s+/g, \" \")\n\t\t.replace(/\\b\\w/g, (letter) => letter.toUpperCase())\n\t\t.trim();\n}\n\nconst IDENTIFIER_WORD_LABELS: Record<string, string> = {\n\tapi: \"API\",\n\tid: \"ID\",\n\tllm: \"LLM\",\n\tmr: \"MR\",\n\tpi: \"Pi\",\n\tui: \"UI\",\n};\n\n/** Display an identifier with known acronyms, preserving the remaining spelling. @internal */\nexport function formatProcessIdentifier(value: string): string {\n\treturn value\n\t\t.split(/[_-]+/)\n\t\t.filter((part) => part.length > 0)\n\t\t.map((part) => {\n\t\t\tconst normalizedPart = part.toLowerCase();\n\t\t\treturn IDENTIFIER_WORD_LABELS[normalizedPart] ?? part.charAt(0).toUpperCase() + part.slice(1);\n\t\t})\n\t\t.join(\" \");\n}\n","import type { RepoLocatorKind } from \"./repo-locator.js\";\nimport type { ScopedSettingsSnapshot } from \"./scoped-settings.js\";\nimport type { ProcessSemanticEntryRefKey } from \"./semantic-entry-refs.js\";\nimport { trimToNull } from \"./string-normalize.js\";\nimport type { FailedTurnRecoveryContext } from \"./turn-recovery.js\";\nimport type { ProcessTurnStartTarget } from \"./turn-start-resolution.js\";\n\n/** @internal */\nexport type TransitionTrigger =\n\t| \"start\"\n\t| \"advance\"\n\t| \"revision_requested\"\n\t| \"plan_approved\"\n\t| \"feedback_received\"\n\t| \"operator_re_review\"\n\t| \"mr_merged\"\n\t| \"abort\"\n\t| \"mr_state_waiting\";\n\n/** @public */\nexport type InputSource =\n\t| \"external_comment\"\n\t| \"app_steer\"\n\t| \"action_prompt\"\n\t| \"watcher_event\"\n\t| \"llm_review\"\n\t| \"system\";\n\n/**\n * Stable principal that drove an action, orthogonal to `InputSource` (the\n * channel an input arrived through) and `TransitionTrigger` (the graph edge a\n * transition followed). An `Actor` answers \"who acted\", not \"how\" or \"why\".\n */\n/** @public */\nexport type ActorKind = \"user\" | \"channel\" | \"system\";\n\n/** @public */\nexport interface Actor {\n\t/**\n\t * Stable principal id, namespaced by provider where applicable.\n\t * e.g. \"identity-provider:alice\", \"operator-channel\", \"system\", \"admin\".\n\t */\n\t/** @public */\n\tid: string;\n\t/** @public */\n\tkind: ActorKind;\n\t/** Origin that vouched for this actor. `null` for system/admin/local. @public */\n\tprovider: string | null;\n\t/** Optional human-readable name for UI display. @internal */\n\tdisplayName?: string;\n}\n\n/** Watcher / scheduler / startup reconciliation and other internal callers. @internal */\nexport const SYSTEM_ACTOR: Actor = { id: \"system\", kind: \"system\", provider: null };\n\n/**\n * Unauthenticated default for human-driven web/HTTP/WS actions when no SSO\n * provider is configured. Keeps an auth-disabled leitwerk behaving exactly\n * as it does today while still attributing actions to a stable principal.\n */\n/** @internal */\nexport const ADMIN_ACTOR: Actor = { id: \"admin\", kind: \"user\", provider: null };\n\n/** @internal */\nexport type QuestionSelectionMode = \"single\" | \"multiple\";\n\n/** @internal */\nexport interface NormalizedQuestionOption {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tlabel: string;\n\t/** @internal */\n\tdetails: string | null;\n}\n\n/** @internal */\nexport interface NormalizedQuestion {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tquestion: string;\n\t/** @internal */\n\tselection: QuestionSelectionMode;\n\t/** @internal */\n\toptions: readonly NormalizedQuestionOption[];\n}\n\n/** @internal */\nexport interface QuestionAnswerDraft {\n\t/** @internal */\n\tselectedOptionIds: readonly string[];\n\t/** @internal */\n\tfreeText: string;\n\t/** @internal */\n\tcomment: string;\n}\n\n/** @internal */\nexport interface ProcessRelation {\n\t/** @internal */\n\tparentInstanceId: string;\n\t/** @internal */\n\tchildInstanceId: string;\n\t/** @internal */\n\tkind: \"derived\";\n\t/** @internal */\n\tpurpose: string;\n\t/** @internal */\n\tcreatedAt: string;\n\t/** @internal */\n\tcreatedBy: Actor;\n}\n\n/** @internal */\nexport type ToolApprovalStatus = \"open\" | \"accepted\" | \"feedback\" | \"declined\" | \"cancelled\";\n\n/** @internal */\nexport interface ProcessToolApprovalDestination {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tdisplayName: string;\n\t/** @internal */\n\tgroup?: string;\n\t/** @internal */\n\tdescription?: string;\n}\n\n/** @internal */\nexport interface ProcessToolApprovalRequest {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tturnRecordId: string;\n\t/** @internal */\n\ttoolCallId: string;\n\t/** @internal */\n\ttoolName: string;\n\t/** @internal */\n\targuments: Record<string, unknown>;\n\t/** @internal */\n\tdestination: ProcessToolApprovalDestination | null;\n\t/** @internal */\n\tstatus: ToolApprovalStatus;\n\t/** @internal */\n\trequestedAt: string;\n\t/** @internal */\n\tresolvedAt: string | null;\n\t/** @internal */\n\tresolvedBy: Actor | null;\n\t/** @internal */\n\tfeedback: string | null;\n}\n\n/** @internal */\nexport interface ProcessQuestionRequest {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tturnRecordId: string;\n\t/** @internal */\n\ttoolCallId: string;\n\t/** @internal */\n\tquestions: readonly NormalizedQuestion[];\n\t/** @internal */\n\tstatus: \"open\" | \"answered\" | \"cancelled\";\n\t/** @internal */\n\tanswers: readonly string[] | null;\n\t/** @internal */\n\taskedAt: string;\n\t/** @internal */\n\tansweredAt: string | null;\n\t/** @internal */\n\tansweredBy: Actor | null;\n\t/** @internal */\n\tcancelledAt: string | null;\n}\n\nfunction requiredTrimmedString(value: unknown, field: string): string {\n\tconst trimmed = trimToNull(value);\n\tif (!trimmed) {\n\t\tthrow new Error(`${field} must be a non-empty string`);\n\t}\n\treturn trimmed;\n}\n\n/** Normalize an LLM-authored request into immutable, position-stable identities. @internal */\nexport function normalizeAskQuestionsInput(value: unknown): NormalizedQuestion[] {\n\tconst questions = (\n\t\tvalue as {\n\t\t\tquestions?: Array<{\n\t\t\t\tquestion?: unknown;\n\t\t\t\tselection?: unknown;\n\t\t\t\toptions?: Array<{ label?: unknown; details?: unknown }>;\n\t\t\t}>;\n\t\t}\n\t)?.questions;\n\tif (!Array.isArray(questions)) throw new Error(\"questions must be an array\");\n\tif (questions.length === 0) throw new Error(\"questions must not be empty\");\n\treturn questions.map((candidate, questionIndex) => {\n\t\tconst question = requiredTrimmedString(\n\t\t\tcandidate?.question,\n\t\t\t`questions[${questionIndex}].question`,\n\t\t);\n\t\tif (candidate?.selection !== \"single\" && candidate?.selection !== \"multiple\") {\n\t\t\tthrow new Error(`questions[${questionIndex}].selection must be 'single' or 'multiple'`);\n\t\t}\n\t\tif (!Array.isArray(candidate.options) || candidate.options.length === 0) {\n\t\t\tthrow new Error(`questions[${questionIndex}].options must not be empty`);\n\t\t}\n\t\tconst labels = new Set<string>();\n\t\tconst questionId = `question_${questionIndex + 1}`;\n\t\tconst options = candidate.options.map((option, optionIndex) => {\n\t\t\tconst label = requiredTrimmedString(\n\t\t\t\toption?.label,\n\t\t\t\t`questions[${questionIndex}].options[${optionIndex}].label`,\n\t\t\t);\n\t\t\tconst key = label.toLocaleLowerCase();\n\t\t\tif (labels.has(key)) {\n\t\t\t\tthrow new Error(`questions[${questionIndex}] contains duplicate option '${label}'`);\n\t\t\t}\n\t\t\tlabels.add(key);\n\t\t\treturn {\n\t\t\t\tid: `${questionId}_option_${optionIndex + 1}`,\n\t\t\t\tlabel,\n\t\t\t\tdetails: trimToNull(option.details),\n\t\t\t};\n\t\t});\n\t\treturn { id: questionId, question, selection: candidate.selection, options };\n\t});\n}\n\n/** @internal */\nexport function emptyQuestionDrafts(\n\tquestions: readonly NormalizedQuestion[],\n): QuestionAnswerDraft[] {\n\treturn questions.map(() => ({ selectedOptionIds: [], freeText: \"\", comment: \"\" }));\n}\n\nfunction normalizeQuestionDrafts(\n\tquestions: readonly NormalizedQuestion[],\n\tvalue: unknown,\n): QuestionAnswerDraft[] {\n\tif (!Array.isArray(value) || value.length !== questions.length) {\n\t\tthrow new Error(\"Every question must have one draft answer in question order\");\n\t}\n\treturn questions.map((question, index) => {\n\t\tconst answer = value[index] as Partial<QuestionAnswerDraft> | undefined;\n\t\tif (!Array.isArray(answer?.selectedOptionIds)) {\n\t\t\tthrow new Error(`Question ${index + 1} has a malformed selection`);\n\t\t}\n\t\tconst selectedOptionIds = answer.selectedOptionIds.map((id) => {\n\t\t\tif (typeof id !== \"string\" || !question.options.some((option) => option.id === id)) {\n\t\t\t\tthrow new Error(`Question ${index + 1} contains an unknown selection`);\n\t\t\t}\n\t\t\treturn id;\n\t\t});\n\t\tif (new Set(selectedOptionIds).size !== selectedOptionIds.length) {\n\t\t\tthrow new Error(`Question ${index + 1} contains duplicate selections`);\n\t\t}\n\t\tif (question.selection === \"single\" && selectedOptionIds.length > 1) {\n\t\t\tthrow new Error(`Question ${index + 1} accepts only one selection`);\n\t\t}\n\t\tif (typeof answer.freeText !== \"string\" || typeof answer.comment !== \"string\") {\n\t\t\tthrow new Error(`Question ${index + 1} contains malformed text`);\n\t\t}\n\t\treturn { selectedOptionIds, freeText: answer.freeText, comment: answer.comment };\n\t});\n}\n\n/** Validate a complete structured draft and produce one canonical free-text answer per question. @internal */\nexport function canonicalizeQuestionAnswers(\n\tquestions: readonly NormalizedQuestion[],\n\tvalue: unknown,\n): string[] {\n\treturn normalizeQuestionDrafts(questions, value).map((answer, index) => {\n\t\tconst question = questions[index];\n\t\tif (!question) throw new Error(`Question ${index + 1} is missing`);\n\t\tconst options = answer.selectedOptionIds.map(\n\t\t\t(id) => question.options.find((option) => option.id === id)?.label ?? \"\",\n\t\t);\n\t\tconst freeText = answer.freeText.trim();\n\t\tconst comment = answer.comment.trim();\n\t\tif (options.length === 0 && freeText === \"\") {\n\t\t\tthrow new Error(`Question ${index + 1} requires an answer`);\n\t\t}\n\t\treturn [options.join(\", \"), freeText, comment ? `Context: ${comment}` : \"\"]\n\t\t\t.filter(Boolean)\n\t\t\t.join(\"\\n\");\n\t});\n}\n\n/**\n * Durable operator/system input queued for worker delivery.\n * `action_prompt` is the conventional source for action-originated follow-up\n * prompts. Delivery semantics are owned by `ProcessInput.target`, not by\n * `source` or `kind`.\n */\n\n/** @public */\nexport type InputKind = \"instruction\" | \"action\" | \"system_event\";\n\n/** @public */\nexport type ProcessInputTarget =\n\t| {\n\t\t\t/** @public */\n\t\t\tsemanticRef: ProcessSemanticEntryRefKey;\n\t\t\t/** @internal */\n\t\t\tproductName?: never;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tproductName: string;\n\t\t\t/** @public */\n\t\t\tsemanticRef?: never;\n\t };\n\n/** @internal */\nexport const WORKER_ERROR_CLASSES = [\n\t\"llm_error\",\n\t\"git_error\",\n\t\"pi_crash\",\n\t\"pipeline_error\",\n\t\"infrastructure\",\n\t\"protocol_error\",\n\t\"operator_abort\",\n] as const;\n\n/** @internal */\nexport type WorkerErrorClass = (typeof WORKER_ERROR_CLASSES)[number];\n\n/** @internal */\nexport function isWorkerErrorClass(value: string): value is WorkerErrorClass {\n\treturn (WORKER_ERROR_CLASSES as readonly string[]).includes(value);\n}\n\n/** @internal */\nexport type TurnFailureCode = \"branch_drift\";\n\n/** @internal */\nexport function isTurnFailureCode(value: string): value is TurnFailureCode {\n\treturn value === \"branch_drift\";\n}\n\n/** Extension-defined stable turn identifier. @public */\nexport type TurnId = string;\n\n/** @internal */\nexport const PROCESS_TURN_TYPES = [\"llm\", \"human\", \"external\", \"automatic\"] as const;\n\n/** @internal */\nexport type ProcessTurnType = (typeof PROCESS_TURN_TYPES)[number];\n\n/** @internal */\nexport interface TurnOutcomePayload {\n\t/** @internal */\n\tresultSummary?: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tturnRecordId: string;\n\t/** @internal */\n\tturnId: TurnId;\n\t/** @internal */\n\tturnType: ProcessTurnType;\n\t/** @internal */\n\toutcome: string;\n\t/** @internal */\n\tparams: Record<string, unknown>;\n\t/** @internal */\n\tpathType?: ProcessTurnRecordPathType;\n\t/** @internal */\n\tforkPiEntryId?: string | null;\n\t/** @internal */\n\tresultPiEntryId?: string | null;\n\t/** @internal */\n\tturnResultMarkdown?: string | null;\n\t/** @internal */\n\trootEntryId?: string | null;\n\t/** @internal */\n\tstate?: unknown;\n}\n\n/** @internal */\nexport interface TurnFailedPayload {\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tturnRecordId: string;\n\t/** @internal */\n\tturnId: TurnId;\n\t/** @internal */\n\tturnType: ProcessTurnType;\n\t/** @internal */\n\tpathType: ProcessTurnRecordPathType;\n\t/** @internal */\n\tforkPiEntryId?: string | null;\n\t/** @internal */\n\tresultPiEntryId?: string | null;\n\t/** @internal */\n\terrorSummary: string;\n\t/** @internal */\n\terrorClass?: WorkerErrorClass;\n\t/** @internal */\n\tfailureCode?: TurnFailureCode | null;\n\t/** @internal */\n\tfailureDetails?: Record<string, unknown> | null;\n\t/** @internal */\n\trecoveryContext?: FailedTurnRecoveryContext | null;\n}\n\n/** @public */\nexport type ProcessLifecycleStatus =\n\t| \"discovered\"\n\t| \"active\"\n\t| \"waiting\"\n\t| \"error\"\n\t| \"completed\"\n\t| \"aborted\";\n\n/** @internal */\nexport function isProcessTurnType(value: unknown): value is ProcessTurnType {\n\treturn typeof value === \"string\" && (PROCESS_TURN_TYPES as readonly string[]).includes(value);\n}\n\n/** @internal */\nexport function isWorkerOwnedTurnType(turnType: ProcessTurnType): boolean {\n\treturn turnType === \"llm\" || turnType === \"automatic\";\n}\n\n/** @internal */\nexport function isWaitingTurnType(turnType: ProcessTurnType): boolean {\n\treturn turnType === \"human\" || turnType === \"external\";\n}\n\n/** @internal */\nexport function lifecycleStatusForSelectedTurnType(\n\tturnType: ProcessTurnType,\n): Extract<ProcessLifecycleStatus, \"active\" | \"waiting\"> {\n\treturn isWaitingTurnType(turnType) ? \"waiting\" : \"active\";\n}\n\n/** @internal */\nexport type ProcessSelectedTurnModelSource =\n\t| \"action_override\"\n\t| \"launch_override\"\n\t| \"instance_turn_config\"\n\t| \"process_config_turn\"\n\t| \"instance_default\"\n\t| \"scoped_purpose_default\"\n\t| \"process_config_default\"\n\t| \"catalog_default\"\n\t| \"legacy_persisted\";\n\n/** @internal */\nexport type ModelSelectionKind = \"explicit\" | \"inherited\";\n/** @internal */\nexport type ModelSelectionSource = ProcessSelectedTurnModelSource;\n\n/** Durable intent and resolution path for one effective model selection. @internal */\nexport interface ModelSelectionProvenance {\n\t/** @internal */\n\tkind: ModelSelectionKind;\n\t/** @internal */\n\tsource: ModelSelectionSource;\n}\n\n/** @internal */\nexport interface DurableModelSelection {\n\t/** @internal */\n\tmodelProfileId: string;\n\t/** @internal */\n\tprovenance: ModelSelectionProvenance;\n}\n\n/** @internal */\nexport type ModelPolicyFailureCode =\n\t| \"invalid_model_configuration\"\n\t| \"unknown_model_profile\"\n\t| \"model_profile_not_allowed\"\n\t| \"model_required\"\n\t| \"model_unavailable\"\n\t| \"model_stale\"\n\t| \"stale_evaluation_snapshot\";\n\n/** @internal */\nexport interface FutureExecutionBlockReason {\n\t/** @internal */\n\tcode: ModelPolicyFailureCode;\n\t/** @internal */\n\tselection: DurableModelSelection | null;\n\t/** @internal */\n\tsummary: string;\n\t/** @internal */\n\tdetectedAt: string;\n\t/** Present when the block depends on a runtime availability snapshot. @internal */\n\tavailabilityRevision?: number;\n}\n\n/** JSON object persisted as non-secret turn-start configuration. @internal */\nexport type JsonObject = Record<string, unknown>;\n\n/** The one durable technical execution currently owned by a process. @internal */\nexport type CurrentExecutionRef = {\n\t/** @internal */\n\tkind: \"worker_start\";\n\t/** @internal */\n\tid: string;\n} | null;\n\n/** Immutable non-secret inputs resolved for a worker-owned turn start. @internal */\nexport type ResolvedTurnStart =\n\t| {\n\t\t\t/** Resolved non-secret outcome schemas and publication metadata. @internal */\n\t\t\toutcomeContract?: JsonObject;\n\t\t\t/** @internal */\n\t\t\tscopedSettings?: ScopedSettingsSnapshot;\n\t\t\t/** @internal */\n\t\t\tkind: \"llm\";\n\t\t\t/** @internal */\n\t\t\tmodel: {\n\t\t\t\t/** @internal */\n\t\t\t\tprofileId: string;\n\t\t\t\t/** @internal */\n\t\t\t\tproviderId: string;\n\t\t\t\t/** @internal */\n\t\t\t\tmodelId: string;\n\t\t\t\t/** @internal */\n\t\t\t\tthinkingLevel: string;\n\t\t\t};\n\t\t\t/** Frozen provenance used to resolve this prepared start. @internal */\n\t\t\tmodelSelectionProvenance?: ModelSelectionProvenance;\n\t\t\t/** Status revision evaluated before preparation. Diagnostic only. @internal */\n\t\t\tavailabilityRevision?: number;\n\t\t\t/** @internal */\n\t\t\tproviderOptions: Record<string, string>;\n\t\t\t/** @internal */\n\t\t\tproviderWorkerConfig: {\n\t\t\t\t/** @internal */\n\t\t\t\tversion: number;\n\t\t\t\t/** @internal */\n\t\t\t\tvalue: JsonObject;\n\t\t\t} | null;\n\t\t\t/** @internal */\n\t\t\tpiResourceSnapshotDigest: string;\n\t\t\t/** @internal */\n\t\t\tworkerRuntimeProfileId: string;\n\t\t\t/** @internal */\n\t\t\tpiSettings: JsonObject;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"automatic\";\n\t };\n\n/** @internal */\nexport type TurnStartKind = \"selected_turn\" | \"retry\" | \"continue\" | \"startup_retry\";\n\n/** @internal */\nexport interface TurnStartContinuation {\n\t/** @internal */\n\tcontinueFromPiEntryId: string;\n\t/** @internal */\n\tcontinuePrompt: string;\n\t/** @internal */\n\tsavedPrimaryLeafEntryId: string | null;\n}\n\n/** @internal */\nexport type TurnStartPreparationFailureCode =\n\t| \"invalid_model_configuration\"\n\t| \"model_required\"\n\t| \"model_unavailable\"\n\t| \"model_stale\"\n\t| \"provider_options_required\"\n\t| \"provider_preflight_failed\";\n\n/** @internal */\nexport interface StartupRetryState {\n\t/** First start in this recovery episode. @internal */\n\tepisodeStartRecordId: string;\n\t/** Includes the initial start; these are not accepted turn attempts. @internal */\n\tstarts: number;\n\t/** Retained deadline so polling and restarts cannot postpone recovery. @internal */\n\tnextRetryAt: string | null;\n}\n\n/** Safe recovery information shared by automation and the process inspector. @public */\nexport interface AutomaticStartupRecoverySummary {\n\t/** @public */\n\tstatus: \"blocked\" | \"waiting\" | \"ready\" | \"waiting_for_model\" | \"exhausted\" | \"retried\";\n\t/** @public */\n\treason: string;\n\t/** @public */\n\tstarts: number;\n\t/** @public */\n\tmaxStarts: number;\n\t/** @public */\n\tnextRetryAt: string | null;\n}\n\n/** @internal */\nexport type TurnStartRecordState = {\n\t/** @internal */\n\tautomaticRetry?: StartupRetryState;\n} & (\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"preparation_failed\";\n\t\t\t/** @internal */\n\t\t\trequestedModelProfileId: string | null;\n\t\t\t/** @internal */\n\t\t\tproviderOptions: Record<string, string>;\n\t\t\t/** @internal */\n\t\t\tcode: TurnStartPreparationFailureCode;\n\t\t\t/** @internal */\n\t\t\tsafeSummary: string;\n\t\t\t/** @internal */\n\t\t\tmodelSelectionProvenance?: ModelSelectionProvenance;\n\t\t\t/** @internal */\n\t\t\tavailabilityRevision?: number;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"starting\";\n\t\t\t/** @internal */\n\t\t\tstart: ResolvedTurnStart;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"bootstrap_failed\";\n\t\t\t/** @internal */\n\t\t\tstart: ResolvedTurnStart;\n\t\t\t/** @internal */\n\t\t\tfailedWorkerLeaseId: string | null;\n\t\t\t/** @internal */\n\t\t\tcode: string;\n\t\t\t/** @internal */\n\t\t\tsafeSummary: string;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"accepted\";\n\t\t\t/** @internal */\n\t\t\tstart: ResolvedTurnStart;\n\t\t\t/** @internal */\n\t\t\tturnRecordId: string;\n\t\t\t/** @internal */\n\t\t\tacceptedWorkerLeaseId: string;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"superseded\";\n\t\t\t/** @internal */\n\t\t\tstart: ResolvedTurnStart | null;\n\t }\n);\n\n/** Durable preparation for a single worker-owned selected turn, not an attempt. @internal */\nexport interface TurnStartRecord {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tturnId: TurnId;\n\t/** @internal */\n\tturnType: Extract<ProcessTurnType, \"llm\" | \"automatic\">;\n\t/** Reserved id used when, and only when, this start is accepted. @internal */\n\tproposedTurnRecordId: string;\n\t/** @internal */\n\tstartKind: TurnStartKind;\n\t/** @internal */\n\trecoveryTurnRecordId: string | null;\n\t/** @internal */\n\tcontinuation: TurnStartContinuation | null;\n\t/** @internal */\n\tstate: TurnStartRecordState;\n\t/** Mapped-turn item this start executes; null for ordinary turns. @internal */\n\titeration?: MappedTurnItemRef | null;\n\t/** @internal */\n\tcreatedAt: string;\n\t/** @internal */\n\tupdatedAt: string;\n}\n\n/** Identity of one frozen item in a mapped LLM run. @internal */\nexport interface MappedTurnItemRef {\n\t/** @internal */\n\trunId: string;\n\t/** @internal */\n\titemKey: string;\n\t/** Zero-based position in the frozen order. @internal */\n\titemIndex: number;\n}\n\n/** @internal */\nexport type MappedRunStatus = \"active\" | \"completed\" | \"aborted\";\n\n/** Durable bookkeeping for one sequential pass of a mapped LLM turn. @internal */\nexport interface MappedRun {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tturnId: TurnId;\n\t/** @internal */\n\tstatus: MappedRunStatus;\n\t/** @internal */\n\titemCount: number;\n\t/** Index of the item currently executing, or itemCount when all results exist. @internal */\n\tnextIndex: number;\n\t/** @internal */\n\tcreatedAt: string;\n\t/** @internal */\n\tupdatedAt: string;\n}\n\n/** @internal */\nexport type MappedItemStatus = \"pending\" | \"completed\";\n\n/** One frozen item of a mapped run and its validated result. @internal */\nexport interface MappedItem {\n\t/** @internal */\n\trunId: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\titemIndex: number;\n\t/** @internal */\n\titemKey: string;\n\t/** @internal */\n\tlabel: string;\n\t/** Codec-serialized item value. @internal */\n\titemJson: string;\n\t/** @internal */\n\tstatus: MappedItemStatus;\n\t/** @internal */\n\toutcome: string | null;\n\t/** Codec-serialized result, set once when the item completes. @internal */\n\tresultJson: string | null;\n\t/** Turn record whose outcome produced the result. @internal */\n\tturnRecordId: string | null;\n\t/** @internal */\n\tcompletedAt: string | null;\n}\n\n/** Tree positioning selected during bootstrap, before a turn is accepted. @internal */\nexport interface PreparedTurnStart {\n\t/** @internal */\n\tpathType: ProcessTurnRecordPathType;\n\t/** Durable authored context mode used to reconcile pre-prompt positioning and compaction. @internal */\n\tcontextMode: LlmContextMode;\n\t/** @internal */\n\tstartTarget: ProcessTurnStartTarget;\n\t/** @internal */\n\tforkPiEntryId: string | null;\n}\n\n/** @internal */\nexport type LlmContextMode = \"full\" | \"compacted\" | \"fresh\" | \"fresh_seeded\";\n\n/** Immutable, lease-correlated proof of successful worker bootstrap. @internal */\nexport type WorkerBootstrapReceipt =\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"llm\";\n\t\t\t/** @internal */\n\t\t\tstartRecordId: string;\n\t\t\t/** @internal */\n\t\t\tworkerLeaseId: string;\n\t\t\t/** @internal */\n\t\t\treceiptEpoch: string;\n\t\t\t/** @internal */\n\t\t\tverifiedResourceSnapshotDigest: string;\n\t\t\t/** @internal */\n\t\t\tcredentialRevision: number | null;\n\t\t\t/** @internal */\n\t\t\tloadedResourceIds: string[];\n\t\t\t/** @internal */\n\t\t\tresolvedModel: {\n\t\t\t\t/** @internal */\n\t\t\t\tproviderId: string;\n\t\t\t\t/** @internal */\n\t\t\t\tmodelId: string;\n\t\t\t};\n\t\t\t/** @internal */\n\t\t\tpreparedStart: PreparedTurnStart | null;\n\t\t\t/** @internal */\n\t\t\treadyAt: string;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"automatic\";\n\t\t\t/** @internal */\n\t\t\tstartRecordId: string;\n\t\t\t/** @internal */\n\t\t\tworkerLeaseId: string;\n\t\t\t/** @internal */\n\t\t\treceiptEpoch: string;\n\t\t\t/** @internal */\n\t\t\treadyAt: string;\n\t };\n\n/** @internal */\nexport const PROCESS_SELECTED_TURN_MODEL_SOURCES = [\n\t\"action_override\",\n\t\"launch_override\",\n\t\"instance_turn_config\",\n\t\"process_config_turn\",\n\t\"instance_default\",\n\t\"process_config_default\",\n\t\"scoped_purpose_default\",\n\t\"catalog_default\",\n\t\"legacy_persisted\",\n] as const satisfies readonly ProcessSelectedTurnModelSource[];\n\n/** @internal */\nexport function isProcessSelectedTurnModelSource(\n\tvalue: unknown,\n): value is ProcessSelectedTurnModelSource {\n\treturn PROCESS_SELECTED_TURN_MODEL_SOURCES.includes(value as ProcessSelectedTurnModelSource);\n}\n\n/** @public */\nexport interface ProcessCustomizableFields {\n\t/** @internal */\n\ttitle?: string | null;\n\t/** @public */\n\texternalId?: string | null;\n\t/** @internal */\n\texternalUrl?: string | null;\n\t/** @internal */\n\tmetadata?: Record<string, unknown> | null;\n\t/** @internal */\n\tdefaultModelProfileId?: string | null;\n\t/** @internal */\n\tinitialDefaultModelProfileId?: string | null;\n\t/** @internal */\n\tturnConfigsJson?: string | null;\n\t/** @internal */\n\tselectedTurnModelProfileId?: string | null;\n\t/** @internal */\n\tselectedTurnModelKind?: ModelSelectionKind | null;\n\t/** @internal */\n\tselectedTurnModelSource?: ProcessSelectedTurnModelSource | null;\n}\n\n/** @public */\nexport interface ProcessInstance {\n\t/** @public */\n\tid: string;\n\t/** Canonical process identifier from the extension catalog. @public */\n\tprocessId: string;\n\t/** Durable pointer to the currently selected business turn, if any. @public */\n\tselectedTurnId: TurnId | null;\n\t/** High-level lifecycle bucket for scheduling and operator state. @public */\n\tlifecycleStatus: ProcessLifecycleStatus;\n\t/** Single durable technical execution reference; null for waiting/terminal states. @internal */\n\tcurrentExecution: CurrentExecutionRef;\n\t/** @public */\n\tplanRevision: number;\n\t/** Short operator-facing process title used in process lists and related UI. @public */\n\ttitle: string | null;\n\t/** Provider-agnostic external reference, such as a work item key or change path. @public */\n\texternalId: string | null;\n\t/** URL to the external resource, if applicable. @internal */\n\texternalUrl: string | null;\n\t/** Extension-owned JSON metadata blob. @internal */\n\tmetadata: Record<string, unknown> | null;\n\t/** Instance-scoped default model profile used when no turn override applies. @internal */\n\tdefaultModelProfileId?: string | null;\n\t/** Effective default model at creation time, retained for historical inspection. @internal */\n\tinitialDefaultModelProfileId?: string | null;\n\t/** JSON-serialized per-turn runtime config overrides for this instance. @internal */\n\tturnConfigsJson?: string | null;\n\t/** Frozen effective model profile for the currently selected LLM turn, if any. @internal */\n\tselectedTurnModelProfileId?: string | null;\n\t/** Explicit operator intent or inherited policy resolution for the selected model. @internal */\n\tselectedTurnModelKind?: ModelSelectionKind | null;\n\t/** Resolution path that selected `selectedTurnModelProfileId`; null for empty selections. @internal */\n\tselectedTurnModelSource?: ProcessSelectedTurnModelSource | null;\n\t/** JSON-serialized process params. @public */\n\tparamsJson: string | null;\n\t/** JSON-serialized process state. @public */\n\tstateJson: string | null;\n\t/** @public */\n\tcreatedAt: string;\n\t/** @internal */\n\tupdatedAt: string;\n\t/** Set once when the process first reaches a terminal lifecycle status. @internal */\n\tclosedAt?: string | null;\n}\n\n/** @public */\nexport interface ProcessProject {\n\t/** @public */\n\tid: string;\n\t/** @public */\n\tinstanceId: string;\n\t/** @public */\n\tkey: string;\n\t/** Repository source identifier. May be a remote URL or a local filesystem path. @public */\n\trepoLocator: string;\n\t/** @internal */\n\trepoLocatorKind: RepoLocatorKind;\n\t/** @internal */\n\tbaseBranch: string;\n\t/** @internal */\n\tworkBranch: string | null;\n\t/** Provider-agnostic external identifier (e.g. MR IID, PR number). @internal */\n\texternalId: string | null;\n\t/** URL to the external resource (e.g. MR URL, PR URL). @internal */\n\texternalUrl: string | null;\n\t/** Extension-owned JSON metadata blob. @public */\n\tmetadata: Record<string, unknown> | null;\n\t/** @internal */\n\tpipelineStatus: string | null;\n\t/** @internal */\n\tcreatedAt: string;\n\t/** @internal */\n\tupdatedAt: string;\n}\n\n/** @internal */\nexport interface ProcessInput {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tsequence: number;\n\t/** @internal */\n\tsource: InputSource;\n\t/** @internal */\n\tkind: InputKind;\n\t/** @internal */\n\ttarget: ProcessInputTarget | null;\n\t/** @internal */\n\tbodyMarkdown: string;\n\t/** Stable principal that queued this input. Defaults to `SYSTEM_ACTOR`. @internal */\n\tactor: Actor;\n\t/** @internal */\n\treceivedAt: string;\n\t/** @internal */\n\tconsumedAt: string | null;\n}\n\n/** @internal */\nexport type LaunchOrigin = \"ui\" | \"programmatic\" | \"watcher\" | \"scheduled\" | \"startup_retry\";\n/** @internal */\nexport type LaunchRunStatus =\n\t| \"preparing\"\n\t| \"process_created\"\n\t| \"starting\"\n\t| \"completed\"\n\t| \"failed\"\n\t| \"cancelled\";\n/** @internal */\nexport type LaunchChecklistStepStatus =\n\t| \"pending\"\n\t| \"in_progress\"\n\t| \"completed\"\n\t| \"failed\"\n\t| \"skipped\";\n\n/** Presentation-safe durable progress for one process launch attempt. @internal */\nexport interface LaunchChecklistStep {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tlabel: string;\n\t/** @internal */\n\tstatus: LaunchChecklistStepStatus;\n\t/** @internal */\n\tsafeSummary?: string;\n\t/** @internal */\n\tstartedAt?: string;\n\t/** @internal */\n\tcompletedAt?: string;\n}\n\n/** Durable launch attempt. Secrets and runner identifiers never belong here. @internal */\nexport interface LaunchRun {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tlauncherId: string | null;\n\t/** @internal */\n\torigin: LaunchOrigin;\n\t/** @internal */\n\tinstanceId: string | null;\n\t/** @internal */\n\tstatus: LaunchRunStatus;\n\t/** @internal */\n\tsteps: LaunchChecklistStep[];\n\t/** @internal */\n\tcreatedAt: string;\n\t/** @internal */\n\tupdatedAt: string;\n\t/** @internal */\n\tcompletedAt: string | null;\n\t/** @internal */\n\trevision: number;\n}\n\n/** @internal */\nexport type FutureExecutionKind = \"launch\" | \"action\";\n/** @internal */\nexport type FutureExecutionScheduleKind = \"once\" | \"cron\";\n\n/** @internal */\nexport interface FutureExecution {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tkind: FutureExecutionKind;\n\t/** @internal */\n\tscheduleKind: FutureExecutionScheduleKind;\n\t/** Canonical target process identifier. @internal */\n\tprocessId: string;\n\t/** Populated only for scheduled actions on an existing process instance. @internal */\n\tinstanceId: string | null;\n\t/** @internal */\n\tlauncherId: string | null;\n\t/** @internal */\n\tactionId: string | null;\n\t/** JSON-serialized kind-specific payload. @internal */\n\tpayloadJson: string;\n\t/** @internal */\n\tcronExpression: string | null;\n\t/** @internal */\n\tnextRunAt: string;\n\t/** Immediate LLM selection caused by this execution, if known. @internal */\n\tmodelSelection?: DurableModelSelection | null;\n\t/** Structured model-policy block. Blocked rows remain durable. @internal */\n\tblockedReason?: FutureExecutionBlockReason | null;\n\t/** @internal */\n\tcreatedAt: string;\n\t/** @internal */\n\tupdatedAt: string;\n}\n\n/** @internal */\nexport interface ProcessEvent {\n\t/** Persisted ingestion order. Absent only on legacy in-memory fixtures. @internal */\n\teventSequence?: number;\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\teventType: string;\n\t/** @internal */\n\tdata: Record<string, unknown>;\n\t/** @internal */\n\tcreatedAt: string;\n}\n\n/** @internal */\nexport type ProcessLeafOutcomeSnapshotStatus = \"ready\" | \"capture_error\";\n\n/** @internal */\nexport interface ProcessLeafOutcomeSnapshot {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tleafEntryId: string;\n\t/** @internal */\n\tturnRecordId: string | null;\n\t/** @internal */\n\trendererId: string | null;\n\t/** @internal */\n\tschemaVersion: number | null;\n\t/** @internal */\n\tprops: Record<string, unknown> | null;\n\t/** @internal */\n\tfallbackMarkdown: string | null;\n\t/** @internal */\n\tstatus: ProcessLeafOutcomeSnapshotStatus;\n\t/** @internal */\n\twarningCode: string | null;\n\t/** @internal */\n\twarningMessage: string | null;\n\t/** @internal */\n\tanchoredAt: string;\n\t/** @internal */\n\tcreatedAt: string;\n}\n\n/** @public */\nexport type ProcessTurnRecordStatus = \"running\" | \"succeeded\" | \"failed\" | \"superseded\";\n\n/** @public */\nexport type TurnProgressStepStatus = \"incomplete\" | \"in_progress\" | \"completed\" | \"failed\";\n\n/** @public */\nexport interface TurnProgressStep {\n\t/** @public */\n\tid: string;\n\t/** @public */\n\tlabel: string;\n\t/** @public */\n\tstatus: TurnProgressStepStatus;\n\t/** @public */\n\tdetail?: string | null;\n}\n\n/** @public */\nexport interface TurnProgressLink {\n\t/** @public */\n\tid: string;\n\t/** @public */\n\tlabel: string;\n\t/** @public */\n\turl: string;\n\t/** @public */\n\tkind?: \"pull_request\" | \"merge_request\" | \"commit\" | \"pipeline\" | \"other\";\n}\n\n/** A complete operator-facing snapshot. Reporters replace, rather than patch, this value. @public */\nexport interface TurnProgressReport {\n\t/** @public */\n\ttitle: string;\n\t/** Attempt-specific progress or waiting explanation; not an operation receipt. @public */\n\tsummary?: string;\n\t/** Optional checklist; may be empty when summary supplies the activity text. @public */\n\tsteps: TurnProgressStep[];\n\t/** @public */\n\tlinks?: TurnProgressLink[];\n}\n\n/**\n * Structural tree position for a turn record.\n * - `primary`: continue the primary path from the current leaf\n * - `root_branch`: start from the implicit session root with no prior Pi entry context\n * - `leaf_branch`: fork from the current leaf as a side path\n */\n/** @public */\nexport const PROCESS_TURN_RECORD_PATH_TYPES = [\"primary\", \"root_branch\", \"leaf_branch\"] as const;\n\n/** @public */\nexport type ProcessTurnRecordPathType = (typeof PROCESS_TURN_RECORD_PATH_TYPES)[number];\n\n/** @public */\nexport interface ProcessTurnRecord {\n\t/** @public */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @public */\n\tturnId: TurnId;\n\t/** @internal */\n\tturnType: ProcessTurnType;\n\t/** @public */\n\tstatus: ProcessTurnRecordStatus;\n\t/** @internal */\n\tattemptNumber: number;\n\t/** @internal */\n\tparentTurnRecordId: string | null;\n\t/** @internal */\n\tpathType: ProcessTurnRecordPathType;\n\t/** @internal */\n\tforkPiEntryId: string | null;\n\t/** Accepted worker-start preparation that created this worker-owned record. @internal */\n\tturnStartRecordId?: string | null;\n\t/** Lease whose receipt first authorized this worker-owned record. @internal */\n\tacceptedWorkerLeaseId?: string | null;\n\t/** @internal */\n\tresultPiEntryId: string | null;\n\t/** @internal */\n\tmodelProfileId: string | null;\n\t/** @internal */\n\tmodelSelectionProvenance?: ModelSelectionProvenance | null;\n\t/** Mapped-turn item this record executed; retries keep the same item. @internal */\n\titeration?: MappedTurnItemRef | null;\n\t/** @internal */\n\tturnResultMarkdown: string | null;\n\t/** @public */\n\terrorSummary: string | null;\n\t/** @internal */\n\terrorClass: WorkerErrorClass | null;\n\t/** @internal */\n\tstartedAt: string;\n\t/** @internal */\n\tendedAt: string | null;\n}\n\n/** @internal */\nexport interface WorkerLease {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tworkerId: string;\n\t/** Worker start this physical lease was created to execute. @internal */\n\tturnStartRecordId?: string | null;\n\t/** Durable server-owned supervision state for the current worker lease. @internal */\n\tstate: WorkerState;\n\t/** Server epoch this lease belongs to, used to reject stale snapshot writes. @internal */\n\tserverEpoch?: string | null;\n\t/** Hash of the lease-scoped WebSocket connect token. The raw token is never stored. @internal */\n\tconnectTokenHash?: string | null;\n\t/** Hash of the lease-scoped HTTP session-snapshot credential. The raw token is never stored. @internal */\n\tsnapshotTokenHash?: string | null;\n\t/** Fingerprint of the effective instance model policy/config snapshot used to start this worker. @internal */\n\tmodelPolicyFingerprint?: string | null;\n\t/** First valid lease-correlated bootstrap receipt; written once by the server. @internal */\n\tbootstrapReceipt?: WorkerBootstrapReceipt | null;\n\t/** Updated from heartbeats for liveness/recovery diagnostics. @internal */\n\tlastHeartbeatAt: string | null;\n\t/** @internal */\n\tstartedAt: string;\n\t/** First valid server-observed worker handshake. @internal */\n\tconnectedAt?: string | null;\n\t/** First valid server-observed workspace preparation progress. @internal */\n\tworkspacePreparationStartedAt?: string | null;\n\t/** First accepted server-observed worker readiness. @internal */\n\treadyAt?: string | null;\n\t/** Set once the lease is no longer active for supervision. @internal */\n\texitedAt: string | null;\n}\n\n/**\n * Durable worker lease states owned by the server.\n * `absent` is conceptual in lifecycle logic and usually represented by\n * the absence of an active lease row.\n */\n/** @internal */\nexport type WorkerState =\n\t| \"absent\"\n\t| \"spawning\"\n\t| \"bootstrapping\"\n\t| \"idle\"\n\t| \"busy\"\n\t| \"draining\"\n\t| \"failed\"\n\t| \"cleanup\"\n\t| \"exited\";\n\n/**\n * External write type identifier. Extensions define their own write types\n * as plain strings (e.g. \"tracker.approved_plan_comment\", \"code_host.create_change\").\n */\n/** @public */\nexport type ExternalWriteType = string;\n\n/** @public */\nexport interface ExternalWriteLog {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @public */\n\twriteType: ExternalWriteType;\n\t/** @internal */\n\tdedupKey: string;\n\t/** @internal */\n\tcompletedAt: string;\n\t/** @internal */\n\tmetadata: Record<string, unknown>;\n}\n\n/**\n * Returns a human-readable, operator-facing label for the structural path\n * position of a turn record. These labels avoid internal domain terms such\n * as \"primary\" or \"root_branch\" in favour of plain descriptions of what the\n * turn is doing relative to the main path.\n */\n/** @internal */\nexport function formatPathTypeLabel(pathType: ProcessTurnRecordPathType): string {\n\tswitch (pathType) {\n\t\tcase \"primary\":\n\t\t\treturn \"Continuing the main path\";\n\t\tcase \"root_branch\":\n\t\t\treturn \"Starting from the beginning\";\n\t\tcase \"leaf_branch\":\n\t\t\treturn \"Exploring an alternative\";\n\t\tdefault:\n\t\t\treturn \"Path\";\n\t}\n}\n","import { type Actor, type ActorKind, SYSTEM_ACTOR } from \"./domain-model.js\";\nimport { trimToNull } from \"./string-normalize.js\";\n\nconst ACTOR_KINDS: readonly ActorKind[] = [\"user\", \"channel\", \"system\"];\nfunction isActorKind(value: unknown): value is ActorKind {\n\treturn typeof value === \"string\" && (ACTOR_KINDS as readonly string[]).includes(value);\n}\n\n/**\n * Builds a validated `Actor`, dropping unknown fields and falling back to\n * defaults for invalid kind/provider. Returns `null` when no stable id is\n * present so callers can decide on a fallback actor.\n */\n/** @internal */\nexport function normalizeActor(value: unknown): Actor | null {\n\tif (typeof value !== \"object\" || value === null) {\n\t\treturn null;\n\t}\n\tconst candidate = value as Record<string, unknown>;\n\tconst id = trimToNull(candidate.id);\n\tif (!id) {\n\t\treturn null;\n\t}\n\tconst kind = isActorKind(candidate.kind) ? candidate.kind : \"system\";\n\tconst displayName =\n\t\ttypeof candidate.displayName === \"string\" && candidate.displayName.trim() !== \"\"\n\t\t\t? candidate.displayName\n\t\t\t: undefined;\n\treturn {\n\t\tid,\n\t\tkind,\n\t\tprovider: trimToNull(candidate.provider),\n\t\t...(displayName !== undefined ? { displayName } : {}),\n\t};\n}\n\n/** Serializes an `Actor` to a stable JSON string for durable storage. @internal */\nexport function serializeActor(actor: Actor): string {\n\treturn JSON.stringify({\n\t\tid: actor.id,\n\t\tkind: actor.kind,\n\t\tprovider: actor.provider,\n\t\t...(actor.displayName !== undefined ? { displayName: actor.displayName } : {}),\n\t});\n}\n\n/**\n * Parses a durable actor JSON value, falling back to `SYSTEM_ACTOR` when the\n * stored value is missing or malformed. Used when reading legacy rows that\n * predate actor attribution.\n */\n/** @internal */\nexport function parseActorOrSystem(value: string | null | undefined): Actor {\n\tif (value === null || value === undefined || value.trim() === \"\") {\n\t\treturn SYSTEM_ACTOR;\n\t}\n\ttry {\n\t\treturn normalizeActor(JSON.parse(value)) ?? SYSTEM_ACTOR;\n\t} catch {\n\t\treturn SYSTEM_ACTOR;\n\t}\n}\n\n/** Canonical serialized form of `SYSTEM_ACTOR`, used as the durable default. @internal */\nexport const SERIALIZED_SYSTEM_ACTOR = serializeActor(SYSTEM_ACTOR);\n","/** Dependency-first traversal; callers resolve missing and optional dependencies. @internal */\nexport function orderDependencies(\n\troots: Iterable<string>,\n\tdependencies: (id: string) => Iterable<string>,\n\tcycleMessage: (id: string) => string,\n): string[] {\n\tconst visiting = new Set<string>();\n\tconst ordered = new Set<string>();\n\tfunction visit(id: string): void {\n\t\tif (ordered.has(id)) return;\n\t\tif (visiting.has(id)) throw new Error(cycleMessage(id));\n\t\tvisiting.add(id);\n\t\tfor (const dependency of dependencies(id)) visit(dependency);\n\t\tvisiting.delete(id);\n\t\tordered.add(id);\n\t}\n\tfor (const id of roots) visit(id);\n\treturn [...ordered];\n}\n","import type { PreparedTurnStart } from \"./domain-model.js\";\n\n/** Completeness of one historical fact, independent of request/loading state. @internal */\nexport type InspectionEvidence<T> =\n\t| {\n\t\t\t/** @internal */\n\t\t\tstate: \"recorded\" | \"redacted\";\n\t\t\t/** @internal */\n\t\t\tvalue: T;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tstate: \"not_recorded\" | \"unavailable\" | \"not_applicable\";\n\t\t\t/** @internal */\n\t\t\treason: string;\n\t };\n\n/** Immutable version supplied to a worker, not a declaration of possible consumption. @internal */\nexport interface InspectionProduct {\n\t/** @internal */\n\tname: string;\n\t/** @internal */\n\tproducerTurnRecordId: string;\n\t/** @internal */\n\tentryId: string;\n\t/** @internal */\n\tcontent: InspectionEvidence<string>;\n}\n\n/** Model-facing content only. Renderer details and provider options are deliberately absent. @internal */\nexport interface InspectionMessage {\n\t/** Exact session identity when the conversion is unambiguous. @internal */\n\tentryId: string | null;\n\t/** @internal */\n\trole: string;\n\t/** @internal */\n\ttoolCallId?: string;\n\t/** @internal */\n\tcontent: InspectionEvidence<unknown>;\n}\n\n/** Captured at the Pi stream function after context conversion and tool assembly. @internal */\nexport interface InspectionModelInput {\n\t/** @internal */\n\tkind: \"model_input\";\n\t/** @internal */\n\tboundaryEntryId: string | null;\n\t/** @internal */\n\tmodel: {\n\t\t/** @internal */\n\t\tprovider: string;\n\t\t/** @internal */\n\t\tid: string;\n\t\t/** @internal */\n\t\tthinkingLevel: string | null;\n\t};\n\t/** @internal */\n\tsystemPrompt: InspectionEvidence<string>;\n\t/** @internal */\n\tappendedInstructions: InspectionEvidence<string[]>;\n\t/** @internal */\n\tcontextFiles: InspectionEvidence<\n\t\tArray<{\n\t\t\t/** @internal */\n\t\t\tpath: string;\n\t\t\t/** @internal */\n\t\t\tcontent: string;\n\t\t}>\n\t>;\n\t/** @internal */\n\ttools: InspectionEvidence<\n\t\tArray<{\n\t\t\t/** @internal */\n\t\t\tname: string;\n\t\t\t/** @internal */\n\t\t\tdescription: string;\n\t\t\t/** @internal */\n\t\t\tparameters: unknown;\n\t\t\t/** @internal */\n\t\t\tstrictSchema?: boolean;\n\t\t\t/** @internal */\n\t\t\tschemaEnforcement?: \"provider\" | \"server\";\n\t\t}>\n\t>;\n\t/** Ordered references are retained per call; immutable content is stored once. @internal */\n\tmessages: InspectionMessage[];\n}\n\n/** Versioned worker observation, correlated by the server to an accepted execution and lease. @internal */\nexport interface ExecutionInspectionCapture {\n\t/** Idempotency identity for this observation. @internal */\n\tid: string;\n\t/** @internal */\n\tversion: 1;\n\t/** @internal */\n\ttimestamp: string;\n\t/** @internal */\n\tfact:\n\t\t| InspectionModelInput\n\t\t| {\n\t\t\t\t/** @internal */\n\t\t\t\tkind: \"supplied_context\";\n\t\t\t\t/** @internal */\n\t\t\t\torigin: PreparedTurnStart | null;\n\t\t\t\t/** @internal */\n\t\t\t\tproducts: InspectionProduct[];\n\t\t }\n\t\t| {\n\t\t\t\t/** @internal */\n\t\t\t\tkind: \"product_consumed\";\n\t\t\t\t/** @internal */\n\t\t\t\tsupplyId: string;\n\t\t\t\t/** @internal */\n\t\t\t\tname: string;\n\t\t }\n\t\t| {\n\t\t\t\t/** @internal */\n\t\t\t\tkind: \"entry_link\";\n\t\t\t\t/** @internal */\n\t\t\t\tentryId: string;\n\t\t\t\t/** @internal */\n\t\t\t\tpiTurnId: string;\n\t\t\t\t/** @internal */\n\t\t\t\trole: string;\n\t\t };\n}\n\n/** Compact lineage evidence excludes retained content. @internal */\nexport interface InspectionContextObservation {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tturnRecordId: string;\n\t/** @internal */\n\tfact:\n\t\t| Exclude<\n\t\t\t\tExecutionInspectionCapture[\"fact\"],\n\t\t\t\tInspectionModelInput | { kind: \"supplied_context\" }\n\t\t >\n\t\t| {\n\t\t\t\t/** @internal */\n\t\t\t\tkind: \"supplied_context\";\n\t\t\t\t/** @internal */\n\t\t\t\torigin: PreparedTurnStart | null;\n\t\t\t\t/** @internal */\n\t\t\t\tproducts: Omit<InspectionProduct, \"content\">[];\n\t\t };\n}\n\n/** Server-owned persisted observation. @internal */\nexport interface ExecutionInspectionRecord extends ExecutionInspectionCapture {\n\t/** @internal */\n\tsequence: number;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tturnRecordId: string;\n\t/** @internal */\n\tstartRecordId: string;\n\t/** Physical reporter, which can differ from the original accepting lease. @internal */\n\tworkerLeaseId: string;\n}\n\n/** Redaction is retained as evidence, not silently presented as a complete capture. @internal */\nexport function redactInspectionEvidence<T>(value: T, redact: (text: string) => string): T {\n\tif (typeof value === \"string\") return redact(value) as T;\n\tif (Array.isArray(value)) return value.map((item) => redactInspectionEvidence(item, redact)) as T;\n\tif (!value || typeof value !== \"object\") return value;\n\tconst original = value as Record<string, unknown>;\n\tconst safe = Object.fromEntries(\n\t\tObject.entries(original).map(([key, item]) => [\n\t\t\tredact(key),\n\t\t\tredactInspectionEvidence(item, redact),\n\t\t]),\n\t);\n\tif (\n\t\toriginal.state === \"recorded\" &&\n\t\tJSON.stringify(original.value) !== JSON.stringify(safe.value)\n\t)\n\t\tsafe.state = \"redacted\";\n\treturn safe as T;\n}\n","/** Resolve a validated JSON Pointer through own properties only. @internal */\nexport function resolveJsonPointer(value: unknown, pointer: string): unknown {\n\tif (pointer === \"\") return value;\n\tfor (const token of pointer.slice(1).split(\"/\")) {\n\t\tconst key = token.replaceAll(\"~1\", \"/\").replaceAll(\"~0\", \"~\");\n\t\tif (!value || typeof value !== \"object\" || !Object.hasOwn(value, key)) return undefined;\n\t\tvalue = (value as Record<string, unknown>)[key];\n\t}\n\treturn value;\n}\n","/** @internal */\nexport const DEFAULT_LAUNCHER_RECENT_VALUE_LIMIT = 5;\n\nfunction hasCredentialBearingAbsoluteUrl(value: string): boolean {\n\tif (!/^[a-z][a-z0-9+.-]*:\\/\\//i.test(value)) {\n\t\treturn false;\n\t}\n\ttry {\n\t\tconst url = new URL(value);\n\t\treturn url.protocol !== \"file:\" && (url.username !== \"\" || url.password !== \"\");\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n/**\n * Strip any embedded credentials (`user:pass@`) from an absolute non-`file:` URL,\n * returning the value unchanged when it is not such a URL.\n */\n/** @internal */\nexport function redactCredentialBearingAbsoluteUrl(value: string): string {\n\tif (!hasCredentialBearingAbsoluteUrl(value)) {\n\t\treturn value;\n\t}\n\tconst url = new URL(value);\n\turl.username = \"\";\n\turl.password = \"\";\n\treturn url.toString();\n}\n\n/** @internal */\nexport function normalizeLauncherRecentValue(value: unknown): string | null {\n\tconst normalizedValue = typeof value === \"string\" ? value.trim() : \"\";\n\tif (!normalizedValue || hasCredentialBearingAbsoluteUrl(normalizedValue)) {\n\t\treturn null;\n\t}\n\treturn normalizedValue;\n}\n\n/** @internal */\nexport function normalizeLauncherRecentValues(\n\tvalues: readonly unknown[],\n\tlimit = DEFAULT_LAUNCHER_RECENT_VALUE_LIMIT,\n): string[] {\n\tconst nextValues = new Set<string>();\n\tfor (const value of values) {\n\t\tconst normalizedValue = normalizeLauncherRecentValue(value);\n\t\tif (!normalizedValue || nextValues.has(normalizedValue)) {\n\t\t\tcontinue;\n\t\t}\n\t\tnextValues.add(normalizedValue);\n\t\tif (nextValues.size >= limit) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn [...nextValues];\n}\n\n/** @internal */\nexport function addLauncherRecentValue(\n\texistingValues: readonly string[],\n\tvalue: string,\n\tlimit = DEFAULT_LAUNCHER_RECENT_VALUE_LIMIT,\n): string[] {\n\tconst normalizedValue = normalizeLauncherRecentValue(value);\n\tif (!normalizedValue) {\n\t\treturn normalizeLauncherRecentValues(existingValues, limit);\n\t}\n\treturn normalizeLauncherRecentValues([normalizedValue, ...existingValues], limit);\n}\n","/** @internal */\nexport function normalizeMarkdownLineEndings(markdown: string): string {\n\treturn markdown.replace(/\\r\\n?/g, \"\\n\");\n}\n\n/** @internal */\nexport function normalizeMarkdownText(markdown: string): string {\n\treturn normalizeMarkdownLineEndings(markdown).trim();\n}\n\n/** @internal */\nexport function normalizeOptionalMarkdown(value: unknown): string | null {\n\tif (typeof value !== \"string\") {\n\t\treturn null;\n\t}\n\tconst normalized = normalizeMarkdownText(value);\n\treturn normalized === \"\" ? null : normalized;\n}\n","/** Accept finite numbers and non-blank numeric strings, without coercing other values. @internal */\nexport function readFiniteNumber(value: unknown): number | null {\n\tif (typeof value === \"number\" && Number.isFinite(value)) {\n\t\treturn value;\n\t}\n\tif (typeof value === \"string\" && value.trim() !== \"\") {\n\t\tconst parsed = Number(value);\n\t\treturn Number.isFinite(parsed) ? parsed : null;\n\t}\n\treturn null;\n}\n","import * as v from \"valibot\";\nimport { trimToNull } from \"./string-normalize.js\";\n\n/** @internal */\nexport interface InstanceTurnConfigInput {\n\t/** @internal */\n\tmodelProfileId?: string | null;\n}\n\n/** @internal */\nexport type InstanceTurnConfigMap = Record<string, InstanceTurnConfigInput>;\n\n/** @public */\nexport interface LaunchModelConfigInput {\n\t/** @internal */\n\tdefaultModelProfileId?: string | null;\n\t/** @internal */\n\tturnConfigs?: InstanceTurnConfigMap;\n}\n\n/** @internal */\nexport interface InstanceTurnConfigsJsonError {\n\t/** @internal */\n\tcode: \"invalid_turn_configs_json\";\n\t/** @internal */\n\tprocessId: string;\n\t/** @internal */\n\treason: \"invalid_json\" | \"not_object\" | \"turn_config_not_object\";\n\t/** @internal */\n\tturnId?: string;\n}\n\nconst jsonObjectSchema = v.custom<Record<string, unknown>>(\n\t(value): value is Record<string, unknown> =>\n\t\ttypeof value === \"object\" && value !== null && !Array.isArray(value),\n\t\"Expected object\",\n);\n\nconst instanceTurnConfigSchema = v.pipe(\n\tjsonObjectSchema,\n\tv.object({\n\t\tmodelProfileId: v.optional(v.unknown()),\n\t}),\n);\n\nconst strictInstanceTurnConfigsJsonSchema = v.pipe(\n\tv.string(),\n\tv.parseJson(),\n\tjsonObjectSchema,\n\tv.record(v.string(), instanceTurnConfigSchema),\n);\n\nfunction normalizeInstanceTurnConfigs(\n\tturnConfigs: Record<string, { modelProfileId?: unknown }>,\n): InstanceTurnConfigMap {\n\tconst next: InstanceTurnConfigMap = {};\n\tfor (const [turnId, turnConfig] of Object.entries(turnConfigs)) {\n\t\tconst modelProfileId = trimToNull(turnConfig.modelProfileId);\n\t\tnext[turnId] = modelProfileId ? { modelProfileId } : {};\n\t}\n\treturn next;\n}\n\nfunction getFirstIssuePathKey(issue: v.BaseIssue<unknown>): string | undefined {\n\tconst pathItem = issue.path?.[0] as { key?: unknown } | undefined;\n\treturn typeof pathItem?.key === \"string\" ? pathItem.key : undefined;\n}\n\n/** @internal */\nexport function parseStrictInstanceTurnConfigsJson(\n\tprocessId: string,\n\tturnConfigsJson: string | null | undefined,\n):\n\t| {\n\t\t\t/** @internal */\n\t\t\tok: true;\n\t\t\t/** @internal */\n\t\t\tvalue: InstanceTurnConfigMap;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tok: false;\n\t\t\t/** @internal */\n\t\t\terror: InstanceTurnConfigsJsonError;\n\t } {\n\tif (!turnConfigsJson) return { ok: true, value: {} };\n\tconst result = v.safeParse(strictInstanceTurnConfigsJsonSchema, turnConfigsJson, {\n\t\tabortEarly: true,\n\t});\n\tif (!result.success) {\n\t\tconst issue = result.issues[0];\n\t\tif (issue?.type === \"parse_json\") {\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: { code: \"invalid_turn_configs_json\", processId, reason: \"invalid_json\" },\n\t\t\t};\n\t\t}\n\t\tconst turnId = issue ? getFirstIssuePathKey(issue) : undefined;\n\t\treturn {\n\t\t\tok: false,\n\t\t\terror: {\n\t\t\t\tcode: \"invalid_turn_configs_json\",\n\t\t\t\tprocessId,\n\t\t\t\treason: turnId !== undefined ? \"turn_config_not_object\" : \"not_object\",\n\t\t\t\t...(turnId !== undefined ? { turnId } : {}),\n\t\t\t},\n\t\t};\n\t}\n\treturn { ok: true, value: normalizeInstanceTurnConfigs(result.output) };\n}\n\n/** @internal */\nexport function serializeInstanceTurnConfigs(turnConfigs: InstanceTurnConfigMap): string | null {\n\tconst normalizedEntries = Object.entries(turnConfigs)\n\t\t.map(([turnId, turnConfig]) => {\n\t\t\tconst modelProfileId = trimToNull(turnConfig.modelProfileId);\n\t\t\treturn [turnId, modelProfileId ? { modelProfileId } : {}] as const;\n\t\t})\n\t\t.filter(([, turnConfig]) => Object.keys(turnConfig).length > 0);\n\treturn normalizedEntries.length === 0\n\t\t? null\n\t\t: JSON.stringify(Object.fromEntries(normalizedEntries));\n}\n\n/** @internal */\nexport function normalizeLaunchModelConfigInput(\n\tinput: LaunchModelConfigInput,\n): LaunchModelConfigInput {\n\tconst defaultModelProfileId = trimToNull(input.defaultModelProfileId);\n\tconst nextTurnConfigs: InstanceTurnConfigMap = {};\n\tfor (const [turnId, turnConfig] of Object.entries(input.turnConfigs ?? {})) {\n\t\tconst modelProfileId = trimToNull(turnConfig.modelProfileId);\n\t\tif (modelProfileId) nextTurnConfigs[turnId] = { modelProfileId };\n\t}\n\treturn { defaultModelProfileId, turnConfigs: nextTurnConfigs };\n}\n","import type { TurnId } from \"./domain-model.js\";\n\n/** Breadth-first path in declaration order; null marks success. Returns [entry] without success. @internal */\nexport function shortestSuccessfulTurnPath(\n\tentry: TurnId,\n\toutgoing: (id: TurnId) => Iterable<TurnId | null>,\n): TurnId[] {\n\tconst parents = new Map<TurnId, TurnId | null>([[entry, null]]);\n\tfor (const id of parents.keys()) {\n\t\tfor (const next of outgoing(id)) {\n\t\t\tif (next === null) {\n\t\t\t\tconst path: TurnId[] = [];\n\t\t\t\tlet cursor: TurnId | null = id;\n\t\t\t\twhile (cursor !== null) {\n\t\t\t\t\tpath.push(cursor);\n\t\t\t\t\tcursor = parents.get(cursor) ?? null;\n\t\t\t\t}\n\t\t\t\treturn path.reverse();\n\t\t\t}\n\t\t\tif (parents.has(next)) continue;\n\t\t\tparents.set(next, id);\n\t\t}\n\t}\n\treturn [entry];\n}\n","import type { ProcessInstance, ProcessLifecycleStatus, ProcessProject } from \"./domain-model.js\";\n\n/** @internal */\nexport interface ProcessRowSlot {\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tprocessId: string;\n\t/** @internal */\n\ttitle: string;\n\t/** @internal */\n\tsubtitle: string;\n\t/** @internal */\n\tselectedTurnId: string | null;\n\t/** @internal */\n\tlifecycleStatus: ProcessLifecycleStatus;\n\t/** @internal */\n\tstatusCategory: \"error\" | \"active\" | \"waiting\" | \"terminal\" | \"discovered\";\n\t/** @internal */\n\tprojectCount: number;\n\t/** @internal */\n\texternalId: string | null;\n\t/** @internal */\n\texternalLinkCount: number;\n}\n\n/** @internal */\nexport function getProcessStatusCategory(\n\tlifecycleStatus: ProcessLifecycleStatus,\n): ProcessRowSlot[\"statusCategory\"] {\n\tif (lifecycleStatus === \"error\") return \"error\";\n\tif (lifecycleStatus === \"active\") return \"active\";\n\tif (lifecycleStatus === \"waiting\") return \"waiting\";\n\tif (lifecycleStatus === \"completed\" || lifecycleStatus === \"aborted\") return \"terminal\";\n\treturn \"discovered\";\n}\n\n/** @internal */\nexport function buildProcessRowSlot(\n\tprocess: ProcessInstance,\n\tprojects: ReadonlyArray<ProcessProject>,\n): ProcessRowSlot {\n\tconst externalLinkCount = projects.filter((p) => p.externalId !== null).length;\n\n\tconst title = process.title ?? process.externalId ?? process.id;\n\tconst subtitle = `${process.processId} \\u00b7 ${projects.length} component${projects.length !== 1 ? \"s\" : \"\"}`;\n\n\treturn {\n\t\tinstanceId: process.id,\n\t\tprocessId: process.processId,\n\t\ttitle,\n\t\tsubtitle,\n\t\tselectedTurnId: process.selectedTurnId,\n\t\tlifecycleStatus: process.lifecycleStatus,\n\t\tstatusCategory: getProcessStatusCategory(process.lifecycleStatus),\n\t\tprojectCount: projects.length,\n\t\texternalId: process.externalId,\n\t\texternalLinkCount,\n\t};\n}\n\n/** @internal */\nexport function sortProcessRows(rows: ProcessRowSlot[]): ProcessRowSlot[] {\n\tconst categoryOrder: Record<string, number> = {\n\t\terror: 0,\n\t\tactive: 1,\n\t\twaiting: 2,\n\t\tdiscovered: 3,\n\t\tterminal: 4,\n\t};\n\n\treturn [...rows].sort((a, b) => {\n\t\tconst catA = categoryOrder[a.statusCategory] ?? 4;\n\t\tconst catB = categoryOrder[b.statusCategory] ?? 4;\n\t\tif (catA !== catB) return catA - catB;\n\t\treturn a.title.localeCompare(b.title);\n\t});\n}\n","import * as v from \"valibot\";\n\n/** Parse non-array objects into a fresh record using Valibot's key handling. @internal */\nexport const copiedUnknownRecordSchema = v.pipe(\n\tv.unknown(),\n\tv.check(isUnknownRecord, \"Expected object\"),\n\tv.record(v.string(), v.unknown()),\n);\n\n/** @internal */\nexport function isUnknownRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/** @internal */\nexport function asUnknownRecord(value: unknown): Record<string, unknown> | null {\n\treturn isUnknownRecord(value) ? value : null;\n}\n","import { trimToNull } from \"./string-normalize.js\";\nimport { asUnknownRecord, isUnknownRecord } from \"./unknown-record.js\";\n\n/** @public */\nexport const PROCESS_SEMANTIC_ENTRY_REF_KEYS = [\n\t\"plan\",\n\t\"review\",\n\t\"currentPrimaryPathLeaf\",\n\t\"rootEntry\",\n] as const;\n\n/** @public */\nexport type ProcessSemanticEntryRefKey = (typeof PROCESS_SEMANTIC_ENTRY_REF_KEYS)[number];\n\n/** @internal */\nexport interface SemanticEntryRef {\n\t/** @internal */\n\tentryId: string;\n\t/** @internal */\n\tturnRecordId: string | null;\n}\n\n/** @internal */\nexport function areSemanticEntryRefsEqual(\n\tleft: SemanticEntryRef | null | undefined,\n\tright: SemanticEntryRef | null | undefined,\n): boolean {\n\treturn (\n\t\t(left?.entryId ?? null) === (right?.entryId ?? null) &&\n\t\t(left?.turnRecordId ?? null) === (right?.turnRecordId ?? null)\n\t);\n}\n\n/** @internal */\nexport type ProcessProductRef = SemanticEntryRef;\n/** @internal */\nexport type ProcessProductRefs = Record<string, ProcessProductRef>;\n\nconst PRODUCT_NAME_PATTERN = /^[a-z][a-z0-9-]*$/;\n\n/** @internal */\nexport function isValidProcessProductName(value: string): boolean {\n\treturn PRODUCT_NAME_PATTERN.test(value);\n}\n\n/** @internal */\nexport function assertValidProcessProductName(value: string): void {\n\tif (!isValidProcessProductName(value)) {\n\t\tthrow new Error(\n\t\t\t`Invalid process product name '${value}'. Product names must match ${PRODUCT_NAME_PATTERN.source}`,\n\t\t);\n\t}\n}\n\n/**\n * Stage 2 keeps these refs as structural placeholders initialized to `null`.\n * Current runtime population:\n * - `rootEntry` during worker bootstrap and subsequent worker tree-fact reporting\n * - `currentPrimaryPathLeaf` during worker bootstrap, successful primary turns,\n * and prompt-style primary-path input delivery\n * - `plan` during successful planning turns; it remains the current plan through\n * implementation until another planning turn replaces it\n * - `review` during successful review turns; it remains the current review until\n * another review turn replaces it\n */\n/** @internal */\nexport interface ProcessSemanticEntryRefs {\n\t/** @internal */\n\tplan: SemanticEntryRef | null;\n\t/** @internal */\n\treview: SemanticEntryRef | null;\n\t/** @internal */\n\tcurrentPrimaryPathLeaf: SemanticEntryRef | null;\n\t/** @internal */\n\trootEntry: SemanticEntryRef | null;\n}\n\n/** @internal */\nexport function isProcessSemanticEntryRefKey(value: string): value is ProcessSemanticEntryRefKey {\n\treturn (PROCESS_SEMANTIC_ENTRY_REF_KEYS as readonly string[]).includes(value);\n}\n\n/** @internal */\nexport function parseSemanticEntryRef(value: unknown): SemanticEntryRef | null {\n\tconst record = asUnknownRecord(value);\n\tconst entryId = trimToNull(record?.entryId);\n\tif (!entryId) {\n\t\treturn null;\n\t}\n\treturn {\n\t\tentryId,\n\t\tturnRecordId: trimToNull(record?.turnRecordId),\n\t};\n}\n\n/** @internal */\nexport function createEmptyProcessSemanticEntryRefs(): ProcessSemanticEntryRefs {\n\treturn {\n\t\tplan: null,\n\t\treview: null,\n\t\tcurrentPrimaryPathLeaf: null,\n\t\trootEntry: null,\n\t};\n}\n\n/** @internal */\nexport function createEmptyProcessProductRefs(): ProcessProductRefs {\n\treturn {};\n}\n\n/** @internal */\nexport function parseProcessProductRefs(value: unknown): ProcessProductRefs {\n\tif (!isUnknownRecord(value)) return createEmptyProcessProductRefs();\n\tconst refs: ProcessProductRefs = {};\n\tfor (const [name, rawRef] of Object.entries(value)) {\n\t\tif (!isValidProcessProductName(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst ref = parseSemanticEntryRef(rawRef);\n\t\tif (ref) {\n\t\t\trefs[name] = ref;\n\t\t}\n\t}\n\treturn refs;\n}\n\n/** @internal */\nexport function parseProcessSemanticEntryRefs(value: unknown): ProcessSemanticEntryRefs {\n\tconst record = asUnknownRecord(value) ?? {};\n\treturn {\n\t\tplan: parseSemanticEntryRef(record.plan),\n\t\treview: parseSemanticEntryRef(record.review),\n\t\tcurrentPrimaryPathLeaf: parseSemanticEntryRef(record.currentPrimaryPathLeaf),\n\t\trootEntry: parseSemanticEntryRef(record.rootEntry),\n\t};\n}\n","import {\n\tcreateEmptyProcessProductRefs,\n\tcreateEmptyProcessSemanticEntryRefs,\n\tisValidProcessProductName,\n\ttype ProcessProductRefs,\n\ttype ProcessSemanticEntryRefs,\n\tparseProcessSemanticEntryRefs,\n\tparseSemanticEntryRef,\n} from \"./semantic-entry-refs.js\";\n\n/** @internal */\nexport interface ProcessStateJsonParseContext {\n\t/** @internal */\n\tlabel?: string;\n\t/** @internal */\n\tprocessId?: string;\n}\n\nfunction formatMalformedSubject(\n\tdefaultLabel: string,\n\tcontext: string | ProcessStateJsonParseContext | undefined,\n): string {\n\tif (typeof context === \"string\") {\n\t\treturn context;\n\t}\n\tconst label = context?.label ?? defaultLabel;\n\treturn context?.processId ? `${label} for process '${context.processId}'` : label;\n}\n\n/** @internal */\nexport function parseProcessStateJsonStrict(\n\tstateJson: string | null | undefined,\n\tcontext?: string | ProcessStateJsonParseContext,\n): Record<string, unknown> {\n\tif (!stateJson) {\n\t\treturn {};\n\t}\n\tconst subject = formatMalformedSubject(\"stateJson\", context);\n\tlet parsed: unknown;\n\ttry {\n\t\tparsed = JSON.parse(stateJson);\n\t} catch (error) {\n\t\tthrow new Error(\n\t\t\t`Malformed ${subject}: ${error instanceof Error ? error.message : String(error)}`,\n\t\t);\n\t}\n\tif (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n\t\tthrow new Error(`Malformed ${subject}: expected a JSON object`);\n\t}\n\treturn parsed as Record<string, unknown>;\n}\n\n/** @internal */\nexport function parseProcessStateJsonLenient(\n\tstateJson: string | null | undefined,\n): Record<string, unknown> {\n\ttry {\n\t\treturn parseProcessStateJsonStrict(stateJson);\n\t} catch {\n\t\treturn {};\n\t}\n}\n\n/** @internal */\nexport function parseSemanticEntryRefsStrict(\n\tvalue: unknown,\n\tcontext?: ProcessStateJsonParseContext,\n): ProcessSemanticEntryRefs {\n\tif (value === undefined) {\n\t\treturn createEmptyProcessSemanticEntryRefs();\n\t}\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n\t\tthrow new Error(\n\t\t\t`Malformed ${formatMalformedSubject(\"semanticEntryRefs\", {\n\t\t\t\tlabel: \"semanticEntryRefs\",\n\t\t\t\tprocessId: context?.processId,\n\t\t\t})}: expected an object when present`,\n\t\t);\n\t}\n\treturn parseProcessSemanticEntryRefs(value);\n}\n\n/** @internal */\nexport function parseSemanticEntryRefsLenient(value: unknown): ProcessSemanticEntryRefs {\n\ttry {\n\t\treturn parseSemanticEntryRefsStrict(value);\n\t} catch {\n\t\treturn createEmptyProcessSemanticEntryRefs();\n\t}\n}\n\n/** @internal */\nexport function parseProductRefsStrict(\n\tvalue: unknown,\n\tcontext?: ProcessStateJsonParseContext,\n): ProcessProductRefs {\n\tif (value === undefined) {\n\t\treturn createEmptyProcessProductRefs();\n\t}\n\tconst subject = formatMalformedSubject(\"productRefs\", {\n\t\tlabel: \"productRefs\",\n\t\tprocessId: context?.processId,\n\t});\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n\t\tthrow new Error(`Malformed ${subject}: expected an object when present`);\n\t}\n\tconst refs: ProcessProductRefs = {};\n\tfor (const [name, rawRef] of Object.entries(value as Record<string, unknown>)) {\n\t\tif (!isValidProcessProductName(name)) {\n\t\t\tthrow new Error(`Malformed ${subject}: invalid product name '${name}'`);\n\t\t}\n\t\tconst ref = parseSemanticEntryRef(rawRef);\n\t\tif (!ref) {\n\t\t\tthrow new Error(`Malformed ${subject}: product '${name}' must reference an entry`);\n\t\t}\n\t\trefs[name] = ref;\n\t}\n\treturn refs;\n}\n\n/** @internal */\nexport function parseProductRefsLenient(value: unknown): ProcessProductRefs {\n\ttry {\n\t\treturn parseProductRefsStrict(value);\n\t} catch {\n\t\treturn createEmptyProcessProductRefs();\n\t}\n}\n\n/** @internal */\nexport function parseSemanticEntryRefsFromStateJsonStrict(\n\tstateJson: string | null | undefined,\n\tcontext?: string | ProcessStateJsonParseContext,\n): ProcessSemanticEntryRefs {\n\tconst stateRecord = parseProcessStateJsonStrict(stateJson, context);\n\treturn parseSemanticEntryRefsStrict(\n\t\tstateRecord.semanticEntryRefs,\n\t\ttypeof context === \"string\" ? undefined : context,\n\t);\n}\n\n/** @internal */\nexport function parseSemanticEntryRefsFromStateJsonLenient(\n\tstateJson: string | null | undefined,\n): ProcessSemanticEntryRefs {\n\tconst stateRecord = parseProcessStateJsonLenient(stateJson);\n\treturn parseSemanticEntryRefsLenient(stateRecord.semanticEntryRefs);\n}\n\n/** @internal */\nexport function parseProductRefsFromStateJsonStrict(\n\tstateJson: string | null | undefined,\n\tcontext?: string | ProcessStateJsonParseContext,\n): ProcessProductRefs {\n\tconst stateRecord = parseProcessStateJsonStrict(stateJson, context);\n\treturn parseProductRefsStrict(\n\t\tstateRecord.productRefs,\n\t\ttypeof context === \"string\" ? undefined : context,\n\t);\n}\n\n/** @internal */\nexport function parseProductRefsFromStateJsonLenient(\n\tstateJson: string | null | undefined,\n): ProcessProductRefs {\n\tconst stateRecord = parseProcessStateJsonLenient(stateJson);\n\treturn parseProductRefsLenient(stateRecord.productRefs);\n}\n","/** @internal */\nexport type RepoLocatorKind = \"remote_url\" | \"local_path\";\n\n/** @internal */\nexport interface ParsedRepoLocator {\n\t/** @internal */\n\tkind: RepoLocatorKind;\n\t/** @internal */\n\tvalue: string;\n}\n\nfunction isFileUrl(value: string): boolean {\n\ttry {\n\t\tconst url = new URL(value);\n\t\tif (url.protocol !== \"file:\") {\n\t\t\treturn false;\n\t\t}\n\t\treturn (\n\t\t\t(url.hostname === \"\" || url.hostname === \"localhost\") &&\n\t\t\turl.pathname.startsWith(\"/\") &&\n\t\t\tdecodeURIComponent(url.pathname).length > 1\n\t\t);\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction isLocalFilesystemPath(value: string): boolean {\n\treturn (\n\t\tvalue.startsWith(\"/\") ||\n\t\tvalue.startsWith(\"./\") ||\n\t\tvalue.startsWith(\"../\") ||\n\t\tvalue.startsWith(\"~/\") ||\n\t\tisFileUrl(value)\n\t);\n}\n\nconst scpLikeGitUrlPattern = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+:[^\\s]+$/;\nconst explicitRemoteGitUrlPattern = /^(?:https?|ssh|git):\\/\\//;\n\nfunction hasRepositoryPath(pathname: string): boolean {\n\treturn pathname.split(\"/\").filter(Boolean).length >= 1;\n}\n\nfunction isRemoteGitUrl(value: string): boolean {\n\tif (scpLikeGitUrlPattern.test(value)) {\n\t\tconst path = value.slice(value.indexOf(\":\") + 1);\n\t\treturn hasRepositoryPath(path);\n\t}\n\tif (!explicitRemoteGitUrlPattern.test(value)) {\n\t\treturn false;\n\t}\n\ttry {\n\t\tconst url = new URL(value);\n\t\treturn (\n\t\t\t[\"http:\", \"https:\", \"ssh:\", \"git:\"].includes(url.protocol) &&\n\t\t\t!!url.hostname &&\n\t\t\thasRepositoryPath(url.pathname)\n\t\t);\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n/** @internal */\nexport function detectRepoLocatorKind(value: string): RepoLocatorKind | null {\n\tconst trimmed = value.trim();\n\tif (trimmed.length === 0) {\n\t\treturn null;\n\t}\n\tif (isLocalFilesystemPath(trimmed)) {\n\t\treturn \"local_path\";\n\t}\n\tif (isRemoteGitUrl(trimmed)) {\n\t\treturn \"remote_url\";\n\t}\n\treturn null;\n}\n\n/** @internal */\nexport function parseRepoLocator(value: unknown): ParsedRepoLocator | null {\n\tif (typeof value !== \"string\") {\n\t\treturn null;\n\t}\n\tconst trimmed = value.trim();\n\tconst kind = detectRepoLocatorKind(trimmed);\n\tif (!kind) {\n\t\treturn null;\n\t}\n\treturn { kind, value: trimmed };\n}\n\n/** @internal */\nexport function isRepoLocator(value: unknown): value is string {\n\treturn parseRepoLocator(value) !== null;\n}\n\n/** @internal */\nexport function assertRepoLocator(value: unknown, fieldName = \"repoLocator\"): string {\n\tconst parsed = parseRepoLocator(value);\n\tif (!parsed) {\n\t\tthrow new Error(`${fieldName} must be a remote URL or local filesystem path`);\n\t}\n\treturn parsed.value;\n}\n","/** First server receipt of a physical worker startup milestone. @internal */\nexport type StartupMilestone =\n\t| \"pvc_requested\"\n\t| \"pvc_acknowledged\"\n\t| \"pvc_bound\"\n\t| \"pod_requested\"\n\t| \"pod_acknowledged\"\n\t| \"pod_created\"\n\t| \"pod_scheduled\"\n\t| \"image_pull_started\"\n\t| \"image_pull_finished\"\n\t| \"image_cached\"\n\t| \"container_started\"\n\t| \"prompt_started\"\n\t| \"first_text\";\n/** @internal */\nexport interface StartupObservation {\n\t/** @internal */\n\tworkerLeaseId: string;\n\t/** @internal */\n\tmilestone: StartupMilestone;\n\t/** @internal */\n\tobservedAt: string;\n\t/** @internal */\n\tsourceAt: string | null;\n\t/** @internal */\n\tsourceKind: \"server\" | \"kubernetes_status\" | \"kubernetes_event\";\n\t/** @internal */\n\tobjectUid: string | null;\n\t/** @internal */\n\tturnRecordId: string | null;\n\t/** Sampling lower bound, never an exact binding timestamp. @internal */\n\tnotBefore: string | null;\n\t/** @internal */\n\tmetadata: {\n\t\t/** @internal */\n\t\tnode?: string;\n\t\t/** @internal */\n\t\timageId?: string;\n\t\t/** @internal */\n\t\timage?: string;\n\t\t/** @internal */\n\t\tstorageClass?: string;\n\t\t/** @internal */\n\t\tcpu?: string;\n\t\t/** @internal */\n\t\tmemory?: string;\n\t\t/** @internal */\n\t\tnamespace?: string;\n\t\t/** @internal */\n\t\tpodName?: string;\n\t\t/** @internal */\n\t\tprecision?: \"milliseconds\" | \"microseconds\" | \"seconds\" | \"sampling_interval\";\n\t};\n}\n/** @internal */\nexport interface StartupInterval {\n\t/** @internal */\n\tstart: string | null;\n\t/** @internal */\n\tend: string | null;\n\t/** @internal */\n\tdurationMs: number | null;\n\t/** @internal */\n\tstatus: \"available\" | \"missing\" | \"invalid_order\";\n\t/** @internal */\n\tclock: \"server\" | \"kubernetes\";\n}\n/** @internal */\nexport function startupInterval(\n\tstart: string | null | undefined,\n\tend: string | null | undefined,\n\tclock: StartupInterval[\"clock\"] = \"server\",\n): StartupInterval {\n\tconst delta = start && end ? Date.parse(end) - Date.parse(start) : NaN;\n\tconst status =\n\t\t!start || !end\n\t\t\t? \"missing\"\n\t\t\t: !Number.isFinite(delta) || delta < 0\n\t\t\t\t? \"invalid_order\"\n\t\t\t\t: \"available\";\n\treturn {\n\t\tstart: start ?? null,\n\t\tend: end ?? null,\n\t\tdurationMs: status === \"available\" ? delta : null,\n\t\tstatus,\n\t\tclock,\n\t};\n}\n/** @internal */\nexport interface PhysicalWorkerStart {\n\t/** @internal */\n\tworkerLeaseId: string;\n\t/** @internal */\n\tworkerId: string;\n\t/** @internal */\n\tturnStartRecordId: string | null;\n\t/** @internal */\n\tturnRecordId: string | null;\n\t/** @internal */\n\tstate: string;\n\t/** @internal */\n\tobservations: StartupObservation[];\n\t/** @internal */\n\tintervals: Record<string, StartupInterval>;\n}\n","import {\n\tisProcessSemanticEntryRefKey,\n\ttype ProcessSemanticEntryRefKey,\n} from \"./semantic-entry-refs.js\";\nimport { trimToNull } from \"./string-normalize.js\";\n\n/** @internal */\nexport const TURN_ANNOTATION_REFERENCE_KINDS = [\n\t\"turn_record\",\n\t\"entry\",\n\t\"semantic_entry_ref\",\n] as const;\n\n/** @internal */\nexport type TurnAnnotationReferenceKind = (typeof TURN_ANNOTATION_REFERENCE_KINDS)[number];\n/** @internal */\nexport type TurnAnnotationReferenceRole = string;\n\n/** @internal */\nexport interface TurnRecordAnnotationReference {\n\t/** @internal */\n\tkind: \"turn_record\";\n\t/** @internal */\n\tturnRecordId: string;\n\t/** @internal */\n\trole: TurnAnnotationReferenceRole | null;\n}\n\n/** @internal */\nexport interface EntryTurnAnnotationReference {\n\t/** @internal */\n\tkind: \"entry\";\n\t/** @internal */\n\tentryId: string;\n\t/** @internal */\n\trole: TurnAnnotationReferenceRole | null;\n}\n\n/** @internal */\nexport interface SemanticEntryRefTurnAnnotationReference {\n\t/** @internal */\n\tkind: \"semantic_entry_ref\";\n\t/** @internal */\n\tref: ProcessSemanticEntryRefKey;\n\t/** @internal */\n\trole: TurnAnnotationReferenceRole | null;\n}\n\n/** @internal */\nexport type TurnAnnotationReference =\n\t| TurnRecordAnnotationReference\n\t| EntryTurnAnnotationReference\n\t| SemanticEntryRefTurnAnnotationReference;\n\n/** @internal */\nexport interface ProcessTurnAnnotation {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tannotationType: string;\n\t/** @internal */\n\tannotationKey: string | null;\n\t/** @internal */\n\treferences: TurnAnnotationReference[];\n\t/** @internal */\n\tpayload: Record<string, unknown>;\n\t/** @internal */\n\tcreatedAt: string;\n\t/** @internal */\n\tupdatedAt: string;\n}\n\n/** @internal */\nexport function parseTurnAnnotationReference(value: unknown): TurnAnnotationReference | null {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n\t\treturn null;\n\t}\n\tconst record = value as Record<string, unknown>;\n\tconst kind = trimToNull(record.kind);\n\tconst role = trimToNull(record.role);\n\tif (kind === \"turn_record\") {\n\t\tconst turnRecordId = trimToNull(record.turnRecordId);\n\t\treturn turnRecordId ? { kind, turnRecordId, role } : null;\n\t}\n\tif (kind === \"entry\") {\n\t\tconst entryId = trimToNull(record.entryId);\n\t\treturn entryId ? { kind, entryId, role } : null;\n\t}\n\tif (kind === \"semantic_entry_ref\") {\n\t\tconst ref = trimToNull(record.ref);\n\t\treturn ref && isProcessSemanticEntryRefKey(ref) ? { kind, ref, role } : null;\n\t}\n\treturn null;\n}\n\n/** @internal */\nexport function parseTurnAnnotationReferences(value: unknown): TurnAnnotationReference[] {\n\tif (!Array.isArray(value)) {\n\t\treturn [];\n\t}\n\treturn value\n\t\t.map(parseTurnAnnotationReference)\n\t\t.filter((reference): reference is TurnAnnotationReference => reference !== null);\n}\n","import { normalizeStringArray, trimToNull } from \"./string-normalize.js\";\nimport { isUnknownRecord as isRecord } from \"./unknown-record.js\";\n\n/** @internal */\nexport const DEFAULT_CONTINUE_PROMPT = \"continue\";\n\n/** @internal */\nexport const FAILED_TURN_RECOVERY_CODES = [\n\t\"generic_continue\",\n\t\"outcome_rejected\",\n\t\"missing_outcome_tool\",\n\t\"missing_markdown_result\",\n\t\"missing_required_tool_calls\",\n] as const;\n\n/** @internal */\nexport type FailedTurnRecoveryCode = (typeof FAILED_TURN_RECOVERY_CODES)[number];\n\n/** @internal */\nexport interface FailedTurnRecoveryContext {\n\t/** @internal */\n\tstrategy: \"continue\";\n\t/** @internal */\n\tsuggestedContinuePrompt: string;\n\t/** @internal */\n\tfailureCode: FailedTurnRecoveryCode;\n\t/** @internal */\n\tmissingToolNames?: string[];\n}\n\n/** @internal */\nexport type FailedTurnRecoveryOverrides = Partial<Omit<FailedTurnRecoveryContext, \"strategy\">>;\n\n/** @internal */\nexport const FAILED_TURN_RECOVERY_METADATA_KEY = \"failedTurnRecovery\";\n/** @internal */\nexport const CONTINUE_PROMPT_METADATA_KEY = \"continuePrompt\";\nconst TERMINAL_OUTCOME_RECORDING_FAILURE_PREFIX =\n\t\"Server could not durably record worker turn outcome:\";\n\n/** @internal */\nexport function isFailedTurnRecoveryCode(value: string): value is FailedTurnRecoveryCode {\n\treturn (FAILED_TURN_RECOVERY_CODES as readonly string[]).includes(value);\n}\n\nfunction normalizeUniqueStringArray(value: unknown): string[] | undefined {\n\tconst normalized = normalizeStringArray(value);\n\treturn normalized.length > 0 ? [...new Set(normalized)] : undefined;\n}\n\nexport { trimToNull as normalizeContinuePrompt };\n\n/** @internal */\nexport function createGenericFailedTurnRecoveryContext(\n\toverrides: FailedTurnRecoveryOverrides = {},\n): FailedTurnRecoveryContext {\n\treturn {\n\t\tstrategy: \"continue\",\n\t\tsuggestedContinuePrompt: DEFAULT_CONTINUE_PROMPT,\n\t\tfailureCode: \"generic_continue\",\n\t\t...overrides,\n\t};\n}\n\n/** @internal */\nexport function inferTerminalRecordingFailedTurnRecoveryContext(input: {\n\t/** @internal */\n\terrorSummary?: string | null;\n\t/** @internal */\n\terrorClass?: string | null;\n}): FailedTurnRecoveryContext | null {\n\tif (\n\t\tinput.errorClass !== \"infrastructure\" ||\n\t\t!input.errorSummary?.startsWith(TERMINAL_OUTCOME_RECORDING_FAILURE_PREFIX)\n\t) {\n\t\treturn null;\n\t}\n\treturn createGenericFailedTurnRecoveryContext();\n}\n\n/** @internal */\nexport function buildFailedTurnRecoveryMetadata(\n\tturnRecordId: string,\n\tcontext: FailedTurnRecoveryOverrides = {},\n) {\n\treturn {\n\t\t/** @internal */\n\t\t[FAILED_TURN_RECOVERY_METADATA_KEY]: {\n\t\t\t/** @internal */\n\t\t\tturnRecordId,\n\t\t\t...createGenericFailedTurnRecoveryContext(context),\n\t\t},\n\t};\n}\n\n/** @internal */\nexport function readFailedTurnRecoveryContext(\n\tmetadata: Record<string, unknown> | null | undefined,\n\texpectedTurnRecordId?: string | null,\n): FailedTurnRecoveryContext | null {\n\tif (!metadata) {\n\t\treturn null;\n\t}\n\tconst raw = metadata[FAILED_TURN_RECOVERY_METADATA_KEY];\n\tif (!isRecord(raw)) {\n\t\treturn null;\n\t}\n\tif (expectedTurnRecordId) {\n\t\tconst turnRecordId = trimToNull(raw.turnRecordId);\n\t\tif (turnRecordId !== expectedTurnRecordId) {\n\t\t\treturn null;\n\t\t}\n\t}\n\tif (raw.strategy !== \"continue\") {\n\t\treturn null;\n\t}\n\tconst suggestedContinuePrompt = trimToNull(raw.suggestedContinuePrompt);\n\tconst failureCode = trimToNull(raw.failureCode);\n\tif (!suggestedContinuePrompt || !failureCode || !isFailedTurnRecoveryCode(failureCode)) {\n\t\treturn null;\n\t}\n\tconst missingToolNames = normalizeUniqueStringArray(raw.missingToolNames);\n\treturn {\n\t\tstrategy: \"continue\",\n\t\tsuggestedContinuePrompt,\n\t\tfailureCode,\n\t\t...(missingToolNames ? { missingToolNames } : {}),\n\t};\n}\n","import type { ProcessTurnRecordPathType } from \"./domain-model.js\";\nimport type {\n\tProcessProductRefs,\n\tProcessSemanticEntryRefKey,\n\tProcessSemanticEntryRefs,\n} from \"./semantic-entry-refs.js\";\n\n/** @internal */\nexport interface ProcessTurnStartFromCurrentLeaf {\n\t/** @internal */\n\tkind: \"current_leaf\";\n}\n\n/** @internal */\nexport interface ProcessTurnStartFromSessionRoot {\n\t/** Start with no persisted Pi entry in context. The kickoff entry has parentId null. @internal */\n\tkind: \"session_root\";\n}\n\n/** @internal */\nexport interface ProcessTurnStartFromEntry {\n\t/** @internal */\n\tkind: \"entry\";\n\t/** @internal */\n\tentryId: string;\n}\n\n/** @internal */\nexport type ProcessTurnStartFallback =\n\t| ProcessTurnStartFromCurrentLeaf\n\t| ProcessTurnStartFromSessionRoot\n\t| ProcessTurnStartFromEntry;\n\n/** @internal */\nexport interface ProcessTurnStartFromSemanticRef {\n\t/** @internal */\n\tkind: \"semantic_ref\";\n\t/** @internal */\n\tref: ProcessSemanticEntryRefKey;\n\t/** @internal */\n\tfallback?: ProcessTurnStartSelection;\n}\n\n/** @internal */\nexport interface ProcessTurnStartFromProductRef {\n\t/** @internal */\n\tkind: \"product_ref\";\n\t/** @internal */\n\tproductName: string;\n\t/** @internal */\n\tfallback?: ProcessTurnStartSelection;\n}\n\n/** @internal */\nexport type ProcessTurnStartSelection =\n\t| ProcessTurnStartFallback\n\t| ProcessTurnStartFromSemanticRef\n\t| ProcessTurnStartFromProductRef;\n\n/** @internal */\nexport type ProcessTurnStartTarget =\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"current_leaf\";\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"entry\";\n\t\t\t/** @internal */\n\t\t\tentryId: string;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"root\";\n\t };\n\n/** @internal */\nexport interface ProcessTurnStartResolution {\n\t/** @internal */\n\tforkPiEntryId: string | null;\n\t/** @internal */\n\tstartTarget: ProcessTurnStartTarget;\n}\n\n/** @internal */\nexport function defaultProcessTurnStartSelection(\n\tbranchType: ProcessTurnRecordPathType,\n): ProcessTurnStartFallback {\n\tswitch (branchType) {\n\t\tcase \"primary\":\n\t\tcase \"leaf_branch\":\n\t\t\treturn { kind: \"current_leaf\" };\n\t\tcase \"root_branch\":\n\t\t\treturn { kind: \"session_root\" };\n\t}\n}\n\n/** @internal */\nexport function resolveProcessTurnStartSelection(input: {\n\t/** @internal */\n\tbranchType: ProcessTurnRecordPathType;\n\t/** @internal */\n\tstartFrom?: ProcessTurnStartSelection;\n}): ProcessTurnStartSelection {\n\treturn input.startFrom ?? defaultProcessTurnStartSelection(input.branchType);\n}\n\n/** @internal */\nexport function resolveExistingProcessEntryId(\n\tentryId: string | null,\n\tentryExists?: ((entryId: string) => boolean) | undefined,\n): string | null {\n\tif (!entryId) {\n\t\treturn null;\n\t}\n\treturn entryExists && !entryExists(entryId) ? null : entryId;\n}\n\n/** @internal */\nexport function resolveProcessSemanticRefEntryId(input: {\n\t/** @internal */\n\tref: keyof ProcessSemanticEntryRefs;\n\t/** @internal */\n\tsemanticEntryRefs?: ProcessSemanticEntryRefs | null;\n\t/** @internal */\n\tcurrentLeafId: string | null;\n\t/** @internal */\n\trootEntryId: string | null;\n\t/** @internal */\n\tentryExists?: (entryId: string) => boolean;\n}): string | null {\n\tconst fromState = resolveExistingProcessEntryId(\n\t\tinput.semanticEntryRefs?.[input.ref]?.entryId ?? null,\n\t\tinput.entryExists,\n\t);\n\tif (fromState) {\n\t\treturn fromState;\n\t}\n\tif (input.ref === \"currentPrimaryPathLeaf\") {\n\t\treturn resolveExistingProcessEntryId(input.currentLeafId, input.entryExists);\n\t}\n\tif (input.ref === \"rootEntry\") {\n\t\treturn resolveExistingProcessEntryId(input.rootEntryId, input.entryExists);\n\t}\n\treturn null;\n}\n\n/** @internal */\nexport function resolveProcessProductRefEntryId(input: {\n\t/** @internal */\n\tproductName: string;\n\t/** @internal */\n\tproductRefs?: ProcessProductRefs | null;\n\t/** @internal */\n\tentryExists?: (entryId: string) => boolean;\n}): string | null {\n\tconst productName = input.productName.trim();\n\tif (!productName) {\n\t\treturn null;\n\t}\n\treturn resolveExistingProcessEntryId(\n\t\tinput.productRefs?.[productName]?.entryId ?? null,\n\t\tinput.entryExists,\n\t);\n}\n\n/** @internal */\nexport function resolveProcessTurnStartTarget(input: {\n\t/** @internal */\n\tbranchType: ProcessTurnRecordPathType;\n\t/** @internal */\n\tselection: ProcessTurnStartSelection;\n\t/** @internal */\n\tcurrentLeafId: string | null;\n\t/** @internal */\n\trootEntryId: string | null;\n\t/** @internal */\n\tsemanticEntryRefs?: ProcessSemanticEntryRefs | null;\n\t/** @internal */\n\tproductRefs?: ProcessProductRefs | null;\n\t/** @internal */\n\tentryExists?: (entryId: string) => boolean;\n}): ProcessTurnStartResolution {\n\tswitch (input.selection.kind) {\n\t\tcase \"current_leaf\": {\n\t\t\treturn {\n\t\t\t\tforkPiEntryId: resolveExistingProcessEntryId(input.currentLeafId, input.entryExists),\n\t\t\t\tstartTarget: { kind: \"current_leaf\" },\n\t\t\t};\n\t\t}\n\t\tcase \"session_root\": {\n\t\t\treturn {\n\t\t\t\tforkPiEntryId: null,\n\t\t\t\tstartTarget: { kind: \"root\" },\n\t\t\t};\n\t\t}\n\t\tcase \"entry\": {\n\t\t\treturn {\n\t\t\t\tforkPiEntryId: input.selection.entryId,\n\t\t\t\tstartTarget: { kind: \"entry\", entryId: input.selection.entryId },\n\t\t\t};\n\t\t}\n\t\tcase \"semantic_ref\":\n\t\tcase \"product_ref\": {\n\t\t\tconst entryId =\n\t\t\t\tinput.selection.kind === \"semantic_ref\"\n\t\t\t\t\t? resolveProcessSemanticRefEntryId({\n\t\t\t\t\t\t\t...input,\n\t\t\t\t\t\t\tref: input.selection.ref,\n\t\t\t\t\t\t})\n\t\t\t\t\t: resolveProcessProductRefEntryId({\n\t\t\t\t\t\t\t...input,\n\t\t\t\t\t\t\tproductName: input.selection.productName,\n\t\t\t\t\t\t});\n\t\t\tif (entryId) {\n\t\t\t\treturn {\n\t\t\t\t\tforkPiEntryId: entryId,\n\t\t\t\t\tstartTarget: { kind: \"entry\", entryId },\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn resolveProcessTurnStartTarget({\n\t\t\t\t...input,\n\t\t\t\tselection: input.selection.fallback ?? defaultProcessTurnStartSelection(input.branchType),\n\t\t\t});\n\t\t}\n\t}\n}\n","import { createRepositoryChangeProcess } from \"@leitwerk-dev/coding\";\nimport type { RepositoryChangePublicationAdapter } from \"@leitwerk-dev/coding/repository-change-publication\";\nimport {\n\tcreateRepositoryChangePublication,\n\ttype PublicationEvidence,\n\ttype PublicationSource,\n\treadPublicationState,\n} from \"@leitwerk-dev/coding/repository-change-publication\";\nimport type { RepositoryChangeState } from \"@leitwerk-dev/coding/repository-change-state\";\nimport {\n\tcreateGitLabPublicationAdapter,\n\ttype GitLabDeliveryObservation,\n\tgitlabExternal,\n\tgitlabIssueWatcherSource,\n\tgitlabPublicationEvidenceForRequest,\n} from \"@leitwerk-dev/gitlab\";\nimport type { ExtensionProcessDefinition, ServerExtensionAPI } from \"@leitwerk-dev/process-sdk\";\nimport type { createGitLabRepoChangeLauncher } from \"./launcher.js\";\nimport { type GitLabRepoChangeParams, gitlabRepoChangeParamsCodec } from \"./params.js\";\n\nconst remote = (state: RepositoryChangeState) => readPublicationState(state, \"gitlabRepoChange\");\nconst maintenanceAdapters = new WeakMap<\n\tExtensionProcessDefinition<GitLabRepoChangeParams, RepositoryChangeState>,\n\tRepositoryChangePublicationAdapter<GitLabRepoChangeParams>\n>();\n/** @internal */\nexport function registerGitLabRepoChangeMaintenance(\n\tapi: ServerExtensionAPI,\n\tprocess: ExtensionProcessDefinition<GitLabRepoChangeParams, RepositoryChangeState>,\n): void {\n\tmaintenanceAdapters.get(process)?.maintenance?.register(api, process);\n}\nfunction requireRequest(state: RepositoryChangeState) {\n\tconst current = remote(state);\n\tif (!current.prNumber || !current.headSha)\n\t\tthrow new Error(\"Merge request delivery state is incomplete\");\n\treturn { ...current, prNumber: current.prNumber, headSha: current.headSha };\n}\n\n/** @public */\nexport function gitlabPublicationEvidence(\n\tstate: RepositoryChangeState,\n\tevent: GitLabDeliveryObservation,\n): PublicationEvidence {\n\treturn gitlabPublicationEvidenceForRequest(remote(state), event);\n}\n\n/** @public */\nexport function createGitLabRepoChangeProcess(\n\tlauncher: ReturnType<typeof createGitLabRepoChangeLauncher>,\n\tdocker: boolean,\n) {\n\tconst sources: PublicationSource<GitLabRepoChangeParams>[] = [\n\t\t{\n\t\t\tid: \"source_cancelled\",\n\t\t\tkind: \"cancelled\",\n\t\t\tlabel: \"GitLab source issue cancelled\",\n\t\t\tenabled: (params, state) =>\n\t\t\t\tparams.origin === \"issue\" && !!remote(state).prNumber && !!remote(state).headSha,\n\t\t\tsource: gitlabExternal.issueCancelled(({ params, state }) => {\n\t\t\t\tif (params.origin !== \"issue\") throw new Error(\"Missing GitLab source issue\");\n\t\t\t\treturn {\n\t\t\t\t\tprofile: params.gitlabProfile,\n\t\t\t\t\torigin: params.gitlabOrigin,\n\t\t\t\t\tprojectId: params.projectId,\n\t\t\t\t\tissueIid: params.issueNumber,\n\t\t\t\t\tiid: requireRequest(state).prNumber,\n\t\t\t\t\ttriggerLabel: params.triggerLabel,\n\t\t\t\t\tpollInterval: \"30s\",\n\t\t\t\t};\n\t\t\t}),\n\t\t\tread: () => ({ kind: \"cancelled\" }),\n\t\t},\n\t];\n\tconst adapter = createGitLabPublicationAdapter<GitLabRepoChangeParams>(sources);\n\tconst publication = createRepositoryChangePublication(adapter);\n\tpublication.fragment.watcher({\n\t\tid: \"use_leitwerk\",\n\t\tlabel: \"GitLab use-leitwerk issues\",\n\t\tdescription: \"Launch repository changes from labeled GitLab issues\",\n\t\tsource: gitlabIssueWatcherSource,\n\t\tpreparationChecks: launcher.preparationChecks,\n\t\tresolveLaunchConfig: launcher.fromIssue,\n\t});\n\tconst definition = createRepositoryChangeProcess<GitLabRepoChangeParams>({\n\t\tprocessId: \"gitlab_repo_change_process\",\n\t\tdisplayName: \"GitLab Repo Change\",\n\t\tparamsCodec: gitlabRepoChangeParamsCodec,\n\t\tlauncher: launcher.launcher,\n\t\tworkflow: launcher.workflow,\n\t\trepositoryCredentials: ({ params, projects }) =>\n\t\t\tprojects.map((project) => {\n\t\t\t\tif (!params.gitSshProfile) throw new Error(\"Missing Git SSH profile\");\n\t\t\t\treturn {\n\t\t\t\t\tprojectKey: project.key,\n\t\t\t\t\tkind: \"git_ssh\" as const,\n\t\t\t\t\tcredentialRef: params.gitSshProfile,\n\t\t\t\t};\n\t\t\t}),\n\t\tpublication,\n\t});\n\tdefinition.process.runtime = { ...definition.process.runtime, docker };\n\tmaintenanceAdapters.set(definition.process, adapter);\n\treturn definition.process;\n}\n","import {\n\tcreateRepositoryChangeParamsCodec,\n\tnormalizeRepositoryChangeParamsInput,\n\ttype RepositoryChangeLaunchParams,\n\ttype RepositoryIssueOriginParams,\n\ttype RepositoryUiOriginParams,\n\trepositoryChangeParamsRecord,\n} from \"@leitwerk-dev/coding/repository-change-launch\";\nimport { trimString } from \"@leitwerk-dev/domain\";\n\n/** @public */\nexport type GitLabRepoChangeParams = RepositoryChangeLaunchParams<\n\t{\n\t\t/** @public */\n\t\tgitlabProfile: string;\n\n\t\t/** @public */\n\t\tgitSshProfile?: string;\n\n\t\t/** @public */\n\t\tgitlabOrigin: string;\n\n\t\t/** @public */\n\t\tprojectId: number;\n\n\t\t/** @public */\n\t\towner: string;\n\n\t\t/** @public */\n\t\trepo: string;\n\t} & (RepositoryUiOriginParams | RepositoryIssueOriginParams)\n>;\n\n/** @public */\nexport const gitlabRepoChangeParamsCodec =\n\tcreateRepositoryChangeParamsCodec<GitLabRepoChangeParams>({\n\t\tnormalize(value) {\n\t\t\tconst r = repositoryChangeParamsRecord(value, \"GitLab Repo Change\");\n\t\t\tconst text = (key: string) => {\n\t\t\t\tconst v = trimString(r[key]);\n\t\t\t\tif (!v) throw new Error(`GitLab Repo Change requires ${key}`);\n\t\t\t\treturn v;\n\t\t\t};\n\t\t\tif (typeof r.projectId !== \"number\" || !Number.isSafeInteger(r.projectId) || r.projectId <= 0)\n\t\t\t\tthrow new Error(\"GitLab Repo Change requires projectId\");\n\t\t\tconst common = {\n\t\t\t\t...normalizeRepositoryChangeParamsInput(value, \"GitLab Repo Change\"),\n\t\t\t\tgitlabProfile: text(\"gitlabProfile\"),\n\t\t\t\tgitSshProfile: trimString(r.gitSshProfile),\n\t\t\t\tgitlabOrigin: text(\"gitlabOrigin\"),\n\t\t\t\tprojectId: r.projectId,\n\t\t\t\towner: text(\"owner\"),\n\t\t\t\trepo: text(\"repo\"),\n\t\t\t};\n\t\t\tif (r.origin === \"ui\")\n\t\t\t\treturn {\n\t\t\t\t\t...common,\n\t\t\t\t\torigin: \"ui\",\n\t\t\t\t\tissueNumber: null,\n\t\t\t\t\tissueUrl: null,\n\t\t\t\t\ttriggerLabel: null,\n\t\t\t\t\tdoneLabel: null,\n\t\t\t\t};\n\t\t\tif (\n\t\t\t\tr.origin !== \"issue\" ||\n\t\t\t\ttypeof r.issueNumber !== \"number\" ||\n\t\t\t\t!Number.isSafeInteger(r.issueNumber) ||\n\t\t\t\tr.issueNumber <= 0\n\t\t\t)\n\t\t\t\tthrow new Error(\"GitLab Repo Change requires a valid origin and issueNumber\");\n\t\t\treturn {\n\t\t\t\t...common,\n\t\t\t\torigin: \"issue\",\n\t\t\t\tissueNumber: r.issueNumber,\n\t\t\t\tissueUrl: text(\"issueUrl\"),\n\t\t\t\ttriggerLabel: text(\"triggerLabel\"),\n\t\t\t\tdoneLabel: text(\"doneLabel\"),\n\t\t\t};\n\t\t},\n\t});\n"],"mappings":"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","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/launcher.ts","../../../node_modules/valibot/dist/index.mjs","../../../packages/domain/src/string-normalize.ts","../../../packages/domain/src/domain-model.ts","../../../packages/domain/src/actor.ts","../../../packages/domain/src/dependency-order.ts","../../../packages/domain/src/execution-inspection.ts","../../../packages/domain/src/json-pointer.ts","../../../packages/domain/src/launcher-recent-values.ts","../../../packages/domain/src/markdown-normalize.ts","../../../packages/domain/src/number-normalize.ts","../../../packages/domain/src/process-model-config.ts","../../../packages/domain/src/process-path.ts","../../../packages/domain/src/process-row-slots.ts","../../../packages/domain/src/unknown-record.ts","../../../packages/domain/src/semantic-entry-refs.ts","../../../packages/domain/src/process-state-json.ts","../../../packages/domain/src/repo-locator.ts","../../../packages/domain/src/startup-observation.ts","../../../packages/domain/src/turn-annotations.ts","../../../packages/domain/src/turn-recovery.ts","../../../packages/domain/src/turn-start-resolution.ts","../src/process.ts","../src/params.ts"],"sourcesContent":["import { gitSshIntegration } from \"@leitwerk-dev/git-ssh\";\nimport { gitlabIntegration } from \"@leitwerk-dev/gitlab\";\nimport type { LeitwerkExtensionModule } from \"@leitwerk-dev/process-sdk\";\nimport { createGitLabRepoChangeLauncher } from \"./launcher.js\";\nimport { createGitLabRepoChangeProcess, registerGitLabRepoChangeMaintenance } from \"./process.js\";\n\n/** @public */\nexport const manifest = {\n\t/** @public */\n\tid: \"gitlab-repo-change\",\n\n\t/** @public */\n\tversion: \"0.1.9\",\n\n\t/** @public */\n\trequires: [\"gitlab\", \"coding\", \"git-ssh\"],\n} as const;\n\n/** @public */\n/** @public */\nexport function createGitLabRepoChange(options: {\n\t/** @public */\n\tdocker: boolean;\n}) {\n\tif (typeof options.docker !== \"boolean\") throw new Error(\"docker must be a boolean\");\n\tconst launcher = createGitLabRepoChangeLauncher();\n\tconst process = createGitLabRepoChangeProcess(launcher, options.docker);\n\tconst extension: LeitwerkExtensionModule = {\n\t\tmanifest,\n\t\tsetupCatalog(api) {\n\t\t\tapi.registerProcess(process);\n\t\t},\n\t\tsetupServer(api) {\n\t\t\tregisterGitLabRepoChangeMaintenance(api, process);\n\t\t\tconst integration = api.require(gitlabIntegration);\n\t\t\tif (Array.isArray(integration)) throw new Error(\"GitLab integration must be singular\");\n\t\t\tconst ssh = api.require(gitSshIntegration);\n\t\t\tif (Array.isArray(ssh)) throw new Error(\"Git SSH integration must be singular\");\n\t\t\tlauncher.configure(integration, ssh);\n\t\t\tapi.onStop(() => launcher.configure(null));\n\t\t},\n\t};\n\n\t/** @public */\n\t/** @public */\n\treturn {\n\t\t/** @public */\n\t\textension,\n\n\t\t/** @public */\n\t\tprocess,\n\n\t\t/** @public */\n\t\tlauncher,\n\t};\n}\n\n/** @public */\nexport const {\n\textension: defaultExtension,\n\tprocess: gitlabRepoChangeProcess,\n\tlauncher: defaultGitLabRepoChangeLauncher,\n} = createGitLabRepoChange({ docker: true });\nexport * from \"./launcher.js\";\nexport * from \"./params.js\";\nexport * from \"./process.js\";\nexport default defaultExtension;\n","import { buildAutoWorkBranchFromSeed } from \"@leitwerk-dev/coding/auto-work-branch\";\nimport {\n\trepositoryChangeOptionFields,\n\trepositoryChangeOptions,\n\trepositoryChangeWorkflow,\n} from \"@leitwerk-dev/coding/repository-change-launch\";\nimport { trimString } from \"@leitwerk-dev/domain\";\nimport { createGitSshPreparationCheck, type GitSshIntegration } from \"@leitwerk-dev/git-ssh\";\nimport {\n\ttype GitLabIntegration,\n\ttype GitLabIssueWatcherEvent,\n\ttype GitLabProject,\n\tgitlabIssueExternalId,\n\tresolveGitLabLaunchProject,\n} from \"@leitwerk-dev/gitlab\";\nimport {\n\ttype LaunchPreparationCheck,\n\ttype ProcessLaunchConfig,\n\ttype ProcessLauncherDefinition,\n\tSafeLaunchPreparationError,\n} from \"@leitwerk-dev/process-sdk\";\nimport type { GitLabRepoChangeParams } from \"./params.js\";\n\n/** @public */\nexport function createGitLabRepoChangeLauncher() {\n\tlet integration: GitLabIntegration | null = null;\n\tlet ssh: GitSshIntegration | null = null;\n\tconst requireIntegration = () => {\n\t\tif (!integration) throw new Error(\"GitLab repository launcher is not configured\");\n\t\treturn integration;\n\t};\n\tconst configure = (\n\t\tvalue: GitLabIntegration | null,\n\t\tsshIntegration: GitSshIntegration | null = null,\n\t) => {\n\t\tintegration = value;\n\t\tssh = sshIntegration;\n\t};\n\tasync function launch(\n\t\trepository: GitLabProject,\n\t\tprofile: string,\n\t\tprompt: string,\n\t\tissue?: GitLabIssueWatcherEvent,\n\t\toptions: {\n\t\t\tskipPlanDecision?: boolean;\n\t\t\tskipSimplification?: boolean;\n\t\t\tgitSshProfile?: string;\n\t\t} = {},\n\t): Promise<ProcessLaunchConfig<GitLabRepoChangeParams>> {\n\t\tconst service = requireIntegration();\n\t\tif (!service.profiles().includes(profile)) throw new Error(\"GitLab profile is unavailable\");\n\t\tconst client = service.client(profile);\n\t\tconst gitSshProfile =\n\t\t\toptions.gitSshProfile ??\n\t\t\tissue?.gitSshProfile ??\n\t\t\t(ssh?.profiles().length === 1 ? ssh.profiles()[0] : \"\");\n\t\tif (!gitSshProfile || !ssh?.profiles().includes(gitSshProfile))\n\t\t\tthrow new Error(\"Select a matching Git SSH profile\");\n\t\tconst { params: binding, project } = await resolveGitLabLaunchProject(\n\t\t\tclient,\n\t\t\tprofile,\n\t\t\trepository,\n\t\t\tissue\n\t\t\t\t? `leitwerk/issue-${issue.issue.iid}`\n\t\t\t\t: buildAutoWorkBranchFromSeed(\n\t\t\t\t\t\tprompt,\n\t\t\t\t\t\t`${repository.http_url_to_repo}:${repository.default_branch}`,\n\t\t\t\t\t),\n\t\t);\n\t\tproject.settingsRepository.origin = new URL(repository.web_url).origin;\n\t\tif (issue) Object.assign(project.metadata.gitlab, { issueIid: issue.issue.iid });\n\t\tconst common = { ...binding, gitSshProfile, ...repositoryChangeOptions(options), prompt };\n\t\tconst params: GitLabRepoChangeParams = issue\n\t\t\t? {\n\t\t\t\t\t...common,\n\t\t\t\t\torigin: \"issue\",\n\t\t\t\t\tissueNumber: issue.issue.iid,\n\t\t\t\t\tissueUrl: issue.issue.web_url,\n\t\t\t\t\ttriggerLabel: issue.labels.trigger,\n\t\t\t\t\tdoneLabel: issue.labels.done,\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\t...common,\n\t\t\t\t\torigin: \"ui\",\n\t\t\t\t\tissueNumber: null,\n\t\t\t\t\tissueUrl: null,\n\t\t\t\t\ttriggerLabel: null,\n\t\t\t\t\tdoneLabel: null,\n\t\t\t\t};\n\t\treturn {\n\t\t\tprocessId: \"gitlab_repo_change_process\",\n\t\t\ttitle: issue?.issue.title ?? prompt,\n\t\t\tparams,\n\t\t\tstartTurnId: \"generate_plan\",\n\t\t\t...(issue\n\t\t\t\t? {\n\t\t\t\t\t\texternalId: gitlabIssueExternalId(client.baseUrl, repository.id, issue.issue.iid),\n\t\t\t\t\t\texternalUrl: issue.issue.web_url,\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t\tprojects: [project],\n\t\t};\n\t}\n\tconst preparationChecks = (\n\t\t_input: unknown,\n\t\t{ params }: ProcessLaunchConfig<GitLabRepoChangeParams>,\n\t): readonly LaunchPreparationCheck<GitLabRepoChangeParams>[] => [\n\t\t{\n\t\t\tid: \"gitlab_repository_access\",\n\t\t\tlabel: \"Verify GitLab repository access\",\n\t\t\tasync run({ signal }) {\n\t\t\t\tconst client = requireIntegration().client(params.gitlabProfile);\n\t\t\t\tconst repository = await client.getProject(params.projectId, signal);\n\t\t\t\tif (\n\t\t\t\t\trepository.archived ||\n\t\t\t\t\trepository.ssh_url_to_repo !== params.repoLocator ||\n\t\t\t\t\trepository.default_branch !== params.baseBranch\n\t\t\t\t)\n\t\t\t\t\tthrow new SafeLaunchPreparationError(\n\t\t\t\t\t\t\"Repository changed or is archived\",\n\t\t\t\t\t\t\"Select an active GitLab project and launch again.\",\n\t\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\tcreateGitSshPreparationCheck(\n\t\t\t\"write\",\n\t\t\t{ ...params, sshCredentialRef: params.gitSshProfile ?? \"\" },\n\t\t\t() => {\n\t\t\t\tif (!params.gitSshProfile || !ssh) throw new Error(\"Git SSH profile is unavailable\");\n\t\t\t\treturn ssh;\n\t\t\t},\n\t\t),\n\t];\n\tconst launcher: ProcessLauncherDefinition<GitLabRepoChangeParams> = {\n\t\tid: \"gitlab_repo_change_process.ui_launcher\",\n\t\tlabel: \"GitLab Repo Change\",\n\t\tdescription: \"Plan, implement, review, and publish a GitLab merge request\",\n\t\tvisibility: \"ui\",\n\t\tui: {\n\t\t\tcard: {\n\t\t\t\ttitle: \"GitLab Repo Change\",\n\t\t\t\tdescription: \"Start a repository change and publish a merge request.\",\n\t\t\t},\n\t\t\tlaunchConfigSchema: {\n\t\t\t\tid: \"gitlab_repo_change_form\",\n\t\t\t\ttitle: \"GitLab Repo Change\",\n\t\t\t\tfields: [\n\t\t\t\t\t{ id: \"gitlabProfile\", label: \"GitLab profile\", kind: \"select\", required: true },\n\t\t\t\t\t{ id: \"repository\", label: \"Project\", kind: \"select\", required: true },\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"gitSshProfile\",\n\t\t\t\t\t\tlabel: \"Git SSH profile\",\n\t\t\t\t\t\tkind: \"select\",\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\toptions: [],\n\t\t\t\t\t},\n\t\t\t\t\t{ id: \"prompt\", label: \"Requested change\", kind: \"textarea\", required: true },\n\t\t\t\t\t...repositoryChangeOptionFields,\n\t\t\t\t],\n\t\t\t\tsubmitLabel: \"Start change\",\n\t\t\t},\n\t\t\tresolveDefaults() {\n\t\t\t\treturn {\n\t\t\t\t\tgitlabProfile: requireIntegration().profiles()[0] ?? \"\",\n\t\t\t\t\trepository: \"\",\n\t\t\t\t\tgitSshProfile: ssh?.profiles()[0] ?? \"\",\n\t\t\t\t\tprompt: \"\",\n\t\t\t\t\t...repositoryChangeOptions({}),\n\t\t\t\t};\n\t\t\t},\n\t\t\tasync resolveOptions(input) {\n\t\t\t\tconst i = requireIntegration();\n\t\t\t\tconst profile = trimString(input.gitlabProfile);\n\t\t\t\treturn {\n\t\t\t\t\tgitSshProfile: (ssh?.profiles() ?? []).map((value) => ({ value, label: value })),\n\t\t\t\t\tgitlabProfile: i.profiles().map((value) => ({ value, label: value })),\n\t\t\t\t\trepository: (i.profiles().includes(profile) ? await i.client(profile).listProjects() : [])\n\t\t\t\t\t\t.filter((p) => !p.archived && p.default_branch)\n\t\t\t\t\t\t.map((p) => ({\n\t\t\t\t\t\t\tvalue: String(p.id),\n\t\t\t\t\t\t\tlabel: p.path_with_namespace,\n\t\t\t\t\t\t\tdescription: p.web_url,\n\t\t\t\t\t\t})),\n\t\t\t\t};\n\t\t\t},\n\t\t\tpreparationChecks,\n\t\t\tresolveRelaunchInput(input) {\n\t\t\t\treturn {\n\t\t\t\t\tgitlabProfile: trimString(input.gitlabProfile),\n\t\t\t\t\trepository: trimString(input.repository),\n\t\t\t\t\tprompt: trimString(input.prompt),\n\t\t\t\t\tgitSshProfile: trimString(input.gitSshProfile),\n\t\t\t\t\t...repositoryChangeOptions(input),\n\t\t\t\t};\n\t\t\t},\n\t\t\tasync resolveLaunchConfig(input) {\n\t\t\t\tconst profile = trimString(input.gitlabProfile);\n\t\t\t\tconst projectId = Number(input.repository);\n\t\t\t\tconst prompt = trimString(input.prompt);\n\t\t\t\tconst errors = [];\n\t\t\t\tif (!ssh?.profiles().includes(trimString(input.gitSshProfile)))\n\t\t\t\t\terrors.push({\n\t\t\t\t\t\tfieldId: \"gitSshProfile\",\n\t\t\t\t\t\tmessage: \"Select an available Git SSH profile\",\n\t\t\t\t\t\tcode: \"custom_rule\" as const,\n\t\t\t\t\t});\n\t\t\t\tif (!requireIntegration().profiles().includes(profile))\n\t\t\t\t\terrors.push({\n\t\t\t\t\t\tfieldId: \"gitlabProfile\",\n\t\t\t\t\t\tmessage: \"Select an available GitLab profile\",\n\t\t\t\t\t\tcode: \"custom_rule\" as const,\n\t\t\t\t\t});\n\t\t\t\tif (!Number.isSafeInteger(projectId) || projectId <= 0)\n\t\t\t\t\terrors.push({\n\t\t\t\t\t\tfieldId: \"repository\",\n\t\t\t\t\t\tmessage: \"Select a project\",\n\t\t\t\t\t\tcode: \"required\" as const,\n\t\t\t\t\t});\n\t\t\t\tif (!prompt)\n\t\t\t\t\terrors.push({\n\t\t\t\t\t\tfieldId: \"prompt\",\n\t\t\t\t\t\tmessage: \"Describe the requested change\",\n\t\t\t\t\t\tcode: \"required\" as const,\n\t\t\t\t\t});\n\t\t\t\tif (errors.length) return { ok: false, errors };\n\t\t\t\tconst repository = await requireIntegration().client(profile).getProject(projectId);\n\t\t\t\tif (repository.archived || !repository.default_branch)\n\t\t\t\t\treturn {\n\t\t\t\t\t\tok: false,\n\t\t\t\t\t\terrors: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfieldId: \"repository\",\n\t\t\t\t\t\t\t\tmessage: \"Project is archived or has no default branch\",\n\t\t\t\t\t\t\t\tcode: \"custom_rule\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\tok: true,\n\t\t\t\t\tlaunchConfig: await launch(repository, profile, prompt, undefined, {\n\t\t\t\t\t\tgitSshProfile: trimString(input.gitSshProfile),\n\t\t\t\t\t\t...repositoryChangeOptions(input),\n\t\t\t\t\t}),\n\t\t\t\t};\n\t\t\t},\n\t\t},\n\t};\n\treturn {\n\t\t/** @public */\n\t\tconfigure,\n\n\t\t/** @public */\n\t\tlauncher,\n\t\t/** Server-side routing policies. @public */\n\t\tworkflow: repositoryChangeWorkflow(async (params: GitLabRepoChangeParams) => {\n\t\t\tif (params.origin !== \"issue\") throw new Error(\"Missing GitLab source issue\");\n\t\t\tconst client = requireIntegration().client(params.gitlabProfile);\n\t\t\tif (client.baseUrl !== params.gitlabOrigin)\n\t\t\t\tthrow new Error(\"GitLab profile installation changed from the source issue\");\n\t\t\treturn (await client.getIssue(params.projectId, params.issueNumber)).labels;\n\t\t}),\n\n\t\t/** @public */\n\t\tpreparationChecks,\n\n\t\t/** @public */\n\t\tasync fromIssue(event: GitLabIssueWatcherEvent) {\n\t\t\treturn launch(\n\t\t\t\tevent.repository,\n\t\t\t\tevent.profile,\n\t\t\t\t`${event.issue.title}${event.issue.description ? `\\n\\n${event.issue.description}` : \"\"}`,\n\t\t\t\tevent,\n\t\t\t);\n\t\t},\n\t};\n}\n","//#region src/storages/globalConfig/globalConfig.ts\nlet store$4;\n/**\n* Sets the global configuration.\n*\n* @param config The configuration.\n*/\nfunction setGlobalConfig(config$1) {\n\tstore$4 = {\n\t\t...store$4,\n\t\t...config$1\n\t};\n}\n/**\n* Returns the global configuration.\n*\n* @param config The config to merge.\n*\n* @returns The configuration.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getGlobalConfig(config$1) {\n\treturn {\n\t\tlang: config$1?.lang ?? store$4?.lang,\n\t\tmessage: config$1?.message,\n\t\tabortEarly: config$1?.abortEarly ?? store$4?.abortEarly,\n\t\tabortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly\n\t};\n}\n/**\n* Deletes the global configuration.\n*/\nfunction deleteGlobalConfig() {\n\tstore$4 = void 0;\n}\n\n//#endregion\n//#region src/storages/globalMessage/globalMessage.ts\nlet store$3;\n/**\n* Sets a global error message.\n*\n* @param message The error message.\n* @param lang The language of the message.\n*/\nfunction setGlobalMessage(message$1, lang) {\n\tif (!store$3) store$3 = /* @__PURE__ */ new Map();\n\tstore$3.set(lang, message$1);\n}\n/**\n* Returns a global error message.\n*\n* @param lang The language of the message.\n*\n* @returns The error message.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getGlobalMessage(lang) {\n\treturn store$3?.get(lang);\n}\n/**\n* Deletes a global error message.\n*\n* @param lang The language of the message.\n*/\nfunction deleteGlobalMessage(lang) {\n\tstore$3?.delete(lang);\n}\n\n//#endregion\n//#region src/storages/schemaMessage/schemaMessage.ts\nlet store$2;\n/**\n* Sets a schema error message.\n*\n* @param message The error message.\n* @param lang The language of the message.\n*/\nfunction setSchemaMessage(message$1, lang) {\n\tif (!store$2) store$2 = /* @__PURE__ */ new Map();\n\tstore$2.set(lang, message$1);\n}\n/**\n* Returns a schema error message.\n*\n* @param lang The language of the message.\n*\n* @returns The error message.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getSchemaMessage(lang) {\n\treturn store$2?.get(lang);\n}\n/**\n* Deletes a schema error message.\n*\n* @param lang The language of the message.\n*/\nfunction deleteSchemaMessage(lang) {\n\tstore$2?.delete(lang);\n}\n\n//#endregion\n//#region src/storages/specificMessage/specificMessage.ts\nlet store$1;\n/**\n* Sets a specific error message.\n*\n* @param reference The identifier reference.\n* @param message The error message.\n* @param lang The language of the message.\n*/\nfunction setSpecificMessage(reference, message$1, lang) {\n\tif (!store$1) store$1 = /* @__PURE__ */ new Map();\n\tif (!store$1.get(reference)) store$1.set(reference, /* @__PURE__ */ new Map());\n\tstore$1.get(reference).set(lang, message$1);\n}\n/**\n* Returns a specific error message.\n*\n* @param reference The identifier reference.\n* @param lang The language of the message.\n*\n* @returns The error message.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getSpecificMessage(reference, lang) {\n\treturn store$1?.get(reference)?.get(lang);\n}\n/**\n* Deletes a specific error message.\n*\n* @param reference The identifier reference.\n* @param lang The language of the message.\n*/\nfunction deleteSpecificMessage(reference, lang) {\n\tstore$1?.get(reference)?.delete(lang);\n}\n\n//#endregion\n//#region src/utils/_stringify/_stringify.ts\n/**\n* Stringifies an unknown input to a literal or type string.\n*\n* @param input The unknown input.\n*\n* @returns A literal or type string.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _stringify(input) {\n\tconst type = typeof input;\n\tif (type === \"string\") return `\"${input}\"`;\n\tif (type === \"number\" || type === \"bigint\" || type === \"boolean\") return `${input}`;\n\tif (type === \"object\" || type === \"function\") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? \"null\";\n\treturn type;\n}\n\n//#endregion\n//#region src/utils/_addIssue/_addIssue.ts\n/**\n* Adds an issue to the dataset.\n*\n* @param context The issue context.\n* @param label The issue label.\n* @param dataset The input dataset.\n* @param config The configuration.\n* @param other The optional props.\n*\n* @internal\n*/\nfunction _addIssue(context, label, dataset, config$1, other) {\n\tconst input = other && \"input\" in other ? other.input : dataset.value;\n\tconst expected = other?.expected ?? context.expects ?? null;\n\tconst received = other?.received ?? /* @__PURE__ */ _stringify(input);\n\tconst issue = {\n\t\tkind: context.kind,\n\t\ttype: context.type,\n\t\tinput,\n\t\texpected,\n\t\treceived,\n\t\tmessage: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : \"R\"}eceived ${received}`,\n\t\trequirement: context.requirement,\n\t\tpath: other?.path,\n\t\tissues: other?.issues,\n\t\tlang: config$1.lang,\n\t\tabortEarly: config$1.abortEarly,\n\t\tabortPipeEarly: config$1.abortPipeEarly\n\t};\n\tconst isSchema = context.kind === \"schema\";\n\tconst message$1 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config$1.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang);\n\tif (message$1 !== void 0) issue.message = typeof message$1 === \"function\" ? message$1(issue) : message$1;\n\tif (isSchema) dataset.typed = false;\n\tif (dataset.issues) dataset.issues.push(issue);\n\telse dataset.issues = [issue];\n}\n\n//#endregion\n//#region src/utils/_cloneDataset/_cloneDataset.ts\n/**\n* Creates a shallow copy of a dataset.\n*\n* Hint: The `value` is copied by reference, but the `issues` array is cloned\n* to avoid reusing mutable dataset state across multiple runs. Mutating a\n* returned object or array value can therefore affect later cache hits that\n* reuse the same cached output.\n*\n* @param dataset The output dataset.\n*\n* @returns The copied output dataset.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _cloneDataset(dataset) {\n\treturn {\n\t\ttyped: dataset.typed,\n\t\tvalue: dataset.value,\n\t\tissues: dataset.issues && [...dataset.issues]\n\t};\n}\n\n//#endregion\n//#region src/utils/_getByteCount/_getByteCount.ts\nlet textEncoder;\n/**\n* Returns the byte count of the input.\n*\n* @param input The input to be measured.\n*\n* @returns The byte count.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getByteCount(input) {\n\tif (!textEncoder) textEncoder = new TextEncoder();\n\treturn textEncoder.encode(input).length;\n}\n\n//#endregion\n//#region src/utils/_getGraphemeCount/_getGraphemeCount.ts\nlet segmenter;\n/**\n* Returns the grapheme count of the input.\n*\n* @param input The input to be measured.\n*\n* @returns The grapheme count.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getGraphemeCount(input) {\n\tif (!segmenter) segmenter = new Intl.Segmenter();\n\tconst segments = segmenter.segment(input);\n\tlet count = 0;\n\tfor (const _ of segments) count++;\n\treturn count;\n}\n\n//#endregion\n//#region src/utils/_getLastMetadata/_getLastMetadata.ts\n/**\n* Returns the last top-level value of a given metadata type from a schema\n* using a breadth-first search that starts with the last item in the pipeline.\n*\n* @param schema The schema to search.\n* @param type The metadata type.\n*\n* @returns The value, if any.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getLastMetadata(schema, type) {\n\tif (\"pipe\" in schema) {\n\t\tconst nestedSchemas = [];\n\t\tfor (let index = schema.pipe.length - 1; index >= 0; index--) {\n\t\t\tconst item = schema.pipe[index];\n\t\t\tif (item.kind === \"schema\" && \"pipe\" in item) nestedSchemas.push(item);\n\t\t\telse if (item.kind === \"metadata\" && item.type === type) return item[type];\n\t\t}\n\t\tfor (const nestedSchema of nestedSchemas) {\n\t\t\tconst result = /* @__PURE__ */ _getLastMetadata(nestedSchema, type);\n\t\t\tif (result !== void 0) return result;\n\t\t}\n\t}\n}\n\n//#endregion\n//#region src/utils/_getStandardProps/_getStandardProps.ts\n/**\n* Returns the Standard Schema properties.\n*\n* @param context The schema context.\n*\n* @returns The Standard Schema properties.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getStandardProps(context) {\n\treturn {\n\t\tversion: 1,\n\t\tvendor: \"valibot\",\n\t\tvalidate(value$1) {\n\t\t\treturn context[\"~run\"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig());\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/utils/_getWordCount/_getWordCount.ts\nlet store;\n/**\n* Returns the word count of the input.\n*\n* @param locales The locales to be used.\n* @param input The input to be measured.\n*\n* @returns The word count.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _getWordCount(locales, input) {\n\tif (!store) store = /* @__PURE__ */ new Map();\n\tif (!store.get(locales)) store.set(locales, new Intl.Segmenter(locales, { granularity: \"word\" }));\n\tconst segments = store.get(locales).segment(input);\n\tlet count = 0;\n\tfor (const segment of segments) if (segment.isWordLike) count++;\n\treturn count;\n}\n\n//#endregion\n//#region src/utils/_isLuhnAlgo/_isLuhnAlgo.ts\n/**\n* Non-digit regex.\n*/\nconst NON_DIGIT_REGEX = /\\D/gu;\n/**\n* Checks whether a string with numbers corresponds to the luhn algorithm.\n*\n* @param input The input to be checked.\n*\n* @returns Whether input is valid.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _isLuhnAlgo(input) {\n\tconst number$1 = input.replace(NON_DIGIT_REGEX, \"\");\n\tlet length$1 = number$1.length;\n\tlet bit = 1;\n\tlet sum = 0;\n\twhile (length$1) {\n\t\tconst value$1 = +number$1[--length$1];\n\t\tbit ^= 1;\n\t\tsum += bit ? [\n\t\t\t0,\n\t\t\t2,\n\t\t\t4,\n\t\t\t6,\n\t\t\t8,\n\t\t\t1,\n\t\t\t3,\n\t\t\t5,\n\t\t\t7,\n\t\t\t9\n\t\t][value$1] : value$1;\n\t}\n\treturn sum % 10 === 0;\n}\n\n//#endregion\n//#region src/utils/_isValidObjectKey/_isValidObjectKey.ts\n/**\n* Disallows inherited object properties and prevents object prototype\n* pollution by disallowing certain keys.\n*\n* @param object The object to check.\n* @param key The key to check.\n*\n* @returns Whether the key is allowed.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _isValidObjectKey(object$1, key) {\n\treturn Object.hasOwn(object$1, key) && key !== \"__proto__\" && key !== \"prototype\" && key !== \"constructor\";\n}\n\n//#endregion\n//#region src/utils/_joinExpects/_joinExpects.ts\n/**\n* Joins multiple `expects` values with the given separator.\n*\n* @param values The `expects` values.\n* @param separator The separator.\n*\n* @returns The joined `expects` property.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _joinExpects(values$1, separator) {\n\tconst list = [...new Set(values$1)];\n\tif (list.length > 1) return `(${list.join(` ${separator} `)})`;\n\treturn list[0] ?? \"never\";\n}\n\n//#endregion\n//#region src/utils/entriesFromList/entriesFromList.ts\n/**\n* Creates an object entries definition from a list of keys and a schema.\n*\n* @param list A list of keys.\n* @param schema The schema of the keys.\n*\n* @returns The object entries.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction entriesFromList(list, schema) {\n\tconst entries$1 = {};\n\tfor (const key of list) entries$1[key] = schema;\n\treturn entries$1;\n}\n\n//#endregion\n//#region src/utils/entriesFromObjects/entriesFromObjects.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction entriesFromObjects(schemas) {\n\tconst entries$1 = {};\n\tfor (const schema of schemas) Object.assign(entries$1, schema.entries);\n\treturn entries$1;\n}\n\n//#endregion\n//#region src/utils/getDotPath/getDotPath.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction getDotPath(issue) {\n\tif (issue.path) {\n\t\tlet key = \"\";\n\t\tfor (const item of issue.path) if (typeof item.key === \"string\" || typeof item.key === \"number\") if (key) key += `.${item.key}`;\n\t\telse key += item.key;\n\t\telse return null;\n\t\treturn key;\n\t}\n\treturn null;\n}\n\n//#endregion\n//#region src/utils/isOfKind/isOfKind.ts\n/**\n* A generic type guard to check the kind of an object.\n*\n* @param kind The kind to check for.\n* @param object The object to check.\n*\n* @returns Whether it matches.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction isOfKind(kind, object$1) {\n\treturn object$1.kind === kind;\n}\n\n//#endregion\n//#region src/utils/isOfType/isOfType.ts\n/**\n* A generic type guard to check the type of an object.\n*\n* @param type The type to check for.\n* @param object The object to check.\n*\n* @returns Whether it matches.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction isOfType(type, object$1) {\n\treturn object$1.type === type;\n}\n\n//#endregion\n//#region src/utils/isValiError/isValiError.ts\n/**\n* A type guard to check if an error is a ValiError.\n*\n* @param error The error to check.\n*\n* @returns Whether its a ValiError.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction isValiError(error) {\n\treturn error instanceof ValiError;\n}\n\n//#endregion\n//#region src/utils/ValiError/ValiError.ts\n/**\n* A Valibot error with useful information.\n*/\nvar ValiError = class extends Error {\n\t/**\n\t* Creates a Valibot error with useful information.\n\t*\n\t* @param issues The error issues.\n\t*/\n\tconstructor(issues) {\n\t\tsuper(issues[0].message);\n\t\tthis.name = \"ValiError\";\n\t\tthis.issues = issues;\n\t}\n};\n\n//#endregion\n//#region src/actions/args/args.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction args(schema) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"args\",\n\t\treference: args,\n\t\tasync: false,\n\t\tschema,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst func = dataset.value;\n\t\t\tdataset.value = (...args_) => {\n\t\t\t\tconst argsDataset = this.schema[\"~run\"]({ value: args_ }, config$1);\n\t\t\t\tif (argsDataset.issues) throw new ValiError(argsDataset.issues);\n\t\t\t\treturn func(...argsDataset.value);\n\t\t\t};\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/args/argsAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction argsAsync(schema) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"args\",\n\t\treference: argsAsync,\n\t\tasync: false,\n\t\tschema,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst func = dataset.value;\n\t\t\tdataset.value = async (...args$1) => {\n\t\t\t\tconst argsDataset = await schema[\"~run\"]({ value: args$1 }, config$1);\n\t\t\t\tif (argsDataset.issues) throw new ValiError(argsDataset.issues);\n\t\t\t\treturn func(...argsDataset.value);\n\t\t\t};\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/await/awaitAsync.ts\n/**\n* Creates an await transformation action.\n*\n* @returns An await action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction awaitAsync() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"await\",\n\t\treference: awaitAsync,\n\t\tasync: true,\n\t\tasync \"~run\"(dataset) {\n\t\t\tdataset.value = await dataset.value;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/regex.ts\n/**\n* [Base64](https://en.wikipedia.org/wiki/Base64) regex.\n*/\nconst BASE64_REGEX = /^(?:[\\da-z+/]{4})*(?:[\\da-z+/]{2}==|[\\da-z+/]{3}=)?$/iu;\n/**\n* [BIC](https://en.wikipedia.org/wiki/ISO_9362) regex.\n*/\nconst BIC_REGEX = /^[A-Z]{6}(?!00)[\\dA-Z]{2}(?:[\\dA-Z]{3})?$/u;\n/**\n* [Cuid2](https://github.com/paralleldrive/cuid2) regex.\n*/\nconst CUID2_REGEX = /^[a-z][\\da-z]*$/u;\n/**\n* [Decimal](https://en.wikipedia.org/wiki/Decimal) regex.\n*/\nconst DECIMAL_REGEX = /^[+-]?(?:\\d*\\.)?\\d+$/u;\n/**\n* [Digits](https://en.wikipedia.org/wiki/Numerical_digit) regex.\n*/\nconst DIGITS_REGEX = /^\\d+$/u;\n/**\n* [Domain name](https://en.wikipedia.org/wiki/Domain_name) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n* ASCII-only validation. Internationalized domain names (IDNs) are not\n* supported, including Punycode-encoded labels.\n*/\nconst DOMAIN_REGEX = /^(?=.{1,253}$)(?:(?![Xx][Nn]--)[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63}$/u;\n/**\n* [Email address](https://en.wikipedia.org/wiki/Email_address) regex.\n*/\nconst EMAIL_REGEX = /^[\\w+-]+(?:\\.[\\w+-]+)*@[\\da-z]+(?:[.-][\\da-z]+)*\\.[a-z]{2,}$/iu;\n/**\n* Emoji regex from [emoji-regex-xs](https://github.com/slevithan/emoji-regex-xs) v1.0.0 (MIT license).\n*\n* Hint: We decided against the newer `/^\\p{RGI_Emoji}+$/v` regex because it is\n* not supported in older runtimes and does not match all emoji.\n*/\nconst EMOJI_REGEX = /^(?:[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|(?![\\p{Emoji_Modifier_Base}\\u{1F1E6}-\\u{1F1FF}])\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|(?![\\p{Emoji_Modifier_Base}\\u{1F1E6}-\\u{1F1FF}])\\p{Emoji_Presentation}))*)+$/u;\n/**\n* [Hexadecimal](https://en.wikipedia.org/wiki/Hexadecimal) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst HEXADECIMAL_REGEX = /^(?:0[hx])?[\\da-fA-F]+$/u;\n/**\n* [Hex color](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst HEX_COLOR_REGEX = /^#(?:[\\da-fA-F]{3,4}|[\\da-fA-F]{6}|[\\da-fA-F]{8})$/u;\n/**\n* [IMEI](https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity) regex.\n*/\nconst IMEI_REGEX = /^\\d{15}$|^\\d{2}-\\d{6}-\\d{6}-\\d$/u;\n/**\n* [IPv4](https://en.wikipedia.org/wiki/IPv4) regex.\n*/\nconst IPV4_REGEX = /^(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])(?:\\.(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])){3}$/u;\n/**\n* [IPv6](https://en.wikipedia.org/wiki/IPv6) regex.\n*/\nconst IPV6_REGEX = /^(?:(?:[\\da-f]{1,4}:){7}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,7}:|(?:[\\da-f]{1,4}:){1,6}:[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,5}(?::[\\da-f]{1,4}){1,2}|(?:[\\da-f]{1,4}:){1,4}(?::[\\da-f]{1,4}){1,3}|(?:[\\da-f]{1,4}:){1,3}(?::[\\da-f]{1,4}){1,4}|(?:[\\da-f]{1,4}:){1,2}(?::[\\da-f]{1,4}){1,5}|[\\da-f]{1,4}:(?::[\\da-f]{1,4}){1,6}|:(?:(?::[\\da-f]{1,4}){1,7}|:)|fe80:(?::[\\da-f]{0,4}){0,4}%[\\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)|(?:[\\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d))$/iu;\n/**\n* [IP](https://en.wikipedia.org/wiki/IP_address) regex.\n*/\nconst IP_REGEX = /^(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])(?:\\.(?:(?:[1-9]|1\\d|2[0-4])?\\d|25[0-5])){3}$|^(?:(?:[\\da-f]{1,4}:){7}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,7}:|(?:[\\da-f]{1,4}:){1,6}:[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,5}(?::[\\da-f]{1,4}){1,2}|(?:[\\da-f]{1,4}:){1,4}(?::[\\da-f]{1,4}){1,3}|(?:[\\da-f]{1,4}:){1,3}(?::[\\da-f]{1,4}){1,4}|(?:[\\da-f]{1,4}:){1,2}(?::[\\da-f]{1,4}){1,5}|[\\da-f]{1,4}:(?::[\\da-f]{1,4}){1,6}|:(?:(?::[\\da-f]{1,4}){1,7}|:)|fe80:(?::[\\da-f]{0,4}){0,4}%[\\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)|(?:[\\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d)\\.){3}(?:25[0-5]|(?:2[0-4]|1?\\d)?\\d))$/iu;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date regex.\n*/\nconst ISO_DATE_REGEX = /^\\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\\d|0[1-9]|3[01])$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time regex.\n*/\nconst ISO_DATE_TIME_REGEX = /^\\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\\d|0[1-9]|3[01])[T ](?:0\\d|1\\d|2[0-3]):[0-5]\\d$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time regex.\n*/\nconst ISO_TIME_REGEX = /^(?:0\\d|1\\d|2[0-3]):[0-5]\\d$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time with seconds regex.\n*/\nconst ISO_TIME_SECOND_REGEX = /^(?:0\\d|1\\d|2[0-3])(?::[0-5]\\d){2}$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp regex. Allows a\n* space as a date/time separator and an optional space before the UTC offset.\n*/\nconst ISO_TIMESTAMP_REGEX = /^\\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\\d|0[1-9]|3[01])[T ](?:0\\d|1\\d|2[0-3])(?::[0-5]\\d){2}(?:\\.\\d{1,9})?(?:Z| ?[+-](?:0\\d|1\\d|2[0-3])(?::?[0-5]\\d)?)$/u;\n/**\n* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) week regex.\n*/\nconst ISO_WEEK_REGEX = /^\\d{4}-W(?:0[1-9]|[1-4]\\d|5[0-3])$/u;\n/**\n* [JWS compact serialization](https://datatracker.ietf.org/doc/html/rfc7515#section-3.1)\n* regex.\n*\n* Hint: Empty payload and signature segments are allowed because the\n* Base64URL-encoded representation of an empty octet sequence is an empty\n* string.\n*/\nconst JWS_COMPACT_REGEX = /^(?:[\\w-]{2,3}|(?:[\\w-]{4})+(?:[\\w-]{2,3})?)\\.(?:[\\w-]{2,3}|(?:[\\w-]{4})+(?:[\\w-]{2,3})?)?\\.(?:[\\w-]{2,3}|(?:[\\w-]{4})+(?:[\\w-]{2,3})?)?$/u;\n/**\n* [ISRC](https://en.wikipedia.org/wiki/International_Standard_Recording_Code) regex.\n*/\nconst ISRC_REGEX = /^(?:[A-Z]{2}[A-Z\\d]{3}\\d{7}|[A-Z]{2}-[A-Z\\d]{3}-\\d{2}-\\d{5})$/u;\n/**\n* [MAC](https://en.wikipedia.org/wiki/MAC_address) 48 bit regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst MAC48_REGEX = /^(?:[\\da-fA-F]{2}:){5}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{2}-){5}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{4}\\.){2}[\\da-fA-F]{4}$/u;\n/**\n* [MAC](https://en.wikipedia.org/wiki/MAC_address) 64 bit regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst MAC64_REGEX = /^(?:[\\da-fA-F]{2}:){7}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{2}-){7}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{4}\\.){3}[\\da-fA-F]{4}$|^(?:[\\da-fA-F]{4}:){3}[\\da-fA-F]{4}$/u;\n/**\n* [MAC](https://en.wikipedia.org/wiki/MAC_address) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst MAC_REGEX = /^(?:[\\da-fA-F]{2}:){5}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{2}-){5}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{4}\\.){2}[\\da-fA-F]{4}$|^(?:[\\da-fA-F]{2}:){7}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{2}-){7}[\\da-fA-F]{2}$|^(?:[\\da-fA-F]{4}\\.){3}[\\da-fA-F]{4}$|^(?:[\\da-fA-F]{4}:){3}[\\da-fA-F]{4}$/u;\n/**\n* [Nano ID](https://github.com/ai/nanoid) regex.\n*/\nconst NANO_ID_REGEX = /^[\\w-]+$/u;\n/**\n* [Octal](https://en.wikipedia.org/wiki/Octal) regex.\n*/\nconst OCTAL_REGEX = /^(?:0o)?[0-7]+$/u;\n/**\n* [RFC 5322 email address](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1) regex.\n*\n* Hint: This regex was taken from the [HTML Living Standard Specification](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) and does not perfectly represent RFC 5322.\n*/\nconst RFC_EMAIL_REGEX = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n/**\n* [Slug](https://en.wikipedia.org/wiki/Clean_URL#Slug) regex.\n*/\nconst SLUG_REGEX = /^[\\da-z]+(?:[-_][\\da-z]+)*$/u;\n/**\n* [ULID](https://github.com/ulid/spec) regex.\n*\n* Hint: We decided against the `i` flag for better JSON Schema compatibility.\n*/\nconst ULID_REGEX = /^[\\da-hjkmnp-tv-zA-HJKMNP-TV-Z]{26}$/u;\n/**\n* [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) regex.\n*/\nconst UUID_REGEX = /^[\\da-f]{8}(?:-[\\da-f]{4}){3}-[\\da-f]{12}$/iu;\n\n//#endregion\n//#region src/actions/base64/base64.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction base64(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"base64\",\n\t\treference: base64,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: BASE64_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"Base64\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/bic/bic.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction bic(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"bic\",\n\t\treference: bic,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: BIC_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"BIC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/brand/brand.ts\n/**\n* Creates a brand transformation action.\n*\n* @param name The brand name.\n*\n* @returns A brand action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction brand(name) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"brand\",\n\t\treference: brand,\n\t\tasync: false,\n\t\tname,\n\t\t\"~run\"(dataset) {\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/bytes/bytes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction bytes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"bytes\",\n\t\treference: bytes,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst length$1 = /* @__PURE__ */ _getByteCount(dataset.value);\n\t\t\t\tif (length$1 !== this.requirement) _addIssue(this, \"bytes\", dataset, config$1, { received: `${length$1}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/check/check.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction check(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"check\",\n\t\treference: check,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"input\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/check/checkAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction checkAsync(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"check\",\n\t\treference: checkAsync,\n\t\tasync: true,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !await this.requirement(dataset.value)) _addIssue(this, \"input\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/checkItems/checkItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction checkItems(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"check_items\",\n\t\treference: checkItems,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) for (let index = 0; index < dataset.value.length; index++) {\n\t\t\t\tconst item = dataset.value[index];\n\t\t\t\tif (!this.requirement(item, index, dataset.value)) _addIssue(this, \"item\", dataset, config$1, {\n\t\t\t\t\tinput: item,\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput: dataset.value,\n\t\t\t\t\t\tkey: index,\n\t\t\t\t\t\tvalue: item\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/checkItems/checkItemsAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction checkItemsAsync(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"check_items\",\n\t\treference: checkItemsAsync,\n\t\tasync: true,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst requirementResults = await Promise.all(dataset.value.map(this.requirement));\n\t\t\t\tfor (let index = 0; index < dataset.value.length; index++) if (!requirementResults[index]) {\n\t\t\t\t\tconst item = dataset.value[index];\n\t\t\t\t\t_addIssue(this, \"item\", dataset, config$1, {\n\t\t\t\t\t\tinput: item,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput: dataset.value,\n\t\t\t\t\t\t\tkey: index,\n\t\t\t\t\t\t\tvalue: item\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/creditCard/creditCard.ts\n/**\n* Credit card regex.\n*/\nconst CREDIT_CARD_REGEX = /^(?:\\d{13,19}|\\d{4}(?: \\d{3,6}){2,4}|\\d{4}(?:-\\d{3,6}){2,4})$/u;\n/**\n* Sanitize regex.\n*/\nconst SANITIZE_REGEX = /[- ]/gu;\n/**\n* Provider regex list.\n*/\nconst PROVIDER_REGEX_LIST = [\n\t/^3[47]\\d{13}$/u,\n\t/^3(?:0[0-5]|[68]\\d)\\d{11,13}$/u,\n\t/^6(?:011|5\\d{2})\\d{12,15}$/u,\n\t/^(?:2131|1800|35\\d{3})\\d{11}$/u,\n\t/^5[1-5]\\d{2}|(?:222\\d|22[3-9]\\d|2[3-6]\\d{2}|27[01]\\d|2720)\\d{12}$/u,\n\t/^(?:6[27]\\d{14,17}|81\\d{14,17})$/u,\n\t/^4\\d{12}(?:\\d{3,6})?$/u\n];\n/* @__NO_SIDE_EFFECTS__ */\nfunction creditCard(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"credit_card\",\n\t\treference: creditCard,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement(input) {\n\t\t\tlet sanitized;\n\t\t\treturn CREDIT_CARD_REGEX.test(input) && (sanitized = input.replace(SANITIZE_REGEX, \"\")) && PROVIDER_REGEX_LIST.some((regex$1) => regex$1.test(sanitized)) && /* @__PURE__ */ _isLuhnAlgo(sanitized);\n\t\t},\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"credit card\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/cuid2/cuid2.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction cuid2(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"cuid2\",\n\t\treference: cuid2,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: CUID2_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"Cuid2\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/decimal/decimal.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction decimal(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"decimal\",\n\t\treference: decimal,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: DECIMAL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"decimal\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/description/description.ts\n/**\n* Creates a description metadata action.\n*\n* @param description_ The description text.\n*\n* @returns A description action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction description(description_) {\n\treturn {\n\t\tkind: \"metadata\",\n\t\ttype: \"description\",\n\t\treference: description,\n\t\tdescription: description_\n\t};\n}\n\n//#endregion\n//#region src/actions/digits/digits.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction digits(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"digits\",\n\t\treference: digits,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: DIGITS_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"digits\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/domain/domain.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction domain(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"domain\",\n\t\treference: domain,\n\t\texpects: null,\n\t\tasync: false,\n\t\trequirement: DOMAIN_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"domain\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/email/email.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction email(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"email\",\n\t\treference: email,\n\t\texpects: null,\n\t\tasync: false,\n\t\trequirement: EMAIL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"email\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/emoji/emoji.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction emoji(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"emoji\",\n\t\treference: emoji,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: EMOJI_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"emoji\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/empty/empty.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction empty(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"empty\",\n\t\treference: empty,\n\t\tasync: false,\n\t\texpects: \"0\",\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length > 0) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/endsWith/endsWith.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction endsWith(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ends_with\",\n\t\treference: endsWith,\n\t\tasync: false,\n\t\texpects: `\"${requirement}\"`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.endsWith(this.requirement)) _addIssue(this, \"end\", dataset, config$1, { received: `\"${dataset.value.slice(-this.requirement.length)}\"` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/entries/entries.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction entries(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"entries\",\n\t\treference: entries,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!dataset.typed) return dataset;\n\t\t\tconst count = Object.keys(dataset.value).length;\n\t\t\tif (dataset.typed && count !== this.requirement) _addIssue(this, \"entries\", dataset, config$1, { received: `${count}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/everyItem/everyItem.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction everyItem(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"every_item\",\n\t\treference: everyItem,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.every(this.requirement)) _addIssue(this, \"item\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/examples/examples.ts\n/**\n* Creates an examples metadata action.\n*\n* @param examples_ The examples.\n*\n* @returns An examples action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction examples(examples_) {\n\treturn {\n\t\tkind: \"metadata\",\n\t\ttype: \"examples\",\n\t\treference: examples,\n\t\texamples: examples_\n\t};\n}\n\n//#endregion\n//#region src/actions/excludes/excludes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction excludes(requirement, message$1) {\n\tconst received = /* @__PURE__ */ _stringify(requirement);\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"excludes\",\n\t\treference: excludes,\n\t\tasync: false,\n\t\texpects: `!${received}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.includes(this.requirement)) _addIssue(this, \"content\", dataset, config$1, { received });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/filterItems/filterItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction filterItems(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"filter_items\",\n\t\treference: filterItems,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.filter(this.operation);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/findItem/findItem.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction findItem(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"find_item\",\n\t\treference: findItem,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.find(this.operation);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/finite/finite.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction finite(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"finite\",\n\t\treference: finite,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: Number.isFinite,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"finite\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/flavor/flavor.ts\n/**\n* Creates a flavor transformation action.\n*\n* @param name The flavor name.\n*\n* @returns A flavor action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction flavor(name) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"flavor\",\n\t\treference: flavor,\n\t\tasync: false,\n\t\tname,\n\t\t\"~run\"(dataset) {\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/graphemes/graphemes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction graphemes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"graphemes\",\n\t\treference: graphemes,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getGraphemeCount(dataset.value);\n\t\t\t\tif (count !== this.requirement) _addIssue(this, \"graphemes\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/gtValue/gtValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction gtValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"gt_value\",\n\t\treference: gtValue,\n\t\tasync: false,\n\t\texpects: `>${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !(dataset.value > this.requirement)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/guard/guard.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction guard(requirement, message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"guard\",\n\t\treference: guard,\n\t\tasync: false,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) {\n\t\t\t\t_addIssue(this, \"input\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/hash/hash.ts\n/**\n* Hash lengths object.\n*/\nconst HASH_LENGTHS = {\n\tmd4: 32,\n\tmd5: 32,\n\tsha1: 40,\n\tsha256: 64,\n\tsha384: 96,\n\tsha512: 128,\n\tripemd128: 32,\n\tripemd160: 40,\n\ttiger128: 32,\n\ttiger160: 40,\n\ttiger192: 48,\n\tcrc32: 8,\n\tcrc32b: 8,\n\tadler32: 8\n};\n/* @__NO_SIDE_EFFECTS__ */\nfunction hash(types, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"hash\",\n\t\treference: hash,\n\t\texpects: null,\n\t\tasync: false,\n\t\trequirement: RegExp(types.map((type) => `^[a-fA-F0-9]{${HASH_LENGTHS[type]}}$`).join(\"|\"), \"u\"),\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"hash\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/hexadecimal/hexadecimal.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction hexadecimal(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"hexadecimal\",\n\t\treference: hexadecimal,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: HEXADECIMAL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"hexadecimal\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/hexColor/hexColor.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction hexColor(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"hex_color\",\n\t\treference: hexColor,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: HEX_COLOR_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"hex color\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/imei/imei.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction imei(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"imei\",\n\t\treference: imei,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement(input) {\n\t\t\treturn IMEI_REGEX.test(input) && /* @__PURE__ */ _isLuhnAlgo(input);\n\t\t},\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"IMEI\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/includes/includes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction includes(requirement, message$1) {\n\tconst expects = /* @__PURE__ */ _stringify(requirement);\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"includes\",\n\t\treference: includes,\n\t\tasync: false,\n\t\texpects,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.includes(this.requirement)) _addIssue(this, \"content\", dataset, config$1, { received: `!${expects}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/integer/integer.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction integer(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"integer\",\n\t\treference: integer,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: Number.isInteger,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"integer\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ip/ip.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ip(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ip\",\n\t\treference: ip,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: IP_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"IP\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ipv4/ipv4.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ipv4(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ipv4\",\n\t\treference: ipv4,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: IPV4_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"IPv4\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ipv6/ipv6.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ipv6(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ipv6\",\n\t\treference: ipv6,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: IPV6_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"IPv6\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isbn/utils/_isIsbn10.ts\n/**\n* [Validates an ISBN-10](https://en.wikipedia.org/wiki/ISBN#ISBN-10_check_digits).\n*\n* @param input The input value.\n*\n* @returns `true` if the input is a valid ISBN-10, `false` otherwise.\n*\n* @internal\n*/\nfunction _isIsbn10(input) {\n\tconst digits$1 = input.split(\"\").map((c) => c === \"X\" ? 10 : parseInt(c));\n\tlet sum = 0;\n\tfor (let i = 0; i < 10; i++) sum += digits$1[i] * (10 - i);\n\treturn sum % 11 === 0;\n}\n\n//#endregion\n//#region src/actions/isbn/utils/_isIsbn13.ts\n/**\n* [Validates an ISBN-13](https://en.wikipedia.org/wiki/ISBN#ISBN-13_check_digit_calculation).\n*\n* @param input The input value.\n*\n* @returns `true` if the input is a valid ISBN-13, `false` otherwise.\n*\n* @internal\n*/\nfunction _isIsbn13(input) {\n\tconst digits$1 = input.split(\"\").map((c) => parseInt(c));\n\tlet sum = 0;\n\tfor (let i = 0; i < 13; i++) sum += digits$1[i] * (i % 2 === 0 ? 1 : 3);\n\treturn sum % 10 === 0;\n}\n\n//#endregion\n//#region src/actions/isbn/isbn.ts\n/**\n* ISBN separator regex.\n*/\nconst ISBN_SEPARATOR_REGEX = /[- ]/gu;\n/**\n* ISBN-10 detection regex.\n*/\nconst ISBN_10_DETECTION_REGEX = /^\\d{9}[\\dX]$/u;\n/**\n* ISBN-13 detection regex.\n*/\nconst ISBN_13_DETECTION_REGEX = /^\\d{13}$/u;\n/* @__NO_SIDE_EFFECTS__ */\nfunction isbn(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"isbn\",\n\t\treference: isbn,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement(input) {\n\t\t\tconst replacedInput = input.replace(ISBN_SEPARATOR_REGEX, \"\");\n\t\t\tif (ISBN_10_DETECTION_REGEX.test(replacedInput)) return _isIsbn10(replacedInput);\n\t\t\telse if (ISBN_13_DETECTION_REGEX.test(replacedInput)) return _isIsbn13(replacedInput);\n\t\t\treturn false;\n\t\t},\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"ISBN\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isrc/isrc.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isrc(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"isrc\",\n\t\treference: isrc,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISRC_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"ISRC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoDate/isoDate.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoDate(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_date\",\n\t\treference: isoDate,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_DATE_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"date\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoDateTime/isoDateTime.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoDateTime(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_date_time\",\n\t\treference: isoDateTime,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_DATE_TIME_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"date-time\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoTime/isoTime.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoTime(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_time\",\n\t\treference: isoTime,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_TIME_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"time\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoTimeSecond/isoTimeSecond.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoTimeSecond(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_time_second\",\n\t\treference: isoTimeSecond,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_TIME_SECOND_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"time-second\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoTimestamp/isoTimestamp.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoTimestamp(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_timestamp\",\n\t\treference: isoTimestamp,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_TIMESTAMP_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"timestamp\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/isoWeek/isoWeek.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction isoWeek(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"iso_week\",\n\t\treference: isoWeek,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ISO_WEEK_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"week\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/jwsCompact/jwsCompact.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction jwsCompact(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"jws_compact\",\n\t\treference: jwsCompact,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: JWS_COMPACT_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"JWS compact\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/length/length.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction length(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"length\",\n\t\treference: length,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length !== this.requirement) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ltValue/ltValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ltValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"lt_value\",\n\t\treference: ltValue,\n\t\tasync: false,\n\t\texpects: `<${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !(dataset.value < this.requirement)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/mac/mac.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mac(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"mac\",\n\t\treference: mac,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: MAC_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"MAC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/mac48/mac48.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mac48(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"mac48\",\n\t\treference: mac48,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: MAC48_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"48-bit MAC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/mac64/mac64.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mac64(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"mac64\",\n\t\treference: mac64,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: MAC64_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"64-bit MAC\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/mapItems/mapItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mapItems(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"map_items\",\n\t\treference: mapItems,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.map(this.operation);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxBytes/maxBytes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxBytes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_bytes\",\n\t\treference: maxBytes,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst length$1 = /* @__PURE__ */ _getByteCount(dataset.value);\n\t\t\t\tif (length$1 > this.requirement) _addIssue(this, \"bytes\", dataset, config$1, { received: `${length$1}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxEntries/maxEntries.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxEntries(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_entries\",\n\t\treference: maxEntries,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!dataset.typed) return dataset;\n\t\t\tconst count = Object.keys(dataset.value).length;\n\t\t\tif (dataset.typed && count > this.requirement) _addIssue(this, \"entries\", dataset, config$1, { received: `${count}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxGraphemes/maxGraphemes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxGraphemes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_graphemes\",\n\t\treference: maxGraphemes,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getGraphemeCount(dataset.value);\n\t\t\t\tif (count > this.requirement) _addIssue(this, \"graphemes\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxLength/maxLength.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxLength(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_length\",\n\t\treference: maxLength,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length > this.requirement) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxSize/maxSize.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxSize(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_size\",\n\t\treference: maxSize,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.size > this.requirement) _addIssue(this, \"size\", dataset, config$1, { received: `${dataset.value.size}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxValue/maxValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_value\",\n\t\treference: maxValue,\n\t\tasync: false,\n\t\texpects: `<=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !(dataset.value <= this.requirement)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/maxWords/maxWords.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction maxWords(locales, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"max_words\",\n\t\treference: maxWords,\n\t\tasync: false,\n\t\texpects: `<=${requirement}`,\n\t\tlocales,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value);\n\t\t\t\tif (count > this.requirement) _addIssue(this, \"words\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/metadata/metadata.ts\n/**\n* Creates a custom metadata action.\n*\n* @param metadata_ The metadata object.\n*\n* @returns A metadata action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction metadata(metadata_) {\n\treturn {\n\t\tkind: \"metadata\",\n\t\ttype: \"metadata\",\n\t\treference: metadata,\n\t\tmetadata: metadata_\n\t};\n}\n\n//#endregion\n//#region src/actions/mimeType/mimeType.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mimeType(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"mime_type\",\n\t\treference: mimeType,\n\t\tasync: false,\n\t\texpects: /* @__PURE__ */ _joinExpects(requirement.map((option) => `\"${option}\"`), \"|\"),\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.includes(dataset.value.type)) _addIssue(this, \"MIME type\", dataset, config$1, { received: `\"${dataset.value.type}\"` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minBytes/minBytes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minBytes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_bytes\",\n\t\treference: minBytes,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst length$1 = /* @__PURE__ */ _getByteCount(dataset.value);\n\t\t\t\tif (length$1 < this.requirement) _addIssue(this, \"bytes\", dataset, config$1, { received: `${length$1}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minEntries/minEntries.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minEntries(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_entries\",\n\t\treference: minEntries,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!dataset.typed) return dataset;\n\t\t\tconst count = Object.keys(dataset.value).length;\n\t\t\tif (dataset.typed && count < this.requirement) _addIssue(this, \"entries\", dataset, config$1, { received: `${count}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minGraphemes/minGraphemes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minGraphemes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_graphemes\",\n\t\treference: minGraphemes,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getGraphemeCount(dataset.value);\n\t\t\t\tif (count < this.requirement) _addIssue(this, \"graphemes\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minLength/minLength.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minLength(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_length\",\n\t\treference: minLength,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length < this.requirement) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minSize/minSize.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minSize(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_size\",\n\t\treference: minSize,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.size < this.requirement) _addIssue(this, \"size\", dataset, config$1, { received: `${dataset.value.size}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minValue/minValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_value\",\n\t\treference: minValue,\n\t\tasync: false,\n\t\texpects: `>=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !(dataset.value >= this.requirement)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/minWords/minWords.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction minWords(locales, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"min_words\",\n\t\treference: minWords,\n\t\tasync: false,\n\t\texpects: `>=${requirement}`,\n\t\tlocales,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value);\n\t\t\t\tif (count < this.requirement) _addIssue(this, \"words\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/multipleOf/multipleOf.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction multipleOf(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"multiple_of\",\n\t\treference: multipleOf,\n\t\tasync: false,\n\t\texpects: `%${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value % this.requirement != 0) _addIssue(this, \"multiple\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/nanoid/nanoid.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nanoid(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"nanoid\",\n\t\treference: nanoid,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: NANO_ID_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"Nano ID\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/nonEmpty/nonEmpty.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonEmpty(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"non_empty\",\n\t\treference: nonEmpty,\n\t\tasync: false,\n\t\texpects: \"!0\",\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length === 0) _addIssue(this, \"length\", dataset, config$1, { received: \"0\" });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/normalize/normalize.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction normalize(form) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"normalize\",\n\t\treference: normalize,\n\t\tasync: false,\n\t\tform,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.normalize(this.form);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notBytes/notBytes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notBytes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_bytes\",\n\t\treference: notBytes,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst length$1 = /* @__PURE__ */ _getByteCount(dataset.value);\n\t\t\t\tif (length$1 === this.requirement) _addIssue(this, \"bytes\", dataset, config$1, { received: `${length$1}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notEntries/notEntries.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notEntries(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_entries\",\n\t\treference: notEntries,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!dataset.typed) return dataset;\n\t\t\tconst count = Object.keys(dataset.value).length;\n\t\t\tif (dataset.typed && count === this.requirement) _addIssue(this, \"entries\", dataset, config$1, { received: `${count}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notGraphemes/notGraphemes.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notGraphemes(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_graphemes\",\n\t\treference: notGraphemes,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getGraphemeCount(dataset.value);\n\t\t\t\tif (count === this.requirement) _addIssue(this, \"graphemes\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notLength/notLength.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notLength(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_length\",\n\t\treference: notLength,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.length === this.requirement) _addIssue(this, \"length\", dataset, config$1, { received: `${dataset.value.length}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notSize/notSize.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notSize(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_size\",\n\t\treference: notSize,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.size === this.requirement) _addIssue(this, \"size\", dataset, config$1, { received: `${dataset.value.size}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notValue/notValue.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notValue(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_value\",\n\t\treference: notValue,\n\t\tasync: false,\n\t\texpects: requirement instanceof Date ? `!${requirement.toJSON()}` : `!${/* @__PURE__ */ _stringify(requirement)}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && this.requirement <= dataset.value && this.requirement >= dataset.value) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notValues/notValues.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notValues(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_values\",\n\t\treference: notValues,\n\t\tasync: false,\n\t\texpects: `!${/* @__PURE__ */ _joinExpects(requirement.map((value$1) => value$1 instanceof Date ? value$1.toJSON() : /* @__PURE__ */ _stringify(value$1)), \"|\")}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && this.requirement.some((value$1) => value$1 <= dataset.value && value$1 >= dataset.value)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/notWords/notWords.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction notWords(locales, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"not_words\",\n\t\treference: notWords,\n\t\tasync: false,\n\t\texpects: `!${requirement}`,\n\t\tlocales,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value);\n\t\t\t\tif (count === this.requirement) _addIssue(this, \"words\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/octal/octal.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction octal(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"octal\",\n\t\treference: octal,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: OCTAL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"octal\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/parseBoolean/parseBoolean.ts\nconst TRUTHY = [\n\ttrue,\n\t1,\n\t\"true\",\n\t\"1\",\n\t\"yes\",\n\t\"y\",\n\t\"on\",\n\t\"enabled\"\n];\nconst FALSY = [\n\tfalse,\n\t0,\n\t\"false\",\n\t\"0\",\n\t\"no\",\n\t\"n\",\n\t\"off\",\n\t\"disabled\"\n];\n/* @__NO_SIDE_EFFECTS__ */\nfunction parseBoolean(config$1, message$1) {\n\tconst normalize$1 = (v) => typeof v === \"string\" ? v.toLowerCase() : v;\n\tconst truthyRaw = config$1?.truthy ?? TRUTHY;\n\tconst falsyRaw = config$1?.falsy ?? FALSY;\n\tconst truthy = config$1?.truthy ? config$1.truthy.map(normalize$1) : TRUTHY;\n\tconst falsy = config$1?.falsy ? config$1.falsy.map(normalize$1) : FALSY;\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"parse_boolean\",\n\t\treference: parseBoolean,\n\t\texpects: /* @__PURE__ */ _joinExpects([...truthyRaw, ...falsyRaw].map(_stringify), \"|\"),\n\t\tconfig: config$1,\n\t\tmessage: message$1,\n\t\tasync: false,\n\t\t\"~run\"(dataset, config$2) {\n\t\t\tconst input = normalize$1(dataset.value);\n\t\t\tif (truthy.includes(input)) dataset.value = true;\n\t\t\telse if (falsy.includes(input)) dataset.value = false;\n\t\t\telse {\n\t\t\t\t_addIssue(this, \"boolean\", dataset, config$2);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/parseJson/parseJson.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction parseJson(config$1, message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"parse_json\",\n\t\treference: parseJson,\n\t\tconfig: config$1,\n\t\tmessage: message$1,\n\t\tasync: false,\n\t\t\"~run\"(dataset, config$2) {\n\t\t\ttry {\n\t\t\t\tdataset.value = JSON.parse(dataset.value, this.config?.reviver);\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof Error) {\n\t\t\t\t\t_addIssue(this, \"JSON\", dataset, config$2, { received: `\"${error.message}\"` });\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t} else throw error;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/partialCheck/utils/_isPartiallyTyped/_isPartiallyTyped.ts\n/**\n* Checks if a dataset is partially typed.\n*\n* @param dataset The dataset to check.\n* @param paths The paths to check.\n*\n* @returns Whether it is partially typed.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _isPartiallyTyped(dataset, paths) {\n\tif (dataset.issues) for (const path of paths) for (const issue of dataset.issues) {\n\t\tlet typed = false;\n\t\tconst bound = Math.min(path.length, issue.path?.length ?? 0);\n\t\tfor (let index = 0; index < bound; index++) if (path[index] !== issue.path[index].key && (path[index] !== \"$\" || issue.path[index].type !== \"array\")) {\n\t\t\ttyped = true;\n\t\t\tbreak;\n\t\t}\n\t\tif (!typed) return false;\n\t}\n\treturn true;\n}\n\n//#endregion\n//#region src/actions/partialCheck/partialCheck.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction partialCheck(paths, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"partial_check\",\n\t\treference: partialCheck,\n\t\tasync: false,\n\t\texpects: null,\n\t\tpaths,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif ((dataset.typed || /* @__PURE__ */ _isPartiallyTyped(dataset, paths)) && !this.requirement(dataset.value)) _addIssue(this, \"input\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/partialCheck/partialCheckAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction partialCheckAsync(paths, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"partial_check\",\n\t\treference: partialCheckAsync,\n\t\tasync: true,\n\t\texpects: null,\n\t\tpaths,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif ((dataset.typed || /* @__PURE__ */ _isPartiallyTyped(dataset, paths)) && !await this.requirement(dataset.value)) _addIssue(this, \"input\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rawCheck/rawCheck.ts\n/**\n* Creates a raw check validation action.\n*\n* @param action The validation action.\n*\n* @returns A raw check action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction rawCheck(action) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"raw_check\",\n\t\treference: rawCheck,\n\t\tasync: false,\n\t\texpects: null,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\taction({\n\t\t\t\tdataset,\n\t\t\t\tconfig: config$1,\n\t\t\t\taddIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config$1, info)\n\t\t\t});\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rawCheck/rawCheckAsync.ts\n/**\n* Creates a raw check validation action.\n*\n* @param action The validation action.\n*\n* @returns A raw check action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction rawCheckAsync(action) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"raw_check\",\n\t\treference: rawCheckAsync,\n\t\tasync: true,\n\t\texpects: null,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tawait action({\n\t\t\t\tdataset,\n\t\t\t\tconfig: config$1,\n\t\t\t\taddIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config$1, info)\n\t\t\t});\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rawTransform/rawTransform.ts\n/**\n* Creates a raw transformation action.\n*\n* @param action The transformation action.\n*\n* @returns A raw transform action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction rawTransform(action) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"raw_transform\",\n\t\treference: rawTransform,\n\t\tasync: false,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst output = action({\n\t\t\t\tdataset,\n\t\t\t\tconfig: config$1,\n\t\t\t\taddIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config$1, info),\n\t\t\t\tNEVER: null\n\t\t\t});\n\t\t\tif (dataset.issues) dataset.typed = false;\n\t\t\telse dataset.value = output;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rawTransform/rawTransformAsync.ts\n/**\n* Creates a raw transformation action.\n*\n* @param action The transformation action.\n*\n* @returns A raw transform action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction rawTransformAsync(action) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"raw_transform\",\n\t\treference: rawTransformAsync,\n\t\tasync: true,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst output = await action({\n\t\t\t\tdataset,\n\t\t\t\tconfig: config$1,\n\t\t\t\taddIssue: (info) => _addIssue(this, info?.label ?? \"input\", dataset, config$1, info),\n\t\t\t\tNEVER: null\n\t\t\t});\n\t\t\tif (dataset.issues) dataset.typed = false;\n\t\t\telse dataset.value = output;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/readonly/readonly.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction readonly() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"readonly\",\n\t\treference: readonly,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/reduceItems/reduceItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction reduceItems(operation, initial) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"reduce_items\",\n\t\treference: reduceItems,\n\t\tasync: false,\n\t\toperation,\n\t\tinitial,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.reduce(this.operation, this.initial);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/regex/regex.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction regex(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"regex\",\n\t\treference: regex,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"format\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/returns/returns.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction returns(schema) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"returns\",\n\t\treference: returns,\n\t\tasync: false,\n\t\tschema,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst func = dataset.value;\n\t\t\tdataset.value = (...args_) => {\n\t\t\t\tconst returnsDataset = this.schema[\"~run\"]({ value: func(...args_) }, config$1);\n\t\t\t\tif (returnsDataset.issues) throw new ValiError(returnsDataset.issues);\n\t\t\t\treturn returnsDataset.value;\n\t\t\t};\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/returns/returnsAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction returnsAsync(schema) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"returns\",\n\t\treference: returnsAsync,\n\t\tasync: false,\n\t\tschema,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst func = dataset.value;\n\t\t\tdataset.value = async (...args_) => {\n\t\t\t\tconst returnsDataset = await this.schema[\"~run\"]({ value: await func(...args_) }, config$1);\n\t\t\t\tif (returnsDataset.issues) throw new ValiError(returnsDataset.issues);\n\t\t\t\treturn returnsDataset.value;\n\t\t\t};\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/rfcEmail/rfcEmail.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction rfcEmail(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"rfc_email\",\n\t\treference: rfcEmail,\n\t\texpects: null,\n\t\tasync: false,\n\t\trequirement: RFC_EMAIL_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"email\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/safeInteger/safeInteger.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction safeInteger(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"safe_integer\",\n\t\treference: safeInteger,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: Number.isSafeInteger,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"safe integer\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/size/size.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction size(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"size\",\n\t\treference: size,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && dataset.value.size !== this.requirement) _addIssue(this, \"size\", dataset, config$1, { received: `${dataset.value.size}` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/slug/slug.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction slug(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"slug\",\n\t\treference: slug,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: SLUG_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"slug\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/someItem/someItem.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction someItem(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"some_item\",\n\t\treference: someItem,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.some(this.requirement)) _addIssue(this, \"item\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/sortItems/sortItems.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction sortItems(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"sort_items\",\n\t\treference: sortItems,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.sort(this.operation);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/startsWith/startsWith.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction startsWith(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"starts_with\",\n\t\treference: startsWith,\n\t\tasync: false,\n\t\texpects: `\"${requirement}\"`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !dataset.value.startsWith(this.requirement)) _addIssue(this, \"start\", dataset, config$1, { received: `\"${dataset.value.slice(0, this.requirement.length)}\"` });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/stringifyJson/stringifyJson.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction stringifyJson(config$1, message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"stringify_json\",\n\t\treference: stringifyJson,\n\t\tmessage: message$1,\n\t\tconfig: config$1,\n\t\tasync: false,\n\t\t\"~run\"(dataset, config$2) {\n\t\t\ttry {\n\t\t\t\tconst output = JSON.stringify(dataset.value, this.config?.replacer, this.config?.space);\n\t\t\t\tif (output === void 0) {\n\t\t\t\t\t_addIssue(this, \"JSON\", dataset, config$2);\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t}\n\t\t\t\tdataset.value = output;\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof Error) {\n\t\t\t\t\t_addIssue(this, \"JSON\", dataset, config$2, { received: `\"${error.message}\"` });\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t} else throw error;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/title/title.ts\n/**\n* Creates a title metadata action.\n*\n* @param title_ The title text.\n*\n* @returns A title action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction title(title_) {\n\treturn {\n\t\tkind: \"metadata\",\n\t\ttype: \"title\",\n\t\treference: title,\n\t\ttitle: title_\n\t};\n}\n\n//#endregion\n//#region src/actions/toBigint/toBigint.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction toBigint(message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_bigint\",\n\t\treference: toBigint,\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\ttry {\n\t\t\t\tdataset.value = BigInt(dataset.value);\n\t\t\t} catch {\n\t\t\t\t_addIssue(this, \"bigint\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toBoolean/toBoolean.ts\n/**\n* Creates a to boolean transformation action.\n*\n* @returns A to boolean action.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toBoolean() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_boolean\",\n\t\treference: toBoolean,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = Boolean(dataset.value);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toDate/toDate.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction toDate(message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_date\",\n\t\treference: toDate,\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\ttry {\n\t\t\t\tdataset.value = new Date(dataset.value);\n\t\t\t\tif (isNaN(dataset.value)) {\n\t\t\t\t\t_addIssue(this, \"date\", dataset, config$1, { received: \"\\\"Invalid Date\\\"\" });\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t_addIssue(this, \"date\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toLowerCase/toLowerCase.ts\n/**\n* Creates a to lower case transformation action.\n*\n* @returns A to lower case action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toLowerCase() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_lower_case\",\n\t\treference: toLowerCase,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.toLowerCase();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toMaxValue/toMaxValue.ts\n/**\n* Creates a to max value transformation action.\n*\n* @param requirement The maximum value.\n*\n* @returns A to max value action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toMaxValue(requirement) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_max_value\",\n\t\treference: toMaxValue,\n\t\tasync: false,\n\t\trequirement,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value > this.requirement ? this.requirement : dataset.value;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toMinValue/toMinValue.ts\n/**\n* Creates a to min value transformation action.\n*\n* @param requirement The minimum value.\n*\n* @returns A to min value action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toMinValue(requirement) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_min_value\",\n\t\treference: toMinValue,\n\t\tasync: false,\n\t\trequirement,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value < this.requirement ? this.requirement : dataset.value;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toNumber/toNumber.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction toNumber(message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_number\",\n\t\treference: toNumber,\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\ttry {\n\t\t\t\tdataset.value = Number(dataset.value);\n\t\t\t\tif (isNaN(dataset.value)) {\n\t\t\t\t\t_addIssue(this, \"number\", dataset, config$1);\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t_addIssue(this, \"number\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toString/toString.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction toString(message$1) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_string\",\n\t\treference: toString,\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\ttry {\n\t\t\t\tdataset.value = String(dataset.value);\n\t\t\t} catch {\n\t\t\t\t_addIssue(this, \"string\", dataset, config$1);\n\t\t\t\tdataset.typed = false;\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/toUpperCase/toUpperCase.ts\n/**\n* Creates a to upper case transformation action.\n*\n* @returns A to upper case action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction toUpperCase() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"to_upper_case\",\n\t\treference: toUpperCase,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.toUpperCase();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/transform/transform.ts\n/**\n* Creates a custom transformation action.\n*\n* @param operation The transformation operation.\n*\n* @returns A transform action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction transform(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"transform\",\n\t\treference: transform,\n\t\tasync: false,\n\t\toperation,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = this.operation(dataset.value);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/transform/transformAsync.ts\n/**\n* Creates a custom transformation action.\n*\n* @param operation The transformation operation.\n*\n* @returns A transform action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction transformAsync(operation) {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"transform\",\n\t\treference: transformAsync,\n\t\tasync: true,\n\t\toperation,\n\t\tasync \"~run\"(dataset) {\n\t\t\tdataset.value = await this.operation(dataset.value);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/trim/trim.ts\n/**\n* Creates a trim transformation action.\n*\n* @returns A trim action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction trim() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"trim\",\n\t\treference: trim,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.trim();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/trimEnd/trimEnd.ts\n/**\n* Creates a trim end transformation action.\n*\n* @returns A trim end action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction trimEnd() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"trim_end\",\n\t\treference: trimEnd,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.trimEnd();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/trimStart/trimStart.ts\n/**\n* Creates a trim start transformation action.\n*\n* @returns A trim start action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction trimStart() {\n\treturn {\n\t\tkind: \"transformation\",\n\t\ttype: \"trim_start\",\n\t\treference: trimStart,\n\t\tasync: false,\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.value = dataset.value.trimStart();\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/ulid/ulid.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction ulid(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"ulid\",\n\t\treference: ulid,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: ULID_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"ULID\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/url/url.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction url(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"url\",\n\t\treference: url,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement(input) {\n\t\t\ttry {\n\t\t\t\tnew URL(input);\n\t\t\t\treturn true;\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, \"URL\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/uuid/uuid.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction uuid(message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"uuid\",\n\t\treference: uuid,\n\t\tasync: false,\n\t\texpects: null,\n\t\trequirement: UUID_REGEX,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, \"UUID\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/value/value.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction value(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"value\",\n\t\treference: value,\n\t\tasync: false,\n\t\texpects: requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement),\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !(this.requirement <= dataset.value && this.requirement >= dataset.value)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/values/values.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction values(requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"values\",\n\t\treference: values,\n\t\tasync: false,\n\t\texpects: `${/* @__PURE__ */ _joinExpects(requirement.map((value$1) => value$1 instanceof Date ? value$1.toJSON() : /* @__PURE__ */ _stringify(value$1)), \"|\")}`,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed && !this.requirement.some((value$1) => value$1 <= dataset.value && value$1 >= dataset.value)) _addIssue(this, \"value\", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/actions/words/words.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction words(locales, requirement, message$1) {\n\treturn {\n\t\tkind: \"validation\",\n\t\ttype: \"words\",\n\t\treference: words,\n\t\tasync: false,\n\t\texpects: `${requirement}`,\n\t\tlocales,\n\t\trequirement,\n\t\tmessage: message$1,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.typed) {\n\t\t\t\tconst count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value);\n\t\t\t\tif (count !== this.requirement) _addIssue(this, \"words\", dataset, config$1, { received: `${count}` });\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/assert/assert.ts\n/**\n* Checks if the input matches the schema. As this is an assertion function, it\n* can be used as a type guard.\n*\n* @param schema The schema to be used.\n* @param input The input to be tested.\n*/\nfunction assert(schema, input) {\n\tconst issues = schema[\"~run\"]({ value: input }, { abortEarly: true }).issues;\n\tif (issues) throw new ValiError(issues);\n}\n\n//#endregion\n//#region src/methods/cache/_LruCache.ts\n/**\n* Efficient LRU cache using Map iteration order.\n*/\nvar _LruCache = class {\n\tconstructor(config$1) {\n\t\tthis.refCount = 0;\n\t\tthis.maxSize = config$1?.maxSize ?? 1e3;\n\t\tthis.maxAge = config$1?.maxAge ?? Infinity;\n\t\tthis.hasMaxAge = isFinite(this.maxAge);\n\t}\n\t/**\n\t* Stringifies an unknown input to a cache key component.\n\t*\n\t* @param input The unknown input.\n\t*\n\t* @returns A cache key component.\n\t*/\n\t#stringify(input) {\n\t\tconst type = typeof input;\n\t\tif (type === \"string\") return `\"${input}\"`;\n\t\tif (type === \"number\" || type === \"boolean\") return `${input}`;\n\t\tif (type === \"bigint\") return `${input}n`;\n\t\tif (type === \"object\" || type === \"function\") {\n\t\t\tif (input) {\n\t\t\t\tthis.refIds ??= /* @__PURE__ */ new WeakMap();\n\t\t\t\tlet id = this.refIds.get(input);\n\t\t\t\tif (!id) {\n\t\t\t\t\tid = ++this.refCount;\n\t\t\t\t\tthis.refIds.set(input, id);\n\t\t\t\t}\n\t\t\t\treturn `#${id}`;\n\t\t\t}\n\t\t\treturn \"null\";\n\t\t}\n\t\treturn type;\n\t}\n\t/**\n\t* Creates a cache key from input and config.\n\t*\n\t* @param input The input value.\n\t* @param config The parse configuration.\n\t*\n\t* @returns The cache key.\n\t*/\n\tkey(input, config$1 = {}) {\n\t\treturn `${this.#stringify(input)}|${this.#stringify(config$1.lang)}|${this.#stringify(config$1.message)}|${this.#stringify(config$1.abortEarly)}|${this.#stringify(config$1.abortPipeEarly)}`;\n\t}\n\t/**\n\t* Gets a value from the cache by key.\n\t*\n\t* @param key The cache key.\n\t*\n\t* @returns The cached value.\n\t*/\n\tget(key) {\n\t\tif (!this.store) return void 0;\n\t\tconst entry = this.store.get(key);\n\t\tif (!entry) return void 0;\n\t\tif (this.hasMaxAge && Date.now() - entry[1] > this.maxAge) {\n\t\t\tthis.store.delete(key);\n\t\t\treturn;\n\t\t}\n\t\tthis.store.delete(key);\n\t\tthis.store.set(key, entry);\n\t\treturn entry[0];\n\t}\n\t/**\n\t* Sets a value in the cache by key.\n\t*\n\t* @param key The cache key.\n\t* @param value The cached value.\n\t*/\n\tset(key, value$1) {\n\t\tthis.store ??= /* @__PURE__ */ new Map();\n\t\tthis.store.delete(key);\n\t\tconst timestamp = this.hasMaxAge ? Date.now() : 0;\n\t\tthis.store.set(key, [value$1, timestamp]);\n\t\tif (this.store.size > this.maxSize) this.store.delete(this.store.keys().next().value);\n\t}\n\t/**\n\t* Clears all entries from the cache.\n\t*/\n\tclear() {\n\t\tthis.store?.clear();\n\t}\n};\n\n//#endregion\n//#region src/methods/cache/cache.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction cache(schema, config$1) {\n\treturn {\n\t\t...schema,\n\t\tcacheConfig: config$1,\n\t\tcache: new _LruCache(config$1),\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, runConfig) {\n\t\t\tconst key = this.cache.key(dataset.value, runConfig);\n\t\t\tlet outputDataset = this.cache.get(key);\n\t\t\tif (!outputDataset) this.cache.set(key, outputDataset = schema[\"~run\"](dataset, runConfig));\n\t\t\treturn /* @__PURE__ */ _cloneDataset(outputDataset);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/cache/cacheAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction cacheAsync(schema, config$1) {\n\tlet activeRuns;\n\treturn {\n\t\t...schema,\n\t\tasync: true,\n\t\tcacheConfig: config$1,\n\t\tcache: new _LruCache(config$1),\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, runConfig) {\n\t\t\tconst key = this.cache.key(dataset.value, runConfig);\n\t\t\tconst cached = this.cache.get(key);\n\t\t\tif (cached) return /* @__PURE__ */ _cloneDataset(cached);\n\t\t\tlet promise$1 = activeRuns?.get(key);\n\t\t\tif (!promise$1) {\n\t\t\t\tactiveRuns ??= /* @__PURE__ */ new Map();\n\t\t\t\tpromise$1 = Promise.resolve(schema[\"~run\"](dataset, runConfig));\n\t\t\t\tactiveRuns.set(key, promise$1);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst outputDataset = await promise$1;\n\t\t\t\tthis.cache.set(key, outputDataset);\n\t\t\t\treturn /* @__PURE__ */ _cloneDataset(outputDataset);\n\t\t\t} finally {\n\t\t\t\tactiveRuns?.delete(key);\n\t\t\t}\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/config/config.ts\n/**\n* Changes the local configuration of a schema.\n*\n* @param schema The schema to configure.\n* @param config The parse configuration.\n*\n* @returns The configured schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction config(schema, config$1) {\n\treturn {\n\t\t...schema,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config_) {\n\t\t\treturn schema[\"~run\"](dataset, {\n\t\t\t\t...config_,\n\t\t\t\t...config$1\n\t\t\t});\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/getFallback/getFallback.ts\n/**\n* Returns the fallback value of the schema.\n*\n* @param schema The schema to get it from.\n* @param dataset The output dataset if available.\n* @param config The config if available.\n*\n* @returns The fallback value.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getFallback(schema, dataset, config$1) {\n\treturn typeof schema.fallback === \"function\" ? schema.fallback(dataset, config$1) : schema.fallback;\n}\n\n//#endregion\n//#region src/methods/fallback/fallback.ts\n/**\n* Returns a fallback value as output if the input does not match the schema.\n*\n* @param schema The schema to catch.\n* @param fallback The fallback value.\n*\n* @returns The passed schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction fallback(schema, fallback$1) {\n\treturn {\n\t\t...schema,\n\t\tfallback: fallback$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst outputDataset = schema[\"~run\"](dataset, config$1);\n\t\t\treturn outputDataset.issues ? {\n\t\t\t\ttyped: true,\n\t\t\t\tvalue: /* @__PURE__ */ getFallback(this, outputDataset, config$1)\n\t\t\t} : outputDataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/fallback/fallbackAsync.ts\n/**\n* Returns a fallback value as output if the input does not match the schema.\n*\n* @param schema The schema to catch.\n* @param fallback The fallback value.\n*\n* @returns The passed schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction fallbackAsync(schema, fallback$1) {\n\treturn {\n\t\t...schema,\n\t\tfallback: fallback$1,\n\t\tasync: true,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst outputDataset = await schema[\"~run\"](dataset, config$1);\n\t\t\treturn outputDataset.issues ? {\n\t\t\t\ttyped: true,\n\t\t\t\tvalue: await /* @__PURE__ */ getFallback(this, outputDataset, config$1)\n\t\t\t} : outputDataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/flatten/flatten.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction flatten(issues) {\n\tconst flatErrors = {};\n\tfor (const issue of issues) if (issue.path) {\n\t\tconst dotPath = /* @__PURE__ */ getDotPath(issue);\n\t\tif (dotPath) {\n\t\t\tif (!flatErrors.nested) flatErrors.nested = {};\n\t\t\tif (flatErrors.nested[dotPath]) flatErrors.nested[dotPath].push(issue.message);\n\t\t\telse flatErrors.nested[dotPath] = [issue.message];\n\t\t} else if (flatErrors.other) flatErrors.other.push(issue.message);\n\t\telse flatErrors.other = [issue.message];\n\t} else if (flatErrors.root) flatErrors.root.push(issue.message);\n\telse flatErrors.root = [issue.message];\n\treturn flatErrors;\n}\n\n//#endregion\n//#region src/methods/forward/forward.ts\n/**\n* Forwards the issues of the passed validation action.\n*\n* @param action The validation action.\n* @param path The path to forward the issues to.\n*\n* @returns The modified action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction forward(action, path) {\n\treturn {\n\t\t...action,\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst prevIssues = dataset.issues && [...dataset.issues];\n\t\t\tdataset = action[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.issues) {\n\t\t\t\tfor (const issue of dataset.issues) if (!prevIssues?.includes(issue)) {\n\t\t\t\t\tlet pathInput = dataset.value;\n\t\t\t\t\tfor (const key of path) {\n\t\t\t\t\t\tconst pathValue = pathInput[key];\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"unknown\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput: pathInput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: pathValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (issue.path) issue.path.push(pathItem);\n\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\tif (!pathValue) break;\n\t\t\t\t\t\tpathInput = pathValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/forward/forwardAsync.ts\n/**\n* Forwards the issues of the passed validation action.\n*\n* @param action The validation action.\n* @param path The path to forward the issues to.\n*\n* @returns The modified action.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction forwardAsync(action, path) {\n\treturn {\n\t\t...action,\n\t\tasync: true,\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst prevIssues = dataset.issues && [...dataset.issues];\n\t\t\tdataset = await action[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.issues) {\n\t\t\t\tfor (const issue of dataset.issues) if (!prevIssues?.includes(issue)) {\n\t\t\t\t\tlet pathInput = dataset.value;\n\t\t\t\t\tfor (const key of path) {\n\t\t\t\t\t\tconst pathValue = pathInput[key];\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"unknown\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput: pathInput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: pathValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (issue.path) issue.path.push(pathItem);\n\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\tif (!pathValue) break;\n\t\t\t\t\t\tpathInput = pathValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/getDefault/getDefault.ts\n/**\n* Returns the default value of the schema.\n*\n* @param schema The schema to get it from.\n* @param dataset The input dataset if available.\n* @param config The config if available.\n*\n* @returns The default value.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getDefault(schema, dataset, config$1) {\n\treturn typeof schema.default === \"function\" ? schema.default(dataset, config$1) : schema.default;\n}\n\n//#endregion\n//#region src/methods/getDefaults/getDefaults.ts\n/**\n* Returns the default values of the schema.\n*\n* Hint: The difference to `getDefault` is that for object and tuple schemas\n* this function recursively returns the default values of the subschemas\n* instead of `undefined`.\n*\n* @param schema The schema to get them from.\n*\n* @returns The default values.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getDefaults(schema) {\n\tif (\"entries\" in schema) {\n\t\tconst object$1 = {};\n\t\tfor (const key in schema.entries) object$1[key] = /* @__PURE__ */ getDefaults(schema.entries[key]);\n\t\treturn object$1;\n\t}\n\tif (\"items\" in schema) return schema.items.map(getDefaults);\n\treturn /* @__PURE__ */ getDefault(schema);\n}\n\n//#endregion\n//#region src/methods/getDefaults/getDefaultsAsync.ts\n/**\n* Returns the default values of the schema.\n*\n* Hint: The difference to `getDefault` is that for object and tuple schemas\n* this function recursively returns the default values of the subschemas\n* instead of `undefined`.\n*\n* @param schema The schema to get them from.\n*\n* @returns The default values.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nasync function getDefaultsAsync(schema) {\n\tif (\"entries\" in schema) return Object.fromEntries(await Promise.all(Object.entries(schema.entries).map(async ([key, value$1]) => [key, await /* @__PURE__ */ getDefaultsAsync(value$1)])));\n\tif (\"items\" in schema) return Promise.all(schema.items.map(getDefaultsAsync));\n\treturn /* @__PURE__ */ getDefault(schema);\n}\n\n//#endregion\n//#region src/methods/getDescription/getDescription.ts\n/**\n* Returns the description of the schema.\n*\n* If multiple descriptions are defined, the last one of the highest level is\n* returned. If no description is defined, `undefined` is returned.\n*\n* @param schema The schema to get the description from.\n*\n* @returns The description, if any.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getDescription(schema) {\n\treturn /* @__PURE__ */ _getLastMetadata(schema, \"description\");\n}\n\n//#endregion\n//#region src/methods/getExamples/getExamples.ts\n/**\n* Returns the examples of a schema.\n*\n* If multiple examples are defined, it concatenates them using depth-first\n* search. If no examples are defined, an empty array is returned.\n*\n* @param schema The schema to get the examples from.\n*\n* @returns The examples, if any.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getExamples(schema) {\n\tconst examples$1 = [];\n\tfunction depthFirstCollect(schema$1) {\n\t\tif (\"pipe\" in schema$1) {\n\t\t\tfor (const item of schema$1.pipe) if (item.kind === \"schema\" && \"pipe\" in item) depthFirstCollect(item);\n\t\t\telse if (item.kind === \"metadata\" && item.type === \"examples\") examples$1.push(...item.examples);\n\t\t}\n\t}\n\tdepthFirstCollect(schema);\n\treturn examples$1;\n}\n\n//#endregion\n//#region src/methods/getFallbacks/getFallbacks.ts\n/**\n* Returns the fallback values of the schema.\n*\n* Hint: The difference to `getFallback` is that for object and tuple schemas\n* this function recursively returns the fallback values of the subschemas\n* instead of `undefined`.\n*\n* @param schema The schema to get them from.\n*\n* @returns The fallback values.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getFallbacks(schema) {\n\tif (\"entries\" in schema) {\n\t\tconst object$1 = {};\n\t\tfor (const key in schema.entries) object$1[key] = /* @__PURE__ */ getFallbacks(schema.entries[key]);\n\t\treturn object$1;\n\t}\n\tif (\"items\" in schema) return schema.items.map(getFallbacks);\n\treturn /* @__PURE__ */ getFallback(schema);\n}\n\n//#endregion\n//#region src/methods/getFallbacks/getFallbacksAsync.ts\n/**\n* Returns the fallback values of the schema.\n*\n* Hint: The difference to `getFallback` is that for object and tuple schemas\n* this function recursively returns the fallback values of the subschemas\n* instead of `undefined`.\n*\n* @param schema The schema to get them from.\n*\n* @returns The fallback values.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nasync function getFallbacksAsync(schema) {\n\tif (\"entries\" in schema) return Object.fromEntries(await Promise.all(Object.entries(schema.entries).map(async ([key, value$1]) => [key, await /* @__PURE__ */ getFallbacksAsync(value$1)])));\n\tif (\"items\" in schema) return Promise.all(schema.items.map(getFallbacksAsync));\n\treturn /* @__PURE__ */ getFallback(schema);\n}\n\n//#endregion\n//#region src/methods/getMetadata/getMetadata.ts\n/**\n* Returns the metadata of a schema.\n*\n* If multiple metadata are defined, it shallowly merges them using depth-first\n* search. If no metadata is defined, an empty object is returned.\n*\n* @param schema Schema to get the metadata from.\n*\n* @returns The metadata, if any.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getMetadata(schema) {\n\tconst result = {};\n\tfunction depthFirstMerge(schema$1) {\n\t\tif (\"pipe\" in schema$1) {\n\t\t\tfor (const item of schema$1.pipe) if (item.kind === \"schema\" && \"pipe\" in item) depthFirstMerge(item);\n\t\t\telse if (item.kind === \"metadata\" && item.type === \"metadata\") Object.assign(result, item.metadata);\n\t\t}\n\t}\n\tdepthFirstMerge(schema);\n\treturn result;\n}\n\n//#endregion\n//#region src/methods/getTitle/getTitle.ts\n/**\n* Returns the title of the schema.\n*\n* If multiple titles are defined, the last one of the highest level is\n* returned. If no title is defined, `undefined` is returned.\n*\n* @param schema The schema to get the title from.\n*\n* @returns The title, if any.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getTitle(schema) {\n\treturn /* @__PURE__ */ _getLastMetadata(schema, \"title\");\n}\n\n//#endregion\n//#region src/methods/is/is.ts\n/**\n* Checks if the input matches the schema. By using a type predicate, this\n* function can be used as a type guard.\n*\n* @param schema The schema to be used.\n* @param input The input to be tested.\n*\n* @returns Whether the input matches the schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction is(schema, input) {\n\treturn !schema[\"~run\"]({ value: input }, { abortEarly: true }).issues;\n}\n\n//#endregion\n//#region src/schemas/any/any.ts\n/**\n* Creates an any schema.\n*\n* Hint: This schema function exists only for completeness and is not\n* recommended in practice. Instead, `unknown` should be used to accept\n* unknown data.\n*\n* @returns An any schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction any() {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"any\",\n\t\treference: any,\n\t\texpects: \"any\",\n\t\tasync: false,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.typed = true;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/array/array.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction array(item, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"array\",\n\t\treference: array,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titem,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < input.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.item[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/array/arrayAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction arrayAsync(item, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"array\",\n\t\treference: arrayAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titem,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst itemDatasets = await Promise.all(input.map((value$1) => this.item[\"~run\"]({ value: value$1 }, config$1)));\n\t\t\t\tfor (let key = 0; key < itemDatasets.length; key++) {\n\t\t\t\t\tconst itemDataset = itemDatasets[key];\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/bigint/bigint.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction bigint(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"bigint\",\n\t\treference: bigint,\n\t\texpects: \"bigint\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"bigint\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/blob/blob.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction blob(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"blob\",\n\t\treference: blob,\n\t\texpects: \"Blob\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof Blob) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/boolean/boolean.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction boolean(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"boolean\",\n\t\treference: boolean,\n\t\texpects: \"boolean\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"boolean\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/custom/custom.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction custom(check$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"custom\",\n\t\treference: custom,\n\t\texpects: \"unknown\",\n\t\tasync: false,\n\t\tcheck: check$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (this.check(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/custom/customAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction customAsync(check$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"custom\",\n\t\treference: customAsync,\n\t\texpects: \"unknown\",\n\t\tasync: true,\n\t\tcheck: check$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (await this.check(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/date/date.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction date(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"date\",\n\t\treference: date,\n\t\texpects: \"Date\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof Date) if (!isNaN(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1, { received: \"\\\"Invalid Date\\\"\" });\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/enum/enum.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction enum_(enum__, message$1) {\n\tconst options = [];\n\tfor (const key in enum__) if (`${+key}` !== key || typeof enum__[key] !== \"string\" || !Object.is(enum__[enum__[key]], +key)) options.push(enum__[key]);\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"enum\",\n\t\treference: enum_,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map(_stringify), \"|\"),\n\t\tasync: false,\n\t\tenum: enum__,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (this.options.includes(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/exactOptional/exactOptional.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction exactOptional(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"exact_optional\",\n\t\treference: exactOptional,\n\t\texpects: wrapped.expects,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/exactOptional/exactOptionalAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction exactOptionalAsync(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"exact_optional\",\n\t\treference: exactOptionalAsync,\n\t\texpects: wrapped.expects,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/file/file.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction file(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"file\",\n\t\treference: file,\n\t\texpects: \"File\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof File) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/function/function.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction function_(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"function\",\n\t\treference: function_,\n\t\texpects: \"Function\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"function\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/instance/instance.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction instance(class_, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"instance\",\n\t\treference: instance,\n\t\texpects: class_.name,\n\t\tasync: false,\n\t\tclass: class_,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof this.class) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/intersect/utils/_merge/_merge.ts\n/**\n* Merges two values into one single output.\n*\n* @param value1 First value.\n* @param value2 Second value.\n*\n* @returns The merge dataset.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _merge(value1, value2) {\n\tif (typeof value1 === typeof value2) {\n\t\tif (value1 === value2 || value1 instanceof Date && value2 instanceof Date && +value1 === +value2) return { value: value1 };\n\t\tif (value1 && value2 && value1.constructor === Object && value2.constructor === Object) {\n\t\t\tfor (const key in value2) if (key in value1) {\n\t\t\t\tconst dataset = /* @__PURE__ */ _merge(value1[key], value2[key]);\n\t\t\t\tif (dataset.issue) return dataset;\n\t\t\t\tvalue1[key] = dataset.value;\n\t\t\t} else value1[key] = value2[key];\n\t\t\treturn { value: value1 };\n\t\t}\n\t\tif (Array.isArray(value1) && Array.isArray(value2)) {\n\t\t\tif (value1.length === value2.length) {\n\t\t\t\tfor (let index = 0; index < value1.length; index++) {\n\t\t\t\t\tconst dataset = /* @__PURE__ */ _merge(value1[index], value2[index]);\n\t\t\t\t\tif (dataset.issue) return dataset;\n\t\t\t\t\tvalue1[index] = dataset.value;\n\t\t\t\t}\n\t\t\t\treturn { value: value1 };\n\t\t\t}\n\t\t}\n\t}\n\treturn { issue: true };\n}\n\n//#endregion\n//#region src/schemas/intersect/intersect.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction intersect(options, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"intersect\",\n\t\treference: intersect,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), \"&\"),\n\t\tasync: false,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (this.options.length) {\n\t\t\t\tconst input = dataset.value;\n\t\t\t\tlet outputs;\n\t\t\t\tdataset.typed = true;\n\t\t\t\tfor (const schema of this.options) {\n\t\t\t\t\tconst optionDataset = schema[\"~run\"]({ value: input }, config$1);\n\t\t\t\t\tif (optionDataset.issues) {\n\t\t\t\t\t\tif (dataset.issues) dataset.issues.push(...optionDataset.issues);\n\t\t\t\t\t\telse dataset.issues = optionDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!optionDataset.typed) dataset.typed = false;\n\t\t\t\t\tif (dataset.typed) if (outputs) outputs.push(optionDataset.value);\n\t\t\t\t\telse outputs = [optionDataset.value];\n\t\t\t\t}\n\t\t\t\tif (dataset.typed) {\n\t\t\t\t\tdataset.value = outputs[0];\n\t\t\t\t\tfor (let index = 1; index < outputs.length; index++) {\n\t\t\t\t\t\tconst mergeDataset = /* @__PURE__ */ _merge(dataset.value, outputs[index]);\n\t\t\t\t\t\tif (mergeDataset.issue) {\n\t\t\t\t\t\t\t_addIssue(this, \"type\", dataset, config$1, { received: \"unknown\" });\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdataset.value = mergeDataset.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/intersect/intersectAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction intersectAsync(options, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"intersect\",\n\t\treference: intersectAsync,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), \"&\"),\n\t\tasync: true,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (this.options.length) {\n\t\t\t\tconst input = dataset.value;\n\t\t\t\tlet outputs;\n\t\t\t\tdataset.typed = true;\n\t\t\t\tconst optionDatasets = await Promise.all(this.options.map((schema) => schema[\"~run\"]({ value: input }, config$1)));\n\t\t\t\tfor (const optionDataset of optionDatasets) {\n\t\t\t\t\tif (optionDataset.issues) {\n\t\t\t\t\t\tif (dataset.issues) dataset.issues.push(...optionDataset.issues);\n\t\t\t\t\t\telse dataset.issues = optionDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!optionDataset.typed) dataset.typed = false;\n\t\t\t\t\tif (dataset.typed) if (outputs) outputs.push(optionDataset.value);\n\t\t\t\t\telse outputs = [optionDataset.value];\n\t\t\t\t}\n\t\t\t\tif (dataset.typed) {\n\t\t\t\t\tdataset.value = outputs[0];\n\t\t\t\t\tfor (let index = 1; index < outputs.length; index++) {\n\t\t\t\t\t\tconst mergeDataset = /* @__PURE__ */ _merge(dataset.value, outputs[index]);\n\t\t\t\t\t\tif (mergeDataset.issue) {\n\t\t\t\t\t\t\t_addIssue(this, \"type\", dataset, config$1, { received: \"unknown\" });\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdataset.value = mergeDataset.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/lazy/lazy.ts\n/**\n* Creates a lazy schema.\n*\n* @param getter The schema getter.\n*\n* @returns A lazy schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction lazy(getter) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"lazy\",\n\t\treference: lazy,\n\t\texpects: \"unknown\",\n\t\tasync: false,\n\t\tgetter,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\treturn this.getter(dataset.value)[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/lazy/lazyAsync.ts\n/**\n* Creates a lazy schema.\n*\n* @param getter The schema getter.\n*\n* @returns A lazy schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction lazyAsync(getter) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"lazy\",\n\t\treference: lazyAsync,\n\t\texpects: \"unknown\",\n\t\tasync: true,\n\t\tgetter,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\treturn (await this.getter(dataset.value))[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/literal/literal.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction literal(literal_, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"literal\",\n\t\treference: literal,\n\t\texpects: /* @__PURE__ */ _stringify(literal_),\n\t\tasync: false,\n\t\tliteral: literal_,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === this.literal) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/looseObject/looseObject.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction looseObject(entries$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"loose_object\",\n\t\treference: looseObject,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const key in this.entries) {\n\t\t\t\t\tconst valueSchema = this.entries[key];\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\tconst valueDataset = valueSchema[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key];\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/looseObject/looseObjectAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction looseObjectAsync(entries$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"loose_object\",\n\t\treference: looseObjectAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => {\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\t\tawait valueSchema[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tinput[key],\n\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\tnull\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key];\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/looseTuple/looseTuple.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction looseTuple(items, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"loose_tuple\",\n\t\treference: looseTuple,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titems,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < this.items.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.items[key][\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) dataset.value.push(input[key]);\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/looseTuple/looseTupleAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction looseTupleAsync(items, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"loose_tuple\",\n\t\treference: looseTupleAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titems,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst itemDatasets = await Promise.all(this.items.map(async (item, key) => {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait item[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, itemDataset] of itemDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) dataset.value.push(input[key]);\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/map/map.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction map(key, value$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"map\",\n\t\treference: map,\n\t\texpects: \"Map\",\n\t\tasync: false,\n\t\tkey,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input instanceof Map) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = /* @__PURE__ */ new Map();\n\t\t\t\tfor (const [inputKey, inputValue] of input) {\n\t\t\t\t\tconst keyDataset = this.key[\"~run\"]({ value: inputKey }, config$1);\n\t\t\t\t\tif (keyDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"map\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: inputKey,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of keyDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = keyDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst valueDataset = this.value[\"~run\"]({ value: inputValue }, config$1);\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"map\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: inputKey,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.set(keyDataset.value, valueDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/map/mapAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction mapAsync(key, value$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"map\",\n\t\treference: mapAsync,\n\t\texpects: \"Map\",\n\t\tasync: true,\n\t\tkey,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input instanceof Map) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = /* @__PURE__ */ new Map();\n\t\t\t\tconst datasets = await Promise.all([...input].map(([inputKey, inputValue]) => Promise.all([\n\t\t\t\t\tinputKey,\n\t\t\t\t\tinputValue,\n\t\t\t\t\tthis.key[\"~run\"]({ value: inputKey }, config$1),\n\t\t\t\t\tthis.value[\"~run\"]({ value: inputValue }, config$1)\n\t\t\t\t])));\n\t\t\t\tfor (const [inputKey, inputValue, keyDataset, valueDataset] of datasets) {\n\t\t\t\t\tif (keyDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"map\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: inputKey,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of keyDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = keyDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"map\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: inputKey,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.set(keyDataset.value, valueDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nan/nan.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nan(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"nan\",\n\t\treference: nan,\n\t\texpects: \"NaN\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (Number.isNaN(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/never/never.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction never(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"never\",\n\t\treference: never,\n\t\texpects: \"never\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\t_addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nonNullable/nonNullable.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonNullable(wrapped, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"non_nullable\",\n\t\treference: nonNullable,\n\t\texpects: \"!null\",\n\t\tasync: false,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value !== null) dataset = this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === null) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nonNullable/nonNullableAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonNullableAsync(wrapped, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"non_nullable\",\n\t\treference: nonNullableAsync,\n\t\texpects: \"!null\",\n\t\tasync: true,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value !== null) dataset = await this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === null) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nonNullish/nonNullish.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonNullish(wrapped, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"non_nullish\",\n\t\treference: nonNullish,\n\t\texpects: \"(!null & !undefined)\",\n\t\tasync: false,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (!(dataset.value === null || dataset.value === void 0)) dataset = this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === null || dataset.value === void 0) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nonNullish/nonNullishAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonNullishAsync(wrapped, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"non_nullish\",\n\t\treference: nonNullishAsync,\n\t\texpects: \"(!null & !undefined)\",\n\t\tasync: true,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (!(dataset.value === null || dataset.value === void 0)) dataset = await this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === null || dataset.value === void 0) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nonOptional/nonOptional.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonOptional(wrapped, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"non_optional\",\n\t\treference: nonOptional,\n\t\texpects: \"!undefined\",\n\t\tasync: false,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value !== void 0) dataset = this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === void 0) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nonOptional/nonOptionalAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nonOptionalAsync(wrapped, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"non_optional\",\n\t\treference: nonOptionalAsync,\n\t\texpects: \"!undefined\",\n\t\tasync: true,\n\t\twrapped,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value !== void 0) dataset = await this.wrapped[\"~run\"](dataset, config$1);\n\t\t\tif (dataset.value === void 0) _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/null/null.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction null_(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"null\",\n\t\treference: null_,\n\t\texpects: \"null\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nullable/nullable.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nullable(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"nullable\",\n\t\treference: nullable,\n\t\texpects: `(${wrapped.expects} | null)`,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null) {\n\t\t\t\tif (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === null) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nullable/nullableAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nullableAsync(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"nullable\",\n\t\treference: nullableAsync,\n\t\texpects: `(${wrapped.expects} | null)`,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null) {\n\t\t\t\tif (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === null) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nullish/nullish.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nullish(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"nullish\",\n\t\treference: nullish,\n\t\texpects: `(${wrapped.expects} | null | undefined)`,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null || dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === null || dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/nullish/nullishAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction nullishAsync(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"nullish\",\n\t\treference: nullishAsync,\n\t\texpects: `(${wrapped.expects} | null | undefined)`,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === null || dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === null || dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/number/number.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction number(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"number\",\n\t\treference: number,\n\t\texpects: \"number\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"number\" && !isNaN(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/object/object.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction object(entries$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"object\",\n\t\treference: object,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const key in this.entries) {\n\t\t\t\t\tconst valueSchema = this.entries[key];\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\tconst valueDataset = valueSchema[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/object/objectAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction objectAsync(entries$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"object\",\n\t\treference: objectAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => {\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\t\tawait valueSchema[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tinput[key],\n\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\tnull\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/objectWithRest/objectWithRest.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction objectWithRest(entries$1, rest, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"object_with_rest\",\n\t\treference: objectWithRest,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tentries: entries$1,\n\t\trest,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const key in this.entries) {\n\t\t\t\t\tconst valueSchema = this.entries[key];\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\tconst valueDataset = valueSchema[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) {\n\t\t\t\t\t\tconst valueDataset = this.rest[\"~run\"]({ value: input[key] }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/objectWithRest/objectWithRestAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction objectWithRestAsync(entries$1, rest, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"object_with_rest\",\n\t\treference: objectWithRestAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tentries: entries$1,\n\t\trest,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst [normalDatasets, restDatasets] = await Promise.all([Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => {\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\t\tawait valueSchema[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tinput[key],\n\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\tnull\n\t\t\t\t\t];\n\t\t\t\t})), Promise.all(Object.entries(input).filter(([key]) => /* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)).map(async ([key, value$1]) => [\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue$1,\n\t\t\t\t\tawait this.rest[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t]))]);\n\t\t\t\tfor (const [key, value$1, valueSchema, valueDataset] of normalDatasets) if (valueDataset) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (const [key, value$1, valueDataset] of restDatasets) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/optional/optional.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction optional(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"optional\",\n\t\treference: optional,\n\t\texpects: `(${wrapped.expects} | undefined)`,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/optional/optionalAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction optionalAsync(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"optional\",\n\t\treference: optionalAsync,\n\t\texpects: `(${wrapped.expects} | undefined)`,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/picklist/picklist.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction picklist(options, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"picklist\",\n\t\treference: picklist,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map(_stringify), \"|\"),\n\t\tasync: false,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (this.options.includes(dataset.value)) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/promise/promise.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction promise(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"promise\",\n\t\treference: promise,\n\t\texpects: \"Promise\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value instanceof Promise) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/record/record.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction record(key, value$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"record\",\n\t\treference: record,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tkey,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const entryKey in input) if (/* @__PURE__ */ _isValidObjectKey(input, entryKey)) {\n\t\t\t\t\tconst entryValue = input[entryKey];\n\t\t\t\t\tconst keyDataset = this.key[\"~run\"]({ value: entryKey }, config$1);\n\t\t\t\t\tif (keyDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: entryKey,\n\t\t\t\t\t\t\tvalue: entryValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of keyDataset.issues) {\n\t\t\t\t\t\t\tissue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = keyDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst valueDataset = this.value[\"~run\"]({ value: entryValue }, config$1);\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: entryKey,\n\t\t\t\t\t\t\tvalue: entryValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tif (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value;\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/record/recordAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction recordAsync(key, value$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"record\",\n\t\treference: recordAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tkey,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst datasets = await Promise.all(Object.entries(input).filter(([key$1]) => /* @__PURE__ */ _isValidObjectKey(input, key$1)).map(([entryKey, entryValue]) => Promise.all([\n\t\t\t\t\tentryKey,\n\t\t\t\t\tentryValue,\n\t\t\t\t\tthis.key[\"~run\"]({ value: entryKey }, config$1),\n\t\t\t\t\tthis.value[\"~run\"]({ value: entryValue }, config$1)\n\t\t\t\t])));\n\t\t\t\tfor (const [entryKey, entryValue, keyDataset, valueDataset] of datasets) {\n\t\t\t\t\tif (keyDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: entryKey,\n\t\t\t\t\t\t\tvalue: entryValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of keyDataset.issues) {\n\t\t\t\t\t\t\tissue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = keyDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: entryKey,\n\t\t\t\t\t\t\tvalue: entryValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tif (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value;\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/set/set.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction set(value$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"set\",\n\t\treference: set,\n\t\texpects: \"Set\",\n\t\tasync: false,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input instanceof Set) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = /* @__PURE__ */ new Set();\n\t\t\t\tfor (const inputValue of input) {\n\t\t\t\t\tconst valueDataset = this.value[\"~run\"]({ value: inputValue }, config$1);\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"set\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: null,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.add(valueDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/set/setAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction setAsync(value$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"set\",\n\t\treference: setAsync,\n\t\texpects: \"Set\",\n\t\tasync: true,\n\t\tvalue: value$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input instanceof Set) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = /* @__PURE__ */ new Set();\n\t\t\t\tconst valueDatasets = await Promise.all([...input].map(async (inputValue) => [inputValue, await this.value[\"~run\"]({ value: inputValue }, config$1)]));\n\t\t\t\tfor (const [inputValue, valueDataset] of valueDatasets) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"set\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey: null,\n\t\t\t\t\t\t\tvalue: inputValue\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.add(valueDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/strictObject/strictObject.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction strictObject(entries$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"strict_object\",\n\t\treference: strictObject,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tfor (const key in this.entries) {\n\t\t\t\t\tconst valueSchema = this.entries[key];\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\tconst valueDataset = valueSchema[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (!(key in this.entries)) {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: key,\n\t\t\t\t\t\t\texpected: \"never\",\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/strictObject/strictObjectAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction strictObjectAsync(entries$1, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"strict_object\",\n\t\treference: strictObjectAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tentries: entries$1,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = {};\n\t\t\t\tconst valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => {\n\t\t\t\t\tif (key in input || (valueSchema.type === \"exact_optional\" || valueSchema.type === \"optional\" || valueSchema.type === \"nullish\") && valueSchema.default !== void 0) {\n\t\t\t\t\t\tconst value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema);\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\t\tawait valueSchema[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tinput[key],\n\t\t\t\t\t\tvalueSchema,\n\t\t\t\t\t\tnull\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) {\n\t\t\t\t\tif (valueDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of valueDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = valueDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!valueDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value[key] = valueDataset.value;\n\t\t\t\t} else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema);\n\t\t\t\telse if (valueSchema.type !== \"exact_optional\" && valueSchema.type !== \"optional\" && valueSchema.type !== \"nullish\") {\n\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\texpected: `\"${key}\"`,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t\tif (config$1.abortEarly) break;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) {\n\t\t\t\t\tfor (const key in input) if (!(key in this.entries)) {\n\t\t\t\t\t\t_addIssue(this, \"key\", dataset, config$1, {\n\t\t\t\t\t\t\tinput: key,\n\t\t\t\t\t\t\texpected: \"never\",\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tvalue: input[key]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/strictTuple/strictTuple.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction strictTuple(items, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"strict_tuple\",\n\t\treference: strictTuple,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titems,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < this.items.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.items[key][\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!(dataset.issues && config$1.abortEarly) && this.items.length < input.length) _addIssue(this, \"type\", dataset, config$1, {\n\t\t\t\t\tinput: input[this.items.length],\n\t\t\t\t\texpected: \"never\",\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tkey: this.items.length,\n\t\t\t\t\t\tvalue: input[this.items.length]\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/strictTuple/strictTupleAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction strictTupleAsync(items, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"strict_tuple\",\n\t\treference: strictTupleAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titems,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst itemDatasets = await Promise.all(this.items.map(async (item, key) => {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait item[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, itemDataset] of itemDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!(dataset.issues && config$1.abortEarly) && this.items.length < input.length) _addIssue(this, \"type\", dataset, config$1, {\n\t\t\t\t\tinput: input[this.items.length],\n\t\t\t\t\texpected: \"never\",\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tkey: this.items.length,\n\t\t\t\t\t\tvalue: input[this.items.length]\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/string/string.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction string(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"string\",\n\t\treference: string,\n\t\texpects: \"string\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"string\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/symbol/symbol.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction symbol(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"symbol\",\n\t\treference: symbol,\n\t\texpects: \"symbol\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (typeof dataset.value === \"symbol\") dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/tuple/tuple.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction tuple(items, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"tuple\",\n\t\treference: tuple,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titems,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < this.items.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.items[key][\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/tuple/tupleAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction tupleAsync(items, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"tuple\",\n\t\treference: tupleAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titems,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst itemDatasets = await Promise.all(this.items.map(async (item, key) => {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait item[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t}));\n\t\t\t\tfor (const [key, value$1, itemDataset] of itemDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/tupleWithRest/tupleWithRest.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction tupleWithRest(items, rest, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"tuple_with_rest\",\n\t\treference: tupleWithRest,\n\t\texpects: \"Array\",\n\t\tasync: false,\n\t\titems,\n\t\trest,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tfor (let key = 0; key < this.items.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.items[key][\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\tconst itemDataset = this.rest[\"~run\"]({ value: value$1 }, config$1);\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/tupleWithRest/tupleWithRestAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction tupleWithRestAsync(items, rest, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"tuple_with_rest\",\n\t\treference: tupleWithRestAsync,\n\t\texpects: \"Array\",\n\t\tasync: true,\n\t\titems,\n\t\trest,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tdataset.typed = true;\n\t\t\t\tdataset.value = [];\n\t\t\t\tconst [normalDatasets, restDatasets] = await Promise.all([Promise.all(this.items.map(async (item, key) => {\n\t\t\t\t\tconst value$1 = input[key];\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait item[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t})), Promise.all(input.slice(this.items.length).map(async (value$1, key) => {\n\t\t\t\t\treturn [\n\t\t\t\t\t\tkey + this.items.length,\n\t\t\t\t\t\tvalue$1,\n\t\t\t\t\t\tawait this.rest[\"~run\"]({ value: value$1 }, config$1)\n\t\t\t\t\t];\n\t\t\t\t}))]);\n\t\t\t\tfor (const [key, value$1, itemDataset] of normalDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly) for (const [key, value$1, itemDataset] of restDatasets) {\n\t\t\t\t\tif (itemDataset.issues) {\n\t\t\t\t\t\tconst pathItem = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue: value$1\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (const issue of itemDataset.issues) {\n\t\t\t\t\t\t\tif (issue.path) issue.path.unshift(pathItem);\n\t\t\t\t\t\t\telse issue.path = [pathItem];\n\t\t\t\t\t\t\tdataset.issues?.push(issue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!dataset.issues) dataset.issues = itemDataset.issues;\n\t\t\t\t\t\tif (config$1.abortEarly) {\n\t\t\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!itemDataset.typed) dataset.typed = false;\n\t\t\t\t\tdataset.value.push(itemDataset.value);\n\t\t\t\t}\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/undefined/undefined.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction undefined_(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"undefined\",\n\t\treference: undefined_,\n\t\texpects: \"undefined\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/undefinedable/undefinedable.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction undefinedable(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"undefinedable\",\n\t\treference: undefinedable,\n\t\texpects: `(${wrapped.expects} | undefined)`,\n\t\tasync: false,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/undefinedable/undefinedableAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction undefinedableAsync(wrapped, default_) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"undefinedable\",\n\t\treference: undefinedableAsync,\n\t\texpects: `(${wrapped.expects} | undefined)`,\n\t\tasync: true,\n\t\twrapped,\n\t\tdefault: default_,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) {\n\t\t\t\tif (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1);\n\t\t\t\tif (dataset.value === void 0) {\n\t\t\t\t\tdataset.typed = true;\n\t\t\t\t\treturn dataset;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.wrapped[\"~run\"](dataset, config$1);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/union/utils/_subIssues/_subIssues.ts\n/**\n* Returns the sub issues of the provided datasets for the union issue.\n*\n* @param datasets The datasets.\n*\n* @returns The sub issues.\n*\n* @internal\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction _subIssues(datasets) {\n\tlet issues;\n\tif (datasets) for (const dataset of datasets) if (issues) issues.push(...dataset.issues);\n\telse issues = dataset.issues;\n\treturn issues;\n}\n\n//#endregion\n//#region src/schemas/union/union.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction union(options, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"union\",\n\t\treference: union,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), \"|\"),\n\t\tasync: false,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tlet validDataset;\n\t\t\tlet typedDatasets;\n\t\t\tlet untypedDatasets;\n\t\t\tfor (const schema of this.options) {\n\t\t\t\tconst optionDataset = schema[\"~run\"]({ value: dataset.value }, config$1);\n\t\t\t\tif (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);\n\t\t\t\telse typedDatasets = [optionDataset];\n\t\t\t\telse {\n\t\t\t\t\tvalidDataset = optionDataset;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if (untypedDatasets) untypedDatasets.push(optionDataset);\n\t\t\t\telse untypedDatasets = [optionDataset];\n\t\t\t}\n\t\t\tif (validDataset) return validDataset;\n\t\t\tif (typedDatasets) {\n\t\t\t\tif (typedDatasets.length === 1) return typedDatasets[0];\n\t\t\t\t_addIssue(this, \"type\", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });\n\t\t\t\tdataset.typed = true;\n\t\t\t} else if (untypedDatasets?.length === 1) return untypedDatasets[0];\n\t\t\telse _addIssue(this, \"type\", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/union/unionAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction unionAsync(options, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"union\",\n\t\treference: unionAsync,\n\t\texpects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), \"|\"),\n\t\tasync: true,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tlet validDataset;\n\t\t\tlet typedDatasets;\n\t\t\tlet untypedDatasets;\n\t\t\tfor (const schema of this.options) {\n\t\t\t\tconst optionDataset = await schema[\"~run\"]({ value: dataset.value }, config$1);\n\t\t\t\tif (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);\n\t\t\t\telse typedDatasets = [optionDataset];\n\t\t\t\telse {\n\t\t\t\t\tvalidDataset = optionDataset;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if (untypedDatasets) untypedDatasets.push(optionDataset);\n\t\t\t\telse untypedDatasets = [optionDataset];\n\t\t\t}\n\t\t\tif (validDataset) return validDataset;\n\t\t\tif (typedDatasets) {\n\t\t\t\tif (typedDatasets.length === 1) return typedDatasets[0];\n\t\t\t\t_addIssue(this, \"type\", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });\n\t\t\t\tdataset.typed = true;\n\t\t\t} else if (untypedDatasets?.length === 1) return untypedDatasets[0];\n\t\t\telse _addIssue(this, \"type\", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/unknown/unknown.ts\n/**\n* Creates a unknown schema.\n*\n* @returns A unknown schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction unknown() {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"unknown\",\n\t\treference: unknown,\n\t\texpects: \"unknown\",\n\t\tasync: false,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset) {\n\t\t\tdataset.typed = true;\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/variant/variant.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction variant(key, options, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"variant\",\n\t\treference: variant,\n\t\texpects: \"Object\",\n\t\tasync: false,\n\t\tkey,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tlet outputDataset;\n\t\t\t\tlet maxDiscriminatorPriority = 0;\n\t\t\t\tlet invalidDiscriminatorKey = this.key;\n\t\t\t\tlet expectedDiscriminators = [];\n\t\t\t\tconst parseOptions = (variant$1, allKeys) => {\n\t\t\t\t\tfor (const schema of variant$1.options) {\n\t\t\t\t\t\tif (schema.type === \"variant\") parseOptions(schema, new Set(allKeys).add(schema.key));\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tlet keysAreValid = true;\n\t\t\t\t\t\t\tlet currentPriority = 0;\n\t\t\t\t\t\t\tfor (const currentKey of allKeys) {\n\t\t\t\t\t\t\t\tconst discriminatorSchema = schema.entries[currentKey];\n\t\t\t\t\t\t\t\tif (currentKey in input ? discriminatorSchema[\"~run\"]({\n\t\t\t\t\t\t\t\t\ttyped: false,\n\t\t\t\t\t\t\t\t\tvalue: input[currentKey]\n\t\t\t\t\t\t\t\t}, { abortEarly: true }).issues : discriminatorSchema.type !== \"exact_optional\" && discriminatorSchema.type !== \"optional\" && discriminatorSchema.type !== \"nullish\") {\n\t\t\t\t\t\t\t\t\tkeysAreValid = false;\n\t\t\t\t\t\t\t\t\tif (invalidDiscriminatorKey !== currentKey && (maxDiscriminatorPriority < currentPriority || maxDiscriminatorPriority === currentPriority && currentKey in input && !(invalidDiscriminatorKey in input))) {\n\t\t\t\t\t\t\t\t\t\tmaxDiscriminatorPriority = currentPriority;\n\t\t\t\t\t\t\t\t\t\tinvalidDiscriminatorKey = currentKey;\n\t\t\t\t\t\t\t\t\t\texpectedDiscriminators = [];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (invalidDiscriminatorKey === currentKey) expectedDiscriminators.push(schema.entries[currentKey].expects);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcurrentPriority++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (keysAreValid) {\n\t\t\t\t\t\t\t\tconst optionDataset = schema[\"~run\"]({ value: input }, config$1);\n\t\t\t\t\t\t\t\tif (!outputDataset || !outputDataset.typed && optionDataset.typed) outputDataset = optionDataset;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (outputDataset && !outputDataset.issues) break;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tparseOptions(this, new Set([this.key]));\n\t\t\t\tif (outputDataset) return outputDataset;\n\t\t\t\t_addIssue(this, \"type\", dataset, config$1, {\n\t\t\t\t\tinput: input[invalidDiscriminatorKey],\n\t\t\t\t\texpected: /* @__PURE__ */ _joinExpects(expectedDiscriminators, \"|\"),\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tkey: invalidDiscriminatorKey,\n\t\t\t\t\t\tvalue: input[invalidDiscriminatorKey]\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/variant/variantAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction variantAsync(key, options, message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"variant\",\n\t\treference: variantAsync,\n\t\texpects: \"Object\",\n\t\tasync: true,\n\t\tkey,\n\t\toptions,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tconst input = dataset.value;\n\t\t\tif (input && typeof input === \"object\") {\n\t\t\t\tlet outputDataset;\n\t\t\t\tlet maxDiscriminatorPriority = 0;\n\t\t\t\tlet invalidDiscriminatorKey = this.key;\n\t\t\t\tlet expectedDiscriminators = [];\n\t\t\t\tconst parseOptions = async (variant$1, allKeys) => {\n\t\t\t\t\tfor (const schema of variant$1.options) {\n\t\t\t\t\t\tif (schema.type === \"variant\") await parseOptions(schema, new Set(allKeys).add(schema.key));\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tlet keysAreValid = true;\n\t\t\t\t\t\t\tlet currentPriority = 0;\n\t\t\t\t\t\t\tfor (const currentKey of allKeys) {\n\t\t\t\t\t\t\t\tconst discriminatorSchema = schema.entries[currentKey];\n\t\t\t\t\t\t\t\tif (currentKey in input ? (await discriminatorSchema[\"~run\"]({\n\t\t\t\t\t\t\t\t\ttyped: false,\n\t\t\t\t\t\t\t\t\tvalue: input[currentKey]\n\t\t\t\t\t\t\t\t}, { abortEarly: true })).issues : discriminatorSchema.type !== \"exact_optional\" && discriminatorSchema.type !== \"optional\" && discriminatorSchema.type !== \"nullish\") {\n\t\t\t\t\t\t\t\t\tkeysAreValid = false;\n\t\t\t\t\t\t\t\t\tif (invalidDiscriminatorKey !== currentKey && (maxDiscriminatorPriority < currentPriority || maxDiscriminatorPriority === currentPriority && currentKey in input && !(invalidDiscriminatorKey in input))) {\n\t\t\t\t\t\t\t\t\t\tmaxDiscriminatorPriority = currentPriority;\n\t\t\t\t\t\t\t\t\t\tinvalidDiscriminatorKey = currentKey;\n\t\t\t\t\t\t\t\t\t\texpectedDiscriminators = [];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (invalidDiscriminatorKey === currentKey) expectedDiscriminators.push(schema.entries[currentKey].expects);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcurrentPriority++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (keysAreValid) {\n\t\t\t\t\t\t\t\tconst optionDataset = await schema[\"~run\"]({ value: input }, config$1);\n\t\t\t\t\t\t\t\tif (!outputDataset || !outputDataset.typed && optionDataset.typed) outputDataset = optionDataset;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (outputDataset && !outputDataset.issues) break;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tawait parseOptions(this, new Set([this.key]));\n\t\t\t\tif (outputDataset) return outputDataset;\n\t\t\t\t_addIssue(this, \"type\", dataset, config$1, {\n\t\t\t\t\tinput: input[invalidDiscriminatorKey],\n\t\t\t\t\texpected: /* @__PURE__ */ _joinExpects(expectedDiscriminators, \"|\"),\n\t\t\t\t\tpath: [{\n\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tkey: invalidDiscriminatorKey,\n\t\t\t\t\t\tvalue: input[invalidDiscriminatorKey]\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t} else _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/schemas/void/void.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction void_(message$1) {\n\treturn {\n\t\tkind: \"schema\",\n\t\ttype: \"void\",\n\t\treference: void_,\n\t\texpects: \"void\",\n\t\tasync: false,\n\t\tmessage: message$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tif (dataset.value === void 0) dataset.typed = true;\n\t\t\telse _addIssue(this, \"type\", dataset, config$1);\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/keyof/keyof.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction keyof(schema, message$1) {\n\treturn /* @__PURE__ */ picklist(Object.keys(schema.entries), message$1);\n}\n\n//#endregion\n//#region src/methods/message/message.ts\n/**\n* Changes the local message configuration of a schema.\n*\n* @param schema The schema to configure.\n* @param message_ The error message.\n*\n* @returns The configured schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction message(schema, message_) {\n\treturn {\n\t\t...schema,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\treturn schema[\"~run\"](dataset, {\n\t\t\t\t...config$1,\n\t\t\t\tmessage: message_\n\t\t\t});\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/omit/omit.ts\n/**\n* Creates a modified copy of an object schema that does not contain the\n* selected entries.\n*\n* @param schema The schema to omit from.\n* @param keys The selected entries.\n*\n* @returns An object schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction omit(schema, keys) {\n\tconst entries$1 = { ...schema.entries };\n\tfor (const key of keys) delete entries$1[key];\n\treturn {\n\t\t...schema,\n\t\tentries: entries$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/parse/parse.ts\n/**\n* Parses an unknown input based on a schema.\n*\n* @param schema The schema to be used.\n* @param input The input to be parsed.\n* @param config The parse configuration.\n*\n* @returns The parsed input.\n*/\nfunction parse(schema, input, config$1) {\n\tconst dataset = schema[\"~run\"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));\n\tif (dataset.issues) throw new ValiError(dataset.issues);\n\treturn dataset.value;\n}\n\n//#endregion\n//#region src/methods/parse/parseAsync.ts\n/**\n* Parses an unknown input based on a schema.\n*\n* @param schema The schema to be used.\n* @param input The input to be parsed.\n* @param config The parse configuration.\n*\n* @returns The parsed input.\n*/\nasync function parseAsync(schema, input, config$1) {\n\tconst dataset = await schema[\"~run\"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));\n\tif (dataset.issues) throw new ValiError(dataset.issues);\n\treturn dataset.value;\n}\n\n//#endregion\n//#region src/methods/parser/parser.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction parser(schema, config$1) {\n\tconst func = (input) => parse(schema, input, config$1);\n\tfunc.schema = schema;\n\tfunc.config = config$1;\n\treturn func;\n}\n\n//#endregion\n//#region src/methods/parser/parserAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction parserAsync(schema, config$1) {\n\tconst func = (input) => parseAsync(schema, input, config$1);\n\tfunc.schema = schema;\n\tfunc.config = config$1;\n\treturn func;\n}\n\n//#endregion\n//#region src/methods/partial/partial.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction partial(schema, keys) {\n\tconst entries$1 = {};\n\tfor (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ optional(schema.entries[key]) : schema.entries[key];\n\treturn {\n\t\t...schema,\n\t\tentries: entries$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/partial/partialAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction partialAsync(schema, keys) {\n\tconst entries$1 = {};\n\tfor (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ optionalAsync(schema.entries[key]) : schema.entries[key];\n\treturn {\n\t\t...schema,\n\t\tentries: entries$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/pick/pick.ts\n/**\n* Creates a modified copy of an object schema that contains only the selected\n* entries.\n*\n* @param schema The schema to pick from.\n* @param keys The selected entries.\n*\n* @returns An object schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction pick(schema, keys) {\n\tconst entries$1 = {};\n\tfor (const key of keys) entries$1[key] = schema.entries[key];\n\treturn {\n\t\t...schema,\n\t\tentries: entries$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/pipe/pipe.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction pipe(...pipe$1) {\n\treturn {\n\t\t...pipe$1[0],\n\t\tpipe: pipe$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\t\"~run\"(dataset, config$1) {\n\t\t\tfor (const item of pipe$1) if (item.kind !== \"metadata\") {\n\t\t\t\tif (dataset.issues && (item.kind === \"schema\" || item.kind === \"transformation\")) {\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item[\"~run\"](dataset, config$1);\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/pipe/pipeAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction pipeAsync(...pipe$1) {\n\treturn {\n\t\t...pipe$1[0],\n\t\tpipe: pipe$1,\n\t\tasync: true,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t},\n\t\tasync \"~run\"(dataset, config$1) {\n\t\t\tfor (const item of pipe$1) if (item.kind !== \"metadata\") {\n\t\t\t\tif (dataset.issues && (item.kind === \"schema\" || item.kind === \"transformation\")) {\n\t\t\t\t\tdataset.typed = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = await item[\"~run\"](dataset, config$1);\n\t\t\t}\n\t\t\treturn dataset;\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/required/required.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction required(schema, arg2, arg3) {\n\tconst keys = Array.isArray(arg2) ? arg2 : void 0;\n\tconst message$1 = Array.isArray(arg2) ? arg3 : arg2;\n\tconst entries$1 = {};\n\tfor (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ nonOptional(schema.entries[key], message$1) : schema.entries[key];\n\treturn {\n\t\t...schema,\n\t\tentries: entries$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/required/requiredAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction requiredAsync(schema, arg2, arg3) {\n\tconst keys = Array.isArray(arg2) ? arg2 : void 0;\n\tconst message$1 = Array.isArray(arg2) ? arg3 : arg2;\n\tconst entries$1 = {};\n\tfor (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ nonOptionalAsync(schema.entries[key], message$1) : schema.entries[key];\n\treturn {\n\t\t...schema,\n\t\tentries: entries$1,\n\t\tget \"~standard\"() {\n\t\t\treturn /* @__PURE__ */ _getStandardProps(this);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/methods/safeParse/safeParse.ts\n/**\n* Parses an unknown input based on a schema.\n*\n* @param schema The schema to be used.\n* @param input The input to be parsed.\n* @param config The parse configuration.\n*\n* @returns The parse result.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction safeParse(schema, input, config$1) {\n\tconst dataset = schema[\"~run\"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));\n\treturn {\n\t\ttyped: dataset.typed,\n\t\tsuccess: !dataset.issues,\n\t\toutput: dataset.value,\n\t\tissues: dataset.issues\n\t};\n}\n\n//#endregion\n//#region src/methods/safeParse/safeParseAsync.ts\n/**\n* Parses an unknown input based on a schema.\n*\n* @param schema The schema to be used.\n* @param input The input to be parsed.\n* @param config The parse configuration.\n*\n* @returns The parse result.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nasync function safeParseAsync(schema, input, config$1) {\n\tconst dataset = await schema[\"~run\"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));\n\treturn {\n\t\ttyped: dataset.typed,\n\t\tsuccess: !dataset.issues,\n\t\toutput: dataset.value,\n\t\tissues: dataset.issues\n\t};\n}\n\n//#endregion\n//#region src/methods/safeParser/safeParser.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction safeParser(schema, config$1) {\n\tconst func = (input) => /* @__PURE__ */ safeParse(schema, input, config$1);\n\tfunc.schema = schema;\n\tfunc.config = config$1;\n\treturn func;\n}\n\n//#endregion\n//#region src/methods/safeParser/safeParserAsync.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction safeParserAsync(schema, config$1) {\n\tconst func = (input) => /* @__PURE__ */ safeParseAsync(schema, input, config$1);\n\tfunc.schema = schema;\n\tfunc.config = config$1;\n\treturn func;\n}\n\n//#endregion\n//#region src/methods/summarize/summarize.ts\n/**\n* Summarize the error messages of issues in a pretty-printable multi-line string.\n*\n* @param issues The list of issues.\n*\n* @returns A summary of the issues.\n*\n* @beta\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction summarize(issues) {\n\tlet summary = \"\";\n\tfor (const issue of issues) {\n\t\tif (summary) summary += \"\\n\";\n\t\tsummary += `× ${issue.message}`;\n\t\tconst dotPath = /* @__PURE__ */ getDotPath(issue);\n\t\tif (dotPath) summary += `\\n → at ${dotPath}`;\n\t}\n\treturn summary;\n}\n\n//#endregion\n//#region src/methods/unwrap/unwrap.ts\n/**\n* Unwraps the wrapped schema.\n*\n* @param schema The schema to be unwrapped.\n*\n* @returns The unwrapped schema.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction unwrap(schema) {\n\treturn schema.wrapped;\n}\n\n//#endregion\nexport { BASE64_REGEX, BIC_REGEX, CUID2_REGEX, DECIMAL_REGEX, DIGITS_REGEX, DOMAIN_REGEX, EMAIL_REGEX, EMOJI_REGEX, HEXADECIMAL_REGEX, HEX_COLOR_REGEX, IMEI_REGEX, IPV4_REGEX, IPV6_REGEX, IP_REGEX, ISO_DATE_REGEX, ISO_DATE_TIME_REGEX, ISO_TIMESTAMP_REGEX, ISO_TIME_REGEX, ISO_TIME_SECOND_REGEX, ISO_WEEK_REGEX, ISRC_REGEX, JWS_COMPACT_REGEX, MAC48_REGEX, MAC64_REGEX, MAC_REGEX, NANO_ID_REGEX, OCTAL_REGEX, RFC_EMAIL_REGEX, SLUG_REGEX, ULID_REGEX, UUID_REGEX, ValiError, _addIssue, _cloneDataset, _getByteCount, _getGraphemeCount, _getLastMetadata, _getStandardProps, _getWordCount, _isLuhnAlgo, _isValidObjectKey, _joinExpects, _stringify, any, args, argsAsync, array, arrayAsync, assert, awaitAsync, base64, bic, bigint, blob, boolean, brand, bytes, cache, cacheAsync, check, checkAsync, checkItems, checkItemsAsync, config, creditCard, cuid2, custom, customAsync, date, decimal, deleteGlobalConfig, deleteGlobalMessage, deleteSchemaMessage, deleteSpecificMessage, description, digits, domain, email, emoji, empty, endsWith, entries, entriesFromList, entriesFromObjects, enum_ as enum, enum_, everyItem, exactOptional, exactOptionalAsync, examples, excludes, fallback, fallbackAsync, file, filterItems, findItem, finite, flatten, flavor, forward, forwardAsync, function_ as function, function_, getDefault, getDefaults, getDefaultsAsync, getDescription, getDotPath, getExamples, getFallback, getFallbacks, getFallbacksAsync, getGlobalConfig, getGlobalMessage, getMetadata, getSchemaMessage, getSpecificMessage, getTitle, graphemes, gtValue, guard, hash, hexColor, hexadecimal, imei, includes, instance, integer, intersect, intersectAsync, ip, ipv4, ipv6, is, isOfKind, isOfType, isValiError, isbn, isoDate, isoDateTime, isoTime, isoTimeSecond, isoTimestamp, isoWeek, isrc, jwsCompact, keyof, lazy, lazyAsync, length, literal, looseObject, looseObjectAsync, looseTuple, looseTupleAsync, ltValue, mac, mac48, mac64, map, mapAsync, mapItems, maxBytes, maxEntries, maxGraphemes, maxLength, maxSize, maxValue, maxWords, message, metadata, mimeType, minBytes, minEntries, minGraphemes, minLength, minSize, minValue, minWords, multipleOf, nan, nanoid, never, nonEmpty, nonNullable, nonNullableAsync, nonNullish, nonNullishAsync, nonOptional, nonOptionalAsync, normalize, notBytes, notEntries, notGraphemes, notLength, notSize, notValue, notValues, notWords, null_ as null, null_, nullable, nullableAsync, nullish, nullishAsync, number, object, objectAsync, objectWithRest, objectWithRestAsync, octal, omit, optional, optionalAsync, parse, parseAsync, parseBoolean, parseJson, parser, parserAsync, partial, partialAsync, partialCheck, partialCheckAsync, pick, picklist, pipe, pipeAsync, promise, rawCheck, rawCheckAsync, rawTransform, rawTransformAsync, readonly, record, recordAsync, reduceItems, regex, required, requiredAsync, returns, returnsAsync, rfcEmail, safeInteger, safeParse, safeParseAsync, safeParser, safeParserAsync, set, setAsync, setGlobalConfig, setGlobalMessage, setSchemaMessage, setSpecificMessage, size, slug, someItem, sortItems, startsWith, strictObject, strictObjectAsync, strictTuple, strictTupleAsync, string, stringifyJson, summarize, symbol, title, toBigint, toBoolean, toDate, toLowerCase, toMaxValue, toMinValue, toNumber, toString, toUpperCase, transform, transformAsync, trim, trimEnd, trimStart, tuple, tupleAsync, tupleWithRest, tupleWithRestAsync, ulid, undefined_ as undefined, undefined_, undefinedable, undefinedableAsync, union, unionAsync, unknown, unwrap, url, uuid, value, values, variant, variantAsync, void_ as void, void_, words };","/** @internal */\nexport function toErrorMessage(error: unknown): string {\n\tif (error instanceof Error && error.message.trim() !== \"\") {\n\t\treturn error.message;\n\t}\n\treturn String(error);\n}\n\n/** Return non-blank strings verbatim; unlike trimToNull, preserve surrounding whitespace. @internal */\nexport function readNonBlankString(value: unknown): string | null {\n\treturn typeof value === \"string\" && value.trim() !== \"\" ? value : null;\n}\n\n/** @internal */\nexport function trimString(value: unknown): string {\n\treturn typeof value === \"string\" ? value.trim() : \"\";\n}\n\n/** @internal */\nexport function trimToNull(value: unknown): string | null {\n\tconst trimmed = trimString(value);\n\treturn trimmed === \"\" ? null : trimmed;\n}\n\n/** @internal */\nexport function normalizeStringArray(value: unknown): string[] {\n\tif (!Array.isArray(value)) {\n\t\treturn [];\n\t}\n\treturn value.map((entry) => trimString(entry)).filter((entry) => entry.length > 0);\n}\n\n/**\n * Single source of truth for turning an internal identifier (an action id,\n * outcome id, or trigger) into a human-readable Title Case label, e.g.\n * `approve_plan` -> `Approve Plan`. All operator-facing surfaces (action forms,\n * flow diagrams) must route through this so the translation lives in one place\n * and can later be swapped for a localized lookup.\n */\n/** @internal */\nexport function humanizeProcessLabel(identifier: unknown): string {\n\treturn trimString(identifier)\n\t\t.replace(/[_-]+/g, \" \")\n\t\t.replace(/\\s+/g, \" \")\n\t\t.replace(/\\b\\w/g, (letter) => letter.toUpperCase())\n\t\t.trim();\n}\n\nconst IDENTIFIER_WORD_LABELS: Record<string, string> = {\n\tapi: \"API\",\n\tid: \"ID\",\n\tllm: \"LLM\",\n\tmr: \"MR\",\n\tpi: \"Pi\",\n\tui: \"UI\",\n};\n\n/** Display an identifier with known acronyms, preserving the remaining spelling. @internal */\nexport function formatProcessIdentifier(value: string): string {\n\treturn value\n\t\t.split(/[_-]+/)\n\t\t.filter((part) => part.length > 0)\n\t\t.map((part) => {\n\t\t\tconst normalizedPart = part.toLowerCase();\n\t\t\treturn IDENTIFIER_WORD_LABELS[normalizedPart] ?? part.charAt(0).toUpperCase() + part.slice(1);\n\t\t})\n\t\t.join(\" \");\n}\n","import type { RepoLocatorKind } from \"./repo-locator.js\";\nimport type { ScopedSettingsSnapshot } from \"./scoped-settings.js\";\nimport type { ProcessSemanticEntryRefKey } from \"./semantic-entry-refs.js\";\nimport { trimToNull } from \"./string-normalize.js\";\nimport type { FailedTurnRecoveryContext } from \"./turn-recovery.js\";\nimport type { ProcessTurnStartTarget } from \"./turn-start-resolution.js\";\n\n/** @internal */\nexport type TransitionTrigger =\n\t| \"start\"\n\t| \"advance\"\n\t| \"revision_requested\"\n\t| \"plan_approved\"\n\t| \"feedback_received\"\n\t| \"operator_re_review\"\n\t| \"mr_merged\"\n\t| \"abort\"\n\t| \"mr_state_waiting\";\n\n/** @public */\nexport type InputSource =\n\t| \"external_comment\"\n\t| \"app_steer\"\n\t| \"action_prompt\"\n\t| \"watcher_event\"\n\t| \"llm_review\"\n\t| \"system\";\n\n/**\n * Stable principal that drove an action, orthogonal to `InputSource` (the\n * channel an input arrived through) and `TransitionTrigger` (the graph edge a\n * transition followed). An `Actor` answers \"who acted\", not \"how\" or \"why\".\n */\n/** @public */\nexport type ActorKind = \"user\" | \"channel\" | \"system\";\n\n/** @public */\nexport interface Actor {\n\t/**\n\t * Stable principal id, namespaced by provider where applicable.\n\t * e.g. \"identity-provider:alice\", \"operator-channel\", \"system\", \"admin\".\n\t */\n\t/** @public */\n\tid: string;\n\t/** @public */\n\tkind: ActorKind;\n\t/** Origin that vouched for this actor. `null` for system/admin/local. @public */\n\tprovider: string | null;\n\t/** Optional human-readable name for UI display. @internal */\n\tdisplayName?: string;\n}\n\n/** Watcher / scheduler / startup reconciliation and other internal callers. @internal */\nexport const SYSTEM_ACTOR: Actor = { id: \"system\", kind: \"system\", provider: null };\n\n/**\n * Unauthenticated default for human-driven web/HTTP/WS actions when no SSO\n * provider is configured. Keeps an auth-disabled leitwerk behaving exactly\n * as it does today while still attributing actions to a stable principal.\n */\n/** @internal */\nexport const ADMIN_ACTOR: Actor = { id: \"admin\", kind: \"user\", provider: null };\n\n/** @internal */\nexport type QuestionSelectionMode = \"single\" | \"multiple\";\n\n/** @internal */\nexport interface NormalizedQuestionOption {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tlabel: string;\n\t/** @internal */\n\tdetails: string | null;\n}\n\n/** @internal */\nexport interface NormalizedQuestion {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tquestion: string;\n\t/** @internal */\n\tselection: QuestionSelectionMode;\n\t/** @internal */\n\toptions: readonly NormalizedQuestionOption[];\n}\n\n/** @internal */\nexport interface QuestionAnswerDraft {\n\t/** @internal */\n\tselectedOptionIds: readonly string[];\n\t/** @internal */\n\tfreeText: string;\n\t/** @internal */\n\tcomment: string;\n}\n\n/** @internal */\nexport interface ProcessRelation {\n\t/** @internal */\n\tparentInstanceId: string;\n\t/** @internal */\n\tchildInstanceId: string;\n\t/** @internal */\n\tkind: \"derived\";\n\t/** @internal */\n\tpurpose: string;\n\t/** @internal */\n\tcreatedAt: string;\n\t/** @internal */\n\tcreatedBy: Actor;\n}\n\n/** @internal */\nexport type ToolApprovalStatus = \"open\" | \"accepted\" | \"feedback\" | \"declined\" | \"cancelled\";\n\n/** @internal */\nexport interface ProcessToolApprovalDestination {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tdisplayName: string;\n\t/** @internal */\n\tgroup?: string;\n\t/** @internal */\n\tdescription?: string;\n}\n\n/** @internal */\nexport interface ProcessToolApprovalRequest {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tturnRecordId: string;\n\t/** @internal */\n\ttoolCallId: string;\n\t/** @internal */\n\ttoolName: string;\n\t/** @internal */\n\targuments: Record<string, unknown>;\n\t/** @internal */\n\tdestination: ProcessToolApprovalDestination | null;\n\t/** @internal */\n\tstatus: ToolApprovalStatus;\n\t/** @internal */\n\trequestedAt: string;\n\t/** @internal */\n\tresolvedAt: string | null;\n\t/** @internal */\n\tresolvedBy: Actor | null;\n\t/** @internal */\n\tfeedback: string | null;\n}\n\n/** @internal */\nexport interface ProcessQuestionRequest {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tturnRecordId: string;\n\t/** @internal */\n\ttoolCallId: string;\n\t/** @internal */\n\tquestions: readonly NormalizedQuestion[];\n\t/** @internal */\n\tstatus: \"open\" | \"answered\" | \"cancelled\";\n\t/** @internal */\n\tanswers: readonly string[] | null;\n\t/** @internal */\n\taskedAt: string;\n\t/** @internal */\n\tansweredAt: string | null;\n\t/** @internal */\n\tansweredBy: Actor | null;\n\t/** @internal */\n\tcancelledAt: string | null;\n}\n\nfunction requiredTrimmedString(value: unknown, field: string): string {\n\tconst trimmed = trimToNull(value);\n\tif (!trimmed) {\n\t\tthrow new Error(`${field} must be a non-empty string`);\n\t}\n\treturn trimmed;\n}\n\n/** Normalize an LLM-authored request into immutable, position-stable identities. @internal */\nexport function normalizeAskQuestionsInput(value: unknown): NormalizedQuestion[] {\n\tconst questions = (\n\t\tvalue as {\n\t\t\tquestions?: Array<{\n\t\t\t\tquestion?: unknown;\n\t\t\t\tselection?: unknown;\n\t\t\t\toptions?: Array<{ label?: unknown; details?: unknown }>;\n\t\t\t}>;\n\t\t}\n\t)?.questions;\n\tif (!Array.isArray(questions)) throw new Error(\"questions must be an array\");\n\tif (questions.length === 0) throw new Error(\"questions must not be empty\");\n\treturn questions.map((candidate, questionIndex) => {\n\t\tconst question = requiredTrimmedString(\n\t\t\tcandidate?.question,\n\t\t\t`questions[${questionIndex}].question`,\n\t\t);\n\t\tif (candidate?.selection !== \"single\" && candidate?.selection !== \"multiple\") {\n\t\t\tthrow new Error(`questions[${questionIndex}].selection must be 'single' or 'multiple'`);\n\t\t}\n\t\tif (!Array.isArray(candidate.options) || candidate.options.length === 0) {\n\t\t\tthrow new Error(`questions[${questionIndex}].options must not be empty`);\n\t\t}\n\t\tconst labels = new Set<string>();\n\t\tconst questionId = `question_${questionIndex + 1}`;\n\t\tconst options = candidate.options.map((option, optionIndex) => {\n\t\t\tconst label = requiredTrimmedString(\n\t\t\t\toption?.label,\n\t\t\t\t`questions[${questionIndex}].options[${optionIndex}].label`,\n\t\t\t);\n\t\t\tconst key = label.toLocaleLowerCase();\n\t\t\tif (labels.has(key)) {\n\t\t\t\tthrow new Error(`questions[${questionIndex}] contains duplicate option '${label}'`);\n\t\t\t}\n\t\t\tlabels.add(key);\n\t\t\treturn {\n\t\t\t\tid: `${questionId}_option_${optionIndex + 1}`,\n\t\t\t\tlabel,\n\t\t\t\tdetails: trimToNull(option.details),\n\t\t\t};\n\t\t});\n\t\treturn { id: questionId, question, selection: candidate.selection, options };\n\t});\n}\n\n/** @internal */\nexport function emptyQuestionDrafts(\n\tquestions: readonly NormalizedQuestion[],\n): QuestionAnswerDraft[] {\n\treturn questions.map(() => ({ selectedOptionIds: [], freeText: \"\", comment: \"\" }));\n}\n\nfunction normalizeQuestionDrafts(\n\tquestions: readonly NormalizedQuestion[],\n\tvalue: unknown,\n): QuestionAnswerDraft[] {\n\tif (!Array.isArray(value) || value.length !== questions.length) {\n\t\tthrow new Error(\"Every question must have one draft answer in question order\");\n\t}\n\treturn questions.map((question, index) => {\n\t\tconst answer = value[index] as Partial<QuestionAnswerDraft> | undefined;\n\t\tif (!Array.isArray(answer?.selectedOptionIds)) {\n\t\t\tthrow new Error(`Question ${index + 1} has a malformed selection`);\n\t\t}\n\t\tconst selectedOptionIds = answer.selectedOptionIds.map((id) => {\n\t\t\tif (typeof id !== \"string\" || !question.options.some((option) => option.id === id)) {\n\t\t\t\tthrow new Error(`Question ${index + 1} contains an unknown selection`);\n\t\t\t}\n\t\t\treturn id;\n\t\t});\n\t\tif (new Set(selectedOptionIds).size !== selectedOptionIds.length) {\n\t\t\tthrow new Error(`Question ${index + 1} contains duplicate selections`);\n\t\t}\n\t\tif (question.selection === \"single\" && selectedOptionIds.length > 1) {\n\t\t\tthrow new Error(`Question ${index + 1} accepts only one selection`);\n\t\t}\n\t\tif (typeof answer.freeText !== \"string\" || typeof answer.comment !== \"string\") {\n\t\t\tthrow new Error(`Question ${index + 1} contains malformed text`);\n\t\t}\n\t\treturn { selectedOptionIds, freeText: answer.freeText, comment: answer.comment };\n\t});\n}\n\n/** Validate a complete structured draft and produce one canonical free-text answer per question. @internal */\nexport function canonicalizeQuestionAnswers(\n\tquestions: readonly NormalizedQuestion[],\n\tvalue: unknown,\n): string[] {\n\treturn normalizeQuestionDrafts(questions, value).map((answer, index) => {\n\t\tconst question = questions[index];\n\t\tif (!question) throw new Error(`Question ${index + 1} is missing`);\n\t\tconst options = answer.selectedOptionIds.map(\n\t\t\t(id) => question.options.find((option) => option.id === id)?.label ?? \"\",\n\t\t);\n\t\tconst freeText = answer.freeText.trim();\n\t\tconst comment = answer.comment.trim();\n\t\tif (options.length === 0 && freeText === \"\") {\n\t\t\tthrow new Error(`Question ${index + 1} requires an answer`);\n\t\t}\n\t\treturn [options.join(\", \"), freeText, comment ? `Context: ${comment}` : \"\"]\n\t\t\t.filter(Boolean)\n\t\t\t.join(\"\\n\");\n\t});\n}\n\n/**\n * Durable operator/system input queued for worker delivery.\n * `action_prompt` is the conventional source for action-originated follow-up\n * prompts. Delivery semantics are owned by `ProcessInput.target`, not by\n * `source` or `kind`.\n */\n\n/** @public */\nexport type InputKind = \"instruction\" | \"action\" | \"system_event\";\n\n/** @public */\nexport type ProcessInputTarget =\n\t| {\n\t\t\t/** @public */\n\t\t\tsemanticRef: ProcessSemanticEntryRefKey;\n\t\t\t/** @internal */\n\t\t\tproductName?: never;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tproductName: string;\n\t\t\t/** @public */\n\t\t\tsemanticRef?: never;\n\t };\n\n/** @internal */\nexport const WORKER_ERROR_CLASSES = [\n\t\"llm_error\",\n\t\"git_error\",\n\t\"pi_crash\",\n\t\"pipeline_error\",\n\t\"infrastructure\",\n\t\"protocol_error\",\n\t\"operator_abort\",\n] as const;\n\n/** @internal */\nexport type WorkerErrorClass = (typeof WORKER_ERROR_CLASSES)[number];\n\n/** @internal */\nexport function isWorkerErrorClass(value: string): value is WorkerErrorClass {\n\treturn (WORKER_ERROR_CLASSES as readonly string[]).includes(value);\n}\n\n/** @internal */\nexport type TurnFailureCode = \"branch_drift\";\n\n/** @internal */\nexport function isTurnFailureCode(value: string): value is TurnFailureCode {\n\treturn value === \"branch_drift\";\n}\n\n/** Extension-defined stable turn identifier. @public */\nexport type TurnId = string;\n\n/** @internal */\nexport const PROCESS_TURN_TYPES = [\"llm\", \"human\", \"external\", \"automatic\"] as const;\n\n/** @internal */\nexport type ProcessTurnType = (typeof PROCESS_TURN_TYPES)[number];\n\n/** @internal */\nexport interface TurnOutcomePayload {\n\t/** @internal */\n\tresultSummary?: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tturnRecordId: string;\n\t/** @internal */\n\tturnId: TurnId;\n\t/** @internal */\n\tturnType: ProcessTurnType;\n\t/** @internal */\n\toutcome: string;\n\t/** @internal */\n\tparams: Record<string, unknown>;\n\t/** @internal */\n\tpathType?: ProcessTurnRecordPathType;\n\t/** @internal */\n\tforkPiEntryId?: string | null;\n\t/** @internal */\n\tresultPiEntryId?: string | null;\n\t/** @internal */\n\tturnResultMarkdown?: string | null;\n\t/** @internal */\n\trootEntryId?: string | null;\n\t/** @internal */\n\tstate?: unknown;\n}\n\n/** @internal */\nexport interface TurnFailedPayload {\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tturnRecordId: string;\n\t/** @internal */\n\tturnId: TurnId;\n\t/** @internal */\n\tturnType: ProcessTurnType;\n\t/** @internal */\n\tpathType: ProcessTurnRecordPathType;\n\t/** @internal */\n\tforkPiEntryId?: string | null;\n\t/** @internal */\n\tresultPiEntryId?: string | null;\n\t/** @internal */\n\terrorSummary: string;\n\t/** @internal */\n\terrorClass?: WorkerErrorClass;\n\t/** @internal */\n\tfailureCode?: TurnFailureCode | null;\n\t/** @internal */\n\tfailureDetails?: Record<string, unknown> | null;\n\t/** @internal */\n\trecoveryContext?: FailedTurnRecoveryContext | null;\n}\n\n/** @public */\nexport type ProcessLifecycleStatus =\n\t| \"discovered\"\n\t| \"active\"\n\t| \"waiting\"\n\t| \"error\"\n\t| \"completed\"\n\t| \"aborted\";\n\n/** @internal */\nexport function isProcessTurnType(value: unknown): value is ProcessTurnType {\n\treturn typeof value === \"string\" && (PROCESS_TURN_TYPES as readonly string[]).includes(value);\n}\n\n/** @internal */\nexport function isWorkerOwnedTurnType(turnType: ProcessTurnType): boolean {\n\treturn turnType === \"llm\" || turnType === \"automatic\";\n}\n\n/** @internal */\nexport function isWaitingTurnType(turnType: ProcessTurnType): boolean {\n\treturn turnType === \"human\" || turnType === \"external\";\n}\n\n/** @internal */\nexport function lifecycleStatusForSelectedTurnType(\n\tturnType: ProcessTurnType,\n): Extract<ProcessLifecycleStatus, \"active\" | \"waiting\"> {\n\treturn isWaitingTurnType(turnType) ? \"waiting\" : \"active\";\n}\n\n/** @internal */\nexport type ProcessSelectedTurnModelSource =\n\t| \"action_override\"\n\t| \"launch_override\"\n\t| \"instance_turn_config\"\n\t| \"process_config_turn\"\n\t| \"instance_default\"\n\t| \"scoped_purpose_default\"\n\t| \"process_config_default\"\n\t| \"catalog_default\"\n\t| \"marked_default\"\n\t| \"automatic\"\n\t| \"fixed_purpose\"\n\t| \"legacy_persisted\";\n\n/** @internal */\nexport type ModelSelectionKind = \"explicit\" | \"inherited\";\n/** @internal */\nexport type ModelSelectionSource = ProcessSelectedTurnModelSource;\n\n/** Durable intent and resolution path for one effective model selection. @internal */\nexport interface ModelSelectionProvenance {\n\t/** @internal */\n\tkind: ModelSelectionKind;\n\t/** @internal */\n\tsource: ModelSelectionSource;\n}\n\n/** @internal */\nexport interface DurableModelSelection {\n\t/** @internal */\n\tmodelProfileId: string;\n\t/** @internal */\n\tprovenance: ModelSelectionProvenance;\n}\n\n/** @internal */\nexport type ModelPolicyFailureCode =\n\t| \"invalid_model_configuration\"\n\t| \"unknown_model_profile\"\n\t| \"model_profile_not_allowed\"\n\t| \"model_required\"\n\t| \"model_unavailable\"\n\t| \"model_stale\"\n\t| \"stale_evaluation_snapshot\";\n\n/** @internal */\nexport interface FutureExecutionBlockReason {\n\t/** @internal */\n\tcode: ModelPolicyFailureCode;\n\t/** @internal */\n\tselection: DurableModelSelection | null;\n\t/** @internal */\n\tsummary: string;\n\t/** @internal */\n\tdetectedAt: string;\n\t/** Present when the block depends on a runtime availability snapshot. @internal */\n\tavailabilityRevision?: number;\n}\n\n/** JSON object persisted as non-secret turn-start configuration. @internal */\nexport type JsonObject = Record<string, unknown>;\n\n/** The one durable technical execution currently owned by a process. @internal */\nexport type CurrentExecutionRef = {\n\t/** @internal */\n\tkind: \"worker_start\";\n\t/** @internal */\n\tid: string;\n} | null;\n\n/** Immutable non-secret inputs resolved for a worker-owned turn start. @internal */\nexport type ResolvedTurnStart =\n\t| {\n\t\t\t/** Resolved non-secret outcome schemas and publication metadata. @internal */\n\t\t\toutcomeContract?: JsonObject;\n\t\t\t/** @internal */\n\t\t\tscopedSettings?: ScopedSettingsSnapshot;\n\t\t\t/** @internal */\n\t\t\tkind: \"llm\";\n\t\t\t/** @internal */\n\t\t\tmodel: {\n\t\t\t\t/** @internal */\n\t\t\t\tprofileId: string;\n\t\t\t\t/** @internal */\n\t\t\t\tproviderId: string;\n\t\t\t\t/** @internal */\n\t\t\t\tmodelId: string;\n\t\t\t\t/** @internal */\n\t\t\t\tthinkingLevel: string;\n\t\t\t};\n\t\t\t/** Frozen provenance used to resolve this prepared start. @internal */\n\t\t\tmodelSelectionProvenance?: ModelSelectionProvenance;\n\t\t\t/** Status revision evaluated before preparation. Diagnostic only. @internal */\n\t\t\tavailabilityRevision?: number;\n\t\t\t/** @internal */\n\t\t\tproviderOptions: Record<string, string>;\n\t\t\t/** @internal */\n\t\t\tproviderWorkerConfig: {\n\t\t\t\t/** @internal */\n\t\t\t\tversion: number;\n\t\t\t\t/** @internal */\n\t\t\t\tvalue: JsonObject;\n\t\t\t} | null;\n\t\t\t/** @internal */\n\t\t\tpiResourceSnapshotDigest: string;\n\t\t\t/** @internal */\n\t\t\tworkerRuntimeProfileId: string;\n\t\t\t/** @internal */\n\t\t\tpiSettings: JsonObject;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"automatic\";\n\t };\n\n/** @internal */\nexport type TurnStartKind = \"selected_turn\" | \"retry\" | \"continue\" | \"startup_retry\";\n\n/** @internal */\nexport interface TurnStartContinuation {\n\t/** @internal */\n\tcontinueFromPiEntryId: string;\n\t/** @internal */\n\tcontinuePrompt: string;\n\t/** @internal */\n\tsavedPrimaryLeafEntryId: string | null;\n}\n\n/** @internal */\nexport type TurnStartPreparationFailureCode =\n\t| \"invalid_model_configuration\"\n\t| \"model_required\"\n\t| \"model_unavailable\"\n\t| \"model_stale\"\n\t| \"provider_options_required\"\n\t| \"provider_preflight_failed\";\n\n/** @internal */\nexport interface StartupRetryState {\n\t/** First start in this recovery episode. @internal */\n\tepisodeStartRecordId: string;\n\t/** Includes the initial start; these are not accepted turn attempts. @internal */\n\tstarts: number;\n\t/** Retained deadline so polling and restarts cannot postpone recovery. @internal */\n\tnextRetryAt: string | null;\n}\n\n/** Safe recovery information shared by automation and the process inspector. @public */\nexport interface AutomaticStartupRecoverySummary {\n\t/** @public */\n\tstatus: \"blocked\" | \"waiting\" | \"ready\" | \"waiting_for_model\" | \"exhausted\" | \"retried\";\n\t/** @public */\n\treason: string;\n\t/** @public */\n\tstarts: number;\n\t/** @public */\n\tmaxStarts: number;\n\t/** @public */\n\tnextRetryAt: string | null;\n}\n\n/** @internal */\nexport type TurnStartRecordState = {\n\t/** @internal */\n\tautomaticRetry?: StartupRetryState;\n} & (\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"preparation_failed\";\n\t\t\t/** @internal */\n\t\t\trequestedModelProfileId: string | null;\n\t\t\t/** @internal */\n\t\t\tproviderOptions: Record<string, string>;\n\t\t\t/** @internal */\n\t\t\tcode: TurnStartPreparationFailureCode;\n\t\t\t/** @internal */\n\t\t\tsafeSummary: string;\n\t\t\t/** @internal */\n\t\t\tmodelSelectionProvenance?: ModelSelectionProvenance;\n\t\t\t/** @internal */\n\t\t\tavailabilityRevision?: number;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"starting\";\n\t\t\t/** @internal */\n\t\t\tstart: ResolvedTurnStart;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"bootstrap_failed\";\n\t\t\t/** @internal */\n\t\t\tstart: ResolvedTurnStart;\n\t\t\t/** @internal */\n\t\t\tfailedWorkerLeaseId: string | null;\n\t\t\t/** @internal */\n\t\t\tcode: string;\n\t\t\t/** @internal */\n\t\t\tsafeSummary: string;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"accepted\";\n\t\t\t/** @internal */\n\t\t\tstart: ResolvedTurnStart;\n\t\t\t/** @internal */\n\t\t\tturnRecordId: string;\n\t\t\t/** @internal */\n\t\t\tacceptedWorkerLeaseId: string;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"superseded\";\n\t\t\t/** @internal */\n\t\t\tstart: ResolvedTurnStart | null;\n\t }\n);\n\n/** Durable preparation for a single worker-owned selected turn, not an attempt. @internal */\nexport interface TurnStartRecord {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tturnId: TurnId;\n\t/** @internal */\n\tturnType: Extract<ProcessTurnType, \"llm\" | \"automatic\">;\n\t/** Reserved id used when, and only when, this start is accepted. @internal */\n\tproposedTurnRecordId: string;\n\t/** @internal */\n\tstartKind: TurnStartKind;\n\t/** @internal */\n\trecoveryTurnRecordId: string | null;\n\t/** @internal */\n\tcontinuation: TurnStartContinuation | null;\n\t/** @internal */\n\tstate: TurnStartRecordState;\n\t/** Mapped-turn item this start executes; null for ordinary turns. @internal */\n\titeration?: MappedTurnItemRef | null;\n\t/** @internal */\n\tcreatedAt: string;\n\t/** @internal */\n\tupdatedAt: string;\n}\n\n/** Identity of one frozen item in a mapped LLM run. @internal */\nexport interface MappedTurnItemRef {\n\t/** @internal */\n\trunId: string;\n\t/** @internal */\n\titemKey: string;\n\t/** Zero-based position in the frozen order. @internal */\n\titemIndex: number;\n}\n\n/** @internal */\nexport type MappedRunStatus = \"active\" | \"completed\" | \"aborted\";\n\n/** Durable bookkeeping for one sequential pass of a mapped LLM turn. @internal */\nexport interface MappedRun {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tturnId: TurnId;\n\t/** @internal */\n\tstatus: MappedRunStatus;\n\t/** @internal */\n\titemCount: number;\n\t/** Index of the item currently executing, or itemCount when all results exist. @internal */\n\tnextIndex: number;\n\t/** @internal */\n\tcreatedAt: string;\n\t/** @internal */\n\tupdatedAt: string;\n}\n\n/** @internal */\nexport type MappedItemStatus = \"pending\" | \"completed\";\n\n/** One frozen item of a mapped run and its validated result. @internal */\nexport interface MappedItem {\n\t/** @internal */\n\trunId: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\titemIndex: number;\n\t/** @internal */\n\titemKey: string;\n\t/** @internal */\n\tlabel: string;\n\t/** Codec-serialized item value. @internal */\n\titemJson: string;\n\t/** @internal */\n\tstatus: MappedItemStatus;\n\t/** @internal */\n\toutcome: string | null;\n\t/** Codec-serialized result, set once when the item completes. @internal */\n\tresultJson: string | null;\n\t/** Turn record whose outcome produced the result. @internal */\n\tturnRecordId: string | null;\n\t/** @internal */\n\tcompletedAt: string | null;\n}\n\n/** Tree positioning selected during bootstrap, before a turn is accepted. @internal */\nexport interface PreparedTurnStart {\n\t/** @internal */\n\tpathType: ProcessTurnRecordPathType;\n\t/** Durable authored context mode used to reconcile pre-prompt positioning and compaction. @internal */\n\tcontextMode: LlmContextMode;\n\t/** @internal */\n\tstartTarget: ProcessTurnStartTarget;\n\t/** @internal */\n\tforkPiEntryId: string | null;\n}\n\n/** @internal */\nexport type LlmContextMode = \"full\" | \"compacted\" | \"fresh\" | \"fresh_seeded\";\n\n/** Immutable, lease-correlated proof of successful worker bootstrap. @internal */\nexport type WorkerBootstrapReceipt =\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"llm\";\n\t\t\t/** @internal */\n\t\t\tstartRecordId: string;\n\t\t\t/** @internal */\n\t\t\tworkerLeaseId: string;\n\t\t\t/** @internal */\n\t\t\treceiptEpoch: string;\n\t\t\t/** @internal */\n\t\t\tverifiedResourceSnapshotDigest: string;\n\t\t\t/** @internal */\n\t\t\tcredentialRevision: number | null;\n\t\t\t/** @internal */\n\t\t\tloadedResourceIds: string[];\n\t\t\t/** @internal */\n\t\t\tresolvedModel: {\n\t\t\t\t/** @internal */\n\t\t\t\tproviderId: string;\n\t\t\t\t/** @internal */\n\t\t\t\tmodelId: string;\n\t\t\t};\n\t\t\t/** @internal */\n\t\t\tpreparedStart: PreparedTurnStart | null;\n\t\t\t/** @internal */\n\t\t\treadyAt: string;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"automatic\";\n\t\t\t/** @internal */\n\t\t\tstartRecordId: string;\n\t\t\t/** @internal */\n\t\t\tworkerLeaseId: string;\n\t\t\t/** @internal */\n\t\t\treceiptEpoch: string;\n\t\t\t/** @internal */\n\t\t\treadyAt: string;\n\t };\n\n/** @internal */\nexport const PROCESS_SELECTED_TURN_MODEL_SOURCES = [\n\t\"action_override\",\n\t\"launch_override\",\n\t\"instance_turn_config\",\n\t\"process_config_turn\",\n\t\"instance_default\",\n\t\"process_config_default\",\n\t\"scoped_purpose_default\",\n\t\"catalog_default\",\n\t\"marked_default\",\n\t\"automatic\",\n\t\"fixed_purpose\",\n\t\"legacy_persisted\",\n] as const satisfies readonly ProcessSelectedTurnModelSource[];\n\n/** @internal */\nexport function isProcessSelectedTurnModelSource(\n\tvalue: unknown,\n): value is ProcessSelectedTurnModelSource {\n\treturn PROCESS_SELECTED_TURN_MODEL_SOURCES.includes(value as ProcessSelectedTurnModelSource);\n}\n\n/** @public */\nexport interface ProcessCustomizableFields {\n\t/** @internal */\n\ttitle?: string | null;\n\t/** @public */\n\texternalId?: string | null;\n\t/** @internal */\n\texternalUrl?: string | null;\n\t/** @internal */\n\tmetadata?: Record<string, unknown> | null;\n\t/** @internal */\n\tdefaultModelProfileId?: string | null;\n\t/** @internal */\n\tinitialDefaultModelProfileId?: string | null;\n\t/** @internal */\n\tturnConfigsJson?: string | null;\n\t/** @internal */\n\tselectedTurnModelProfileId?: string | null;\n\t/** @internal */\n\tselectedTurnModelKind?: ModelSelectionKind | null;\n\t/** @internal */\n\tselectedTurnModelSource?: ProcessSelectedTurnModelSource | null;\n}\n\n/** @public */\nexport interface ProcessInstance {\n\t/** @public */\n\tid: string;\n\t/** Canonical process identifier from the extension catalog. @public */\n\tprocessId: string;\n\t/** Durable pointer to the currently selected business turn, if any. @public */\n\tselectedTurnId: TurnId | null;\n\t/** High-level lifecycle bucket for scheduling and operator state. @public */\n\tlifecycleStatus: ProcessLifecycleStatus;\n\t/** Single durable technical execution reference; null for waiting/terminal states. @internal */\n\tcurrentExecution: CurrentExecutionRef;\n\t/** @public */\n\tplanRevision: number;\n\t/** Short operator-facing process title used in process lists and related UI. @public */\n\ttitle: string | null;\n\t/** Provider-agnostic external reference, such as a work item key or change path. @public */\n\texternalId: string | null;\n\t/** URL to the external resource, if applicable. @internal */\n\texternalUrl: string | null;\n\t/** Extension-owned JSON metadata blob. @internal */\n\tmetadata: Record<string, unknown> | null;\n\t/** Instance-scoped default model profile used when no turn override applies. @internal */\n\tdefaultModelProfileId?: string | null;\n\t/** Effective default model at creation time, retained for historical inspection. @internal */\n\tinitialDefaultModelProfileId?: string | null;\n\t/** JSON-serialized per-turn runtime config overrides for this instance. @internal */\n\tturnConfigsJson?: string | null;\n\t/** Frozen effective model profile for the currently selected LLM turn, if any. @internal */\n\tselectedTurnModelProfileId?: string | null;\n\t/** Explicit operator intent or inherited policy resolution for the selected model. @internal */\n\tselectedTurnModelKind?: ModelSelectionKind | null;\n\t/** Resolution path that selected `selectedTurnModelProfileId`; null for empty selections. @internal */\n\tselectedTurnModelSource?: ProcessSelectedTurnModelSource | null;\n\t/** JSON-serialized process params. @public */\n\tparamsJson: string | null;\n\t/** JSON-serialized process state. @public */\n\tstateJson: string | null;\n\t/** @public */\n\tcreatedAt: string;\n\t/** @internal */\n\tupdatedAt: string;\n\t/** Set once when the process first reaches a terminal lifecycle status. @internal */\n\tclosedAt?: string | null;\n}\n\n/** @public */\nexport interface ProcessProject {\n\t/** @public */\n\tid: string;\n\t/** @public */\n\tinstanceId: string;\n\t/** @public */\n\tkey: string;\n\t/** Repository source identifier. May be a remote URL or a local filesystem path. @public */\n\trepoLocator: string;\n\t/** @internal */\n\trepoLocatorKind: RepoLocatorKind;\n\t/** @internal */\n\tbaseBranch: string;\n\t/** @internal */\n\tworkBranch: string | null;\n\t/** Provider-agnostic external identifier (e.g. MR IID, PR number). @internal */\n\texternalId: string | null;\n\t/** URL to the external resource (e.g. MR URL, PR URL). @internal */\n\texternalUrl: string | null;\n\t/** Extension-owned JSON metadata blob. @public */\n\tmetadata: Record<string, unknown> | null;\n\t/** @internal */\n\tpipelineStatus: string | null;\n\t/** @internal */\n\tcreatedAt: string;\n\t/** @internal */\n\tupdatedAt: string;\n}\n\n/** @internal */\nexport interface ProcessInput {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tsequence: number;\n\t/** @internal */\n\tsource: InputSource;\n\t/** @internal */\n\tkind: InputKind;\n\t/** @internal */\n\ttarget: ProcessInputTarget | null;\n\t/** @internal */\n\tbodyMarkdown: string;\n\t/** Stable principal that queued this input. Defaults to `SYSTEM_ACTOR`. @internal */\n\tactor: Actor;\n\t/** @internal */\n\treceivedAt: string;\n\t/** @internal */\n\tconsumedAt: string | null;\n}\n\n/** @internal */\nexport type LaunchOrigin = \"ui\" | \"programmatic\" | \"watcher\" | \"scheduled\" | \"startup_retry\";\n/** @internal */\nexport type LaunchRunStatus =\n\t| \"preparing\"\n\t| \"process_created\"\n\t| \"starting\"\n\t| \"completed\"\n\t| \"failed\"\n\t| \"cancelled\";\n/** @internal */\nexport type LaunchChecklistStepStatus =\n\t| \"pending\"\n\t| \"in_progress\"\n\t| \"completed\"\n\t| \"failed\"\n\t| \"skipped\";\n\n/** Presentation-safe durable progress for one process launch attempt. @internal */\nexport interface LaunchChecklistStep {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tlabel: string;\n\t/** @internal */\n\tstatus: LaunchChecklistStepStatus;\n\t/** @internal */\n\tsafeSummary?: string;\n\t/** @internal */\n\tstartedAt?: string;\n\t/** @internal */\n\tcompletedAt?: string;\n}\n\n/** Durable launch attempt. Secrets and runner identifiers never belong here. @internal */\nexport interface LaunchRun {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tlauncherId: string | null;\n\t/** @internal */\n\torigin: LaunchOrigin;\n\t/** @internal */\n\tinstanceId: string | null;\n\t/** @internal */\n\tstatus: LaunchRunStatus;\n\t/** @internal */\n\tsteps: LaunchChecklistStep[];\n\t/** @internal */\n\tcreatedAt: string;\n\t/** @internal */\n\tupdatedAt: string;\n\t/** @internal */\n\tcompletedAt: string | null;\n\t/** @internal */\n\trevision: number;\n}\n\n/** @internal */\nexport type FutureExecutionKind = \"launch\" | \"action\";\n/** @internal */\nexport type FutureExecutionScheduleKind = \"once\" | \"cron\";\n\n/** @internal */\nexport interface FutureExecution {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tkind: FutureExecutionKind;\n\t/** @internal */\n\tscheduleKind: FutureExecutionScheduleKind;\n\t/** Canonical target process identifier. @internal */\n\tprocessId: string;\n\t/** Populated only for scheduled actions on an existing process instance. @internal */\n\tinstanceId: string | null;\n\t/** @internal */\n\tlauncherId: string | null;\n\t/** @internal */\n\tactionId: string | null;\n\t/** JSON-serialized kind-specific payload. @internal */\n\tpayloadJson: string;\n\t/** @internal */\n\tcronExpression: string | null;\n\t/** @internal */\n\tnextRunAt: string;\n\t/** Immediate LLM selection caused by this execution, if known. @internal */\n\tmodelSelection?: DurableModelSelection | null;\n\t/** Structured model-policy block. Blocked rows remain durable. @internal */\n\tblockedReason?: FutureExecutionBlockReason | null;\n\t/** @internal */\n\tcreatedAt: string;\n\t/** @internal */\n\tupdatedAt: string;\n}\n\n/** @internal */\nexport interface ProcessEvent {\n\t/** Persisted ingestion order. Absent only on legacy in-memory fixtures. @internal */\n\teventSequence?: number;\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\teventType: string;\n\t/** @internal */\n\tdata: Record<string, unknown>;\n\t/** @internal */\n\tcreatedAt: string;\n}\n\n/** @internal */\nexport type ProcessLeafOutcomeSnapshotStatus = \"ready\" | \"capture_error\";\n\n/** @internal */\nexport interface ProcessLeafOutcomeSnapshot {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tleafEntryId: string;\n\t/** @internal */\n\tturnRecordId: string | null;\n\t/** @internal */\n\trendererId: string | null;\n\t/** @internal */\n\tschemaVersion: number | null;\n\t/** @internal */\n\tprops: Record<string, unknown> | null;\n\t/** @internal */\n\tfallbackMarkdown: string | null;\n\t/** @internal */\n\tstatus: ProcessLeafOutcomeSnapshotStatus;\n\t/** @internal */\n\twarningCode: string | null;\n\t/** @internal */\n\twarningMessage: string | null;\n\t/** @internal */\n\tanchoredAt: string;\n\t/** @internal */\n\tcreatedAt: string;\n}\n\n/** @public */\nexport type ProcessTurnRecordStatus = \"running\" | \"succeeded\" | \"failed\" | \"superseded\";\n\n/** @public */\nexport type TurnProgressStepStatus = \"incomplete\" | \"in_progress\" | \"completed\" | \"failed\";\n\n/** @public */\nexport interface TurnProgressStep {\n\t/** @public */\n\tid: string;\n\t/** @public */\n\tlabel: string;\n\t/** @public */\n\tstatus: TurnProgressStepStatus;\n\t/** @public */\n\tdetail?: string | null;\n}\n\n/** @public */\nexport interface TurnProgressLink {\n\t/** @public */\n\tid: string;\n\t/** @public */\n\tlabel: string;\n\t/** @public */\n\turl: string;\n\t/** @public */\n\tkind?: \"pull_request\" | \"merge_request\" | \"commit\" | \"pipeline\" | \"other\";\n}\n\n/** A complete operator-facing snapshot. Reporters replace, rather than patch, this value. @public */\nexport interface TurnProgressReport {\n\t/** @public */\n\ttitle: string;\n\t/** Attempt-specific progress or waiting explanation; not an operation receipt. @public */\n\tsummary?: string;\n\t/** Optional checklist; may be empty when summary supplies the activity text. @public */\n\tsteps: TurnProgressStep[];\n\t/** @public */\n\tlinks?: TurnProgressLink[];\n}\n\n/**\n * Structural tree position for a turn record.\n * - `primary`: continue the primary path from the current leaf\n * - `root_branch`: start from the implicit session root with no prior Pi entry context\n * - `leaf_branch`: fork from the current leaf as a side path\n */\n/** @public */\nexport const PROCESS_TURN_RECORD_PATH_TYPES = [\"primary\", \"root_branch\", \"leaf_branch\"] as const;\n\n/** @public */\nexport type ProcessTurnRecordPathType = (typeof PROCESS_TURN_RECORD_PATH_TYPES)[number];\n\n/** @public */\nexport interface ProcessTurnRecord {\n\t/** @public */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @public */\n\tturnId: TurnId;\n\t/** @internal */\n\tturnType: ProcessTurnType;\n\t/** @public */\n\tstatus: ProcessTurnRecordStatus;\n\t/** @internal */\n\tattemptNumber: number;\n\t/** @internal */\n\tparentTurnRecordId: string | null;\n\t/** @internal */\n\tpathType: ProcessTurnRecordPathType;\n\t/** @internal */\n\tforkPiEntryId: string | null;\n\t/** Accepted worker-start preparation that created this worker-owned record. @internal */\n\tturnStartRecordId?: string | null;\n\t/** Lease whose receipt first authorized this worker-owned record. @internal */\n\tacceptedWorkerLeaseId?: string | null;\n\t/** @internal */\n\tresultPiEntryId: string | null;\n\t/** @internal */\n\tmodelProfileId: string | null;\n\t/** @internal */\n\tmodelSelectionProvenance?: ModelSelectionProvenance | null;\n\t/** Mapped-turn item this record executed; retries keep the same item. @internal */\n\titeration?: MappedTurnItemRef | null;\n\t/** @internal */\n\tturnResultMarkdown: string | null;\n\t/** @public */\n\terrorSummary: string | null;\n\t/** @internal */\n\terrorClass: WorkerErrorClass | null;\n\t/** @internal */\n\tstartedAt: string;\n\t/** @internal */\n\tendedAt: string | null;\n}\n\n/** @internal */\nexport interface WorkerLease {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tworkerId: string;\n\t/** Worker start this physical lease was created to execute. @internal */\n\tturnStartRecordId?: string | null;\n\t/** Durable server-owned supervision state for the current worker lease. @internal */\n\tstate: WorkerState;\n\t/** Server epoch this lease belongs to, used to reject stale snapshot writes. @internal */\n\tserverEpoch?: string | null;\n\t/** Hash of the lease-scoped WebSocket connect token. The raw token is never stored. @internal */\n\tconnectTokenHash?: string | null;\n\t/** Hash of the lease-scoped HTTP session-snapshot credential. The raw token is never stored. @internal */\n\tsnapshotTokenHash?: string | null;\n\t/** Fingerprint of the effective instance model policy/config snapshot used to start this worker. @internal */\n\tmodelPolicyFingerprint?: string | null;\n\t/** First valid lease-correlated bootstrap receipt; written once by the server. @internal */\n\tbootstrapReceipt?: WorkerBootstrapReceipt | null;\n\t/** Updated from heartbeats for liveness/recovery diagnostics. @internal */\n\tlastHeartbeatAt: string | null;\n\t/** @internal */\n\tstartedAt: string;\n\t/** First valid server-observed worker handshake. @internal */\n\tconnectedAt?: string | null;\n\t/** First valid server-observed workspace preparation progress. @internal */\n\tworkspacePreparationStartedAt?: string | null;\n\t/** First accepted server-observed worker readiness. @internal */\n\treadyAt?: string | null;\n\t/** Set once the lease is no longer active for supervision. @internal */\n\texitedAt: string | null;\n}\n\n/**\n * Durable worker lease states owned by the server.\n * `absent` is conceptual in lifecycle logic and usually represented by\n * the absence of an active lease row.\n */\n/** @internal */\nexport type WorkerState =\n\t| \"absent\"\n\t| \"spawning\"\n\t| \"bootstrapping\"\n\t| \"idle\"\n\t| \"busy\"\n\t| \"draining\"\n\t| \"failed\"\n\t| \"cleanup\"\n\t| \"exited\";\n\n/**\n * External write type identifier. Extensions define their own write types\n * as plain strings (e.g. \"tracker.approved_plan_comment\", \"code_host.create_change\").\n */\n/** @public */\nexport type ExternalWriteType = string;\n\n/** @public */\nexport interface ExternalWriteLog {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @public */\n\twriteType: ExternalWriteType;\n\t/** @internal */\n\tdedupKey: string;\n\t/** @internal */\n\tcompletedAt: string;\n\t/** @internal */\n\tmetadata: Record<string, unknown>;\n}\n\n/**\n * Returns a human-readable, operator-facing label for the structural path\n * position of a turn record. These labels avoid internal domain terms such\n * as \"primary\" or \"root_branch\" in favour of plain descriptions of what the\n * turn is doing relative to the main path.\n */\n/** @internal */\nexport function formatPathTypeLabel(pathType: ProcessTurnRecordPathType): string {\n\tswitch (pathType) {\n\t\tcase \"primary\":\n\t\t\treturn \"Continuing the main path\";\n\t\tcase \"root_branch\":\n\t\t\treturn \"Starting from the beginning\";\n\t\tcase \"leaf_branch\":\n\t\t\treturn \"Exploring an alternative\";\n\t\tdefault:\n\t\t\treturn \"Path\";\n\t}\n}\n","import { type Actor, type ActorKind, SYSTEM_ACTOR } from \"./domain-model.js\";\nimport { trimToNull } from \"./string-normalize.js\";\n\nconst ACTOR_KINDS: readonly ActorKind[] = [\"user\", \"channel\", \"system\"];\nfunction isActorKind(value: unknown): value is ActorKind {\n\treturn typeof value === \"string\" && (ACTOR_KINDS as readonly string[]).includes(value);\n}\n\n/**\n * Builds a validated `Actor`, dropping unknown fields and falling back to\n * defaults for invalid kind/provider. Returns `null` when no stable id is\n * present so callers can decide on a fallback actor.\n */\n/** @internal */\nexport function normalizeActor(value: unknown): Actor | null {\n\tif (typeof value !== \"object\" || value === null) {\n\t\treturn null;\n\t}\n\tconst candidate = value as Record<string, unknown>;\n\tconst id = trimToNull(candidate.id);\n\tif (!id) {\n\t\treturn null;\n\t}\n\tconst kind = isActorKind(candidate.kind) ? candidate.kind : \"system\";\n\tconst displayName =\n\t\ttypeof candidate.displayName === \"string\" && candidate.displayName.trim() !== \"\"\n\t\t\t? candidate.displayName\n\t\t\t: undefined;\n\treturn {\n\t\tid,\n\t\tkind,\n\t\tprovider: trimToNull(candidate.provider),\n\t\t...(displayName !== undefined ? { displayName } : {}),\n\t};\n}\n\n/** Serializes an `Actor` to a stable JSON string for durable storage. @internal */\nexport function serializeActor(actor: Actor): string {\n\treturn JSON.stringify({\n\t\tid: actor.id,\n\t\tkind: actor.kind,\n\t\tprovider: actor.provider,\n\t\t...(actor.displayName !== undefined ? { displayName: actor.displayName } : {}),\n\t});\n}\n\n/**\n * Parses a durable actor JSON value, falling back to `SYSTEM_ACTOR` when the\n * stored value is missing or malformed. Used when reading legacy rows that\n * predate actor attribution.\n */\n/** @internal */\nexport function parseActorOrSystem(value: string | null | undefined): Actor {\n\tif (value === null || value === undefined || value.trim() === \"\") {\n\t\treturn SYSTEM_ACTOR;\n\t}\n\ttry {\n\t\treturn normalizeActor(JSON.parse(value)) ?? SYSTEM_ACTOR;\n\t} catch {\n\t\treturn SYSTEM_ACTOR;\n\t}\n}\n\n/** Canonical serialized form of `SYSTEM_ACTOR`, used as the durable default. @internal */\nexport const SERIALIZED_SYSTEM_ACTOR = serializeActor(SYSTEM_ACTOR);\n","/** Dependency-first traversal; callers resolve missing and optional dependencies. @internal */\nexport function orderDependencies(\n\troots: Iterable<string>,\n\tdependencies: (id: string) => Iterable<string>,\n\tcycleMessage: (id: string) => string,\n): string[] {\n\tconst visiting = new Set<string>();\n\tconst ordered = new Set<string>();\n\tfunction visit(id: string): void {\n\t\tif (ordered.has(id)) return;\n\t\tif (visiting.has(id)) throw new Error(cycleMessage(id));\n\t\tvisiting.add(id);\n\t\tfor (const dependency of dependencies(id)) visit(dependency);\n\t\tvisiting.delete(id);\n\t\tordered.add(id);\n\t}\n\tfor (const id of roots) visit(id);\n\treturn [...ordered];\n}\n","import type { PreparedTurnStart } from \"./domain-model.js\";\n\n/** Completeness of one historical fact, independent of request/loading state. @internal */\nexport type InspectionEvidence<T> =\n\t| {\n\t\t\t/** @internal */\n\t\t\tstate: \"recorded\" | \"redacted\";\n\t\t\t/** @internal */\n\t\t\tvalue: T;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tstate: \"not_recorded\" | \"unavailable\" | \"not_applicable\";\n\t\t\t/** @internal */\n\t\t\treason: string;\n\t };\n\n/** Immutable version supplied to a worker, not a declaration of possible consumption. @internal */\nexport interface InspectionProduct {\n\t/** @internal */\n\tname: string;\n\t/** @internal */\n\tproducerTurnRecordId: string;\n\t/** @internal */\n\tentryId: string;\n\t/** @internal */\n\tcontent: InspectionEvidence<string>;\n}\n\n/** Model-facing content only. Renderer details and provider options are deliberately absent. @internal */\nexport interface InspectionMessage {\n\t/** Exact session identity when the conversion is unambiguous. @internal */\n\tentryId: string | null;\n\t/** @internal */\n\trole: string;\n\t/** @internal */\n\ttoolCallId?: string;\n\t/** @internal */\n\tcontent: InspectionEvidence<unknown>;\n}\n\n/** Captured at the Pi stream function after context conversion and tool assembly. @internal */\nexport interface InspectionModelInput {\n\t/** @internal */\n\tkind: \"model_input\";\n\t/** @internal */\n\tboundaryEntryId: string | null;\n\t/** @internal */\n\tmodel: {\n\t\t/** @internal */\n\t\tprovider: string;\n\t\t/** @internal */\n\t\tid: string;\n\t\t/** @internal */\n\t\tthinkingLevel: string | null;\n\t};\n\t/** @internal */\n\tsystemPrompt: InspectionEvidence<string>;\n\t/** @internal */\n\tappendedInstructions: InspectionEvidence<string[]>;\n\t/** @internal */\n\tcontextFiles: InspectionEvidence<\n\t\tArray<{\n\t\t\t/** @internal */\n\t\t\tpath: string;\n\t\t\t/** @internal */\n\t\t\tcontent: string;\n\t\t}>\n\t>;\n\t/** @internal */\n\ttools: InspectionEvidence<\n\t\tArray<{\n\t\t\t/** @internal */\n\t\t\tname: string;\n\t\t\t/** @internal */\n\t\t\tdescription: string;\n\t\t\t/** @internal */\n\t\t\tparameters: unknown;\n\t\t\t/** @internal */\n\t\t\tstrictSchema?: boolean;\n\t\t\t/** @internal */\n\t\t\tschemaEnforcement?: \"provider\" | \"server\";\n\t\t}>\n\t>;\n\t/** Ordered references are retained per call; immutable content is stored once. @internal */\n\tmessages: InspectionMessage[];\n}\n\n/** Versioned worker observation, correlated by the server to an accepted execution and lease. @internal */\nexport interface ExecutionInspectionCapture {\n\t/** Idempotency identity for this observation. @internal */\n\tid: string;\n\t/** @internal */\n\tversion: 1;\n\t/** @internal */\n\ttimestamp: string;\n\t/** @internal */\n\tfact:\n\t\t| InspectionModelInput\n\t\t| {\n\t\t\t\t/** @internal */\n\t\t\t\tkind: \"supplied_context\";\n\t\t\t\t/** @internal */\n\t\t\t\torigin: PreparedTurnStart | null;\n\t\t\t\t/** @internal */\n\t\t\t\tproducts: InspectionProduct[];\n\t\t }\n\t\t| {\n\t\t\t\t/** @internal */\n\t\t\t\tkind: \"product_consumed\";\n\t\t\t\t/** @internal */\n\t\t\t\tsupplyId: string;\n\t\t\t\t/** @internal */\n\t\t\t\tname: string;\n\t\t }\n\t\t| {\n\t\t\t\t/** @internal */\n\t\t\t\tkind: \"entry_link\";\n\t\t\t\t/** @internal */\n\t\t\t\tentryId: string;\n\t\t\t\t/** @internal */\n\t\t\t\tpiTurnId: string;\n\t\t\t\t/** @internal */\n\t\t\t\trole: string;\n\t\t };\n}\n\n/** Compact lineage evidence excludes retained content. @internal */\nexport interface InspectionContextObservation {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tturnRecordId: string;\n\t/** @internal */\n\tfact:\n\t\t| Exclude<\n\t\t\t\tExecutionInspectionCapture[\"fact\"],\n\t\t\t\tInspectionModelInput | { kind: \"supplied_context\" }\n\t\t >\n\t\t| {\n\t\t\t\t/** @internal */\n\t\t\t\tkind: \"supplied_context\";\n\t\t\t\t/** @internal */\n\t\t\t\torigin: PreparedTurnStart | null;\n\t\t\t\t/** @internal */\n\t\t\t\tproducts: Omit<InspectionProduct, \"content\">[];\n\t\t };\n}\n\n/** Server-owned persisted observation. @internal */\nexport interface ExecutionInspectionRecord extends ExecutionInspectionCapture {\n\t/** @internal */\n\tsequence: number;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tturnRecordId: string;\n\t/** @internal */\n\tstartRecordId: string;\n\t/** Physical reporter, which can differ from the original accepting lease. @internal */\n\tworkerLeaseId: string;\n}\n\n/** Redaction is retained as evidence, not silently presented as a complete capture. @internal */\nexport function redactInspectionEvidence<T>(value: T, redact: (text: string) => string): T {\n\tif (typeof value === \"string\") return redact(value) as T;\n\tif (Array.isArray(value)) return value.map((item) => redactInspectionEvidence(item, redact)) as T;\n\tif (!value || typeof value !== \"object\") return value;\n\tconst original = value as Record<string, unknown>;\n\tconst safe = Object.fromEntries(\n\t\tObject.entries(original).map(([key, item]) => [\n\t\t\tredact(key),\n\t\t\tredactInspectionEvidence(item, redact),\n\t\t]),\n\t);\n\tif (\n\t\toriginal.state === \"recorded\" &&\n\t\tJSON.stringify(original.value) !== JSON.stringify(safe.value)\n\t)\n\t\tsafe.state = \"redacted\";\n\treturn safe as T;\n}\n","/** Resolve a validated JSON Pointer through own properties only. @internal */\nexport function resolveJsonPointer(value: unknown, pointer: string): unknown {\n\tif (pointer === \"\") return value;\n\tfor (const token of pointer.slice(1).split(\"/\")) {\n\t\tconst key = token.replaceAll(\"~1\", \"/\").replaceAll(\"~0\", \"~\");\n\t\tif (!value || typeof value !== \"object\" || !Object.hasOwn(value, key)) return undefined;\n\t\tvalue = (value as Record<string, unknown>)[key];\n\t}\n\treturn value;\n}\n","/** @internal */\nexport const DEFAULT_LAUNCHER_RECENT_VALUE_LIMIT = 5;\n\nfunction hasCredentialBearingAbsoluteUrl(value: string): boolean {\n\tif (!/^[a-z][a-z0-9+.-]*:\\/\\//i.test(value)) {\n\t\treturn false;\n\t}\n\ttry {\n\t\tconst url = new URL(value);\n\t\treturn url.protocol !== \"file:\" && (url.username !== \"\" || url.password !== \"\");\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n/**\n * Strip any embedded credentials (`user:pass@`) from an absolute non-`file:` URL,\n * returning the value unchanged when it is not such a URL.\n */\n/** @internal */\nexport function redactCredentialBearingAbsoluteUrl(value: string): string {\n\tif (!hasCredentialBearingAbsoluteUrl(value)) {\n\t\treturn value;\n\t}\n\tconst url = new URL(value);\n\turl.username = \"\";\n\turl.password = \"\";\n\treturn url.toString();\n}\n\n/** @internal */\nexport function normalizeLauncherRecentValue(value: unknown): string | null {\n\tconst normalizedValue = typeof value === \"string\" ? value.trim() : \"\";\n\tif (!normalizedValue || hasCredentialBearingAbsoluteUrl(normalizedValue)) {\n\t\treturn null;\n\t}\n\treturn normalizedValue;\n}\n\n/** @internal */\nexport function normalizeLauncherRecentValues(\n\tvalues: readonly unknown[],\n\tlimit = DEFAULT_LAUNCHER_RECENT_VALUE_LIMIT,\n): string[] {\n\tconst nextValues = new Set<string>();\n\tfor (const value of values) {\n\t\tconst normalizedValue = normalizeLauncherRecentValue(value);\n\t\tif (!normalizedValue || nextValues.has(normalizedValue)) {\n\t\t\tcontinue;\n\t\t}\n\t\tnextValues.add(normalizedValue);\n\t\tif (nextValues.size >= limit) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn [...nextValues];\n}\n\n/** @internal */\nexport function addLauncherRecentValue(\n\texistingValues: readonly string[],\n\tvalue: string,\n\tlimit = DEFAULT_LAUNCHER_RECENT_VALUE_LIMIT,\n): string[] {\n\tconst normalizedValue = normalizeLauncherRecentValue(value);\n\tif (!normalizedValue) {\n\t\treturn normalizeLauncherRecentValues(existingValues, limit);\n\t}\n\treturn normalizeLauncherRecentValues([normalizedValue, ...existingValues], limit);\n}\n","/** @internal */\nexport function normalizeMarkdownLineEndings(markdown: string): string {\n\treturn markdown.replace(/\\r\\n?/g, \"\\n\");\n}\n\n/** @internal */\nexport function normalizeMarkdownText(markdown: string): string {\n\treturn normalizeMarkdownLineEndings(markdown).trim();\n}\n\n/** @internal */\nexport function normalizeOptionalMarkdown(value: unknown): string | null {\n\tif (typeof value !== \"string\") {\n\t\treturn null;\n\t}\n\tconst normalized = normalizeMarkdownText(value);\n\treturn normalized === \"\" ? null : normalized;\n}\n","/** Accept finite numbers and non-blank numeric strings, without coercing other values. @internal */\nexport function readFiniteNumber(value: unknown): number | null {\n\tif (typeof value === \"number\" && Number.isFinite(value)) {\n\t\treturn value;\n\t}\n\tif (typeof value === \"string\" && value.trim() !== \"\") {\n\t\tconst parsed = Number(value);\n\t\treturn Number.isFinite(parsed) ? parsed : null;\n\t}\n\treturn null;\n}\n","import * as v from \"valibot\";\nimport { trimToNull } from \"./string-normalize.js\";\n\n/** @internal */\nexport interface InstanceTurnConfigInput {\n\t/** @internal */\n\tmodelProfileId?: string | null;\n}\n\n/** @internal */\nexport type InstanceTurnConfigMap = Record<string, InstanceTurnConfigInput>;\n\n/** @public */\nexport interface LaunchModelConfigInput {\n\t/** @internal */\n\tdefaultModelProfileId?: string | null;\n\t/** @internal */\n\tturnConfigs?: InstanceTurnConfigMap;\n}\n\n/** @internal */\nexport interface InstanceTurnConfigsJsonError {\n\t/** @internal */\n\tcode: \"invalid_turn_configs_json\";\n\t/** @internal */\n\tprocessId: string;\n\t/** @internal */\n\treason: \"invalid_json\" | \"not_object\" | \"turn_config_not_object\";\n\t/** @internal */\n\tturnId?: string;\n}\n\nconst jsonObjectSchema = v.custom<Record<string, unknown>>(\n\t(value): value is Record<string, unknown> =>\n\t\ttypeof value === \"object\" && value !== null && !Array.isArray(value),\n\t\"Expected object\",\n);\n\nconst instanceTurnConfigSchema = v.pipe(\n\tjsonObjectSchema,\n\tv.object({\n\t\tmodelProfileId: v.optional(v.unknown()),\n\t}),\n);\n\nconst strictInstanceTurnConfigsJsonSchema = v.pipe(\n\tv.string(),\n\tv.parseJson(),\n\tjsonObjectSchema,\n\tv.record(v.string(), instanceTurnConfigSchema),\n);\n\nfunction normalizeInstanceTurnConfigs(\n\tturnConfigs: Record<string, { modelProfileId?: unknown }>,\n): InstanceTurnConfigMap {\n\tconst next: InstanceTurnConfigMap = {};\n\tfor (const [turnId, turnConfig] of Object.entries(turnConfigs)) {\n\t\tconst modelProfileId = trimToNull(turnConfig.modelProfileId);\n\t\tnext[turnId] = modelProfileId ? { modelProfileId } : {};\n\t}\n\treturn next;\n}\n\nfunction getFirstIssuePathKey(issue: v.BaseIssue<unknown>): string | undefined {\n\tconst pathItem = issue.path?.[0] as { key?: unknown } | undefined;\n\treturn typeof pathItem?.key === \"string\" ? pathItem.key : undefined;\n}\n\n/** @internal */\nexport function parseStrictInstanceTurnConfigsJson(\n\tprocessId: string,\n\tturnConfigsJson: string | null | undefined,\n):\n\t| {\n\t\t\t/** @internal */\n\t\t\tok: true;\n\t\t\t/** @internal */\n\t\t\tvalue: InstanceTurnConfigMap;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tok: false;\n\t\t\t/** @internal */\n\t\t\terror: InstanceTurnConfigsJsonError;\n\t } {\n\tif (!turnConfigsJson) return { ok: true, value: {} };\n\tconst result = v.safeParse(strictInstanceTurnConfigsJsonSchema, turnConfigsJson, {\n\t\tabortEarly: true,\n\t});\n\tif (!result.success) {\n\t\tconst issue = result.issues[0];\n\t\tif (issue?.type === \"parse_json\") {\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: { code: \"invalid_turn_configs_json\", processId, reason: \"invalid_json\" },\n\t\t\t};\n\t\t}\n\t\tconst turnId = issue ? getFirstIssuePathKey(issue) : undefined;\n\t\treturn {\n\t\t\tok: false,\n\t\t\terror: {\n\t\t\t\tcode: \"invalid_turn_configs_json\",\n\t\t\t\tprocessId,\n\t\t\t\treason: turnId !== undefined ? \"turn_config_not_object\" : \"not_object\",\n\t\t\t\t...(turnId !== undefined ? { turnId } : {}),\n\t\t\t},\n\t\t};\n\t}\n\treturn { ok: true, value: normalizeInstanceTurnConfigs(result.output) };\n}\n\n/** @internal */\nexport function serializeInstanceTurnConfigs(turnConfigs: InstanceTurnConfigMap): string | null {\n\tconst normalizedEntries = Object.entries(turnConfigs)\n\t\t.map(([turnId, turnConfig]) => {\n\t\t\tconst modelProfileId = trimToNull(turnConfig.modelProfileId);\n\t\t\treturn [turnId, modelProfileId ? { modelProfileId } : {}] as const;\n\t\t})\n\t\t.filter(([, turnConfig]) => Object.keys(turnConfig).length > 0);\n\treturn normalizedEntries.length === 0\n\t\t? null\n\t\t: JSON.stringify(Object.fromEntries(normalizedEntries));\n}\n\n/** @internal */\nexport function normalizeLaunchModelConfigInput(\n\tinput: LaunchModelConfigInput,\n): LaunchModelConfigInput {\n\tconst defaultModelProfileId = trimToNull(input.defaultModelProfileId);\n\tconst nextTurnConfigs: InstanceTurnConfigMap = {};\n\tfor (const [turnId, turnConfig] of Object.entries(input.turnConfigs ?? {})) {\n\t\tconst modelProfileId = trimToNull(turnConfig.modelProfileId);\n\t\tif (modelProfileId) nextTurnConfigs[turnId] = { modelProfileId };\n\t}\n\treturn { defaultModelProfileId, turnConfigs: nextTurnConfigs };\n}\n","import type { TurnId } from \"./domain-model.js\";\n\n/** Breadth-first path in declaration order; null marks success. Returns [entry] without success. @internal */\nexport function shortestSuccessfulTurnPath(\n\tentry: TurnId,\n\toutgoing: (id: TurnId) => Iterable<TurnId | null>,\n): TurnId[] {\n\tconst parents = new Map<TurnId, TurnId | null>([[entry, null]]);\n\tfor (const id of parents.keys()) {\n\t\tfor (const next of outgoing(id)) {\n\t\t\tif (next === null) {\n\t\t\t\tconst path: TurnId[] = [];\n\t\t\t\tlet cursor: TurnId | null = id;\n\t\t\t\twhile (cursor !== null) {\n\t\t\t\t\tpath.push(cursor);\n\t\t\t\t\tcursor = parents.get(cursor) ?? null;\n\t\t\t\t}\n\t\t\t\treturn path.reverse();\n\t\t\t}\n\t\t\tif (parents.has(next)) continue;\n\t\t\tparents.set(next, id);\n\t\t}\n\t}\n\treturn [entry];\n}\n","import type { ProcessInstance, ProcessLifecycleStatus, ProcessProject } from \"./domain-model.js\";\n\n/** @internal */\nexport interface ProcessRowSlot {\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tprocessId: string;\n\t/** @internal */\n\ttitle: string;\n\t/** @internal */\n\tsubtitle: string;\n\t/** @internal */\n\tselectedTurnId: string | null;\n\t/** @internal */\n\tlifecycleStatus: ProcessLifecycleStatus;\n\t/** @internal */\n\tstatusCategory: \"error\" | \"active\" | \"waiting\" | \"terminal\" | \"discovered\";\n\t/** @internal */\n\tprojectCount: number;\n\t/** @internal */\n\texternalId: string | null;\n\t/** @internal */\n\texternalLinkCount: number;\n}\n\n/** @internal */\nexport function getProcessStatusCategory(\n\tlifecycleStatus: ProcessLifecycleStatus,\n): ProcessRowSlot[\"statusCategory\"] {\n\tif (lifecycleStatus === \"error\") return \"error\";\n\tif (lifecycleStatus === \"active\") return \"active\";\n\tif (lifecycleStatus === \"waiting\") return \"waiting\";\n\tif (lifecycleStatus === \"completed\" || lifecycleStatus === \"aborted\") return \"terminal\";\n\treturn \"discovered\";\n}\n\n/** @internal */\nexport function buildProcessRowSlot(\n\tprocess: ProcessInstance,\n\tprojects: ReadonlyArray<ProcessProject>,\n): ProcessRowSlot {\n\tconst externalLinkCount = projects.filter((p) => p.externalId !== null).length;\n\n\tconst title = process.title ?? process.externalId ?? process.id;\n\tconst subtitle = `${process.processId} \\u00b7 ${projects.length} component${projects.length !== 1 ? \"s\" : \"\"}`;\n\n\treturn {\n\t\tinstanceId: process.id,\n\t\tprocessId: process.processId,\n\t\ttitle,\n\t\tsubtitle,\n\t\tselectedTurnId: process.selectedTurnId,\n\t\tlifecycleStatus: process.lifecycleStatus,\n\t\tstatusCategory: getProcessStatusCategory(process.lifecycleStatus),\n\t\tprojectCount: projects.length,\n\t\texternalId: process.externalId,\n\t\texternalLinkCount,\n\t};\n}\n\n/** @internal */\nexport function sortProcessRows(rows: ProcessRowSlot[]): ProcessRowSlot[] {\n\tconst categoryOrder: Record<string, number> = {\n\t\terror: 0,\n\t\tactive: 1,\n\t\twaiting: 2,\n\t\tdiscovered: 3,\n\t\tterminal: 4,\n\t};\n\n\treturn [...rows].sort((a, b) => {\n\t\tconst catA = categoryOrder[a.statusCategory] ?? 4;\n\t\tconst catB = categoryOrder[b.statusCategory] ?? 4;\n\t\tif (catA !== catB) return catA - catB;\n\t\treturn a.title.localeCompare(b.title);\n\t});\n}\n","import * as v from \"valibot\";\n\n/** Parse non-array objects into a fresh record using Valibot's key handling. @internal */\nexport const copiedUnknownRecordSchema = v.pipe(\n\tv.unknown(),\n\tv.check(isUnknownRecord, \"Expected object\"),\n\tv.record(v.string(), v.unknown()),\n);\n\n/** @internal */\nexport function isUnknownRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/** @internal */\nexport function asUnknownRecord(value: unknown): Record<string, unknown> | null {\n\treturn isUnknownRecord(value) ? value : null;\n}\n","import { trimToNull } from \"./string-normalize.js\";\nimport { asUnknownRecord, isUnknownRecord } from \"./unknown-record.js\";\n\n/** @public */\nexport const PROCESS_SEMANTIC_ENTRY_REF_KEYS = [\n\t\"plan\",\n\t\"review\",\n\t\"currentPrimaryPathLeaf\",\n\t\"rootEntry\",\n] as const;\n\n/** @public */\nexport type ProcessSemanticEntryRefKey = (typeof PROCESS_SEMANTIC_ENTRY_REF_KEYS)[number];\n\n/** @internal */\nexport interface SemanticEntryRef {\n\t/** @internal */\n\tentryId: string;\n\t/** @internal */\n\tturnRecordId: string | null;\n}\n\n/** @internal */\nexport function areSemanticEntryRefsEqual(\n\tleft: SemanticEntryRef | null | undefined,\n\tright: SemanticEntryRef | null | undefined,\n): boolean {\n\treturn (\n\t\t(left?.entryId ?? null) === (right?.entryId ?? null) &&\n\t\t(left?.turnRecordId ?? null) === (right?.turnRecordId ?? null)\n\t);\n}\n\n/** @internal */\nexport type ProcessProductRef = SemanticEntryRef;\n/** @internal */\nexport type ProcessProductRefs = Record<string, ProcessProductRef>;\n\nconst PRODUCT_NAME_PATTERN = /^[a-z][a-z0-9-]*$/;\n\n/** @internal */\nexport function isValidProcessProductName(value: string): boolean {\n\treturn PRODUCT_NAME_PATTERN.test(value);\n}\n\n/** @internal */\nexport function assertValidProcessProductName(value: string): void {\n\tif (!isValidProcessProductName(value)) {\n\t\tthrow new Error(\n\t\t\t`Invalid process product name '${value}'. Product names must match ${PRODUCT_NAME_PATTERN.source}`,\n\t\t);\n\t}\n}\n\n/**\n * Stage 2 keeps these refs as structural placeholders initialized to `null`.\n * Current runtime population:\n * - `rootEntry` during worker bootstrap and subsequent worker tree-fact reporting\n * - `currentPrimaryPathLeaf` during worker bootstrap, successful primary turns,\n * and prompt-style primary-path input delivery\n * - `plan` during successful planning turns; it remains the current plan through\n * implementation until another planning turn replaces it\n * - `review` during successful review turns; it remains the current review until\n * another review turn replaces it\n */\n/** @internal */\nexport interface ProcessSemanticEntryRefs {\n\t/** @internal */\n\tplan: SemanticEntryRef | null;\n\t/** @internal */\n\treview: SemanticEntryRef | null;\n\t/** @internal */\n\tcurrentPrimaryPathLeaf: SemanticEntryRef | null;\n\t/** @internal */\n\trootEntry: SemanticEntryRef | null;\n}\n\n/** @internal */\nexport function isProcessSemanticEntryRefKey(value: string): value is ProcessSemanticEntryRefKey {\n\treturn (PROCESS_SEMANTIC_ENTRY_REF_KEYS as readonly string[]).includes(value);\n}\n\n/** @internal */\nexport function parseSemanticEntryRef(value: unknown): SemanticEntryRef | null {\n\tconst record = asUnknownRecord(value);\n\tconst entryId = trimToNull(record?.entryId);\n\tif (!entryId) {\n\t\treturn null;\n\t}\n\treturn {\n\t\tentryId,\n\t\tturnRecordId: trimToNull(record?.turnRecordId),\n\t};\n}\n\n/** @internal */\nexport function createEmptyProcessSemanticEntryRefs(): ProcessSemanticEntryRefs {\n\treturn {\n\t\tplan: null,\n\t\treview: null,\n\t\tcurrentPrimaryPathLeaf: null,\n\t\trootEntry: null,\n\t};\n}\n\n/** @internal */\nexport function createEmptyProcessProductRefs(): ProcessProductRefs {\n\treturn {};\n}\n\n/** @internal */\nexport function parseProcessProductRefs(value: unknown): ProcessProductRefs {\n\tif (!isUnknownRecord(value)) return createEmptyProcessProductRefs();\n\tconst refs: ProcessProductRefs = {};\n\tfor (const [name, rawRef] of Object.entries(value)) {\n\t\tif (!isValidProcessProductName(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst ref = parseSemanticEntryRef(rawRef);\n\t\tif (ref) {\n\t\t\trefs[name] = ref;\n\t\t}\n\t}\n\treturn refs;\n}\n\n/** @internal */\nexport function parseProcessSemanticEntryRefs(value: unknown): ProcessSemanticEntryRefs {\n\tconst record = asUnknownRecord(value) ?? {};\n\treturn {\n\t\tplan: parseSemanticEntryRef(record.plan),\n\t\treview: parseSemanticEntryRef(record.review),\n\t\tcurrentPrimaryPathLeaf: parseSemanticEntryRef(record.currentPrimaryPathLeaf),\n\t\trootEntry: parseSemanticEntryRef(record.rootEntry),\n\t};\n}\n","import {\n\tcreateEmptyProcessProductRefs,\n\tcreateEmptyProcessSemanticEntryRefs,\n\tisValidProcessProductName,\n\ttype ProcessProductRefs,\n\ttype ProcessSemanticEntryRefs,\n\tparseProcessSemanticEntryRefs,\n\tparseSemanticEntryRef,\n} from \"./semantic-entry-refs.js\";\n\n/** @internal */\nexport interface ProcessStateJsonParseContext {\n\t/** @internal */\n\tlabel?: string;\n\t/** @internal */\n\tprocessId?: string;\n}\n\nfunction formatMalformedSubject(\n\tdefaultLabel: string,\n\tcontext: string | ProcessStateJsonParseContext | undefined,\n): string {\n\tif (typeof context === \"string\") {\n\t\treturn context;\n\t}\n\tconst label = context?.label ?? defaultLabel;\n\treturn context?.processId ? `${label} for process '${context.processId}'` : label;\n}\n\n/** @internal */\nexport function parseProcessStateJsonStrict(\n\tstateJson: string | null | undefined,\n\tcontext?: string | ProcessStateJsonParseContext,\n): Record<string, unknown> {\n\tif (!stateJson) {\n\t\treturn {};\n\t}\n\tconst subject = formatMalformedSubject(\"stateJson\", context);\n\tlet parsed: unknown;\n\ttry {\n\t\tparsed = JSON.parse(stateJson);\n\t} catch (error) {\n\t\tthrow new Error(\n\t\t\t`Malformed ${subject}: ${error instanceof Error ? error.message : String(error)}`,\n\t\t);\n\t}\n\tif (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n\t\tthrow new Error(`Malformed ${subject}: expected a JSON object`);\n\t}\n\treturn parsed as Record<string, unknown>;\n}\n\n/** @internal */\nexport function parseProcessStateJsonLenient(\n\tstateJson: string | null | undefined,\n): Record<string, unknown> {\n\ttry {\n\t\treturn parseProcessStateJsonStrict(stateJson);\n\t} catch {\n\t\treturn {};\n\t}\n}\n\n/** @internal */\nexport function parseSemanticEntryRefsStrict(\n\tvalue: unknown,\n\tcontext?: ProcessStateJsonParseContext,\n): ProcessSemanticEntryRefs {\n\tif (value === undefined) {\n\t\treturn createEmptyProcessSemanticEntryRefs();\n\t}\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n\t\tthrow new Error(\n\t\t\t`Malformed ${formatMalformedSubject(\"semanticEntryRefs\", {\n\t\t\t\tlabel: \"semanticEntryRefs\",\n\t\t\t\tprocessId: context?.processId,\n\t\t\t})}: expected an object when present`,\n\t\t);\n\t}\n\treturn parseProcessSemanticEntryRefs(value);\n}\n\n/** @internal */\nexport function parseSemanticEntryRefsLenient(value: unknown): ProcessSemanticEntryRefs {\n\ttry {\n\t\treturn parseSemanticEntryRefsStrict(value);\n\t} catch {\n\t\treturn createEmptyProcessSemanticEntryRefs();\n\t}\n}\n\n/** @internal */\nexport function parseProductRefsStrict(\n\tvalue: unknown,\n\tcontext?: ProcessStateJsonParseContext,\n): ProcessProductRefs {\n\tif (value === undefined) {\n\t\treturn createEmptyProcessProductRefs();\n\t}\n\tconst subject = formatMalformedSubject(\"productRefs\", {\n\t\tlabel: \"productRefs\",\n\t\tprocessId: context?.processId,\n\t});\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n\t\tthrow new Error(`Malformed ${subject}: expected an object when present`);\n\t}\n\tconst refs: ProcessProductRefs = {};\n\tfor (const [name, rawRef] of Object.entries(value as Record<string, unknown>)) {\n\t\tif (!isValidProcessProductName(name)) {\n\t\t\tthrow new Error(`Malformed ${subject}: invalid product name '${name}'`);\n\t\t}\n\t\tconst ref = parseSemanticEntryRef(rawRef);\n\t\tif (!ref) {\n\t\t\tthrow new Error(`Malformed ${subject}: product '${name}' must reference an entry`);\n\t\t}\n\t\trefs[name] = ref;\n\t}\n\treturn refs;\n}\n\n/** @internal */\nexport function parseProductRefsLenient(value: unknown): ProcessProductRefs {\n\ttry {\n\t\treturn parseProductRefsStrict(value);\n\t} catch {\n\t\treturn createEmptyProcessProductRefs();\n\t}\n}\n\n/** @internal */\nexport function parseSemanticEntryRefsFromStateJsonStrict(\n\tstateJson: string | null | undefined,\n\tcontext?: string | ProcessStateJsonParseContext,\n): ProcessSemanticEntryRefs {\n\tconst stateRecord = parseProcessStateJsonStrict(stateJson, context);\n\treturn parseSemanticEntryRefsStrict(\n\t\tstateRecord.semanticEntryRefs,\n\t\ttypeof context === \"string\" ? undefined : context,\n\t);\n}\n\n/** @internal */\nexport function parseSemanticEntryRefsFromStateJsonLenient(\n\tstateJson: string | null | undefined,\n): ProcessSemanticEntryRefs {\n\tconst stateRecord = parseProcessStateJsonLenient(stateJson);\n\treturn parseSemanticEntryRefsLenient(stateRecord.semanticEntryRefs);\n}\n\n/** @internal */\nexport function parseProductRefsFromStateJsonStrict(\n\tstateJson: string | null | undefined,\n\tcontext?: string | ProcessStateJsonParseContext,\n): ProcessProductRefs {\n\tconst stateRecord = parseProcessStateJsonStrict(stateJson, context);\n\treturn parseProductRefsStrict(\n\t\tstateRecord.productRefs,\n\t\ttypeof context === \"string\" ? undefined : context,\n\t);\n}\n\n/** @internal */\nexport function parseProductRefsFromStateJsonLenient(\n\tstateJson: string | null | undefined,\n): ProcessProductRefs {\n\tconst stateRecord = parseProcessStateJsonLenient(stateJson);\n\treturn parseProductRefsLenient(stateRecord.productRefs);\n}\n","/** @internal */\nexport type RepoLocatorKind = \"remote_url\" | \"local_path\";\n\n/** @internal */\nexport interface ParsedRepoLocator {\n\t/** @internal */\n\tkind: RepoLocatorKind;\n\t/** @internal */\n\tvalue: string;\n}\n\nfunction isFileUrl(value: string): boolean {\n\ttry {\n\t\tconst url = new URL(value);\n\t\tif (url.protocol !== \"file:\") {\n\t\t\treturn false;\n\t\t}\n\t\treturn (\n\t\t\t(url.hostname === \"\" || url.hostname === \"localhost\") &&\n\t\t\turl.pathname.startsWith(\"/\") &&\n\t\t\tdecodeURIComponent(url.pathname).length > 1\n\t\t);\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction isLocalFilesystemPath(value: string): boolean {\n\treturn (\n\t\tvalue.startsWith(\"/\") ||\n\t\tvalue.startsWith(\"./\") ||\n\t\tvalue.startsWith(\"../\") ||\n\t\tvalue.startsWith(\"~/\") ||\n\t\tisFileUrl(value)\n\t);\n}\n\nconst scpLikeGitUrlPattern = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+:[^\\s]+$/;\nconst explicitRemoteGitUrlPattern = /^(?:https?|ssh|git):\\/\\//;\n\nfunction hasRepositoryPath(pathname: string): boolean {\n\treturn pathname.split(\"/\").filter(Boolean).length >= 1;\n}\n\nfunction isRemoteGitUrl(value: string): boolean {\n\tif (scpLikeGitUrlPattern.test(value)) {\n\t\tconst path = value.slice(value.indexOf(\":\") + 1);\n\t\treturn hasRepositoryPath(path);\n\t}\n\tif (!explicitRemoteGitUrlPattern.test(value)) {\n\t\treturn false;\n\t}\n\ttry {\n\t\tconst url = new URL(value);\n\t\treturn (\n\t\t\t[\"http:\", \"https:\", \"ssh:\", \"git:\"].includes(url.protocol) &&\n\t\t\t!!url.hostname &&\n\t\t\thasRepositoryPath(url.pathname)\n\t\t);\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n/** @internal */\nexport function detectRepoLocatorKind(value: string): RepoLocatorKind | null {\n\tconst trimmed = value.trim();\n\tif (trimmed.length === 0) {\n\t\treturn null;\n\t}\n\tif (isLocalFilesystemPath(trimmed)) {\n\t\treturn \"local_path\";\n\t}\n\tif (isRemoteGitUrl(trimmed)) {\n\t\treturn \"remote_url\";\n\t}\n\treturn null;\n}\n\n/** @internal */\nexport function parseRepoLocator(value: unknown): ParsedRepoLocator | null {\n\tif (typeof value !== \"string\") {\n\t\treturn null;\n\t}\n\tconst trimmed = value.trim();\n\tconst kind = detectRepoLocatorKind(trimmed);\n\tif (!kind) {\n\t\treturn null;\n\t}\n\treturn { kind, value: trimmed };\n}\n\n/** @internal */\nexport function isRepoLocator(value: unknown): value is string {\n\treturn parseRepoLocator(value) !== null;\n}\n\n/** @internal */\nexport function assertRepoLocator(value: unknown, fieldName = \"repoLocator\"): string {\n\tconst parsed = parseRepoLocator(value);\n\tif (!parsed) {\n\t\tthrow new Error(`${fieldName} must be a remote URL or local filesystem path`);\n\t}\n\treturn parsed.value;\n}\n","/** First server receipt of a physical worker startup milestone. @internal */\nexport type StartupMilestone =\n\t| \"pvc_requested\"\n\t| \"pvc_acknowledged\"\n\t| \"pvc_bound\"\n\t| \"pod_requested\"\n\t| \"pod_acknowledged\"\n\t| \"pod_created\"\n\t| \"pod_scheduled\"\n\t| \"image_pull_started\"\n\t| \"image_pull_finished\"\n\t| \"image_cached\"\n\t| \"container_started\"\n\t| \"prompt_started\"\n\t| \"first_text\";\n/** @internal */\nexport interface StartupObservation {\n\t/** @internal */\n\tworkerLeaseId: string;\n\t/** @internal */\n\tmilestone: StartupMilestone;\n\t/** @internal */\n\tobservedAt: string;\n\t/** @internal */\n\tsourceAt: string | null;\n\t/** @internal */\n\tsourceKind: \"server\" | \"kubernetes_status\" | \"kubernetes_event\";\n\t/** @internal */\n\tobjectUid: string | null;\n\t/** @internal */\n\tturnRecordId: string | null;\n\t/** Sampling lower bound, never an exact binding timestamp. @internal */\n\tnotBefore: string | null;\n\t/** @internal */\n\tmetadata: {\n\t\t/** @internal */\n\t\tnode?: string;\n\t\t/** @internal */\n\t\timageId?: string;\n\t\t/** @internal */\n\t\timage?: string;\n\t\t/** @internal */\n\t\tstorageClass?: string;\n\t\t/** @internal */\n\t\tcpu?: string;\n\t\t/** @internal */\n\t\tmemory?: string;\n\t\t/** @internal */\n\t\tnamespace?: string;\n\t\t/** @internal */\n\t\tpodName?: string;\n\t\t/** @internal */\n\t\tprecision?: \"milliseconds\" | \"microseconds\" | \"seconds\" | \"sampling_interval\";\n\t};\n}\n/** @internal */\nexport interface StartupInterval {\n\t/** @internal */\n\tstart: string | null;\n\t/** @internal */\n\tend: string | null;\n\t/** @internal */\n\tdurationMs: number | null;\n\t/** @internal */\n\tstatus: \"available\" | \"missing\" | \"invalid_order\";\n\t/** @internal */\n\tclock: \"server\" | \"kubernetes\";\n}\n/** @internal */\nexport function startupInterval(\n\tstart: string | null | undefined,\n\tend: string | null | undefined,\n\tclock: StartupInterval[\"clock\"] = \"server\",\n): StartupInterval {\n\tconst delta = start && end ? Date.parse(end) - Date.parse(start) : NaN;\n\tconst status =\n\t\t!start || !end\n\t\t\t? \"missing\"\n\t\t\t: !Number.isFinite(delta) || delta < 0\n\t\t\t\t? \"invalid_order\"\n\t\t\t\t: \"available\";\n\treturn {\n\t\tstart: start ?? null,\n\t\tend: end ?? null,\n\t\tdurationMs: status === \"available\" ? delta : null,\n\t\tstatus,\n\t\tclock,\n\t};\n}\n/** @internal */\nexport interface PhysicalWorkerStart {\n\t/** @internal */\n\tworkerLeaseId: string;\n\t/** @internal */\n\tworkerId: string;\n\t/** @internal */\n\tturnStartRecordId: string | null;\n\t/** @internal */\n\tturnRecordId: string | null;\n\t/** @internal */\n\tstate: string;\n\t/** @internal */\n\tobservations: StartupObservation[];\n\t/** @internal */\n\tintervals: Record<string, StartupInterval>;\n}\n","import {\n\tisProcessSemanticEntryRefKey,\n\ttype ProcessSemanticEntryRefKey,\n} from \"./semantic-entry-refs.js\";\nimport { trimToNull } from \"./string-normalize.js\";\n\n/** @internal */\nexport const TURN_ANNOTATION_REFERENCE_KINDS = [\n\t\"turn_record\",\n\t\"entry\",\n\t\"semantic_entry_ref\",\n] as const;\n\n/** @internal */\nexport type TurnAnnotationReferenceKind = (typeof TURN_ANNOTATION_REFERENCE_KINDS)[number];\n/** @internal */\nexport type TurnAnnotationReferenceRole = string;\n\n/** @internal */\nexport interface TurnRecordAnnotationReference {\n\t/** @internal */\n\tkind: \"turn_record\";\n\t/** @internal */\n\tturnRecordId: string;\n\t/** @internal */\n\trole: TurnAnnotationReferenceRole | null;\n}\n\n/** @internal */\nexport interface EntryTurnAnnotationReference {\n\t/** @internal */\n\tkind: \"entry\";\n\t/** @internal */\n\tentryId: string;\n\t/** @internal */\n\trole: TurnAnnotationReferenceRole | null;\n}\n\n/** @internal */\nexport interface SemanticEntryRefTurnAnnotationReference {\n\t/** @internal */\n\tkind: \"semantic_entry_ref\";\n\t/** @internal */\n\tref: ProcessSemanticEntryRefKey;\n\t/** @internal */\n\trole: TurnAnnotationReferenceRole | null;\n}\n\n/** @internal */\nexport type TurnAnnotationReference =\n\t| TurnRecordAnnotationReference\n\t| EntryTurnAnnotationReference\n\t| SemanticEntryRefTurnAnnotationReference;\n\n/** @internal */\nexport interface ProcessTurnAnnotation {\n\t/** @internal */\n\tid: string;\n\t/** @internal */\n\tinstanceId: string;\n\t/** @internal */\n\tannotationType: string;\n\t/** @internal */\n\tannotationKey: string | null;\n\t/** @internal */\n\treferences: TurnAnnotationReference[];\n\t/** @internal */\n\tpayload: Record<string, unknown>;\n\t/** @internal */\n\tcreatedAt: string;\n\t/** @internal */\n\tupdatedAt: string;\n}\n\n/** @internal */\nexport function parseTurnAnnotationReference(value: unknown): TurnAnnotationReference | null {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n\t\treturn null;\n\t}\n\tconst record = value as Record<string, unknown>;\n\tconst kind = trimToNull(record.kind);\n\tconst role = trimToNull(record.role);\n\tif (kind === \"turn_record\") {\n\t\tconst turnRecordId = trimToNull(record.turnRecordId);\n\t\treturn turnRecordId ? { kind, turnRecordId, role } : null;\n\t}\n\tif (kind === \"entry\") {\n\t\tconst entryId = trimToNull(record.entryId);\n\t\treturn entryId ? { kind, entryId, role } : null;\n\t}\n\tif (kind === \"semantic_entry_ref\") {\n\t\tconst ref = trimToNull(record.ref);\n\t\treturn ref && isProcessSemanticEntryRefKey(ref) ? { kind, ref, role } : null;\n\t}\n\treturn null;\n}\n\n/** @internal */\nexport function parseTurnAnnotationReferences(value: unknown): TurnAnnotationReference[] {\n\tif (!Array.isArray(value)) {\n\t\treturn [];\n\t}\n\treturn value\n\t\t.map(parseTurnAnnotationReference)\n\t\t.filter((reference): reference is TurnAnnotationReference => reference !== null);\n}\n","import { normalizeStringArray, trimToNull } from \"./string-normalize.js\";\nimport { isUnknownRecord as isRecord } from \"./unknown-record.js\";\n\n/** @internal */\nexport const DEFAULT_CONTINUE_PROMPT = \"continue\";\n\n/** @internal */\nexport const FAILED_TURN_RECOVERY_CODES = [\n\t\"generic_continue\",\n\t\"outcome_rejected\",\n\t\"missing_outcome_tool\",\n\t\"missing_markdown_result\",\n\t\"missing_required_tool_calls\",\n] as const;\n\n/** @internal */\nexport type FailedTurnRecoveryCode = (typeof FAILED_TURN_RECOVERY_CODES)[number];\n\n/** @internal */\nexport interface FailedTurnRecoveryContext {\n\t/** @internal */\n\tstrategy: \"continue\";\n\t/** @internal */\n\tsuggestedContinuePrompt: string;\n\t/** @internal */\n\tfailureCode: FailedTurnRecoveryCode;\n\t/** @internal */\n\tmissingToolNames?: string[];\n}\n\n/** @internal */\nexport type FailedTurnRecoveryOverrides = Partial<Omit<FailedTurnRecoveryContext, \"strategy\">>;\n\n/** @internal */\nexport const FAILED_TURN_RECOVERY_METADATA_KEY = \"failedTurnRecovery\";\n/** @internal */\nexport const CONTINUE_PROMPT_METADATA_KEY = \"continuePrompt\";\nconst TERMINAL_OUTCOME_RECORDING_FAILURE_PREFIX =\n\t\"Server could not durably record worker turn outcome:\";\n\n/** @internal */\nexport function isFailedTurnRecoveryCode(value: string): value is FailedTurnRecoveryCode {\n\treturn (FAILED_TURN_RECOVERY_CODES as readonly string[]).includes(value);\n}\n\nfunction normalizeUniqueStringArray(value: unknown): string[] | undefined {\n\tconst normalized = normalizeStringArray(value);\n\treturn normalized.length > 0 ? [...new Set(normalized)] : undefined;\n}\n\nexport { trimToNull as normalizeContinuePrompt };\n\n/** @internal */\nexport function createGenericFailedTurnRecoveryContext(\n\toverrides: FailedTurnRecoveryOverrides = {},\n): FailedTurnRecoveryContext {\n\treturn {\n\t\tstrategy: \"continue\",\n\t\tsuggestedContinuePrompt: DEFAULT_CONTINUE_PROMPT,\n\t\tfailureCode: \"generic_continue\",\n\t\t...overrides,\n\t};\n}\n\n/** @internal */\nexport function inferTerminalRecordingFailedTurnRecoveryContext(input: {\n\t/** @internal */\n\terrorSummary?: string | null;\n\t/** @internal */\n\terrorClass?: string | null;\n}): FailedTurnRecoveryContext | null {\n\tif (\n\t\tinput.errorClass !== \"infrastructure\" ||\n\t\t!input.errorSummary?.startsWith(TERMINAL_OUTCOME_RECORDING_FAILURE_PREFIX)\n\t) {\n\t\treturn null;\n\t}\n\treturn createGenericFailedTurnRecoveryContext();\n}\n\n/** @internal */\nexport function buildFailedTurnRecoveryMetadata(\n\tturnRecordId: string,\n\tcontext: FailedTurnRecoveryOverrides = {},\n) {\n\treturn {\n\t\t/** @internal */\n\t\t[FAILED_TURN_RECOVERY_METADATA_KEY]: {\n\t\t\t/** @internal */\n\t\t\tturnRecordId,\n\t\t\t...createGenericFailedTurnRecoveryContext(context),\n\t\t},\n\t};\n}\n\n/** @internal */\nexport function readFailedTurnRecoveryContext(\n\tmetadata: Record<string, unknown> | null | undefined,\n\texpectedTurnRecordId?: string | null,\n): FailedTurnRecoveryContext | null {\n\tif (!metadata) {\n\t\treturn null;\n\t}\n\tconst raw = metadata[FAILED_TURN_RECOVERY_METADATA_KEY];\n\tif (!isRecord(raw)) {\n\t\treturn null;\n\t}\n\tif (expectedTurnRecordId) {\n\t\tconst turnRecordId = trimToNull(raw.turnRecordId);\n\t\tif (turnRecordId !== expectedTurnRecordId) {\n\t\t\treturn null;\n\t\t}\n\t}\n\tif (raw.strategy !== \"continue\") {\n\t\treturn null;\n\t}\n\tconst suggestedContinuePrompt = trimToNull(raw.suggestedContinuePrompt);\n\tconst failureCode = trimToNull(raw.failureCode);\n\tif (!suggestedContinuePrompt || !failureCode || !isFailedTurnRecoveryCode(failureCode)) {\n\t\treturn null;\n\t}\n\tconst missingToolNames = normalizeUniqueStringArray(raw.missingToolNames);\n\treturn {\n\t\tstrategy: \"continue\",\n\t\tsuggestedContinuePrompt,\n\t\tfailureCode,\n\t\t...(missingToolNames ? { missingToolNames } : {}),\n\t};\n}\n","import type { ProcessTurnRecordPathType } from \"./domain-model.js\";\nimport type {\n\tProcessProductRefs,\n\tProcessSemanticEntryRefKey,\n\tProcessSemanticEntryRefs,\n} from \"./semantic-entry-refs.js\";\n\n/** @internal */\nexport interface ProcessTurnStartFromCurrentLeaf {\n\t/** @internal */\n\tkind: \"current_leaf\";\n}\n\n/** @internal */\nexport interface ProcessTurnStartFromSessionRoot {\n\t/** Start with no persisted Pi entry in context. The kickoff entry has parentId null. @internal */\n\tkind: \"session_root\";\n}\n\n/** @internal */\nexport interface ProcessTurnStartFromEntry {\n\t/** @internal */\n\tkind: \"entry\";\n\t/** @internal */\n\tentryId: string;\n}\n\n/** @internal */\nexport type ProcessTurnStartFallback =\n\t| ProcessTurnStartFromCurrentLeaf\n\t| ProcessTurnStartFromSessionRoot\n\t| ProcessTurnStartFromEntry;\n\n/** @internal */\nexport interface ProcessTurnStartFromSemanticRef {\n\t/** @internal */\n\tkind: \"semantic_ref\";\n\t/** @internal */\n\tref: ProcessSemanticEntryRefKey;\n\t/** @internal */\n\tfallback?: ProcessTurnStartSelection;\n}\n\n/** @internal */\nexport interface ProcessTurnStartFromProductRef {\n\t/** @internal */\n\tkind: \"product_ref\";\n\t/** @internal */\n\tproductName: string;\n\t/** @internal */\n\tfallback?: ProcessTurnStartSelection;\n}\n\n/** @internal */\nexport type ProcessTurnStartSelection =\n\t| ProcessTurnStartFallback\n\t| ProcessTurnStartFromSemanticRef\n\t| ProcessTurnStartFromProductRef;\n\n/** @internal */\nexport type ProcessTurnStartTarget =\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"current_leaf\";\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"entry\";\n\t\t\t/** @internal */\n\t\t\tentryId: string;\n\t }\n\t| {\n\t\t\t/** @internal */\n\t\t\tkind: \"root\";\n\t };\n\n/** @internal */\nexport interface ProcessTurnStartResolution {\n\t/** @internal */\n\tforkPiEntryId: string | null;\n\t/** @internal */\n\tstartTarget: ProcessTurnStartTarget;\n}\n\n/** @internal */\nexport function defaultProcessTurnStartSelection(\n\tbranchType: ProcessTurnRecordPathType,\n): ProcessTurnStartFallback {\n\tswitch (branchType) {\n\t\tcase \"primary\":\n\t\tcase \"leaf_branch\":\n\t\t\treturn { kind: \"current_leaf\" };\n\t\tcase \"root_branch\":\n\t\t\treturn { kind: \"session_root\" };\n\t}\n}\n\n/** @internal */\nexport function resolveProcessTurnStartSelection(input: {\n\t/** @internal */\n\tbranchType: ProcessTurnRecordPathType;\n\t/** @internal */\n\tstartFrom?: ProcessTurnStartSelection;\n}): ProcessTurnStartSelection {\n\treturn input.startFrom ?? defaultProcessTurnStartSelection(input.branchType);\n}\n\n/** @internal */\nexport function resolveExistingProcessEntryId(\n\tentryId: string | null,\n\tentryExists?: ((entryId: string) => boolean) | undefined,\n): string | null {\n\tif (!entryId) {\n\t\treturn null;\n\t}\n\treturn entryExists && !entryExists(entryId) ? null : entryId;\n}\n\n/** @internal */\nexport function resolveProcessSemanticRefEntryId(input: {\n\t/** @internal */\n\tref: keyof ProcessSemanticEntryRefs;\n\t/** @internal */\n\tsemanticEntryRefs?: ProcessSemanticEntryRefs | null;\n\t/** @internal */\n\tcurrentLeafId: string | null;\n\t/** @internal */\n\trootEntryId: string | null;\n\t/** @internal */\n\tentryExists?: (entryId: string) => boolean;\n}): string | null {\n\tconst fromState = resolveExistingProcessEntryId(\n\t\tinput.semanticEntryRefs?.[input.ref]?.entryId ?? null,\n\t\tinput.entryExists,\n\t);\n\tif (fromState) {\n\t\treturn fromState;\n\t}\n\tif (input.ref === \"currentPrimaryPathLeaf\") {\n\t\treturn resolveExistingProcessEntryId(input.currentLeafId, input.entryExists);\n\t}\n\tif (input.ref === \"rootEntry\") {\n\t\treturn resolveExistingProcessEntryId(input.rootEntryId, input.entryExists);\n\t}\n\treturn null;\n}\n\n/** @internal */\nexport function resolveProcessProductRefEntryId(input: {\n\t/** @internal */\n\tproductName: string;\n\t/** @internal */\n\tproductRefs?: ProcessProductRefs | null;\n\t/** @internal */\n\tentryExists?: (entryId: string) => boolean;\n}): string | null {\n\tconst productName = input.productName.trim();\n\tif (!productName) {\n\t\treturn null;\n\t}\n\treturn resolveExistingProcessEntryId(\n\t\tinput.productRefs?.[productName]?.entryId ?? null,\n\t\tinput.entryExists,\n\t);\n}\n\n/** @internal */\nexport function resolveProcessTurnStartTarget(input: {\n\t/** @internal */\n\tbranchType: ProcessTurnRecordPathType;\n\t/** @internal */\n\tselection: ProcessTurnStartSelection;\n\t/** @internal */\n\tcurrentLeafId: string | null;\n\t/** @internal */\n\trootEntryId: string | null;\n\t/** @internal */\n\tsemanticEntryRefs?: ProcessSemanticEntryRefs | null;\n\t/** @internal */\n\tproductRefs?: ProcessProductRefs | null;\n\t/** @internal */\n\tentryExists?: (entryId: string) => boolean;\n}): ProcessTurnStartResolution {\n\tswitch (input.selection.kind) {\n\t\tcase \"current_leaf\": {\n\t\t\treturn {\n\t\t\t\tforkPiEntryId: resolveExistingProcessEntryId(input.currentLeafId, input.entryExists),\n\t\t\t\tstartTarget: { kind: \"current_leaf\" },\n\t\t\t};\n\t\t}\n\t\tcase \"session_root\": {\n\t\t\treturn {\n\t\t\t\tforkPiEntryId: null,\n\t\t\t\tstartTarget: { kind: \"root\" },\n\t\t\t};\n\t\t}\n\t\tcase \"entry\": {\n\t\t\treturn {\n\t\t\t\tforkPiEntryId: input.selection.entryId,\n\t\t\t\tstartTarget: { kind: \"entry\", entryId: input.selection.entryId },\n\t\t\t};\n\t\t}\n\t\tcase \"semantic_ref\":\n\t\tcase \"product_ref\": {\n\t\t\tconst entryId =\n\t\t\t\tinput.selection.kind === \"semantic_ref\"\n\t\t\t\t\t? resolveProcessSemanticRefEntryId({\n\t\t\t\t\t\t\t...input,\n\t\t\t\t\t\t\tref: input.selection.ref,\n\t\t\t\t\t\t})\n\t\t\t\t\t: resolveProcessProductRefEntryId({\n\t\t\t\t\t\t\t...input,\n\t\t\t\t\t\t\tproductName: input.selection.productName,\n\t\t\t\t\t\t});\n\t\t\tif (entryId) {\n\t\t\t\treturn {\n\t\t\t\t\tforkPiEntryId: entryId,\n\t\t\t\t\tstartTarget: { kind: \"entry\", entryId },\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn resolveProcessTurnStartTarget({\n\t\t\t\t...input,\n\t\t\t\tselection: input.selection.fallback ?? defaultProcessTurnStartSelection(input.branchType),\n\t\t\t});\n\t\t}\n\t}\n}\n","import { createRepositoryChangeProcess } from \"@leitwerk-dev/coding\";\nimport type { RepositoryChangePublicationAdapter } from \"@leitwerk-dev/coding/repository-change-publication\";\nimport {\n\tcreateRepositoryChangePublication,\n\ttype PublicationEvidence,\n\ttype PublicationSource,\n\treadPublicationState,\n} from \"@leitwerk-dev/coding/repository-change-publication\";\nimport type { RepositoryChangeState } from \"@leitwerk-dev/coding/repository-change-state\";\nimport {\n\tcreateGitLabPublicationAdapter,\n\ttype GitLabDeliveryObservation,\n\tgitlabExternal,\n\tgitlabIssueWatcherSource,\n\tgitlabPublicationEvidenceForRequest,\n} from \"@leitwerk-dev/gitlab\";\nimport type { ExtensionProcessDefinition, ServerExtensionAPI } from \"@leitwerk-dev/process-sdk\";\nimport type { createGitLabRepoChangeLauncher } from \"./launcher.js\";\nimport { type GitLabRepoChangeParams, gitlabRepoChangeParamsCodec } from \"./params.js\";\n\nconst remote = (state: RepositoryChangeState) => readPublicationState(state, \"gitlabRepoChange\");\nconst maintenanceAdapters = new WeakMap<\n\tExtensionProcessDefinition<GitLabRepoChangeParams, RepositoryChangeState>,\n\tRepositoryChangePublicationAdapter<GitLabRepoChangeParams>\n>();\n/** @internal */\nexport function registerGitLabRepoChangeMaintenance(\n\tapi: ServerExtensionAPI,\n\tprocess: ExtensionProcessDefinition<GitLabRepoChangeParams, RepositoryChangeState>,\n): void {\n\tmaintenanceAdapters.get(process)?.maintenance?.register(api, process);\n}\nfunction requireRequest(state: RepositoryChangeState) {\n\tconst current = remote(state);\n\tif (!current.prNumber || !current.headSha)\n\t\tthrow new Error(\"Merge request delivery state is incomplete\");\n\treturn { ...current, prNumber: current.prNumber, headSha: current.headSha };\n}\n\n/** @public */\nexport function gitlabPublicationEvidence(\n\tstate: RepositoryChangeState,\n\tevent: GitLabDeliveryObservation,\n): PublicationEvidence {\n\treturn gitlabPublicationEvidenceForRequest(remote(state), event);\n}\n\n/** @public */\nexport function createGitLabRepoChangeProcess(\n\tlauncher: ReturnType<typeof createGitLabRepoChangeLauncher>,\n\tdocker: boolean,\n) {\n\tconst sources: PublicationSource<GitLabRepoChangeParams>[] = [\n\t\t{\n\t\t\tid: \"source_cancelled\",\n\t\t\tkind: \"cancelled\",\n\t\t\tlabel: \"GitLab source issue cancelled\",\n\t\t\tenabled: (params, state) =>\n\t\t\t\tparams.origin === \"issue\" && !!remote(state).prNumber && !!remote(state).headSha,\n\t\t\tsource: gitlabExternal.issueCancelled(({ params, state }) => {\n\t\t\t\tif (params.origin !== \"issue\") throw new Error(\"Missing GitLab source issue\");\n\t\t\t\treturn {\n\t\t\t\t\tprofile: params.gitlabProfile,\n\t\t\t\t\torigin: params.gitlabOrigin,\n\t\t\t\t\tprojectId: params.projectId,\n\t\t\t\t\tissueIid: params.issueNumber,\n\t\t\t\t\tiid: requireRequest(state).prNumber,\n\t\t\t\t\ttriggerLabel: params.triggerLabel,\n\t\t\t\t\tpollInterval: \"30s\",\n\t\t\t\t};\n\t\t\t}),\n\t\t\tread: () => ({ kind: \"cancelled\" }),\n\t\t},\n\t];\n\tconst adapter = createGitLabPublicationAdapter<GitLabRepoChangeParams>(sources);\n\tconst publication = createRepositoryChangePublication(adapter);\n\tpublication.fragment.watcher({\n\t\tid: \"use_leitwerk\",\n\t\tlabel: \"GitLab use-leitwerk issues\",\n\t\tdescription: \"Launch repository changes from labeled GitLab issues\",\n\t\tsource: gitlabIssueWatcherSource,\n\t\tpreparationChecks: launcher.preparationChecks,\n\t\tresolveLaunchConfig: launcher.fromIssue,\n\t});\n\tconst definition = createRepositoryChangeProcess<GitLabRepoChangeParams>({\n\t\tprocessId: \"gitlab_repo_change_process\",\n\t\tdisplayName: \"GitLab Repo Change\",\n\t\tparamsCodec: gitlabRepoChangeParamsCodec,\n\t\tlauncher: launcher.launcher,\n\t\tworkflow: launcher.workflow,\n\t\trepositoryCredentials: ({ params, projects }) =>\n\t\t\tprojects.map((project) => {\n\t\t\t\tif (!params.gitSshProfile) throw new Error(\"Missing Git SSH profile\");\n\t\t\t\treturn {\n\t\t\t\t\tprojectKey: project.key,\n\t\t\t\t\tkind: \"git_ssh\" as const,\n\t\t\t\t\tcredentialRef: params.gitSshProfile,\n\t\t\t\t};\n\t\t\t}),\n\t\tpublication,\n\t});\n\tdefinition.process.runtime = { ...definition.process.runtime, docker };\n\tmaintenanceAdapters.set(definition.process, adapter);\n\treturn definition.process;\n}\n","import {\n\tcreateRepositoryChangeParamsCodec,\n\tnormalizeRepositoryChangeParamsInput,\n\ttype RepositoryChangeLaunchParams,\n\ttype RepositoryIssueOriginParams,\n\ttype RepositoryUiOriginParams,\n\trepositoryChangeParamsRecord,\n} from \"@leitwerk-dev/coding/repository-change-launch\";\nimport { trimString } from \"@leitwerk-dev/domain\";\n\n/** @public */\nexport type GitLabRepoChangeParams = RepositoryChangeLaunchParams<\n\t{\n\t\t/** @public */\n\t\tgitlabProfile: string;\n\n\t\t/** @public */\n\t\tgitSshProfile?: string;\n\n\t\t/** @public */\n\t\tgitlabOrigin: string;\n\n\t\t/** @public */\n\t\tprojectId: number;\n\n\t\t/** @public */\n\t\towner: string;\n\n\t\t/** @public */\n\t\trepo: string;\n\t} & (RepositoryUiOriginParams | RepositoryIssueOriginParams)\n>;\n\n/** @public */\nexport const gitlabRepoChangeParamsCodec =\n\tcreateRepositoryChangeParamsCodec<GitLabRepoChangeParams>({\n\t\tnormalize(value) {\n\t\t\tconst r = repositoryChangeParamsRecord(value, \"GitLab Repo Change\");\n\t\t\tconst text = (key: string) => {\n\t\t\t\tconst v = trimString(r[key]);\n\t\t\t\tif (!v) throw new Error(`GitLab Repo Change requires ${key}`);\n\t\t\t\treturn v;\n\t\t\t};\n\t\t\tif (typeof r.projectId !== \"number\" || !Number.isSafeInteger(r.projectId) || r.projectId <= 0)\n\t\t\t\tthrow new Error(\"GitLab Repo Change requires projectId\");\n\t\t\tconst common = {\n\t\t\t\t...normalizeRepositoryChangeParamsInput(value, \"GitLab Repo Change\"),\n\t\t\t\tgitlabProfile: text(\"gitlabProfile\"),\n\t\t\t\tgitSshProfile: trimString(r.gitSshProfile),\n\t\t\t\tgitlabOrigin: text(\"gitlabOrigin\"),\n\t\t\t\tprojectId: r.projectId,\n\t\t\t\towner: text(\"owner\"),\n\t\t\t\trepo: text(\"repo\"),\n\t\t\t};\n\t\t\tif (r.origin === \"ui\")\n\t\t\t\treturn {\n\t\t\t\t\t...common,\n\t\t\t\t\torigin: \"ui\",\n\t\t\t\t\tissueNumber: null,\n\t\t\t\t\tissueUrl: null,\n\t\t\t\t\ttriggerLabel: null,\n\t\t\t\t\tdoneLabel: null,\n\t\t\t\t};\n\t\t\tif (\n\t\t\t\tr.origin !== \"issue\" ||\n\t\t\t\ttypeof r.issueNumber !== \"number\" ||\n\t\t\t\t!Number.isSafeInteger(r.issueNumber) ||\n\t\t\t\tr.issueNumber <= 0\n\t\t\t)\n\t\t\t\tthrow new Error(\"GitLab Repo Change requires a valid origin and issueNumber\");\n\t\t\treturn {\n\t\t\t\t...common,\n\t\t\t\torigin: \"issue\",\n\t\t\t\tissueNumber: r.issueNumber,\n\t\t\t\tissueUrl: text(\"issueUrl\"),\n\t\t\t\ttriggerLabel: text(\"triggerLabel\"),\n\t\t\t\tdoneLabel: text(\"doneLabel\"),\n\t\t\t};\n\t\t},\n\t});\n"],"mappings":"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","names":[]}