@halliday-sdk/payments 2.1.0 → 2.3.0
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/paymentsApiClient/index.cjs.min.js +1 -1
- package/dist/paymentsApiClient/index.cjs.min.js.map +1 -1
- package/dist/paymentsApiClient/index.d.ts +52 -1
- package/dist/paymentsApiClient/index.esm.min.js +1 -1
- package/dist/paymentsApiClient/index.esm.min.js.map +1 -1
- package/dist/paymentsWidget/index.cjs.min.js +1 -1
- package/dist/paymentsWidget/index.cjs.min.js.map +1 -1
- package/dist/paymentsWidget/index.d.ts +172 -2
- package/dist/paymentsWidget/index.esm.min.js +1 -1
- package/dist/paymentsWidget/index.esm.min.js.map +1 -1
- package/dist/paymentsWidget/index.umd.min.js +1 -1
- package/dist/paymentsWidget/index.umd.min.js.map +1 -1
- package/package.json +5 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.min.js","sources":["../../../node_modules/zod/dist/esm/v4/core/core.js","../../../node_modules/zod/dist/esm/v4/core/util.js","../../../node_modules/zod/dist/esm/v4/core/errors.js","../../../node_modules/zod/dist/esm/v4/core/parse.js","../../../node_modules/zod/dist/esm/v4/core/regexes.js","../../../node_modules/zod/dist/esm/v4/core/checks.js","../../../node_modules/zod/dist/esm/v4/core/doc.js","../../../node_modules/zod/dist/esm/v4/core/versions.js","../../../node_modules/zod/dist/esm/v4/core/schemas.js","../../../node_modules/zod/dist/esm/v4/core/registries.js","../../../node_modules/zod/dist/esm/v4/core/api.js","../../../node_modules/zod/dist/esm/v4/classic/iso.js","../../../node_modules/zod/dist/esm/v4/classic/errors.js","../../../node_modules/zod/dist/esm/v4/classic/parse.js","../../../node_modules/zod/dist/esm/v4/classic/schemas.js","../../../_shared/constants/index.ts","../../../_shared/types/index.ts","../../src/paymentsApiClient/hson.ts","../../../node_modules/reflect-metadata/Reflect.js","../../src/paymentsApiClient/decorators.ts","../../src/paymentsApiClient/axios/responseValidationInterceptor.ts","../../src/paymentsApiClient/axios/errorInterceptor.ts","../../src/paymentsApiClient/axios/index.ts","../../src/paymentsApiClient/utils.ts","../../src/paymentsApiClient/types.ts","../../src/paymentsApiClient/PaymentsApiClient.ts"],"sourcesContent":["export /*@__NO_SIDE_EFFECTS__*/ function $constructor(name, initializer, params) {\n function init(inst, def) {\n var _a;\n Object.defineProperty(inst, \"_zod\", {\n value: inst._zod ?? {},\n enumerable: false,\n });\n (_a = inst._zod).traits ?? (_a.traits = new Set());\n inst._zod.traits.add(name);\n initializer(inst, def);\n // support prototype modifications\n for (const k in _.prototype) {\n Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) });\n }\n inst._zod.constr = _;\n inst._zod.def = def;\n }\n // doesn't work if Parent has a constructor with arguments\n const Parent = params?.Parent ?? Object;\n class Definition extends Parent {\n }\n Object.defineProperty(Definition, \"name\", { value: name });\n function _(def) {\n var _a;\n const inst = params?.Parent ? new Definition() : this;\n init(inst, def);\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n for (const fn of inst._zod.deferred) {\n fn();\n }\n return inst;\n }\n Object.defineProperty(_, \"init\", { value: init });\n Object.defineProperty(_, Symbol.hasInstance, {\n value: (inst) => {\n if (params?.Parent && inst instanceof params.Parent)\n return true;\n return inst?._zod?.traits?.has(name);\n },\n });\n Object.defineProperty(_, \"name\", { value: name });\n return _;\n}\n////////////////////////////// UTILITIES ///////////////////////////////////////\nexport const $brand = Symbol(\"zod_brand\");\nexport class $ZodAsyncError extends Error {\n constructor() {\n super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);\n }\n}\nexport const globalConfig = {};\nexport function config(newConfig) {\n if (newConfig)\n Object.assign(globalConfig, newConfig);\n return globalConfig;\n}\n","// functions\nexport function assertEqual(val) {\n return val;\n}\nexport function assertNotEqual(val) {\n return val;\n}\nexport function assertIs(_arg) { }\nexport function assertNever(_x) {\n throw new Error();\n}\nexport function assert(_) { }\nexport function getEnumValues(entries) {\n const numericValues = Object.values(entries).filter((v) => typeof v === \"number\");\n const values = Object.entries(entries)\n .filter(([k, _]) => numericValues.indexOf(+k) === -1)\n .map(([_, v]) => v);\n return values;\n}\nexport function joinValues(array, separator = \"|\") {\n return array.map((val) => stringifyPrimitive(val)).join(separator);\n}\nexport function jsonStringifyReplacer(_, value) {\n if (typeof value === \"bigint\")\n return value.toString();\n return value;\n}\nexport function cached(getter) {\n const set = false;\n return {\n get value() {\n if (!set) {\n const value = getter();\n Object.defineProperty(this, \"value\", { value });\n return value;\n }\n throw new Error(\"cached value already set\");\n },\n };\n}\nexport function nullish(input) {\n return input === null || input === undefined;\n}\nexport function cleanRegex(source) {\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n return source.slice(start, end);\n}\nexport function floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepDecCount = (step.toString().split(\".\")[1] || \"\").length;\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = Number.parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = Number.parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / 10 ** decCount;\n}\nexport function defineLazy(object, key, getter) {\n const set = false;\n Object.defineProperty(object, key, {\n get() {\n if (!set) {\n const value = getter();\n object[key] = value;\n return value;\n }\n throw new Error(\"cached value already set\");\n },\n set(v) {\n Object.defineProperty(object, key, {\n value: v,\n // configurable: true,\n });\n // object[key] = v;\n },\n configurable: true,\n });\n}\nexport function assignProp(target, prop, value) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n}\nexport function getElementAtPath(obj, path) {\n if (!path)\n return obj;\n return path.reduce((acc, key) => acc?.[key], obj);\n}\nexport function promiseAllObject(promisesObj) {\n const keys = Object.keys(promisesObj);\n const promises = keys.map((key) => promisesObj[key]);\n return Promise.all(promises).then((results) => {\n const resolvedObj = {};\n for (let i = 0; i < keys.length; i++) {\n resolvedObj[keys[i]] = results[i];\n }\n return resolvedObj;\n });\n}\nexport function randomString(length = 10) {\n const chars = \"abcdefghijklmnopqrstuvwxyz\";\n let str = \"\";\n for (let i = 0; i < length; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n}\nexport function esc(str) {\n return JSON.stringify(str);\n}\nexport function isObject(data) {\n return typeof data === \"object\" && data !== null && !Array.isArray(data);\n}\nexport const allowsEval = cached(() => {\n try {\n const F = Function;\n new F(\"\");\n return true;\n }\n catch (_) {\n return false;\n }\n});\nexport function isPlainObject(data) {\n return (typeof data === \"object\" &&\n data !== null &&\n (Object.getPrototypeOf(data) === Object.prototype || Object.getPrototypeOf(data) === null));\n}\nexport function numKeys(data) {\n let keyCount = 0;\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n keyCount++;\n }\n }\n return keyCount;\n}\nexport const getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return \"undefined\";\n case \"string\":\n return \"string\";\n case \"number\":\n return Number.isNaN(data) ? \"nan\" : \"number\";\n case \"boolean\":\n return \"boolean\";\n case \"function\":\n return \"function\";\n case \"bigint\":\n return \"bigint\";\n case \"symbol\":\n return \"symbol\";\n case \"object\":\n if (Array.isArray(data)) {\n return \"array\";\n }\n if (data === null) {\n return \"null\";\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return \"promise\";\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return \"map\";\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return \"set\";\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return \"date\";\n }\n if (typeof File !== \"undefined\" && data instanceof File) {\n return \"file\";\n }\n return \"object\";\n default:\n throw new Error(`Unknown data type: ${t}`);\n }\n};\nexport const propertyKeyTypes = new Set([\"string\", \"number\", \"symbol\"]);\nexport const primitiveTypes = new Set([\"string\", \"number\", \"bigint\", \"boolean\", \"symbol\", \"undefined\"]);\nexport function escapeRegex(str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n// zod-specific utils\nexport function clone(inst, def, params) {\n const cl = new inst._zod.constr(def ?? inst._zod.def);\n if (!def || params?.parent)\n cl._zod.parent = inst;\n return cl;\n}\nexport function normalizeParams(_params) {\n const params = _params;\n if (!params)\n return {};\n if (typeof params === \"string\")\n return { error: () => params };\n if (params?.message !== undefined) {\n if (params?.error !== undefined)\n throw new Error(\"Cannot specify both `message` and `error` params\");\n params.error = params.message;\n }\n delete params.message;\n if (typeof params.error === \"string\")\n return { ...params, error: () => params.error };\n return params;\n}\nexport function createTransparentProxy(getter) {\n let target;\n return new Proxy({}, {\n get(_, prop, receiver) {\n target ?? (target = getter());\n return Reflect.get(target, prop, receiver);\n },\n set(_, prop, value, receiver) {\n target ?? (target = getter());\n return Reflect.set(target, prop, value, receiver);\n },\n has(_, prop) {\n target ?? (target = getter());\n return Reflect.has(target, prop);\n },\n deleteProperty(_, prop) {\n target ?? (target = getter());\n return Reflect.deleteProperty(target, prop);\n },\n ownKeys(_) {\n target ?? (target = getter());\n return Reflect.ownKeys(target);\n },\n getOwnPropertyDescriptor(_, prop) {\n target ?? (target = getter());\n return Reflect.getOwnPropertyDescriptor(target, prop);\n },\n defineProperty(_, prop, descriptor) {\n target ?? (target = getter());\n return Reflect.defineProperty(target, prop, descriptor);\n },\n });\n}\nexport function stringifyPrimitive(value) {\n if (typeof value === \"bigint\")\n return value.toString() + \"n\";\n if (typeof value === \"string\")\n return `\"${value}\"`;\n return `${value}`;\n}\nexport function optionalKeys(shape) {\n return Object.keys(shape).filter((k) => {\n return shape[k]._zod.optin === \"optional\" && shape[k]._zod.optout === \"optional\";\n });\n}\nexport const NUMBER_FORMAT_RANGES = {\n safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],\n int32: [-2147483648, 2147483647],\n uint32: [0, 4294967295],\n float32: [-3.4028234663852886e38, 3.4028234663852886e38],\n float64: [-Number.MAX_VALUE, Number.MAX_VALUE],\n};\nexport const BIGINT_FORMAT_RANGES = {\n int64: [/* @__PURE__*/ BigInt(\"-9223372036854775808\"), /* @__PURE__*/ BigInt(\"9223372036854775807\")],\n uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt(\"18446744073709551615\")],\n};\nexport function pick(schema, mask) {\n const newShape = {};\n const currDef = schema._zod.def; //.shape;\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // pick key\n newShape[key] = currDef.shape[key];\n }\n return clone(schema, {\n ...schema._zod.def,\n shape: newShape,\n checks: [],\n });\n}\nexport function omit(schema, mask) {\n const newShape = { ...schema._zod.def.shape };\n const currDef = schema._zod.def; //.shape;\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n delete newShape[key];\n }\n return clone(schema, {\n ...schema._zod.def,\n shape: newShape,\n checks: [],\n });\n}\nexport function extend(schema, shape) {\n const def = {\n ...schema._zod.def,\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n checks: [], // delete existing checks\n };\n return clone(schema, def);\n}\nexport function merge(a, b) {\n return clone(a, {\n ...a._zod.def,\n get shape() {\n const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n catchall: b._zod.def.catchall,\n checks: [], // delete existing checks\n });\n}\nexport function partial(Class, schema, mask) {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in oldShape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n else {\n for (const key in oldShape) {\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n return clone(schema, {\n ...schema._zod.def,\n shape,\n checks: [],\n });\n}\nexport function required(Class, schema, mask) {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n else {\n for (const key in oldShape) {\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n return clone(schema, {\n ...schema._zod.def,\n shape,\n // optional: [],\n checks: [],\n });\n}\nexport function aborted(x, startIndex = 0) {\n for (let i = startIndex; i < x.issues.length; i++) {\n if (x.issues[i].continue !== true)\n return true;\n }\n return false;\n}\nexport function prefixIssues(path, issues) {\n return issues.map((iss) => {\n var _a;\n (_a = iss).path ?? (_a.path = []);\n iss.path.unshift(path);\n return iss;\n });\n}\nexport function unwrapMessage(message) {\n return typeof message === \"string\" ? message : message?.message;\n}\nexport function finalizeIssue(iss, ctx, config) {\n const full = { ...iss, path: iss.path ?? [] };\n // for backwards compatibility\n if (!iss.message) {\n const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??\n unwrapMessage(ctx?.error?.(iss)) ??\n unwrapMessage(config.customError?.(iss)) ??\n unwrapMessage(config.localeError?.(iss)) ??\n \"Invalid input\";\n full.message = message;\n }\n // delete (full as any).def;\n delete full.inst;\n delete full.continue;\n if (!ctx?.reportInput) {\n delete full.input;\n }\n return full;\n}\nexport function getSizableOrigin(input) {\n if (input instanceof Set)\n return \"set\";\n if (input instanceof Map)\n return \"map\";\n if (input instanceof File)\n return \"file\";\n return \"unknown\";\n}\nexport function getLengthableOrigin(input) {\n if (Array.isArray(input))\n return \"array\";\n if (typeof input === \"string\")\n return \"string\";\n return \"unknown\";\n}\nexport function issue(...args) {\n const [iss, input, inst] = args;\n if (typeof iss === \"string\") {\n return {\n message: iss,\n code: \"custom\",\n input,\n inst,\n };\n }\n return { ...iss };\n}\nexport function cleanEnum(obj) {\n return Object.entries(obj)\n .filter(([k, _]) => {\n // return true if NaN, meaning it's not a number, thus a string key\n return Number.isNaN(Number.parseInt(k, 10));\n })\n .map((el) => el[1]);\n}\n// instanceof\nexport class Class {\n constructor(..._args) { }\n}\n","import { $constructor } from \"./core.js\";\nimport * as util from \"./util.js\";\nconst initializer = (inst, def) => {\n inst.name = \"$ZodError\";\n Object.defineProperty(inst, \"_zod\", {\n value: inst._zod,\n enumerable: false,\n });\n Object.defineProperty(inst, \"issues\", {\n value: def,\n enumerable: false,\n });\n Object.defineProperty(inst, \"message\", {\n get() {\n return JSON.stringify(def, util.jsonStringifyReplacer, 2);\n },\n enumerable: true,\n // configurable: false,\n });\n};\nexport const $ZodError = $constructor(\"$ZodError\", initializer);\nexport const $ZodRealError = $constructor(\"$ZodError\", initializer, { Parent: Error });\nexport function flattenError(error, mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of error.issues) {\n if (sub.path.length > 0) {\n fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];\n fieldErrors[sub.path[0]].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n}\nexport function formatError(error, _mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n issue.errors.map((issues) => processError({ issues }));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues });\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues });\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(error);\n return fieldErrors;\n}\nexport function treeifyError(error, _mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const result = { errors: [] };\n const processError = (error, path = []) => {\n var _a, _b;\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n // regular union error\n issue.errors.map((issues) => processError({ issues }, issue.path));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues }, issue.path);\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues }, issue.path);\n }\n else {\n const fullpath = [...path, ...issue.path];\n if (fullpath.length === 0) {\n result.errors.push(mapper(issue));\n continue;\n }\n let curr = result;\n let i = 0;\n while (i < fullpath.length) {\n const el = fullpath[i];\n const terminal = i === fullpath.length - 1;\n if (typeof el === \"string\") {\n curr.properties ?? (curr.properties = {});\n (_a = curr.properties)[el] ?? (_a[el] = { errors: [] });\n curr = curr.properties[el];\n }\n else {\n curr.items ?? (curr.items = []);\n (_b = curr.items)[el] ?? (_b[el] = { errors: [] });\n curr = curr.items[el];\n }\n if (terminal) {\n curr.errors.push(mapper(issue));\n }\n i++;\n }\n }\n }\n };\n processError(error);\n return result;\n}\n/** Format a ZodError as a human-readable string in the following form.\n *\n * From\n *\n * ```ts\n * ZodError {\n * issues: [\n * {\n * expected: 'string',\n * code: 'invalid_type',\n * path: [ 'username' ],\n * message: 'Invalid input: expected string'\n * },\n * {\n * expected: 'number',\n * code: 'invalid_type',\n * path: [ 'favoriteNumbers', 1 ],\n * message: 'Invalid input: expected number'\n * }\n * ];\n * }\n * ```\n *\n * to\n *\n * ```\n * username\n * ✖ Expected number, received string at \"username\n * favoriteNumbers[0]\n * ✖ Invalid input: expected number\n * ```\n */\nexport function toDotPath(path) {\n const segs = [];\n for (const seg of path) {\n if (typeof seg === \"number\")\n segs.push(`[${seg}]`);\n else if (typeof seg === \"symbol\")\n segs.push(`[${JSON.stringify(String(seg))}]`);\n else if (/[^\\w$]/.test(seg))\n segs.push(`[${JSON.stringify(seg)}]`);\n else {\n if (segs.length)\n segs.push(\".\");\n segs.push(seg);\n }\n }\n return segs.join(\"\");\n}\nexport function prettifyError(error) {\n const lines = [];\n // sort by path length\n const issues = [...error.issues].sort((a, b) => a.path.length - b.path.length);\n // Process each issue\n for (const issue of issues) {\n lines.push(`✖ ${issue.message}`);\n if (issue.path?.length)\n lines.push(` → at ${toDotPath(issue.path)}`);\n }\n // Convert Map to formatted string\n return lines.join(\"\\n\");\n}\n","import * as core from \"./core.js\";\nimport * as errors from \"./errors.js\";\nimport * as util from \"./util.js\";\nexport const _parse = (_Err) => (schema, value, _ctx, _params) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n if (result.issues.length) {\n const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n Error.captureStackTrace(e, _params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parse = /* @__PURE__*/ _parse(errors.$ZodRealError);\nexport const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n if (result.issues.length) {\n const e = new (params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n Error.captureStackTrace(e, params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parseAsync = /* @__PURE__*/ _parseAsync(errors.$ZodRealError);\nexport const _safeParse = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._ctx, async: false } : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n return result.issues.length\n ? {\n success: false,\n error: new (_Err ?? errors.$ZodError)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParse = /* @__PURE__*/ _safeParse(errors.$ZodRealError);\nexport const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n return result.issues.length\n ? {\n success: false,\n error: new _Err(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParseAsync = /* @__PURE__*/ _safeParseAsync(errors.$ZodRealError);\n","export const cuid = /^[cC][^\\s-]{8,}$/;\nexport const cuid2 = /^[0-9a-z]+$/;\nexport const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;\nexport const xid = /^[0-9a-vA-V]{20}$/;\nexport const ksuid = /^[A-Za-z0-9]{27}$/;\nexport const nanoid = /^[a-zA-Z0-9_-]{21}$/;\n/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */\nexport const duration = /^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/;\n/** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */\nexport const extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/;\n/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */\nexport const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;\n/** Returns a regex for validating an RFC 4122 UUID.\n *\n * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */\nexport const uuid = (version) => {\n if (!version)\n return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;\n return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);\n};\nexport const uuid4 = /*@__PURE__*/ uuid(4);\nexport const uuid6 = /*@__PURE__*/ uuid(6);\nexport const uuid7 = /*@__PURE__*/ uuid(7);\n/** Practical email validation */\nexport const email = /^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/;\n/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */\nexport const html5Email = /^[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/** The classic emailregex.com regex for RFC 5322-compliant emails */\nexport const rfc5322Email = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n/** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */\nexport const unicodeEmail = /^[^\\s@\"]{1,64}@[^\\s@]{1,255}$/u;\nexport const browserEmail = /^[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// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nexport const _emoji = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nexport function emoji() {\n return new RegExp(_emoji, \"u\");\n}\nexport const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;\nexport const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/;\nexport const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$/;\nexport const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nexport const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;\nexport const base64url = /^[A-Za-z0-9_-]*$/;\n// based on https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address\n// export const hostname: RegExp =\n// /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)+([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$/;\nexport const hostname = /^([a-zA-Z0-9-]+\\.)*[a-zA-Z0-9-]+$/;\nexport const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$/;\n// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces)\nexport const e164 = /^\\+(?:[0-9]){6,14}[0-9]$/;\nconst dateSource = `((\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\\\d|30)|(02)-(0[1-9]|1\\\\d|2[0-8])))`;\nexport const date = /*@__PURE__*/ new RegExp(`^${dateSource}$`);\nfunction timeSource(args) {\n // let regex = `\\\\d{2}:\\\\d{2}:\\\\d{2}`;\n let regex = `([01]\\\\d|2[0-3]):[0-5]\\\\d:[0-5]\\\\d`;\n if (args.precision) {\n regex = `${regex}\\\\.\\\\d{${args.precision}}`;\n }\n else if (args.precision == null) {\n regex = `${regex}(\\\\.\\\\d+)?`;\n }\n return regex;\n}\nexport function time(args) {\n return new RegExp(`^${timeSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nexport function datetime(args) {\n let regex = `${dateSource}T${timeSource(args)}`;\n const opts = [];\n opts.push(args.local ? `Z?` : `Z`);\n if (args.offset)\n opts.push(`([+-]\\\\d{2}:?\\\\d{2})`);\n regex = `${regex}(${opts.join(\"|\")})`;\n return new RegExp(`^${regex}$`);\n}\nexport const string = (params) => {\n const regex = params ? `[\\\\s\\\\S]{${params?.minimum ?? 0},${params?.maximum ?? \"\"}}` : `[\\\\s\\\\S]*`;\n return new RegExp(`^${regex}$`);\n};\nexport const bigint = /^\\d+n?$/;\nexport const integer = /^\\d+$/;\nexport const number = /^-?\\d+(?:\\.\\d+)?/i;\nexport const boolean = /true|false/i;\nconst _null = /null/i;\nexport { _null as null };\nconst _undefined = /undefined/i;\nexport { _undefined as undefined };\n// regex for string with no uppercase letters\nexport const lowercase = /^[^A-Z]*$/;\n// regex for string with no lowercase letters\nexport const uppercase = /^[^a-z]*$/;\n","// import { $ZodType } from \"./schemas.js\";\nimport * as core from \"./core.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nexport const $ZodCheck = /*@__PURE__*/ core.$constructor(\"$ZodCheck\", (inst, def) => {\n var _a;\n inst._zod ?? (inst._zod = {});\n inst._zod.def = def;\n (_a = inst._zod).onattach ?? (_a.onattach = []);\n});\nconst numericOriginMap = {\n number: \"number\",\n bigint: \"bigint\",\n object: \"date\",\n};\nexport const $ZodCheckLessThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckLessThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;\n if (def.value < curr) {\n if (def.inclusive)\n bag.maximum = def.value;\n else\n bag.exclusiveMaximum = def.value;\n }\n });\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {\n return;\n }\n payload.issues.push({\n origin,\n code: \"too_big\",\n maximum: def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckGreaterThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckGreaterThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;\n if (def.value > curr) {\n if (def.inclusive)\n bag.minimum = def.value;\n else\n bag.exclusiveMinimum = def.value;\n }\n });\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {\n return;\n }\n payload.issues.push({\n origin: origin,\n code: \"too_small\",\n minimum: def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMultipleOf = \n/*@__PURE__*/ core.$constructor(\"$ZodCheckMultipleOf\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.onattach.push((inst) => {\n var _a;\n (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);\n });\n inst._zod.check = (payload) => {\n if (typeof payload.value !== typeof def.value)\n throw new Error(\"Cannot mix number and bigint in multiple_of check.\");\n const isMultiple = typeof payload.value === \"bigint\"\n ? payload.value % def.value === BigInt(0)\n : util.floatSafeRemainder(payload.value, def.value) === 0;\n if (isMultiple)\n return;\n payload.issues.push({\n origin: typeof payload.value,\n code: \"not_multiple_of\",\n divisor: def.value,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckNumberFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n def.format = def.format || \"float64\";\n const isInt = def.format?.includes(\"int\");\n const origin = isInt ? \"int\" : \"number\";\n const [minimum, maximum] = util.NUMBER_FORMAT_RANGES[def.format];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = def.format;\n bag.minimum = minimum;\n bag.maximum = maximum;\n if (isInt)\n bag.pattern = regexes.integer;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (isInt) {\n if (!Number.isInteger(input)) {\n // invalid_format issue\n // payload.issues.push({\n // expected: def.format,\n // format: def.format,\n // code: \"invalid_format\",\n // input,\n // inst,\n // });\n // invalid_type issue\n payload.issues.push({\n expected: origin,\n format: def.format,\n code: \"invalid_type\",\n input,\n inst,\n });\n return;\n // not_multiple_of issue\n // payload.issues.push({\n // code: \"not_multiple_of\",\n // origin: \"number\",\n // input,\n // inst,\n // divisor: 1,\n // });\n }\n if (!Number.isSafeInteger(input)) {\n if (input > 0) {\n // too_big\n payload.issues.push({\n input,\n code: \"too_big\",\n maximum: Number.MAX_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n continue: !def.abort,\n });\n }\n else {\n // too_small\n payload.issues.push({\n input,\n code: \"too_small\",\n minimum: Number.MIN_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n continue: !def.abort,\n });\n }\n return;\n }\n }\n if (input < minimum) {\n payload.issues.push({\n origin: \"number\",\n input: input,\n code: \"too_small\",\n minimum: minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"number\",\n input,\n code: \"too_big\",\n maximum,\n inst,\n });\n }\n };\n});\nexport const $ZodCheckBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckBigIntFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n const [minimum, maximum] = util.BIGINT_FORMAT_RANGES[def.format];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = def.format;\n bag.minimum = minimum;\n bag.maximum = maximum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (input < minimum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_small\",\n minimum: minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_big\",\n maximum,\n inst,\n });\n }\n };\n});\nexport const $ZodCheckMaxSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxSize\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n };\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);\n if (def.maximum < curr)\n inst._zod.bag.maximum = def.maximum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size <= def.maximum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_big\",\n maximum: def.maximum,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinSize\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n };\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);\n if (def.minimum > curr)\n inst._zod.bag.minimum = def.minimum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size >= def.minimum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_small\",\n minimum: def.minimum,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckSizeEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckSizeEquals\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n };\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.minimum = def.size;\n bag.maximum = def.size;\n bag.size = def.size;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size === def.size)\n return;\n const tooBig = size > def.size;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n ...(tooBig ? { code: \"too_big\", maximum: def.size } : { code: \"too_small\", minimum: def.size }),\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMaxLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxLength\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n };\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);\n if (def.maximum < curr)\n inst._zod.bag.maximum = def.maximum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const length = input.length;\n if (length <= def.maximum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_big\",\n maximum: def.maximum,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinLength\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n };\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);\n if (def.minimum > curr)\n inst._zod.bag.minimum = def.minimum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const length = input.length;\n if (length >= def.minimum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_small\",\n minimum: def.minimum,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLengthEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckLengthEquals\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n };\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.minimum = def.length;\n bag.maximum = def.length;\n bag.length = def.length;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const length = input.length;\n if (length === def.length)\n return;\n const origin = util.getLengthableOrigin(input);\n const tooBig = length > def.length;\n payload.issues.push({\n origin,\n ...(tooBig ? { code: \"too_big\", maximum: def.length } : { code: \"too_small\", minimum: def.length }),\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckStringFormat\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = def.format;\n if (def.pattern) {\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(def.pattern);\n }\n });\n (_a = inst._zod).check ?? (_a.check = (payload) => {\n if (!def.pattern)\n throw new Error(\"Not implemented.\");\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: def.format,\n input: payload.value,\n ...(def.pattern ? { pattern: def.pattern.toString() } : {}),\n inst,\n continue: !def.abort,\n });\n });\n});\nexport const $ZodCheckRegex = /*@__PURE__*/ core.$constructor(\"$ZodCheckRegex\", (inst, def) => {\n $ZodCheckStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"regex\",\n input: payload.value,\n pattern: def.pattern.toString(),\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLowerCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckLowerCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.lowercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckUpperCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckUpperCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.uppercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckIncludes = /*@__PURE__*/ core.$constructor(\"$ZodCheckIncludes\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const escapedRegex = util.escapeRegex(def.includes);\n const pattern = new RegExp(typeof def.position === \"number\" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);\n def.pattern = pattern;\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(pattern);\n });\n inst._zod.check = (payload) => {\n if (payload.value.includes(def.includes, def.position))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"includes\",\n includes: def.includes,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStartsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckStartsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`^${util.escapeRegex(def.prefix)}.*`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(pattern);\n });\n inst._zod.check = (payload) => {\n if (payload.value.startsWith(def.prefix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"starts_with\",\n prefix: def.prefix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckEndsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckEndsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`.*${util.escapeRegex(def.suffix)}$`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(pattern);\n });\n inst._zod.check = (payload) => {\n if (payload.value.endsWith(def.suffix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"ends_with\",\n suffix: def.suffix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n///////////////////////////////////\n///// $ZodCheckProperty /////\n///////////////////////////////////\nfunction handleCheckPropertyResult(result, payload, property) {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(property, result.issues));\n }\n}\nexport const $ZodCheckProperty = /*@__PURE__*/ core.$constructor(\"$ZodCheckProperty\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n const result = def.schema._zod.run({\n value: payload.value[def.property],\n issues: [],\n }, {});\n if (result instanceof Promise) {\n return result.then((result) => handleCheckPropertyResult(result, payload, def.property));\n }\n handleCheckPropertyResult(result, payload, def.property);\n return;\n };\n});\nexport const $ZodCheckMimeType = /*@__PURE__*/ core.$constructor(\"$ZodCheckMimeType\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const mimeSet = new Set(def.mime);\n inst._zod.onattach.push((inst) => {\n inst._zod.bag.mime = def.mime;\n });\n inst._zod.check = (payload) => {\n if (mimeSet.has(payload.value.type))\n return;\n payload.issues.push({\n code: \"invalid_value\",\n values: def.mime,\n input: payload.value.type,\n path: [\"type\"],\n inst,\n });\n };\n});\nexport const $ZodCheckOverwrite = /*@__PURE__*/ core.$constructor(\"$ZodCheckOverwrite\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n payload.value = def.tx(payload.value);\n };\n});\n","export class Doc {\n constructor(args = []) {\n this.content = [];\n this.indent = 0;\n if (this)\n this.args = args;\n }\n indented(fn) {\n this.indent += 1;\n fn(this);\n this.indent -= 1;\n }\n write(arg) {\n if (typeof arg === \"function\") {\n arg(this, { execution: \"sync\" });\n arg(this, { execution: \"async\" });\n return;\n }\n const content = arg;\n const lines = content.split(\"\\n\").filter((x) => x);\n const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));\n const dedented = lines.map((x) => x.slice(minIndent)).map((x) => \" \".repeat(this.indent * 2) + x);\n for (const line of dedented) {\n this.content.push(line);\n }\n }\n compile() {\n const F = Function;\n const args = this?.args;\n const content = this?.content ?? [``];\n const lines = [...content.map((x) => ` ${x}`)];\n // console.log(lines.join(\"\\n\"));\n return new F(...args, lines.join(\"\\n\"));\n }\n}\n","export const version = {\n major: 4,\n minor: 0,\n patch: 0,\n};\n","import * as checks from \"./checks.js\";\nimport * as core from \"./core.js\";\nimport { Doc } from \"./doc.js\";\nimport { safeParse, safeParseAsync } from \"./parse.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nimport { version } from \"./versions.js\";\nexport const $ZodType = /*@__PURE__*/ core.$constructor(\"$ZodType\", (inst, def) => {\n var _a;\n inst ?? (inst = {});\n inst._zod.id = def.type + \"_\" + util.randomString(10);\n inst._zod.def = def; // set _def property\n inst._zod.bag = inst._zod.bag || {}; // initialize _bag object\n inst._zod.version = version;\n const checks = [...(inst._zod.def.checks ?? [])];\n // if inst is itself a checks.$ZodCheck, run it as a check\n if (inst._zod.traits.has(\"$ZodCheck\")) {\n checks.unshift(inst);\n }\n //\n for (const ch of checks) {\n for (const fn of ch._zod.onattach) {\n fn(inst);\n }\n }\n if (checks.length === 0) {\n // deferred initializer\n // inst._zod.parse is not yet defined\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n inst._zod.deferred?.push(() => {\n inst._zod.run = inst._zod.parse;\n });\n }\n else {\n const runChecks = (payload, checks, ctx) => {\n let isAborted = util.aborted(payload);\n let asyncResult;\n for (const ch of checks) {\n if (ch._zod.when) {\n const shouldRun = ch._zod.when(payload);\n if (!shouldRun)\n continue;\n }\n else {\n if (isAborted) {\n continue;\n }\n }\n const currLen = payload.issues.length;\n const _ = ch._zod.check(payload);\n if (_ instanceof Promise && ctx?.async === false) {\n throw new core.$ZodAsyncError();\n }\n if (asyncResult || _ instanceof Promise) {\n asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {\n await _;\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n return;\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n });\n }\n else {\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n continue;\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n }\n }\n if (asyncResult) {\n return asyncResult.then(() => {\n return payload;\n });\n }\n return payload;\n };\n inst._zod.run = (payload, ctx) => {\n const result = inst._zod.parse(payload, ctx);\n if (result instanceof Promise) {\n if (ctx.async === false)\n throw new core.$ZodAsyncError();\n return result.then((result) => runChecks(result, checks, ctx));\n }\n return runChecks(result, checks, ctx);\n };\n }\n inst[\"~standard\"] = {\n validate: (value) => {\n try {\n const r = safeParse(inst, value);\n return r.success ? { value: r.data } : { issues: r.error?.issues };\n }\n catch (_) {\n return safeParseAsync(inst, value).then((r) => (r.success ? { value: r.data } : { issues: r.error?.issues }));\n }\n },\n vendor: \"zod\",\n version: 1,\n };\n});\nexport { clone } from \"./util.js\";\nexport const $ZodString = /*@__PURE__*/ core.$constructor(\"$ZodString\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = [...(inst?._zod.bag?.patterns ?? [])].pop() ?? regexes.string(inst._zod.bag);\n inst._zod.parse = (payload, _) => {\n if (def.coerce)\n try {\n payload.value = String(payload.value);\n }\n catch (_) { }\n if (typeof payload.value === \"string\")\n return payload;\n payload.issues.push({\n expected: \"string\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodStringFormat\", (inst, def) => {\n // check initialization must come first\n checks.$ZodCheckStringFormat.init(inst, def);\n $ZodString.init(inst, def);\n});\nexport const $ZodGUID = /*@__PURE__*/ core.$constructor(\"$ZodGUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.guid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodUUID = /*@__PURE__*/ core.$constructor(\"$ZodUUID\", (inst, def) => {\n if (def.version) {\n const versionMap = {\n v1: 1,\n v2: 2,\n v3: 3,\n v4: 4,\n v5: 5,\n v6: 6,\n v7: 7,\n v8: 8,\n };\n const v = versionMap[def.version];\n if (v === undefined)\n throw new Error(`Invalid UUID version: \"${def.version}\"`);\n def.pattern ?? (def.pattern = regexes.uuid(v));\n }\n else\n def.pattern ?? (def.pattern = regexes.uuid());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodEmail = /*@__PURE__*/ core.$constructor(\"$ZodEmail\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.email);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodURL = /*@__PURE__*/ core.$constructor(\"$ZodURL\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n try {\n const url = new URL(payload.value);\n if (def.hostname) {\n def.hostname.lastIndex = 0;\n if (!def.hostname.test(url.hostname)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid hostname\",\n pattern: regexes.hostname.source,\n input: payload.value,\n inst,\n });\n }\n }\n if (def.protocol) {\n def.protocol.lastIndex = 0;\n if (!def.protocol.test(url.protocol.endsWith(\":\") ? url.protocol.slice(0, -1) : url.protocol)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid protocol\",\n pattern: def.protocol.source,\n input: payload.value,\n inst,\n });\n }\n }\n return;\n }\n catch (_) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n input: payload.value,\n inst,\n });\n }\n };\n});\nexport const $ZodEmoji = /*@__PURE__*/ core.$constructor(\"$ZodEmoji\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.emoji());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodNanoID = /*@__PURE__*/ core.$constructor(\"$ZodNanoID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.nanoid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCUID = /*@__PURE__*/ core.$constructor(\"$ZodCUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCUID2 = /*@__PURE__*/ core.$constructor(\"$ZodCUID2\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid2);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodULID = /*@__PURE__*/ core.$constructor(\"$ZodULID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ulid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodXID = /*@__PURE__*/ core.$constructor(\"$ZodXID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.xid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodKSUID = /*@__PURE__*/ core.$constructor(\"$ZodKSUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ksuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODateTime = /*@__PURE__*/ core.$constructor(\"$ZodISODateTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.datetime(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODate = /*@__PURE__*/ core.$constructor(\"$ZodISODate\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.date);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISOTime = /*@__PURE__*/ core.$constructor(\"$ZodISOTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.time(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODuration = /*@__PURE__*/ core.$constructor(\"$ZodISODuration\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.duration);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodIPv4 = /*@__PURE__*/ core.$constructor(\"$ZodIPv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv4);\n $ZodStringFormat.init(inst, def);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = `ipv4`;\n });\n});\nexport const $ZodIPv6 = /*@__PURE__*/ core.$constructor(\"$ZodIPv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv6);\n $ZodStringFormat.init(inst, def);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = `ipv6`;\n });\n inst._zod.check = (payload) => {\n try {\n new URL(`http://[${payload.value}]`);\n // return;\n }\n catch {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"ipv6\",\n input: payload.value,\n inst,\n });\n }\n };\n});\nexport const $ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv4);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv6); // not used for validation\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n const [address, prefix] = payload.value.split(\"/\");\n try {\n if (!prefix)\n throw new Error();\n const prefixNum = Number(prefix);\n if (`${prefixNum}` !== prefix)\n throw new Error();\n if (prefixNum < 0 || prefixNum > 128)\n throw new Error();\n new URL(`http://[${address}]`);\n }\n catch {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"cidrv6\",\n input: payload.value,\n inst,\n });\n }\n };\n});\n////////////////////////////// ZodBase64 //////////////////////////////\nexport function isValidBase64(data) {\n if (data === \"\")\n return true;\n if (data.length % 4 !== 0)\n return false;\n try {\n atob(data);\n return true;\n }\n catch {\n return false;\n }\n}\nexport const $ZodBase64 = /*@__PURE__*/ core.$constructor(\"$ZodBase64\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.base64);\n $ZodStringFormat.init(inst, def);\n inst._zod.onattach.push((inst) => {\n inst._zod.bag.contentEncoding = \"base64\";\n });\n inst._zod.check = (payload) => {\n if (isValidBase64(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64\",\n input: payload.value,\n inst,\n });\n };\n});\n////////////////////////////// ZodBase64 //////////////////////////////\nexport function isValidBase64URL(data) {\n if (!regexes.base64url.test(data))\n return false;\n const base64 = data.replace(/[-_]/g, (c) => (c === \"-\" ? \"+\" : \"/\"));\n const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, \"=\");\n return isValidBase64(padded);\n}\nexport const $ZodBase64URL = /*@__PURE__*/ core.$constructor(\"$ZodBase64URL\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.base64url);\n $ZodStringFormat.init(inst, def);\n inst._zod.onattach.push((inst) => {\n inst._zod.bag.contentEncoding = \"base64url\";\n });\n inst._zod.check = (payload) => {\n if (isValidBase64URL(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64url\",\n input: payload.value,\n inst,\n });\n };\n});\nexport const $ZodE164 = /*@__PURE__*/ core.$constructor(\"$ZodE164\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.e164);\n $ZodStringFormat.init(inst, def);\n});\n////////////////////////////// ZodJWT //////////////////////////////\nexport function isValidJWT(token, algorithm = null) {\n try {\n const tokensParts = token.split(\".\");\n if (tokensParts.length !== 3)\n return false;\n const [header] = tokensParts;\n const parsedHeader = JSON.parse(atob(header));\n if (\"typ\" in parsedHeader && parsedHeader?.typ !== \"JWT\")\n return false;\n if (!parsedHeader.alg)\n return false;\n if (algorithm && (!(\"alg\" in parsedHeader) || parsedHeader.alg !== algorithm))\n return false;\n return true;\n }\n catch {\n return false;\n }\n}\nexport const $ZodJWT = /*@__PURE__*/ core.$constructor(\"$ZodJWT\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (isValidJWT(payload.value, def.alg))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"jwt\",\n input: payload.value,\n inst,\n });\n };\n});\nexport const $ZodNumber = /*@__PURE__*/ core.$constructor(\"$ZodNumber\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = inst._zod.bag.pattern ?? regexes.number;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Number(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"number\" && !Number.isNaN(input) && Number.isFinite(input)) {\n return payload;\n }\n const received = typeof input === \"number\"\n ? Number.isNaN(input)\n ? \"NaN\"\n : !Number.isFinite(input)\n ? \"Infinity\"\n : undefined\n : undefined;\n payload.issues.push({\n expected: \"number\",\n code: \"invalid_type\",\n input,\n inst,\n ...(received ? { received } : {}),\n });\n return payload;\n };\n});\nexport const $ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodNumber\", (inst, def) => {\n checks.$ZodCheckNumberFormat.init(inst, def);\n $ZodNumber.init(inst, def); // no format checksp\n});\nexport const $ZodBoolean = /*@__PURE__*/ core.$constructor(\"$ZodBoolean\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.boolean;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Boolean(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"boolean\")\n return payload;\n payload.issues.push({\n expected: \"boolean\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigInt = /*@__PURE__*/ core.$constructor(\"$ZodBigInt\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.bigint;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = BigInt(payload.value);\n }\n catch (_) { }\n const { value: input } = payload;\n if (typeof input === \"bigint\")\n return payload;\n payload.issues.push({\n expected: \"bigint\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodBigInt\", (inst, def) => {\n checks.$ZodCheckBigIntFormat.init(inst, def);\n $ZodBigInt.init(inst, def); // no format checks\n});\nexport const $ZodSymbol = /*@__PURE__*/ core.$constructor(\"$ZodSymbol\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const { value: input } = payload;\n if (typeof input === \"symbol\")\n return payload;\n payload.issues.push({\n expected: \"symbol\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodUndefined = /*@__PURE__*/ core.$constructor(\"$ZodUndefined\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.undefined;\n inst._zod.values = new Set([undefined]);\n inst._zod.parse = (payload, _ctx) => {\n const { value: input } = payload;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"undefined\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodNull = /*@__PURE__*/ core.$constructor(\"$ZodNull\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.null;\n inst._zod.values = new Set([null]);\n inst._zod.parse = (payload, _ctx) => {\n const { value: input } = payload;\n if (input === null)\n return payload;\n payload.issues.push({\n expected: \"null\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodAny = /*@__PURE__*/ core.$constructor(\"$ZodAny\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodUnknown = /*@__PURE__*/ core.$constructor(\"$ZodUnknown\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodNever = /*@__PURE__*/ core.$constructor(\"$ZodNever\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n payload.issues.push({\n expected: \"never\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodVoid = /*@__PURE__*/ core.$constructor(\"$ZodVoid\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const { value: input } = payload;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"void\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodDate = /*@__PURE__*/ core.$constructor(\"$ZodDate\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce) {\n try {\n payload.value = new Date(payload.value);\n }\n catch (_err) { }\n }\n const input = payload.value;\n const isDate = input instanceof Date;\n const isValidDate = isDate && !Number.isNaN(input.getTime());\n if (isValidDate)\n return payload;\n payload.issues.push({\n expected: \"date\",\n code: \"invalid_type\",\n input,\n ...(isDate ? { received: \"Invalid Date\" } : {}),\n inst,\n });\n return payload;\n };\n});\nfunction handleArrayResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nexport const $ZodArray = /*@__PURE__*/ core.$constructor(\"$ZodArray\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n expected: \"array\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n payload.value = Array(input.length);\n const proms = [];\n for (let i = 0; i < input.length; i++) {\n const item = input[i];\n const result = def.element._zod.run({\n value: item,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleArrayResult(result, payload, i)));\n }\n else {\n handleArrayResult(result, payload, i);\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload; //handleArrayResultsAsync(parseResults, final);\n };\n});\nfunction handleObjectResult(result, final, key) {\n // if(isOptional)\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(key, result.issues));\n }\n final.value[key] = result.value;\n}\nfunction handleOptionalObjectResult(result, final, key, input) {\n if (result.issues.length) {\n // validation failed against value schema\n if (input[key] === undefined) {\n // if input was undefined, ignore the error\n if (key in input) {\n final.value[key] = undefined;\n }\n else {\n final.value[key] = result.value;\n }\n }\n else {\n final.issues.push(...util.prefixIssues(key, result.issues));\n }\n }\n else if (result.value === undefined) {\n // validation returned `undefined`\n if (key in input)\n final.value[key] = undefined;\n }\n else {\n // non-undefined value\n final.value[key] = result.value;\n }\n}\nexport const $ZodObject = /*@__PURE__*/ core.$constructor(\"$ZodObject\", (inst, def) => {\n $ZodType.init(inst, def);\n const _normalized = util.cached(() => {\n const keys = Object.keys(def.shape);\n for (const k of keys) {\n if (!(def.shape[k] instanceof $ZodType)) {\n throw new Error(`Invalid element at key \"${k}\": expected a Zod schema`);\n }\n }\n const okeys = util.optionalKeys(def.shape);\n return {\n shape: def.shape,\n keys,\n keySet: new Set(keys),\n numKeys: keys.length,\n optionalKeys: new Set(okeys),\n };\n });\n util.defineLazy(inst._zod, \"propValues\", () => {\n const shape = def.shape;\n const propValues = {};\n for (const key in shape) {\n const field = shape[key]._zod;\n if (field.values) {\n propValues[key] ?? (propValues[key] = new Set());\n for (const v of field.values)\n propValues[key].add(v);\n }\n }\n return propValues;\n });\n const generateFastpass = (shape) => {\n const doc = new Doc([\"shape\", \"payload\", \"ctx\"]);\n const { keys, optionalKeys } = _normalized.value;\n const parseStr = (key) => {\n const k = util.esc(key);\n return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;\n };\n doc.write(`const input = payload.value;`);\n const ids = Object.create(null);\n for (const key of keys) {\n ids[key] = util.randomString(15);\n }\n // A: preserve key order {\n doc.write(`const newResult = {}`);\n for (const key of keys) {\n if (optionalKeys.has(key)) {\n const id = ids[key];\n doc.write(`const ${id} = ${parseStr(key)};`);\n const k = util.esc(key);\n doc.write(`\n if (${id}.issues.length) {\n if (input[${k}] === undefined) {\n if (${k} in input) {\n newResult[${k}] = undefined;\n }\n } else {\n payload.issues = payload.issues.concat(\n ${id}.issues.map((iss) => ({\n ...iss,\n path: iss.path ? [${k}, ...iss.path] : [${k}],\n }))\n );\n }\n } else if (${id}.value === undefined) {\n if (${k} in input) newResult[${k}] = undefined;\n } else {\n newResult[${k}] = ${id}.value;\n }\n `);\n }\n else {\n const id = ids[key];\n // const id = ids[key];\n doc.write(`const ${id} = ${parseStr(key)};`);\n doc.write(`\n if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${util.esc(key)}, ...iss.path] : [${util.esc(key)}]\n })));`);\n doc.write(`newResult[${util.esc(key)}] = ${id}.value`);\n }\n }\n doc.write(`payload.value = newResult;`);\n doc.write(`return payload;`);\n const fn = doc.compile();\n return (payload, ctx) => fn(shape, payload, ctx);\n };\n let fastpass;\n const isObject = util.isObject;\n const jit = !core.globalConfig.jitless;\n const allowsEval = util.allowsEval;\n const fastEnabled = jit && allowsEval.value; // && !def.catchall;\n const { catchall } = def;\n let value;\n inst._zod.parse = (payload, ctx) => {\n value ?? (value = _normalized.value);\n const input = payload.value;\n if (!isObject(input)) {\n payload.issues.push({\n expected: \"object\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {\n // always synchronous\n if (!fastpass)\n fastpass = generateFastpass(def.shape);\n payload = fastpass(payload, ctx);\n }\n else {\n payload.value = {};\n const shape = value.shape;\n for (const key of value.keys) {\n const el = shape[key];\n // do not add omitted optional keys\n // if (!(key in input)) {\n // if (optionalKeys.has(key)) continue;\n // payload.issues.push({\n // code: \"invalid_type\",\n // path: [key],\n // expected: \"nonoptional\",\n // note: `Missing required key: \"${key}\"`,\n // input,\n // inst,\n // });\n // }\n const r = el._zod.run({ value: input[key], issues: [] }, ctx);\n const isOptional = el._zod.optin === \"optional\" && el._zod.optout === \"optional\";\n if (r instanceof Promise) {\n proms.push(r.then((r) => isOptional ? handleOptionalObjectResult(r, payload, key, input) : handleObjectResult(r, payload, key)));\n }\n else {\n if (isOptional) {\n handleOptionalObjectResult(r, payload, key, input);\n }\n else {\n handleObjectResult(r, payload, key);\n }\n }\n }\n }\n if (!catchall) {\n // return payload;\n return proms.length ? Promise.all(proms).then(() => payload) : payload;\n }\n const unrecognized = [];\n // iterate over input keys\n const keySet = value.keySet;\n const _catchall = catchall._zod;\n const t = _catchall.def.type;\n for (const key of Object.keys(input)) {\n if (keySet.has(key))\n continue;\n if (t === \"never\") {\n unrecognized.push(key);\n continue;\n }\n const r = _catchall.run({ value: input[key], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((r) => handleObjectResult(r, payload, key)));\n }\n else {\n handleObjectResult(r, payload, key);\n }\n }\n if (unrecognized.length) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n keys: unrecognized,\n input,\n inst,\n });\n }\n if (!proms.length)\n return payload;\n return Promise.all(proms).then(() => {\n return payload;\n });\n };\n});\nfunction handleUnionResults(results, final, inst, ctx) {\n for (const result of results) {\n if (result.issues.length === 0) {\n final.value = result.value;\n return final;\n }\n }\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n });\n return final;\n}\nexport const $ZodUnion = /*@__PURE__*/ core.$constructor(\"$ZodUnion\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => {\n if (def.options.every((o) => o._zod.values)) {\n return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));\n }\n return undefined;\n });\n util.defineLazy(inst._zod, \"pattern\", () => {\n if (def.options.every((o) => o._zod.pattern)) {\n const patterns = def.options.map((o) => o._zod.pattern);\n return new RegExp(`^(${patterns.map((p) => util.cleanRegex(p.source)).join(\"|\")})$`);\n }\n return undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n let async = false;\n const results = [];\n for (const option of def.options) {\n const result = option._zod.run({\n value: payload.value,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n results.push(result);\n async = true;\n }\n else {\n if (result.issues.length === 0)\n return result;\n results.push(result);\n }\n }\n if (!async)\n return handleUnionResults(results, payload, inst, ctx);\n return Promise.all(results).then((results) => {\n return handleUnionResults(results, payload, inst, ctx);\n });\n };\n});\nexport const $ZodDiscriminatedUnion = \n/*@__PURE__*/\ncore.$constructor(\"$ZodDiscriminatedUnion\", (inst, def) => {\n $ZodUnion.init(inst, def);\n const _super = inst._zod.parse;\n util.defineLazy(inst._zod, \"propValues\", () => {\n const propValues = {};\n for (const option of def.options) {\n const pv = option._zod.propValues;\n if (!pv || Object.keys(pv).length === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(option)}\"`);\n for (const [k, v] of Object.entries(pv)) {\n if (!propValues[k])\n propValues[k] = new Set();\n for (const val of v) {\n propValues[k].add(val);\n }\n }\n }\n return propValues;\n });\n const disc = util.cached(() => {\n const opts = def.options;\n const map = new Map();\n for (const o of opts) {\n const values = o._zod.propValues[def.discriminator];\n if (!values || values.size === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(o)}\"`);\n for (const v of values) {\n if (map.has(v)) {\n throw new Error(`Duplicate discriminator value \"${String(v)}\"`);\n }\n map.set(v, o);\n }\n }\n return map;\n });\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isObject(input)) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"object\",\n input,\n inst,\n });\n return payload;\n }\n const opt = disc.value.get(input?.[def.discriminator]);\n if (opt) {\n return opt._zod.run(payload, ctx);\n }\n if (def.unionFallback) {\n return _super(payload, ctx);\n }\n // no matching discriminator\n payload.issues.push({\n code: \"invalid_union\",\n errors: [],\n note: \"No matching discriminator\",\n input,\n path: [def.discriminator],\n inst,\n });\n return payload;\n };\n});\nexport const $ZodIntersection = /*@__PURE__*/ core.$constructor(\"$ZodIntersection\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const { value: input } = payload;\n const left = def.left._zod.run({ value: input, issues: [] }, ctx);\n const right = def.right._zod.run({ value: input, issues: [] }, ctx);\n const async = left instanceof Promise || right instanceof Promise;\n if (async) {\n return Promise.all([left, right]).then(([left, right]) => {\n return handleIntersectionResults(payload, left, right);\n });\n }\n return handleIntersectionResults(payload, left, right);\n };\n});\nfunction mergeValues(a, b) {\n // const aType = parse.t(a);\n // const bType = parse.t(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n if (a instanceof Date && b instanceof Date && +a === +b) {\n return { valid: true, data: a };\n }\n if (util.isPlainObject(a) && util.isPlainObject(b)) {\n const bKeys = Object.keys(b);\n const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [key, ...sharedValue.mergeErrorPath],\n };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) {\n return { valid: false, mergeErrorPath: [] };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [index, ...sharedValue.mergeErrorPath],\n };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n return { valid: false, mergeErrorPath: [] };\n}\nfunction handleIntersectionResults(result, left, right) {\n if (left.issues.length) {\n result.issues.push(...left.issues);\n }\n if (right.issues.length) {\n result.issues.push(...right.issues);\n }\n if (util.aborted(result))\n return result;\n const merged = mergeValues(left.value, right.value);\n if (!merged.valid) {\n throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);\n }\n result.value = merged.data;\n return result;\n}\nexport const $ZodTuple = /*@__PURE__*/ core.$constructor(\"$ZodTuple\", (inst, def) => {\n $ZodType.init(inst, def);\n const items = def.items;\n const optStart = items.length - [...items].reverse().findIndex((item) => item._zod.optin !== \"optional\");\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n input,\n inst,\n expected: \"tuple\",\n code: \"invalid_type\",\n });\n return payload;\n }\n payload.value = [];\n const proms = [];\n if (!def.rest) {\n const tooBig = input.length > items.length;\n const tooSmall = input.length < optStart - 1;\n if (tooBig || tooSmall) {\n payload.issues.push({\n input,\n inst,\n origin: \"array\",\n ...(tooBig ? { code: \"too_big\", maximum: items.length } : { code: \"too_small\", minimum: items.length }),\n });\n return payload;\n }\n }\n let i = -1;\n for (const item of items) {\n i++;\n if (i >= input.length)\n if (i >= optStart)\n continue;\n const result = item._zod.run({\n value: input[i],\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleTupleResult(result, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n if (def.rest) {\n const rest = input.slice(items.length);\n for (const el of rest) {\n i++;\n const result = def.rest._zod.run({\n value: el,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleTupleResult(result, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleTupleResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nexport const $ZodRecord = /*@__PURE__*/ core.$constructor(\"$ZodRecord\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isPlainObject(input)) {\n payload.issues.push({\n expected: \"record\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n if (def.keyType._zod.values) {\n const values = def.keyType._zod.values;\n payload.value = {};\n for (const key of values) {\n if (typeof key === \"string\" || typeof key === \"number\" || typeof key === \"symbol\") {\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[key] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[key] = result.value;\n }\n }\n }\n let unrecognized;\n for (const key in input) {\n if (!values.has(key)) {\n unrecognized = unrecognized ?? [];\n unrecognized.push(key);\n }\n }\n if (unrecognized && unrecognized.length > 0) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n input,\n inst,\n keys: unrecognized,\n });\n }\n }\n else {\n payload.value = {};\n for (const key of Reflect.ownKeys(input)) {\n if (key === \"__proto__\")\n continue;\n const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n if (keyResult instanceof Promise) {\n throw new Error(\"Async schemas not supported in object keys currently\");\n }\n if (keyResult.issues.length) {\n payload.issues.push({\n origin: \"record\",\n code: \"invalid_key\",\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n input: key,\n path: [key],\n inst,\n });\n payload.value[keyResult.value] = keyResult.value;\n continue;\n }\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[keyResult.value] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[keyResult.value] = result.value;\n }\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload;\n };\n});\nexport const $ZodMap = /*@__PURE__*/ core.$constructor(\"$ZodMap\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Map)) {\n payload.issues.push({\n expected: \"map\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n payload.value = new Map();\n for (const [key, value] of input) {\n const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);\n if (keyResult instanceof Promise || valueResult instanceof Promise) {\n proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }));\n }\n else {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {\n if (keyResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, keyResult.issues));\n }\n else {\n final.issues.push({\n origin: \"map\",\n code: \"invalid_key\",\n input,\n inst,\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n if (valueResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, valueResult.issues));\n }\n else {\n final.issues.push({\n origin: \"map\",\n code: \"invalid_element\",\n input,\n inst,\n key: key,\n issues: valueResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n final.value.set(keyResult.value, valueResult.value);\n}\nexport const $ZodSet = /*@__PURE__*/ core.$constructor(\"$ZodSet\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Set)) {\n payload.issues.push({\n input,\n inst,\n expected: \"set\",\n code: \"invalid_type\",\n });\n return payload;\n }\n const proms = [];\n payload.value = new Set();\n for (const item of input) {\n const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleSetResult(result, payload)));\n }\n else\n handleSetResult(result, payload);\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleSetResult(result, final) {\n if (result.issues.length) {\n final.issues.push(...result.issues);\n }\n final.value.add(result.value);\n}\nexport const $ZodEnum = /*@__PURE__*/ core.$constructor(\"$ZodEnum\", (inst, def) => {\n $ZodType.init(inst, def);\n const values = util.getEnumValues(def.entries);\n inst._zod.values = new Set(values);\n inst._zod.pattern = new RegExp(`^(${values\n .filter((k) => util.propertyKeyTypes.has(typeof k))\n .map((o) => (typeof o === \"string\" ? util.escapeRegex(o) : o.toString()))\n .join(\"|\")})$`);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (inst._zod.values.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodLiteral = /*@__PURE__*/ core.$constructor(\"$ZodLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.values = new Set(def.values);\n inst._zod.pattern = new RegExp(`^(${def.values\n .map((o) => (typeof o === \"string\" ? util.escapeRegex(o) : o ? o.toString() : String(o)))\n .join(\"|\")})$`);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (inst._zod.values.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values: def.values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodFile = /*@__PURE__*/ core.$constructor(\"$ZodFile\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (input instanceof File)\n return payload;\n payload.issues.push({\n expected: \"file\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodTransform = /*@__PURE__*/ core.$constructor(\"$ZodTransform\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const _out = def.transform(payload.value, payload);\n if (_ctx.async) {\n const output = _out instanceof Promise ? _out : Promise.resolve(_out);\n return output.then((output) => {\n payload.value = output;\n return payload;\n });\n }\n if (_out instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n payload.value = _out;\n return payload;\n };\n});\nexport const $ZodOptional = /*@__PURE__*/ core.$constructor(\"$ZodOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n inst._zod.optout = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => {\n return def.innerType._zod.values ? new Set([...def.innerType._zod.values, undefined]) : undefined;\n });\n util.defineLazy(inst._zod, \"pattern\", () => {\n const pattern = def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n if (payload.value === undefined) {\n return payload;\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNullable = /*@__PURE__*/ core.$constructor(\"$ZodNullable\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n util.defineLazy(inst._zod, \"pattern\", () => {\n const pattern = def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;\n });\n util.defineLazy(inst._zod, \"values\", () => {\n return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n if (payload.value === null)\n return payload;\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodDefault = /*@__PURE__*/ core.$constructor(\"$ZodDefault\", (inst, def) => {\n $ZodType.init(inst, def);\n // inst._zod.qin = \"true\";\n inst._zod.optin = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n /**\n * $ZodDefault always returns the default value immediately.\n * It doesn't pass the default value into the validator (\"prefault\"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a \"prefault\" for the pipe. */\n return payload;\n }\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleDefaultResult(result, def));\n }\n return handleDefaultResult(result, def);\n };\n});\nfunction handleDefaultResult(payload, def) {\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return payload;\n}\nexport const $ZodPrefault = /*@__PURE__*/ core.$constructor(\"$ZodPrefault\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNonOptional = /*@__PURE__*/ core.$constructor(\"$ZodNonOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => {\n const v = def.innerType._zod.values;\n return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleNonOptionalResult(result, inst));\n }\n return handleNonOptionalResult(result, inst);\n };\n});\nfunction handleNonOptionalResult(payload, inst) {\n if (!payload.issues.length && payload.value === undefined) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"nonoptional\",\n input: payload.value,\n inst,\n });\n }\n return payload;\n}\nexport const $ZodSuccess = /*@__PURE__*/ core.$constructor(\"$ZodSuccess\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => {\n payload.value = result.issues.length === 0;\n return payload;\n });\n }\n payload.value = result.issues.length === 0;\n return payload;\n };\n});\nexport const $ZodCatch = /*@__PURE__*/ core.$constructor(\"$ZodCatch\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => {\n payload.value = result.value;\n if (result.issues.length) {\n payload.value = def.catchValue({\n ...payload,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n payload.issues = [];\n }\n return payload;\n });\n }\n payload.value = result.value;\n if (result.issues.length) {\n payload.value = def.catchValue({\n ...payload,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n payload.issues = [];\n }\n return payload;\n };\n});\nexport const $ZodNaN = /*@__PURE__*/ core.$constructor(\"$ZodNaN\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"number\" || !Number.isNaN(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"nan\",\n code: \"invalid_type\",\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodPipe = /*@__PURE__*/ core.$constructor(\"$ZodPipe\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => def.in._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.in._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.out._zod.optout);\n inst._zod.parse = (payload, ctx) => {\n const left = def.in._zod.run(payload, ctx);\n if (left instanceof Promise) {\n return left.then((left) => handlePipeResult(left, def, ctx));\n }\n return handlePipeResult(left, def, ctx);\n };\n});\nfunction handlePipeResult(left, def, ctx) {\n if (util.aborted(left)) {\n return left;\n }\n return def.out._zod.run({ value: left.value, issues: left.issues }, ctx);\n}\nexport const $ZodReadonly = /*@__PURE__*/ core.$constructor(\"$ZodReadonly\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"propValues\", () => def.innerType._zod.propValues);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n inst._zod.parse = (payload, ctx) => {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then(handleReadonlyResult);\n }\n return handleReadonlyResult(result);\n };\n});\nfunction handleReadonlyResult(payload) {\n payload.value = Object.freeze(payload.value);\n return payload;\n}\nexport const $ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"$ZodTemplateLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n const regexParts = [];\n for (const part of def.parts) {\n if (part instanceof $ZodType) {\n if (!part._zod.pattern) {\n // if (!source)\n throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);\n }\n const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;\n if (!source)\n throw new Error(`Invalid template literal part: ${part._zod.traits}`);\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n regexParts.push(source.slice(start, end));\n }\n else if (part === null || util.primitiveTypes.has(typeof part)) {\n regexParts.push(util.escapeRegex(`${part}`));\n }\n else {\n throw new Error(`Invalid template literal part: ${part}`);\n }\n }\n inst._zod.pattern = new RegExp(`^${regexParts.join(\"\")}$`);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"string\") {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"template_literal\",\n code: \"invalid_type\",\n });\n return payload;\n }\n inst._zod.pattern.lastIndex = 0;\n if (!inst._zod.pattern.test(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n code: \"invalid_format\",\n format: \"template_literal\",\n pattern: inst._zod.pattern.source,\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodPromise = /*@__PURE__*/ core.$constructor(\"$ZodPromise\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx));\n };\n});\nexport const $ZodLazy = /*@__PURE__*/ core.$constructor(\"$ZodLazy\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"innerType\", () => def.getter());\n util.defineLazy(inst._zod, \"pattern\", () => inst._zod.innerType._zod.pattern);\n util.defineLazy(inst._zod, \"propValues\", () => inst._zod.innerType._zod.propValues);\n util.defineLazy(inst._zod, \"optin\", () => inst._zod.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => inst._zod.innerType._zod.optout);\n inst._zod.parse = (payload, ctx) => {\n const inner = inst._zod.innerType;\n return inner._zod.run(payload, ctx);\n };\n});\nexport const $ZodCustom = /*@__PURE__*/ core.$constructor(\"$ZodCustom\", (inst, def) => {\n checks.$ZodCheck.init(inst, def);\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _) => {\n return payload;\n };\n inst._zod.check = (payload) => {\n const input = payload.value;\n const r = def.fn(input);\n if (r instanceof Promise) {\n return r.then((r) => handleRefineResult(r, payload, input, inst));\n }\n handleRefineResult(r, payload, input, inst);\n return;\n };\n});\nfunction handleRefineResult(result, payload, input, inst) {\n if (!result) {\n const _iss = {\n code: \"custom\",\n input,\n inst, // incorporates params.error into issue reporting\n path: [...(inst._zod.def.path ?? [])], // incorporates params.error into issue reporting\n continue: !inst._zod.def.abort,\n // params: inst._zod.def.params,\n };\n if (inst._zod.def.params)\n _iss.params = inst._zod.def.params;\n payload.issues.push(util.issue(_iss));\n }\n}\n","export const $output = Symbol(\"ZodOutput\");\nexport const $input = Symbol(\"ZodInput\");\nexport class $ZodRegistry {\n constructor() {\n this._map = new WeakMap();\n this._idmap = new Map();\n }\n add(schema, ..._meta) {\n const meta = _meta[0];\n this._map.set(schema, meta);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n if (this._idmap.has(meta.id)) {\n throw new Error(`ID ${meta.id} already exists in the registry`);\n }\n this._idmap.set(meta.id, schema);\n }\n return this;\n }\n remove(schema) {\n this._map.delete(schema);\n return this;\n }\n get(schema) {\n // return this._map.get(schema) as any;\n // inherit metadata\n const p = schema._zod.parent;\n if (p) {\n const pm = { ...(this.get(p) ?? {}) };\n delete pm.id; // do not inherit id\n return { ...pm, ...this._map.get(schema) };\n }\n return this._map.get(schema);\n }\n has(schema) {\n return this._map.has(schema);\n }\n}\n// registries\nexport function registry() {\n return new $ZodRegistry();\n}\nexport const globalRegistry = /*@__PURE__*/ registry();\n","import * as checks from \"./checks.js\";\nimport * as schemas from \"./schemas.js\";\nimport * as util from \"./util.js\";\nexport function _string(Class, params) {\n return new Class({\n type: \"string\",\n ...util.normalizeParams(params),\n });\n}\nexport function _coercedString(Class, params) {\n return new Class({\n type: \"string\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\nexport function _email(Class, params) {\n return new Class({\n type: \"string\",\n format: \"email\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _guid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"guid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _uuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _uuidv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v4\",\n ...util.normalizeParams(params),\n });\n}\nexport function _uuidv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v6\",\n ...util.normalizeParams(params),\n });\n}\nexport function _uuidv7(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v7\",\n ...util.normalizeParams(params),\n });\n}\nexport function _url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _emoji(Class, params) {\n return new Class({\n type: \"string\",\n format: \"emoji\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _nanoid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"nanoid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _cuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _cuid2(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid2\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _ulid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ulid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _xid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"xid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _ksuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ksuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _ipv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _ipv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _cidrv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _cidrv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _base64(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _base64url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _e164(Class, params) {\n return new Class({\n type: \"string\",\n format: \"e164\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _jwt(Class, params) {\n return new Class({\n type: \"string\",\n format: \"jwt\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _isoDateTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"datetime\",\n check: \"string_format\",\n offset: false,\n local: false,\n precision: null,\n ...util.normalizeParams(params),\n });\n}\nexport function _isoDate(Class, params) {\n return new Class({\n type: \"string\",\n format: \"date\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\nexport function _isoTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"time\",\n check: \"string_format\",\n precision: null,\n ...util.normalizeParams(params),\n });\n}\nexport function _isoDuration(Class, params) {\n return new Class({\n type: \"string\",\n format: \"duration\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\nexport function _number(Class, params) {\n return new Class({\n type: \"number\",\n checks: [],\n ...util.normalizeParams(params),\n });\n}\nexport function _coercedNumber(Class, params) {\n return new Class({\n type: \"number\",\n coerce: true,\n checks: [],\n ...util.normalizeParams(params),\n });\n}\nexport function _int(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"safeint\",\n ...util.normalizeParams(params),\n });\n}\nexport function _float32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float32\",\n ...util.normalizeParams(params),\n });\n}\nexport function _float64(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float64\",\n ...util.normalizeParams(params),\n });\n}\nexport function _int32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"int32\",\n ...util.normalizeParams(params),\n });\n}\nexport function _uint32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"uint32\",\n ...util.normalizeParams(params),\n });\n}\nexport function _boolean(Class, params) {\n return new Class({\n type: \"boolean\",\n ...util.normalizeParams(params),\n });\n}\nexport function _coercedBoolean(Class, params) {\n return new Class({\n type: \"boolean\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\nexport function _bigint(Class, params) {\n return new Class({\n type: \"bigint\",\n ...util.normalizeParams(params),\n });\n}\nexport function _coercedBigint(Class, params) {\n return new Class({\n type: \"bigint\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\nexport function _int64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"int64\",\n ...util.normalizeParams(params),\n });\n}\nexport function _uint64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"uint64\",\n ...util.normalizeParams(params),\n });\n}\nexport function _symbol(Class, params) {\n return new Class({\n type: \"symbol\",\n ...util.normalizeParams(params),\n });\n}\nexport function _undefined(Class, params) {\n return new Class({\n type: \"undefined\",\n ...util.normalizeParams(params),\n });\n}\nexport function _null(Class, params) {\n return new Class({\n type: \"null\",\n ...util.normalizeParams(params),\n });\n}\nexport function _any(Class) {\n return new Class({\n type: \"any\",\n });\n}\nexport function _unknown(Class) {\n return new Class({\n type: \"unknown\",\n });\n}\nexport function _never(Class, params) {\n return new Class({\n type: \"never\",\n ...util.normalizeParams(params),\n });\n}\nexport function _void(Class, params) {\n return new Class({\n type: \"void\",\n ...util.normalizeParams(params),\n });\n}\nexport function _date(Class, params) {\n return new Class({\n type: \"date\",\n ...util.normalizeParams(params),\n });\n}\nexport function _coercedDate(Class, params) {\n return new Class({\n type: \"date\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\nexport function _nan(Class, params) {\n return new Class({\n type: \"nan\",\n ...util.normalizeParams(params),\n });\n}\nexport function _lt(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\nexport function _lte(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.lte()` instead. */\n_lte as _max, };\nexport function _gt(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\nexport function _gte(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.gte()` instead. */\n_gte as _min, };\nexport function _positive(params) {\n return _gt(0, params);\n}\n// negative\nexport function _negative(params) {\n return _lt(0, params);\n}\n// nonpositive\nexport function _nonpositive(params) {\n return _lte(0, params);\n}\n// nonnegative\nexport function _nonnegative(params) {\n return _gte(0, params);\n}\nexport function _multipleOf(value, params) {\n return new checks.$ZodCheckMultipleOf({\n check: \"multiple_of\",\n ...util.normalizeParams(params),\n value,\n });\n}\nexport function _maxSize(maximum, params) {\n return new checks.$ZodCheckMaxSize({\n check: \"max_size\",\n ...util.normalizeParams(params),\n maximum,\n });\n}\nexport function _minSize(minimum, params) {\n return new checks.$ZodCheckMinSize({\n check: \"min_size\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\nexport function _size(size, params) {\n return new checks.$ZodCheckSizeEquals({\n check: \"size_equals\",\n ...util.normalizeParams(params),\n size,\n });\n}\nexport function _maxLength(maximum, params) {\n const ch = new checks.$ZodCheckMaxLength({\n check: \"max_length\",\n ...util.normalizeParams(params),\n maximum,\n });\n return ch;\n}\nexport function _minLength(minimum, params) {\n return new checks.$ZodCheckMinLength({\n check: \"min_length\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\nexport function _length(length, params) {\n return new checks.$ZodCheckLengthEquals({\n check: \"length_equals\",\n ...util.normalizeParams(params),\n length,\n });\n}\nexport function _regex(pattern, params) {\n return new checks.$ZodCheckRegex({\n check: \"string_format\",\n format: \"regex\",\n ...util.normalizeParams(params),\n pattern,\n });\n}\nexport function _lowercase(params) {\n return new checks.$ZodCheckLowerCase({\n check: \"string_format\",\n format: \"lowercase\",\n ...util.normalizeParams(params),\n });\n}\nexport function _uppercase(params) {\n return new checks.$ZodCheckUpperCase({\n check: \"string_format\",\n format: \"uppercase\",\n ...util.normalizeParams(params),\n });\n}\nexport function _includes(includes, params) {\n return new checks.$ZodCheckIncludes({\n check: \"string_format\",\n format: \"includes\",\n ...util.normalizeParams(params),\n includes,\n });\n}\nexport function _startsWith(prefix, params) {\n return new checks.$ZodCheckStartsWith({\n check: \"string_format\",\n format: \"starts_with\",\n ...util.normalizeParams(params),\n prefix,\n });\n}\nexport function _endsWith(suffix, params) {\n return new checks.$ZodCheckEndsWith({\n check: \"string_format\",\n format: \"ends_with\",\n ...util.normalizeParams(params),\n suffix,\n });\n}\nexport function _property(property, schema, params) {\n return new checks.$ZodCheckProperty({\n check: \"property\",\n property,\n schema,\n ...util.normalizeParams(params),\n });\n}\nexport function _mime(types, params) {\n return new checks.$ZodCheckMimeType({\n check: \"mime_type\",\n mime: types,\n ...util.normalizeParams(params),\n });\n}\nexport function _overwrite(tx) {\n return new checks.$ZodCheckOverwrite({\n check: \"overwrite\",\n tx,\n });\n}\n// normalize\nexport function _normalize(form) {\n return _overwrite((input) => input.normalize(form));\n}\n// trim\nexport function _trim() {\n return _overwrite((input) => input.trim());\n}\n// toLowerCase\nexport function _toLowerCase() {\n return _overwrite((input) => input.toLowerCase());\n}\n// toUpperCase\nexport function _toUpperCase() {\n return _overwrite((input) => input.toUpperCase());\n}\nexport function _array(Class, element, params) {\n return new Class({\n type: \"array\",\n element,\n // get element() {\n // return element;\n // },\n ...util.normalizeParams(params),\n });\n}\nexport function _union(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n ...util.normalizeParams(params),\n });\n}\nexport function _discriminatedUnion(Class, discriminator, options, params) {\n return new Class({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\nexport function _intersection(Class, left, right) {\n return new Class({\n type: \"intersection\",\n left,\n right,\n });\n}\n// export function _tuple(\n// Class: util.SchemaClass<schemas.$ZodTuple>,\n// items: [],\n// params?: string | $ZodTupleParams\n// ): schemas.$ZodTuple<[], null>;\nexport function _tuple(Class, items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof schemas.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new Class({\n type: \"tuple\",\n items,\n rest,\n ...util.normalizeParams(params),\n });\n}\nexport function _record(Class, keyType, valueType, params) {\n return new Class({\n type: \"record\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\nexport function _map(Class, keyType, valueType, params) {\n return new Class({\n type: \"map\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\nexport function _set(Class, valueType, params) {\n return new Class({\n type: \"set\",\n valueType,\n ...util.normalizeParams(params),\n });\n}\nexport function _enum(Class, values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n // if (Array.isArray(values)) {\n // for (const value of values) {\n // entries[value] = value;\n // }\n // } else {\n // Object.assign(entries, values);\n // }\n // const entries: util.EnumLike = {};\n // for (const val of values) {\n // entries[val] = val;\n // }\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function _nativeEnum(Class, entries, params) {\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport function _literal(Class, value, params) {\n return new Class({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\nexport function _file(Class, params) {\n return new Class({\n type: \"file\",\n ...util.normalizeParams(params),\n });\n}\nexport function _transform(Class, fn) {\n return new Class({\n type: \"transform\",\n transform: fn,\n });\n}\nexport function _optional(Class, innerType) {\n return new Class({\n type: \"optional\",\n innerType,\n });\n}\nexport function _nullable(Class, innerType) {\n return new Class({\n type: \"nullable\",\n innerType,\n });\n}\nexport function _default(Class, innerType, defaultValue) {\n return new Class({\n type: \"default\",\n innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : defaultValue;\n },\n });\n}\nexport function _nonoptional(Class, innerType, params) {\n return new Class({\n type: \"nonoptional\",\n innerType,\n ...util.normalizeParams(params),\n });\n}\nexport function _success(Class, innerType) {\n return new Class({\n type: \"success\",\n innerType,\n });\n}\nexport function _catch(Class, innerType, catchValue) {\n return new Class({\n type: \"catch\",\n innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\nexport function _pipe(Class, in_, out) {\n return new Class({\n type: \"pipe\",\n in: in_,\n out,\n });\n}\nexport function _readonly(Class, innerType) {\n return new Class({\n type: \"readonly\",\n innerType,\n });\n}\nexport function _templateLiteral(Class, parts, params) {\n return new Class({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\nexport function _lazy(Class, getter) {\n return new Class({\n type: \"lazy\",\n getter,\n });\n}\nexport function _promise(Class, innerType) {\n return new Class({\n type: \"promise\",\n innerType,\n });\n}\nexport function _custom(Class, fn, _params) {\n const norm = util.normalizeParams(_params);\n norm.abort ?? (norm.abort = true); // default to abort:false\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...norm,\n });\n return schema;\n}\n// export function _refine<T>(\n// Class: util.SchemaClass<schemas.$ZodCustom>,\n// fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>,\n// _params: string | $ZodCustomParams = {}\n// ): checks.$ZodCheck<T> {\n// return _custom(Class, fn, _params);\n// }\n// same as _custom but deafults to abort:false\nexport function _refine(Class, fn, _params) {\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...util.normalizeParams(_params),\n });\n return schema;\n}\nexport function _stringbool(Classes, _params) {\n const { case: _case, error, truthy, falsy } = util.normalizeParams(_params);\n const trueValues = new Set(truthy ?? [\"true\", \"1\", \"yes\", \"on\", \"y\", \"enabled\"]);\n const falseValues = new Set(falsy ?? [\"false\", \"0\", \"no\", \"off\", \"n\", \"disabled\"]);\n const _Pipe = Classes.Pipe ?? schemas.$ZodPipe;\n const _Boolean = Classes.Boolean ?? schemas.$ZodBoolean;\n const _Unknown = Classes.Unknown ?? schemas.$ZodUnknown;\n const inst = new _Unknown({\n type: \"unknown\",\n checks: [\n {\n _zod: {\n check: (ctx) => {\n if (typeof ctx.value === \"string\") {\n let data = ctx.value;\n if (_case !== \"sensitive\")\n data = data.toLowerCase();\n if (trueValues.has(data)) {\n ctx.value = true;\n }\n else if (falseValues.has(data)) {\n ctx.value = false;\n }\n else {\n ctx.issues.push({\n code: \"invalid_value\",\n expected: \"stringbool\",\n values: [...trueValues, ...falseValues],\n input: ctx.value,\n inst,\n });\n }\n }\n else {\n ctx.issues.push({\n code: \"invalid_type\",\n expected: \"string\",\n input: ctx.value,\n });\n }\n },\n def: {\n check: \"custom\",\n },\n onattach: [],\n },\n },\n ],\n error,\n });\n return new _Pipe({\n type: \"pipe\",\n in: inst,\n out: new _Boolean({\n type: \"boolean\",\n error,\n }),\n error,\n });\n}\n","import * as core from \"zod/v4/core\";\nimport * as schemas from \"./schemas.js\";\nexport const ZodISODateTime = /*@__PURE__*/ core.$constructor(\"ZodISODateTime\", (inst, def) => {\n core.$ZodISODateTime.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function datetime(params) {\n return core._isoDateTime(ZodISODateTime, params);\n}\nexport const ZodISODate = /*@__PURE__*/ core.$constructor(\"ZodISODate\", (inst, def) => {\n core.$ZodISODate.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function date(params) {\n return core._isoDate(ZodISODate, params);\n}\nexport const ZodISOTime = /*@__PURE__*/ core.$constructor(\"ZodISOTime\", (inst, def) => {\n core.$ZodISOTime.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function time(params) {\n return core._isoTime(ZodISOTime, params);\n}\nexport const ZodISODuration = /*@__PURE__*/ core.$constructor(\"ZodISODuration\", (inst, def) => {\n core.$ZodISODuration.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function duration(params) {\n return core._isoDuration(ZodISODuration, params);\n}\n","import * as core from \"zod/v4/core\";\nimport { $ZodError } from \"zod/v4/core\";\nconst initializer = (inst, issues) => {\n $ZodError.init(inst, issues);\n inst.name = \"ZodError\";\n Object.defineProperties(inst, {\n format: {\n value: (mapper) => core.formatError(inst, mapper),\n // enumerable: false,\n },\n flatten: {\n value: (mapper) => core.flattenError(inst, mapper),\n // enumerable: false,\n },\n addIssue: {\n value: (issue) => inst.issues.push(issue),\n // enumerable: false,\n },\n addIssues: {\n value: (issues) => inst.issues.push(...issues),\n // enumerable: false,\n },\n isEmpty: {\n get() {\n return inst.issues.length === 0;\n },\n // enumerable: false,\n },\n });\n // Object.defineProperty(inst, \"isEmpty\", {\n // get() {\n // return inst.issues.length === 0;\n // },\n // });\n};\nexport const ZodError = core.$constructor(\"ZodError\", initializer);\nexport const ZodRealError = core.$constructor(\"ZodError\", initializer, {\n Parent: Error,\n});\n// /** @deprecated Use `z.core.$ZodErrorMapCtx` instead. */\n// export type ErrorMapCtx = core.$ZodErrorMapCtx;\n","import * as core from \"zod/v4/core\";\nimport { ZodRealError } from \"./errors.js\";\nexport const parse = /* @__PURE__ */ core._parse(ZodRealError);\nexport const parseAsync = /* @__PURE__ */ core._parseAsync(ZodRealError);\nexport const safeParse = /* @__PURE__ */ core._safeParse(ZodRealError);\nexport const safeParseAsync = /* @__PURE__ */ core._safeParseAsync(ZodRealError);\n","import * as core from \"zod/v4/core\";\nimport { util } from \"zod/v4/core\";\nimport * as checks from \"./checks.js\";\nimport * as iso from \"./iso.js\";\nimport * as parse from \"./parse.js\";\nexport const ZodType = /*@__PURE__*/ core.$constructor(\"ZodType\", (inst, def) => {\n core.$ZodType.init(inst, def);\n inst.def = def;\n Object.defineProperty(inst, \"_def\", { value: def });\n // base methods\n inst.check = (...checks) => {\n return inst.clone({\n ...def,\n checks: [\n ...(def.checks ?? []),\n ...checks.map((ch) => typeof ch === \"function\" ? { _zod: { check: ch, def: { check: \"custom\" }, onattach: [] } } : ch),\n ],\n }\n // { parent: true }\n );\n };\n inst.clone = (def, params) => core.clone(inst, def, params);\n inst.brand = () => inst;\n inst.register = ((reg, meta) => {\n reg.add(inst, meta);\n return inst;\n });\n // parsing\n inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });\n inst.safeParse = (data, params) => parse.safeParse(inst, data, params);\n inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });\n inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);\n inst.spa = inst.safeParseAsync;\n // refinements\n inst.refine = (check, params) => inst.check(refine(check, params));\n inst.superRefine = (refinement) => inst.check(superRefine(refinement));\n inst.overwrite = (fn) => inst.check(checks.overwrite(fn));\n // wrappers\n inst.optional = () => optional(inst);\n inst.nullable = () => nullable(inst);\n inst.nullish = () => optional(nullable(inst));\n inst.nonoptional = (params) => nonoptional(inst, params);\n inst.array = () => array(inst);\n inst.or = (arg) => union([inst, arg]);\n inst.and = (arg) => intersection(inst, arg);\n inst.transform = (tx) => pipe(inst, transform(tx));\n inst.default = (def) => _default(inst, def);\n inst.prefault = (def) => prefault(inst, def);\n // inst.coalesce = (def, params) => coalesce(inst, def, params);\n inst.catch = (params) => _catch(inst, params);\n inst.pipe = (target) => pipe(inst, target);\n inst.readonly = () => readonly(inst);\n // meta\n inst.describe = (description) => {\n const cl = inst.clone();\n core.globalRegistry.add(cl, { description });\n return cl;\n };\n Object.defineProperty(inst, \"description\", {\n get() {\n return core.globalRegistry.get(inst)?.description;\n },\n configurable: true,\n });\n inst.meta = (...args) => {\n if (args.length === 0) {\n return core.globalRegistry.get(inst);\n }\n const cl = inst.clone();\n core.globalRegistry.add(cl, args[0]);\n return cl;\n };\n // helpers\n inst.isOptional = () => inst.safeParse(undefined).success;\n inst.isNullable = () => inst.safeParse(null).success;\n return inst;\n});\n/** @internal */\nexport const _ZodString = /*@__PURE__*/ core.$constructor(\"_ZodString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n ZodType.init(inst, def);\n const bag = inst._zod.bag;\n inst.format = bag.format ?? null;\n inst.minLength = bag.minimum ?? null;\n inst.maxLength = bag.maximum ?? null;\n // validations\n inst.regex = (...args) => inst.check(checks.regex(...args));\n inst.includes = (...args) => inst.check(checks.includes(...args));\n inst.startsWith = (...args) => inst.check(checks.startsWith(...args));\n inst.endsWith = (...args) => inst.check(checks.endsWith(...args));\n inst.min = (...args) => inst.check(checks.minLength(...args));\n inst.max = (...args) => inst.check(checks.maxLength(...args));\n inst.length = (...args) => inst.check(checks.length(...args));\n inst.nonempty = (...args) => inst.check(checks.minLength(1, ...args));\n inst.lowercase = (params) => inst.check(checks.lowercase(params));\n inst.uppercase = (params) => inst.check(checks.uppercase(params));\n // transforms\n inst.trim = () => inst.check(checks.trim());\n inst.normalize = (...args) => inst.check(checks.normalize(...args));\n inst.toLowerCase = () => inst.check(checks.toLowerCase());\n inst.toUpperCase = () => inst.check(checks.toUpperCase());\n});\nexport const ZodString = /*@__PURE__*/ core.$constructor(\"ZodString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n _ZodString.init(inst, def);\n inst.email = (params) => inst.check(core._email(ZodEmail, params));\n inst.url = (params) => inst.check(core._url(ZodURL, params));\n inst.jwt = (params) => inst.check(core._jwt(ZodJWT, params));\n inst.emoji = (params) => inst.check(core._emoji(ZodEmoji, params));\n inst.guid = (params) => inst.check(core._guid(ZodGUID, params));\n inst.uuid = (params) => inst.check(core._uuid(ZodUUID, params));\n inst.uuidv4 = (params) => inst.check(core._uuidv4(ZodUUID, params));\n inst.uuidv6 = (params) => inst.check(core._uuidv6(ZodUUID, params));\n inst.uuidv7 = (params) => inst.check(core._uuidv7(ZodUUID, params));\n inst.nanoid = (params) => inst.check(core._nanoid(ZodNanoID, params));\n inst.guid = (params) => inst.check(core._guid(ZodGUID, params));\n inst.cuid = (params) => inst.check(core._cuid(ZodCUID, params));\n inst.cuid2 = (params) => inst.check(core._cuid2(ZodCUID2, params));\n inst.ulid = (params) => inst.check(core._ulid(ZodULID, params));\n inst.base64 = (params) => inst.check(core._base64(ZodBase64, params));\n inst.base64url = (params) => inst.check(core._base64url(ZodBase64URL, params));\n inst.xid = (params) => inst.check(core._xid(ZodXID, params));\n inst.ksuid = (params) => inst.check(core._ksuid(ZodKSUID, params));\n inst.ipv4 = (params) => inst.check(core._ipv4(ZodIPv4, params));\n inst.ipv6 = (params) => inst.check(core._ipv6(ZodIPv6, params));\n inst.cidrv4 = (params) => inst.check(core._cidrv4(ZodCIDRv4, params));\n inst.cidrv6 = (params) => inst.check(core._cidrv6(ZodCIDRv6, params));\n inst.e164 = (params) => inst.check(core._e164(ZodE164, params));\n // iso\n inst.datetime = (params) => inst.check(iso.datetime(params));\n inst.date = (params) => inst.check(iso.date(params));\n inst.time = (params) => inst.check(iso.time(params));\n inst.duration = (params) => inst.check(iso.duration(params));\n});\nexport function string(params) {\n return core._string(ZodString, params);\n}\nexport const ZodStringFormat = /*@__PURE__*/ core.$constructor(\"ZodStringFormat\", (inst, def) => {\n core.$ZodStringFormat.init(inst, def);\n _ZodString.init(inst, def);\n});\nexport const ZodEmail = /*@__PURE__*/ core.$constructor(\"ZodEmail\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodEmail.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function email(params) {\n return core._email(ZodEmail, params);\n}\nexport const ZodGUID = /*@__PURE__*/ core.$constructor(\"ZodGUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodGUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function guid(params) {\n return core._guid(ZodGUID, params);\n}\nexport const ZodUUID = /*@__PURE__*/ core.$constructor(\"ZodUUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodUUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function uuid(params) {\n return core._uuid(ZodUUID, params);\n}\nexport function uuidv4(params) {\n return core._uuidv4(ZodUUID, params);\n}\n// ZodUUIDv6\nexport function uuidv6(params) {\n return core._uuidv6(ZodUUID, params);\n}\n// ZodUUIDv7\nexport function uuidv7(params) {\n return core._uuidv7(ZodUUID, params);\n}\nexport const ZodURL = /*@__PURE__*/ core.$constructor(\"ZodURL\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodURL.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function url(params) {\n return core._url(ZodURL, params);\n}\nexport const ZodEmoji = /*@__PURE__*/ core.$constructor(\"ZodEmoji\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodEmoji.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function emoji(params) {\n return core._emoji(ZodEmoji, params);\n}\nexport const ZodNanoID = /*@__PURE__*/ core.$constructor(\"ZodNanoID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodNanoID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function nanoid(params) {\n return core._nanoid(ZodNanoID, params);\n}\nexport const ZodCUID = /*@__PURE__*/ core.$constructor(\"ZodCUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cuid(params) {\n return core._cuid(ZodCUID, params);\n}\nexport const ZodCUID2 = /*@__PURE__*/ core.$constructor(\"ZodCUID2\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCUID2.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cuid2(params) {\n return core._cuid2(ZodCUID2, params);\n}\nexport const ZodULID = /*@__PURE__*/ core.$constructor(\"ZodULID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodULID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ulid(params) {\n return core._ulid(ZodULID, params);\n}\nexport const ZodXID = /*@__PURE__*/ core.$constructor(\"ZodXID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodXID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function xid(params) {\n return core._xid(ZodXID, params);\n}\nexport const ZodKSUID = /*@__PURE__*/ core.$constructor(\"ZodKSUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodKSUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ksuid(params) {\n return core._ksuid(ZodKSUID, params);\n}\nexport const ZodIPv4 = /*@__PURE__*/ core.$constructor(\"ZodIPv4\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodIPv4.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ipv4(params) {\n return core._ipv4(ZodIPv4, params);\n}\nexport const ZodIPv6 = /*@__PURE__*/ core.$constructor(\"ZodIPv6\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodIPv6.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ipv6(params) {\n return core._ipv6(ZodIPv6, params);\n}\nexport const ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"ZodCIDRv4\", (inst, def) => {\n core.$ZodCIDRv4.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cidrv4(params) {\n return core._cidrv4(ZodCIDRv4, params);\n}\nexport const ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"ZodCIDRv6\", (inst, def) => {\n core.$ZodCIDRv6.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cidrv6(params) {\n return core._cidrv6(ZodCIDRv6, params);\n}\nexport const ZodBase64 = /*@__PURE__*/ core.$constructor(\"ZodBase64\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodBase64.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function base64(params) {\n return core._base64(ZodBase64, params);\n}\nexport const ZodBase64URL = /*@__PURE__*/ core.$constructor(\"ZodBase64URL\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodBase64URL.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function base64url(params) {\n return core._base64url(ZodBase64URL, params);\n}\nexport const ZodE164 = /*@__PURE__*/ core.$constructor(\"ZodE164\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodE164.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function e164(params) {\n return core._e164(ZodE164, params);\n}\nexport const ZodJWT = /*@__PURE__*/ core.$constructor(\"ZodJWT\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodJWT.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function jwt(params) {\n return core._jwt(ZodJWT, params);\n}\nexport const ZodNumber = /*@__PURE__*/ core.$constructor(\"ZodNumber\", (inst, def) => {\n core.$ZodNumber.init(inst, def);\n ZodType.init(inst, def);\n inst.gt = (value, params) => inst.check(checks.gt(value, params));\n inst.gte = (value, params) => inst.check(checks.gte(value, params));\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.lt = (value, params) => inst.check(checks.lt(value, params));\n inst.lte = (value, params) => inst.check(checks.lte(value, params));\n inst.max = (value, params) => inst.check(checks.lte(value, params));\n inst.int = (params) => inst.check(int(params));\n inst.safe = (params) => inst.check(int(params));\n inst.positive = (params) => inst.check(checks.gt(0, params));\n inst.nonnegative = (params) => inst.check(checks.gte(0, params));\n inst.negative = (params) => inst.check(checks.lt(0, params));\n inst.nonpositive = (params) => inst.check(checks.lte(0, params));\n inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));\n inst.step = (value, params) => inst.check(checks.multipleOf(value, params));\n // inst.finite = (params) => inst.check(core.finite(params));\n inst.finite = () => inst;\n const bag = inst._zod.bag;\n inst.minValue =\n Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;\n inst.maxValue =\n Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;\n inst.isInt = (bag.format ?? \"\").includes(\"int\") || Number.isSafeInteger(bag.multipleOf ?? 0.5);\n inst.isFinite = true;\n inst.format = bag.format ?? null;\n});\nexport function number(params) {\n return core._number(ZodNumber, params);\n}\nexport const ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"ZodNumberFormat\", (inst, def) => {\n core.$ZodNumberFormat.init(inst, def);\n ZodNumber.init(inst, def);\n});\nexport function int(params) {\n return core._int(ZodNumberFormat, params);\n}\nexport function float32(params) {\n return core._float32(ZodNumberFormat, params);\n}\nexport function float64(params) {\n return core._float64(ZodNumberFormat, params);\n}\nexport function int32(params) {\n return core._int32(ZodNumberFormat, params);\n}\nexport function uint32(params) {\n return core._uint32(ZodNumberFormat, params);\n}\nexport const ZodBoolean = /*@__PURE__*/ core.$constructor(\"ZodBoolean\", (inst, def) => {\n core.$ZodBoolean.init(inst, def);\n ZodType.init(inst, def);\n});\nexport function boolean(params) {\n return core._boolean(ZodBoolean, params);\n}\nexport const ZodBigInt = /*@__PURE__*/ core.$constructor(\"ZodBigInt\", (inst, def) => {\n core.$ZodBigInt.init(inst, def);\n ZodType.init(inst, def);\n inst.gte = (value, params) => inst.check(checks.gte(value, params));\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.gt = (value, params) => inst.check(checks.gt(value, params));\n inst.gte = (value, params) => inst.check(checks.gte(value, params));\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.lt = (value, params) => inst.check(checks.lt(value, params));\n inst.lte = (value, params) => inst.check(checks.lte(value, params));\n inst.max = (value, params) => inst.check(checks.lte(value, params));\n inst.positive = (params) => inst.check(checks.gt(BigInt(0), params));\n inst.negative = (params) => inst.check(checks.lt(BigInt(0), params));\n inst.nonpositive = (params) => inst.check(checks.lte(BigInt(0), params));\n inst.nonnegative = (params) => inst.check(checks.gte(BigInt(0), params));\n inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));\n const bag = inst._zod.bag;\n inst.minValue = bag.minimum ?? null;\n inst.maxValue = bag.maximum ?? null;\n inst.format = bag.format ?? null;\n});\nexport function bigint(params) {\n return core._bigint(ZodBigInt, params);\n}\nexport const ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"ZodBigIntFormat\", (inst, def) => {\n core.$ZodBigIntFormat.init(inst, def);\n ZodBigInt.init(inst, def);\n});\n// int64\nexport function int64(params) {\n return core._int64(ZodBigIntFormat, params);\n}\n// uint64\nexport function uint64(params) {\n return core._uint64(ZodBigIntFormat, params);\n}\nexport const ZodSymbol = /*@__PURE__*/ core.$constructor(\"ZodSymbol\", (inst, def) => {\n core.$ZodSymbol.init(inst, def);\n ZodType.init(inst, def);\n});\nexport function symbol(params) {\n return core._symbol(ZodSymbol, params);\n}\nexport const ZodUndefined = /*@__PURE__*/ core.$constructor(\"ZodUndefined\", (inst, def) => {\n core.$ZodUndefined.init(inst, def);\n ZodType.init(inst, def);\n});\nfunction _undefined(params) {\n return core._undefined(ZodUndefined, params);\n}\nexport { _undefined as undefined };\nexport const ZodNull = /*@__PURE__*/ core.$constructor(\"ZodNull\", (inst, def) => {\n core.$ZodNull.init(inst, def);\n ZodType.init(inst, def);\n});\nfunction _null(params) {\n return core._null(ZodNull, params);\n}\nexport { _null as null };\nexport const ZodAny = /*@__PURE__*/ core.$constructor(\"ZodAny\", (inst, def) => {\n core.$ZodAny.init(inst, def);\n ZodType.init(inst, def);\n});\nexport function any() {\n return core._any(ZodAny);\n}\nexport const ZodUnknown = /*@__PURE__*/ core.$constructor(\"ZodUnknown\", (inst, def) => {\n core.$ZodUnknown.init(inst, def);\n ZodType.init(inst, def);\n});\nexport function unknown() {\n return core._unknown(ZodUnknown);\n}\nexport const ZodNever = /*@__PURE__*/ core.$constructor(\"ZodNever\", (inst, def) => {\n core.$ZodNever.init(inst, def);\n ZodType.init(inst, def);\n});\nexport function never(params) {\n return core._never(ZodNever, params);\n}\nexport const ZodVoid = /*@__PURE__*/ core.$constructor(\"ZodVoid\", (inst, def) => {\n core.$ZodVoid.init(inst, def);\n ZodType.init(inst, def);\n});\nfunction _void(params) {\n return core._void(ZodVoid, params);\n}\nexport { _void as void };\nexport const ZodDate = /*@__PURE__*/ core.$constructor(\"ZodDate\", (inst, def) => {\n core.$ZodDate.init(inst, def);\n ZodType.init(inst, def);\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.max = (value, params) => inst.check(checks.lte(value, params));\n const c = inst._zod.bag;\n inst.minDate = c.minimum ? new Date(c.minimum) : null;\n inst.maxDate = c.maximum ? new Date(c.maximum) : null;\n});\nexport function date(params) {\n return core._date(ZodDate, params);\n}\nexport const ZodArray = /*@__PURE__*/ core.$constructor(\"ZodArray\", (inst, def) => {\n core.$ZodArray.init(inst, def);\n ZodType.init(inst, def);\n inst.element = def.element;\n inst.min = (minLength, params) => inst.check(checks.minLength(minLength, params));\n inst.nonempty = (params) => inst.check(checks.minLength(1, params));\n inst.max = (maxLength, params) => inst.check(checks.maxLength(maxLength, params));\n inst.length = (len, params) => inst.check(checks.length(len, params));\n inst.unwrap = () => inst.element;\n});\nexport function array(element, params) {\n return core._array(ZodArray, element, params);\n}\n// .keyof\nexport function keyof(schema) {\n const shape = schema._zod.def.shape;\n return literal(Object.keys(shape));\n}\nexport const ZodObject = /*@__PURE__*/ core.$constructor(\"ZodObject\", (inst, def) => {\n core.$ZodObject.init(inst, def);\n ZodType.init(inst, def);\n util.defineLazy(inst, \"shape\", () => {\n return Object.fromEntries(Object.entries(inst._zod.def.shape));\n });\n inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));\n inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall });\n inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });\n // inst.nonstrict = () => inst.clone({ ...inst._zod.def, catchall: api.unknown() });\n inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() });\n inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });\n inst.strip = () => inst.clone({ ...inst._zod.def, catchall: undefined });\n inst.extend = (incoming) => {\n return util.extend(inst, incoming);\n };\n inst.merge = (other) => util.merge(inst, other);\n inst.pick = (mask) => util.pick(inst, mask);\n inst.omit = (mask) => util.omit(inst, mask);\n inst.partial = (...args) => util.partial(ZodOptional, inst, args[0]);\n inst.required = (...args) => util.required(ZodNonOptional, inst, args[0]);\n});\nexport function object(shape, params) {\n const def = {\n type: \"object\",\n get shape() {\n util.assignProp(this, \"shape\", { ...shape });\n return this.shape;\n },\n ...util.normalizeParams(params),\n };\n return new ZodObject(def);\n}\n// strictObject\nexport function strictObject(shape, params) {\n return new ZodObject({\n type: \"object\",\n get shape() {\n util.assignProp(this, \"shape\", { ...shape });\n return this.shape;\n },\n catchall: never(),\n ...util.normalizeParams(params),\n });\n}\n// looseObject\nexport function looseObject(shape, params) {\n return new ZodObject({\n type: \"object\",\n get shape() {\n util.assignProp(this, \"shape\", { ...shape });\n return this.shape;\n },\n catchall: unknown(),\n ...util.normalizeParams(params),\n });\n}\nexport const ZodUnion = /*@__PURE__*/ core.$constructor(\"ZodUnion\", (inst, def) => {\n core.$ZodUnion.init(inst, def);\n ZodType.init(inst, def);\n inst.options = def.options;\n});\nexport function union(options, params) {\n return new ZodUnion({\n type: \"union\",\n options,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodDiscriminatedUnion = /*@__PURE__*/ core.$constructor(\"ZodDiscriminatedUnion\", (inst, def) => {\n ZodUnion.init(inst, def);\n core.$ZodDiscriminatedUnion.init(inst, def);\n});\nexport function discriminatedUnion(discriminator, options, params) {\n // const [options, params] = args;\n return new ZodDiscriminatedUnion({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodIntersection = /*@__PURE__*/ core.$constructor(\"ZodIntersection\", (inst, def) => {\n core.$ZodIntersection.init(inst, def);\n ZodType.init(inst, def);\n});\nexport function intersection(left, right) {\n return new ZodIntersection({\n type: \"intersection\",\n left,\n right,\n });\n}\nexport const ZodTuple = /*@__PURE__*/ core.$constructor(\"ZodTuple\", (inst, def) => {\n core.$ZodTuple.init(inst, def);\n ZodType.init(inst, def);\n inst.rest = (rest) => inst.clone({\n ...inst._zod.def,\n rest,\n });\n});\nexport function tuple(items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof core.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new ZodTuple({\n type: \"tuple\",\n items,\n rest,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodRecord = /*@__PURE__*/ core.$constructor(\"ZodRecord\", (inst, def) => {\n core.$ZodRecord.init(inst, def);\n ZodType.init(inst, def);\n inst.keyType = def.keyType;\n inst.valueType = def.valueType;\n});\nexport function record(keyType, valueType, params) {\n return new ZodRecord({\n type: \"record\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\nexport function partialRecord(keyType, valueType, params) {\n return new ZodRecord({\n type: \"record\",\n keyType: union([keyType, never()]),\n valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMap = /*@__PURE__*/ core.$constructor(\"ZodMap\", (inst, def) => {\n core.$ZodMap.init(inst, def);\n ZodType.init(inst, def);\n inst.keyType = def.keyType;\n inst.valueType = def.valueType;\n});\nexport function map(keyType, valueType, params) {\n return new ZodMap({\n type: \"map\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodSet = /*@__PURE__*/ core.$constructor(\"ZodSet\", (inst, def) => {\n core.$ZodSet.init(inst, def);\n ZodType.init(inst, def);\n inst.min = (...args) => inst.check(core._minSize(...args));\n inst.nonempty = (params) => inst.check(core._minSize(1, params));\n inst.max = (...args) => inst.check(core._maxSize(...args));\n inst.size = (...args) => inst.check(core._size(...args));\n});\nexport function set(valueType, params) {\n return new ZodSet({\n type: \"set\",\n valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodEnum = /*@__PURE__*/ core.$constructor(\"ZodEnum\", (inst, def) => {\n core.$ZodEnum.init(inst, def);\n ZodType.init(inst, def);\n inst.enum = def.entries;\n inst.options = Object.values(def.entries);\n const keys = new Set(Object.keys(def.entries));\n inst.extract = (values, params) => {\n const newEntries = {};\n for (const value of values) {\n if (keys.has(value)) {\n newEntries[value] = def.entries[value];\n }\n else\n throw new Error(`Key ${value} not found in enum`);\n }\n return new ZodEnum({\n ...def,\n checks: [],\n ...util.normalizeParams(params),\n entries: newEntries,\n });\n };\n inst.exclude = (values, params) => {\n const newEntries = { ...def.entries };\n for (const value of values) {\n if (keys.has(value)) {\n delete newEntries[value];\n }\n else\n throw new Error(`Key ${value} not found in enum`);\n }\n return new ZodEnum({\n ...def,\n checks: [],\n ...util.normalizeParams(params),\n entries: newEntries,\n });\n };\n});\nfunction _enum(values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n return new ZodEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport { _enum as enum };\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function nativeEnum(entries, params) {\n return new ZodEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodLiteral = /*@__PURE__*/ core.$constructor(\"ZodLiteral\", (inst, def) => {\n core.$ZodLiteral.init(inst, def);\n ZodType.init(inst, def);\n inst.values = new Set(def.values);\n Object.defineProperty(inst, \"value\", {\n get() {\n if (def.values.length > 1) {\n throw new Error(\"This schema contains multiple valid literal values. Use `.values` instead.\");\n }\n return def.values[0];\n },\n });\n});\nexport function literal(value, params) {\n return new ZodLiteral({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\nexport const ZodFile = /*@__PURE__*/ core.$constructor(\"ZodFile\", (inst, def) => {\n core.$ZodFile.init(inst, def);\n ZodType.init(inst, def);\n inst.min = (size, params) => inst.check(core._minSize(size, params));\n inst.max = (size, params) => inst.check(core._maxSize(size, params));\n inst.mime = (types, params) => inst.check(core._mime(Array.isArray(types) ? types : [types], params));\n});\nexport function file(params) {\n return core._file(ZodFile, params);\n}\nexport const ZodTransform = /*@__PURE__*/ core.$constructor(\"ZodTransform\", (inst, def) => {\n core.$ZodTransform.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, def));\n }\n else {\n // for Zod 3 backwards compatibility\n const _issue = issue;\n if (_issue.fatal)\n _issue.continue = false;\n _issue.code ?? (_issue.code = \"custom\");\n _issue.input ?? (_issue.input = payload.value);\n _issue.inst ?? (_issue.inst = inst);\n _issue.continue ?? (_issue.continue = true);\n payload.issues.push(util.issue(_issue));\n }\n };\n const output = def.transform(payload.value, payload);\n if (output instanceof Promise) {\n return output.then((output) => {\n payload.value = output;\n return payload;\n });\n }\n payload.value = output;\n return payload;\n };\n});\nexport function transform(fn) {\n return new ZodTransform({\n type: \"transform\",\n transform: fn,\n });\n}\nexport const ZodOptional = /*@__PURE__*/ core.$constructor(\"ZodOptional\", (inst, def) => {\n core.$ZodOptional.init(inst, def);\n ZodType.init(inst, def);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function optional(innerType) {\n return new ZodOptional({\n type: \"optional\",\n innerType,\n });\n}\nexport const ZodNullable = /*@__PURE__*/ core.$constructor(\"ZodNullable\", (inst, def) => {\n core.$ZodNullable.init(inst, def);\n ZodType.init(inst, def);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function nullable(innerType) {\n return new ZodNullable({\n type: \"nullable\",\n innerType,\n });\n}\n// nullish\nexport function nullish(innerType) {\n return optional(nullable(innerType));\n}\nexport const ZodDefault = /*@__PURE__*/ core.$constructor(\"ZodDefault\", (inst, def) => {\n core.$ZodDefault.init(inst, def);\n ZodType.init(inst, def);\n inst.unwrap = () => inst._zod.def.innerType;\n inst.removeDefault = inst.unwrap;\n});\nexport function _default(innerType, defaultValue) {\n return new ZodDefault({\n type: \"default\",\n innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : defaultValue;\n },\n });\n}\nexport const ZodPrefault = /*@__PURE__*/ core.$constructor(\"ZodPrefault\", (inst, def) => {\n core.$ZodPrefault.init(inst, def);\n ZodType.init(inst, def);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function prefault(innerType, defaultValue) {\n return new ZodPrefault({\n type: \"prefault\",\n innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : defaultValue;\n },\n });\n}\nexport const ZodNonOptional = /*@__PURE__*/ core.$constructor(\"ZodNonOptional\", (inst, def) => {\n core.$ZodNonOptional.init(inst, def);\n ZodType.init(inst, def);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function nonoptional(innerType, params) {\n return new ZodNonOptional({\n type: \"nonoptional\",\n innerType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodSuccess = /*@__PURE__*/ core.$constructor(\"ZodSuccess\", (inst, def) => {\n core.$ZodSuccess.init(inst, def);\n ZodType.init(inst, def);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function success(innerType) {\n return new ZodSuccess({\n type: \"success\",\n innerType,\n });\n}\nexport const ZodCatch = /*@__PURE__*/ core.$constructor(\"ZodCatch\", (inst, def) => {\n core.$ZodCatch.init(inst, def);\n ZodType.init(inst, def);\n inst.unwrap = () => inst._zod.def.innerType;\n inst.removeCatch = inst.unwrap;\n});\nfunction _catch(innerType, catchValue) {\n return new ZodCatch({\n type: \"catch\",\n innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\nexport { _catch as catch };\nexport const ZodNaN = /*@__PURE__*/ core.$constructor(\"ZodNaN\", (inst, def) => {\n core.$ZodNaN.init(inst, def);\n ZodType.init(inst, def);\n});\nexport function nan(params) {\n return core._nan(ZodNaN, params);\n}\nexport const ZodPipe = /*@__PURE__*/ core.$constructor(\"ZodPipe\", (inst, def) => {\n core.$ZodPipe.init(inst, def);\n ZodType.init(inst, def);\n inst.in = def.in;\n inst.out = def.out;\n});\nexport function pipe(in_, out) {\n return new ZodPipe({\n type: \"pipe\",\n in: in_,\n out,\n // ...util.normalizeParams(params),\n });\n}\nexport const ZodReadonly = /*@__PURE__*/ core.$constructor(\"ZodReadonly\", (inst, def) => {\n core.$ZodReadonly.init(inst, def);\n ZodType.init(inst, def);\n});\nexport function readonly(innerType) {\n return new ZodReadonly({\n type: \"readonly\",\n innerType,\n });\n}\nexport const ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"ZodTemplateLiteral\", (inst, def) => {\n core.$ZodTemplateLiteral.init(inst, def);\n ZodType.init(inst, def);\n});\nexport function templateLiteral(parts, params) {\n return new ZodTemplateLiteral({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodLazy = /*@__PURE__*/ core.$constructor(\"ZodLazy\", (inst, def) => {\n core.$ZodLazy.init(inst, def);\n ZodType.init(inst, def);\n inst.unwrap = () => inst._zod.def.getter();\n});\nexport function lazy(getter) {\n return new ZodLazy({\n type: \"lazy\",\n getter,\n });\n}\nexport const ZodPromise = /*@__PURE__*/ core.$constructor(\"ZodPromise\", (inst, def) => {\n core.$ZodPromise.init(inst, def);\n ZodType.init(inst, def);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function promise(innerType) {\n return new ZodPromise({\n type: \"promise\",\n innerType,\n });\n}\nexport const ZodCustom = /*@__PURE__*/ core.$constructor(\"ZodCustom\", (inst, def) => {\n core.$ZodCustom.init(inst, def);\n ZodType.init(inst, def);\n});\n// custom checks\nexport function check(fn, params) {\n const ch = new core.$ZodCheck({\n check: \"custom\",\n ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\nexport function custom(fn, _params) {\n return core._custom(ZodCustom, fn ?? (() => true), _params);\n}\nexport function refine(fn, _params = {}) {\n return core._refine(ZodCustom, fn, _params);\n}\n// superRefine\nexport function superRefine(fn, params) {\n const ch = check((payload) => {\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, ch._zod.def));\n }\n else {\n // for Zod 3 backwards compatibility\n const _issue = issue;\n if (_issue.fatal)\n _issue.continue = false;\n _issue.code ?? (_issue.code = \"custom\");\n _issue.input ?? (_issue.input = payload.value);\n _issue.inst ?? (_issue.inst = ch);\n _issue.continue ?? (_issue.continue = !ch._zod.def.abort);\n payload.issues.push(util.issue(_issue));\n }\n };\n return fn(payload.value, payload);\n }, params);\n return ch;\n}\nfunction _instanceof(cls, params = {\n error: `Input not instance of ${cls.name}`,\n}) {\n const inst = new ZodCustom({\n type: \"custom\",\n check: \"custom\",\n fn: (data) => data instanceof cls,\n abort: true,\n ...util.normalizeParams(params),\n });\n inst._zod.bag.Class = cls;\n return inst;\n}\nexport { _instanceof as instanceof };\n// stringbool\nexport const stringbool = (...args) => core._stringbool({\n Pipe: ZodPipe,\n Boolean: ZodBoolean,\n Unknown: ZodUnknown,\n}, ...args);\nexport function json(params) {\n const jsonSchema = lazy(() => {\n return union([string(params), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);\n });\n return jsonSchema;\n}\n// preprocess\n// /** @deprecated Use `z.pipe()` and `z.transform()` instead. */\nexport function preprocess(fn, schema) {\n return pipe(transform(fn), schema);\n}\n","export const HALLIDAY_DOMAIN = \"https://app.halliday.xyz\";\nexport const HALLIDAY_API_URL = \"https://api.halliday.xyz/v1/client\";\nexport const HALLIDAY_PAYMENTS_API_URL = \"https://v2.prod.halliday.xyz\";\n\nexport const WIDGET_WIDTH = 480;\nexport const WIDGET_HEIGHT = 638;\n\n/**\n * Regex to validate the apiDomainName\n * Only allow halliday.xyz or localhost\n */\nexport const API_DOMAIN_REGEX =\n /^(https:\\/\\/(?:[\\w-]+\\.)*halliday\\.xyz(?:\\/.*)?|http:\\/\\/localhost(?::\\d+)?(?:\\/.*)?|https:\\/\\/localhost(?::\\d+)?(?:\\/.*)?)$/;\n\nexport const UUID_REGEX = /^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/;\n","import { z } from \"zod/v4\";\n\nexport const Amount = z.string().refine((amount) => /^(0|[1-9]\\d*)(\\.\\d+)?$/.test(amount), {\n message: \"Invalid amount\",\n});\nexport type Amount = z.infer<typeof Amount>;\n\n// EVM\nexport const EVMAddressRegex = /^(0x|0x[a-fA-F0-9]{40})$/;\nexport const EVMTokenAddress = z.string().refine((a) => EVMAddressRegex.test(a), {\n message: \"Invalid EVM token address\",\n});\nexport type EVMTokenAddress = z.infer<typeof EVMTokenAddress>;\n\nexport const EVMAddress = EVMTokenAddress.refine((val) => val !== \"0x\", {\n message: \"Invalid EVM address\",\n});\nexport type EVMAddress = z.infer<typeof EVMAddress>;\n\n// Solana\nexport const SolAddressRegex = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;\nexport const SolNativeRegex = /^So[1-2]{41}$/;\nexport const SolTokenAddress = z.string().refine((a) => SolAddressRegex.test(a) || SolNativeRegex.test(a), {\n message: \"Invalid Solana token address\",\n});\nexport type SolTokenAddress = z.infer<typeof SolTokenAddress>;\nexport const SolAddress = z.string().refine((a) => SolAddressRegex.test(a), {\n message: \"Invalid Solana address\",\n});\nexport type SolAddress = z.infer<typeof SolAddress>;\n\n// Address\nexport const Address = z.union([EVMAddress, SolAddress]);\nexport type Address = z.infer<typeof Address>;\n\n// Fiat\nexport const Fiat = z.string().refine((fiat) => /^[a-zA-Z_]{3,}$/.test(fiat), {\n message: \"Invalid fiat\",\n});\nexport type Fiat = z.infer<typeof Fiat>;\n\nexport const FiatDetails = z.object({\n issuer: z.string(),\n name: z.string(),\n alias: z.string().optional(),\n symbol: z.string(),\n decimals: z.number(),\n});\nexport type FiatDetails = z.infer<typeof FiatDetails>;\n\n// Token\nexport const Name = z.string();\nexport const Symbol = z.string().regex(/^[a-zA-Z]\\w{1,7}$/, {\n message: \"Must be a short alpha-numeric symbol\",\n});\nexport const Decimals = z.number().min(0).max(18);\n\nexport const ImageUrl = z.string().url();\nexport const CoinGeckoId = z.string();\n\nexport const EVMTokenPointer = z.object({\n chain: z.string(),\n address: EVMTokenAddress,\n});\n\nexport const SolTokenPointer = z.object({\n chain: z.literal(\"solana\"),\n address: SolTokenAddress,\n});\n\nexport const FlexibleTokenPointer = z.object({\n chain: z.string(),\n address: z.string(),\n});\n\nexport const TokenPointer = z.union([EVMTokenPointer, SolTokenPointer, FlexibleTokenPointer]);\n\nexport const Token = z.string().refine(\n (token) => {\n const [chain, address] = token.split(\":\");\n const result = TokenPointer.safeParse({ chain, address });\n return result.success;\n },\n {\n message: \"Invalid token\",\n }\n);\nexport type Token = z.infer<typeof Token>;\n\nexport const TokenInfo = z.object({\n name: Name,\n symbol: Symbol,\n decimals: Decimals,\n alias: Symbol.optional(),\n image_url: ImageUrl.optional(),\n coingecko_id: CoinGeckoId.optional(),\n wrapper: Symbol.optional(),\n is_native: z.boolean().optional(),\n});\n\nexport const EVMTokenDetails = EVMTokenPointer.extend(TokenInfo.shape);\nexport type EVMTokenDetails = z.infer<typeof EVMTokenDetails>;\n\nexport const SolTokenDetails = SolTokenPointer.extend(TokenInfo.shape);\nexport type SolTokenDetails = z.infer<typeof SolTokenDetails>;\n\nexport const FlexibleTokenDetails = FlexibleTokenPointer.extend(TokenInfo.shape);\nexport type FlexibleTokenDetails = z.infer<typeof FlexibleTokenDetails>;\n\nexport const TokenDetails = z.union([EVMTokenDetails, SolTokenDetails, FlexibleTokenDetails]);\nexport type TokenDetails = z.infer<typeof TokenDetails>;\n\n// Asset\nexport const Asset = z.union([Token, Fiat]);\nexport type Asset = z.infer<typeof Asset>;\nexport const AssetDetails = z.union([TokenDetails, FiatDetails]);\nexport type AssetDetails = z.infer<typeof AssetDetails>;\n\nexport const Realm = z.discriminatedUnion(\"type\", [\n z.object({\n type: z.literal(\"chain\"),\n chain: z.string(),\n }),\n z.object({\n type: z.literal(\"issuer\"),\n issuer: z.string(),\n }),\n]);\nexport type Realm = z.infer<typeof Realm>;\n\n// Ramp\nexport const RampName = z.string().transform((ramp_name) => ramp_name.toLowerCase());\nexport type RampName = z.infer<typeof RampName>;\n\nexport const RampType = z.preprocess(\n (ramp_type) => (typeof ramp_type === \"string\" ? ramp_type.toUpperCase() : ramp_type),\n z.enum([\"ONRAMP\", \"OFFRAMP\"])\n);\nexport type RampType = z.infer<typeof RampType>;\n\n// Transaction\n// TODO: confirm the fields that accommodate ethers and viem\nexport const TransactionRequest = z.object({\n to: EVMAddress,\n from: EVMAddress.optional(),\n nonce: z.number().optional(),\n gasLimit: z.bigint().optional(),\n gasPrice: z.bigint().optional(),\n maxPriorityFeePerGas: z.bigint().optional(),\n maxFeePerGas: z.bigint().optional(),\n data: z.string().optional(),\n value: z.bigint().optional(),\n chainId: z.number(),\n});\nexport type TransactionRequest = z.infer<typeof TransactionRequest>;\n\n// TODO: confirm the fields that accommodate ethers and viem\nexport const TransactionReceipt = z.object({\n transactionHash: z.string().optional(),\n blockHash: z.string().optional(),\n blockNumber: z.number().optional(),\n from: EVMAddress.optional(),\n to: EVMAddress.optional(),\n rawReceipt: z.any(), // Preserves the original receipt from ethers or viem\n});\nexport type TransactionReceipt = z.infer<typeof TransactionReceipt>;\n\n// Chain\nexport const EVMChainConfig = z.object({\n chain_id: z.bigint(),\n network: z.string(),\n native_currency: z.object({\n name: z.string(),\n symbol: z.string(),\n decimals: z.number(),\n }),\n rpc: z.string(),\n image: z.string(),\n is_testnet: z.boolean(),\n explorer: z.string(),\n});\nexport type EVMChainConfig = z.infer<typeof EVMChainConfig>;\n\nexport const SolChainConfig = z.object({\n chain_id: z.bigint(),\n network: z.string(),\n});\nexport type SolChainConfig = z.infer<typeof SolChainConfig>;\n\nexport const ChainConfig = z.union([EVMChainConfig, SolChainConfig]);\nexport type ChainConfig = z.infer<typeof ChainConfig>;\n\nexport const OnrampMethod = z.enum([\n \"CREDIT_CARD\",\n \"DEBIT_CARD\",\n \"ACH\",\n \"FIAT_BALANCE\",\n \"TOKEN_BALANCE\",\n \"APPLE_PAY\",\n \"PAYPAL\",\n \"VENMO\",\n \"REVOLUT\",\n \"GOOGLE_PAY\",\n \"SEPA\",\n \"FASTER_PAYMENTS\",\n \"PIX\",\n \"UPI\",\n \"WIRE\",\n]);\nexport type OnrampMethod = z.infer<typeof OnrampMethod>;\n","export class HSON {\n static replacer = (_: any, value: any) => {\n if (typeof value === \"bigint\") {\n return { \"#\": value.toString() };\n }\n return value;\n }\n\n static reviver = (_: any, value: any) => {\n if (value && typeof value === \"object\" && \"#\" in value && Object.keys(value).length === 1) {\n return BigInt(value[\"#\"]);\n }\n return value;\n }\n\n static stringify(obj: any, space?: number | string): string {\n return JSON.stringify(obj, this.replacer, space);\n }\n\n static parse(str: string): any {\n return JSON.parse(str, this.reviver);\n }\n}\n","/*! *****************************************************************************\nCopyright (C) Microsoft. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\nvar Reflect;\n(function (Reflect) {\n // Metadata Proposal\n // https://rbuckton.github.io/reflect-metadata/\n (function (factory) {\n var root = typeof globalThis === \"object\" ? globalThis :\n typeof global === \"object\" ? global :\n typeof self === \"object\" ? self :\n typeof this === \"object\" ? this :\n sloppyModeThis();\n var exporter = makeExporter(Reflect);\n if (typeof root.Reflect !== \"undefined\") {\n exporter = makeExporter(root.Reflect, exporter);\n }\n factory(exporter, root);\n if (typeof root.Reflect === \"undefined\") {\n root.Reflect = Reflect;\n }\n function makeExporter(target, previous) {\n return function (key, value) {\n Object.defineProperty(target, key, { configurable: true, writable: true, value: value });\n if (previous)\n previous(key, value);\n };\n }\n function functionThis() {\n try {\n return Function(\"return this;\")();\n }\n catch (_) { }\n }\n function indirectEvalThis() {\n try {\n return (void 0, eval)(\"(function() { return this; })()\");\n }\n catch (_) { }\n }\n function sloppyModeThis() {\n return functionThis() || indirectEvalThis();\n }\n })(function (exporter, root) {\n var hasOwn = Object.prototype.hasOwnProperty;\n // feature test for Symbol support\n var supportsSymbol = typeof Symbol === \"function\";\n var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== \"undefined\" ? Symbol.toPrimitive : \"@@toPrimitive\";\n var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== \"undefined\" ? Symbol.iterator : \"@@iterator\";\n var supportsCreate = typeof Object.create === \"function\"; // feature test for Object.create support\n var supportsProto = { __proto__: [] } instanceof Array; // feature test for __proto__ support\n var downLevel = !supportsCreate && !supportsProto;\n var HashMap = {\n // create an object in dictionary mode (a.k.a. \"slow\" mode in v8)\n create: supportsCreate\n ? function () { return MakeDictionary(Object.create(null)); }\n : supportsProto\n ? function () { return MakeDictionary({ __proto__: null }); }\n : function () { return MakeDictionary({}); },\n has: downLevel\n ? function (map, key) { return hasOwn.call(map, key); }\n : function (map, key) { return key in map; },\n get: downLevel\n ? function (map, key) { return hasOwn.call(map, key) ? map[key] : undefined; }\n : function (map, key) { return map[key]; },\n };\n // Load global or shim versions of Map, Set, and WeakMap\n var functionPrototype = Object.getPrototypeOf(Function);\n var _Map = typeof Map === \"function\" && typeof Map.prototype.entries === \"function\" ? Map : CreateMapPolyfill();\n var _Set = typeof Set === \"function\" && typeof Set.prototype.entries === \"function\" ? Set : CreateSetPolyfill();\n var _WeakMap = typeof WeakMap === \"function\" ? WeakMap : CreateWeakMapPolyfill();\n var registrySymbol = supportsSymbol ? Symbol.for(\"@reflect-metadata:registry\") : undefined;\n var metadataRegistry = GetOrCreateMetadataRegistry();\n var metadataProvider = CreateMetadataProvider(metadataRegistry);\n /**\n * Applies a set of decorators to a property of a target object.\n * @param decorators An array of decorators.\n * @param target The target object.\n * @param propertyKey (Optional) The property key to decorate.\n * @param attributes (Optional) The property descriptor for the target key.\n * @remarks Decorators are applied in reverse order.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * Example = Reflect.decorate(decoratorsArray, Example);\n *\n * // property (on constructor)\n * Reflect.decorate(decoratorsArray, Example, \"staticProperty\");\n *\n * // property (on prototype)\n * Reflect.decorate(decoratorsArray, Example.prototype, \"property\");\n *\n * // method (on constructor)\n * Object.defineProperty(Example, \"staticMethod\",\n * Reflect.decorate(decoratorsArray, Example, \"staticMethod\",\n * Object.getOwnPropertyDescriptor(Example, \"staticMethod\")));\n *\n * // method (on prototype)\n * Object.defineProperty(Example.prototype, \"method\",\n * Reflect.decorate(decoratorsArray, Example.prototype, \"method\",\n * Object.getOwnPropertyDescriptor(Example.prototype, \"method\")));\n *\n */\n function decorate(decorators, target, propertyKey, attributes) {\n if (!IsUndefined(propertyKey)) {\n if (!IsArray(decorators))\n throw new TypeError();\n if (!IsObject(target))\n throw new TypeError();\n if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))\n throw new TypeError();\n if (IsNull(attributes))\n attributes = undefined;\n propertyKey = ToPropertyKey(propertyKey);\n return DecorateProperty(decorators, target, propertyKey, attributes);\n }\n else {\n if (!IsArray(decorators))\n throw new TypeError();\n if (!IsConstructor(target))\n throw new TypeError();\n return DecorateConstructor(decorators, target);\n }\n }\n exporter(\"decorate\", decorate);\n // 4.1.2 Reflect.metadata(metadataKey, metadataValue)\n // https://rbuckton.github.io/reflect-metadata/#reflect.metadata\n /**\n * A default metadata decorator factory that can be used on a class, class member, or parameter.\n * @param metadataKey The key for the metadata entry.\n * @param metadataValue The value for the metadata entry.\n * @returns A decorator function.\n * @remarks\n * If `metadataKey` is already defined for the target and target key, the\n * metadataValue for that key will be overwritten.\n * @example\n *\n * // constructor\n * @Reflect.metadata(key, value)\n * class Example {\n * }\n *\n * // property (on constructor, TypeScript only)\n * class Example {\n * @Reflect.metadata(key, value)\n * static staticProperty;\n * }\n *\n * // property (on prototype, TypeScript only)\n * class Example {\n * @Reflect.metadata(key, value)\n * property;\n * }\n *\n * // method (on constructor)\n * class Example {\n * @Reflect.metadata(key, value)\n * static staticMethod() { }\n * }\n *\n * // method (on prototype)\n * class Example {\n * @Reflect.metadata(key, value)\n * method() { }\n * }\n *\n */\n function metadata(metadataKey, metadataValue) {\n function decorator(target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))\n throw new TypeError();\n OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n }\n return decorator;\n }\n exporter(\"metadata\", metadata);\n /**\n * Define a unique metadata entry on the target.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param metadataValue A value that contains attached metadata.\n * @param target The target object on which to define metadata.\n * @param propertyKey (Optional) The property key for the target.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * Reflect.defineMetadata(\"custom:annotation\", options, Example);\n *\n * // property (on constructor)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example, \"staticProperty\");\n *\n * // property (on prototype)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example.prototype, \"property\");\n *\n * // method (on constructor)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example, \"staticMethod\");\n *\n * // method (on prototype)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example.prototype, \"method\");\n *\n * // decorator factory as metadata-producing annotation.\n * function MyAnnotation(options): Decorator {\n * return (target, key?) => Reflect.defineMetadata(\"custom:annotation\", options, target, key);\n * }\n *\n */\n function defineMetadata(metadataKey, metadataValue, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n }\n exporter(\"defineMetadata\", defineMetadata);\n /**\n * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.hasMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function hasMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryHasMetadata(metadataKey, target, propertyKey);\n }\n exporter(\"hasMetadata\", hasMetadata);\n /**\n * Gets a value indicating whether the target object has the provided metadata key defined.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns `true` if the metadata key was defined on the target object; otherwise, `false`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function hasOwnMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);\n }\n exporter(\"hasOwnMetadata\", hasOwnMetadata);\n /**\n * Gets the metadata value for the provided metadata key on the target object or its prototype chain.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.getMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function getMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryGetMetadata(metadataKey, target, propertyKey);\n }\n exporter(\"getMetadata\", getMetadata);\n /**\n * Gets the metadata value for the provided metadata key on the target object.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function getOwnMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);\n }\n exporter(\"getOwnMetadata\", getOwnMetadata);\n /**\n * Gets the metadata keys defined on the target object or its prototype chain.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns An array of unique metadata keys.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getMetadataKeys(Example);\n *\n * // property (on constructor)\n * result = Reflect.getMetadataKeys(Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getMetadataKeys(Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getMetadataKeys(Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getMetadataKeys(Example.prototype, \"method\");\n *\n */\n function getMetadataKeys(target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryMetadataKeys(target, propertyKey);\n }\n exporter(\"getMetadataKeys\", getMetadataKeys);\n /**\n * Gets the unique metadata keys defined on the target object.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns An array of unique metadata keys.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getOwnMetadataKeys(Example);\n *\n * // property (on constructor)\n * result = Reflect.getOwnMetadataKeys(Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getOwnMetadataKeys(Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getOwnMetadataKeys(Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getOwnMetadataKeys(Example.prototype, \"method\");\n *\n */\n function getOwnMetadataKeys(target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryOwnMetadataKeys(target, propertyKey);\n }\n exporter(\"getOwnMetadataKeys\", getOwnMetadataKeys);\n /**\n * Deletes the metadata entry from the target object with the provided key.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns `true` if the metadata entry was found and deleted; otherwise, false.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function deleteMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n var provider = GetMetadataProvider(target, propertyKey, /*Create*/ false);\n if (IsUndefined(provider))\n return false;\n return provider.OrdinaryDeleteMetadata(metadataKey, target, propertyKey);\n }\n exporter(\"deleteMetadata\", deleteMetadata);\n function DecorateConstructor(decorators, target) {\n for (var i = decorators.length - 1; i >= 0; --i) {\n var decorator = decorators[i];\n var decorated = decorator(target);\n if (!IsUndefined(decorated) && !IsNull(decorated)) {\n if (!IsConstructor(decorated))\n throw new TypeError();\n target = decorated;\n }\n }\n return target;\n }\n function DecorateProperty(decorators, target, propertyKey, descriptor) {\n for (var i = decorators.length - 1; i >= 0; --i) {\n var decorator = decorators[i];\n var decorated = decorator(target, propertyKey, descriptor);\n if (!IsUndefined(decorated) && !IsNull(decorated)) {\n if (!IsObject(decorated))\n throw new TypeError();\n descriptor = decorated;\n }\n }\n return descriptor;\n }\n // 3.1.1.1 OrdinaryHasMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinaryhasmetadata\n function OrdinaryHasMetadata(MetadataKey, O, P) {\n var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn)\n return true;\n var parent = OrdinaryGetPrototypeOf(O);\n if (!IsNull(parent))\n return OrdinaryHasMetadata(MetadataKey, parent, P);\n return false;\n }\n // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata\n function OrdinaryHasOwnMetadata(MetadataKey, O, P) {\n var provider = GetMetadataProvider(O, P, /*Create*/ false);\n if (IsUndefined(provider))\n return false;\n return ToBoolean(provider.OrdinaryHasOwnMetadata(MetadataKey, O, P));\n }\n // 3.1.3.1 OrdinaryGetMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarygetmetadata\n function OrdinaryGetMetadata(MetadataKey, O, P) {\n var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn)\n return OrdinaryGetOwnMetadata(MetadataKey, O, P);\n var parent = OrdinaryGetPrototypeOf(O);\n if (!IsNull(parent))\n return OrdinaryGetMetadata(MetadataKey, parent, P);\n return undefined;\n }\n // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata\n function OrdinaryGetOwnMetadata(MetadataKey, O, P) {\n var provider = GetMetadataProvider(O, P, /*Create*/ false);\n if (IsUndefined(provider))\n return;\n return provider.OrdinaryGetOwnMetadata(MetadataKey, O, P);\n }\n // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata\n function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {\n var provider = GetMetadataProvider(O, P, /*Create*/ true);\n provider.OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P);\n }\n // 3.1.6.1 OrdinaryMetadataKeys(O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarymetadatakeys\n function OrdinaryMetadataKeys(O, P) {\n var ownKeys = OrdinaryOwnMetadataKeys(O, P);\n var parent = OrdinaryGetPrototypeOf(O);\n if (parent === null)\n return ownKeys;\n var parentKeys = OrdinaryMetadataKeys(parent, P);\n if (parentKeys.length <= 0)\n return ownKeys;\n if (ownKeys.length <= 0)\n return parentKeys;\n var set = new _Set();\n var keys = [];\n for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) {\n var key = ownKeys_1[_i];\n var hasKey = set.has(key);\n if (!hasKey) {\n set.add(key);\n keys.push(key);\n }\n }\n for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) {\n var key = parentKeys_1[_a];\n var hasKey = set.has(key);\n if (!hasKey) {\n set.add(key);\n keys.push(key);\n }\n }\n return keys;\n }\n // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys\n function OrdinaryOwnMetadataKeys(O, P) {\n var provider = GetMetadataProvider(O, P, /*create*/ false);\n if (!provider) {\n return [];\n }\n return provider.OrdinaryOwnMetadataKeys(O, P);\n }\n // 6 ECMAScript Data Types and Values\n // https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values\n function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }\n // 6.1.1 The Undefined Type\n // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-undefined-type\n function IsUndefined(x) {\n return x === undefined;\n }\n // 6.1.2 The Null Type\n // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-null-type\n function IsNull(x) {\n return x === null;\n }\n // 6.1.5 The Symbol Type\n // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-symbol-type\n function IsSymbol(x) {\n return typeof x === \"symbol\";\n }\n // 6.1.7 The Object Type\n // https://tc39.github.io/ecma262/#sec-object-type\n function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }\n // 7.1 Type Conversion\n // https://tc39.github.io/ecma262/#sec-type-conversion\n // 7.1.1 ToPrimitive(input [, PreferredType])\n // https://tc39.github.io/ecma262/#sec-toprimitive\n function ToPrimitive(input, PreferredType) {\n switch (Type(input)) {\n case 0 /* Undefined */: return input;\n case 1 /* Null */: return input;\n case 2 /* Boolean */: return input;\n case 3 /* String */: return input;\n case 4 /* Symbol */: return input;\n case 5 /* Number */: return input;\n }\n var hint = PreferredType === 3 /* String */ ? \"string\" : PreferredType === 5 /* Number */ ? \"number\" : \"default\";\n var exoticToPrim = GetMethod(input, toPrimitiveSymbol);\n if (exoticToPrim !== undefined) {\n var result = exoticToPrim.call(input, hint);\n if (IsObject(result))\n throw new TypeError();\n return result;\n }\n return OrdinaryToPrimitive(input, hint === \"default\" ? \"number\" : hint);\n }\n // 7.1.1.1 OrdinaryToPrimitive(O, hint)\n // https://tc39.github.io/ecma262/#sec-ordinarytoprimitive\n function OrdinaryToPrimitive(O, hint) {\n if (hint === \"string\") {\n var toString_1 = O.toString;\n if (IsCallable(toString_1)) {\n var result = toString_1.call(O);\n if (!IsObject(result))\n return result;\n }\n var valueOf = O.valueOf;\n if (IsCallable(valueOf)) {\n var result = valueOf.call(O);\n if (!IsObject(result))\n return result;\n }\n }\n else {\n var valueOf = O.valueOf;\n if (IsCallable(valueOf)) {\n var result = valueOf.call(O);\n if (!IsObject(result))\n return result;\n }\n var toString_2 = O.toString;\n if (IsCallable(toString_2)) {\n var result = toString_2.call(O);\n if (!IsObject(result))\n return result;\n }\n }\n throw new TypeError();\n }\n // 7.1.2 ToBoolean(argument)\n // https://tc39.github.io/ecma262/2016/#sec-toboolean\n function ToBoolean(argument) {\n return !!argument;\n }\n // 7.1.12 ToString(argument)\n // https://tc39.github.io/ecma262/#sec-tostring\n function ToString(argument) {\n return \"\" + argument;\n }\n // 7.1.14 ToPropertyKey(argument)\n // https://tc39.github.io/ecma262/#sec-topropertykey\n function ToPropertyKey(argument) {\n var key = ToPrimitive(argument, 3 /* String */);\n if (IsSymbol(key))\n return key;\n return ToString(key);\n }\n // 7.2 Testing and Comparison Operations\n // https://tc39.github.io/ecma262/#sec-testing-and-comparison-operations\n // 7.2.2 IsArray(argument)\n // https://tc39.github.io/ecma262/#sec-isarray\n function IsArray(argument) {\n return Array.isArray\n ? Array.isArray(argument)\n : argument instanceof Object\n ? argument instanceof Array\n : Object.prototype.toString.call(argument) === \"[object Array]\";\n }\n // 7.2.3 IsCallable(argument)\n // https://tc39.github.io/ecma262/#sec-iscallable\n function IsCallable(argument) {\n // NOTE: This is an approximation as we cannot check for [[Call]] internal method.\n return typeof argument === \"function\";\n }\n // 7.2.4 IsConstructor(argument)\n // https://tc39.github.io/ecma262/#sec-isconstructor\n function IsConstructor(argument) {\n // NOTE: This is an approximation as we cannot check for [[Construct]] internal method.\n return typeof argument === \"function\";\n }\n // 7.2.7 IsPropertyKey(argument)\n // https://tc39.github.io/ecma262/#sec-ispropertykey\n function IsPropertyKey(argument) {\n switch (Type(argument)) {\n case 3 /* String */: return true;\n case 4 /* Symbol */: return true;\n default: return false;\n }\n }\n function SameValueZero(x, y) {\n return x === y || x !== x && y !== y;\n }\n // 7.3 Operations on Objects\n // https://tc39.github.io/ecma262/#sec-operations-on-objects\n // 7.3.9 GetMethod(V, P)\n // https://tc39.github.io/ecma262/#sec-getmethod\n function GetMethod(V, P) {\n var func = V[P];\n if (func === undefined || func === null)\n return undefined;\n if (!IsCallable(func))\n throw new TypeError();\n return func;\n }\n // 7.4 Operations on Iterator Objects\n // https://tc39.github.io/ecma262/#sec-operations-on-iterator-objects\n function GetIterator(obj) {\n var method = GetMethod(obj, iteratorSymbol);\n if (!IsCallable(method))\n throw new TypeError(); // from Call\n var iterator = method.call(obj);\n if (!IsObject(iterator))\n throw new TypeError();\n return iterator;\n }\n // 7.4.4 IteratorValue(iterResult)\n // https://tc39.github.io/ecma262/2016/#sec-iteratorvalue\n function IteratorValue(iterResult) {\n return iterResult.value;\n }\n // 7.4.5 IteratorStep(iterator)\n // https://tc39.github.io/ecma262/#sec-iteratorstep\n function IteratorStep(iterator) {\n var result = iterator.next();\n return result.done ? false : result;\n }\n // 7.4.6 IteratorClose(iterator, completion)\n // https://tc39.github.io/ecma262/#sec-iteratorclose\n function IteratorClose(iterator) {\n var f = iterator[\"return\"];\n if (f)\n f.call(iterator);\n }\n // 9.1 Ordinary Object Internal Methods and Internal Slots\n // https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots\n // 9.1.1.1 OrdinaryGetPrototypeOf(O)\n // https://tc39.github.io/ecma262/#sec-ordinarygetprototypeof\n function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }\n // Global metadata registry\n // - Allows `import \"reflect-metadata\"` and `import \"reflect-metadata/no-conflict\"` to interoperate.\n // - Uses isolated metadata if `Reflect` is frozen before the registry can be installed.\n /**\n * Creates a registry used to allow multiple `reflect-metadata` providers.\n */\n function CreateMetadataRegistry() {\n var fallback;\n if (!IsUndefined(registrySymbol) &&\n typeof root.Reflect !== \"undefined\" &&\n !(registrySymbol in root.Reflect) &&\n typeof root.Reflect.defineMetadata === \"function\") {\n // interoperate with older version of `reflect-metadata` that did not support a registry.\n fallback = CreateFallbackProvider(root.Reflect);\n }\n var first;\n var second;\n var rest;\n var targetProviderMap = new _WeakMap();\n var registry = {\n registerProvider: registerProvider,\n getProvider: getProvider,\n setProvider: setProvider,\n };\n return registry;\n function registerProvider(provider) {\n if (!Object.isExtensible(registry)) {\n throw new Error(\"Cannot add provider to a frozen registry.\");\n }\n switch (true) {\n case fallback === provider: break;\n case IsUndefined(first):\n first = provider;\n break;\n case first === provider: break;\n case IsUndefined(second):\n second = provider;\n break;\n case second === provider: break;\n default:\n if (rest === undefined)\n rest = new _Set();\n rest.add(provider);\n break;\n }\n }\n function getProviderNoCache(O, P) {\n if (!IsUndefined(first)) {\n if (first.isProviderFor(O, P))\n return first;\n if (!IsUndefined(second)) {\n if (second.isProviderFor(O, P))\n return first;\n if (!IsUndefined(rest)) {\n var iterator = GetIterator(rest);\n while (true) {\n var next = IteratorStep(iterator);\n if (!next) {\n return undefined;\n }\n var provider = IteratorValue(next);\n if (provider.isProviderFor(O, P)) {\n IteratorClose(iterator);\n return provider;\n }\n }\n }\n }\n }\n if (!IsUndefined(fallback) && fallback.isProviderFor(O, P)) {\n return fallback;\n }\n return undefined;\n }\n function getProvider(O, P) {\n var providerMap = targetProviderMap.get(O);\n var provider;\n if (!IsUndefined(providerMap)) {\n provider = providerMap.get(P);\n }\n if (!IsUndefined(provider)) {\n return provider;\n }\n provider = getProviderNoCache(O, P);\n if (!IsUndefined(provider)) {\n if (IsUndefined(providerMap)) {\n providerMap = new _Map();\n targetProviderMap.set(O, providerMap);\n }\n providerMap.set(P, provider);\n }\n return provider;\n }\n function hasProvider(provider) {\n if (IsUndefined(provider))\n throw new TypeError();\n return first === provider || second === provider || !IsUndefined(rest) && rest.has(provider);\n }\n function setProvider(O, P, provider) {\n if (!hasProvider(provider)) {\n throw new Error(\"Metadata provider not registered.\");\n }\n var existingProvider = getProvider(O, P);\n if (existingProvider !== provider) {\n if (!IsUndefined(existingProvider)) {\n return false;\n }\n var providerMap = targetProviderMap.get(O);\n if (IsUndefined(providerMap)) {\n providerMap = new _Map();\n targetProviderMap.set(O, providerMap);\n }\n providerMap.set(P, provider);\n }\n return true;\n }\n }\n /**\n * Gets or creates the shared registry of metadata providers.\n */\n function GetOrCreateMetadataRegistry() {\n var metadataRegistry;\n if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {\n metadataRegistry = root.Reflect[registrySymbol];\n }\n if (IsUndefined(metadataRegistry)) {\n metadataRegistry = CreateMetadataRegistry();\n }\n if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {\n Object.defineProperty(root.Reflect, registrySymbol, {\n enumerable: false,\n configurable: false,\n writable: false,\n value: metadataRegistry\n });\n }\n return metadataRegistry;\n }\n function CreateMetadataProvider(registry) {\n // [[Metadata]] internal slot\n // https://rbuckton.github.io/reflect-metadata/#ordinary-object-internal-methods-and-internal-slots\n var metadata = new _WeakMap();\n var provider = {\n isProviderFor: function (O, P) {\n var targetMetadata = metadata.get(O);\n if (IsUndefined(targetMetadata))\n return false;\n return targetMetadata.has(P);\n },\n OrdinaryDefineOwnMetadata: OrdinaryDefineOwnMetadata,\n OrdinaryHasOwnMetadata: OrdinaryHasOwnMetadata,\n OrdinaryGetOwnMetadata: OrdinaryGetOwnMetadata,\n OrdinaryOwnMetadataKeys: OrdinaryOwnMetadataKeys,\n OrdinaryDeleteMetadata: OrdinaryDeleteMetadata,\n };\n metadataRegistry.registerProvider(provider);\n return provider;\n function GetOrCreateMetadataMap(O, P, Create) {\n var targetMetadata = metadata.get(O);\n var createdTargetMetadata = false;\n if (IsUndefined(targetMetadata)) {\n if (!Create)\n return undefined;\n targetMetadata = new _Map();\n metadata.set(O, targetMetadata);\n createdTargetMetadata = true;\n }\n var metadataMap = targetMetadata.get(P);\n if (IsUndefined(metadataMap)) {\n if (!Create)\n return undefined;\n metadataMap = new _Map();\n targetMetadata.set(P, metadataMap);\n if (!registry.setProvider(O, P, provider)) {\n targetMetadata.delete(P);\n if (createdTargetMetadata) {\n metadata.delete(O);\n }\n throw new Error(\"Wrong provider for target.\");\n }\n }\n return metadataMap;\n }\n // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata\n function OrdinaryHasOwnMetadata(MetadataKey, O, P) {\n var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n if (IsUndefined(metadataMap))\n return false;\n return ToBoolean(metadataMap.has(MetadataKey));\n }\n // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata\n function OrdinaryGetOwnMetadata(MetadataKey, O, P) {\n var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n if (IsUndefined(metadataMap))\n return undefined;\n return metadataMap.get(MetadataKey);\n }\n // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata\n function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {\n var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ true);\n metadataMap.set(MetadataKey, MetadataValue);\n }\n // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys\n function OrdinaryOwnMetadataKeys(O, P) {\n var keys = [];\n var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n if (IsUndefined(metadataMap))\n return keys;\n var keysObj = metadataMap.keys();\n var iterator = GetIterator(keysObj);\n var k = 0;\n while (true) {\n var next = IteratorStep(iterator);\n if (!next) {\n keys.length = k;\n return keys;\n }\n var nextValue = IteratorValue(next);\n try {\n keys[k] = nextValue;\n }\n catch (e) {\n try {\n IteratorClose(iterator);\n }\n finally {\n throw e;\n }\n }\n k++;\n }\n }\n function OrdinaryDeleteMetadata(MetadataKey, O, P) {\n var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n if (IsUndefined(metadataMap))\n return false;\n if (!metadataMap.delete(MetadataKey))\n return false;\n if (metadataMap.size === 0) {\n var targetMetadata = metadata.get(O);\n if (!IsUndefined(targetMetadata)) {\n targetMetadata.delete(P);\n if (targetMetadata.size === 0) {\n metadata.delete(targetMetadata);\n }\n }\n }\n return true;\n }\n }\n function CreateFallbackProvider(reflect) {\n var defineMetadata = reflect.defineMetadata, hasOwnMetadata = reflect.hasOwnMetadata, getOwnMetadata = reflect.getOwnMetadata, getOwnMetadataKeys = reflect.getOwnMetadataKeys, deleteMetadata = reflect.deleteMetadata;\n var metadataOwner = new _WeakMap();\n var provider = {\n isProviderFor: function (O, P) {\n var metadataPropertySet = metadataOwner.get(O);\n if (!IsUndefined(metadataPropertySet) && metadataPropertySet.has(P)) {\n return true;\n }\n if (getOwnMetadataKeys(O, P).length) {\n if (IsUndefined(metadataPropertySet)) {\n metadataPropertySet = new _Set();\n metadataOwner.set(O, metadataPropertySet);\n }\n metadataPropertySet.add(P);\n return true;\n }\n return false;\n },\n OrdinaryDefineOwnMetadata: defineMetadata,\n OrdinaryHasOwnMetadata: hasOwnMetadata,\n OrdinaryGetOwnMetadata: getOwnMetadata,\n OrdinaryOwnMetadataKeys: getOwnMetadataKeys,\n OrdinaryDeleteMetadata: deleteMetadata,\n };\n return provider;\n }\n /**\n * Gets the metadata provider for an object. If the object has no metadata provider and this is for a create operation,\n * then this module's metadata provider is assigned to the object.\n */\n function GetMetadataProvider(O, P, Create) {\n var registeredProvider = metadataRegistry.getProvider(O, P);\n if (!IsUndefined(registeredProvider)) {\n return registeredProvider;\n }\n if (Create) {\n if (metadataRegistry.setProvider(O, P, metadataProvider)) {\n return metadataProvider;\n }\n throw new Error(\"Illegal state.\");\n }\n return undefined;\n }\n // naive Map shim\n function CreateMapPolyfill() {\n var cacheSentinel = {};\n var arraySentinel = [];\n var MapIterator = /** @class */ (function () {\n function MapIterator(keys, values, selector) {\n this._index = 0;\n this._keys = keys;\n this._values = values;\n this._selector = selector;\n }\n MapIterator.prototype[\"@@iterator\"] = function () { return this; };\n MapIterator.prototype[iteratorSymbol] = function () { return this; };\n MapIterator.prototype.next = function () {\n var index = this._index;\n if (index >= 0 && index < this._keys.length) {\n var result = this._selector(this._keys[index], this._values[index]);\n if (index + 1 >= this._keys.length) {\n this._index = -1;\n this._keys = arraySentinel;\n this._values = arraySentinel;\n }\n else {\n this._index++;\n }\n return { value: result, done: false };\n }\n return { value: undefined, done: true };\n };\n MapIterator.prototype.throw = function (error) {\n if (this._index >= 0) {\n this._index = -1;\n this._keys = arraySentinel;\n this._values = arraySentinel;\n }\n throw error;\n };\n MapIterator.prototype.return = function (value) {\n if (this._index >= 0) {\n this._index = -1;\n this._keys = arraySentinel;\n this._values = arraySentinel;\n }\n return { value: value, done: true };\n };\n return MapIterator;\n }());\n var Map = /** @class */ (function () {\n function Map() {\n this._keys = [];\n this._values = [];\n this._cacheKey = cacheSentinel;\n this._cacheIndex = -2;\n }\n Object.defineProperty(Map.prototype, \"size\", {\n get: function () { return this._keys.length; },\n enumerable: true,\n configurable: true\n });\n Map.prototype.has = function (key) { return this._find(key, /*insert*/ false) >= 0; };\n Map.prototype.get = function (key) {\n var index = this._find(key, /*insert*/ false);\n return index >= 0 ? this._values[index] : undefined;\n };\n Map.prototype.set = function (key, value) {\n var index = this._find(key, /*insert*/ true);\n this._values[index] = value;\n return this;\n };\n Map.prototype.delete = function (key) {\n var index = this._find(key, /*insert*/ false);\n if (index >= 0) {\n var size = this._keys.length;\n for (var i = index + 1; i < size; i++) {\n this._keys[i - 1] = this._keys[i];\n this._values[i - 1] = this._values[i];\n }\n this._keys.length--;\n this._values.length--;\n if (SameValueZero(key, this._cacheKey)) {\n this._cacheKey = cacheSentinel;\n this._cacheIndex = -2;\n }\n return true;\n }\n return false;\n };\n Map.prototype.clear = function () {\n this._keys.length = 0;\n this._values.length = 0;\n this._cacheKey = cacheSentinel;\n this._cacheIndex = -2;\n };\n Map.prototype.keys = function () { return new MapIterator(this._keys, this._values, getKey); };\n Map.prototype.values = function () { return new MapIterator(this._keys, this._values, getValue); };\n Map.prototype.entries = function () { return new MapIterator(this._keys, this._values, getEntry); };\n Map.prototype[\"@@iterator\"] = function () { return this.entries(); };\n Map.prototype[iteratorSymbol] = function () { return this.entries(); };\n Map.prototype._find = function (key, insert) {\n if (!SameValueZero(this._cacheKey, key)) {\n this._cacheIndex = -1;\n for (var i = 0; i < this._keys.length; i++) {\n if (SameValueZero(this._keys[i], key)) {\n this._cacheIndex = i;\n break;\n }\n }\n }\n if (this._cacheIndex < 0 && insert) {\n this._cacheIndex = this._keys.length;\n this._keys.push(key);\n this._values.push(undefined);\n }\n return this._cacheIndex;\n };\n return Map;\n }());\n return Map;\n function getKey(key, _) {\n return key;\n }\n function getValue(_, value) {\n return value;\n }\n function getEntry(key, value) {\n return [key, value];\n }\n }\n // naive Set shim\n function CreateSetPolyfill() {\n var Set = /** @class */ (function () {\n function Set() {\n this._map = new _Map();\n }\n Object.defineProperty(Set.prototype, \"size\", {\n get: function () { return this._map.size; },\n enumerable: true,\n configurable: true\n });\n Set.prototype.has = function (value) { return this._map.has(value); };\n Set.prototype.add = function (value) { return this._map.set(value, value), this; };\n Set.prototype.delete = function (value) { return this._map.delete(value); };\n Set.prototype.clear = function () { this._map.clear(); };\n Set.prototype.keys = function () { return this._map.keys(); };\n Set.prototype.values = function () { return this._map.keys(); };\n Set.prototype.entries = function () { return this._map.entries(); };\n Set.prototype[\"@@iterator\"] = function () { return this.keys(); };\n Set.prototype[iteratorSymbol] = function () { return this.keys(); };\n return Set;\n }());\n return Set;\n }\n // naive WeakMap shim\n function CreateWeakMapPolyfill() {\n var UUID_SIZE = 16;\n var keys = HashMap.create();\n var rootKey = CreateUniqueKey();\n return /** @class */ (function () {\n function WeakMap() {\n this._key = CreateUniqueKey();\n }\n WeakMap.prototype.has = function (target) {\n var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n return table !== undefined ? HashMap.has(table, this._key) : false;\n };\n WeakMap.prototype.get = function (target) {\n var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n return table !== undefined ? HashMap.get(table, this._key) : undefined;\n };\n WeakMap.prototype.set = function (target, value) {\n var table = GetOrCreateWeakMapTable(target, /*create*/ true);\n table[this._key] = value;\n return this;\n };\n WeakMap.prototype.delete = function (target) {\n var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n return table !== undefined ? delete table[this._key] : false;\n };\n WeakMap.prototype.clear = function () {\n // NOTE: not a real clear, just makes the previous data unreachable\n this._key = CreateUniqueKey();\n };\n return WeakMap;\n }());\n function CreateUniqueKey() {\n var key;\n do\n key = \"@@WeakMap@@\" + CreateUUID();\n while (HashMap.has(keys, key));\n keys[key] = true;\n return key;\n }\n function GetOrCreateWeakMapTable(target, create) {\n if (!hasOwn.call(target, rootKey)) {\n if (!create)\n return undefined;\n Object.defineProperty(target, rootKey, { value: HashMap.create() });\n }\n return target[rootKey];\n }\n function FillRandomBytes(buffer, size) {\n for (var i = 0; i < size; ++i)\n buffer[i] = Math.random() * 0xff | 0;\n return buffer;\n }\n function GenRandomBytes(size) {\n if (typeof Uint8Array === \"function\") {\n var array = new Uint8Array(size);\n if (typeof crypto !== \"undefined\") {\n crypto.getRandomValues(array);\n }\n else if (typeof msCrypto !== \"undefined\") {\n msCrypto.getRandomValues(array);\n }\n else {\n FillRandomBytes(array, size);\n }\n return array;\n }\n return FillRandomBytes(new Array(size), size);\n }\n function CreateUUID() {\n var data = GenRandomBytes(UUID_SIZE);\n // mark as random - RFC 4122 § 4.4\n data[6] = data[6] & 0x4f | 0x40;\n data[8] = data[8] & 0xbf | 0x80;\n var result = \"\";\n for (var offset = 0; offset < UUID_SIZE; ++offset) {\n var byte = data[offset];\n if (offset === 4 || offset === 6 || offset === 8)\n result += \"-\";\n if (byte < 16)\n result += \"0\";\n result += byte.toString(16).toLowerCase();\n }\n return result;\n }\n }\n // uses a heuristic used by v8 and chakra to force an object into dictionary mode.\n function MakeDictionary(obj) {\n obj.__ = undefined;\n delete obj.__;\n return obj;\n }\n });\n})(Reflect || (Reflect = {}));\n","import \"reflect-metadata\";\nimport { z } from \"zod/v4\";\n\n/**\n * Metadata interface for API method decorators\n */\nexport interface MethodMetadata {\n /** Description of the API method */\n description: string;\n /** HTTP verb (GET, POST, PUT, DELETE, etc.) */\n httpVerb: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\";\n /** API endpoint path (e.g., \"/quotes\", \"/payments/session\") */\n endpoint: string;\n /** Zod schema for request input validation */\n inputSchema?: z.ZodSchema;\n /** Zod schema for response output validation */\n outputSchema?: z.ZodSchema;\n}\n\n/**\n * Symbol key for storing API method metadata\n */\nexport const API_METHOD_METADATA_KEY = Symbol(\"api-method-metadata\");\n\n// A global registry that maps endpoint strings (with HTTP verb) to MethodMetadata\nexport const methodMetadataRegistry = new Map<string, MethodMetadata>();\n\n/**\n * @MethodMetadata decorator factory\n * - Attaches `config` to the prototype under MetadataKey.MethodMetadata\n * - Injects a static toJSON(methodName) on the constructor\n */\nexport const MethodMetadata = (config: MethodMetadata) => {\n return (target: object, propertyKey: string | symbol) => {\n // 1) Store metadata on the prototype for this method\n Reflect.defineMetadata(API_METHOD_METADATA_KEY, config, target, propertyKey);\n\n // 2) Store metadata in the global registry\n const httpVerb = config.httpVerb;\n const endpoint = config.endpoint;\n const key = `${httpVerb.toLowerCase()} ${endpoint}`;\n methodMetadataRegistry.set(key, config);\n\n // 3) Inject static toJSON(...) on the class constructor if not already defined\n const ctor = (target as any).constructor as MethodMetadataContainer;\n if (typeof ctor.toJSON !== \"function\") {\n Object.defineProperty(ctor, \"toJSON\", {\n value: (methodName: string): MethodMetadata | undefined => {\n return Reflect.getMetadata(API_METHOD_METADATA_KEY, ctor.prototype, methodName);\n },\n writable: false,\n configurable: false,\n });\n }\n };\n};\n\n/**\n * By declaring this interface, TypeScript knows\n * that any class decorated with @MethodMetadata has a static toJSON method.\n */\nexport interface MethodMetadataContainer {\n new (...args: any[]): unknown;\n toJSON(methodName: string): MethodMetadata | undefined;\n}\n","import { AxiosResponse } from \"axios\";\n\nimport { HALLIDAY_PAYMENTS_API_URL } from \"@shared/constants\";\nimport { methodMetadataRegistry } from \"../decorators\";\n\n/**\n * Configuration options for response validation\n */\nexport interface ResponseValidationOptions {\n /** Whether to enable response validation */\n enabled: boolean;\n /** Enable debug logging */\n debug?: boolean;\n}\n\n/**\n * Default response validation configuration\n */\nexport const defaultValidationOptions: ResponseValidationOptions = {\n enabled: true,\n debug: false,\n};\n\n/**\n * Extracts and normalizes the endpoint from a URL for schema lookup.\n * Handles dynamic path parameters and query strings.\n */\nexport const extractPathname = (url: string, baseUrl: string = HALLIDAY_PAYMENTS_API_URL): string => {\n if (!url) return \"\";\n\n // Remove base URL if present and get just the path\n const urlObj = new URL(url, baseUrl);\n let pathname = urlObj.pathname;\n\n // Strip dynamic segments by removing common patterns\n pathname = pathname\n // Replace UUIDs (e.g., /quotes/unwant/550e8400-e29b-41d4-a716-446655440000 -> /quotes/unwant)\n .replace(/\\/[0-9a-f]{8}\\b-[0-9a-f]{4}\\b-[0-9a-f]{4}\\b-[0-9a-f]{4}\\b-[0-9a-f]{12}/gi, \"\");\n\n return pathname;\n};\n\n/**\n * Validates an API response against its expected schema.\n * Logs warnings if validation fails but doesn't throw errors.\n */\nexport const validateResponse = (\n response: AxiosResponse,\n options: ResponseValidationOptions = defaultValidationOptions\n): void => {\n // Skip validation if disabled\n if (!options.enabled) {\n return;\n }\n\n try {\n const endpoint = extractPathname(response.config.url || \"\");\n if (!endpoint) {\n if (options.debug) {\n console.debug(\"[HallidayPaymentsApiClient] No endpoint found in URL:\", response.config.url);\n }\n return;\n }\n\n const httpVerb = response.config.method?.toLowerCase() || \"get\";\n const key = `${httpVerb} ${endpoint}`;\n const schema = methodMetadataRegistry.get(key)?.outputSchema;\n // Skip validation if no schema is defined for this endpoint\n if (!schema) {\n if (options.debug) {\n console.debug(`[HallidayPaymentsApiClient] No validation schema defined for endpoint: ${endpoint}`);\n }\n return;\n }\n\n // Perform validation\n const result = schema.safeParse(response.data);\n if (!result.success) {\n console.warn(\n `[HallidayPaymentsApiClient] Response validation failed for ${endpoint}. Your SDK version might be outdated - please check for updates.`\n );\n if (options.debug) {\n console.debug(\"[HallidayPaymentsApiClient] Response validation error:\", result.error);\n }\n }\n } catch (error) {\n // Silently fail validation to not break the main application flow\n if (options.debug) {\n console.debug(\"[HallidayPaymentsApiClient] Response validation error:\", error);\n }\n }\n};\n\n/**\n * Creates a response validation interceptor function for axios.\n */\nexport const createResponseValidationInterceptor = (options: ResponseValidationOptions) => {\n return {\n onFulfilled: <T>(response: AxiosResponse<T>): AxiosResponse<T> => {\n validateResponse(response, options);\n return response;\n },\n onRejected: (error: any) => {\n // pass through the error\n throw error;\n },\n };\n};\n","import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from \"axios\";\nimport { ZodError, ZodIssue } from \"zod/v4\";\n\n/**\n * The type of error that can occur in the payments API client.\n * @enum {string}\n * @readonly\n */\nexport enum ErrorCodes {\n /**\n * The error code for zod validation errors.\n * @type {string}\n */\n VALIDATION_ERROR = \"VALIDATION_ERROR\",\n /**\n * The error code for Halliday Payments API business logic errors.\n * @type {string}\n */\n API_ERROR = \"API_ERROR\",\n /**\n * The error code for server 500 errors.\n * @type {string}\n */\n SERVER_ERROR = \"SERVER_ERROR\",\n /**\n * The error code for axios/network errors.\n * @type {string}\n */\n NETWORK_ERROR = \"NETWORK_ERROR\",\n /**\n * The error code for unknown errors.\n * @type {string}\n */\n UNKNOWN_ERROR = \"UNKNOWN_ERROR\",\n}\n\n/**\n * Custom error class for the payments API client.\n * @extends Error\n * @property {string} name - HallidayPaymentsApiClientError.\n * @property {ErrorCodes} code - The error code.\n * @property {string} message - The message of the error.\n * @property {string} validationMessage - The message from zod validation error.\n * @property {ZodError[\"issues\"]} validationIssues - The issues from zod validation error.\n * @property {number} status - The HTTP request status.\n * @property {string} statusText - The HTTP request status text.\n * @property {Record<string, any>} reqHeaders - The HTTP request headers.\n * @property {Record<string, any>} resHeaders - The HTTP response headers.\n * @property {any} data - The response data from the server.\n * @property {AxiosRequestConfig} config - The request configuration.\n * @property {any} request - The request object.\n * @property {AxiosResponse} response - The response object.\n * @property {Error} error - The error object.\n */\nexport class PaymentsApiClientError extends Error {\n name: string = \"HallidayPaymentsApiClientError\";\n code: ErrorCodes;\n message: string;\n\n // Zod Validation Errors\n validationIssues: ZodError[\"issues\"] | null = null;\n validationMessage: ZodError[\"message\"] | string | null = null;\n\n // Axios provided properties\n status: number | null = null;\n statusText: string | null = null;\n reqHeaders: Record<string, any> | null = null;\n resHeaders: Record<string, any> | null = null;\n data: any | null = null;\n config: AxiosRequestConfig | null = null;\n request: any | null = null;\n response: AxiosResponse | null = null;\n\n // Fallback error\n error: Error | any = null;\n\n constructor({\n message,\n code,\n status,\n statusText,\n reqHeaders,\n resHeaders,\n data,\n config,\n request,\n response,\n error,\n validationIssues,\n validationMessage,\n }: {\n message: string;\n code: ErrorCodes;\n status?: number;\n statusText?: string;\n reqHeaders?: Record<string, any>;\n resHeaders?: Record<string, any>;\n data?: any;\n config?: AxiosRequestConfig;\n request?: any;\n response?: AxiosResponse;\n error?: Error;\n validationIssues?: ZodError[\"issues\"] | null;\n validationMessage?: ZodError[\"message\"] | string | null;\n }) {\n super(message);\n this.code = code;\n this.message = message;\n this.status = status ?? null;\n this.statusText = statusText ?? null;\n this.reqHeaders = reqHeaders ?? null;\n this.resHeaders = resHeaders ?? null;\n this.data = data ?? null;\n this.config = config ?? null;\n this.request = request ?? null;\n this.response = response ?? null;\n this.error = error ?? null;\n this.validationIssues = validationIssues ?? null;\n this.validationMessage = validationMessage ?? null;\n\n // Maintains proper prototype chain\n Object.setPrototypeOf(this, PaymentsApiClientError.prototype);\n }\n\n static isPaymentsApiClientError(error: unknown): error is PaymentsApiClientError {\n return error instanceof PaymentsApiClientError;\n }\n\n static parseValidationError({\n message,\n error,\n }: {\n message?: string;\n error?: ZodError | Error;\n }): PaymentsApiClientError {\n const validationMessage = message ?? error?.message ?? \"Validation error\";\n return new PaymentsApiClientError({\n message: validationMessage,\n code: ErrorCodes.VALIDATION_ERROR,\n validationIssues: error instanceof ZodError ? error.issues : null,\n validationMessage: error instanceof ZodError ? error.message : null,\n error,\n });\n }\n\n static parseAxiosError(error: AxiosError): PaymentsApiClientError | null {\n if (error.response) {\n const errorStatus = error.response.status;\n let errorsFromResponse: string | string[] | ZodIssue[] = (error.response.data as any)?.errors || [];\n let validationIssues: ZodIssue[] | null = null;\n if (!Array.isArray(errorsFromResponse)) {\n errorsFromResponse = [errorsFromResponse];\n }\n\n let errorMessages =\n errorsFromResponse\n .map((errorFromResponse: string | object) => {\n if (typeof errorFromResponse !== \"string\") {\n return JSON.stringify(errorFromResponse);\n }\n return errorFromResponse;\n })\n .join(\"\\n\") ||\n error.message ||\n \"Unknown error\";\n let statusText = error.response?.statusText;\n\n if (errorStatus === 500) {\n return new PaymentsApiClientError({\n message: errorMessages,\n code: ErrorCodes.SERVER_ERROR,\n status: 500,\n statusText: `${error.code ?? \"500\"}: ${statusText ?? \"Server Error\"}`,\n data: error.response?.data,\n config: error.config,\n request: error.request,\n response: error.response,\n reqHeaders: error.request?.headers,\n resHeaders: error.response?.headers,\n });\n } else if (errorStatus === 400) {\n errorMessages = `Bad request: ${errorMessages}`;\n statusText = `${error.code ?? \"400\"}: ${statusText ?? \"Bad Request\"}`;\n validationIssues = errorsFromResponse as ZodIssue[];\n } else if (errorStatus === 401) {\n errorMessages = `Unauthorized: ${errorMessages}`;\n statusText = `${error.code ?? \"401\"}: ${statusText ?? \"Unauthorized\"}`;\n } else if (errorStatus === 403) {\n errorMessages = `Forbidden: ${errorMessages}`;\n statusText = `${error.code ?? \"403\"}: ${statusText ?? \"Forbidden\"}`;\n } else if (errorStatus === 404) {\n errorMessages = `Resource not found: ${errorMessages}`;\n statusText = `${error.code ?? \"404\"}: ${statusText ?? \"Not Found\"}`;\n } else {\n errorMessages = `Request failed with status ${errorStatus}: ${errorMessages}`;\n statusText = `${error.code ?? errorStatus}: ${statusText ?? \"Unexpected error\"}`;\n }\n return new PaymentsApiClientError({\n message: errorMessages,\n code: ErrorCodes.API_ERROR,\n status: errorStatus,\n statusText,\n data: error.response?.data,\n config: error.config,\n request: error.request,\n response: error.response,\n reqHeaders: error.request?.headers,\n resHeaders: error.response?.headers,\n validationIssues,\n });\n } else if (error.request) {\n return new PaymentsApiClientError({\n message: error.message || `No response received from the server: ${error.code}`,\n code: ErrorCodes.NETWORK_ERROR,\n config: error.config,\n request: error.request,\n reqHeaders: error.request?.headers,\n });\n } else {\n // Aborted requests are not errors, handle it gracefully\n if (error.code === \"ERR_CANCELED\") {\n return null;\n }\n return new PaymentsApiClientError({\n message: `${error.code ? `${error.code}: ` : \"\"}${error.message || \"No message\"}`,\n code: ErrorCodes.NETWORK_ERROR,\n config: error.config,\n request: error.request,\n error,\n });\n }\n }\n\n toJSON(): string {\n return JSON.stringify({\n name: this.name,\n code: this.code,\n message: this.message,\n validationIssues: this.validationIssues,\n status: this.status,\n statusText: this.statusText,\n config: this.config,\n stack: this.stack,\n });\n }\n}\n\n/**\n * Creates a response error interceptor for axios.\n */\nexport const createErrorInterceptor = () => {\n return {\n onFulfilled: <T>(response: AxiosResponse<T>): AxiosResponse<T> => {\n // Pass through the response\n return response;\n },\n onRejected: (error: any) => {\n if (axios.isAxiosError(error)) {\n const newError = PaymentsApiClientError.parseAxiosError(error);\n if (newError) throw newError;\n return { data: null };\n } else {\n throw new PaymentsApiClientError({\n message: error.message || `Unknown error`,\n code: ErrorCodes.UNKNOWN_ERROR,\n error,\n });\n }\n },\n };\n};\n","import axios from \"axios\";\n\nimport { API_DOMAIN_REGEX, HALLIDAY_PAYMENTS_API_URL } from \"@shared/constants\";\nimport { HSON } from \"../hson\";\nimport {\n ResponseValidationOptions,\n defaultValidationOptions,\n createResponseValidationInterceptor,\n} from \"./responseValidationInterceptor\";\nimport { createErrorInterceptor, PaymentsApiClientError, ErrorCodes } from \"./errorInterceptor\";\n\nexport { PaymentsApiClientError, defaultValidationOptions, ErrorCodes, ResponseValidationOptions };\n\n/**\n * Creates a new axios instance with the given options.\n * @param {Object} options The options for the axios instance.\n * @param {!string} options.apiKey {string} The API key for the axios instance.\n * @param {string=} options.baseUrl {string} The base URL for the axios instance.\n * @param {ResponseValidationOptions=} options.responseValidationOptions {@link ResponseValidationOptions} The options for the response validation interceptor.\n * @returns {AxiosInstance} The axios instance.\n */\nconst createAxiosApiClient = ({\n apiKey,\n baseUrl = HALLIDAY_PAYMENTS_API_URL,\n responseValidationOptions = defaultValidationOptions,\n}: {\n apiKey: string;\n baseUrl?: string;\n responseValidationOptions?: ResponseValidationOptions;\n}) => {\n if (!API_DOMAIN_REGEX.test(baseUrl)) {\n throw new Error(`Invalid base URL: ${baseUrl}`);\n }\n if (!apiKey) {\n throw new Error(\"API key is required\");\n }\n\n const instance = axios.create({\n baseURL: baseUrl,\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${apiKey}`,\n },\n parseReviver: HSON.reviver,\n });\n\n // Add response validation interceptor\n const validationInterceptor = createResponseValidationInterceptor(responseValidationOptions);\n instance.interceptors.response.use(validationInterceptor.onFulfilled, validationInterceptor.onRejected);\n\n // Add error interceptor\n const errorInterceptor = createErrorInterceptor();\n instance.interceptors.response.use(errorInterceptor.onFulfilled, errorInterceptor.onRejected);\n\n return instance;\n};\n\nexport default createAxiosApiClient;\n","import { AssetFilters } from \"./types\";\n\nexport const getQueryParamsFromAssetFilters = (filters: AssetFilters): string => {\n return Object.entries(filters)\n .reduce((acc, [key, value]) => {\n if (key === \"sandbox\") {\n acc.push(`sandbox=${value === true ? \"true\" : \"false\"}`);\n } else if (Array.isArray(value)) {\n for (const valueItem of value) {\n acc.push(`${key}[]=${valueItem}`);\n }\n } else {\n acc.push(`${key}=${value}`);\n }\n return acc;\n }, [] as string[])\n .join(\"&\");\n};\n","import { z } from \"zod/v4\";\n\nimport { Address, Amount, Asset, Fiat, OnrampMethod, RampName, Token, TokenPointer } from \"@shared/types\";\nimport { UUID_REGEX } from \"@shared/constants\";\n\nexport const PaymentId = z.string().refine((id) => UUID_REGEX.test(id), {\n message: \"Invalid payment ID\",\n});\nexport type PaymentId = z.infer<typeof PaymentId>;\n\nconst BaseAssetFilters = z.object({\n onramps: z.array(RampName).optional(),\n offramps: z.array(RampName).optional(),\n sandbox: z.boolean().optional().default(false),\n});\n\nexport const InputsAssetFilters = BaseAssetFilters.extend({\n inputs: z.array(Asset).optional(),\n outputs: z.array(Asset),\n});\nexport type InputsAssetFilters = z.input<typeof InputsAssetFilters>;\n\nexport const OutputsAssetFilters = BaseAssetFilters.extend({\n inputs: z.array(Asset),\n outputs: z.array(Asset).optional(),\n});\nexport type OutputsAssetFilters = z.input<typeof OutputsAssetFilters>;\n\nexport const AssetFilters = z.union([InputsAssetFilters, OutputsAssetFilters]);\nexport type AssetFilters = z.infer<typeof AssetFilters>;\n\nconst AssetAmount = z.object({\n asset: Asset,\n amount: Amount,\n});\ntype AssetAmount = z.infer<typeof AssetAmount>;\n\nconst TokenAmount = z.object({\n token: Token,\n amount: Amount,\n});\ntype TokenAmount = z.infer<typeof TokenAmount>;\n\nconst Signature = z.string();\ntype Signature = z.infer<typeof Signature>;\n\nexport const IPAddressOverride = z.union([z.ipv4(), z.ipv6()]);\n\nconst BaseQuoteRequest = z.object({\n price_currency: Fiat,\n\n // onramp filters\n onramps: z.array(RampName).optional(),\n onramp_methods: z.array(OnrampMethod).optional(),\n\n // XXX add offramp filters\n\n // optional customer information\n customer_ip_address: z.string().optional(),\n customer_id: z.string().optional(),\n\n // optional parent payment ID for re-quote\n parent_payment_id: PaymentId.optional(),\n});\n\nconst FixedInput = z.object({\n kind: z.literal(\"FIXED_INPUT\"),\n fixed_input_amount: AssetAmount,\n output_asset: Asset,\n});\ntype FixedInput = z.infer<typeof FixedInput>;\n\n// TODO: uncomment this when we support FIXED_OUTPUT quotes\n// const FixedOutput = z.object({\n// kind: z.literal(\"FIXED_OUTPUT\"),\n// input_asset: Asset,\n// fixed_output_amount: AssetAmount,\n// });\n// type FixedOutput = z.infer<typeof FixedOutput>;\n\nconst FixedRequest = z.discriminatedUnion(\"kind\", [FixedInput]);\n\nexport const RequestForQuotes = BaseQuoteRequest.extend({\n request: FixedRequest,\n});\nexport type RequestForQuotes = z.infer<typeof RequestForQuotes>;\n\n// Status\nexport const Account = z.enum([\"USER\", \"DEST\", \"HALLIDAY\", \"SPW\", \"REV_SHARE\", \"BRIDGE\"]);\nexport type Account = z.infer<typeof Account>;\n\nconst Property = z.enum([\"APPROVAL\", \"BALANCE\"]);\ntype Property = z.infer<typeof Property>;\nconst Resource = z.object({\n asset: Asset,\n property: Property,\n});\ntype Resource = z.infer<typeof Resource>;\n\nconst ChangeStructure = z.object({\n account: Account,\n resource: Resource,\n});\ntype ChangeStructure = z.infer<typeof ChangeStructure>;\n\nconst TerminalObservedStatus = z.union([z.literal(\"COMPLETE\"), z.literal(\"UNREACHABLE\"), z.literal(\"FAILED\")]);\ntype TerminalObservedStatus = z.infer<typeof TerminalObservedStatus>;\nconst NonTerminalObservedStatus = z.literal(\"PENDING\");\ntype NonTerminalObservedStatus = z.infer<typeof NonTerminalObservedStatus>;\nexport const ObservedStatus = z.union([TerminalObservedStatus, NonTerminalObservedStatus]);\nexport type ObservedStatus = z.infer<typeof ObservedStatus>;\n\nconst WorkflowStatus = z.enum([\"PENDING\", \"COMPLETE\", \"FAILED\", \"EXPIRED\", \"WITHDRAWN\", \"TAINTED\"]);\ntype WorkflowStatus = z.infer<typeof WorkflowStatus>;\n\nconst EffectStructure = z.object({\n consume: z.array(ChangeStructure),\n produce: z.array(ChangeStructure),\n});\ntype EffectStructure = z.infer<typeof EffectStructure>;\n\nexport const ChangeAmount = ChangeStructure.extend({\n amount: Amount,\n});\nexport type ChangeAmount = z.infer<typeof ChangeAmount>;\n\nconst EffectAmount = EffectStructure.extend({\n consume: z.array(ChangeAmount),\n produce: z.array(ChangeAmount),\n});\ntype EffectAmount = z.infer<typeof EffectAmount>;\n\nexport const Prices = z.record(Asset, z.string());\nexport type Prices = z.infer<typeof Prices>;\n\nconst AmountIssue = z.object({\n kind: z.union([z.literal(\"amount\"), z.literal(\"amount-downstream\")]),\n given: z.string(),\n limits: z.object({\n min: z.string().optional(),\n max: z.string().optional(),\n }),\n source: z.string(),\n message: z.string(),\n});\ntype AmountIssue = z.infer<typeof AmountIssue>;\n\nconst GeoLocationIssue = z.object({\n kind: z.literal(\"geolocation\"),\n message: z.string(),\n});\ntype GeoLocationIssue = z.infer<typeof GeoLocationIssue>;\n\nconst ProviderIssue = z.object({\n kind: z.literal(\"provider\"),\n message: z.string(),\n});\ntype ProviderIssue = z.infer<typeof ProviderIssue>;\n\nconst OtherIssue = z.object({\n kind: z.literal(\"other\"),\n message: z.string(),\n});\ntype OtherIssue = z.infer<typeof OtherIssue>;\n\nconst UnknownIssue = z.object({\n kind: z.literal(\"unknown\"),\n message: z.string(),\n});\ntype UnknownIssue = z.infer<typeof UnknownIssue>;\n\nexport const Issue = z.discriminatedUnion(\"kind\", [\n AmountIssue,\n GeoLocationIssue,\n ProviderIssue,\n OtherIssue,\n UnknownIssue,\n]);\nexport type Issue = z.infer<typeof Issue>;\n\nexport const Failure = z.object({\n service_ids: z.array(z.string()),\n latency_seconds: z.number(),\n issues: z.array(Issue).optional(),\n});\nexport type Failure = z.infer<typeof Failure>;\n\nexport const RouteType = z.union([z.literal(\"USER_FUND\"), z.literal(\"ONCHAIN_STEP\"), z.literal(\"ONRAMP\")]);\nexport type RouteType = z.infer<typeof RouteType>;\n\nexport const QuotedRoute = z.object({\n type: RouteType,\n net_effect: EffectAmount,\n pieces_info: z.array(\n z.object({\n type: z.union([\n z.literal(\"onramp\"),\n z.literal(\"poll\"),\n z.literal(\"bridge\"),\n z.literal(\"rev_share\"),\n z.literal(\"transfer_out\"),\n z.literal(\"convert\"),\n ]),\n })\n ),\n step_index: z.number().optional(),\n});\nexport type QuotedRoute = z.infer<typeof QuotedRoute>;\n\nexport const Quote = z.object({\n payment_id: z.string(),\n output_amount: z.object({\n asset: Asset,\n amount: z.string(),\n }),\n onramp: RampName.optional(),\n onramp_method: OnrampMethod.optional(),\n fees: z.object({\n total_fees: z.string(),\n conversion_fees: z.string(),\n network_fees: z.string(),\n business_fees: z.string(),\n currency_symbol: Fiat,\n }),\n route: z.array(QuotedRoute),\n});\nexport type Quote = z.infer<typeof Quote>;\n\nexport const FulfillmentRoute = QuotedRoute.extend({\n status: ObservedStatus,\n transaction_hash: z.string().optional(),\n});\nexport type FulfillmentRoute = z.infer<typeof FulfillmentRoute>;\n\nexport const Fulfillment = Quote.omit({\n payment_id: true,\n})\n .partial({\n output_amount: true,\n onramp: true,\n onramp_method: true,\n fees: true,\n })\n .extend({\n route: z.array(FulfillmentRoute),\n });\n\nexport type Fulfillment = z.infer<typeof Fulfillment>;\n\nexport const QuotesResponse = z.object({\n quote_request: RequestForQuotes,\n quotes: z.array(Quote),\n current_prices: Prices,\n price_currency: Fiat,\n state_token: z.string(),\n quoted_at: z.string(),\n accept_by: z.string(),\n failures: z.array(Failure),\n});\nexport type QuotesResponse = z.infer<typeof QuotesResponse>;\n\nexport const RequestForConfirmQuote = z.object({\n payment_id: PaymentId,\n state_token: z.string(),\n owner_address: Address,\n destination_address: Address,\n client_redirect_url: z.string().optional(),\n});\nexport type RequestForConfirmQuote = z.infer<typeof RequestForConfirmQuote>;\n\nexport const DepositInfo = z.object({\n deposit_token: Token,\n deposit_chain: z.string(),\n deposit_amount: Amount,\n deposit_address: Address,\n});\nexport type DepositInfo = z.infer<typeof DepositInfo>;\n\nexport const NextInstruction = z.object({\n type: z.enum([\"ONRAMP\", \"TRANSFER_IN\"]),\n payment_id: PaymentId,\n funding_page_url: z.url(),\n deposit_info: z.array(DepositInfo),\n});\nexport type NextInstruction = z.infer<typeof NextInstruction>;\n\nexport const ConfirmQuoteResponse = z.object({\n payment_id: PaymentId,\n status: WorkflowStatus,\n funded: z.boolean(),\n created_at: z.string(),\n updated_at: z.string(),\n initiate_fund_by: z.string(),\n completed_at: z.string().optional(),\n quote_request: RequestForQuotes,\n quoted: Quote.omit({\n payment_id: true,\n }),\n fulfilled: Fulfillment,\n current_prices: Prices,\n price_currency: Fiat,\n customer_id: z.string().optional(),\n processing_addresses: z.array(\n z.object({\n address: Address,\n chain: z.string(),\n })\n ),\n owner_address: Address,\n destination_address: Address,\n next_instruction: NextInstruction.optional(),\n parent_payment_id: PaymentId.optional(),\n});\nexport type ConfirmQuoteResponse = z.infer<typeof ConfirmQuoteResponse>;\n\nexport const PaymentStatus = ConfirmQuoteResponse;\nexport type PaymentStatus = z.infer<typeof PaymentStatus>;\n\nexport const RequestForOnrampSession = z.object({\n payment_id: PaymentId,\n redirect_url: z.string().optional(),\n});\nexport type RequestForOnrampSession = z.infer<typeof RequestForOnrampSession>;\n\nexport const OnrampSessionResponse = z.object({\n funding_page_onramp_url: z.string(),\n client_redirect_url: z.string().optional(),\n client_secret: z.string().optional(),\n});\nexport type OnrampSessionResponse = z.infer<typeof OnrampSessionResponse>;\n\nexport const RequestForPaymentsHistory = z.object({\n id_query: z.string().optional(),\n pagination_key: z.string().optional(),\n dest_address: Address.optional(),\n owner_address: Address.optional(),\n limit: z.number().int().positive().optional(),\n category: z.enum([\"ALL\", \"NEW_OR_FUNDED\"]).optional(),\n});\nexport type RequestForPaymentsHistory = z.infer<typeof RequestForPaymentsHistory>;\n\nexport const PaymentHistoryResult = z.object({\n payment_statuses: z.array(PaymentStatus),\n next_pagination_key: z.string().nullable(),\n});\nexport type PaymentHistoryResult = z.infer<typeof PaymentHistoryResult>;\n\nexport const RequestForBalance = z\n .object({\n payment_id: PaymentId.optional(),\n custom_queries: z\n .array(\n z.object({\n address: Address,\n token: z.union([Token, TokenPointer]),\n })\n )\n .optional(),\n })\n .refine(\n (data) => {\n if (!data.payment_id && !data.custom_queries?.length) {\n return false;\n }\n return true;\n },\n {\n message: \"payment_id or custom_queries is required\",\n }\n );\nexport type RequestForBalance = z.infer<typeof RequestForBalance>;\n\nexport const BalanceResponse = z.object({\n balance_results: z.array(\n z.object({\n address: Address,\n token: Token,\n value: z.discriminatedUnion(\"kind\", [\n z.object({\n kind: z.literal(\"amount\"),\n amount: Amount,\n }),\n z.object({\n kind: z.literal(\"error\"),\n }),\n ]),\n })\n ),\n});\nexport type BalanceResponse = z.infer<typeof BalanceResponse>;\n\nexport const RequestForPrices = z.object({\n fiat: Fiat,\n tokens: z.array(Token),\n});\nexport type RequestForPrices = z.infer<typeof RequestForPrices>;\n\nexport const TypedData = z.string();\nexport type TypedData = z.infer<typeof TypedData>;\n\nexport const RequestForWithdrawAuthorization = z.object({\n payment_id: PaymentId,\n token_amounts: z.array(TokenAmount),\n recipient_address: Address,\n});\nexport type RequestForWithdrawAuthorization = z.infer<typeof RequestForWithdrawAuthorization>;\n\nexport const WithdrawAuthorizationResponse = z.object({\n payment_id: PaymentId,\n withdraw_authorization: TypedData,\n});\nexport type WithdrawAuthorizationResponse = z.infer<typeof WithdrawAuthorizationResponse>;\n\nexport const RequestForWithdraw = RequestForWithdrawAuthorization.extend({\n owner_signature: Signature,\n});\nexport type RequestForWithdraw = z.infer<typeof RequestForWithdraw>;\n\nexport const WithdrawResponse = z.object({\n payment_id: PaymentId,\n transaction_hash: z.string(),\n});\nexport type WithdrawResponse = z.infer<typeof WithdrawResponse>;\n","import { z, ZodError } from \"zod/v4\";\n\nimport { HALLIDAY_PAYMENTS_API_URL } from \"@shared/constants\";\nimport { RampName, ChainConfig, Asset, Fiat, Token, AssetDetails } from \"@shared/types\";\n\nimport createAxiosApiClient, {\n PaymentsApiClientError,\n ResponseValidationOptions,\n defaultValidationOptions,\n} from \"./axios\";\nimport { getQueryParamsFromAssetFilters } from \"./utils\";\nimport {\n ConfirmQuoteResponse,\n BalanceResponse,\n InputsAssetFilters,\n OutputsAssetFilters,\n OnrampSessionResponse,\n PaymentStatus,\n PaymentHistoryResult,\n Prices,\n QuotesResponse,\n RequestForConfirmQuote,\n RequestForBalance,\n RequestForOnrampSession,\n RequestForPaymentsHistory,\n RequestForPrices,\n RequestForQuotes,\n RequestForWithdraw,\n RequestForWithdrawAuthorization,\n WithdrawAuthorizationResponse,\n WithdrawResponse,\n PaymentId,\n} from \"./types\";\nimport { MethodMetadata, API_METHOD_METADATA_KEY } from \"./decorators\";\n\n/**\n * Configuration options for the PaymentsApiClient.\n */\nexport interface PaymentsApiClientOptions {\n /** Your API key for authentication */\n apiKey: string;\n /** Optional base URL for the API. Defaults to HALLIDAY_PAYMENTS_API_URL */\n baseUrl?: string;\n /** Response validation configuration */\n responseValidation?: ResponseValidationOptions;\n}\n\n/**\n * Payments API client for interacting with the Halliday Payments API.\n *\n * This client handles API requests including setting the required headers and\n * managing the API key for authentication. It also validates API responses\n * to help detect when the SDK version might be outdated.\n */\nclass PaymentsApiClient {\n /**\n * Axios API client instance.\n * @private\n */\n private apiClient: ReturnType<typeof createAxiosApiClient>;\n\n /**\n * Creates an instance of PaymentsAPIClient.\n *\n * @param {PaymentsApiClientOptions} options The configuration options for the client.\n * @param {!string} options.apiKey {string} The API key for authentication.\n * @param {string=} options.baseUrl {string} (optional) The base URL for the API.\n * @param {ResponseValidationOptions=} options.responseValidation {@link ResponseValidationOptions} (optional) Response validation helps checking response data format from Halliday payments API\n * and notifies if changes detected. It is enabled by default, turn it off by:\n * @example\n * { apiKey: \"YOUR_API_KEY\", responseValidation: { enabled: false } }\n */\n constructor(options: PaymentsApiClientOptions) {\n const { apiKey, baseUrl = HALLIDAY_PAYMENTS_API_URL, responseValidation = {} } = options;\n\n // Merge response validation options with defaults\n const responseValidationOptions: ResponseValidationOptions = {\n ...defaultValidationOptions,\n ...responseValidation,\n };\n\n this.apiClient = createAxiosApiClient({\n baseUrl,\n apiKey,\n responseValidationOptions,\n });\n }\n\n /**\n * Retrieves the supported chain configuration.\n *\n * @param {boolean} sandbox {boolean} Whether to retrieve chains in the sandbox environment.\n * @returns {Promise<Record<string, ChainConfig>>} A promise that resolves to a mapping from network to their {@link ChainConfig chain configurations}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Retrieves the supported chain configuration.\",\n httpVerb: \"GET\",\n endpoint: \"/chains\",\n inputSchema: z.boolean().optional(),\n outputSchema: z.record(z.string(), ChainConfig),\n })\n getChains = async (sandbox: boolean = false): Promise<Record<string, ChainConfig>> => {\n const { data: chainConfigs } = await this.apiClient.get<Record<string, ChainConfig>>(\n `/chains?sandbox=${sandbox ? \"true\" : \"false\"}`\n );\n return chainConfigs;\n };\n\n /**\n * Retrieves the asset details for all or the specified assets.\n *\n * @param {Asset[]=} assets {{@link Asset}[]} (optional) The assets to retrieve the details for.\n * @param {!boolean} sandbox {boolean} Whether to retrieve testnet assets in the response.\n * @returns {Promise<Record<Asset, AssetDetails>>} A promise that resolves to a mapping from {@link Asset asset} to {@link AssetDetails asset details}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Retrieves the asset details for all or the specified assets.\",\n httpVerb: \"GET\",\n endpoint: \"/assets\",\n inputSchema: z.object({\n assets: z.array(Asset).optional(),\n sandbox: z.boolean().optional(),\n }),\n outputSchema: z.record(Asset, AssetDetails),\n })\n getAssetDetails = async ({\n assets = [],\n sandbox,\n }: {\n assets?: Asset[];\n sandbox: boolean;\n }): Promise<Record<Asset, AssetDetails>> => {\n if (typeof sandbox !== \"boolean\") {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid sandbox value\",\n });\n }\n\n let queryParams = `sandbox=${sandbox}`;\n if (assets) {\n if (!Array.isArray(assets)) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid assets\",\n });\n }\n for (const asset of assets) {\n try {\n const validAsset = Asset.parse(asset);\n queryParams += `&assets[]=${validAsset}`;\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: `Invalid asset: ${asset}`,\n error: error as ZodError,\n });\n }\n }\n }\n\n const response = await this.apiClient.get<Record<Asset, AssetDetails>>(`/assets?${queryParams}`);\n return response.data;\n };\n\n /**\n * Retrieves the supported inputs for the specified filters.\n *\n * @param {AssetFilters} filters Filters to apply to the inputs.\n * @param {Asset[]=} filters.inputs {{@link Asset}[]} (optional) The input assets to be included in the response.\n * @param {!Asset[]} filters.outputs {{@link Asset}[]} The output assets to retrieve inputs for.\n * @param {!boolean} filters.sandbox {boolean} Whether to retrieve assets in the sandbox environment.\n * @param {RampName[]=} filters.onramps {{@link RampName}[]} (optional) The onramp providers that can be used to accept the inputs.\n * @param {RampName[]=} filters.offramps {{@link RampName}[]} (optional) The offramp providers that can be used to deliver the inputs.\n * @returns {Promise<Record<Asset, { fiats: Fiat[]; tokens: Token[] }>>} A mapping from output {@link Asset assets} to their corresponding input {@link Fiat fiats} and {@link Token tokens}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Retrieves the supported inputs for the specified filters.\",\n httpVerb: \"GET\",\n endpoint: \"/assets/available-inputs\",\n inputSchema: InputsAssetFilters,\n outputSchema: z.record(Asset, z.object({ fiats: z.array(Fiat), tokens: z.array(Token) })),\n })\n getInputs = async (filters: InputsAssetFilters): Promise<Record<Asset, { fiats: Fiat[]; tokens: Token[] }>> => {\n let queryParams: string;\n try {\n const validAssetFilters = InputsAssetFilters.parse(filters);\n queryParams = getQueryParamsFromAssetFilters(validAssetFilters);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid asset filters\",\n error: error as ZodError | Error,\n });\n }\n const response = await this.apiClient.get<Record<Asset, { fiats: Fiat[]; tokens: Token[] }>>(\n `/assets/available-inputs?${queryParams}`\n );\n return response.data;\n };\n\n /**\n * Retrieves the supported outputs for the specified filters.\n *\n * @param {AssetFilters} filters Filters to apply to the outputs.\n * @param {!Asset[]} filters.inputs {{@link Asset}[]} The input assets to retrieve outputs for.\n * @param {Asset[]=} filters.outputs {{@link Asset}[]} (optional) The output assets to be included in the response.\n * @param {!boolean} filters.sandbox {boolean} Whether to retrieve assets in the sandbox environment.\n * @param {RampName[]=} filters.onramps {{@link RampName}[]} (optional) The onramp providers that can be used to accept the inputs.\n * @param {RampName[]=} filters.offramps {{@link RampName}[]} (optional) The offramp providers that can be used to deliver the outputs.\n * @returns {Promise<Record<Asset, { fiats: Fiat[]; tokens: Token[] }>>} A mapping from input {@link Asset assets} to their corresponding output {@link Fiat fiats} and {@link Token tokens}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Retrieves the supported outputs for the specified filters.\",\n httpVerb: \"GET\",\n endpoint: \"/assets/available-outputs\",\n inputSchema: OutputsAssetFilters,\n outputSchema: z.record(Asset, z.object({ fiats: z.array(Fiat), tokens: z.array(Token) })),\n })\n getOutputs = async (filters: OutputsAssetFilters): Promise<Record<Asset, { fiats: Fiat[]; tokens: Token[] }>> => {\n let queryParams: string;\n try {\n const validAssetFilters = OutputsAssetFilters.parse(filters);\n queryParams = getQueryParamsFromAssetFilters(validAssetFilters);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid asset filters\",\n error: error as ZodError | Error,\n });\n }\n const response = await this.apiClient.get<Record<Asset, { fiats: Fiat[]; tokens: Token[] }>>(\n `/assets/available-outputs?${queryParams}`\n );\n return response.data;\n };\n\n /**\n * Retrieves quotes for the given input and output asset.\n *\n * @param {!RequestForQuotes} request {{@link RequestForQuotes}} The request for quotes.\n * @returns {Promise<QuotesResponse>} A promise that resolves to the {@link QuotesResponse quotes}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Retrieves quotes for the given input and output asset.\",\n httpVerb: \"POST\",\n endpoint: \"/payments/quotes\",\n inputSchema: RequestForQuotes,\n outputSchema: QuotesResponse,\n })\n getQuotes = async (request: RequestForQuotes, signal?: AbortSignal): Promise<QuotesResponse> => {\n let validatedRequestForQuotes;\n try {\n validatedRequestForQuotes = RequestForQuotes.parse(request);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid request for quotes\",\n error: error as ZodError,\n });\n }\n const response = await this.apiClient.post<QuotesResponse>(\"/payments/quotes\", validatedRequestForQuotes, {\n signal,\n });\n return response.data;\n };\n\n /**\n * Confirms a quote.\n *\n * @param {!RequestForConfirmQuote} request {{@link RequestForConfirmQuote}} The quote to accept.\n * @returns {Promise<ConfirmQuoteResponse>} A promise that resolves to the {@link ConfirmQuoteResponse accepted quote details}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Confirms a quote.\",\n httpVerb: \"POST\",\n endpoint: \"/payments/confirm\",\n inputSchema: RequestForConfirmQuote,\n outputSchema: ConfirmQuoteResponse,\n })\n confirmQuote = async (requestForConfirmQuote: RequestForConfirmQuote): Promise<ConfirmQuoteResponse> => {\n let validatedRequestForConfirmQuote;\n try {\n validatedRequestForConfirmQuote = RequestForConfirmQuote.parse(requestForConfirmQuote);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid request for confirming quote\",\n error: error as ZodError,\n });\n }\n const response = await this.apiClient.post<ConfirmQuoteResponse>(\n \"/payments/confirm\",\n validatedRequestForConfirmQuote\n );\n return response.data;\n };\n\n /**\n * Creates a onramp provider session for a given payment.\n *\n * @param {!RequestForOnrampSession} request {{@link RequestForOnrampSession}} The request for the payment session.\n * @returns {Promise<OnrampSessionResponse>} A promise that resolves to the {@link OnrampSessionResponse session}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Creates a onramp provider session for a given payment.\",\n httpVerb: \"POST\",\n endpoint: \"/onramp\",\n inputSchema: RequestForOnrampSession,\n outputSchema: OnrampSessionResponse,\n })\n createPaymentSession = async (request: RequestForOnrampSession): Promise<OnrampSessionResponse> => {\n let validatedRequest;\n try {\n validatedRequest = RequestForOnrampSession.parse(request);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid request for onramp session\",\n error: error as ZodError,\n });\n }\n const response = await this.apiClient.post<OnrampSessionResponse>(`/onramp`, validatedRequest);\n return response.data;\n };\n\n /**\n * Retrieves the status of a given payment.\n *\n * @param {!PaymentId} payment_id {{@link PaymentId}} The payment ID of the payment to retrieve the status of.\n * @param {AbortSignal=} signal {{@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal AbortSignal}} (optional) Checkout {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortController AbortController} if need to abort the request.\n * @returns {Promise<PaymentStatus | null>} A promise that resolves to {@link PaymentStatus} or null if the request is aborted.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Retrieves the status of a given payment.\",\n httpVerb: \"GET\",\n endpoint: \"/payments\",\n inputSchema: PaymentId,\n outputSchema: PaymentStatus,\n })\n getStatus = async (paymentId: PaymentId, signal?: AbortSignal): Promise<PaymentStatus | null> => {\n try {\n PaymentId.parse(paymentId);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid payment ID\",\n error: error as ZodError,\n });\n }\n const searchParams = new URLSearchParams();\n searchParams.set(\"payment_id\", paymentId);\n const searchParamsString = searchParams.toString();\n\n const response = await this.apiClient.get<PaymentStatus>(`/payments?${searchParamsString}`, { signal });\n return response.data;\n };\n\n /**\n * Retrieves the payments history.\n *\n * @param {RequestForPaymentsHistory} request {{@link RequestForPaymentsHistory}} The request for the payments history.\n * @returns {Promise<PaymentHistoryResult>} A promise that resolves to the {@link PaymentHistoryResult history}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Retrieves the payments history of a given destination address.\",\n httpVerb: \"GET\",\n endpoint: \"/payments/history\",\n inputSchema: RequestForPaymentsHistory,\n outputSchema: PaymentHistoryResult,\n })\n getPaymentsHistory = async (request: RequestForPaymentsHistory): Promise<PaymentHistoryResult> => {\n let validatedRequest;\n try {\n validatedRequest = RequestForPaymentsHistory.parse(request);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid request for payments\",\n error: error as ZodError,\n });\n }\n const queryParams = new URLSearchParams();\n if (validatedRequest.id_query) {\n queryParams.set(\"id_query\", validatedRequest.id_query);\n }\n if (validatedRequest.pagination_key) {\n queryParams.set(\"pagination_key\", validatedRequest.pagination_key);\n }\n if (validatedRequest.dest_address) {\n queryParams.set(\"dest_address\", validatedRequest.dest_address);\n }\n if (validatedRequest.owner_address) {\n queryParams.set(\"owner_address\", validatedRequest.owner_address);\n }\n if (validatedRequest.limit) {\n queryParams.set(\"limit\", validatedRequest.limit.toString());\n }\n if (validatedRequest.category) {\n queryParams.set(\"category\", validatedRequest.category);\n }\n let queryParamsString = queryParams.toString();\n if (queryParamsString) queryParamsString = `?${queryParamsString}`;\n const response = await this.apiClient.get<PaymentHistoryResult>(`/payments/history${queryParamsString}`);\n return response.data;\n };\n\n @MethodMetadata({\n description: \"Retrieves the balance of a given workflow or spw address.\",\n httpVerb: \"POST\",\n endpoint: \"/payments/balances\",\n inputSchema: RequestForBalance,\n outputSchema: BalanceResponse,\n })\n getBalance = async (request: RequestForBalance): Promise<BalanceResponse> => {\n let validatedRequest;\n try {\n validatedRequest = RequestForBalance.parse(request);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid request for balance\",\n error: error as ZodError,\n });\n }\n const response = await this.apiClient.post<BalanceResponse>(`/payments/balances`, validatedRequest);\n return response.data;\n };\n\n @MethodMetadata({\n description: \"Retrieves the prices tokens in a given fiat currency.\",\n httpVerb: \"POST\",\n endpoint: \"/prices\",\n inputSchema: RequestForPrices,\n outputSchema: Prices,\n })\n getPrices = async (request: RequestForPrices): Promise<Prices> => {\n let validatedRequest;\n try {\n validatedRequest = RequestForPrices.parse(request);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid request for prices\",\n error: error as ZodError,\n });\n }\n const response = await this.apiClient.post<Prices>(`/prices`, validatedRequest);\n return response.data;\n };\n\n /**\n * Retrieves the withdraw payload for a given workflow.\n *\n * @param {RequestForWithdrawAuthorization} request {{@link RequestForWithdrawAuthorization}} The request for the withdraw authorization payload.\n * @returns {Promise<WithdrawAuthorizationResponse>} A promise that resolves to the {@link WithdrawAuthorizationResponse withdraw authorization payload}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Retrieves the withdraw authorization for a given workflow.\",\n httpVerb: \"POST\",\n endpoint: \"/payments/withdraw\",\n inputSchema: RequestForWithdrawAuthorization,\n outputSchema: WithdrawAuthorizationResponse,\n })\n getWithdrawAuthorization = async (\n request: RequestForWithdrawAuthorization\n ): Promise<WithdrawAuthorizationResponse> => {\n let validatedRequest;\n try {\n validatedRequest = RequestForWithdrawAuthorization.parse(request);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid request for withdraw authorization\",\n error: error as ZodError,\n });\n }\n\n const response = await this.apiClient.post<WithdrawAuthorizationResponse>(\n \"/payments/withdraw\",\n validatedRequest\n );\n return response.data;\n };\n\n /**\n * Submits the owner signature for a withdraw payload.\n *\n * @param {RequestForWithdraw} request {{@link RequestForWithdraw}} The request for the withdraw payload.\n * @returns {Promise<WithdrawResponse>} A promise that resolves to the {@link WithdrawResponse transaction ID}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Submits the owner signature for a withdraw payload.\",\n httpVerb: \"POST\",\n endpoint: \"/payments/withdraw/confirm\",\n inputSchema: RequestForWithdraw,\n outputSchema: WithdrawResponse,\n })\n withdraw = async (request: RequestForWithdraw): Promise<WithdrawResponse> => {\n let validatedRequest;\n try {\n validatedRequest = RequestForWithdraw.parse(request);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid request for withdraw\",\n error: error as ZodError,\n });\n }\n\n const response = await this.apiClient.post<WithdrawResponse>(`/payments/withdraw/confirm`, validatedRequest);\n return response.data;\n };\n\n /**\n * Returns the method metadata for a given method name.\n *\n * @param methodName The name of the method to get the method metadata for.\n * @returns The method metadata for the given method name.\n */\n static toJSON<T extends keyof PaymentsApiClient>(methodName: T): MethodMetadata | undefined {\n return Reflect.getMetadata(API_METHOD_METADATA_KEY, this.prototype, methodName);\n }\n}\n\nexport default PaymentsApiClient;\n"],"names":["$constructor","name","initializer","params","init","inst","def","_a","Object","defineProperty","value","_zod","enumerable","traits","Set","add","k","_","prototype","bind","constr","Parent","Definition","this","deferred","fn","Symbol","hasInstance","has","$ZodAsyncError","Error","constructor","super","globalConfig","config","newConfig","jsonStringifyReplacer","toString","cached","getter","nullish","input","cleanRegex","source","start","startsWith","end","endsWith","length","slice","defineLazy","object","key","get","set","v","configurable","assignProp","target","prop","writable","randomString","chars","str","i","Math","floor","random","esc","JSON","stringify","isObject","data","Array","isArray","allowsEval","Function","isPlainObject","getPrototypeOf","propertyKeyTypes","escapeRegex","replace","clone","cl","parent","normalizeParams","_params","error","undefined","message","NUMBER_FORMAT_RANGES","safeint","Number","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","int32","uint32","float32","float64","MAX_VALUE","aborted","x","startIndex","issues","continue","prefixIssues","path","map","iss","unshift","unwrapMessage","finalizeIssue","ctx","full","customError","localeError","reportInput","getLengthableOrigin","issue","args","code","util.jsonStringifyReplacer","$ZodError","$ZodRealError","_parse","_Err","schema","_ctx","assign","async","result","run","Promise","core.$ZodAsyncError","e","Err","util.finalizeIssue","core.config","captureStackTrace","callee","_parseAsync","_safeParse","success","errors.$ZodError","safeParse","errors.$ZodRealError","_safeParseAsync","safeParseAsync","cuid","cuid2","ulid","xid","ksuid","nanoid","duration","guid","uuid","version","RegExp","email","ipv4","ipv6","cidrv4","cidrv6","base64","base64url","hostname","e164","dateSource","date","timeSource","regex","precision","bigint","integer","number","boolean","lowercase","uppercase","$ZodCheck","core.$constructor","onattach","numericOriginMap","$ZodCheckLessThan","origin","push","bag","curr","inclusive","maximum","exclusiveMaximum","POSITIVE_INFINITY","check","payload","abort","$ZodCheckGreaterThan","minimum","exclusiveMinimum","NEGATIVE_INFINITY","$ZodCheckMultipleOf","multipleOf","BigInt","val","step","valDecCount","split","stepDecCount","decCount","parseInt","toFixed","util.floatSafeRemainder","divisor","$ZodCheckNumberFormat","format","isInt","includes","util.NUMBER_FORMAT_RANGES","pattern","regexes.integer","isInteger","expected","isSafeInteger","note","$ZodCheckMaxLength","when","util.nullish","util.getLengthableOrigin","$ZodCheckMinLength","$ZodCheckLengthEquals","tooBig","$ZodCheckStringFormat","patterns","lastIndex","test","$ZodCheckRegex","$ZodCheckLowerCase","regexes.lowercase","$ZodCheckUpperCase","regexes.uppercase","$ZodCheckIncludes","escapedRegex","util.escapeRegex","position","$ZodCheckStartsWith","prefix","$ZodCheckEndsWith","suffix","$ZodCheckOverwrite","tx","Doc","content","indent","indented","write","arg","execution","lines","filter","minIndent","min","trimStart","dedented","repeat","line","compile","F","join","major","minor","patch","$ZodType","id","type","util.randomString","checks","ch","parse","runChecks","asyncResult","isAborted","util.aborted","currLen","resolve","then","validate","r","vendor","$ZodString","pop","coerce","String","$ZodStringFormat","checks.$ZodCheckStringFormat","$ZodGUID","regexes.guid","$ZodUUID","v1","v2","v3","v4","v5","v6","v7","v8","regexes.uuid","$ZodEmail","regexes.email","$ZodURL","url","URL","regexes.hostname","protocol","$ZodEmoji","$ZodNanoID","regexes.nanoid","$ZodCUID","regexes.cuid","$ZodCUID2","regexes.cuid2","$ZodULID","regexes.ulid","$ZodXID","regexes.xid","$ZodKSUID","regexes.ksuid","$ZodISODateTime","opts","local","offset","regexes.datetime","$ZodISODate","regexes.date","$ZodISOTime","$ZodISODuration","regexes.duration","$ZodIPv4","regexes.ipv4","$ZodIPv6","regexes.ipv6","$ZodCIDRv4","regexes.cidrv4","$ZodCIDRv6","regexes.cidrv6","address","prefixNum","isValidBase64","atob","$ZodBase64","regexes.base64","contentEncoding","$ZodBase64URL","regexes.base64url","c","padEnd","ceil","isValidBase64URL","$ZodE164","regexes.e164","$ZodJWT","token","algorithm","tokensParts","header","parsedHeader","typ","alg","isValidJWT","$ZodNumber","regexes.number","isNaN","isFinite","received","$ZodNumberFormat","checks.$ZodCheckNumberFormat","$ZodBoolean","regexes.boolean","Boolean","$ZodBigInt","regexes.bigint","$ZodAny","$ZodUnknown","$ZodNever","handleArrayResult","final","index","util.prefixIssues","$ZodArray","proms","item","element","all","handleObjectResult","handleOptionalObjectResult","$ZodObject","_normalized","util.cached","keys","shape","okeys","optin","optout","keySet","numKeys","optionalKeys","util.defineLazy","propValues","field","values","fastpass","util.isObject","jit","core.globalConfig","jitless","fastEnabled","util.allowsEval","catchall","doc","parseStr","util.esc","ids","create","generateFastpass","el","isOptional","unrecognized","_catchall","t","handleUnionResults","results","errors","$ZodUnion","options","every","o","flatMap","option","from","p","util.cleanRegex","$ZodDiscriminatedUnion","_super","pv","indexOf","entries","disc","Map","discriminator","size","opt","unionFallback","$ZodIntersection","left","right","handleIntersectionResults","mergeValues","a","b","valid","Date","util.isPlainObject","bKeys","sharedKeys","newObj","sharedValue","mergeErrorPath","newArray","merged","$ZodRecord","keyType","valueType","Reflect","ownKeys","keyResult","$ZodEnum","numericValues","util.getEnumValues","util.propertyKeyTypes","$ZodLiteral","$ZodTransform","_out","transform","output","$ZodOptional","innerType","$ZodNullable","$ZodDefault","defaultValue","handleDefaultResult","$ZodPrefault","$ZodNonOptional","handleNonOptionalResult","$ZodCatch","catchValue","$ZodPipe","in","out","handlePipeResult","$ZodReadonly","handleReadonlyResult","freeze","$ZodCustom","checks.$ZodCheck","handleRefineResult","_iss","util.issue","$ZodRegistry","_map","WeakMap","_idmap","_meta","meta","remove","delete","pm","registry","globalRegistry","_guid","Class","util.normalizeParams","_url","_ipv4","_ipv6","_lt","checks.$ZodCheckLessThan","_lte","_gt","checks.$ZodCheckGreaterThan","_gte","_multipleOf","checks.$ZodCheckMultipleOf","_maxLength","checks.$ZodCheckMaxLength","_minLength","checks.$ZodCheckMinLength","_length","checks.$ZodCheckLengthEquals","_overwrite","checks.$ZodCheckOverwrite","ZodISODateTime","core.$ZodISODateTime","schemas.ZodStringFormat","datetime","core._isoDateTime","ZodISODate","core.$ZodISODate","core._isoDate","ZodISOTime","core.$ZodISOTime","time","core._isoTime","ZodISODuration","core.$ZodISODuration","core._isoDuration","defineProperties","mapper","_mapper","fieldErrors","_errors","processError","core.formatError","flatten","formErrors","sub","core.flattenError","addIssue","addIssues","isEmpty","ZodError","ZodRealError","core._parse","parseAsync","core._parseAsync","core._safeParse","core._safeParseAsync","ZodType","core.$ZodType","core.clone","brand","register","reg","parse.parse","parse.safeParse","parse.parseAsync","parse.safeParseAsync","spa","refine","core._refine","ZodCustom","superRefine","refinement","core.$ZodCheck","_issue","fatal","overwrite","checks.overwrite","optional","nullable","nonoptional","ZodNonOptional","array","or","union","and","ZodIntersection","pipe","default","_default","ZodDefault","prefault","ZodPrefault","catch","_catch","ZodCatch","readonly","ZodReadonly","describe","description","core.globalRegistry","isNullable","_ZodString","core.$ZodString","minLength","maxLength","checks.$ZodCheckRegex","checks.regex","checks.$ZodCheckIncludes","checks.includes","checks.$ZodCheckStartsWith","checks.startsWith","checks.$ZodCheckEndsWith","checks.endsWith","checks.minLength","max","checks.maxLength","checks.length","nonempty","checks.$ZodCheckLowerCase","checks.lowercase","checks.$ZodCheckUpperCase","checks.uppercase","trim","normalize","form","checks.normalize","toLowerCase","toUpperCase","ZodString","core._email","ZodEmail","core._url","ZodURL","jwt","core._jwt","ZodJWT","emoji","core._emoji","ZodEmoji","core._guid","ZodGUID","core._uuid","ZodUUID","uuidv4","core._uuidv4","uuidv6","core._uuidv6","uuidv7","core._uuidv7","core._nanoid","ZodNanoID","core._cuid","ZodCUID","core._cuid2","ZodCUID2","core._ulid","ZodULID","core._base64","ZodBase64","core._base64url","ZodBase64URL","core._xid","ZodXID","core._ksuid","ZodKSUID","core._ipv4","ZodIPv4","core._ipv6","ZodIPv6","core._cidrv4","ZodCIDRv4","core._cidrv6","ZodCIDRv6","core._e164","ZodE164","iso.datetime","iso.date","iso.time","iso.duration","string","core._string","ZodStringFormat","core.$ZodStringFormat","core.$ZodEmail","core.$ZodGUID","core.$ZodUUID","core.$ZodURL","core.$ZodEmoji","core.$ZodNanoID","core.$ZodCUID","core.$ZodCUID2","core.$ZodULID","core.$ZodXID","core.$ZodKSUID","core.$ZodIPv4","core.$ZodIPv6","core.$ZodCIDRv4","core.$ZodCIDRv6","core.$ZodBase64","core.$ZodBase64URL","core.$ZodE164","core.$ZodJWT","ZodNumber","core.$ZodNumber","gt","checks.gt","gte","checks.gte","lt","checks.lt","lte","checks.lte","int","safe","positive","nonnegative","negative","nonpositive","checks.multipleOf","finite","minValue","maxValue","core._number","ZodNumberFormat","core.$ZodNumberFormat","core._int","ZodBoolean","core.$ZodBoolean","core._boolean","ZodBigInt","core.$ZodBigInt","core._bigint","ZodAny","core.$ZodAny","ZodUnknown","core.$ZodUnknown","unknown","ZodNever","core.$ZodNever","never","core._never","ZodArray","core.$ZodArray","len","unwrap","core._array","ZodObject","core.$ZodObject","fromEntries","keyof","_enum","passthrough","loose","strict","strip","extend","incoming","_shape","util.extend","merge","other","util.merge","pick","mask","newShape","currDef","util.pick","omit","util.omit","partial","oldShape","util.partial","ZodOptional","required","util.required","util.assignProp","ZodUnion","core.$ZodUnion","ZodDiscriminatedUnion","core.$ZodDiscriminatedUnion","discriminatedUnion","core.$ZodIntersection","ZodRecord","core.$ZodRecord","record","ZodEnum","core.$ZodEnum","enum","extract","newEntries","exclude","ZodLiteral","core.$ZodLiteral","literal","ZodTransform","core.$ZodTransform","core.$ZodOptional","ZodNullable","core.$ZodNullable","core.$ZodDefault","removeDefault","core.$ZodPrefault","core.$ZodNonOptional","core.$ZodCatch","removeCatch","ZodPipe","core.$ZodPipe","in_","core.$ZodReadonly","core.$ZodCustom","HALLIDAY_PAYMENTS_API_URL","API_DOMAIN_REGEX","UUID_REGEX","Amount","z.string","amount","EVMAddressRegex","EVMTokenAddress","EVMAddress","SolAddressRegex","SolNativeRegex","SolTokenAddress","SolAddress","Address","z.union","Fiat","fiat","FiatDetails","z.object","issuer","alias","symbol","decimals","z.number","Name","Decimals","ImageUrl","CoinGeckoId","EVMTokenPointer","chain","SolTokenPointer","z.literal","FlexibleTokenPointer","TokenPointer","Token","TokenInfo","image_url","coingecko_id","wrapper","is_native","z.boolean","EVMTokenDetails","SolTokenDetails","TokenDetails","Asset","AssetDetails","Realm","z.discriminatedUnion","RampName","ramp_name","RampType","ramp_type","z.enum","TransactionRequest","to","nonce","gasLimit","z.bigint","gasPrice","maxPriorityFeePerGas","maxFeePerGas","chainId","TransactionReceipt","transactionHash","blockHash","blockNumber","rawReceipt","EVMChainConfig","chain_id","network","native_currency","rpc","image","is_testnet","explorer","SolChainConfig","ChainConfig","OnrampMethod","HSON","obj","space","replacer","reviver","root","globalThis","global","self","functionThis","eval","indirectEvalThis","exporter","makeExporter","previous","hasOwn","hasOwnProperty","supportsSymbol","toPrimitiveSymbol","toPrimitive","iteratorSymbol","iterator","supportsCreate","supportsProto","__proto__","downLevel","HashMap","MakeDictionary","call","functionPrototype","_Map","CreateMapPolyfill","_Set","CreateSetPolyfill","_WeakMap","CreateWeakMapPolyfill","registrySymbol","for","metadataRegistry","GetOrCreateMetadataRegistry","metadataProvider","CreateMetadataProvider","decorate","decorators","propertyKey","attributes","IsUndefined","IsArray","TypeError","IsConstructor","DecorateConstructor","IsObject","IsNull","DecorateProperty","ToPropertyKey","metadata","metadataKey","metadataValue","decorator","IsPropertyKey","OrdinaryDefineOwnMetadata","defineMetadata","hasMetadata","OrdinaryHasMetadata","hasOwnMetadata","OrdinaryHasOwnMetadata","getMetadata","OrdinaryGetMetadata","getOwnMetadata","OrdinaryGetOwnMetadata","getMetadataKeys","OrdinaryMetadataKeys","getOwnMetadataKeys","OrdinaryOwnMetadataKeys","deleteMetadata","provider","GetMetadataProvider","OrdinaryDeleteMetadata","decorated","descriptor","MetadataKey","O","P","OrdinaryGetPrototypeOf","ToBoolean","MetadataValue","parentKeys","_i","ownKeys_1","parentKeys_1","Type","IsSymbol","ToPrimitive","PreferredType","hint","exoticToPrim","GetMethod","OrdinaryToPrimitive","valueOf","toString_1","IsCallable","argument","ToString","SameValueZero","y","V","func","GetIterator","method","IteratorValue","iterResult","IteratorStep","next","done","IteratorClose","f","proto","prototypeProto","CreateMetadataRegistry","fallback","first","second","rest","CreateFallbackProvider","targetProviderMap","registerProvider","getProvider","setProvider","isExtensible","getProviderNoCache","isProviderFor","providerMap","hasProvider","existingProvider","targetMetadata","GetOrCreateMetadataMap","Create","createdTargetMetadata","metadataMap","nextValue","reflect","metadataOwner","metadataPropertySet","registeredProvider","cacheSentinel","arraySentinel","MapIterator","selector","_index","_keys","_values","_selector","throw","return","_cacheKey","_cacheIndex","_find","clear","getKey","getValue","getEntry","insert","UUID_SIZE","rootKey","CreateUniqueKey","_key","table","GetOrCreateWeakMapTable","CreateUUID","FillRandomBytes","buffer","GenRandomBytes","Uint8Array","crypto","getRandomValues","msCrypto","byte","__","factory","API_METHOD_METADATA_KEY","methodMetadataRegistry","MethodMetadata","httpVerb","endpoint","ctor","toJSON","methodName","defaultValidationOptions","enabled","debug","validateResponse","response","baseUrl","pathname","extractPathname","console","outputSchema","warn","ErrorCodes","PaymentsApiClientError","status","statusText","reqHeaders","resHeaders","request","validationIssues","validationMessage","setPrototypeOf","isPaymentsApiClientError","parseValidationError","VALIDATION_ERROR","parseAxiosError","errorStatus","errorsFromResponse","errorMessages","errorFromResponse","SERVER_ERROR","headers","API_ERROR","NETWORK_ERROR","stack","createAxiosApiClient","apiKey","responseValidationOptions","instance","axios","baseURL","Authorization","parseReviver","validationInterceptor","onFulfilled","onRejected","interceptors","use","errorInterceptor","isAxiosError","newError","UNKNOWN_ERROR","getQueryParamsFromAssetFilters","filters","reduce","acc","valueItem","PaymentId","BaseAssetFilters","onramps","z.array","offramps","sandbox","InputsAssetFilters","inputs","outputs","OutputsAssetFilters","AssetFilters","AssetAmount","asset","TokenAmount","Signature","IPAddressOverride","z.ipv6","BaseQuoteRequest","price_currency","onramp_methods","customer_ip_address","customer_id","parent_payment_id","FixedRequest","kind","fixed_input_amount","output_asset","RequestForQuotes","Account","Property","Resource","property","ChangeStructure","account","resource","TerminalObservedStatus","ObservedStatus","WorkflowStatus","EffectStructure","consume","produce","ChangeAmount","EffectAmount","Prices","z.record","Issue","given","limits","Failure","service_ids","latency_seconds","RouteType","QuotedRoute","net_effect","pieces_info","step_index","Quote","payment_id","output_amount","onramp","onramp_method","fees","total_fees","conversion_fees","network_fees","business_fees","currency_symbol","route","FulfillmentRoute","transaction_hash","Fulfillment","QuotesResponse","quote_request","quotes","current_prices","state_token","quoted_at","accept_by","failures","RequestForConfirmQuote","owner_address","destination_address","client_redirect_url","DepositInfo","deposit_token","deposit_chain","deposit_amount","deposit_address","NextInstruction","funding_page_url","z.url","deposit_info","ConfirmQuoteResponse","funded","created_at","updated_at","initiate_fund_by","completed_at","quoted","fulfilled","processing_addresses","next_instruction","PaymentStatus","RequestForOnrampSession","redirect_url","OnrampSessionResponse","funding_page_onramp_url","client_secret","RequestForPaymentsHistory","id_query","pagination_key","dest_address","limit","category","PaymentHistoryResult","payment_statuses","next_pagination_key","RequestForBalance","z\n .object","custom_queries","z\n .array","BalanceResponse","balance_results","RequestForPrices","tokens","TypedData","RequestForWithdrawAuthorization","token_amounts","recipient_address","WithdrawAuthorizationResponse","withdraw_authorization","RequestForWithdraw","owner_signature","WithdrawResponse","PaymentsApiClient","getChains","chainConfigs","apiClient","getAssetDetails","assets","queryParams","getInputs","validAssetFilters","getOutputs","getQuotes","signal","validatedRequestForQuotes","post","confirmQuote","requestForConfirmQuote","validatedRequestForConfirmQuote","createPaymentSession","validatedRequest","getStatus","paymentId","searchParams","URLSearchParams","searchParamsString","getPaymentsHistory","queryParamsString","getBalance","getPrices","getWithdrawAuthorization","withdraw","responseValidation","__decorate","inputSchema","fiats"],"mappings":"wcAAgC,SAASA,EAAaC,EAAMC,EAAaC,GACrE,SAASC,EAAKC,EAAMC,GAChB,IAAIC,EACJC,OAAOC,eAAeJ,EAAM,OAAQ,CAChCK,MAAOL,EAAKM,MAAQ,CAAE,EACtBC,YAAY,KAEfL,EAAKF,EAAKM,MAAME,SAAWN,EAAGM,OAAS,IAAIC,KAC5CT,EAAKM,KAAKE,OAAOE,IAAId,GACrBC,EAAYG,EAAMC,GAElB,IAAK,MAAMU,KAAKC,EAAEC,UACdV,OAAOC,eAAeJ,EAAMW,EAAG,CAAEN,MAAOO,EAAEC,UAAUF,GAAGG,KAAKd,KAEhEA,EAAKM,KAAKS,OAASH,EACnBZ,EAAKM,KAAKL,IAAMA,CACxB,CAEI,MAAMe,EAASlB,GAAQkB,QAAUb,OACjC,MAAMc,UAAmBD,GAGzB,SAASJ,EAAEX,GACP,IAAIC,EACJ,MAAMF,EAAOF,GAAQkB,OAAS,IAAIC,EAAeC,KACjDnB,EAAKC,EAAMC,IACVC,EAAKF,EAAKM,MAAMa,WAAajB,EAAGiB,SAAW,IAC5C,IAAK,MAAMC,KAAMpB,EAAKM,KAAKa,SACvBC,IAEJ,OAAOpB,CACf,CAUI,OApBAG,OAAOC,eAAea,EAAY,OAAQ,CAAEZ,MAAOT,IAWnDO,OAAOC,eAAeQ,EAAG,OAAQ,CAAEP,MAAON,IAC1CI,OAAOC,eAAeQ,EAAGS,OAAOC,YAAa,CACzCjB,MAAQL,MACAF,GAAQkB,QAAUhB,aAAgBF,EAAOkB,SAEtChB,GAAMM,MAAME,QAAQe,IAAI3B,KAGvCO,OAAOC,eAAeQ,EAAG,OAAQ,CAAEP,MAAOT,IACnCgB,CACX,qDAGO,MAAMY,UAAuBC,MAChC,W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d,YAAa,6DACbwd,SAAU,OACVC,SAAU,qBACVkO,YAAaxC,GACb7K,aAAcgL,8BAoBhBK,GAAAjvC,UAAA,gCAAA,GAiBFgxC,EAAA,CAPCnO,GAAe,CACZvd,YAAa,sDACbwd,SAAU,OACVC,SAAU,6BACVkO,YAAanC,GACblL,aAAcoL,8BAehBC,GAAAjvC,UAAA,gBAAA","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,18]}
|
|
1
|
+
{"version":3,"file":"index.esm.min.js","sources":["../../../node_modules/zod/dist/esm/v4/core/core.js","../../../node_modules/zod/dist/esm/v4/core/util.js","../../../node_modules/zod/dist/esm/v4/core/errors.js","../../../node_modules/zod/dist/esm/v4/core/parse.js","../../../node_modules/zod/dist/esm/v4/core/regexes.js","../../../node_modules/zod/dist/esm/v4/core/checks.js","../../../node_modules/zod/dist/esm/v4/core/doc.js","../../../node_modules/zod/dist/esm/v4/core/versions.js","../../../node_modules/zod/dist/esm/v4/core/schemas.js","../../../node_modules/zod/dist/esm/v4/core/registries.js","../../../node_modules/zod/dist/esm/v4/core/api.js","../../../node_modules/zod/dist/esm/v4/classic/iso.js","../../../node_modules/zod/dist/esm/v4/classic/errors.js","../../../node_modules/zod/dist/esm/v4/classic/parse.js","../../../node_modules/zod/dist/esm/v4/classic/schemas.js","../../../_shared/constants/index.ts","../../../_shared/types/index.ts","../../src/paymentsApiClient/hson.ts","../../../node_modules/reflect-metadata/Reflect.js","../../src/paymentsApiClient/decorators.ts","../../src/paymentsApiClient/axios/responseValidationInterceptor.ts","../../src/paymentsApiClient/axios/errorInterceptor.ts","../../src/paymentsApiClient/axios/index.ts","../../src/paymentsApiClient/utils.ts","../../src/paymentsApiClient/types.ts","../../src/paymentsApiClient/PaymentsApiClient.ts"],"sourcesContent":["export /*@__NO_SIDE_EFFECTS__*/ function $constructor(name, initializer, params) {\n function init(inst, def) {\n var _a;\n Object.defineProperty(inst, \"_zod\", {\n value: inst._zod ?? {},\n enumerable: false,\n });\n (_a = inst._zod).traits ?? (_a.traits = new Set());\n inst._zod.traits.add(name);\n initializer(inst, def);\n // support prototype modifications\n for (const k in _.prototype) {\n Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) });\n }\n inst._zod.constr = _;\n inst._zod.def = def;\n }\n // doesn't work if Parent has a constructor with arguments\n const Parent = params?.Parent ?? Object;\n class Definition extends Parent {\n }\n Object.defineProperty(Definition, \"name\", { value: name });\n function _(def) {\n var _a;\n const inst = params?.Parent ? new Definition() : this;\n init(inst, def);\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n for (const fn of inst._zod.deferred) {\n fn();\n }\n return inst;\n }\n Object.defineProperty(_, \"init\", { value: init });\n Object.defineProperty(_, Symbol.hasInstance, {\n value: (inst) => {\n if (params?.Parent && inst instanceof params.Parent)\n return true;\n return inst?._zod?.traits?.has(name);\n },\n });\n Object.defineProperty(_, \"name\", { value: name });\n return _;\n}\n////////////////////////////// UTILITIES ///////////////////////////////////////\nexport const $brand = Symbol(\"zod_brand\");\nexport class $ZodAsyncError extends Error {\n constructor() {\n super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);\n }\n}\nexport const globalConfig = {};\nexport function config(newConfig) {\n if (newConfig)\n Object.assign(globalConfig, newConfig);\n return globalConfig;\n}\n","// functions\nexport function assertEqual(val) {\n return val;\n}\nexport function assertNotEqual(val) {\n return val;\n}\nexport function assertIs(_arg) { }\nexport function assertNever(_x) {\n throw new Error();\n}\nexport function assert(_) { }\nexport function getEnumValues(entries) {\n const numericValues = Object.values(entries).filter((v) => typeof v === \"number\");\n const values = Object.entries(entries)\n .filter(([k, _]) => numericValues.indexOf(+k) === -1)\n .map(([_, v]) => v);\n return values;\n}\nexport function joinValues(array, separator = \"|\") {\n return array.map((val) => stringifyPrimitive(val)).join(separator);\n}\nexport function jsonStringifyReplacer(_, value) {\n if (typeof value === \"bigint\")\n return value.toString();\n return value;\n}\nexport function cached(getter) {\n const set = false;\n return {\n get value() {\n if (!set) {\n const value = getter();\n Object.defineProperty(this, \"value\", { value });\n return value;\n }\n throw new Error(\"cached value already set\");\n },\n };\n}\nexport function nullish(input) {\n return input === null || input === undefined;\n}\nexport function cleanRegex(source) {\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n return source.slice(start, end);\n}\nexport function floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepDecCount = (step.toString().split(\".\")[1] || \"\").length;\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = Number.parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = Number.parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / 10 ** decCount;\n}\nexport function defineLazy(object, key, getter) {\n const set = false;\n Object.defineProperty(object, key, {\n get() {\n if (!set) {\n const value = getter();\n object[key] = value;\n return value;\n }\n throw new Error(\"cached value already set\");\n },\n set(v) {\n Object.defineProperty(object, key, {\n value: v,\n // configurable: true,\n });\n // object[key] = v;\n },\n configurable: true,\n });\n}\nexport function assignProp(target, prop, value) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n}\nexport function getElementAtPath(obj, path) {\n if (!path)\n return obj;\n return path.reduce((acc, key) => acc?.[key], obj);\n}\nexport function promiseAllObject(promisesObj) {\n const keys = Object.keys(promisesObj);\n const promises = keys.map((key) => promisesObj[key]);\n return Promise.all(promises).then((results) => {\n const resolvedObj = {};\n for (let i = 0; i < keys.length; i++) {\n resolvedObj[keys[i]] = results[i];\n }\n return resolvedObj;\n });\n}\nexport function randomString(length = 10) {\n const chars = \"abcdefghijklmnopqrstuvwxyz\";\n let str = \"\";\n for (let i = 0; i < length; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n}\nexport function esc(str) {\n return JSON.stringify(str);\n}\nexport function isObject(data) {\n return typeof data === \"object\" && data !== null && !Array.isArray(data);\n}\nexport const allowsEval = cached(() => {\n try {\n const F = Function;\n new F(\"\");\n return true;\n }\n catch (_) {\n return false;\n }\n});\nexport function isPlainObject(data) {\n return (typeof data === \"object\" &&\n data !== null &&\n (Object.getPrototypeOf(data) === Object.prototype || Object.getPrototypeOf(data) === null));\n}\nexport function numKeys(data) {\n let keyCount = 0;\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n keyCount++;\n }\n }\n return keyCount;\n}\nexport const getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return \"undefined\";\n case \"string\":\n return \"string\";\n case \"number\":\n return Number.isNaN(data) ? \"nan\" : \"number\";\n case \"boolean\":\n return \"boolean\";\n case \"function\":\n return \"function\";\n case \"bigint\":\n return \"bigint\";\n case \"symbol\":\n return \"symbol\";\n case \"object\":\n if (Array.isArray(data)) {\n return \"array\";\n }\n if (data === null) {\n return \"null\";\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return \"promise\";\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return \"map\";\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return \"set\";\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return \"date\";\n }\n if (typeof File !== \"undefined\" && data instanceof File) {\n return \"file\";\n }\n return \"object\";\n default:\n throw new Error(`Unknown data type: ${t}`);\n }\n};\nexport const propertyKeyTypes = new Set([\"string\", \"number\", \"symbol\"]);\nexport const primitiveTypes = new Set([\"string\", \"number\", \"bigint\", \"boolean\", \"symbol\", \"undefined\"]);\nexport function escapeRegex(str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n// zod-specific utils\nexport function clone(inst, def, params) {\n const cl = new inst._zod.constr(def ?? inst._zod.def);\n if (!def || params?.parent)\n cl._zod.parent = inst;\n return cl;\n}\nexport function normalizeParams(_params) {\n const params = _params;\n if (!params)\n return {};\n if (typeof params === \"string\")\n return { error: () => params };\n if (params?.message !== undefined) {\n if (params?.error !== undefined)\n throw new Error(\"Cannot specify both `message` and `error` params\");\n params.error = params.message;\n }\n delete params.message;\n if (typeof params.error === \"string\")\n return { ...params, error: () => params.error };\n return params;\n}\nexport function createTransparentProxy(getter) {\n let target;\n return new Proxy({}, {\n get(_, prop, receiver) {\n target ?? (target = getter());\n return Reflect.get(target, prop, receiver);\n },\n set(_, prop, value, receiver) {\n target ?? (target = getter());\n return Reflect.set(target, prop, value, receiver);\n },\n has(_, prop) {\n target ?? (target = getter());\n return Reflect.has(target, prop);\n },\n deleteProperty(_, prop) {\n target ?? (target = getter());\n return Reflect.deleteProperty(target, prop);\n },\n ownKeys(_) {\n target ?? (target = getter());\n return Reflect.ownKeys(target);\n },\n getOwnPropertyDescriptor(_, prop) {\n target ?? (target = getter());\n return Reflect.getOwnPropertyDescriptor(target, prop);\n },\n defineProperty(_, prop, descriptor) {\n target ?? (target = getter());\n return Reflect.defineProperty(target, prop, descriptor);\n },\n });\n}\nexport function stringifyPrimitive(value) {\n if (typeof value === \"bigint\")\n return value.toString() + \"n\";\n if (typeof value === \"string\")\n return `\"${value}\"`;\n return `${value}`;\n}\nexport function optionalKeys(shape) {\n return Object.keys(shape).filter((k) => {\n return shape[k]._zod.optin === \"optional\" && shape[k]._zod.optout === \"optional\";\n });\n}\nexport const NUMBER_FORMAT_RANGES = {\n safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],\n int32: [-2147483648, 2147483647],\n uint32: [0, 4294967295],\n float32: [-3.4028234663852886e38, 3.4028234663852886e38],\n float64: [-Number.MAX_VALUE, Number.MAX_VALUE],\n};\nexport const BIGINT_FORMAT_RANGES = {\n int64: [/* @__PURE__*/ BigInt(\"-9223372036854775808\"), /* @__PURE__*/ BigInt(\"9223372036854775807\")],\n uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt(\"18446744073709551615\")],\n};\nexport function pick(schema, mask) {\n const newShape = {};\n const currDef = schema._zod.def; //.shape;\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // pick key\n newShape[key] = currDef.shape[key];\n }\n return clone(schema, {\n ...schema._zod.def,\n shape: newShape,\n checks: [],\n });\n}\nexport function omit(schema, mask) {\n const newShape = { ...schema._zod.def.shape };\n const currDef = schema._zod.def; //.shape;\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n delete newShape[key];\n }\n return clone(schema, {\n ...schema._zod.def,\n shape: newShape,\n checks: [],\n });\n}\nexport function extend(schema, shape) {\n const def = {\n ...schema._zod.def,\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n checks: [], // delete existing checks\n };\n return clone(schema, def);\n}\nexport function merge(a, b) {\n return clone(a, {\n ...a._zod.def,\n get shape() {\n const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n catchall: b._zod.def.catchall,\n checks: [], // delete existing checks\n });\n}\nexport function partial(Class, schema, mask) {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in oldShape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n else {\n for (const key in oldShape) {\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n return clone(schema, {\n ...schema._zod.def,\n shape,\n checks: [],\n });\n}\nexport function required(Class, schema, mask) {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n else {\n for (const key in oldShape) {\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n return clone(schema, {\n ...schema._zod.def,\n shape,\n // optional: [],\n checks: [],\n });\n}\nexport function aborted(x, startIndex = 0) {\n for (let i = startIndex; i < x.issues.length; i++) {\n if (x.issues[i].continue !== true)\n return true;\n }\n return false;\n}\nexport function prefixIssues(path, issues) {\n return issues.map((iss) => {\n var _a;\n (_a = iss).path ?? (_a.path = []);\n iss.path.unshift(path);\n return iss;\n });\n}\nexport function unwrapMessage(message) {\n return typeof message === \"string\" ? message : message?.message;\n}\nexport function finalizeIssue(iss, ctx, config) {\n const full = { ...iss, path: iss.path ?? [] };\n // for backwards compatibility\n if (!iss.message) {\n const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??\n unwrapMessage(ctx?.error?.(iss)) ??\n unwrapMessage(config.customError?.(iss)) ??\n unwrapMessage(config.localeError?.(iss)) ??\n \"Invalid input\";\n full.message = message;\n }\n // delete (full as any).def;\n delete full.inst;\n delete full.continue;\n if (!ctx?.reportInput) {\n delete full.input;\n }\n return full;\n}\nexport function getSizableOrigin(input) {\n if (input instanceof Set)\n return \"set\";\n if (input instanceof Map)\n return \"map\";\n if (input instanceof File)\n return \"file\";\n return \"unknown\";\n}\nexport function getLengthableOrigin(input) {\n if (Array.isArray(input))\n return \"array\";\n if (typeof input === \"string\")\n return \"string\";\n return \"unknown\";\n}\nexport function issue(...args) {\n const [iss, input, inst] = args;\n if (typeof iss === \"string\") {\n return {\n message: iss,\n code: \"custom\",\n input,\n inst,\n };\n }\n return { ...iss };\n}\nexport function cleanEnum(obj) {\n return Object.entries(obj)\n .filter(([k, _]) => {\n // return true if NaN, meaning it's not a number, thus a string key\n return Number.isNaN(Number.parseInt(k, 10));\n })\n .map((el) => el[1]);\n}\n// instanceof\nexport class Class {\n constructor(..._args) { }\n}\n","import { $constructor } from \"./core.js\";\nimport * as util from \"./util.js\";\nconst initializer = (inst, def) => {\n inst.name = \"$ZodError\";\n Object.defineProperty(inst, \"_zod\", {\n value: inst._zod,\n enumerable: false,\n });\n Object.defineProperty(inst, \"issues\", {\n value: def,\n enumerable: false,\n });\n Object.defineProperty(inst, \"message\", {\n get() {\n return JSON.stringify(def, util.jsonStringifyReplacer, 2);\n },\n enumerable: true,\n // configurable: false,\n });\n};\nexport const $ZodError = $constructor(\"$ZodError\", initializer);\nexport const $ZodRealError = $constructor(\"$ZodError\", initializer, { Parent: Error });\nexport function flattenError(error, mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of error.issues) {\n if (sub.path.length > 0) {\n fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];\n fieldErrors[sub.path[0]].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n}\nexport function formatError(error, _mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n issue.errors.map((issues) => processError({ issues }));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues });\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues });\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(error);\n return fieldErrors;\n}\nexport function treeifyError(error, _mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const result = { errors: [] };\n const processError = (error, path = []) => {\n var _a, _b;\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n // regular union error\n issue.errors.map((issues) => processError({ issues }, issue.path));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues }, issue.path);\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues }, issue.path);\n }\n else {\n const fullpath = [...path, ...issue.path];\n if (fullpath.length === 0) {\n result.errors.push(mapper(issue));\n continue;\n }\n let curr = result;\n let i = 0;\n while (i < fullpath.length) {\n const el = fullpath[i];\n const terminal = i === fullpath.length - 1;\n if (typeof el === \"string\") {\n curr.properties ?? (curr.properties = {});\n (_a = curr.properties)[el] ?? (_a[el] = { errors: [] });\n curr = curr.properties[el];\n }\n else {\n curr.items ?? (curr.items = []);\n (_b = curr.items)[el] ?? (_b[el] = { errors: [] });\n curr = curr.items[el];\n }\n if (terminal) {\n curr.errors.push(mapper(issue));\n }\n i++;\n }\n }\n }\n };\n processError(error);\n return result;\n}\n/** Format a ZodError as a human-readable string in the following form.\n *\n * From\n *\n * ```ts\n * ZodError {\n * issues: [\n * {\n * expected: 'string',\n * code: 'invalid_type',\n * path: [ 'username' ],\n * message: 'Invalid input: expected string'\n * },\n * {\n * expected: 'number',\n * code: 'invalid_type',\n * path: [ 'favoriteNumbers', 1 ],\n * message: 'Invalid input: expected number'\n * }\n * ];\n * }\n * ```\n *\n * to\n *\n * ```\n * username\n * ✖ Expected number, received string at \"username\n * favoriteNumbers[0]\n * ✖ Invalid input: expected number\n * ```\n */\nexport function toDotPath(path) {\n const segs = [];\n for (const seg of path) {\n if (typeof seg === \"number\")\n segs.push(`[${seg}]`);\n else if (typeof seg === \"symbol\")\n segs.push(`[${JSON.stringify(String(seg))}]`);\n else if (/[^\\w$]/.test(seg))\n segs.push(`[${JSON.stringify(seg)}]`);\n else {\n if (segs.length)\n segs.push(\".\");\n segs.push(seg);\n }\n }\n return segs.join(\"\");\n}\nexport function prettifyError(error) {\n const lines = [];\n // sort by path length\n const issues = [...error.issues].sort((a, b) => a.path.length - b.path.length);\n // Process each issue\n for (const issue of issues) {\n lines.push(`✖ ${issue.message}`);\n if (issue.path?.length)\n lines.push(` → at ${toDotPath(issue.path)}`);\n }\n // Convert Map to formatted string\n return lines.join(\"\\n\");\n}\n","import * as core from \"./core.js\";\nimport * as errors from \"./errors.js\";\nimport * as util from \"./util.js\";\nexport const _parse = (_Err) => (schema, value, _ctx, _params) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n if (result.issues.length) {\n const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n Error.captureStackTrace(e, _params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parse = /* @__PURE__*/ _parse(errors.$ZodRealError);\nexport const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n if (result.issues.length) {\n const e = new (params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n Error.captureStackTrace(e, params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parseAsync = /* @__PURE__*/ _parseAsync(errors.$ZodRealError);\nexport const _safeParse = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._ctx, async: false } : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n return result.issues.length\n ? {\n success: false,\n error: new (_Err ?? errors.$ZodError)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParse = /* @__PURE__*/ _safeParse(errors.$ZodRealError);\nexport const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n return result.issues.length\n ? {\n success: false,\n error: new _Err(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParseAsync = /* @__PURE__*/ _safeParseAsync(errors.$ZodRealError);\n","export const cuid = /^[cC][^\\s-]{8,}$/;\nexport const cuid2 = /^[0-9a-z]+$/;\nexport const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;\nexport const xid = /^[0-9a-vA-V]{20}$/;\nexport const ksuid = /^[A-Za-z0-9]{27}$/;\nexport const nanoid = /^[a-zA-Z0-9_-]{21}$/;\n/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */\nexport const duration = /^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/;\n/** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */\nexport const extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/;\n/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */\nexport const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;\n/** Returns a regex for validating an RFC 4122 UUID.\n *\n * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */\nexport const uuid = (version) => {\n if (!version)\n return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;\n return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);\n};\nexport const uuid4 = /*@__PURE__*/ uuid(4);\nexport const uuid6 = /*@__PURE__*/ uuid(6);\nexport const uuid7 = /*@__PURE__*/ uuid(7);\n/** Practical email validation */\nexport const email = /^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/;\n/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */\nexport const html5Email = /^[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/** The classic emailregex.com regex for RFC 5322-compliant emails */\nexport const rfc5322Email = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n/** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */\nexport const unicodeEmail = /^[^\\s@\"]{1,64}@[^\\s@]{1,255}$/u;\nexport const browserEmail = /^[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// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nexport const _emoji = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nexport function emoji() {\n return new RegExp(_emoji, \"u\");\n}\nexport const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;\nexport const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/;\nexport const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$/;\nexport const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nexport const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;\nexport const base64url = /^[A-Za-z0-9_-]*$/;\n// based on https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address\n// export const hostname: RegExp =\n// /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)+([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$/;\nexport const hostname = /^([a-zA-Z0-9-]+\\.)*[a-zA-Z0-9-]+$/;\nexport const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$/;\n// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces)\nexport const e164 = /^\\+(?:[0-9]){6,14}[0-9]$/;\nconst dateSource = `((\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\\\d|30)|(02)-(0[1-9]|1\\\\d|2[0-8])))`;\nexport const date = /*@__PURE__*/ new RegExp(`^${dateSource}$`);\nfunction timeSource(args) {\n // let regex = `\\\\d{2}:\\\\d{2}:\\\\d{2}`;\n let regex = `([01]\\\\d|2[0-3]):[0-5]\\\\d:[0-5]\\\\d`;\n if (args.precision) {\n regex = `${regex}\\\\.\\\\d{${args.precision}}`;\n }\n else if (args.precision == null) {\n regex = `${regex}(\\\\.\\\\d+)?`;\n }\n return regex;\n}\nexport function time(args) {\n return new RegExp(`^${timeSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nexport function datetime(args) {\n let regex = `${dateSource}T${timeSource(args)}`;\n const opts = [];\n opts.push(args.local ? `Z?` : `Z`);\n if (args.offset)\n opts.push(`([+-]\\\\d{2}:?\\\\d{2})`);\n regex = `${regex}(${opts.join(\"|\")})`;\n return new RegExp(`^${regex}$`);\n}\nexport const string = (params) => {\n const regex = params ? `[\\\\s\\\\S]{${params?.minimum ?? 0},${params?.maximum ?? \"\"}}` : `[\\\\s\\\\S]*`;\n return new RegExp(`^${regex}$`);\n};\nexport const bigint = /^\\d+n?$/;\nexport const integer = /^\\d+$/;\nexport const number = /^-?\\d+(?:\\.\\d+)?/i;\nexport const boolean = /true|false/i;\nconst _null = /null/i;\nexport { _null as null };\nconst _undefined = /undefined/i;\nexport { _undefined as undefined };\n// regex for string with no uppercase letters\nexport const lowercase = /^[^A-Z]*$/;\n// regex for string with no lowercase letters\nexport const uppercase = /^[^a-z]*$/;\n","// import { $ZodType } from \"./schemas.js\";\nimport * as core from \"./core.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nexport const $ZodCheck = /*@__PURE__*/ core.$constructor(\"$ZodCheck\", (inst, def) => {\n var _a;\n inst._zod ?? (inst._zod = {});\n inst._zod.def = def;\n (_a = inst._zod).onattach ?? (_a.onattach = []);\n});\nconst numericOriginMap = {\n number: \"number\",\n bigint: \"bigint\",\n object: \"date\",\n};\nexport const $ZodCheckLessThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckLessThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;\n if (def.value < curr) {\n if (def.inclusive)\n bag.maximum = def.value;\n else\n bag.exclusiveMaximum = def.value;\n }\n });\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {\n return;\n }\n payload.issues.push({\n origin,\n code: \"too_big\",\n maximum: def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckGreaterThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckGreaterThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;\n if (def.value > curr) {\n if (def.inclusive)\n bag.minimum = def.value;\n else\n bag.exclusiveMinimum = def.value;\n }\n });\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {\n return;\n }\n payload.issues.push({\n origin: origin,\n code: \"too_small\",\n minimum: def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMultipleOf = \n/*@__PURE__*/ core.$constructor(\"$ZodCheckMultipleOf\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.onattach.push((inst) => {\n var _a;\n (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);\n });\n inst._zod.check = (payload) => {\n if (typeof payload.value !== typeof def.value)\n throw new Error(\"Cannot mix number and bigint in multiple_of check.\");\n const isMultiple = typeof payload.value === \"bigint\"\n ? payload.value % def.value === BigInt(0)\n : util.floatSafeRemainder(payload.value, def.value) === 0;\n if (isMultiple)\n return;\n payload.issues.push({\n origin: typeof payload.value,\n code: \"not_multiple_of\",\n divisor: def.value,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckNumberFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n def.format = def.format || \"float64\";\n const isInt = def.format?.includes(\"int\");\n const origin = isInt ? \"int\" : \"number\";\n const [minimum, maximum] = util.NUMBER_FORMAT_RANGES[def.format];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = def.format;\n bag.minimum = minimum;\n bag.maximum = maximum;\n if (isInt)\n bag.pattern = regexes.integer;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (isInt) {\n if (!Number.isInteger(input)) {\n // invalid_format issue\n // payload.issues.push({\n // expected: def.format,\n // format: def.format,\n // code: \"invalid_format\",\n // input,\n // inst,\n // });\n // invalid_type issue\n payload.issues.push({\n expected: origin,\n format: def.format,\n code: \"invalid_type\",\n input,\n inst,\n });\n return;\n // not_multiple_of issue\n // payload.issues.push({\n // code: \"not_multiple_of\",\n // origin: \"number\",\n // input,\n // inst,\n // divisor: 1,\n // });\n }\n if (!Number.isSafeInteger(input)) {\n if (input > 0) {\n // too_big\n payload.issues.push({\n input,\n code: \"too_big\",\n maximum: Number.MAX_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n continue: !def.abort,\n });\n }\n else {\n // too_small\n payload.issues.push({\n input,\n code: \"too_small\",\n minimum: Number.MIN_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n continue: !def.abort,\n });\n }\n return;\n }\n }\n if (input < minimum) {\n payload.issues.push({\n origin: \"number\",\n input: input,\n code: \"too_small\",\n minimum: minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"number\",\n input,\n code: \"too_big\",\n maximum,\n inst,\n });\n }\n };\n});\nexport const $ZodCheckBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckBigIntFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n const [minimum, maximum] = util.BIGINT_FORMAT_RANGES[def.format];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = def.format;\n bag.minimum = minimum;\n bag.maximum = maximum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (input < minimum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_small\",\n minimum: minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_big\",\n maximum,\n inst,\n });\n }\n };\n});\nexport const $ZodCheckMaxSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxSize\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n };\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);\n if (def.maximum < curr)\n inst._zod.bag.maximum = def.maximum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size <= def.maximum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_big\",\n maximum: def.maximum,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinSize\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n };\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);\n if (def.minimum > curr)\n inst._zod.bag.minimum = def.minimum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size >= def.minimum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_small\",\n minimum: def.minimum,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckSizeEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckSizeEquals\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n };\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.minimum = def.size;\n bag.maximum = def.size;\n bag.size = def.size;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size === def.size)\n return;\n const tooBig = size > def.size;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n ...(tooBig ? { code: \"too_big\", maximum: def.size } : { code: \"too_small\", minimum: def.size }),\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMaxLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxLength\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n };\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);\n if (def.maximum < curr)\n inst._zod.bag.maximum = def.maximum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const length = input.length;\n if (length <= def.maximum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_big\",\n maximum: def.maximum,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinLength\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n };\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);\n if (def.minimum > curr)\n inst._zod.bag.minimum = def.minimum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const length = input.length;\n if (length >= def.minimum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_small\",\n minimum: def.minimum,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLengthEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckLengthEquals\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n };\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.minimum = def.length;\n bag.maximum = def.length;\n bag.length = def.length;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const length = input.length;\n if (length === def.length)\n return;\n const origin = util.getLengthableOrigin(input);\n const tooBig = length > def.length;\n payload.issues.push({\n origin,\n ...(tooBig ? { code: \"too_big\", maximum: def.length } : { code: \"too_small\", minimum: def.length }),\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckStringFormat\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = def.format;\n if (def.pattern) {\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(def.pattern);\n }\n });\n (_a = inst._zod).check ?? (_a.check = (payload) => {\n if (!def.pattern)\n throw new Error(\"Not implemented.\");\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: def.format,\n input: payload.value,\n ...(def.pattern ? { pattern: def.pattern.toString() } : {}),\n inst,\n continue: !def.abort,\n });\n });\n});\nexport const $ZodCheckRegex = /*@__PURE__*/ core.$constructor(\"$ZodCheckRegex\", (inst, def) => {\n $ZodCheckStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"regex\",\n input: payload.value,\n pattern: def.pattern.toString(),\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLowerCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckLowerCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.lowercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckUpperCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckUpperCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.uppercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckIncludes = /*@__PURE__*/ core.$constructor(\"$ZodCheckIncludes\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const escapedRegex = util.escapeRegex(def.includes);\n const pattern = new RegExp(typeof def.position === \"number\" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);\n def.pattern = pattern;\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(pattern);\n });\n inst._zod.check = (payload) => {\n if (payload.value.includes(def.includes, def.position))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"includes\",\n includes: def.includes,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStartsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckStartsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`^${util.escapeRegex(def.prefix)}.*`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(pattern);\n });\n inst._zod.check = (payload) => {\n if (payload.value.startsWith(def.prefix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"starts_with\",\n prefix: def.prefix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckEndsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckEndsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`.*${util.escapeRegex(def.suffix)}$`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(pattern);\n });\n inst._zod.check = (payload) => {\n if (payload.value.endsWith(def.suffix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"ends_with\",\n suffix: def.suffix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n///////////////////////////////////\n///// $ZodCheckProperty /////\n///////////////////////////////////\nfunction handleCheckPropertyResult(result, payload, property) {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(property, result.issues));\n }\n}\nexport const $ZodCheckProperty = /*@__PURE__*/ core.$constructor(\"$ZodCheckProperty\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n const result = def.schema._zod.run({\n value: payload.value[def.property],\n issues: [],\n }, {});\n if (result instanceof Promise) {\n return result.then((result) => handleCheckPropertyResult(result, payload, def.property));\n }\n handleCheckPropertyResult(result, payload, def.property);\n return;\n };\n});\nexport const $ZodCheckMimeType = /*@__PURE__*/ core.$constructor(\"$ZodCheckMimeType\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const mimeSet = new Set(def.mime);\n inst._zod.onattach.push((inst) => {\n inst._zod.bag.mime = def.mime;\n });\n inst._zod.check = (payload) => {\n if (mimeSet.has(payload.value.type))\n return;\n payload.issues.push({\n code: \"invalid_value\",\n values: def.mime,\n input: payload.value.type,\n path: [\"type\"],\n inst,\n });\n };\n});\nexport const $ZodCheckOverwrite = /*@__PURE__*/ core.$constructor(\"$ZodCheckOverwrite\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n payload.value = def.tx(payload.value);\n };\n});\n","export class Doc {\n constructor(args = []) {\n this.content = [];\n this.indent = 0;\n if (this)\n this.args = args;\n }\n indented(fn) {\n this.indent += 1;\n fn(this);\n this.indent -= 1;\n }\n write(arg) {\n if (typeof arg === \"function\") {\n arg(this, { execution: \"sync\" });\n arg(this, { execution: \"async\" });\n return;\n }\n const content = arg;\n const lines = content.split(\"\\n\").filter((x) => x);\n const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));\n const dedented = lines.map((x) => x.slice(minIndent)).map((x) => \" \".repeat(this.indent * 2) + x);\n for (const line of dedented) {\n this.content.push(line);\n }\n }\n compile() {\n const F = Function;\n const args = this?.args;\n const content = this?.content ?? [``];\n const lines = [...content.map((x) => ` ${x}`)];\n // console.log(lines.join(\"\\n\"));\n return new F(...args, lines.join(\"\\n\"));\n }\n}\n","export const version = {\n major: 4,\n minor: 0,\n patch: 0,\n};\n","import * as checks from \"./checks.js\";\nimport * as core from \"./core.js\";\nimport { Doc } from \"./doc.js\";\nimport { safeParse, safeParseAsync } from \"./parse.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nimport { version } from \"./versions.js\";\nexport const $ZodType = /*@__PURE__*/ core.$constructor(\"$ZodType\", (inst, def) => {\n var _a;\n inst ?? (inst = {});\n inst._zod.id = def.type + \"_\" + util.randomString(10);\n inst._zod.def = def; // set _def property\n inst._zod.bag = inst._zod.bag || {}; // initialize _bag object\n inst._zod.version = version;\n const checks = [...(inst._zod.def.checks ?? [])];\n // if inst is itself a checks.$ZodCheck, run it as a check\n if (inst._zod.traits.has(\"$ZodCheck\")) {\n checks.unshift(inst);\n }\n //\n for (const ch of checks) {\n for (const fn of ch._zod.onattach) {\n fn(inst);\n }\n }\n if (checks.length === 0) {\n // deferred initializer\n // inst._zod.parse is not yet defined\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n inst._zod.deferred?.push(() => {\n inst._zod.run = inst._zod.parse;\n });\n }\n else {\n const runChecks = (payload, checks, ctx) => {\n let isAborted = util.aborted(payload);\n let asyncResult;\n for (const ch of checks) {\n if (ch._zod.when) {\n const shouldRun = ch._zod.when(payload);\n if (!shouldRun)\n continue;\n }\n else {\n if (isAborted) {\n continue;\n }\n }\n const currLen = payload.issues.length;\n const _ = ch._zod.check(payload);\n if (_ instanceof Promise && ctx?.async === false) {\n throw new core.$ZodAsyncError();\n }\n if (asyncResult || _ instanceof Promise) {\n asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {\n await _;\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n return;\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n });\n }\n else {\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n continue;\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n }\n }\n if (asyncResult) {\n return asyncResult.then(() => {\n return payload;\n });\n }\n return payload;\n };\n inst._zod.run = (payload, ctx) => {\n const result = inst._zod.parse(payload, ctx);\n if (result instanceof Promise) {\n if (ctx.async === false)\n throw new core.$ZodAsyncError();\n return result.then((result) => runChecks(result, checks, ctx));\n }\n return runChecks(result, checks, ctx);\n };\n }\n inst[\"~standard\"] = {\n validate: (value) => {\n try {\n const r = safeParse(inst, value);\n return r.success ? { value: r.data } : { issues: r.error?.issues };\n }\n catch (_) {\n return safeParseAsync(inst, value).then((r) => (r.success ? { value: r.data } : { issues: r.error?.issues }));\n }\n },\n vendor: \"zod\",\n version: 1,\n };\n});\nexport { clone } from \"./util.js\";\nexport const $ZodString = /*@__PURE__*/ core.$constructor(\"$ZodString\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = [...(inst?._zod.bag?.patterns ?? [])].pop() ?? regexes.string(inst._zod.bag);\n inst._zod.parse = (payload, _) => {\n if (def.coerce)\n try {\n payload.value = String(payload.value);\n }\n catch (_) { }\n if (typeof payload.value === \"string\")\n return payload;\n payload.issues.push({\n expected: \"string\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodStringFormat\", (inst, def) => {\n // check initialization must come first\n checks.$ZodCheckStringFormat.init(inst, def);\n $ZodString.init(inst, def);\n});\nexport const $ZodGUID = /*@__PURE__*/ core.$constructor(\"$ZodGUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.guid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodUUID = /*@__PURE__*/ core.$constructor(\"$ZodUUID\", (inst, def) => {\n if (def.version) {\n const versionMap = {\n v1: 1,\n v2: 2,\n v3: 3,\n v4: 4,\n v5: 5,\n v6: 6,\n v7: 7,\n v8: 8,\n };\n const v = versionMap[def.version];\n if (v === undefined)\n throw new Error(`Invalid UUID version: \"${def.version}\"`);\n def.pattern ?? (def.pattern = regexes.uuid(v));\n }\n else\n def.pattern ?? (def.pattern = regexes.uuid());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodEmail = /*@__PURE__*/ core.$constructor(\"$ZodEmail\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.email);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodURL = /*@__PURE__*/ core.$constructor(\"$ZodURL\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n try {\n const url = new URL(payload.value);\n if (def.hostname) {\n def.hostname.lastIndex = 0;\n if (!def.hostname.test(url.hostname)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid hostname\",\n pattern: regexes.hostname.source,\n input: payload.value,\n inst,\n });\n }\n }\n if (def.protocol) {\n def.protocol.lastIndex = 0;\n if (!def.protocol.test(url.protocol.endsWith(\":\") ? url.protocol.slice(0, -1) : url.protocol)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid protocol\",\n pattern: def.protocol.source,\n input: payload.value,\n inst,\n });\n }\n }\n return;\n }\n catch (_) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n input: payload.value,\n inst,\n });\n }\n };\n});\nexport const $ZodEmoji = /*@__PURE__*/ core.$constructor(\"$ZodEmoji\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.emoji());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodNanoID = /*@__PURE__*/ core.$constructor(\"$ZodNanoID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.nanoid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCUID = /*@__PURE__*/ core.$constructor(\"$ZodCUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCUID2 = /*@__PURE__*/ core.$constructor(\"$ZodCUID2\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid2);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodULID = /*@__PURE__*/ core.$constructor(\"$ZodULID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ulid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodXID = /*@__PURE__*/ core.$constructor(\"$ZodXID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.xid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodKSUID = /*@__PURE__*/ core.$constructor(\"$ZodKSUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ksuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODateTime = /*@__PURE__*/ core.$constructor(\"$ZodISODateTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.datetime(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODate = /*@__PURE__*/ core.$constructor(\"$ZodISODate\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.date);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISOTime = /*@__PURE__*/ core.$constructor(\"$ZodISOTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.time(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODuration = /*@__PURE__*/ core.$constructor(\"$ZodISODuration\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.duration);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodIPv4 = /*@__PURE__*/ core.$constructor(\"$ZodIPv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv4);\n $ZodStringFormat.init(inst, def);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = `ipv4`;\n });\n});\nexport const $ZodIPv6 = /*@__PURE__*/ core.$constructor(\"$ZodIPv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv6);\n $ZodStringFormat.init(inst, def);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = `ipv6`;\n });\n inst._zod.check = (payload) => {\n try {\n new URL(`http://[${payload.value}]`);\n // return;\n }\n catch {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"ipv6\",\n input: payload.value,\n inst,\n });\n }\n };\n});\nexport const $ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv4);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv6); // not used for validation\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n const [address, prefix] = payload.value.split(\"/\");\n try {\n if (!prefix)\n throw new Error();\n const prefixNum = Number(prefix);\n if (`${prefixNum}` !== prefix)\n throw new Error();\n if (prefixNum < 0 || prefixNum > 128)\n throw new Error();\n new URL(`http://[${address}]`);\n }\n catch {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"cidrv6\",\n input: payload.value,\n inst,\n });\n }\n };\n});\n////////////////////////////// ZodBase64 //////////////////////////////\nexport function isValidBase64(data) {\n if (data === \"\")\n return true;\n if (data.length % 4 !== 0)\n return false;\n try {\n atob(data);\n return true;\n }\n catch {\n return false;\n }\n}\nexport const $ZodBase64 = /*@__PURE__*/ core.$constructor(\"$ZodBase64\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.base64);\n $ZodStringFormat.init(inst, def);\n inst._zod.onattach.push((inst) => {\n inst._zod.bag.contentEncoding = \"base64\";\n });\n inst._zod.check = (payload) => {\n if (isValidBase64(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64\",\n input: payload.value,\n inst,\n });\n };\n});\n////////////////////////////// ZodBase64 //////////////////////////////\nexport function isValidBase64URL(data) {\n if (!regexes.base64url.test(data))\n return false;\n const base64 = data.replace(/[-_]/g, (c) => (c === \"-\" ? \"+\" : \"/\"));\n const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, \"=\");\n return isValidBase64(padded);\n}\nexport const $ZodBase64URL = /*@__PURE__*/ core.$constructor(\"$ZodBase64URL\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.base64url);\n $ZodStringFormat.init(inst, def);\n inst._zod.onattach.push((inst) => {\n inst._zod.bag.contentEncoding = \"base64url\";\n });\n inst._zod.check = (payload) => {\n if (isValidBase64URL(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64url\",\n input: payload.value,\n inst,\n });\n };\n});\nexport const $ZodE164 = /*@__PURE__*/ core.$constructor(\"$ZodE164\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.e164);\n $ZodStringFormat.init(inst, def);\n});\n////////////////////////////// ZodJWT //////////////////////////////\nexport function isValidJWT(token, algorithm = null) {\n try {\n const tokensParts = token.split(\".\");\n if (tokensParts.length !== 3)\n return false;\n const [header] = tokensParts;\n const parsedHeader = JSON.parse(atob(header));\n if (\"typ\" in parsedHeader && parsedHeader?.typ !== \"JWT\")\n return false;\n if (!parsedHeader.alg)\n return false;\n if (algorithm && (!(\"alg\" in parsedHeader) || parsedHeader.alg !== algorithm))\n return false;\n return true;\n }\n catch {\n return false;\n }\n}\nexport const $ZodJWT = /*@__PURE__*/ core.$constructor(\"$ZodJWT\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (isValidJWT(payload.value, def.alg))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"jwt\",\n input: payload.value,\n inst,\n });\n };\n});\nexport const $ZodNumber = /*@__PURE__*/ core.$constructor(\"$ZodNumber\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = inst._zod.bag.pattern ?? regexes.number;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Number(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"number\" && !Number.isNaN(input) && Number.isFinite(input)) {\n return payload;\n }\n const received = typeof input === \"number\"\n ? Number.isNaN(input)\n ? \"NaN\"\n : !Number.isFinite(input)\n ? \"Infinity\"\n : undefined\n : undefined;\n payload.issues.push({\n expected: \"number\",\n code: \"invalid_type\",\n input,\n inst,\n ...(received ? { received } : {}),\n });\n return payload;\n };\n});\nexport const $ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodNumber\", (inst, def) => {\n checks.$ZodCheckNumberFormat.init(inst, def);\n $ZodNumber.init(inst, def); // no format checksp\n});\nexport const $ZodBoolean = /*@__PURE__*/ core.$constructor(\"$ZodBoolean\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.boolean;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Boolean(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"boolean\")\n return payload;\n payload.issues.push({\n expected: \"boolean\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigInt = /*@__PURE__*/ core.$constructor(\"$ZodBigInt\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.bigint;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = BigInt(payload.value);\n }\n catch (_) { }\n const { value: input } = payload;\n if (typeof input === \"bigint\")\n return payload;\n payload.issues.push({\n expected: \"bigint\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodBigInt\", (inst, def) => {\n checks.$ZodCheckBigIntFormat.init(inst, def);\n $ZodBigInt.init(inst, def); // no format checks\n});\nexport const $ZodSymbol = /*@__PURE__*/ core.$constructor(\"$ZodSymbol\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const { value: input } = payload;\n if (typeof input === \"symbol\")\n return payload;\n payload.issues.push({\n expected: \"symbol\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodUndefined = /*@__PURE__*/ core.$constructor(\"$ZodUndefined\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.undefined;\n inst._zod.values = new Set([undefined]);\n inst._zod.parse = (payload, _ctx) => {\n const { value: input } = payload;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"undefined\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodNull = /*@__PURE__*/ core.$constructor(\"$ZodNull\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.null;\n inst._zod.values = new Set([null]);\n inst._zod.parse = (payload, _ctx) => {\n const { value: input } = payload;\n if (input === null)\n return payload;\n payload.issues.push({\n expected: \"null\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodAny = /*@__PURE__*/ core.$constructor(\"$ZodAny\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodUnknown = /*@__PURE__*/ core.$constructor(\"$ZodUnknown\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodNever = /*@__PURE__*/ core.$constructor(\"$ZodNever\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n payload.issues.push({\n expected: \"never\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodVoid = /*@__PURE__*/ core.$constructor(\"$ZodVoid\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const { value: input } = payload;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"void\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodDate = /*@__PURE__*/ core.$constructor(\"$ZodDate\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce) {\n try {\n payload.value = new Date(payload.value);\n }\n catch (_err) { }\n }\n const input = payload.value;\n const isDate = input instanceof Date;\n const isValidDate = isDate && !Number.isNaN(input.getTime());\n if (isValidDate)\n return payload;\n payload.issues.push({\n expected: \"date\",\n code: \"invalid_type\",\n input,\n ...(isDate ? { received: \"Invalid Date\" } : {}),\n inst,\n });\n return payload;\n };\n});\nfunction handleArrayResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nexport const $ZodArray = /*@__PURE__*/ core.$constructor(\"$ZodArray\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n expected: \"array\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n payload.value = Array(input.length);\n const proms = [];\n for (let i = 0; i < input.length; i++) {\n const item = input[i];\n const result = def.element._zod.run({\n value: item,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleArrayResult(result, payload, i)));\n }\n else {\n handleArrayResult(result, payload, i);\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload; //handleArrayResultsAsync(parseResults, final);\n };\n});\nfunction handleObjectResult(result, final, key) {\n // if(isOptional)\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(key, result.issues));\n }\n final.value[key] = result.value;\n}\nfunction handleOptionalObjectResult(result, final, key, input) {\n if (result.issues.length) {\n // validation failed against value schema\n if (input[key] === undefined) {\n // if input was undefined, ignore the error\n if (key in input) {\n final.value[key] = undefined;\n }\n else {\n final.value[key] = result.value;\n }\n }\n else {\n final.issues.push(...util.prefixIssues(key, result.issues));\n }\n }\n else if (result.value === undefined) {\n // validation returned `undefined`\n if (key in input)\n final.value[key] = undefined;\n }\n else {\n // non-undefined value\n final.value[key] = result.value;\n }\n}\nexport const $ZodObject = /*@__PURE__*/ core.$constructor(\"$ZodObject\", (inst, def) => {\n $ZodType.init(inst, def);\n const _normalized = util.cached(() => {\n const keys = Object.keys(def.shape);\n for (const k of keys) {\n if (!(def.shape[k] instanceof $ZodType)) {\n throw new Error(`Invalid element at key \"${k}\": expected a Zod schema`);\n }\n }\n const okeys = util.optionalKeys(def.shape);\n return {\n shape: def.shape,\n keys,\n keySet: new Set(keys),\n numKeys: keys.length,\n optionalKeys: new Set(okeys),\n };\n });\n util.defineLazy(inst._zod, \"propValues\", () => {\n const shape = def.shape;\n const propValues = {};\n for (const key in shape) {\n const field = shape[key]._zod;\n if (field.values) {\n propValues[key] ?? (propValues[key] = new Set());\n for (const v of field.values)\n propValues[key].add(v);\n }\n }\n return propValues;\n });\n const generateFastpass = (shape) => {\n const doc = new Doc([\"shape\", \"payload\", \"ctx\"]);\n const { keys, optionalKeys } = _normalized.value;\n const parseStr = (key) => {\n const k = util.esc(key);\n return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;\n };\n doc.write(`const input = payload.value;`);\n const ids = Object.create(null);\n for (const key of keys) {\n ids[key] = util.randomString(15);\n }\n // A: preserve key order {\n doc.write(`const newResult = {}`);\n for (const key of keys) {\n if (optionalKeys.has(key)) {\n const id = ids[key];\n doc.write(`const ${id} = ${parseStr(key)};`);\n const k = util.esc(key);\n doc.write(`\n if (${id}.issues.length) {\n if (input[${k}] === undefined) {\n if (${k} in input) {\n newResult[${k}] = undefined;\n }\n } else {\n payload.issues = payload.issues.concat(\n ${id}.issues.map((iss) => ({\n ...iss,\n path: iss.path ? [${k}, ...iss.path] : [${k}],\n }))\n );\n }\n } else if (${id}.value === undefined) {\n if (${k} in input) newResult[${k}] = undefined;\n } else {\n newResult[${k}] = ${id}.value;\n }\n `);\n }\n else {\n const id = ids[key];\n // const id = ids[key];\n doc.write(`const ${id} = ${parseStr(key)};`);\n doc.write(`\n if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${util.esc(key)}, ...iss.path] : [${util.esc(key)}]\n })));`);\n doc.write(`newResult[${util.esc(key)}] = ${id}.value`);\n }\n }\n doc.write(`payload.value = newResult;`);\n doc.write(`return payload;`);\n const fn = doc.compile();\n return (payload, ctx) => fn(shape, payload, ctx);\n };\n let fastpass;\n const isObject = util.isObject;\n const jit = !core.globalConfig.jitless;\n const allowsEval = util.allowsEval;\n const fastEnabled = jit && allowsEval.value; // && !def.catchall;\n const { catchall } = def;\n let value;\n inst._zod.parse = (payload, ctx) => {\n value ?? (value = _normalized.value);\n const input = payload.value;\n if (!isObject(input)) {\n payload.issues.push({\n expected: \"object\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {\n // always synchronous\n if (!fastpass)\n fastpass = generateFastpass(def.shape);\n payload = fastpass(payload, ctx);\n }\n else {\n payload.value = {};\n const shape = value.shape;\n for (const key of value.keys) {\n const el = shape[key];\n // do not add omitted optional keys\n // if (!(key in input)) {\n // if (optionalKeys.has(key)) continue;\n // payload.issues.push({\n // code: \"invalid_type\",\n // path: [key],\n // expected: \"nonoptional\",\n // note: `Missing required key: \"${key}\"`,\n // input,\n // inst,\n // });\n // }\n const r = el._zod.run({ value: input[key], issues: [] }, ctx);\n const isOptional = el._zod.optin === \"optional\" && el._zod.optout === \"optional\";\n if (r instanceof Promise) {\n proms.push(r.then((r) => isOptional ? handleOptionalObjectResult(r, payload, key, input) : handleObjectResult(r, payload, key)));\n }\n else {\n if (isOptional) {\n handleOptionalObjectResult(r, payload, key, input);\n }\n else {\n handleObjectResult(r, payload, key);\n }\n }\n }\n }\n if (!catchall) {\n // return payload;\n return proms.length ? Promise.all(proms).then(() => payload) : payload;\n }\n const unrecognized = [];\n // iterate over input keys\n const keySet = value.keySet;\n const _catchall = catchall._zod;\n const t = _catchall.def.type;\n for (const key of Object.keys(input)) {\n if (keySet.has(key))\n continue;\n if (t === \"never\") {\n unrecognized.push(key);\n continue;\n }\n const r = _catchall.run({ value: input[key], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((r) => handleObjectResult(r, payload, key)));\n }\n else {\n handleObjectResult(r, payload, key);\n }\n }\n if (unrecognized.length) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n keys: unrecognized,\n input,\n inst,\n });\n }\n if (!proms.length)\n return payload;\n return Promise.all(proms).then(() => {\n return payload;\n });\n };\n});\nfunction handleUnionResults(results, final, inst, ctx) {\n for (const result of results) {\n if (result.issues.length === 0) {\n final.value = result.value;\n return final;\n }\n }\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n });\n return final;\n}\nexport const $ZodUnion = /*@__PURE__*/ core.$constructor(\"$ZodUnion\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => {\n if (def.options.every((o) => o._zod.values)) {\n return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));\n }\n return undefined;\n });\n util.defineLazy(inst._zod, \"pattern\", () => {\n if (def.options.every((o) => o._zod.pattern)) {\n const patterns = def.options.map((o) => o._zod.pattern);\n return new RegExp(`^(${patterns.map((p) => util.cleanRegex(p.source)).join(\"|\")})$`);\n }\n return undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n let async = false;\n const results = [];\n for (const option of def.options) {\n const result = option._zod.run({\n value: payload.value,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n results.push(result);\n async = true;\n }\n else {\n if (result.issues.length === 0)\n return result;\n results.push(result);\n }\n }\n if (!async)\n return handleUnionResults(results, payload, inst, ctx);\n return Promise.all(results).then((results) => {\n return handleUnionResults(results, payload, inst, ctx);\n });\n };\n});\nexport const $ZodDiscriminatedUnion = \n/*@__PURE__*/\ncore.$constructor(\"$ZodDiscriminatedUnion\", (inst, def) => {\n $ZodUnion.init(inst, def);\n const _super = inst._zod.parse;\n util.defineLazy(inst._zod, \"propValues\", () => {\n const propValues = {};\n for (const option of def.options) {\n const pv = option._zod.propValues;\n if (!pv || Object.keys(pv).length === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(option)}\"`);\n for (const [k, v] of Object.entries(pv)) {\n if (!propValues[k])\n propValues[k] = new Set();\n for (const val of v) {\n propValues[k].add(val);\n }\n }\n }\n return propValues;\n });\n const disc = util.cached(() => {\n const opts = def.options;\n const map = new Map();\n for (const o of opts) {\n const values = o._zod.propValues[def.discriminator];\n if (!values || values.size === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(o)}\"`);\n for (const v of values) {\n if (map.has(v)) {\n throw new Error(`Duplicate discriminator value \"${String(v)}\"`);\n }\n map.set(v, o);\n }\n }\n return map;\n });\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isObject(input)) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"object\",\n input,\n inst,\n });\n return payload;\n }\n const opt = disc.value.get(input?.[def.discriminator]);\n if (opt) {\n return opt._zod.run(payload, ctx);\n }\n if (def.unionFallback) {\n return _super(payload, ctx);\n }\n // no matching discriminator\n payload.issues.push({\n code: \"invalid_union\",\n errors: [],\n note: \"No matching discriminator\",\n input,\n path: [def.discriminator],\n inst,\n });\n return payload;\n };\n});\nexport const $ZodIntersection = /*@__PURE__*/ core.$constructor(\"$ZodIntersection\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const { value: input } = payload;\n const left = def.left._zod.run({ value: input, issues: [] }, ctx);\n const right = def.right._zod.run({ value: input, issues: [] }, ctx);\n const async = left instanceof Promise || right instanceof Promise;\n if (async) {\n return Promise.all([left, right]).then(([left, right]) => {\n return handleIntersectionResults(payload, left, right);\n });\n }\n return handleIntersectionResults(payload, left, right);\n };\n});\nfunction mergeValues(a, b) {\n // const aType = parse.t(a);\n // const bType = parse.t(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n if (a instanceof Date && b instanceof Date && +a === +b) {\n return { valid: true, data: a };\n }\n if (util.isPlainObject(a) && util.isPlainObject(b)) {\n const bKeys = Object.keys(b);\n const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [key, ...sharedValue.mergeErrorPath],\n };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) {\n return { valid: false, mergeErrorPath: [] };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [index, ...sharedValue.mergeErrorPath],\n };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n return { valid: false, mergeErrorPath: [] };\n}\nfunction handleIntersectionResults(result, left, right) {\n if (left.issues.length) {\n result.issues.push(...left.issues);\n }\n if (right.issues.length) {\n result.issues.push(...right.issues);\n }\n if (util.aborted(result))\n return result;\n const merged = mergeValues(left.value, right.value);\n if (!merged.valid) {\n throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);\n }\n result.value = merged.data;\n return result;\n}\nexport const $ZodTuple = /*@__PURE__*/ core.$constructor(\"$ZodTuple\", (inst, def) => {\n $ZodType.init(inst, def);\n const items = def.items;\n const optStart = items.length - [...items].reverse().findIndex((item) => item._zod.optin !== \"optional\");\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n input,\n inst,\n expected: \"tuple\",\n code: \"invalid_type\",\n });\n return payload;\n }\n payload.value = [];\n const proms = [];\n if (!def.rest) {\n const tooBig = input.length > items.length;\n const tooSmall = input.length < optStart - 1;\n if (tooBig || tooSmall) {\n payload.issues.push({\n input,\n inst,\n origin: \"array\",\n ...(tooBig ? { code: \"too_big\", maximum: items.length } : { code: \"too_small\", minimum: items.length }),\n });\n return payload;\n }\n }\n let i = -1;\n for (const item of items) {\n i++;\n if (i >= input.length)\n if (i >= optStart)\n continue;\n const result = item._zod.run({\n value: input[i],\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleTupleResult(result, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n if (def.rest) {\n const rest = input.slice(items.length);\n for (const el of rest) {\n i++;\n const result = def.rest._zod.run({\n value: el,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleTupleResult(result, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleTupleResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nexport const $ZodRecord = /*@__PURE__*/ core.$constructor(\"$ZodRecord\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isPlainObject(input)) {\n payload.issues.push({\n expected: \"record\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n if (def.keyType._zod.values) {\n const values = def.keyType._zod.values;\n payload.value = {};\n for (const key of values) {\n if (typeof key === \"string\" || typeof key === \"number\" || typeof key === \"symbol\") {\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[key] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[key] = result.value;\n }\n }\n }\n let unrecognized;\n for (const key in input) {\n if (!values.has(key)) {\n unrecognized = unrecognized ?? [];\n unrecognized.push(key);\n }\n }\n if (unrecognized && unrecognized.length > 0) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n input,\n inst,\n keys: unrecognized,\n });\n }\n }\n else {\n payload.value = {};\n for (const key of Reflect.ownKeys(input)) {\n if (key === \"__proto__\")\n continue;\n const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n if (keyResult instanceof Promise) {\n throw new Error(\"Async schemas not supported in object keys currently\");\n }\n if (keyResult.issues.length) {\n payload.issues.push({\n origin: \"record\",\n code: \"invalid_key\",\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n input: key,\n path: [key],\n inst,\n });\n payload.value[keyResult.value] = keyResult.value;\n continue;\n }\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[keyResult.value] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[keyResult.value] = result.value;\n }\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload;\n };\n});\nexport const $ZodMap = /*@__PURE__*/ core.$constructor(\"$ZodMap\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Map)) {\n payload.issues.push({\n expected: \"map\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n payload.value = new Map();\n for (const [key, value] of input) {\n const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);\n if (keyResult instanceof Promise || valueResult instanceof Promise) {\n proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }));\n }\n else {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {\n if (keyResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, keyResult.issues));\n }\n else {\n final.issues.push({\n origin: \"map\",\n code: \"invalid_key\",\n input,\n inst,\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n if (valueResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, valueResult.issues));\n }\n else {\n final.issues.push({\n origin: \"map\",\n code: \"invalid_element\",\n input,\n inst,\n key: key,\n issues: valueResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n final.value.set(keyResult.value, valueResult.value);\n}\nexport const $ZodSet = /*@__PURE__*/ core.$constructor(\"$ZodSet\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Set)) {\n payload.issues.push({\n input,\n inst,\n expected: \"set\",\n code: \"invalid_type\",\n });\n return payload;\n }\n const proms = [];\n payload.value = new Set();\n for (const item of input) {\n const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleSetResult(result, payload)));\n }\n else\n handleSetResult(result, payload);\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleSetResult(result, final) {\n if (result.issues.length) {\n final.issues.push(...result.issues);\n }\n final.value.add(result.value);\n}\nexport const $ZodEnum = /*@__PURE__*/ core.$constructor(\"$ZodEnum\", (inst, def) => {\n $ZodType.init(inst, def);\n const values = util.getEnumValues(def.entries);\n inst._zod.values = new Set(values);\n inst._zod.pattern = new RegExp(`^(${values\n .filter((k) => util.propertyKeyTypes.has(typeof k))\n .map((o) => (typeof o === \"string\" ? util.escapeRegex(o) : o.toString()))\n .join(\"|\")})$`);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (inst._zod.values.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodLiteral = /*@__PURE__*/ core.$constructor(\"$ZodLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.values = new Set(def.values);\n inst._zod.pattern = new RegExp(`^(${def.values\n .map((o) => (typeof o === \"string\" ? util.escapeRegex(o) : o ? o.toString() : String(o)))\n .join(\"|\")})$`);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (inst._zod.values.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values: def.values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodFile = /*@__PURE__*/ core.$constructor(\"$ZodFile\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (input instanceof File)\n return payload;\n payload.issues.push({\n expected: \"file\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodTransform = /*@__PURE__*/ core.$constructor(\"$ZodTransform\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const _out = def.transform(payload.value, payload);\n if (_ctx.async) {\n const output = _out instanceof Promise ? _out : Promise.resolve(_out);\n return output.then((output) => {\n payload.value = output;\n return payload;\n });\n }\n if (_out instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n payload.value = _out;\n return payload;\n };\n});\nexport const $ZodOptional = /*@__PURE__*/ core.$constructor(\"$ZodOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n inst._zod.optout = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => {\n return def.innerType._zod.values ? new Set([...def.innerType._zod.values, undefined]) : undefined;\n });\n util.defineLazy(inst._zod, \"pattern\", () => {\n const pattern = def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n if (payload.value === undefined) {\n return payload;\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNullable = /*@__PURE__*/ core.$constructor(\"$ZodNullable\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n util.defineLazy(inst._zod, \"pattern\", () => {\n const pattern = def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;\n });\n util.defineLazy(inst._zod, \"values\", () => {\n return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n if (payload.value === null)\n return payload;\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodDefault = /*@__PURE__*/ core.$constructor(\"$ZodDefault\", (inst, def) => {\n $ZodType.init(inst, def);\n // inst._zod.qin = \"true\";\n inst._zod.optin = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n /**\n * $ZodDefault always returns the default value immediately.\n * It doesn't pass the default value into the validator (\"prefault\"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a \"prefault\" for the pipe. */\n return payload;\n }\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleDefaultResult(result, def));\n }\n return handleDefaultResult(result, def);\n };\n});\nfunction handleDefaultResult(payload, def) {\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return payload;\n}\nexport const $ZodPrefault = /*@__PURE__*/ core.$constructor(\"$ZodPrefault\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNonOptional = /*@__PURE__*/ core.$constructor(\"$ZodNonOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => {\n const v = def.innerType._zod.values;\n return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleNonOptionalResult(result, inst));\n }\n return handleNonOptionalResult(result, inst);\n };\n});\nfunction handleNonOptionalResult(payload, inst) {\n if (!payload.issues.length && payload.value === undefined) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"nonoptional\",\n input: payload.value,\n inst,\n });\n }\n return payload;\n}\nexport const $ZodSuccess = /*@__PURE__*/ core.$constructor(\"$ZodSuccess\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => {\n payload.value = result.issues.length === 0;\n return payload;\n });\n }\n payload.value = result.issues.length === 0;\n return payload;\n };\n});\nexport const $ZodCatch = /*@__PURE__*/ core.$constructor(\"$ZodCatch\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => {\n payload.value = result.value;\n if (result.issues.length) {\n payload.value = def.catchValue({\n ...payload,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n payload.issues = [];\n }\n return payload;\n });\n }\n payload.value = result.value;\n if (result.issues.length) {\n payload.value = def.catchValue({\n ...payload,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n payload.issues = [];\n }\n return payload;\n };\n});\nexport const $ZodNaN = /*@__PURE__*/ core.$constructor(\"$ZodNaN\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"number\" || !Number.isNaN(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"nan\",\n code: \"invalid_type\",\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodPipe = /*@__PURE__*/ core.$constructor(\"$ZodPipe\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => def.in._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.in._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.out._zod.optout);\n inst._zod.parse = (payload, ctx) => {\n const left = def.in._zod.run(payload, ctx);\n if (left instanceof Promise) {\n return left.then((left) => handlePipeResult(left, def, ctx));\n }\n return handlePipeResult(left, def, ctx);\n };\n});\nfunction handlePipeResult(left, def, ctx) {\n if (util.aborted(left)) {\n return left;\n }\n return def.out._zod.run({ value: left.value, issues: left.issues }, ctx);\n}\nexport const $ZodReadonly = /*@__PURE__*/ core.$constructor(\"$ZodReadonly\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"propValues\", () => def.innerType._zod.propValues);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n inst._zod.parse = (payload, ctx) => {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then(handleReadonlyResult);\n }\n return handleReadonlyResult(result);\n };\n});\nfunction handleReadonlyResult(payload) {\n payload.value = Object.freeze(payload.value);\n return payload;\n}\nexport const $ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"$ZodTemplateLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n const regexParts = [];\n for (const part of def.parts) {\n if (part instanceof $ZodType) {\n if (!part._zod.pattern) {\n // if (!source)\n throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);\n }\n const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;\n if (!source)\n throw new Error(`Invalid template literal part: ${part._zod.traits}`);\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n regexParts.push(source.slice(start, end));\n }\n else if (part === null || util.primitiveTypes.has(typeof part)) {\n regexParts.push(util.escapeRegex(`${part}`));\n }\n else {\n throw new Error(`Invalid template literal part: ${part}`);\n }\n }\n inst._zod.pattern = new RegExp(`^${regexParts.join(\"\")}$`);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"string\") {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"template_literal\",\n code: \"invalid_type\",\n });\n return payload;\n }\n inst._zod.pattern.lastIndex = 0;\n if (!inst._zod.pattern.test(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n code: \"invalid_format\",\n format: \"template_literal\",\n pattern: inst._zod.pattern.source,\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodPromise = /*@__PURE__*/ core.$constructor(\"$ZodPromise\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx));\n };\n});\nexport const $ZodLazy = /*@__PURE__*/ core.$constructor(\"$ZodLazy\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"innerType\", () => def.getter());\n util.defineLazy(inst._zod, \"pattern\", () => inst._zod.innerType._zod.pattern);\n util.defineLazy(inst._zod, \"propValues\", () => inst._zod.innerType._zod.propValues);\n util.defineLazy(inst._zod, \"optin\", () => inst._zod.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => inst._zod.innerType._zod.optout);\n inst._zod.parse = (payload, ctx) => {\n const inner = inst._zod.innerType;\n return inner._zod.run(payload, ctx);\n };\n});\nexport const $ZodCustom = /*@__PURE__*/ core.$constructor(\"$ZodCustom\", (inst, def) => {\n checks.$ZodCheck.init(inst, def);\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _) => {\n return payload;\n };\n inst._zod.check = (payload) => {\n const input = payload.value;\n const r = def.fn(input);\n if (r instanceof Promise) {\n return r.then((r) => handleRefineResult(r, payload, input, inst));\n }\n handleRefineResult(r, payload, input, inst);\n return;\n };\n});\nfunction handleRefineResult(result, payload, input, inst) {\n if (!result) {\n const _iss = {\n code: \"custom\",\n input,\n inst, // incorporates params.error into issue reporting\n path: [...(inst._zod.def.path ?? [])], // incorporates params.error into issue reporting\n continue: !inst._zod.def.abort,\n // params: inst._zod.def.params,\n };\n if (inst._zod.def.params)\n _iss.params = inst._zod.def.params;\n payload.issues.push(util.issue(_iss));\n }\n}\n","export const $output = Symbol(\"ZodOutput\");\nexport const $input = Symbol(\"ZodInput\");\nexport class $ZodRegistry {\n constructor() {\n this._map = new WeakMap();\n this._idmap = new Map();\n }\n add(schema, ..._meta) {\n const meta = _meta[0];\n this._map.set(schema, meta);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n if (this._idmap.has(meta.id)) {\n throw new Error(`ID ${meta.id} already exists in the registry`);\n }\n this._idmap.set(meta.id, schema);\n }\n return this;\n }\n remove(schema) {\n this._map.delete(schema);\n return this;\n }\n get(schema) {\n // return this._map.get(schema) as any;\n // inherit metadata\n const p = schema._zod.parent;\n if (p) {\n const pm = { ...(this.get(p) ?? {}) };\n delete pm.id; // do not inherit id\n return { ...pm, ...this._map.get(schema) };\n }\n return this._map.get(schema);\n }\n has(schema) {\n return this._map.has(schema);\n }\n}\n// registries\nexport function registry() {\n return new $ZodRegistry();\n}\nexport const globalRegistry = /*@__PURE__*/ registry();\n","import * as checks from \"./checks.js\";\nimport * as schemas from \"./schemas.js\";\nimport * as util from \"./util.js\";\nexport function _string(Class, params) {\n return new Class({\n type: \"string\",\n ...util.normalizeParams(params),\n });\n}\nexport function _coercedString(Class, params) {\n return new Class({\n type: \"string\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\nexport function _email(Class, params) {\n return new Class({\n type: \"string\",\n format: \"email\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _guid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"guid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _uuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _uuidv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v4\",\n ...util.normalizeParams(params),\n });\n}\nexport function _uuidv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v6\",\n ...util.normalizeParams(params),\n });\n}\nexport function _uuidv7(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v7\",\n ...util.normalizeParams(params),\n });\n}\nexport function _url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _emoji(Class, params) {\n return new Class({\n type: \"string\",\n format: \"emoji\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _nanoid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"nanoid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _cuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _cuid2(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid2\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _ulid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ulid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _xid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"xid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _ksuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ksuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _ipv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _ipv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _cidrv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _cidrv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _base64(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _base64url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _e164(Class, params) {\n return new Class({\n type: \"string\",\n format: \"e164\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _jwt(Class, params) {\n return new Class({\n type: \"string\",\n format: \"jwt\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _isoDateTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"datetime\",\n check: \"string_format\",\n offset: false,\n local: false,\n precision: null,\n ...util.normalizeParams(params),\n });\n}\nexport function _isoDate(Class, params) {\n return new Class({\n type: \"string\",\n format: \"date\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\nexport function _isoTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"time\",\n check: \"string_format\",\n precision: null,\n ...util.normalizeParams(params),\n });\n}\nexport function _isoDuration(Class, params) {\n return new Class({\n type: \"string\",\n format: \"duration\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\nexport function _number(Class, params) {\n return new Class({\n type: \"number\",\n checks: [],\n ...util.normalizeParams(params),\n });\n}\nexport function _coercedNumber(Class, params) {\n return new Class({\n type: \"number\",\n coerce: true,\n checks: [],\n ...util.normalizeParams(params),\n });\n}\nexport function _int(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"safeint\",\n ...util.normalizeParams(params),\n });\n}\nexport function _float32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float32\",\n ...util.normalizeParams(params),\n });\n}\nexport function _float64(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float64\",\n ...util.normalizeParams(params),\n });\n}\nexport function _int32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"int32\",\n ...util.normalizeParams(params),\n });\n}\nexport function _uint32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"uint32\",\n ...util.normalizeParams(params),\n });\n}\nexport function _boolean(Class, params) {\n return new Class({\n type: \"boolean\",\n ...util.normalizeParams(params),\n });\n}\nexport function _coercedBoolean(Class, params) {\n return new Class({\n type: \"boolean\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\nexport function _bigint(Class, params) {\n return new Class({\n type: \"bigint\",\n ...util.normalizeParams(params),\n });\n}\nexport function _coercedBigint(Class, params) {\n return new Class({\n type: \"bigint\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\nexport function _int64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"int64\",\n ...util.normalizeParams(params),\n });\n}\nexport function _uint64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"uint64\",\n ...util.normalizeParams(params),\n });\n}\nexport function _symbol(Class, params) {\n return new Class({\n type: \"symbol\",\n ...util.normalizeParams(params),\n });\n}\nexport function _undefined(Class, params) {\n return new Class({\n type: \"undefined\",\n ...util.normalizeParams(params),\n });\n}\nexport function _null(Class, params) {\n return new Class({\n type: \"null\",\n ...util.normalizeParams(params),\n });\n}\nexport function _any(Class) {\n return new Class({\n type: \"any\",\n });\n}\nexport function _unknown(Class) {\n return new Class({\n type: \"unknown\",\n });\n}\nexport function _never(Class, params) {\n return new Class({\n type: \"never\",\n ...util.normalizeParams(params),\n });\n}\nexport function _void(Class, params) {\n return new Class({\n type: \"void\",\n ...util.normalizeParams(params),\n });\n}\nexport function _date(Class, params) {\n return new Class({\n type: \"date\",\n ...util.normalizeParams(params),\n });\n}\nexport function _coercedDate(Class, params) {\n return new Class({\n type: \"date\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\nexport function _nan(Class, params) {\n return new Class({\n type: \"nan\",\n ...util.normalizeParams(params),\n });\n}\nexport function _lt(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\nexport function _lte(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.lte()` instead. */\n_lte as _max, };\nexport function _gt(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\nexport function _gte(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.gte()` instead. */\n_gte as _min, };\nexport function _positive(params) {\n return _gt(0, params);\n}\n// negative\nexport function _negative(params) {\n return _lt(0, params);\n}\n// nonpositive\nexport function _nonpositive(params) {\n return _lte(0, params);\n}\n// nonnegative\nexport function _nonnegative(params) {\n return _gte(0, params);\n}\nexport function _multipleOf(value, params) {\n return new checks.$ZodCheckMultipleOf({\n check: \"multiple_of\",\n ...util.normalizeParams(params),\n value,\n });\n}\nexport function _maxSize(maximum, params) {\n return new checks.$ZodCheckMaxSize({\n check: \"max_size\",\n ...util.normalizeParams(params),\n maximum,\n });\n}\nexport function _minSize(minimum, params) {\n return new checks.$ZodCheckMinSize({\n check: \"min_size\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\nexport function _size(size, params) {\n return new checks.$ZodCheckSizeEquals({\n check: \"size_equals\",\n ...util.normalizeParams(params),\n size,\n });\n}\nexport function _maxLength(maximum, params) {\n const ch = new checks.$ZodCheckMaxLength({\n check: \"max_length\",\n ...util.normalizeParams(params),\n maximum,\n });\n return ch;\n}\nexport function _minLength(minimum, params) {\n return new checks.$ZodCheckMinLength({\n check: \"min_length\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\nexport function _length(length, params) {\n return new checks.$ZodCheckLengthEquals({\n check: \"length_equals\",\n ...util.normalizeParams(params),\n length,\n });\n}\nexport function _regex(pattern, params) {\n return new checks.$ZodCheckRegex({\n check: \"string_format\",\n format: \"regex\",\n ...util.normalizeParams(params),\n pattern,\n });\n}\nexport function _lowercase(params) {\n return new checks.$ZodCheckLowerCase({\n check: \"string_format\",\n format: \"lowercase\",\n ...util.normalizeParams(params),\n });\n}\nexport function _uppercase(params) {\n return new checks.$ZodCheckUpperCase({\n check: \"string_format\",\n format: \"uppercase\",\n ...util.normalizeParams(params),\n });\n}\nexport function _includes(includes, params) {\n return new checks.$ZodCheckIncludes({\n check: \"string_format\",\n format: \"includes\",\n ...util.normalizeParams(params),\n includes,\n });\n}\nexport function _startsWith(prefix, params) {\n return new checks.$ZodCheckStartsWith({\n check: \"string_format\",\n format: \"starts_with\",\n ...util.normalizeParams(params),\n prefix,\n });\n}\nexport function _endsWith(suffix, params) {\n return new checks.$ZodCheckEndsWith({\n check: \"string_format\",\n format: \"ends_with\",\n ...util.normalizeParams(params),\n suffix,\n });\n}\nexport function _property(property, schema, params) {\n return new checks.$ZodCheckProperty({\n check: \"property\",\n property,\n schema,\n ...util.normalizeParams(params),\n });\n}\nexport function _mime(types, params) {\n return new checks.$ZodCheckMimeType({\n check: \"mime_type\",\n mime: types,\n ...util.normalizeParams(params),\n });\n}\nexport function _overwrite(tx) {\n return new checks.$ZodCheckOverwrite({\n check: \"overwrite\",\n tx,\n });\n}\n// normalize\nexport function _normalize(form) {\n return _overwrite((input) => input.normalize(form));\n}\n// trim\nexport function _trim() {\n return _overwrite((input) => input.trim());\n}\n// toLowerCase\nexport function _toLowerCase() {\n return _overwrite((input) => input.toLowerCase());\n}\n// toUpperCase\nexport function _toUpperCase() {\n return _overwrite((input) => input.toUpperCase());\n}\nexport function _array(Class, element, params) {\n return new Class({\n type: \"array\",\n element,\n // get element() {\n // return element;\n // },\n ...util.normalizeParams(params),\n });\n}\nexport function _union(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n ...util.normalizeParams(params),\n });\n}\nexport function _discriminatedUnion(Class, discriminator, options, params) {\n return new Class({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\nexport function _intersection(Class, left, right) {\n return new Class({\n type: \"intersection\",\n left,\n right,\n });\n}\n// export function _tuple(\n// Class: util.SchemaClass<schemas.$ZodTuple>,\n// items: [],\n// params?: string | $ZodTupleParams\n// ): schemas.$ZodTuple<[], null>;\nexport function _tuple(Class, items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof schemas.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new Class({\n type: \"tuple\",\n items,\n rest,\n ...util.normalizeParams(params),\n });\n}\nexport function _record(Class, keyType, valueType, params) {\n return new Class({\n type: \"record\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\nexport function _map(Class, keyType, valueType, params) {\n return new Class({\n type: \"map\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\nexport function _set(Class, valueType, params) {\n return new Class({\n type: \"set\",\n valueType,\n ...util.normalizeParams(params),\n });\n}\nexport function _enum(Class, values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n // if (Array.isArray(values)) {\n // for (const value of values) {\n // entries[value] = value;\n // }\n // } else {\n // Object.assign(entries, values);\n // }\n // const entries: util.EnumLike = {};\n // for (const val of values) {\n // entries[val] = val;\n // }\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function _nativeEnum(Class, entries, params) {\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport function _literal(Class, value, params) {\n return new Class({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\nexport function _file(Class, params) {\n return new Class({\n type: \"file\",\n ...util.normalizeParams(params),\n });\n}\nexport function _transform(Class, fn) {\n return new Class({\n type: \"transform\",\n transform: fn,\n });\n}\nexport function _optional(Class, innerType) {\n return new Class({\n type: \"optional\",\n innerType,\n });\n}\nexport function _nullable(Class, innerType) {\n return new Class({\n type: \"nullable\",\n innerType,\n });\n}\nexport function _default(Class, innerType, defaultValue) {\n return new Class({\n type: \"default\",\n innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : defaultValue;\n },\n });\n}\nexport function _nonoptional(Class, innerType, params) {\n return new Class({\n type: \"nonoptional\",\n innerType,\n ...util.normalizeParams(params),\n });\n}\nexport function _success(Class, innerType) {\n return new Class({\n type: \"success\",\n innerType,\n });\n}\nexport function _catch(Class, innerType, catchValue) {\n return new Class({\n type: \"catch\",\n innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\nexport function _pipe(Class, in_, out) {\n return new Class({\n type: \"pipe\",\n in: in_,\n out,\n });\n}\nexport function _readonly(Class, innerType) {\n return new Class({\n type: \"readonly\",\n innerType,\n });\n}\nexport function _templateLiteral(Class, parts, params) {\n return new Class({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\nexport function _lazy(Class, getter) {\n return new Class({\n type: \"lazy\",\n getter,\n });\n}\nexport function _promise(Class, innerType) {\n return new Class({\n type: \"promise\",\n innerType,\n });\n}\nexport function _custom(Class, fn, _params) {\n const norm = util.normalizeParams(_params);\n norm.abort ?? (norm.abort = true); // default to abort:false\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...norm,\n });\n return schema;\n}\n// export function _refine<T>(\n// Class: util.SchemaClass<schemas.$ZodCustom>,\n// fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>,\n// _params: string | $ZodCustomParams = {}\n// ): checks.$ZodCheck<T> {\n// return _custom(Class, fn, _params);\n// }\n// same as _custom but deafults to abort:false\nexport function _refine(Class, fn, _params) {\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...util.normalizeParams(_params),\n });\n return schema;\n}\nexport function _stringbool(Classes, _params) {\n const { case: _case, error, truthy, falsy } = util.normalizeParams(_params);\n const trueValues = new Set(truthy ?? [\"true\", \"1\", \"yes\", \"on\", \"y\", \"enabled\"]);\n const falseValues = new Set(falsy ?? [\"false\", \"0\", \"no\", \"off\", \"n\", \"disabled\"]);\n const _Pipe = Classes.Pipe ?? schemas.$ZodPipe;\n const _Boolean = Classes.Boolean ?? schemas.$ZodBoolean;\n const _Unknown = Classes.Unknown ?? schemas.$ZodUnknown;\n const inst = new _Unknown({\n type: \"unknown\",\n checks: [\n {\n _zod: {\n check: (ctx) => {\n if (typeof ctx.value === \"string\") {\n let data = ctx.value;\n if (_case !== \"sensitive\")\n data = data.toLowerCase();\n if (trueValues.has(data)) {\n ctx.value = true;\n }\n else if (falseValues.has(data)) {\n ctx.value = false;\n }\n else {\n ctx.issues.push({\n code: \"invalid_value\",\n expected: \"stringbool\",\n values: [...trueValues, ...falseValues],\n input: ctx.value,\n inst,\n });\n }\n }\n else {\n ctx.issues.push({\n code: \"invalid_type\",\n expected: \"string\",\n input: ctx.value,\n });\n }\n },\n def: {\n check: \"custom\",\n },\n onattach: [],\n },\n },\n ],\n error,\n });\n return new _Pipe({\n type: \"pipe\",\n in: inst,\n out: new _Boolean({\n type: \"boolean\",\n error,\n }),\n error,\n });\n}\n","import * as core from \"zod/v4/core\";\nimport * as schemas from \"./schemas.js\";\nexport const ZodISODateTime = /*@__PURE__*/ core.$constructor(\"ZodISODateTime\", (inst, def) => {\n core.$ZodISODateTime.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function datetime(params) {\n return core._isoDateTime(ZodISODateTime, params);\n}\nexport const ZodISODate = /*@__PURE__*/ core.$constructor(\"ZodISODate\", (inst, def) => {\n core.$ZodISODate.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function date(params) {\n return core._isoDate(ZodISODate, params);\n}\nexport const ZodISOTime = /*@__PURE__*/ core.$constructor(\"ZodISOTime\", (inst, def) => {\n core.$ZodISOTime.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function time(params) {\n return core._isoTime(ZodISOTime, params);\n}\nexport const ZodISODuration = /*@__PURE__*/ core.$constructor(\"ZodISODuration\", (inst, def) => {\n core.$ZodISODuration.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function duration(params) {\n return core._isoDuration(ZodISODuration, params);\n}\n","import * as core from \"zod/v4/core\";\nimport { $ZodError } from \"zod/v4/core\";\nconst initializer = (inst, issues) => {\n $ZodError.init(inst, issues);\n inst.name = \"ZodError\";\n Object.defineProperties(inst, {\n format: {\n value: (mapper) => core.formatError(inst, mapper),\n // enumerable: false,\n },\n flatten: {\n value: (mapper) => core.flattenError(inst, mapper),\n // enumerable: false,\n },\n addIssue: {\n value: (issue) => inst.issues.push(issue),\n // enumerable: false,\n },\n addIssues: {\n value: (issues) => inst.issues.push(...issues),\n // enumerable: false,\n },\n isEmpty: {\n get() {\n return inst.issues.length === 0;\n },\n // enumerable: false,\n },\n });\n // Object.defineProperty(inst, \"isEmpty\", {\n // get() {\n // return inst.issues.length === 0;\n // },\n // });\n};\nexport const ZodError = core.$constructor(\"ZodError\", initializer);\nexport const ZodRealError = core.$constructor(\"ZodError\", initializer, {\n Parent: Error,\n});\n// /** @deprecated Use `z.core.$ZodErrorMapCtx` instead. */\n// export type ErrorMapCtx = core.$ZodErrorMapCtx;\n","import * as core from \"zod/v4/core\";\nimport { ZodRealError } from \"./errors.js\";\nexport const parse = /* @__PURE__ */ core._parse(ZodRealError);\nexport const parseAsync = /* @__PURE__ */ core._parseAsync(ZodRealError);\nexport const safeParse = /* @__PURE__ */ core._safeParse(ZodRealError);\nexport const safeParseAsync = /* @__PURE__ */ core._safeParseAsync(ZodRealError);\n","import * as core from \"zod/v4/core\";\nimport { util } from \"zod/v4/core\";\nimport * as checks from \"./checks.js\";\nimport * as iso from \"./iso.js\";\nimport * as parse from \"./parse.js\";\nexport const ZodType = /*@__PURE__*/ core.$constructor(\"ZodType\", (inst, def) => {\n core.$ZodType.init(inst, def);\n inst.def = def;\n Object.defineProperty(inst, \"_def\", { value: def });\n // base methods\n inst.check = (...checks) => {\n return inst.clone({\n ...def,\n checks: [\n ...(def.checks ?? []),\n ...checks.map((ch) => typeof ch === \"function\" ? { _zod: { check: ch, def: { check: \"custom\" }, onattach: [] } } : ch),\n ],\n }\n // { parent: true }\n );\n };\n inst.clone = (def, params) => core.clone(inst, def, params);\n inst.brand = () => inst;\n inst.register = ((reg, meta) => {\n reg.add(inst, meta);\n return inst;\n });\n // parsing\n inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });\n inst.safeParse = (data, params) => parse.safeParse(inst, data, params);\n inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });\n inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);\n inst.spa = inst.safeParseAsync;\n // refinements\n inst.refine = (check, params) => inst.check(refine(check, params));\n inst.superRefine = (refinement) => inst.check(superRefine(refinement));\n inst.overwrite = (fn) => inst.check(checks.overwrite(fn));\n // wrappers\n inst.optional = () => optional(inst);\n inst.nullable = () => nullable(inst);\n inst.nullish = () => optional(nullable(inst));\n inst.nonoptional = (params) => nonoptional(inst, params);\n inst.array = () => array(inst);\n inst.or = (arg) => union([inst, arg]);\n inst.and = (arg) => intersection(inst, arg);\n inst.transform = (tx) => pipe(inst, transform(tx));\n inst.default = (def) => _default(inst, def);\n inst.prefault = (def) => prefault(inst, def);\n // inst.coalesce = (def, params) => coalesce(inst, def, params);\n inst.catch = (params) => _catch(inst, params);\n inst.pipe = (target) => pipe(inst, target);\n inst.readonly = () => readonly(inst);\n // meta\n inst.describe = (description) => {\n const cl = inst.clone();\n core.globalRegistry.add(cl, { description });\n return cl;\n };\n Object.defineProperty(inst, \"description\", {\n get() {\n return core.globalRegistry.get(inst)?.description;\n },\n configurable: true,\n });\n inst.meta = (...args) => {\n if (args.length === 0) {\n return core.globalRegistry.get(inst);\n }\n const cl = inst.clone();\n core.globalRegistry.add(cl, args[0]);\n return cl;\n };\n // helpers\n inst.isOptional = () => inst.safeParse(undefined).success;\n inst.isNullable = () => inst.safeParse(null).success;\n return inst;\n});\n/** @internal */\nexport const _ZodString = /*@__PURE__*/ core.$constructor(\"_ZodString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n ZodType.init(inst, def);\n const bag = inst._zod.bag;\n inst.format = bag.format ?? null;\n inst.minLength = bag.minimum ?? null;\n inst.maxLength = bag.maximum ?? null;\n // validations\n inst.regex = (...args) => inst.check(checks.regex(...args));\n inst.includes = (...args) => inst.check(checks.includes(...args));\n inst.startsWith = (...args) => inst.check(checks.startsWith(...args));\n inst.endsWith = (...args) => inst.check(checks.endsWith(...args));\n inst.min = (...args) => inst.check(checks.minLength(...args));\n inst.max = (...args) => inst.check(checks.maxLength(...args));\n inst.length = (...args) => inst.check(checks.length(...args));\n inst.nonempty = (...args) => inst.check(checks.minLength(1, ...args));\n inst.lowercase = (params) => inst.check(checks.lowercase(params));\n inst.uppercase = (params) => inst.check(checks.uppercase(params));\n // transforms\n inst.trim = () => inst.check(checks.trim());\n inst.normalize = (...args) => inst.check(checks.normalize(...args));\n inst.toLowerCase = () => inst.check(checks.toLowerCase());\n inst.toUpperCase = () => inst.check(checks.toUpperCase());\n});\nexport const ZodString = /*@__PURE__*/ core.$constructor(\"ZodString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n _ZodString.init(inst, def);\n inst.email = (params) => inst.check(core._email(ZodEmail, params));\n inst.url = (params) => inst.check(core._url(ZodURL, params));\n inst.jwt = (params) => inst.check(core._jwt(ZodJWT, params));\n inst.emoji = (params) => inst.check(core._emoji(ZodEmoji, params));\n inst.guid = (params) => inst.check(core._guid(ZodGUID, params));\n inst.uuid = (params) => inst.check(core._uuid(ZodUUID, params));\n inst.uuidv4 = (params) => inst.check(core._uuidv4(ZodUUID, params));\n inst.uuidv6 = (params) => inst.check(core._uuidv6(ZodUUID, params));\n inst.uuidv7 = (params) => inst.check(core._uuidv7(ZodUUID, params));\n inst.nanoid = (params) => inst.check(core._nanoid(ZodNanoID, params));\n inst.guid = (params) => inst.check(core._guid(ZodGUID, params));\n inst.cuid = (params) => inst.check(core._cuid(ZodCUID, params));\n inst.cuid2 = (params) => inst.check(core._cuid2(ZodCUID2, params));\n inst.ulid = (params) => inst.check(core._ulid(ZodULID, params));\n inst.base64 = (params) => inst.check(core._base64(ZodBase64, params));\n inst.base64url = (params) => inst.check(core._base64url(ZodBase64URL, params));\n inst.xid = (params) => inst.check(core._xid(ZodXID, params));\n inst.ksuid = (params) => inst.check(core._ksuid(ZodKSUID, params));\n inst.ipv4 = (params) => inst.check(core._ipv4(ZodIPv4, params));\n inst.ipv6 = (params) => inst.check(core._ipv6(ZodIPv6, params));\n inst.cidrv4 = (params) => inst.check(core._cidrv4(ZodCIDRv4, params));\n inst.cidrv6 = (params) => inst.check(core._cidrv6(ZodCIDRv6, params));\n inst.e164 = (params) => inst.check(core._e164(ZodE164, params));\n // iso\n inst.datetime = (params) => inst.check(iso.datetime(params));\n inst.date = (params) => inst.check(iso.date(params));\n inst.time = (params) => inst.check(iso.time(params));\n inst.duration = (params) => inst.check(iso.duration(params));\n});\nexport function string(params) {\n return core._string(ZodString, params);\n}\nexport const ZodStringFormat = /*@__PURE__*/ core.$constructor(\"ZodStringFormat\", (inst, def) => {\n core.$ZodStringFormat.init(inst, def);\n _ZodString.init(inst, def);\n});\nexport const ZodEmail = /*@__PURE__*/ core.$constructor(\"ZodEmail\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodEmail.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function email(params) {\n return core._email(ZodEmail, params);\n}\nexport const ZodGUID = /*@__PURE__*/ core.$constructor(\"ZodGUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodGUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function guid(params) {\n return core._guid(ZodGUID, params);\n}\nexport const ZodUUID = /*@__PURE__*/ core.$constructor(\"ZodUUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodUUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function uuid(params) {\n return core._uuid(ZodUUID, params);\n}\nexport function uuidv4(params) {\n return core._uuidv4(ZodUUID, params);\n}\n// ZodUUIDv6\nexport function uuidv6(params) {\n return core._uuidv6(ZodUUID, params);\n}\n// ZodUUIDv7\nexport function uuidv7(params) {\n return core._uuidv7(ZodUUID, params);\n}\nexport const ZodURL = /*@__PURE__*/ core.$constructor(\"ZodURL\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodURL.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function url(params) {\n return core._url(ZodURL, params);\n}\nexport const ZodEmoji = /*@__PURE__*/ core.$constructor(\"ZodEmoji\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodEmoji.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function emoji(params) {\n return core._emoji(ZodEmoji, params);\n}\nexport const ZodNanoID = /*@__PURE__*/ core.$constructor(\"ZodNanoID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodNanoID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function nanoid(params) {\n return core._nanoid(ZodNanoID, params);\n}\nexport const ZodCUID = /*@__PURE__*/ core.$constructor(\"ZodCUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cuid(params) {\n return core._cuid(ZodCUID, params);\n}\nexport const ZodCUID2 = /*@__PURE__*/ core.$constructor(\"ZodCUID2\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCUID2.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cuid2(params) {\n return core._cuid2(ZodCUID2, params);\n}\nexport const ZodULID = /*@__PURE__*/ core.$constructor(\"ZodULID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodULID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ulid(params) {\n return core._ulid(ZodULID, params);\n}\nexport const ZodXID = /*@__PURE__*/ core.$constructor(\"ZodXID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodXID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function xid(params) {\n return core._xid(ZodXID, params);\n}\nexport const ZodKSUID = /*@__PURE__*/ core.$constructor(\"ZodKSUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodKSUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ksuid(params) {\n return core._ksuid(ZodKSUID, params);\n}\nexport const ZodIPv4 = /*@__PURE__*/ core.$constructor(\"ZodIPv4\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodIPv4.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ipv4(params) {\n return core._ipv4(ZodIPv4, params);\n}\nexport const ZodIPv6 = /*@__PURE__*/ core.$constructor(\"ZodIPv6\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodIPv6.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ipv6(params) {\n return core._ipv6(ZodIPv6, params);\n}\nexport const ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"ZodCIDRv4\", (inst, def) => {\n core.$ZodCIDRv4.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cidrv4(params) {\n return core._cidrv4(ZodCIDRv4, params);\n}\nexport const ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"ZodCIDRv6\", (inst, def) => {\n core.$ZodCIDRv6.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cidrv6(params) {\n return core._cidrv6(ZodCIDRv6, params);\n}\nexport const ZodBase64 = /*@__PURE__*/ core.$constructor(\"ZodBase64\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodBase64.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function base64(params) {\n return core._base64(ZodBase64, params);\n}\nexport const ZodBase64URL = /*@__PURE__*/ core.$constructor(\"ZodBase64URL\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodBase64URL.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function base64url(params) {\n return core._base64url(ZodBase64URL, params);\n}\nexport const ZodE164 = /*@__PURE__*/ core.$constructor(\"ZodE164\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodE164.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function e164(params) {\n return core._e164(ZodE164, params);\n}\nexport const ZodJWT = /*@__PURE__*/ core.$constructor(\"ZodJWT\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodJWT.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function jwt(params) {\n return core._jwt(ZodJWT, params);\n}\nexport const ZodNumber = /*@__PURE__*/ core.$constructor(\"ZodNumber\", (inst, def) => {\n core.$ZodNumber.init(inst, def);\n ZodType.init(inst, def);\n inst.gt = (value, params) => inst.check(checks.gt(value, params));\n inst.gte = (value, params) => inst.check(checks.gte(value, params));\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.lt = (value, params) => inst.check(checks.lt(value, params));\n inst.lte = (value, params) => inst.check(checks.lte(value, params));\n inst.max = (value, params) => inst.check(checks.lte(value, params));\n inst.int = (params) => inst.check(int(params));\n inst.safe = (params) => inst.check(int(params));\n inst.positive = (params) => inst.check(checks.gt(0, params));\n inst.nonnegative = (params) => inst.check(checks.gte(0, params));\n inst.negative = (params) => inst.check(checks.lt(0, params));\n inst.nonpositive = (params) => inst.check(checks.lte(0, params));\n inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));\n inst.step = (value, params) => inst.check(checks.multipleOf(value, params));\n // inst.finite = (params) => inst.check(core.finite(params));\n inst.finite = () => inst;\n const bag = inst._zod.bag;\n inst.minValue =\n Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;\n inst.maxValue =\n Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;\n inst.isInt = (bag.format ?? \"\").includes(\"int\") || Number.isSafeInteger(bag.multipleOf ?? 0.5);\n inst.isFinite = true;\n inst.format = bag.format ?? null;\n});\nexport function number(params) {\n return core._number(ZodNumber, params);\n}\nexport const ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"ZodNumberFormat\", (inst, def) => {\n core.$ZodNumberFormat.init(inst, def);\n ZodNumber.init(inst, def);\n});\nexport function int(params) {\n return core._int(ZodNumberFormat, params);\n}\nexport function float32(params) {\n return core._float32(ZodNumberFormat, params);\n}\nexport function float64(params) {\n return core._float64(ZodNumberFormat, params);\n}\nexport function int32(params) {\n return core._int32(ZodNumberFormat, params);\n}\nexport function uint32(params) {\n return core._uint32(ZodNumberFormat, params);\n}\nexport const ZodBoolean = /*@__PURE__*/ core.$constructor(\"ZodBoolean\", (inst, def) => {\n core.$ZodBoolean.init(inst, def);\n ZodType.init(inst, def);\n});\nexport function boolean(params) {\n return core._boolean(ZodBoolean, params);\n}\nexport const ZodBigInt = /*@__PURE__*/ core.$constructor(\"ZodBigInt\", (inst, def) => {\n core.$ZodBigInt.init(inst, def);\n ZodType.init(inst, def);\n inst.gte = (value, params) => inst.check(checks.gte(value, params));\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.gt = (value, params) => inst.check(checks.gt(value, params));\n inst.gte = (value, params) => inst.check(checks.gte(value, params));\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.lt = (value, params) => inst.check(checks.lt(value, params));\n inst.lte = (value, params) => inst.check(checks.lte(value, params));\n inst.max = (value, params) => inst.check(checks.lte(value, params));\n inst.positive = (params) => inst.check(checks.gt(BigInt(0), params));\n inst.negative = (params) => inst.check(checks.lt(BigInt(0), params));\n inst.nonpositive = (params) => inst.check(checks.lte(BigInt(0), params));\n inst.nonnegative = (params) => inst.check(checks.gte(BigInt(0), params));\n inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));\n const bag = inst._zod.bag;\n inst.minValue = bag.minimum ?? null;\n inst.maxValue = bag.maximum ?? null;\n inst.format = bag.format ?? null;\n});\nexport function bigint(params) {\n return core._bigint(ZodBigInt, params);\n}\nexport const ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"ZodBigIntFormat\", (inst, def) => {\n core.$ZodBigIntFormat.init(inst, def);\n ZodBigInt.init(inst, def);\n});\n// int64\nexport function int64(params) {\n return core._int64(ZodBigIntFormat, params);\n}\n// uint64\nexport function uint64(params) {\n return core._uint64(ZodBigIntFormat, params);\n}\nexport const ZodSymbol = /*@__PURE__*/ core.$constructor(\"ZodSymbol\", (inst, def) => {\n core.$ZodSymbol.init(inst, def);\n ZodType.init(inst, def);\n});\nexport function symbol(params) {\n return core._symbol(ZodSymbol, params);\n}\nexport const ZodUndefined = /*@__PURE__*/ core.$constructor(\"ZodUndefined\", (inst, def) => {\n core.$ZodUndefined.init(inst, def);\n ZodType.init(inst, def);\n});\nfunction _undefined(params) {\n return core._undefined(ZodUndefined, params);\n}\nexport { _undefined as undefined };\nexport const ZodNull = /*@__PURE__*/ core.$constructor(\"ZodNull\", (inst, def) => {\n core.$ZodNull.init(inst, def);\n ZodType.init(inst, def);\n});\nfunction _null(params) {\n return core._null(ZodNull, params);\n}\nexport { _null as null };\nexport const ZodAny = /*@__PURE__*/ core.$constructor(\"ZodAny\", (inst, def) => {\n core.$ZodAny.init(inst, def);\n ZodType.init(inst, def);\n});\nexport function any() {\n return core._any(ZodAny);\n}\nexport const ZodUnknown = /*@__PURE__*/ core.$constructor(\"ZodUnknown\", (inst, def) => {\n core.$ZodUnknown.init(inst, def);\n ZodType.init(inst, def);\n});\nexport function unknown() {\n return core._unknown(ZodUnknown);\n}\nexport const ZodNever = /*@__PURE__*/ core.$constructor(\"ZodNever\", (inst, def) => {\n core.$ZodNever.init(inst, def);\n ZodType.init(inst, def);\n});\nexport function never(params) {\n return core._never(ZodNever, params);\n}\nexport const ZodVoid = /*@__PURE__*/ core.$constructor(\"ZodVoid\", (inst, def) => {\n core.$ZodVoid.init(inst, def);\n ZodType.init(inst, def);\n});\nfunction _void(params) {\n return core._void(ZodVoid, params);\n}\nexport { _void as void };\nexport const ZodDate = /*@__PURE__*/ core.$constructor(\"ZodDate\", (inst, def) => {\n core.$ZodDate.init(inst, def);\n ZodType.init(inst, def);\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.max = (value, params) => inst.check(checks.lte(value, params));\n const c = inst._zod.bag;\n inst.minDate = c.minimum ? new Date(c.minimum) : null;\n inst.maxDate = c.maximum ? new Date(c.maximum) : null;\n});\nexport function date(params) {\n return core._date(ZodDate, params);\n}\nexport const ZodArray = /*@__PURE__*/ core.$constructor(\"ZodArray\", (inst, def) => {\n core.$ZodArray.init(inst, def);\n ZodType.init(inst, def);\n inst.element = def.element;\n inst.min = (minLength, params) => inst.check(checks.minLength(minLength, params));\n inst.nonempty = (params) => inst.check(checks.minLength(1, params));\n inst.max = (maxLength, params) => inst.check(checks.maxLength(maxLength, params));\n inst.length = (len, params) => inst.check(checks.length(len, params));\n inst.unwrap = () => inst.element;\n});\nexport function array(element, params) {\n return core._array(ZodArray, element, params);\n}\n// .keyof\nexport function keyof(schema) {\n const shape = schema._zod.def.shape;\n return literal(Object.keys(shape));\n}\nexport const ZodObject = /*@__PURE__*/ core.$constructor(\"ZodObject\", (inst, def) => {\n core.$ZodObject.init(inst, def);\n ZodType.init(inst, def);\n util.defineLazy(inst, \"shape\", () => {\n return Object.fromEntries(Object.entries(inst._zod.def.shape));\n });\n inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));\n inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall });\n inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });\n // inst.nonstrict = () => inst.clone({ ...inst._zod.def, catchall: api.unknown() });\n inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() });\n inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });\n inst.strip = () => inst.clone({ ...inst._zod.def, catchall: undefined });\n inst.extend = (incoming) => {\n return util.extend(inst, incoming);\n };\n inst.merge = (other) => util.merge(inst, other);\n inst.pick = (mask) => util.pick(inst, mask);\n inst.omit = (mask) => util.omit(inst, mask);\n inst.partial = (...args) => util.partial(ZodOptional, inst, args[0]);\n inst.required = (...args) => util.required(ZodNonOptional, inst, args[0]);\n});\nexport function object(shape, params) {\n const def = {\n type: \"object\",\n get shape() {\n util.assignProp(this, \"shape\", { ...shape });\n return this.shape;\n },\n ...util.normalizeParams(params),\n };\n return new ZodObject(def);\n}\n// strictObject\nexport function strictObject(shape, params) {\n return new ZodObject({\n type: \"object\",\n get shape() {\n util.assignProp(this, \"shape\", { ...shape });\n return this.shape;\n },\n catchall: never(),\n ...util.normalizeParams(params),\n });\n}\n// looseObject\nexport function looseObject(shape, params) {\n return new ZodObject({\n type: \"object\",\n get shape() {\n util.assignProp(this, \"shape\", { ...shape });\n return this.shape;\n },\n catchall: unknown(),\n ...util.normalizeParams(params),\n });\n}\nexport const ZodUnion = /*@__PURE__*/ core.$constructor(\"ZodUnion\", (inst, def) => {\n core.$ZodUnion.init(inst, def);\n ZodType.init(inst, def);\n inst.options = def.options;\n});\nexport function union(options, params) {\n return new ZodUnion({\n type: \"union\",\n options,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodDiscriminatedUnion = /*@__PURE__*/ core.$constructor(\"ZodDiscriminatedUnion\", (inst, def) => {\n ZodUnion.init(inst, def);\n core.$ZodDiscriminatedUnion.init(inst, def);\n});\nexport function discriminatedUnion(discriminator, options, params) {\n // const [options, params] = args;\n return new ZodDiscriminatedUnion({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodIntersection = /*@__PURE__*/ core.$constructor(\"ZodIntersection\", (inst, def) => {\n core.$ZodIntersection.init(inst, def);\n ZodType.init(inst, def);\n});\nexport function intersection(left, right) {\n return new ZodIntersection({\n type: \"intersection\",\n left,\n right,\n });\n}\nexport const ZodTuple = /*@__PURE__*/ core.$constructor(\"ZodTuple\", (inst, def) => {\n core.$ZodTuple.init(inst, def);\n ZodType.init(inst, def);\n inst.rest = (rest) => inst.clone({\n ...inst._zod.def,\n rest,\n });\n});\nexport function tuple(items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof core.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new ZodTuple({\n type: \"tuple\",\n items,\n rest,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodRecord = /*@__PURE__*/ core.$constructor(\"ZodRecord\", (inst, def) => {\n core.$ZodRecord.init(inst, def);\n ZodType.init(inst, def);\n inst.keyType = def.keyType;\n inst.valueType = def.valueType;\n});\nexport function record(keyType, valueType, params) {\n return new ZodRecord({\n type: \"record\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\nexport function partialRecord(keyType, valueType, params) {\n return new ZodRecord({\n type: \"record\",\n keyType: union([keyType, never()]),\n valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMap = /*@__PURE__*/ core.$constructor(\"ZodMap\", (inst, def) => {\n core.$ZodMap.init(inst, def);\n ZodType.init(inst, def);\n inst.keyType = def.keyType;\n inst.valueType = def.valueType;\n});\nexport function map(keyType, valueType, params) {\n return new ZodMap({\n type: \"map\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodSet = /*@__PURE__*/ core.$constructor(\"ZodSet\", (inst, def) => {\n core.$ZodSet.init(inst, def);\n ZodType.init(inst, def);\n inst.min = (...args) => inst.check(core._minSize(...args));\n inst.nonempty = (params) => inst.check(core._minSize(1, params));\n inst.max = (...args) => inst.check(core._maxSize(...args));\n inst.size = (...args) => inst.check(core._size(...args));\n});\nexport function set(valueType, params) {\n return new ZodSet({\n type: \"set\",\n valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodEnum = /*@__PURE__*/ core.$constructor(\"ZodEnum\", (inst, def) => {\n core.$ZodEnum.init(inst, def);\n ZodType.init(inst, def);\n inst.enum = def.entries;\n inst.options = Object.values(def.entries);\n const keys = new Set(Object.keys(def.entries));\n inst.extract = (values, params) => {\n const newEntries = {};\n for (const value of values) {\n if (keys.has(value)) {\n newEntries[value] = def.entries[value];\n }\n else\n throw new Error(`Key ${value} not found in enum`);\n }\n return new ZodEnum({\n ...def,\n checks: [],\n ...util.normalizeParams(params),\n entries: newEntries,\n });\n };\n inst.exclude = (values, params) => {\n const newEntries = { ...def.entries };\n for (const value of values) {\n if (keys.has(value)) {\n delete newEntries[value];\n }\n else\n throw new Error(`Key ${value} not found in enum`);\n }\n return new ZodEnum({\n ...def,\n checks: [],\n ...util.normalizeParams(params),\n entries: newEntries,\n });\n };\n});\nfunction _enum(values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n return new ZodEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport { _enum as enum };\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function nativeEnum(entries, params) {\n return new ZodEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodLiteral = /*@__PURE__*/ core.$constructor(\"ZodLiteral\", (inst, def) => {\n core.$ZodLiteral.init(inst, def);\n ZodType.init(inst, def);\n inst.values = new Set(def.values);\n Object.defineProperty(inst, \"value\", {\n get() {\n if (def.values.length > 1) {\n throw new Error(\"This schema contains multiple valid literal values. Use `.values` instead.\");\n }\n return def.values[0];\n },\n });\n});\nexport function literal(value, params) {\n return new ZodLiteral({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\nexport const ZodFile = /*@__PURE__*/ core.$constructor(\"ZodFile\", (inst, def) => {\n core.$ZodFile.init(inst, def);\n ZodType.init(inst, def);\n inst.min = (size, params) => inst.check(core._minSize(size, params));\n inst.max = (size, params) => inst.check(core._maxSize(size, params));\n inst.mime = (types, params) => inst.check(core._mime(Array.isArray(types) ? types : [types], params));\n});\nexport function file(params) {\n return core._file(ZodFile, params);\n}\nexport const ZodTransform = /*@__PURE__*/ core.$constructor(\"ZodTransform\", (inst, def) => {\n core.$ZodTransform.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, def));\n }\n else {\n // for Zod 3 backwards compatibility\n const _issue = issue;\n if (_issue.fatal)\n _issue.continue = false;\n _issue.code ?? (_issue.code = \"custom\");\n _issue.input ?? (_issue.input = payload.value);\n _issue.inst ?? (_issue.inst = inst);\n _issue.continue ?? (_issue.continue = true);\n payload.issues.push(util.issue(_issue));\n }\n };\n const output = def.transform(payload.value, payload);\n if (output instanceof Promise) {\n return output.then((output) => {\n payload.value = output;\n return payload;\n });\n }\n payload.value = output;\n return payload;\n };\n});\nexport function transform(fn) {\n return new ZodTransform({\n type: \"transform\",\n transform: fn,\n });\n}\nexport const ZodOptional = /*@__PURE__*/ core.$constructor(\"ZodOptional\", (inst, def) => {\n core.$ZodOptional.init(inst, def);\n ZodType.init(inst, def);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function optional(innerType) {\n return new ZodOptional({\n type: \"optional\",\n innerType,\n });\n}\nexport const ZodNullable = /*@__PURE__*/ core.$constructor(\"ZodNullable\", (inst, def) => {\n core.$ZodNullable.init(inst, def);\n ZodType.init(inst, def);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function nullable(innerType) {\n return new ZodNullable({\n type: \"nullable\",\n innerType,\n });\n}\n// nullish\nexport function nullish(innerType) {\n return optional(nullable(innerType));\n}\nexport const ZodDefault = /*@__PURE__*/ core.$constructor(\"ZodDefault\", (inst, def) => {\n core.$ZodDefault.init(inst, def);\n ZodType.init(inst, def);\n inst.unwrap = () => inst._zod.def.innerType;\n inst.removeDefault = inst.unwrap;\n});\nexport function _default(innerType, defaultValue) {\n return new ZodDefault({\n type: \"default\",\n innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : defaultValue;\n },\n });\n}\nexport const ZodPrefault = /*@__PURE__*/ core.$constructor(\"ZodPrefault\", (inst, def) => {\n core.$ZodPrefault.init(inst, def);\n ZodType.init(inst, def);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function prefault(innerType, defaultValue) {\n return new ZodPrefault({\n type: \"prefault\",\n innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : defaultValue;\n },\n });\n}\nexport const ZodNonOptional = /*@__PURE__*/ core.$constructor(\"ZodNonOptional\", (inst, def) => {\n core.$ZodNonOptional.init(inst, def);\n ZodType.init(inst, def);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function nonoptional(innerType, params) {\n return new ZodNonOptional({\n type: \"nonoptional\",\n innerType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodSuccess = /*@__PURE__*/ core.$constructor(\"ZodSuccess\", (inst, def) => {\n core.$ZodSuccess.init(inst, def);\n ZodType.init(inst, def);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function success(innerType) {\n return new ZodSuccess({\n type: \"success\",\n innerType,\n });\n}\nexport const ZodCatch = /*@__PURE__*/ core.$constructor(\"ZodCatch\", (inst, def) => {\n core.$ZodCatch.init(inst, def);\n ZodType.init(inst, def);\n inst.unwrap = () => inst._zod.def.innerType;\n inst.removeCatch = inst.unwrap;\n});\nfunction _catch(innerType, catchValue) {\n return new ZodCatch({\n type: \"catch\",\n innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\nexport { _catch as catch };\nexport const ZodNaN = /*@__PURE__*/ core.$constructor(\"ZodNaN\", (inst, def) => {\n core.$ZodNaN.init(inst, def);\n ZodType.init(inst, def);\n});\nexport function nan(params) {\n return core._nan(ZodNaN, params);\n}\nexport const ZodPipe = /*@__PURE__*/ core.$constructor(\"ZodPipe\", (inst, def) => {\n core.$ZodPipe.init(inst, def);\n ZodType.init(inst, def);\n inst.in = def.in;\n inst.out = def.out;\n});\nexport function pipe(in_, out) {\n return new ZodPipe({\n type: \"pipe\",\n in: in_,\n out,\n // ...util.normalizeParams(params),\n });\n}\nexport const ZodReadonly = /*@__PURE__*/ core.$constructor(\"ZodReadonly\", (inst, def) => {\n core.$ZodReadonly.init(inst, def);\n ZodType.init(inst, def);\n});\nexport function readonly(innerType) {\n return new ZodReadonly({\n type: \"readonly\",\n innerType,\n });\n}\nexport const ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"ZodTemplateLiteral\", (inst, def) => {\n core.$ZodTemplateLiteral.init(inst, def);\n ZodType.init(inst, def);\n});\nexport function templateLiteral(parts, params) {\n return new ZodTemplateLiteral({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodLazy = /*@__PURE__*/ core.$constructor(\"ZodLazy\", (inst, def) => {\n core.$ZodLazy.init(inst, def);\n ZodType.init(inst, def);\n inst.unwrap = () => inst._zod.def.getter();\n});\nexport function lazy(getter) {\n return new ZodLazy({\n type: \"lazy\",\n getter,\n });\n}\nexport const ZodPromise = /*@__PURE__*/ core.$constructor(\"ZodPromise\", (inst, def) => {\n core.$ZodPromise.init(inst, def);\n ZodType.init(inst, def);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function promise(innerType) {\n return new ZodPromise({\n type: \"promise\",\n innerType,\n });\n}\nexport const ZodCustom = /*@__PURE__*/ core.$constructor(\"ZodCustom\", (inst, def) => {\n core.$ZodCustom.init(inst, def);\n ZodType.init(inst, def);\n});\n// custom checks\nexport function check(fn, params) {\n const ch = new core.$ZodCheck({\n check: \"custom\",\n ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\nexport function custom(fn, _params) {\n return core._custom(ZodCustom, fn ?? (() => true), _params);\n}\nexport function refine(fn, _params = {}) {\n return core._refine(ZodCustom, fn, _params);\n}\n// superRefine\nexport function superRefine(fn, params) {\n const ch = check((payload) => {\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, ch._zod.def));\n }\n else {\n // for Zod 3 backwards compatibility\n const _issue = issue;\n if (_issue.fatal)\n _issue.continue = false;\n _issue.code ?? (_issue.code = \"custom\");\n _issue.input ?? (_issue.input = payload.value);\n _issue.inst ?? (_issue.inst = ch);\n _issue.continue ?? (_issue.continue = !ch._zod.def.abort);\n payload.issues.push(util.issue(_issue));\n }\n };\n return fn(payload.value, payload);\n }, params);\n return ch;\n}\nfunction _instanceof(cls, params = {\n error: `Input not instance of ${cls.name}`,\n}) {\n const inst = new ZodCustom({\n type: \"custom\",\n check: \"custom\",\n fn: (data) => data instanceof cls,\n abort: true,\n ...util.normalizeParams(params),\n });\n inst._zod.bag.Class = cls;\n return inst;\n}\nexport { _instanceof as instanceof };\n// stringbool\nexport const stringbool = (...args) => core._stringbool({\n Pipe: ZodPipe,\n Boolean: ZodBoolean,\n Unknown: ZodUnknown,\n}, ...args);\nexport function json(params) {\n const jsonSchema = lazy(() => {\n return union([string(params), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);\n });\n return jsonSchema;\n}\n// preprocess\n// /** @deprecated Use `z.pipe()` and `z.transform()` instead. */\nexport function preprocess(fn, schema) {\n return pipe(transform(fn), schema);\n}\n","export const HALLIDAY_DOMAIN = \"https://app.halliday.xyz\";\nexport const HALLIDAY_API_URL = \"https://api.halliday.xyz/v1/client\";\nexport const HALLIDAY_PAYMENTS_API_URL = \"https://v2.prod.halliday.xyz\";\n\nexport const WIDGET_WIDTH = 480;\nexport const WIDGET_HEIGHT = 638;\n\n/**\n * Regex to validate the apiDomainName\n * Only allow halliday.xyz or localhost\n */\nexport const API_DOMAIN_REGEX =\n /^(https:\\/\\/(?:[\\w-]+\\.)*halliday\\.xyz(?:\\/.*)?|http:\\/\\/localhost(?::\\d+)?(?:\\/.*)?|https:\\/\\/localhost(?::\\d+)?(?:\\/.*)?)$/;\n\nexport const UUID_REGEX = /^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/;\n","import { z } from \"zod/v4\";\n\nexport const Amount = z.string().refine((amount) => /^(0|[1-9]\\d*)(\\.\\d+)?$/.test(amount), {\n message: \"Invalid amount\",\n});\nexport type Amount = z.infer<typeof Amount>;\n\n// EVM\nexport const EVMAddressRegex = /^(0x|0x[a-fA-F0-9]{40})$/;\nexport const EVMTokenAddress = z.string().refine((a) => EVMAddressRegex.test(a), {\n message: \"Invalid EVM token address\",\n});\nexport type EVMTokenAddress = z.infer<typeof EVMTokenAddress>;\n\nexport const EVMAddress = EVMTokenAddress.refine((val) => val !== \"0x\", {\n message: \"Invalid EVM address\",\n});\nexport type EVMAddress = z.infer<typeof EVMAddress>;\n\n// Solana\nexport const SolAddressRegex = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;\nexport const SolNativeRegex = /^So[1-2]{41}$/;\nexport const SolTokenAddress = z.string().refine((a) => SolAddressRegex.test(a) || SolNativeRegex.test(a), {\n message: \"Invalid Solana token address\",\n});\nexport type SolTokenAddress = z.infer<typeof SolTokenAddress>;\nexport const SolAddress = z.string().refine((a) => SolAddressRegex.test(a), {\n message: \"Invalid Solana address\",\n});\nexport type SolAddress = z.infer<typeof SolAddress>;\n\n// Address\nexport const Address = z.union([EVMAddress, SolAddress]);\nexport type Address = z.infer<typeof Address>;\n\n// Fiat\nexport const Fiat = z.string().refine((fiat) => /^[a-zA-Z_]{3,}$/.test(fiat), {\n message: \"Invalid fiat\",\n});\nexport type Fiat = z.infer<typeof Fiat>;\n\nexport const FiatDetails = z.object({\n issuer: z.string(),\n name: z.string(),\n alias: z.string().optional(),\n symbol: z.string(),\n decimals: z.number(),\n});\nexport type FiatDetails = z.infer<typeof FiatDetails>;\n\n// Token\nexport const Name = z.string();\nexport const Symbol = z.string().regex(/^[a-zA-Z]\\w{1,7}$/, {\n message: \"Must be a short alpha-numeric symbol\",\n});\nexport const Decimals = z.number().min(0).max(18);\n\nexport const ImageUrl = z.string().url();\nexport const CoinGeckoId = z.string();\n\nexport const EVMTokenPointer = z.object({\n chain: z.string(),\n address: EVMTokenAddress,\n});\n\nexport const SolTokenPointer = z.object({\n chain: z.literal(\"solana\"),\n address: SolTokenAddress,\n});\n\nexport const FlexibleTokenPointer = z.object({\n chain: z.string(),\n address: z.string(),\n});\n\nexport const TokenPointer = z.union([EVMTokenPointer, SolTokenPointer, FlexibleTokenPointer]);\n\nexport const Token = z.string().refine(\n (token) => {\n const [chain, address] = token.split(\":\");\n const result = TokenPointer.safeParse({ chain, address });\n return result.success;\n },\n {\n message: \"Invalid token\",\n }\n);\nexport type Token = z.infer<typeof Token>;\n\nexport const TokenInfo = z.object({\n name: Name,\n symbol: Symbol,\n decimals: Decimals,\n alias: Symbol.optional(),\n image_url: ImageUrl.optional(),\n coingecko_id: CoinGeckoId.optional(),\n wrapper: Symbol.optional(),\n is_native: z.boolean().optional(),\n});\n\nexport const EVMTokenDetails = EVMTokenPointer.extend(TokenInfo.shape);\nexport type EVMTokenDetails = z.infer<typeof EVMTokenDetails>;\n\nexport const SolTokenDetails = SolTokenPointer.extend(TokenInfo.shape);\nexport type SolTokenDetails = z.infer<typeof SolTokenDetails>;\n\nexport const FlexibleTokenDetails = FlexibleTokenPointer.extend(TokenInfo.shape);\nexport type FlexibleTokenDetails = z.infer<typeof FlexibleTokenDetails>;\n\nexport const TokenDetails = z.union([EVMTokenDetails, SolTokenDetails, FlexibleTokenDetails]);\nexport type TokenDetails = z.infer<typeof TokenDetails>;\n\n// Asset\nexport const Asset = z.union([Token, Fiat]);\nexport type Asset = z.infer<typeof Asset>;\nexport const AssetDetails = z.union([TokenDetails, FiatDetails]);\nexport type AssetDetails = z.infer<typeof AssetDetails>;\n\nexport const Realm = z.discriminatedUnion(\"type\", [\n z.object({\n type: z.literal(\"chain\"),\n chain: z.string(),\n }),\n z.object({\n type: z.literal(\"issuer\"),\n issuer: z.string(),\n }),\n]);\nexport type Realm = z.infer<typeof Realm>;\n\n// Ramp\nexport const RampName = z.string().transform((ramp_name) => ramp_name.toLowerCase());\nexport type RampName = z.infer<typeof RampName>;\n\nexport const RampType = z.preprocess(\n (ramp_type) => (typeof ramp_type === \"string\" ? ramp_type.toUpperCase() : ramp_type),\n z.enum([\"ONRAMP\", \"OFFRAMP\"])\n);\nexport type RampType = z.infer<typeof RampType>;\n\n// Transaction\n// TODO: confirm the fields that accommodate ethers and viem\nexport const TransactionRequest = z.object({\n to: EVMAddress,\n from: EVMAddress.optional(),\n nonce: z.number().optional(),\n gasLimit: z.bigint().optional(),\n gasPrice: z.bigint().optional(),\n maxPriorityFeePerGas: z.bigint().optional(),\n maxFeePerGas: z.bigint().optional(),\n data: z.string().optional(),\n value: z.bigint().optional(),\n chainId: z.number(),\n});\nexport type TransactionRequest = z.infer<typeof TransactionRequest>;\n\n// TODO: confirm the fields that accommodate ethers and viem\nexport const TransactionReceipt = z.object({\n transactionHash: z.string().optional(),\n blockHash: z.string().optional(),\n blockNumber: z.number().optional(),\n from: EVMAddress.optional(),\n to: EVMAddress.optional(),\n rawReceipt: z.any(), // Preserves the original receipt from ethers or viem\n});\nexport type TransactionReceipt = z.infer<typeof TransactionReceipt>;\n\n// Chain\nexport const EVMChainConfig = z.object({\n chain_id: z.bigint(),\n network: z.string(),\n native_currency: z.object({\n name: z.string(),\n symbol: z.string(),\n decimals: z.number(),\n }),\n rpc: z.string(),\n image: z.string(),\n is_testnet: z.boolean(),\n explorer: z.string(),\n});\nexport type EVMChainConfig = z.infer<typeof EVMChainConfig>;\n\nexport const SolChainConfig = z.object({\n chain_id: z.bigint(),\n network: z.string(),\n});\nexport type SolChainConfig = z.infer<typeof SolChainConfig>;\n\nexport const ChainConfig = z.union([EVMChainConfig, SolChainConfig]);\nexport type ChainConfig = z.infer<typeof ChainConfig>;\n\nexport const OnrampMethod = z.enum([\n \"CREDIT_CARD\",\n \"DEBIT_CARD\",\n \"ACH\",\n \"FIAT_BALANCE\",\n \"TOKEN_BALANCE\",\n \"APPLE_PAY\",\n \"PAYPAL\",\n \"VENMO\",\n \"REVOLUT\",\n \"GOOGLE_PAY\",\n \"SEPA\",\n \"FASTER_PAYMENTS\",\n \"PIX\",\n \"UPI\",\n \"WIRE\",\n]);\nexport type OnrampMethod = z.infer<typeof OnrampMethod>;\n","export class HSON {\n static replacer = (_: any, value: any) => {\n if (typeof value === \"bigint\") {\n return { \"#\": value.toString() };\n }\n return value;\n }\n\n static reviver = (_: any, value: any) => {\n if (value && typeof value === \"object\" && \"#\" in value && Object.keys(value).length === 1) {\n return BigInt(value[\"#\"]);\n }\n return value;\n }\n\n static stringify(obj: any, space?: number | string): string {\n return JSON.stringify(obj, this.replacer, space);\n }\n\n static parse(str: string): any {\n return JSON.parse(str, this.reviver);\n }\n}\n","/*! *****************************************************************************\nCopyright (C) Microsoft. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\nvar Reflect;\n(function (Reflect) {\n // Metadata Proposal\n // https://rbuckton.github.io/reflect-metadata/\n (function (factory) {\n var root = typeof globalThis === \"object\" ? globalThis :\n typeof global === \"object\" ? global :\n typeof self === \"object\" ? self :\n typeof this === \"object\" ? this :\n sloppyModeThis();\n var exporter = makeExporter(Reflect);\n if (typeof root.Reflect !== \"undefined\") {\n exporter = makeExporter(root.Reflect, exporter);\n }\n factory(exporter, root);\n if (typeof root.Reflect === \"undefined\") {\n root.Reflect = Reflect;\n }\n function makeExporter(target, previous) {\n return function (key, value) {\n Object.defineProperty(target, key, { configurable: true, writable: true, value: value });\n if (previous)\n previous(key, value);\n };\n }\n function functionThis() {\n try {\n return Function(\"return this;\")();\n }\n catch (_) { }\n }\n function indirectEvalThis() {\n try {\n return (void 0, eval)(\"(function() { return this; })()\");\n }\n catch (_) { }\n }\n function sloppyModeThis() {\n return functionThis() || indirectEvalThis();\n }\n })(function (exporter, root) {\n var hasOwn = Object.prototype.hasOwnProperty;\n // feature test for Symbol support\n var supportsSymbol = typeof Symbol === \"function\";\n var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== \"undefined\" ? Symbol.toPrimitive : \"@@toPrimitive\";\n var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== \"undefined\" ? Symbol.iterator : \"@@iterator\";\n var supportsCreate = typeof Object.create === \"function\"; // feature test for Object.create support\n var supportsProto = { __proto__: [] } instanceof Array; // feature test for __proto__ support\n var downLevel = !supportsCreate && !supportsProto;\n var HashMap = {\n // create an object in dictionary mode (a.k.a. \"slow\" mode in v8)\n create: supportsCreate\n ? function () { return MakeDictionary(Object.create(null)); }\n : supportsProto\n ? function () { return MakeDictionary({ __proto__: null }); }\n : function () { return MakeDictionary({}); },\n has: downLevel\n ? function (map, key) { return hasOwn.call(map, key); }\n : function (map, key) { return key in map; },\n get: downLevel\n ? function (map, key) { return hasOwn.call(map, key) ? map[key] : undefined; }\n : function (map, key) { return map[key]; },\n };\n // Load global or shim versions of Map, Set, and WeakMap\n var functionPrototype = Object.getPrototypeOf(Function);\n var _Map = typeof Map === \"function\" && typeof Map.prototype.entries === \"function\" ? Map : CreateMapPolyfill();\n var _Set = typeof Set === \"function\" && typeof Set.prototype.entries === \"function\" ? Set : CreateSetPolyfill();\n var _WeakMap = typeof WeakMap === \"function\" ? WeakMap : CreateWeakMapPolyfill();\n var registrySymbol = supportsSymbol ? Symbol.for(\"@reflect-metadata:registry\") : undefined;\n var metadataRegistry = GetOrCreateMetadataRegistry();\n var metadataProvider = CreateMetadataProvider(metadataRegistry);\n /**\n * Applies a set of decorators to a property of a target object.\n * @param decorators An array of decorators.\n * @param target The target object.\n * @param propertyKey (Optional) The property key to decorate.\n * @param attributes (Optional) The property descriptor for the target key.\n * @remarks Decorators are applied in reverse order.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * Example = Reflect.decorate(decoratorsArray, Example);\n *\n * // property (on constructor)\n * Reflect.decorate(decoratorsArray, Example, \"staticProperty\");\n *\n * // property (on prototype)\n * Reflect.decorate(decoratorsArray, Example.prototype, \"property\");\n *\n * // method (on constructor)\n * Object.defineProperty(Example, \"staticMethod\",\n * Reflect.decorate(decoratorsArray, Example, \"staticMethod\",\n * Object.getOwnPropertyDescriptor(Example, \"staticMethod\")));\n *\n * // method (on prototype)\n * Object.defineProperty(Example.prototype, \"method\",\n * Reflect.decorate(decoratorsArray, Example.prototype, \"method\",\n * Object.getOwnPropertyDescriptor(Example.prototype, \"method\")));\n *\n */\n function decorate(decorators, target, propertyKey, attributes) {\n if (!IsUndefined(propertyKey)) {\n if (!IsArray(decorators))\n throw new TypeError();\n if (!IsObject(target))\n throw new TypeError();\n if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))\n throw new TypeError();\n if (IsNull(attributes))\n attributes = undefined;\n propertyKey = ToPropertyKey(propertyKey);\n return DecorateProperty(decorators, target, propertyKey, attributes);\n }\n else {\n if (!IsArray(decorators))\n throw new TypeError();\n if (!IsConstructor(target))\n throw new TypeError();\n return DecorateConstructor(decorators, target);\n }\n }\n exporter(\"decorate\", decorate);\n // 4.1.2 Reflect.metadata(metadataKey, metadataValue)\n // https://rbuckton.github.io/reflect-metadata/#reflect.metadata\n /**\n * A default metadata decorator factory that can be used on a class, class member, or parameter.\n * @param metadataKey The key for the metadata entry.\n * @param metadataValue The value for the metadata entry.\n * @returns A decorator function.\n * @remarks\n * If `metadataKey` is already defined for the target and target key, the\n * metadataValue for that key will be overwritten.\n * @example\n *\n * // constructor\n * @Reflect.metadata(key, value)\n * class Example {\n * }\n *\n * // property (on constructor, TypeScript only)\n * class Example {\n * @Reflect.metadata(key, value)\n * static staticProperty;\n * }\n *\n * // property (on prototype, TypeScript only)\n * class Example {\n * @Reflect.metadata(key, value)\n * property;\n * }\n *\n * // method (on constructor)\n * class Example {\n * @Reflect.metadata(key, value)\n * static staticMethod() { }\n * }\n *\n * // method (on prototype)\n * class Example {\n * @Reflect.metadata(key, value)\n * method() { }\n * }\n *\n */\n function metadata(metadataKey, metadataValue) {\n function decorator(target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))\n throw new TypeError();\n OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n }\n return decorator;\n }\n exporter(\"metadata\", metadata);\n /**\n * Define a unique metadata entry on the target.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param metadataValue A value that contains attached metadata.\n * @param target The target object on which to define metadata.\n * @param propertyKey (Optional) The property key for the target.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * Reflect.defineMetadata(\"custom:annotation\", options, Example);\n *\n * // property (on constructor)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example, \"staticProperty\");\n *\n * // property (on prototype)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example.prototype, \"property\");\n *\n * // method (on constructor)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example, \"staticMethod\");\n *\n * // method (on prototype)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example.prototype, \"method\");\n *\n * // decorator factory as metadata-producing annotation.\n * function MyAnnotation(options): Decorator {\n * return (target, key?) => Reflect.defineMetadata(\"custom:annotation\", options, target, key);\n * }\n *\n */\n function defineMetadata(metadataKey, metadataValue, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n }\n exporter(\"defineMetadata\", defineMetadata);\n /**\n * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.hasMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function hasMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryHasMetadata(metadataKey, target, propertyKey);\n }\n exporter(\"hasMetadata\", hasMetadata);\n /**\n * Gets a value indicating whether the target object has the provided metadata key defined.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns `true` if the metadata key was defined on the target object; otherwise, `false`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function hasOwnMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);\n }\n exporter(\"hasOwnMetadata\", hasOwnMetadata);\n /**\n * Gets the metadata value for the provided metadata key on the target object or its prototype chain.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.getMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function getMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryGetMetadata(metadataKey, target, propertyKey);\n }\n exporter(\"getMetadata\", getMetadata);\n /**\n * Gets the metadata value for the provided metadata key on the target object.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function getOwnMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);\n }\n exporter(\"getOwnMetadata\", getOwnMetadata);\n /**\n * Gets the metadata keys defined on the target object or its prototype chain.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns An array of unique metadata keys.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getMetadataKeys(Example);\n *\n * // property (on constructor)\n * result = Reflect.getMetadataKeys(Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getMetadataKeys(Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getMetadataKeys(Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getMetadataKeys(Example.prototype, \"method\");\n *\n */\n function getMetadataKeys(target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryMetadataKeys(target, propertyKey);\n }\n exporter(\"getMetadataKeys\", getMetadataKeys);\n /**\n * Gets the unique metadata keys defined on the target object.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns An array of unique metadata keys.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getOwnMetadataKeys(Example);\n *\n * // property (on constructor)\n * result = Reflect.getOwnMetadataKeys(Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getOwnMetadataKeys(Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getOwnMetadataKeys(Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getOwnMetadataKeys(Example.prototype, \"method\");\n *\n */\n function getOwnMetadataKeys(target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryOwnMetadataKeys(target, propertyKey);\n }\n exporter(\"getOwnMetadataKeys\", getOwnMetadataKeys);\n /**\n * Deletes the metadata entry from the target object with the provided key.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns `true` if the metadata entry was found and deleted; otherwise, false.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function deleteMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n var provider = GetMetadataProvider(target, propertyKey, /*Create*/ false);\n if (IsUndefined(provider))\n return false;\n return provider.OrdinaryDeleteMetadata(metadataKey, target, propertyKey);\n }\n exporter(\"deleteMetadata\", deleteMetadata);\n function DecorateConstructor(decorators, target) {\n for (var i = decorators.length - 1; i >= 0; --i) {\n var decorator = decorators[i];\n var decorated = decorator(target);\n if (!IsUndefined(decorated) && !IsNull(decorated)) {\n if (!IsConstructor(decorated))\n throw new TypeError();\n target = decorated;\n }\n }\n return target;\n }\n function DecorateProperty(decorators, target, propertyKey, descriptor) {\n for (var i = decorators.length - 1; i >= 0; --i) {\n var decorator = decorators[i];\n var decorated = decorator(target, propertyKey, descriptor);\n if (!IsUndefined(decorated) && !IsNull(decorated)) {\n if (!IsObject(decorated))\n throw new TypeError();\n descriptor = decorated;\n }\n }\n return descriptor;\n }\n // 3.1.1.1 OrdinaryHasMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinaryhasmetadata\n function OrdinaryHasMetadata(MetadataKey, O, P) {\n var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn)\n return true;\n var parent = OrdinaryGetPrototypeOf(O);\n if (!IsNull(parent))\n return OrdinaryHasMetadata(MetadataKey, parent, P);\n return false;\n }\n // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata\n function OrdinaryHasOwnMetadata(MetadataKey, O, P) {\n var provider = GetMetadataProvider(O, P, /*Create*/ false);\n if (IsUndefined(provider))\n return false;\n return ToBoolean(provider.OrdinaryHasOwnMetadata(MetadataKey, O, P));\n }\n // 3.1.3.1 OrdinaryGetMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarygetmetadata\n function OrdinaryGetMetadata(MetadataKey, O, P) {\n var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn)\n return OrdinaryGetOwnMetadata(MetadataKey, O, P);\n var parent = OrdinaryGetPrototypeOf(O);\n if (!IsNull(parent))\n return OrdinaryGetMetadata(MetadataKey, parent, P);\n return undefined;\n }\n // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata\n function OrdinaryGetOwnMetadata(MetadataKey, O, P) {\n var provider = GetMetadataProvider(O, P, /*Create*/ false);\n if (IsUndefined(provider))\n return;\n return provider.OrdinaryGetOwnMetadata(MetadataKey, O, P);\n }\n // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata\n function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {\n var provider = GetMetadataProvider(O, P, /*Create*/ true);\n provider.OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P);\n }\n // 3.1.6.1 OrdinaryMetadataKeys(O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarymetadatakeys\n function OrdinaryMetadataKeys(O, P) {\n var ownKeys = OrdinaryOwnMetadataKeys(O, P);\n var parent = OrdinaryGetPrototypeOf(O);\n if (parent === null)\n return ownKeys;\n var parentKeys = OrdinaryMetadataKeys(parent, P);\n if (parentKeys.length <= 0)\n return ownKeys;\n if (ownKeys.length <= 0)\n return parentKeys;\n var set = new _Set();\n var keys = [];\n for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) {\n var key = ownKeys_1[_i];\n var hasKey = set.has(key);\n if (!hasKey) {\n set.add(key);\n keys.push(key);\n }\n }\n for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) {\n var key = parentKeys_1[_a];\n var hasKey = set.has(key);\n if (!hasKey) {\n set.add(key);\n keys.push(key);\n }\n }\n return keys;\n }\n // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys\n function OrdinaryOwnMetadataKeys(O, P) {\n var provider = GetMetadataProvider(O, P, /*create*/ false);\n if (!provider) {\n return [];\n }\n return provider.OrdinaryOwnMetadataKeys(O, P);\n }\n // 6 ECMAScript Data Types and Values\n // https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values\n function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }\n // 6.1.1 The Undefined Type\n // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-undefined-type\n function IsUndefined(x) {\n return x === undefined;\n }\n // 6.1.2 The Null Type\n // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-null-type\n function IsNull(x) {\n return x === null;\n }\n // 6.1.5 The Symbol Type\n // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-symbol-type\n function IsSymbol(x) {\n return typeof x === \"symbol\";\n }\n // 6.1.7 The Object Type\n // https://tc39.github.io/ecma262/#sec-object-type\n function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }\n // 7.1 Type Conversion\n // https://tc39.github.io/ecma262/#sec-type-conversion\n // 7.1.1 ToPrimitive(input [, PreferredType])\n // https://tc39.github.io/ecma262/#sec-toprimitive\n function ToPrimitive(input, PreferredType) {\n switch (Type(input)) {\n case 0 /* Undefined */: return input;\n case 1 /* Null */: return input;\n case 2 /* Boolean */: return input;\n case 3 /* String */: return input;\n case 4 /* Symbol */: return input;\n case 5 /* Number */: return input;\n }\n var hint = PreferredType === 3 /* String */ ? \"string\" : PreferredType === 5 /* Number */ ? \"number\" : \"default\";\n var exoticToPrim = GetMethod(input, toPrimitiveSymbol);\n if (exoticToPrim !== undefined) {\n var result = exoticToPrim.call(input, hint);\n if (IsObject(result))\n throw new TypeError();\n return result;\n }\n return OrdinaryToPrimitive(input, hint === \"default\" ? \"number\" : hint);\n }\n // 7.1.1.1 OrdinaryToPrimitive(O, hint)\n // https://tc39.github.io/ecma262/#sec-ordinarytoprimitive\n function OrdinaryToPrimitive(O, hint) {\n if (hint === \"string\") {\n var toString_1 = O.toString;\n if (IsCallable(toString_1)) {\n var result = toString_1.call(O);\n if (!IsObject(result))\n return result;\n }\n var valueOf = O.valueOf;\n if (IsCallable(valueOf)) {\n var result = valueOf.call(O);\n if (!IsObject(result))\n return result;\n }\n }\n else {\n var valueOf = O.valueOf;\n if (IsCallable(valueOf)) {\n var result = valueOf.call(O);\n if (!IsObject(result))\n return result;\n }\n var toString_2 = O.toString;\n if (IsCallable(toString_2)) {\n var result = toString_2.call(O);\n if (!IsObject(result))\n return result;\n }\n }\n throw new TypeError();\n }\n // 7.1.2 ToBoolean(argument)\n // https://tc39.github.io/ecma262/2016/#sec-toboolean\n function ToBoolean(argument) {\n return !!argument;\n }\n // 7.1.12 ToString(argument)\n // https://tc39.github.io/ecma262/#sec-tostring\n function ToString(argument) {\n return \"\" + argument;\n }\n // 7.1.14 ToPropertyKey(argument)\n // https://tc39.github.io/ecma262/#sec-topropertykey\n function ToPropertyKey(argument) {\n var key = ToPrimitive(argument, 3 /* String */);\n if (IsSymbol(key))\n return key;\n return ToString(key);\n }\n // 7.2 Testing and Comparison Operations\n // https://tc39.github.io/ecma262/#sec-testing-and-comparison-operations\n // 7.2.2 IsArray(argument)\n // https://tc39.github.io/ecma262/#sec-isarray\n function IsArray(argument) {\n return Array.isArray\n ? Array.isArray(argument)\n : argument instanceof Object\n ? argument instanceof Array\n : Object.prototype.toString.call(argument) === \"[object Array]\";\n }\n // 7.2.3 IsCallable(argument)\n // https://tc39.github.io/ecma262/#sec-iscallable\n function IsCallable(argument) {\n // NOTE: This is an approximation as we cannot check for [[Call]] internal method.\n return typeof argument === \"function\";\n }\n // 7.2.4 IsConstructor(argument)\n // https://tc39.github.io/ecma262/#sec-isconstructor\n function IsConstructor(argument) {\n // NOTE: This is an approximation as we cannot check for [[Construct]] internal method.\n return typeof argument === \"function\";\n }\n // 7.2.7 IsPropertyKey(argument)\n // https://tc39.github.io/ecma262/#sec-ispropertykey\n function IsPropertyKey(argument) {\n switch (Type(argument)) {\n case 3 /* String */: return true;\n case 4 /* Symbol */: return true;\n default: return false;\n }\n }\n function SameValueZero(x, y) {\n return x === y || x !== x && y !== y;\n }\n // 7.3 Operations on Objects\n // https://tc39.github.io/ecma262/#sec-operations-on-objects\n // 7.3.9 GetMethod(V, P)\n // https://tc39.github.io/ecma262/#sec-getmethod\n function GetMethod(V, P) {\n var func = V[P];\n if (func === undefined || func === null)\n return undefined;\n if (!IsCallable(func))\n throw new TypeError();\n return func;\n }\n // 7.4 Operations on Iterator Objects\n // https://tc39.github.io/ecma262/#sec-operations-on-iterator-objects\n function GetIterator(obj) {\n var method = GetMethod(obj, iteratorSymbol);\n if (!IsCallable(method))\n throw new TypeError(); // from Call\n var iterator = method.call(obj);\n if (!IsObject(iterator))\n throw new TypeError();\n return iterator;\n }\n // 7.4.4 IteratorValue(iterResult)\n // https://tc39.github.io/ecma262/2016/#sec-iteratorvalue\n function IteratorValue(iterResult) {\n return iterResult.value;\n }\n // 7.4.5 IteratorStep(iterator)\n // https://tc39.github.io/ecma262/#sec-iteratorstep\n function IteratorStep(iterator) {\n var result = iterator.next();\n return result.done ? false : result;\n }\n // 7.4.6 IteratorClose(iterator, completion)\n // https://tc39.github.io/ecma262/#sec-iteratorclose\n function IteratorClose(iterator) {\n var f = iterator[\"return\"];\n if (f)\n f.call(iterator);\n }\n // 9.1 Ordinary Object Internal Methods and Internal Slots\n // https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots\n // 9.1.1.1 OrdinaryGetPrototypeOf(O)\n // https://tc39.github.io/ecma262/#sec-ordinarygetprototypeof\n function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }\n // Global metadata registry\n // - Allows `import \"reflect-metadata\"` and `import \"reflect-metadata/no-conflict\"` to interoperate.\n // - Uses isolated metadata if `Reflect` is frozen before the registry can be installed.\n /**\n * Creates a registry used to allow multiple `reflect-metadata` providers.\n */\n function CreateMetadataRegistry() {\n var fallback;\n if (!IsUndefined(registrySymbol) &&\n typeof root.Reflect !== \"undefined\" &&\n !(registrySymbol in root.Reflect) &&\n typeof root.Reflect.defineMetadata === \"function\") {\n // interoperate with older version of `reflect-metadata` that did not support a registry.\n fallback = CreateFallbackProvider(root.Reflect);\n }\n var first;\n var second;\n var rest;\n var targetProviderMap = new _WeakMap();\n var registry = {\n registerProvider: registerProvider,\n getProvider: getProvider,\n setProvider: setProvider,\n };\n return registry;\n function registerProvider(provider) {\n if (!Object.isExtensible(registry)) {\n throw new Error(\"Cannot add provider to a frozen registry.\");\n }\n switch (true) {\n case fallback === provider: break;\n case IsUndefined(first):\n first = provider;\n break;\n case first === provider: break;\n case IsUndefined(second):\n second = provider;\n break;\n case second === provider: break;\n default:\n if (rest === undefined)\n rest = new _Set();\n rest.add(provider);\n break;\n }\n }\n function getProviderNoCache(O, P) {\n if (!IsUndefined(first)) {\n if (first.isProviderFor(O, P))\n return first;\n if (!IsUndefined(second)) {\n if (second.isProviderFor(O, P))\n return first;\n if (!IsUndefined(rest)) {\n var iterator = GetIterator(rest);\n while (true) {\n var next = IteratorStep(iterator);\n if (!next) {\n return undefined;\n }\n var provider = IteratorValue(next);\n if (provider.isProviderFor(O, P)) {\n IteratorClose(iterator);\n return provider;\n }\n }\n }\n }\n }\n if (!IsUndefined(fallback) && fallback.isProviderFor(O, P)) {\n return fallback;\n }\n return undefined;\n }\n function getProvider(O, P) {\n var providerMap = targetProviderMap.get(O);\n var provider;\n if (!IsUndefined(providerMap)) {\n provider = providerMap.get(P);\n }\n if (!IsUndefined(provider)) {\n return provider;\n }\n provider = getProviderNoCache(O, P);\n if (!IsUndefined(provider)) {\n if (IsUndefined(providerMap)) {\n providerMap = new _Map();\n targetProviderMap.set(O, providerMap);\n }\n providerMap.set(P, provider);\n }\n return provider;\n }\n function hasProvider(provider) {\n if (IsUndefined(provider))\n throw new TypeError();\n return first === provider || second === provider || !IsUndefined(rest) && rest.has(provider);\n }\n function setProvider(O, P, provider) {\n if (!hasProvider(provider)) {\n throw new Error(\"Metadata provider not registered.\");\n }\n var existingProvider = getProvider(O, P);\n if (existingProvider !== provider) {\n if (!IsUndefined(existingProvider)) {\n return false;\n }\n var providerMap = targetProviderMap.get(O);\n if (IsUndefined(providerMap)) {\n providerMap = new _Map();\n targetProviderMap.set(O, providerMap);\n }\n providerMap.set(P, provider);\n }\n return true;\n }\n }\n /**\n * Gets or creates the shared registry of metadata providers.\n */\n function GetOrCreateMetadataRegistry() {\n var metadataRegistry;\n if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {\n metadataRegistry = root.Reflect[registrySymbol];\n }\n if (IsUndefined(metadataRegistry)) {\n metadataRegistry = CreateMetadataRegistry();\n }\n if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {\n Object.defineProperty(root.Reflect, registrySymbol, {\n enumerable: false,\n configurable: false,\n writable: false,\n value: metadataRegistry\n });\n }\n return metadataRegistry;\n }\n function CreateMetadataProvider(registry) {\n // [[Metadata]] internal slot\n // https://rbuckton.github.io/reflect-metadata/#ordinary-object-internal-methods-and-internal-slots\n var metadata = new _WeakMap();\n var provider = {\n isProviderFor: function (O, P) {\n var targetMetadata = metadata.get(O);\n if (IsUndefined(targetMetadata))\n return false;\n return targetMetadata.has(P);\n },\n OrdinaryDefineOwnMetadata: OrdinaryDefineOwnMetadata,\n OrdinaryHasOwnMetadata: OrdinaryHasOwnMetadata,\n OrdinaryGetOwnMetadata: OrdinaryGetOwnMetadata,\n OrdinaryOwnMetadataKeys: OrdinaryOwnMetadataKeys,\n OrdinaryDeleteMetadata: OrdinaryDeleteMetadata,\n };\n metadataRegistry.registerProvider(provider);\n return provider;\n function GetOrCreateMetadataMap(O, P, Create) {\n var targetMetadata = metadata.get(O);\n var createdTargetMetadata = false;\n if (IsUndefined(targetMetadata)) {\n if (!Create)\n return undefined;\n targetMetadata = new _Map();\n metadata.set(O, targetMetadata);\n createdTargetMetadata = true;\n }\n var metadataMap = targetMetadata.get(P);\n if (IsUndefined(metadataMap)) {\n if (!Create)\n return undefined;\n metadataMap = new _Map();\n targetMetadata.set(P, metadataMap);\n if (!registry.setProvider(O, P, provider)) {\n targetMetadata.delete(P);\n if (createdTargetMetadata) {\n metadata.delete(O);\n }\n throw new Error(\"Wrong provider for target.\");\n }\n }\n return metadataMap;\n }\n // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata\n function OrdinaryHasOwnMetadata(MetadataKey, O, P) {\n var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n if (IsUndefined(metadataMap))\n return false;\n return ToBoolean(metadataMap.has(MetadataKey));\n }\n // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata\n function OrdinaryGetOwnMetadata(MetadataKey, O, P) {\n var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n if (IsUndefined(metadataMap))\n return undefined;\n return metadataMap.get(MetadataKey);\n }\n // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata\n function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {\n var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ true);\n metadataMap.set(MetadataKey, MetadataValue);\n }\n // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys\n function OrdinaryOwnMetadataKeys(O, P) {\n var keys = [];\n var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n if (IsUndefined(metadataMap))\n return keys;\n var keysObj = metadataMap.keys();\n var iterator = GetIterator(keysObj);\n var k = 0;\n while (true) {\n var next = IteratorStep(iterator);\n if (!next) {\n keys.length = k;\n return keys;\n }\n var nextValue = IteratorValue(next);\n try {\n keys[k] = nextValue;\n }\n catch (e) {\n try {\n IteratorClose(iterator);\n }\n finally {\n throw e;\n }\n }\n k++;\n }\n }\n function OrdinaryDeleteMetadata(MetadataKey, O, P) {\n var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n if (IsUndefined(metadataMap))\n return false;\n if (!metadataMap.delete(MetadataKey))\n return false;\n if (metadataMap.size === 0) {\n var targetMetadata = metadata.get(O);\n if (!IsUndefined(targetMetadata)) {\n targetMetadata.delete(P);\n if (targetMetadata.size === 0) {\n metadata.delete(targetMetadata);\n }\n }\n }\n return true;\n }\n }\n function CreateFallbackProvider(reflect) {\n var defineMetadata = reflect.defineMetadata, hasOwnMetadata = reflect.hasOwnMetadata, getOwnMetadata = reflect.getOwnMetadata, getOwnMetadataKeys = reflect.getOwnMetadataKeys, deleteMetadata = reflect.deleteMetadata;\n var metadataOwner = new _WeakMap();\n var provider = {\n isProviderFor: function (O, P) {\n var metadataPropertySet = metadataOwner.get(O);\n if (!IsUndefined(metadataPropertySet) && metadataPropertySet.has(P)) {\n return true;\n }\n if (getOwnMetadataKeys(O, P).length) {\n if (IsUndefined(metadataPropertySet)) {\n metadataPropertySet = new _Set();\n metadataOwner.set(O, metadataPropertySet);\n }\n metadataPropertySet.add(P);\n return true;\n }\n return false;\n },\n OrdinaryDefineOwnMetadata: defineMetadata,\n OrdinaryHasOwnMetadata: hasOwnMetadata,\n OrdinaryGetOwnMetadata: getOwnMetadata,\n OrdinaryOwnMetadataKeys: getOwnMetadataKeys,\n OrdinaryDeleteMetadata: deleteMetadata,\n };\n return provider;\n }\n /**\n * Gets the metadata provider for an object. If the object has no metadata provider and this is for a create operation,\n * then this module's metadata provider is assigned to the object.\n */\n function GetMetadataProvider(O, P, Create) {\n var registeredProvider = metadataRegistry.getProvider(O, P);\n if (!IsUndefined(registeredProvider)) {\n return registeredProvider;\n }\n if (Create) {\n if (metadataRegistry.setProvider(O, P, metadataProvider)) {\n return metadataProvider;\n }\n throw new Error(\"Illegal state.\");\n }\n return undefined;\n }\n // naive Map shim\n function CreateMapPolyfill() {\n var cacheSentinel = {};\n var arraySentinel = [];\n var MapIterator = /** @class */ (function () {\n function MapIterator(keys, values, selector) {\n this._index = 0;\n this._keys = keys;\n this._values = values;\n this._selector = selector;\n }\n MapIterator.prototype[\"@@iterator\"] = function () { return this; };\n MapIterator.prototype[iteratorSymbol] = function () { return this; };\n MapIterator.prototype.next = function () {\n var index = this._index;\n if (index >= 0 && index < this._keys.length) {\n var result = this._selector(this._keys[index], this._values[index]);\n if (index + 1 >= this._keys.length) {\n this._index = -1;\n this._keys = arraySentinel;\n this._values = arraySentinel;\n }\n else {\n this._index++;\n }\n return { value: result, done: false };\n }\n return { value: undefined, done: true };\n };\n MapIterator.prototype.throw = function (error) {\n if (this._index >= 0) {\n this._index = -1;\n this._keys = arraySentinel;\n this._values = arraySentinel;\n }\n throw error;\n };\n MapIterator.prototype.return = function (value) {\n if (this._index >= 0) {\n this._index = -1;\n this._keys = arraySentinel;\n this._values = arraySentinel;\n }\n return { value: value, done: true };\n };\n return MapIterator;\n }());\n var Map = /** @class */ (function () {\n function Map() {\n this._keys = [];\n this._values = [];\n this._cacheKey = cacheSentinel;\n this._cacheIndex = -2;\n }\n Object.defineProperty(Map.prototype, \"size\", {\n get: function () { return this._keys.length; },\n enumerable: true,\n configurable: true\n });\n Map.prototype.has = function (key) { return this._find(key, /*insert*/ false) >= 0; };\n Map.prototype.get = function (key) {\n var index = this._find(key, /*insert*/ false);\n return index >= 0 ? this._values[index] : undefined;\n };\n Map.prototype.set = function (key, value) {\n var index = this._find(key, /*insert*/ true);\n this._values[index] = value;\n return this;\n };\n Map.prototype.delete = function (key) {\n var index = this._find(key, /*insert*/ false);\n if (index >= 0) {\n var size = this._keys.length;\n for (var i = index + 1; i < size; i++) {\n this._keys[i - 1] = this._keys[i];\n this._values[i - 1] = this._values[i];\n }\n this._keys.length--;\n this._values.length--;\n if (SameValueZero(key, this._cacheKey)) {\n this._cacheKey = cacheSentinel;\n this._cacheIndex = -2;\n }\n return true;\n }\n return false;\n };\n Map.prototype.clear = function () {\n this._keys.length = 0;\n this._values.length = 0;\n this._cacheKey = cacheSentinel;\n this._cacheIndex = -2;\n };\n Map.prototype.keys = function () { return new MapIterator(this._keys, this._values, getKey); };\n Map.prototype.values = function () { return new MapIterator(this._keys, this._values, getValue); };\n Map.prototype.entries = function () { return new MapIterator(this._keys, this._values, getEntry); };\n Map.prototype[\"@@iterator\"] = function () { return this.entries(); };\n Map.prototype[iteratorSymbol] = function () { return this.entries(); };\n Map.prototype._find = function (key, insert) {\n if (!SameValueZero(this._cacheKey, key)) {\n this._cacheIndex = -1;\n for (var i = 0; i < this._keys.length; i++) {\n if (SameValueZero(this._keys[i], key)) {\n this._cacheIndex = i;\n break;\n }\n }\n }\n if (this._cacheIndex < 0 && insert) {\n this._cacheIndex = this._keys.length;\n this._keys.push(key);\n this._values.push(undefined);\n }\n return this._cacheIndex;\n };\n return Map;\n }());\n return Map;\n function getKey(key, _) {\n return key;\n }\n function getValue(_, value) {\n return value;\n }\n function getEntry(key, value) {\n return [key, value];\n }\n }\n // naive Set shim\n function CreateSetPolyfill() {\n var Set = /** @class */ (function () {\n function Set() {\n this._map = new _Map();\n }\n Object.defineProperty(Set.prototype, \"size\", {\n get: function () { return this._map.size; },\n enumerable: true,\n configurable: true\n });\n Set.prototype.has = function (value) { return this._map.has(value); };\n Set.prototype.add = function (value) { return this._map.set(value, value), this; };\n Set.prototype.delete = function (value) { return this._map.delete(value); };\n Set.prototype.clear = function () { this._map.clear(); };\n Set.prototype.keys = function () { return this._map.keys(); };\n Set.prototype.values = function () { return this._map.keys(); };\n Set.prototype.entries = function () { return this._map.entries(); };\n Set.prototype[\"@@iterator\"] = function () { return this.keys(); };\n Set.prototype[iteratorSymbol] = function () { return this.keys(); };\n return Set;\n }());\n return Set;\n }\n // naive WeakMap shim\n function CreateWeakMapPolyfill() {\n var UUID_SIZE = 16;\n var keys = HashMap.create();\n var rootKey = CreateUniqueKey();\n return /** @class */ (function () {\n function WeakMap() {\n this._key = CreateUniqueKey();\n }\n WeakMap.prototype.has = function (target) {\n var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n return table !== undefined ? HashMap.has(table, this._key) : false;\n };\n WeakMap.prototype.get = function (target) {\n var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n return table !== undefined ? HashMap.get(table, this._key) : undefined;\n };\n WeakMap.prototype.set = function (target, value) {\n var table = GetOrCreateWeakMapTable(target, /*create*/ true);\n table[this._key] = value;\n return this;\n };\n WeakMap.prototype.delete = function (target) {\n var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n return table !== undefined ? delete table[this._key] : false;\n };\n WeakMap.prototype.clear = function () {\n // NOTE: not a real clear, just makes the previous data unreachable\n this._key = CreateUniqueKey();\n };\n return WeakMap;\n }());\n function CreateUniqueKey() {\n var key;\n do\n key = \"@@WeakMap@@\" + CreateUUID();\n while (HashMap.has(keys, key));\n keys[key] = true;\n return key;\n }\n function GetOrCreateWeakMapTable(target, create) {\n if (!hasOwn.call(target, rootKey)) {\n if (!create)\n return undefined;\n Object.defineProperty(target, rootKey, { value: HashMap.create() });\n }\n return target[rootKey];\n }\n function FillRandomBytes(buffer, size) {\n for (var i = 0; i < size; ++i)\n buffer[i] = Math.random() * 0xff | 0;\n return buffer;\n }\n function GenRandomBytes(size) {\n if (typeof Uint8Array === \"function\") {\n var array = new Uint8Array(size);\n if (typeof crypto !== \"undefined\") {\n crypto.getRandomValues(array);\n }\n else if (typeof msCrypto !== \"undefined\") {\n msCrypto.getRandomValues(array);\n }\n else {\n FillRandomBytes(array, size);\n }\n return array;\n }\n return FillRandomBytes(new Array(size), size);\n }\n function CreateUUID() {\n var data = GenRandomBytes(UUID_SIZE);\n // mark as random - RFC 4122 § 4.4\n data[6] = data[6] & 0x4f | 0x40;\n data[8] = data[8] & 0xbf | 0x80;\n var result = \"\";\n for (var offset = 0; offset < UUID_SIZE; ++offset) {\n var byte = data[offset];\n if (offset === 4 || offset === 6 || offset === 8)\n result += \"-\";\n if (byte < 16)\n result += \"0\";\n result += byte.toString(16).toLowerCase();\n }\n return result;\n }\n }\n // uses a heuristic used by v8 and chakra to force an object into dictionary mode.\n function MakeDictionary(obj) {\n obj.__ = undefined;\n delete obj.__;\n return obj;\n }\n });\n})(Reflect || (Reflect = {}));\n","import \"reflect-metadata\";\nimport { z } from \"zod/v4\";\n\n/**\n * Metadata interface for API method decorators\n */\nexport interface MethodMetadata {\n /** Description of the API method */\n description: string;\n /** HTTP verb (GET, POST, PUT, DELETE, etc.) */\n httpVerb: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\";\n /** API endpoint path (e.g., \"/quotes\", \"/payments/session\") */\n endpoint: string;\n /** Zod schema for request input validation */\n inputSchema?: z.ZodSchema;\n /** Zod schema for response output validation */\n outputSchema?: z.ZodSchema;\n}\n\n/**\n * Symbol key for storing API method metadata\n */\nexport const API_METHOD_METADATA_KEY = Symbol(\"api-method-metadata\");\n\n// A global registry that maps endpoint strings (with HTTP verb) to MethodMetadata\nexport const methodMetadataRegistry = new Map<string, MethodMetadata>();\n\n/**\n * @MethodMetadata decorator factory\n * - Attaches `config` to the prototype under MetadataKey.MethodMetadata\n * - Injects a static toJSON(methodName) on the constructor\n */\nexport const MethodMetadata = (config: MethodMetadata) => {\n return (target: object, propertyKey: string | symbol) => {\n // 1) Store metadata on the prototype for this method\n Reflect.defineMetadata(API_METHOD_METADATA_KEY, config, target, propertyKey);\n\n // 2) Store metadata in the global registry\n const httpVerb = config.httpVerb;\n const endpoint = config.endpoint;\n const key = `${httpVerb.toLowerCase()} ${endpoint}`;\n methodMetadataRegistry.set(key, config);\n\n // 3) Inject static toJSON(...) on the class constructor if not already defined\n const ctor = (target as any).constructor as MethodMetadataContainer;\n if (typeof ctor.toJSON !== \"function\") {\n Object.defineProperty(ctor, \"toJSON\", {\n value: (methodName: string): MethodMetadata | undefined => {\n return Reflect.getMetadata(API_METHOD_METADATA_KEY, ctor.prototype, methodName);\n },\n writable: false,\n configurable: false,\n });\n }\n };\n};\n\n/**\n * By declaring this interface, TypeScript knows\n * that any class decorated with @MethodMetadata has a static toJSON method.\n */\nexport interface MethodMetadataContainer {\n new (...args: any[]): unknown;\n toJSON(methodName: string): MethodMetadata | undefined;\n}\n","import { AxiosResponse } from \"axios\";\n\nimport { HALLIDAY_PAYMENTS_API_URL } from \"@shared/constants\";\nimport { methodMetadataRegistry } from \"../decorators\";\n\n/**\n * Configuration options for response validation\n */\nexport interface ResponseValidationOptions {\n /** Whether to enable response validation */\n enabled: boolean;\n /** Enable debug logging */\n debug?: boolean;\n}\n\n/**\n * Default response validation configuration\n */\nexport const defaultValidationOptions: ResponseValidationOptions = {\n enabled: true,\n debug: false,\n};\n\n/**\n * Extracts and normalizes the endpoint from a URL for schema lookup.\n * Handles dynamic path parameters and query strings.\n */\nexport const extractPathname = (url: string, baseUrl: string = HALLIDAY_PAYMENTS_API_URL): string => {\n if (!url) return \"\";\n\n // Remove base URL if present and get just the path\n const urlObj = new URL(url, baseUrl);\n let pathname = urlObj.pathname;\n\n // Strip dynamic segments by removing common patterns\n pathname = pathname\n // Replace UUIDs (e.g., /quotes/unwant/550e8400-e29b-41d4-a716-446655440000 -> /quotes/unwant)\n .replace(/\\/[0-9a-f]{8}\\b-[0-9a-f]{4}\\b-[0-9a-f]{4}\\b-[0-9a-f]{4}\\b-[0-9a-f]{12}/gi, \"\");\n\n return pathname;\n};\n\n/**\n * Validates an API response against its expected schema.\n * Logs warnings if validation fails but doesn't throw errors.\n */\nexport const validateResponse = (\n response: AxiosResponse,\n options: ResponseValidationOptions = defaultValidationOptions\n): void => {\n // Skip validation if disabled\n if (!options.enabled) {\n return;\n }\n\n try {\n const endpoint = extractPathname(response.config.url || \"\");\n if (!endpoint) {\n if (options.debug) {\n console.debug(\"[HallidayPaymentsApiClient] No endpoint found in URL:\", response.config.url);\n }\n return;\n }\n\n const httpVerb = response.config.method?.toLowerCase() || \"get\";\n const key = `${httpVerb} ${endpoint}`;\n const schema = methodMetadataRegistry.get(key)?.outputSchema;\n // Skip validation if no schema is defined for this endpoint\n if (!schema) {\n if (options.debug) {\n console.debug(`[HallidayPaymentsApiClient] No validation schema defined for endpoint: ${endpoint}`);\n }\n return;\n }\n\n // Perform validation\n const result = schema.safeParse(response.data);\n if (!result.success) {\n console.warn(\n `[HallidayPaymentsApiClient] Response validation failed for ${endpoint}. Your SDK version might be outdated - please check for updates.`\n );\n if (options.debug) {\n console.debug(\"[HallidayPaymentsApiClient] Response validation error:\", result.error);\n }\n }\n } catch (error) {\n // Silently fail validation to not break the main application flow\n if (options.debug) {\n console.debug(\"[HallidayPaymentsApiClient] Response validation error:\", error);\n }\n }\n};\n\n/**\n * Creates a response validation interceptor function for axios.\n */\nexport const createResponseValidationInterceptor = (options: ResponseValidationOptions) => {\n return {\n onFulfilled: <T>(response: AxiosResponse<T>): AxiosResponse<T> => {\n validateResponse(response, options);\n return response;\n },\n onRejected: (error: any) => {\n // pass through the error\n throw error;\n },\n };\n};\n","import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from \"axios\";\nimport { ZodError, ZodIssue } from \"zod/v4\";\n\n/**\n * The type of error that can occur in the payments API client.\n * @enum {string}\n * @readonly\n */\nexport enum ErrorCodes {\n /**\n * The error code for zod validation errors.\n * @type {string}\n */\n VALIDATION_ERROR = \"VALIDATION_ERROR\",\n /**\n * The error code for Halliday Payments API business logic errors.\n * @type {string}\n */\n API_ERROR = \"API_ERROR\",\n /**\n * The error code for server 500 errors.\n * @type {string}\n */\n SERVER_ERROR = \"SERVER_ERROR\",\n /**\n * The error code for axios/network errors.\n * @type {string}\n */\n NETWORK_ERROR = \"NETWORK_ERROR\",\n /**\n * The error code for unknown errors.\n * @type {string}\n */\n UNKNOWN_ERROR = \"UNKNOWN_ERROR\",\n}\n\n/**\n * Custom error class for the payments API client.\n * @extends Error\n * @property {string} name - HallidayPaymentsApiClientError.\n * @property {ErrorCodes} code - The error code.\n * @property {string} message - The message of the error.\n * @property {string} validationMessage - The message from zod validation error.\n * @property {ZodError[\"issues\"]} validationIssues - The issues from zod validation error.\n * @property {number} status - The HTTP request status.\n * @property {string} statusText - The HTTP request status text.\n * @property {Record<string, any>} reqHeaders - The HTTP request headers.\n * @property {Record<string, any>} resHeaders - The HTTP response headers.\n * @property {any} data - The response data from the server.\n * @property {AxiosRequestConfig} config - The request configuration.\n * @property {any} request - The request object.\n * @property {AxiosResponse} response - The response object.\n * @property {Error} error - The error object.\n */\nexport class PaymentsApiClientError extends Error {\n name: string = \"HallidayPaymentsApiClientError\";\n code: ErrorCodes;\n message: string;\n\n // Zod Validation Errors\n validationIssues: ZodError[\"issues\"] | null = null;\n validationMessage: ZodError[\"message\"] | string | null = null;\n\n // Axios provided properties\n status: number | null = null;\n statusText: string | null = null;\n reqHeaders: Record<string, any> | null = null;\n resHeaders: Record<string, any> | null = null;\n data: any | null = null;\n config: AxiosRequestConfig | null = null;\n request: any | null = null;\n response: AxiosResponse | null = null;\n\n // Fallback error\n error: Error | any = null;\n\n constructor({\n message,\n code,\n status,\n statusText,\n reqHeaders,\n resHeaders,\n data,\n config,\n request,\n response,\n error,\n validationIssues,\n validationMessage,\n }: {\n message: string;\n code: ErrorCodes;\n status?: number;\n statusText?: string;\n reqHeaders?: Record<string, any>;\n resHeaders?: Record<string, any>;\n data?: any;\n config?: AxiosRequestConfig;\n request?: any;\n response?: AxiosResponse;\n error?: Error;\n validationIssues?: ZodError[\"issues\"] | null;\n validationMessage?: ZodError[\"message\"] | string | null;\n }) {\n super(message);\n this.code = code;\n this.message = message;\n this.status = status ?? null;\n this.statusText = statusText ?? null;\n this.reqHeaders = reqHeaders ?? null;\n this.resHeaders = resHeaders ?? null;\n this.data = data ?? null;\n this.config = config ?? null;\n this.request = request ?? null;\n this.response = response ?? null;\n this.error = error ?? null;\n this.validationIssues = validationIssues ?? null;\n this.validationMessage = validationMessage ?? null;\n\n // Maintains proper prototype chain\n Object.setPrototypeOf(this, PaymentsApiClientError.prototype);\n }\n\n static isPaymentsApiClientError(error: unknown): error is PaymentsApiClientError {\n return error instanceof PaymentsApiClientError;\n }\n\n static parseValidationError({\n message,\n error,\n }: {\n message?: string;\n error?: ZodError | Error;\n }): PaymentsApiClientError {\n const validationMessage = message ?? error?.message ?? \"Validation error\";\n return new PaymentsApiClientError({\n message: validationMessage,\n code: ErrorCodes.VALIDATION_ERROR,\n validationIssues: error instanceof ZodError ? error.issues : null,\n validationMessage: error instanceof ZodError ? error.message : null,\n error,\n });\n }\n\n static parseAxiosError(error: AxiosError): PaymentsApiClientError | null {\n if (error.response) {\n const errorStatus = error.response.status;\n let errorsFromResponse: string | string[] | ZodIssue[] = (error.response.data as any)?.errors || [];\n let validationIssues: ZodIssue[] | null = null;\n if (!Array.isArray(errorsFromResponse)) {\n errorsFromResponse = [errorsFromResponse];\n }\n\n let errorMessages =\n errorsFromResponse\n .map((errorFromResponse: string | object) => {\n if (typeof errorFromResponse !== \"string\") {\n return JSON.stringify(errorFromResponse);\n }\n return errorFromResponse;\n })\n .join(\"\\n\") ||\n error.message ||\n \"Unknown error\";\n let statusText = error.response?.statusText;\n\n if (errorStatus === 500) {\n return new PaymentsApiClientError({\n message: errorMessages,\n code: ErrorCodes.SERVER_ERROR,\n status: 500,\n statusText: `${error.code ?? \"500\"}: ${statusText ?? \"Server Error\"}`,\n data: error.response?.data,\n config: error.config,\n request: error.request,\n response: error.response,\n reqHeaders: error.request?.headers,\n resHeaders: error.response?.headers,\n });\n } else if (errorStatus === 400) {\n errorMessages = `Bad request: ${errorMessages}`;\n statusText = `${error.code ?? \"400\"}: ${statusText ?? \"Bad Request\"}`;\n validationIssues = errorsFromResponse as ZodIssue[];\n } else if (errorStatus === 401) {\n errorMessages = `Unauthorized: ${errorMessages}`;\n statusText = `${error.code ?? \"401\"}: ${statusText ?? \"Unauthorized\"}`;\n } else if (errorStatus === 403) {\n errorMessages = `Forbidden: ${errorMessages}`;\n statusText = `${error.code ?? \"403\"}: ${statusText ?? \"Forbidden\"}`;\n } else if (errorStatus === 404) {\n errorMessages = `Resource not found: ${errorMessages}`;\n statusText = `${error.code ?? \"404\"}: ${statusText ?? \"Not Found\"}`;\n } else {\n errorMessages = `Request failed with status ${errorStatus}: ${errorMessages}`;\n statusText = `${error.code ?? errorStatus}: ${statusText ?? \"Unexpected error\"}`;\n }\n return new PaymentsApiClientError({\n message: errorMessages,\n code: ErrorCodes.API_ERROR,\n status: errorStatus,\n statusText,\n data: error.response?.data,\n config: error.config,\n request: error.request,\n response: error.response,\n reqHeaders: error.request?.headers,\n resHeaders: error.response?.headers,\n validationIssues,\n });\n } else if (error.request) {\n return new PaymentsApiClientError({\n message: error.message || `No response received from the server: ${error.code}`,\n code: ErrorCodes.NETWORK_ERROR,\n config: error.config,\n request: error.request,\n reqHeaders: error.request?.headers,\n });\n } else {\n // Aborted requests are not errors, handle it gracefully\n if (error.code === \"ERR_CANCELED\") {\n return null;\n }\n return new PaymentsApiClientError({\n message: `${error.code ? `${error.code}: ` : \"\"}${error.message || \"No message\"}`,\n code: ErrorCodes.NETWORK_ERROR,\n config: error.config,\n request: error.request,\n error,\n });\n }\n }\n\n toJSON(): string {\n return JSON.stringify({\n name: this.name,\n code: this.code,\n message: this.message,\n validationIssues: this.validationIssues,\n status: this.status,\n statusText: this.statusText,\n config: this.config,\n stack: this.stack,\n });\n }\n}\n\n/**\n * Creates a response error interceptor for axios.\n */\nexport const createErrorInterceptor = () => {\n return {\n onFulfilled: <T>(response: AxiosResponse<T>): AxiosResponse<T> => {\n // Pass through the response\n return response;\n },\n onRejected: (error: any) => {\n if (axios.isAxiosError(error)) {\n const newError = PaymentsApiClientError.parseAxiosError(error);\n if (newError) throw newError;\n return { data: null };\n } else {\n throw new PaymentsApiClientError({\n message: error.message || `Unknown error`,\n code: ErrorCodes.UNKNOWN_ERROR,\n error,\n });\n }\n },\n };\n};\n","import axios from \"axios\";\n\nimport { API_DOMAIN_REGEX, HALLIDAY_PAYMENTS_API_URL } from \"@shared/constants\";\nimport { HSON } from \"../hson\";\nimport {\n ResponseValidationOptions,\n defaultValidationOptions,\n createResponseValidationInterceptor,\n} from \"./responseValidationInterceptor\";\nimport { createErrorInterceptor, PaymentsApiClientError, ErrorCodes } from \"./errorInterceptor\";\n\nexport { PaymentsApiClientError, defaultValidationOptions, ErrorCodes, ResponseValidationOptions };\n\n/**\n * Creates a new axios instance with the given options.\n * @param {Object} options The options for the axios instance.\n * @param {!string} options.apiKey {string} The API key for the axios instance.\n * @param {string=} options.baseUrl {string} The base URL for the axios instance.\n * @param {ResponseValidationOptions=} options.responseValidationOptions {@link ResponseValidationOptions} The options for the response validation interceptor.\n * @returns {AxiosInstance} The axios instance.\n */\nconst createAxiosApiClient = ({\n apiKey,\n baseUrl = HALLIDAY_PAYMENTS_API_URL,\n responseValidationOptions = defaultValidationOptions,\n}: {\n apiKey: string;\n baseUrl?: string;\n responseValidationOptions?: ResponseValidationOptions;\n}) => {\n if (!API_DOMAIN_REGEX.test(baseUrl)) {\n throw new Error(`Invalid base URL: ${baseUrl}`);\n }\n if (!apiKey) {\n throw new Error(\"API key is required\");\n }\n\n const instance = axios.create({\n baseURL: baseUrl,\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${apiKey}`,\n },\n parseReviver: HSON.reviver,\n });\n\n // Add response validation interceptor\n const validationInterceptor = createResponseValidationInterceptor(responseValidationOptions);\n instance.interceptors.response.use(validationInterceptor.onFulfilled, validationInterceptor.onRejected);\n\n // Add error interceptor\n const errorInterceptor = createErrorInterceptor();\n instance.interceptors.response.use(errorInterceptor.onFulfilled, errorInterceptor.onRejected);\n\n return instance;\n};\n\nexport default createAxiosApiClient;\n","import { AssetFilters } from \"./types\";\n\nexport const getQueryParamsFromAssetFilters = (filters: AssetFilters): string => {\n return Object.entries(filters)\n .reduce((acc, [key, value]) => {\n if (key === \"sandbox\") {\n acc.push(`sandbox=${value === true ? \"true\" : \"false\"}`);\n } else if (Array.isArray(value)) {\n for (const valueItem of value) {\n acc.push(`${key}[]=${valueItem}`);\n }\n } else {\n acc.push(`${key}=${value}`);\n }\n return acc;\n }, [] as string[])\n .join(\"&\");\n};\n","import { z } from \"zod/v4\";\n\nimport { Address, Amount, Asset, Fiat, OnrampMethod, RampName, Token, TokenPointer } from \"@shared/types\";\nimport { UUID_REGEX } from \"@shared/constants\";\n\nexport const PaymentId = z.string().refine((id) => UUID_REGEX.test(id), {\n message: \"Invalid payment ID\",\n});\nexport type PaymentId = z.infer<typeof PaymentId>;\n\nexport const Feature = z.enum([\"BETA_EDGES\", \"ORG_BETA_EDGES\", \"ORG_EDGES\"]);\nexport type Feature = z.infer<typeof Feature>;\n\nconst BaseAssetFilters = z.object({\n onramps: z.array(RampName).optional(),\n offramps: z.array(RampName).optional(),\n sandbox: z.boolean().optional().default(false),\n features: z.array(Feature).optional(),\n});\n\nexport const InputsAssetFilters = BaseAssetFilters.extend({\n inputs: z.array(Asset).optional(),\n outputs: z.array(Asset),\n});\nexport type InputsAssetFilters = z.input<typeof InputsAssetFilters>;\n\nexport const OutputsAssetFilters = BaseAssetFilters.extend({\n inputs: z.array(Asset),\n outputs: z.array(Asset).optional(),\n});\nexport type OutputsAssetFilters = z.input<typeof OutputsAssetFilters>;\n\nexport const AssetFilters = z.union([InputsAssetFilters, OutputsAssetFilters]);\nexport type AssetFilters = z.infer<typeof AssetFilters>;\n\nconst AssetAmount = z.object({\n asset: Asset,\n amount: Amount,\n});\ntype AssetAmount = z.infer<typeof AssetAmount>;\n\nconst TokenAmount = z.object({\n token: Token,\n amount: Amount,\n});\ntype TokenAmount = z.infer<typeof TokenAmount>;\n\nconst Signature = z.string();\ntype Signature = z.infer<typeof Signature>;\n\nexport const IPAddressOverride = z.union([z.ipv4(), z.ipv6()]);\n\nconst BaseQuoteRequest = z.object({\n price_currency: Fiat,\n\n // onramp filters\n onramps: z.array(RampName).optional(),\n onramp_methods: z.array(OnrampMethod).optional(),\n\n // XXX add offramp filters\n\n // optional customer information\n customer_ip_address: z.string().optional(),\n customer_id: z.string().optional(),\n\n // optional parent payment ID for re-quote\n parent_payment_id: PaymentId.optional(),\n\n features: z.array(Feature).optional(),\n});\n\nconst FixedInput = z.object({\n kind: z.literal(\"FIXED_INPUT\"),\n fixed_input_amount: AssetAmount,\n output_asset: Asset,\n});\ntype FixedInput = z.infer<typeof FixedInput>;\n\n// TODO: uncomment this when we support FIXED_OUTPUT quotes\n// const FixedOutput = z.object({\n// kind: z.literal(\"FIXED_OUTPUT\"),\n// input_asset: Asset,\n// fixed_output_amount: AssetAmount,\n// });\n// type FixedOutput = z.infer<typeof FixedOutput>;\n\nconst FixedRequest = z.discriminatedUnion(\"kind\", [FixedInput]);\n\nexport const RequestForQuotes = BaseQuoteRequest.extend({\n request: FixedRequest,\n});\nexport type RequestForQuotes = z.infer<typeof RequestForQuotes>;\n\n// Status\nexport const Account = z.enum([\"USER\", \"DEST\", \"HALLIDAY\", \"SPW\", \"REV_SHARE\", \"BRIDGE\"]);\nexport type Account = z.infer<typeof Account>;\n\nconst Property = z.enum([\"APPROVAL\", \"BALANCE\"]);\ntype Property = z.infer<typeof Property>;\nconst Resource = z.object({\n asset: Asset,\n property: Property,\n});\ntype Resource = z.infer<typeof Resource>;\n\nconst ChangeStructure = z.object({\n account: Account,\n resource: Resource,\n});\ntype ChangeStructure = z.infer<typeof ChangeStructure>;\n\nconst TerminalObservedStatus = z.union([z.literal(\"COMPLETE\"), z.literal(\"UNREACHABLE\"), z.literal(\"FAILED\")]);\ntype TerminalObservedStatus = z.infer<typeof TerminalObservedStatus>;\nconst NonTerminalObservedStatus = z.literal(\"PENDING\");\ntype NonTerminalObservedStatus = z.infer<typeof NonTerminalObservedStatus>;\nexport const ObservedStatus = z.union([TerminalObservedStatus, NonTerminalObservedStatus]);\nexport type ObservedStatus = z.infer<typeof ObservedStatus>;\n\nconst WorkflowStatus = z.enum([\"PENDING\", \"COMPLETE\", \"FAILED\", \"EXPIRED\", \"WITHDRAWN\", \"TAINTED\"]);\ntype WorkflowStatus = z.infer<typeof WorkflowStatus>;\n\nconst EffectStructure = z.object({\n consume: z.array(ChangeStructure),\n produce: z.array(ChangeStructure),\n});\ntype EffectStructure = z.infer<typeof EffectStructure>;\n\nexport const ChangeAmount = ChangeStructure.extend({\n amount: Amount,\n});\nexport type ChangeAmount = z.infer<typeof ChangeAmount>;\n\nconst EffectAmount = EffectStructure.extend({\n consume: z.array(ChangeAmount),\n produce: z.array(ChangeAmount),\n});\ntype EffectAmount = z.infer<typeof EffectAmount>;\n\nexport const Prices = z.record(Asset, z.string());\nexport type Prices = z.infer<typeof Prices>;\n\nconst AmountIssue = z.object({\n kind: z.union([z.literal(\"amount\"), z.literal(\"amount-downstream\")]),\n given: z.string(),\n limits: z.object({\n min: z.string().optional(),\n max: z.string().optional(),\n }),\n source: z.string(),\n message: z.string(),\n});\ntype AmountIssue = z.infer<typeof AmountIssue>;\n\nconst GeoLocationIssue = z.object({\n kind: z.literal(\"geolocation\"),\n message: z.string(),\n});\ntype GeoLocationIssue = z.infer<typeof GeoLocationIssue>;\n\nconst ProviderIssue = z.object({\n kind: z.literal(\"provider\"),\n message: z.string(),\n});\ntype ProviderIssue = z.infer<typeof ProviderIssue>;\n\nconst OtherIssue = z.object({\n kind: z.literal(\"other\"),\n message: z.string(),\n});\ntype OtherIssue = z.infer<typeof OtherIssue>;\n\nconst UnknownIssue = z.object({\n kind: z.literal(\"unknown\"),\n message: z.string(),\n});\ntype UnknownIssue = z.infer<typeof UnknownIssue>;\n\nexport const Issue = z.discriminatedUnion(\"kind\", [\n AmountIssue,\n GeoLocationIssue,\n ProviderIssue,\n OtherIssue,\n UnknownIssue,\n]);\nexport type Issue = z.infer<typeof Issue>;\n\nexport const Failure = z.object({\n service_ids: z.array(z.string()),\n latency_seconds: z.number(),\n issues: z.array(Issue).optional(),\n});\nexport type Failure = z.infer<typeof Failure>;\n\nexport const RouteType = z.union([z.literal(\"USER_FUND\"), z.literal(\"ONCHAIN_STEP\"), z.literal(\"ONRAMP\")]);\nexport type RouteType = z.infer<typeof RouteType>;\n\nexport const QuotedRoute = z.object({\n type: RouteType,\n net_effect: EffectAmount,\n pieces_info: z.array(\n z.object({\n type: z.union([\n z.literal(\"onramp\"),\n z.literal(\"poll\"),\n z.literal(\"bridge\"),\n z.literal(\"rev_share\"),\n z.literal(\"transfer_out\"),\n z.literal(\"convert\"),\n ]),\n })\n ),\n step_index: z.number().optional(),\n});\nexport type QuotedRoute = z.infer<typeof QuotedRoute>;\n\nexport const Quote = z.object({\n payment_id: z.string(),\n output_amount: z.object({\n asset: Asset,\n amount: z.string(),\n }),\n onramp: RampName.optional(),\n onramp_method: OnrampMethod.optional(),\n fees: z.object({\n total_fees: z.string(),\n conversion_fees: z.string(),\n network_fees: z.string(),\n business_fees: z.string(),\n currency_symbol: Fiat,\n }),\n route: z.array(QuotedRoute),\n});\nexport type Quote = z.infer<typeof Quote>;\n\nexport const FulfillmentRoute = QuotedRoute.extend({\n status: ObservedStatus,\n transaction_hash: z.string().optional(),\n});\nexport type FulfillmentRoute = z.infer<typeof FulfillmentRoute>;\n\nexport const Fulfillment = Quote.omit({\n payment_id: true,\n})\n .partial({\n output_amount: true,\n onramp: true,\n onramp_method: true,\n fees: true,\n })\n .extend({\n route: z.array(FulfillmentRoute),\n });\n\nexport type Fulfillment = z.infer<typeof Fulfillment>;\n\nexport const QuotesResponse = z.object({\n quote_request: RequestForQuotes,\n quotes: z.array(Quote),\n current_prices: Prices,\n price_currency: Fiat,\n state_token: z.string(),\n quoted_at: z.string(),\n accept_by: z.string(),\n failures: z.array(Failure),\n});\nexport type QuotesResponse = z.infer<typeof QuotesResponse>;\n\nexport const RequestForConfirmQuote = z.object({\n payment_id: PaymentId,\n state_token: z.string(),\n owner_address: Address,\n destination_address: Address,\n client_redirect_url: z.string().optional(),\n});\nexport type RequestForConfirmQuote = z.infer<typeof RequestForConfirmQuote>;\n\nexport const DepositInfo = z.object({\n deposit_token: Token,\n deposit_chain: z.string(),\n deposit_amount: Amount,\n deposit_address: Address,\n});\nexport type DepositInfo = z.infer<typeof DepositInfo>;\n\nexport const NextInstruction = z.object({\n type: z.enum([\"ONRAMP\", \"TRANSFER_IN\"]),\n payment_id: PaymentId,\n funding_page_url: z.url(),\n deposit_info: z.array(DepositInfo),\n});\nexport type NextInstruction = z.infer<typeof NextInstruction>;\n\nexport const ConfirmQuoteResponse = z.object({\n payment_id: PaymentId,\n status: WorkflowStatus,\n funded: z.boolean(),\n created_at: z.string(),\n updated_at: z.string(),\n initiate_fund_by: z.string(),\n completed_at: z.string().optional(),\n quote_request: RequestForQuotes,\n quoted: Quote.omit({\n payment_id: true,\n }),\n fulfilled: Fulfillment,\n current_prices: Prices,\n price_currency: Fiat,\n customer_id: z.string().optional(),\n processing_addresses: z.array(\n z.object({\n address: Address,\n chain: z.string(),\n })\n ),\n owner_address: Address,\n destination_address: Address,\n next_instruction: NextInstruction.optional(),\n parent_payment_id: PaymentId.optional(),\n});\nexport type ConfirmQuoteResponse = z.infer<typeof ConfirmQuoteResponse>;\n\nexport const PaymentStatus = ConfirmQuoteResponse;\nexport type PaymentStatus = z.infer<typeof PaymentStatus>;\n\nexport const RequestForOnrampSession = z.object({\n payment_id: PaymentId,\n redirect_url: z.string().optional(),\n});\nexport type RequestForOnrampSession = z.infer<typeof RequestForOnrampSession>;\n\nexport const OnrampSessionResponse = z.object({\n funding_page_onramp_url: z.string(),\n client_redirect_url: z.string().optional(),\n client_secret: z.string().optional(),\n});\nexport type OnrampSessionResponse = z.infer<typeof OnrampSessionResponse>;\n\nexport const RequestForPaymentsHistory = z.object({\n id_query: z.string().optional(),\n pagination_key: z.string().optional(),\n dest_address: Address.optional(),\n owner_address: Address.optional(),\n limit: z.number().int().positive().optional(),\n category: z.enum([\"ALL\", \"NEW_OR_FUNDED\"]).optional(),\n});\nexport type RequestForPaymentsHistory = z.infer<typeof RequestForPaymentsHistory>;\n\nexport const PaymentHistoryResult = z.object({\n payment_statuses: z.array(PaymentStatus),\n next_pagination_key: z.string().nullable(),\n});\nexport type PaymentHistoryResult = z.infer<typeof PaymentHistoryResult>;\n\nexport const RequestForBalance = z\n .object({\n payment_id: PaymentId.optional(),\n custom_queries: z\n .array(\n z.object({\n address: Address,\n token: z.union([Token, TokenPointer]),\n })\n )\n .optional(),\n })\n .refine(\n (data) => {\n if (!data.payment_id && !data.custom_queries?.length) {\n return false;\n }\n return true;\n },\n {\n message: \"payment_id or custom_queries is required\",\n }\n );\nexport type RequestForBalance = z.infer<typeof RequestForBalance>;\n\nexport const BalanceResponse = z.object({\n balance_results: z.array(\n z.object({\n address: Address,\n token: Token,\n value: z.discriminatedUnion(\"kind\", [\n z.object({\n kind: z.literal(\"amount\"),\n amount: Amount,\n }),\n z.object({\n kind: z.literal(\"error\"),\n }),\n ]),\n })\n ),\n});\nexport type BalanceResponse = z.infer<typeof BalanceResponse>;\n\nexport const RequestForPrices = z.object({\n fiat: Fiat,\n tokens: z.array(Token),\n});\nexport type RequestForPrices = z.infer<typeof RequestForPrices>;\n\nexport const TypedData = z.string();\nexport type TypedData = z.infer<typeof TypedData>;\n\nexport const RequestForWithdrawAuthorization = z.object({\n payment_id: PaymentId,\n token_amounts: z.array(TokenAmount),\n recipient_address: Address,\n});\nexport type RequestForWithdrawAuthorization = z.infer<typeof RequestForWithdrawAuthorization>;\n\nexport const WithdrawAuthorizationResponse = z.object({\n payment_id: PaymentId,\n withdraw_authorization: TypedData,\n});\nexport type WithdrawAuthorizationResponse = z.infer<typeof WithdrawAuthorizationResponse>;\n\nexport const RequestForWithdraw = RequestForWithdrawAuthorization.extend({\n owner_signature: Signature,\n});\nexport type RequestForWithdraw = z.infer<typeof RequestForWithdraw>;\n\nexport const WithdrawResponse = z.object({\n payment_id: PaymentId,\n transaction_hash: z.string(),\n});\nexport type WithdrawResponse = z.infer<typeof WithdrawResponse>;\n","import { z, ZodError } from \"zod/v4\";\n\nimport { HALLIDAY_PAYMENTS_API_URL } from \"@shared/constants\";\nimport { RampName, ChainConfig, Asset, Fiat, Token, AssetDetails } from \"@shared/types\";\n\nimport createAxiosApiClient, {\n PaymentsApiClientError,\n ResponseValidationOptions,\n defaultValidationOptions,\n} from \"./axios\";\nimport { getQueryParamsFromAssetFilters } from \"./utils\";\nimport {\n ConfirmQuoteResponse,\n BalanceResponse,\n InputsAssetFilters,\n OutputsAssetFilters,\n OnrampSessionResponse,\n PaymentStatus,\n PaymentHistoryResult,\n Prices,\n QuotesResponse,\n RequestForConfirmQuote,\n RequestForBalance,\n RequestForOnrampSession,\n RequestForPaymentsHistory,\n RequestForPrices,\n RequestForQuotes,\n RequestForWithdraw,\n RequestForWithdrawAuthorization,\n WithdrawAuthorizationResponse,\n WithdrawResponse,\n PaymentId,\n} from \"./types\";\nimport { MethodMetadata, API_METHOD_METADATA_KEY } from \"./decorators\";\n\n/**\n * Configuration options for the PaymentsApiClient.\n */\nexport interface PaymentsApiClientOptions {\n /** Your API key for authentication */\n apiKey: string;\n /** Optional base URL for the API. Defaults to HALLIDAY_PAYMENTS_API_URL */\n baseUrl?: string;\n /** Response validation configuration */\n responseValidation?: ResponseValidationOptions;\n}\n\n/**\n * Payments API client for interacting with the Halliday Payments API.\n *\n * This client handles API requests including setting the required headers and\n * managing the API key for authentication. It also validates API responses\n * to help detect when the SDK version might be outdated.\n */\nclass PaymentsApiClient {\n /**\n * Axios API client instance.\n * @private\n */\n private apiClient: ReturnType<typeof createAxiosApiClient>;\n\n /**\n * Creates an instance of PaymentsAPIClient.\n *\n * @param {PaymentsApiClientOptions} options The configuration options for the client.\n * @param {!string} options.apiKey {string} The API key for authentication.\n * @param {string=} options.baseUrl {string} (optional) The base URL for the API.\n * @param {ResponseValidationOptions=} options.responseValidation {@link ResponseValidationOptions} (optional) Response validation helps checking response data format from Halliday payments API\n * and notifies if changes detected. It is enabled by default, turn it off by:\n * @example\n * { apiKey: \"YOUR_API_KEY\", responseValidation: { enabled: false } }\n */\n constructor(options: PaymentsApiClientOptions) {\n const { apiKey, baseUrl = HALLIDAY_PAYMENTS_API_URL, responseValidation = {} } = options;\n\n // Merge response validation options with defaults\n const responseValidationOptions: ResponseValidationOptions = {\n ...defaultValidationOptions,\n ...responseValidation,\n };\n\n this.apiClient = createAxiosApiClient({\n baseUrl,\n apiKey,\n responseValidationOptions,\n });\n }\n\n /**\n * Retrieves the supported chain configuration.\n *\n * @param {boolean} sandbox {boolean} Whether to retrieve chains in the sandbox environment.\n * @returns {Promise<Record<string, ChainConfig>>} A promise that resolves to a mapping from network to their {@link ChainConfig chain configurations}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Retrieves the supported chain configuration.\",\n httpVerb: \"GET\",\n endpoint: \"/chains\",\n inputSchema: z.boolean().optional(),\n outputSchema: z.record(z.string(), ChainConfig),\n })\n getChains = async (sandbox: boolean = false): Promise<Record<string, ChainConfig>> => {\n const { data: chainConfigs } = await this.apiClient.get<Record<string, ChainConfig>>(\n `/chains?sandbox=${sandbox ? \"true\" : \"false\"}`\n );\n return chainConfigs;\n };\n\n /**\n * Retrieves the asset details for all or the specified assets.\n *\n * @param {Asset[]=} assets {{@link Asset}[]} (optional) The assets to retrieve the details for.\n * @param {!boolean} sandbox {boolean} Whether to retrieve testnet assets in the response.\n * @returns {Promise<Record<Asset, AssetDetails>>} A promise that resolves to a mapping from {@link Asset asset} to {@link AssetDetails asset details}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Retrieves the asset details for all or the specified assets.\",\n httpVerb: \"GET\",\n endpoint: \"/assets\",\n inputSchema: z.object({\n assets: z.array(Asset).optional(),\n sandbox: z.boolean().optional(),\n }),\n outputSchema: z.record(Asset, AssetDetails),\n })\n getAssetDetails = async ({\n assets = [],\n sandbox,\n }: {\n assets?: Asset[];\n sandbox: boolean;\n }): Promise<Record<Asset, AssetDetails>> => {\n if (typeof sandbox !== \"boolean\") {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid sandbox value\",\n });\n }\n\n let queryParams = `sandbox=${sandbox}`;\n if (assets) {\n if (!Array.isArray(assets)) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid assets\",\n });\n }\n for (const asset of assets) {\n try {\n const validAsset = Asset.parse(asset);\n queryParams += `&assets[]=${validAsset}`;\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: `Invalid asset: ${asset}`,\n error: error as ZodError,\n });\n }\n }\n }\n\n const response = await this.apiClient.get<Record<Asset, AssetDetails>>(`/assets?${queryParams}`);\n return response.data;\n };\n\n /**\n * Retrieves the supported inputs for the specified filters.\n *\n * @param {AssetFilters} filters Filters to apply to the inputs.\n * @param {Asset[]=} filters.inputs {{@link Asset}[]} (optional) The input assets to be included in the response.\n * @param {!Asset[]} filters.outputs {{@link Asset}[]} The output assets to retrieve inputs for.\n * @param {!boolean} filters.sandbox {boolean} Whether to retrieve assets in the sandbox environment.\n * @param {RampName[]=} filters.onramps {{@link RampName}[]} (optional) The onramp providers that can be used to accept the inputs.\n * @param {RampName[]=} filters.offramps {{@link RampName}[]} (optional) The offramp providers that can be used to deliver the inputs.\n * @returns {Promise<Record<Asset, { fiats: Fiat[]; tokens: Token[] }>>} A mapping from output {@link Asset assets} to their corresponding input {@link Fiat fiats} and {@link Token tokens}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Retrieves the supported inputs for the specified filters.\",\n httpVerb: \"GET\",\n endpoint: \"/assets/available-inputs\",\n inputSchema: InputsAssetFilters,\n outputSchema: z.record(Asset, z.object({ fiats: z.array(Fiat), tokens: z.array(Token) })),\n })\n getInputs = async (filters: InputsAssetFilters): Promise<Record<Asset, { fiats: Fiat[]; tokens: Token[] }>> => {\n let queryParams: string;\n try {\n const validAssetFilters = InputsAssetFilters.parse(filters);\n queryParams = getQueryParamsFromAssetFilters(validAssetFilters);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid asset filters\",\n error: error as ZodError | Error,\n });\n }\n const response = await this.apiClient.get<Record<Asset, { fiats: Fiat[]; tokens: Token[] }>>(\n `/assets/available-inputs?${queryParams}`\n );\n return response.data;\n };\n\n /**\n * Retrieves the supported outputs for the specified filters.\n *\n * @param {AssetFilters} filters Filters to apply to the outputs.\n * @param {!Asset[]} filters.inputs {{@link Asset}[]} The input assets to retrieve outputs for.\n * @param {Asset[]=} filters.outputs {{@link Asset}[]} (optional) The output assets to be included in the response.\n * @param {!boolean} filters.sandbox {boolean} Whether to retrieve assets in the sandbox environment.\n * @param {RampName[]=} filters.onramps {{@link RampName}[]} (optional) The onramp providers that can be used to accept the inputs.\n * @param {RampName[]=} filters.offramps {{@link RampName}[]} (optional) The offramp providers that can be used to deliver the outputs.\n * @returns {Promise<Record<Asset, { fiats: Fiat[]; tokens: Token[] }>>} A mapping from input {@link Asset assets} to their corresponding output {@link Fiat fiats} and {@link Token tokens}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Retrieves the supported outputs for the specified filters.\",\n httpVerb: \"GET\",\n endpoint: \"/assets/available-outputs\",\n inputSchema: OutputsAssetFilters,\n outputSchema: z.record(Asset, z.object({ fiats: z.array(Fiat), tokens: z.array(Token) })),\n })\n getOutputs = async (filters: OutputsAssetFilters): Promise<Record<Asset, { fiats: Fiat[]; tokens: Token[] }>> => {\n let queryParams: string;\n try {\n const validAssetFilters = OutputsAssetFilters.parse(filters);\n queryParams = getQueryParamsFromAssetFilters(validAssetFilters);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid asset filters\",\n error: error as ZodError | Error,\n });\n }\n const response = await this.apiClient.get<Record<Asset, { fiats: Fiat[]; tokens: Token[] }>>(\n `/assets/available-outputs?${queryParams}`\n );\n return response.data;\n };\n\n /**\n * Retrieves quotes for the given input and output asset.\n *\n * @param {!RequestForQuotes} request {{@link RequestForQuotes}} The request for quotes.\n * @returns {Promise<QuotesResponse>} A promise that resolves to the {@link QuotesResponse quotes}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Retrieves quotes for the given input and output asset.\",\n httpVerb: \"POST\",\n endpoint: \"/payments/quotes\",\n inputSchema: RequestForQuotes,\n outputSchema: QuotesResponse,\n })\n getQuotes = async (request: RequestForQuotes, signal?: AbortSignal): Promise<QuotesResponse> => {\n let validatedRequestForQuotes;\n try {\n validatedRequestForQuotes = RequestForQuotes.parse(request);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid request for quotes\",\n error: error as ZodError,\n });\n }\n const response = await this.apiClient.post<QuotesResponse>(\"/payments/quotes\", validatedRequestForQuotes, {\n signal,\n });\n return response.data;\n };\n\n /**\n * Confirms a quote.\n *\n * @param {!RequestForConfirmQuote} request {{@link RequestForConfirmQuote}} The quote to accept.\n * @returns {Promise<ConfirmQuoteResponse>} A promise that resolves to the {@link ConfirmQuoteResponse accepted quote details}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Confirms a quote.\",\n httpVerb: \"POST\",\n endpoint: \"/payments/confirm\",\n inputSchema: RequestForConfirmQuote,\n outputSchema: ConfirmQuoteResponse,\n })\n confirmQuote = async (requestForConfirmQuote: RequestForConfirmQuote): Promise<ConfirmQuoteResponse> => {\n let validatedRequestForConfirmQuote;\n try {\n validatedRequestForConfirmQuote = RequestForConfirmQuote.parse(requestForConfirmQuote);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid request for confirming quote\",\n error: error as ZodError,\n });\n }\n const response = await this.apiClient.post<ConfirmQuoteResponse>(\n \"/payments/confirm\",\n validatedRequestForConfirmQuote\n );\n return response.data;\n };\n\n /**\n * Creates a onramp provider session for a given payment.\n *\n * @param {!RequestForOnrampSession} request {{@link RequestForOnrampSession}} The request for the payment session.\n * @returns {Promise<OnrampSessionResponse>} A promise that resolves to the {@link OnrampSessionResponse session}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Creates a onramp provider session for a given payment.\",\n httpVerb: \"POST\",\n endpoint: \"/onramp\",\n inputSchema: RequestForOnrampSession,\n outputSchema: OnrampSessionResponse,\n })\n createPaymentSession = async (request: RequestForOnrampSession): Promise<OnrampSessionResponse> => {\n let validatedRequest;\n try {\n validatedRequest = RequestForOnrampSession.parse(request);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid request for onramp session\",\n error: error as ZodError,\n });\n }\n const response = await this.apiClient.post<OnrampSessionResponse>(`/onramp`, validatedRequest);\n return response.data;\n };\n\n /**\n * Retrieves the status of a given payment.\n *\n * @param {!PaymentId} payment_id {{@link PaymentId}} The payment ID of the payment to retrieve the status of.\n * @param {AbortSignal=} signal {{@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal AbortSignal}} (optional) Checkout {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortController AbortController} if need to abort the request.\n * @returns {Promise<PaymentStatus | null>} A promise that resolves to {@link PaymentStatus} or null if the request is aborted.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Retrieves the status of a given payment.\",\n httpVerb: \"GET\",\n endpoint: \"/payments\",\n inputSchema: PaymentId,\n outputSchema: PaymentStatus,\n })\n getStatus = async (paymentId: PaymentId, signal?: AbortSignal): Promise<PaymentStatus | null> => {\n try {\n PaymentId.parse(paymentId);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid payment ID\",\n error: error as ZodError,\n });\n }\n const searchParams = new URLSearchParams();\n searchParams.set(\"payment_id\", paymentId);\n const searchParamsString = searchParams.toString();\n\n const response = await this.apiClient.get<PaymentStatus>(`/payments?${searchParamsString}`, { signal });\n return response.data;\n };\n\n /**\n * Retrieves the payments history.\n *\n * @param {RequestForPaymentsHistory} request {{@link RequestForPaymentsHistory}} The request for the payments history.\n * @returns {Promise<PaymentHistoryResult>} A promise that resolves to the {@link PaymentHistoryResult history}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Retrieves the payments history of a given destination address.\",\n httpVerb: \"GET\",\n endpoint: \"/payments/history\",\n inputSchema: RequestForPaymentsHistory,\n outputSchema: PaymentHistoryResult,\n })\n getPaymentsHistory = async (request: RequestForPaymentsHistory): Promise<PaymentHistoryResult> => {\n let validatedRequest;\n try {\n validatedRequest = RequestForPaymentsHistory.parse(request);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid request for payments\",\n error: error as ZodError,\n });\n }\n const queryParams = new URLSearchParams();\n if (validatedRequest.id_query) {\n queryParams.set(\"id_query\", validatedRequest.id_query);\n }\n if (validatedRequest.pagination_key) {\n queryParams.set(\"pagination_key\", validatedRequest.pagination_key);\n }\n if (validatedRequest.dest_address) {\n queryParams.set(\"dest_address\", validatedRequest.dest_address);\n }\n if (validatedRequest.owner_address) {\n queryParams.set(\"owner_address\", validatedRequest.owner_address);\n }\n if (validatedRequest.limit) {\n queryParams.set(\"limit\", validatedRequest.limit.toString());\n }\n if (validatedRequest.category) {\n queryParams.set(\"category\", validatedRequest.category);\n }\n let queryParamsString = queryParams.toString();\n if (queryParamsString) queryParamsString = `?${queryParamsString}`;\n const response = await this.apiClient.get<PaymentHistoryResult>(`/payments/history${queryParamsString}`);\n return response.data;\n };\n\n @MethodMetadata({\n description: \"Retrieves the balance of a given workflow or spw address.\",\n httpVerb: \"POST\",\n endpoint: \"/payments/balances\",\n inputSchema: RequestForBalance,\n outputSchema: BalanceResponse,\n })\n getBalance = async (request: RequestForBalance): Promise<BalanceResponse> => {\n let validatedRequest;\n try {\n validatedRequest = RequestForBalance.parse(request);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid request for balance\",\n error: error as ZodError,\n });\n }\n const response = await this.apiClient.post<BalanceResponse>(`/payments/balances`, validatedRequest);\n return response.data;\n };\n\n @MethodMetadata({\n description: \"Retrieves the prices tokens in a given fiat currency.\",\n httpVerb: \"POST\",\n endpoint: \"/prices\",\n inputSchema: RequestForPrices,\n outputSchema: Prices,\n })\n getPrices = async (request: RequestForPrices): Promise<Prices> => {\n let validatedRequest;\n try {\n validatedRequest = RequestForPrices.parse(request);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid request for prices\",\n error: error as ZodError,\n });\n }\n const response = await this.apiClient.post<Prices>(`/prices`, validatedRequest);\n return response.data;\n };\n\n /**\n * Retrieves the withdraw payload for a given workflow.\n *\n * @param {RequestForWithdrawAuthorization} request {{@link RequestForWithdrawAuthorization}} The request for the withdraw authorization payload.\n * @returns {Promise<WithdrawAuthorizationResponse>} A promise that resolves to the {@link WithdrawAuthorizationResponse withdraw authorization payload}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Retrieves the withdraw authorization for a given workflow.\",\n httpVerb: \"POST\",\n endpoint: \"/payments/withdraw\",\n inputSchema: RequestForWithdrawAuthorization,\n outputSchema: WithdrawAuthorizationResponse,\n })\n getWithdrawAuthorization = async (\n request: RequestForWithdrawAuthorization\n ): Promise<WithdrawAuthorizationResponse> => {\n let validatedRequest;\n try {\n validatedRequest = RequestForWithdrawAuthorization.parse(request);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid request for withdraw authorization\",\n error: error as ZodError,\n });\n }\n\n const response = await this.apiClient.post<WithdrawAuthorizationResponse>(\n \"/payments/withdraw\",\n validatedRequest\n );\n return response.data;\n };\n\n /**\n * Submits the owner signature for a withdraw payload.\n *\n * @param {RequestForWithdraw} request {{@link RequestForWithdraw}} The request for the withdraw payload.\n * @returns {Promise<WithdrawResponse>} A promise that resolves to the {@link WithdrawResponse transaction ID}.\n * @throws {PaymentsApiClientError}\n * - {@link PaymentsApiClientError}\n */\n @MethodMetadata({\n description: \"Submits the owner signature for a withdraw payload.\",\n httpVerb: \"POST\",\n endpoint: \"/payments/withdraw/confirm\",\n inputSchema: RequestForWithdraw,\n outputSchema: WithdrawResponse,\n })\n withdraw = async (request: RequestForWithdraw): Promise<WithdrawResponse> => {\n let validatedRequest;\n try {\n validatedRequest = RequestForWithdraw.parse(request);\n } catch (error) {\n throw PaymentsApiClientError.parseValidationError({\n message: \"Invalid request for withdraw\",\n error: error as ZodError,\n });\n }\n\n const response = await this.apiClient.post<WithdrawResponse>(`/payments/withdraw/confirm`, validatedRequest);\n return response.data;\n };\n\n /**\n * Returns the method metadata for a given method name.\n *\n * @param methodName The name of the method to get the method metadata for.\n * @returns The method metadata for the given method name.\n */\n static toJSON<T extends keyof PaymentsApiClient>(methodName: T): MethodMetadata | undefined {\n return Reflect.getMetadata(API_METHOD_METADATA_KEY, this.prototype, methodName);\n }\n}\n\nexport default PaymentsApiClient;\n"],"names":["$constructor","name","initializer","params","init","inst","def","_a","Object","defineProperty","value","_zod","enumerable","traits","Set","add","k","_","prototype","bind","constr","Parent","Definition","this","deferred","fn","Symbol","hasInstance","has","$ZodAsyncError","Error","constructor","super","globalConfig","config","newConfig","jsonStringifyReplacer","toString","cached","getter","nullish","input","cleanRegex","source","start","startsWith","end","endsWith","length","slice","defineLazy","object","key","get","set","v","configurable","assignProp","target","prop","writable","randomString","chars","str","i","Math","floor","random","esc","JSON","stringify","isObject","data","Array","isArray","allowsEval","Function","isPlainObject","getPrototypeOf","propertyKeyTypes","escapeRegex","replace","clone","cl","parent","normalizeParams","_params","error","undefined","message","NUMBER_FORMAT_RANGES","safeint","Number","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","int32","uint32","float32","float64","MAX_VALUE","aborted","x","startIndex","issues","continue","prefixIssues","path","map","iss","unshift","unwrapMessage","finalizeIssue","ctx","full","customError","localeError","reportInput","getLengthableOrigin","issue","args","code","util.jsonStringifyReplacer","$ZodError","$ZodRealError","_parse","_Err","schema","_ctx","assign","async","result","run","Promise","core.$ZodAsyncError","e","Err","util.finalizeIssue","core.config","captureStackTrace","callee","_parseAsync","_safeParse","success","errors.$ZodError","safeParse","errors.$ZodRealError","_safeParseAsync","safeParseAsync","cuid","cuid2","ulid","xid","ksuid","nanoid","duration","guid","uuid","version","RegExp","email","ipv4","ipv6","cidrv4","cidrv6","base64","base64url","hostname","e164","dateSource","date","timeSource","regex","precision","bigint","integer","number","boolean","lowercase","uppercase","$ZodCheck","core.$constructor","onattach","numericOriginMap","$ZodCheckLessThan","origin","push","bag","curr","inclusive","maximum","exclusiveMaximum","POSITIVE_INFINITY","check","payload","abort","$ZodCheckGreaterThan","minimum","exclusiveMinimum","NEGATIVE_INFINITY","$ZodCheckMultipleOf","multipleOf","BigInt","val","step","valDecCount","split","stepDecCount","decCount","parseInt","toFixed","util.floatSafeRemainder","divisor","$ZodCheckNumberFormat","format","isInt","includes","util.NUMBER_FORMAT_RANGES","pattern","regexes.integer","isInteger","expected","isSafeInteger","note","$ZodCheckMaxLength","when","util.nullish","util.getLengthableOrigin","$ZodCheckMinLength","$ZodCheckLengthEquals","tooBig","$ZodCheckStringFormat","patterns","lastIndex","test","$ZodCheckRegex","$ZodCheckLowerCase","regexes.lowercase","$ZodCheckUpperCase","regexes.uppercase","$ZodCheckIncludes","escapedRegex","util.escapeRegex","position","$ZodCheckStartsWith","prefix","$ZodCheckEndsWith","suffix","$ZodCheckOverwrite","tx","Doc","content","indent","indented","write","arg","execution","lines","filter","minIndent","min","trimStart","dedented","repeat","line","compile","F","join","major","minor","patch","$ZodType","id","type","util.randomString","checks","ch","parse","runChecks","asyncResult","isAborted","util.aborted","currLen","resolve","then","validate","r","vendor","$ZodString","pop","coerce","String","$ZodStringFormat","checks.$ZodCheckStringFormat","$ZodGUID","regexes.guid","$ZodUUID","v1","v2","v3","v4","v5","v6","v7","v8","regexes.uuid","$ZodEmail","regexes.email","$ZodURL","url","URL","regexes.hostname","protocol","$ZodEmoji","$ZodNanoID","regexes.nanoid","$ZodCUID","regexes.cuid","$ZodCUID2","regexes.cuid2","$ZodULID","regexes.ulid","$ZodXID","regexes.xid","$ZodKSUID","regexes.ksuid","$ZodISODateTime","opts","local","offset","regexes.datetime","$ZodISODate","regexes.date","$ZodISOTime","$ZodISODuration","regexes.duration","$ZodIPv4","regexes.ipv4","$ZodIPv6","regexes.ipv6","$ZodCIDRv4","regexes.cidrv4","$ZodCIDRv6","regexes.cidrv6","address","prefixNum","isValidBase64","atob","$ZodBase64","regexes.base64","contentEncoding","$ZodBase64URL","regexes.base64url","c","padEnd","ceil","isValidBase64URL","$ZodE164","regexes.e164","$ZodJWT","token","algorithm","tokensParts","header","parsedHeader","typ","alg","isValidJWT","$ZodNumber","regexes.number","isNaN","isFinite","received","$ZodNumberFormat","checks.$ZodCheckNumberFormat","$ZodBoolean","regexes.boolean","Boolean","$ZodBigInt","regexes.bigint","$ZodAny","$ZodUnknown","$ZodNever","handleArrayResult","final","index","util.prefixIssues","$ZodArray","proms","item","element","all","handleObjectResult","handleOptionalObjectResult","$ZodObject","_normalized","util.cached","keys","shape","okeys","optin","optout","keySet","numKeys","optionalKeys","util.defineLazy","propValues","field","values","fastpass","util.isObject","jit","core.globalConfig","jitless","fastEnabled","util.allowsEval","catchall","doc","parseStr","util.esc","ids","create","generateFastpass","el","isOptional","unrecognized","_catchall","t","handleUnionResults","results","errors","$ZodUnion","options","every","o","flatMap","option","from","p","util.cleanRegex","$ZodDiscriminatedUnion","_super","pv","indexOf","entries","disc","Map","discriminator","size","opt","unionFallback","$ZodIntersection","left","right","handleIntersectionResults","mergeValues","a","b","valid","Date","util.isPlainObject","bKeys","sharedKeys","newObj","sharedValue","mergeErrorPath","newArray","merged","$ZodRecord","keyType","valueType","Reflect","ownKeys","keyResult","$ZodEnum","numericValues","util.getEnumValues","util.propertyKeyTypes","$ZodLiteral","$ZodTransform","_out","transform","output","$ZodOptional","innerType","$ZodNullable","$ZodDefault","defaultValue","handleDefaultResult","$ZodPrefault","$ZodNonOptional","handleNonOptionalResult","$ZodCatch","catchValue","$ZodPipe","in","out","handlePipeResult","$ZodReadonly","handleReadonlyResult","freeze","$ZodCustom","checks.$ZodCheck","handleRefineResult","_iss","util.issue","$ZodRegistry","_map","WeakMap","_idmap","_meta","meta","remove","delete","pm","registry","globalRegistry","_guid","Class","util.normalizeParams","_url","_ipv4","_ipv6","_lt","checks.$ZodCheckLessThan","_lte","_gt","checks.$ZodCheckGreaterThan","_gte","_multipleOf","checks.$ZodCheckMultipleOf","_maxLength","checks.$ZodCheckMaxLength","_minLength","checks.$ZodCheckMinLength","_length","checks.$ZodCheckLengthEquals","_overwrite","checks.$ZodCheckOverwrite","ZodISODateTime","core.$ZodISODateTime","schemas.ZodStringFormat","datetime","core._isoDateTime","ZodISODate","core.$ZodISODate","core._isoDate","ZodISOTime","core.$ZodISOTime","time","core._isoTime","ZodISODuration","core.$ZodISODuration","core._isoDuration","defineProperties","mapper","_mapper","fieldErrors","_errors","processError","core.formatError","flatten","formErrors","sub","core.flattenError","addIssue","addIssues","isEmpty","ZodError","ZodRealError","core._parse","parseAsync","core._parseAsync","core._safeParse","core._safeParseAsync","ZodType","core.$ZodType","core.clone","brand","register","reg","parse.parse","parse.safeParse","parse.parseAsync","parse.safeParseAsync","spa","refine","core._refine","ZodCustom","superRefine","refinement","core.$ZodCheck","_issue","fatal","overwrite","checks.overwrite","optional","nullable","nonoptional","ZodNonOptional","array","or","union","and","ZodIntersection","pipe","default","_default","ZodDefault","prefault","ZodPrefault","catch","_catch","ZodCatch","readonly","ZodReadonly","describe","description","core.globalRegistry","isNullable","_ZodString","core.$ZodString","minLength","maxLength","checks.$ZodCheckRegex","checks.regex","checks.$ZodCheckIncludes","checks.includes","checks.$ZodCheckStartsWith","checks.startsWith","checks.$ZodCheckEndsWith","checks.endsWith","checks.minLength","max","checks.maxLength","checks.length","nonempty","checks.$ZodCheckLowerCase","checks.lowercase","checks.$ZodCheckUpperCase","checks.uppercase","trim","normalize","form","checks.normalize","toLowerCase","toUpperCase","ZodString","core._email","ZodEmail","core._url","ZodURL","jwt","core._jwt","ZodJWT","emoji","core._emoji","ZodEmoji","core._guid","ZodGUID","core._uuid","ZodUUID","uuidv4","core._uuidv4","uuidv6","core._uuidv6","uuidv7","core._uuidv7","core._nanoid","ZodNanoID","core._cuid","ZodCUID","core._cuid2","ZodCUID2","core._ulid","ZodULID","core._base64","ZodBase64","core._base64url","ZodBase64URL","core._xid","ZodXID","core._ksuid","ZodKSUID","core._ipv4","ZodIPv4","core._ipv6","ZodIPv6","core._cidrv4","ZodCIDRv4","core._cidrv6","ZodCIDRv6","core._e164","ZodE164","iso.datetime","iso.date","iso.time","iso.duration","string","core._string","ZodStringFormat","core.$ZodStringFormat","core.$ZodEmail","core.$ZodGUID","core.$ZodUUID","core.$ZodURL","core.$ZodEmoji","core.$ZodNanoID","core.$ZodCUID","core.$ZodCUID2","core.$ZodULID","core.$ZodXID","core.$ZodKSUID","core.$ZodIPv4","core.$ZodIPv6","core.$ZodCIDRv4","core.$ZodCIDRv6","core.$ZodBase64","core.$ZodBase64URL","core.$ZodE164","core.$ZodJWT","ZodNumber","core.$ZodNumber","gt","checks.gt","gte","checks.gte","lt","checks.lt","lte","checks.lte","int","safe","positive","nonnegative","negative","nonpositive","checks.multipleOf","finite","minValue","maxValue","core._number","ZodNumberFormat","core.$ZodNumberFormat","core._int","ZodBoolean","core.$ZodBoolean","core._boolean","ZodBigInt","core.$ZodBigInt","core._bigint","ZodAny","core.$ZodAny","ZodUnknown","core.$ZodUnknown","unknown","ZodNever","core.$ZodNever","never","core._never","ZodArray","core.$ZodArray","len","unwrap","core._array","ZodObject","core.$ZodObject","fromEntries","keyof","_enum","passthrough","loose","strict","strip","extend","incoming","_shape","util.extend","merge","other","util.merge","pick","mask","newShape","currDef","util.pick","omit","util.omit","partial","oldShape","util.partial","ZodOptional","required","util.required","util.assignProp","ZodUnion","core.$ZodUnion","ZodDiscriminatedUnion","core.$ZodDiscriminatedUnion","discriminatedUnion","core.$ZodIntersection","ZodRecord","core.$ZodRecord","record","ZodEnum","core.$ZodEnum","enum","extract","newEntries","exclude","ZodLiteral","core.$ZodLiteral","literal","ZodTransform","core.$ZodTransform","core.$ZodOptional","ZodNullable","core.$ZodNullable","core.$ZodDefault","removeDefault","core.$ZodPrefault","core.$ZodNonOptional","core.$ZodCatch","removeCatch","ZodPipe","core.$ZodPipe","in_","core.$ZodReadonly","core.$ZodCustom","HALLIDAY_PAYMENTS_API_URL","API_DOMAIN_REGEX","UUID_REGEX","Amount","z.string","amount","EVMAddressRegex","EVMTokenAddress","EVMAddress","SolAddressRegex","SolNativeRegex","SolTokenAddress","SolAddress","Address","z.union","Fiat","fiat","FiatDetails","z.object","issuer","alias","symbol","decimals","z.number","Name","Decimals","ImageUrl","CoinGeckoId","EVMTokenPointer","chain","SolTokenPointer","z.literal","FlexibleTokenPointer","TokenPointer","Token","TokenInfo","image_url","coingecko_id","wrapper","is_native","z.boolean","EVMTokenDetails","SolTokenDetails","TokenDetails","Asset","AssetDetails","Realm","z.discriminatedUnion","RampName","ramp_name","RampType","ramp_type","z.enum","TransactionRequest","to","nonce","gasLimit","z.bigint","gasPrice","maxPriorityFeePerGas","maxFeePerGas","chainId","TransactionReceipt","transactionHash","blockHash","blockNumber","rawReceipt","EVMChainConfig","chain_id","network","native_currency","rpc","image","is_testnet","explorer","SolChainConfig","ChainConfig","OnrampMethod","HSON","obj","space","replacer","reviver","root","globalThis","global","self","functionThis","eval","indirectEvalThis","exporter","makeExporter","previous","hasOwn","hasOwnProperty","supportsSymbol","toPrimitiveSymbol","toPrimitive","iteratorSymbol","iterator","supportsCreate","supportsProto","__proto__","downLevel","HashMap","MakeDictionary","call","functionPrototype","_Map","CreateMapPolyfill","_Set","CreateSetPolyfill","_WeakMap","CreateWeakMapPolyfill","registrySymbol","for","metadataRegistry","GetOrCreateMetadataRegistry","metadataProvider","CreateMetadataProvider","decorate","decorators","propertyKey","attributes","IsUndefined","IsArray","TypeError","IsConstructor","DecorateConstructor","IsObject","IsNull","DecorateProperty","ToPropertyKey","metadata","metadataKey","metadataValue","decorator","IsPropertyKey","OrdinaryDefineOwnMetadata","defineMetadata","hasMetadata","OrdinaryHasMetadata","hasOwnMetadata","OrdinaryHasOwnMetadata","getMetadata","OrdinaryGetMetadata","getOwnMetadata","OrdinaryGetOwnMetadata","getMetadataKeys","OrdinaryMetadataKeys","getOwnMetadataKeys","OrdinaryOwnMetadataKeys","deleteMetadata","provider","GetMetadataProvider","OrdinaryDeleteMetadata","decorated","descriptor","MetadataKey","O","P","OrdinaryGetPrototypeOf","ToBoolean","MetadataValue","parentKeys","_i","ownKeys_1","parentKeys_1","Type","IsSymbol","ToPrimitive","PreferredType","hint","exoticToPrim","GetMethod","OrdinaryToPrimitive","valueOf","toString_1","IsCallable","argument","ToString","SameValueZero","y","V","func","GetIterator","method","IteratorValue","iterResult","IteratorStep","next","done","IteratorClose","f","proto","prototypeProto","CreateMetadataRegistry","fallback","first","second","rest","CreateFallbackProvider","targetProviderMap","registerProvider","getProvider","setProvider","isExtensible","getProviderNoCache","isProviderFor","providerMap","hasProvider","existingProvider","targetMetadata","GetOrCreateMetadataMap","Create","createdTargetMetadata","metadataMap","nextValue","reflect","metadataOwner","metadataPropertySet","registeredProvider","cacheSentinel","arraySentinel","MapIterator","selector","_index","_keys","_values","_selector","throw","return","_cacheKey","_cacheIndex","_find","clear","getKey","getValue","getEntry","insert","UUID_SIZE","rootKey","CreateUniqueKey","_key","table","GetOrCreateWeakMapTable","CreateUUID","FillRandomBytes","buffer","GenRandomBytes","Uint8Array","crypto","getRandomValues","msCrypto","byte","__","factory","API_METHOD_METADATA_KEY","methodMetadataRegistry","MethodMetadata","httpVerb","endpoint","ctor","toJSON","methodName","defaultValidationOptions","enabled","debug","validateResponse","response","baseUrl","pathname","extractPathname","console","outputSchema","warn","ErrorCodes","PaymentsApiClientError","status","statusText","reqHeaders","resHeaders","request","validationIssues","validationMessage","setPrototypeOf","isPaymentsApiClientError","parseValidationError","VALIDATION_ERROR","parseAxiosError","errorStatus","errorsFromResponse","errorMessages","errorFromResponse","SERVER_ERROR","headers","API_ERROR","NETWORK_ERROR","stack","createAxiosApiClient","apiKey","responseValidationOptions","instance","axios","baseURL","Authorization","parseReviver","validationInterceptor","onFulfilled","onRejected","interceptors","use","errorInterceptor","isAxiosError","newError","UNKNOWN_ERROR","getQueryParamsFromAssetFilters","filters","reduce","acc","valueItem","PaymentId","Feature","BaseAssetFilters","onramps","z.array","offramps","sandbox","features","InputsAssetFilters","inputs","outputs","OutputsAssetFilters","AssetFilters","AssetAmount","asset","TokenAmount","Signature","IPAddressOverride","z.ipv6","BaseQuoteRequest","price_currency","onramp_methods","customer_ip_address","customer_id","parent_payment_id","FixedRequest","kind","fixed_input_amount","output_asset","RequestForQuotes","Account","Property","Resource","property","ChangeStructure","account","resource","TerminalObservedStatus","ObservedStatus","WorkflowStatus","EffectStructure","consume","produce","ChangeAmount","EffectAmount","Prices","z.record","Issue","given","limits","Failure","service_ids","latency_seconds","RouteType","QuotedRoute","net_effect","pieces_info","step_index","Quote","payment_id","output_amount","onramp","onramp_method","fees","total_fees","conversion_fees","network_fees","business_fees","currency_symbol","route","FulfillmentRoute","transaction_hash","Fulfillment","QuotesResponse","quote_request","quotes","current_prices","state_token","quoted_at","accept_by","failures","RequestForConfirmQuote","owner_address","destination_address","client_redirect_url","DepositInfo","deposit_token","deposit_chain","deposit_amount","deposit_address","NextInstruction","funding_page_url","z.url","deposit_info","ConfirmQuoteResponse","funded","created_at","updated_at","initiate_fund_by","completed_at","quoted","fulfilled","processing_addresses","next_instruction","PaymentStatus","RequestForOnrampSession","redirect_url","OnrampSessionResponse","funding_page_onramp_url","client_secret","RequestForPaymentsHistory","id_query","pagination_key","dest_address","limit","category","PaymentHistoryResult","payment_statuses","next_pagination_key","RequestForBalance","z\n .object","custom_queries","z\n .array","BalanceResponse","balance_results","RequestForPrices","tokens","TypedData","RequestForWithdrawAuthorization","token_amounts","recipient_address","WithdrawAuthorizationResponse","withdraw_authorization","RequestForWithdraw","owner_signature","WithdrawResponse","PaymentsApiClient","getChains","chainConfigs","apiClient","getAssetDetails","assets","queryParams","getInputs","validAssetFilters","getOutputs","getQuotes","signal","validatedRequestForQuotes","post","confirmQuote","requestForConfirmQuote","validatedRequestForConfirmQuote","createPaymentSession","validatedRequest","getStatus","paymentId","searchParams","URLSearchParams","searchParamsString","getPaymentsHistory","queryParamsString","getBalance","getPrices","getWithdrawAuthorization","withdraw","responseValidation","__decor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