@mastra/deployer 1.86.0-alpha.5 → 1.86.0-alpha.6
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/analyze-D2rLrvfs.cjs +0 -2
- package/dist/analyze-nF1WWQyX.js +0 -2
- package/dist/arktype-aI7TBD0R-CA70n59_.cjs +0 -2
- package/dist/arktype-aI7TBD0R-cDMJgbIj.js +0 -2
- package/dist/build-DOrefH60.js +0 -2
- package/dist/build-Df3yvOA7.cjs +0 -2
- package/dist/bundler-BLVFCaU7.js +0 -2
- package/dist/bundler-BX2HMBEc.js +0 -2
- package/dist/bundler-CpVrkklZ.cjs +0 -2
- package/dist/bundler-N6zbYjHG.cjs +0 -2
- package/dist/bundlerOptions-CNcBNp_E.cjs +0 -2
- package/dist/bundlerOptions-c8B4wLqe.js +0 -2
- package/dist/core-DM6JYCRs.js +0 -2
- package/dist/core-Dw6oRE58.cjs +0 -2
- package/dist/dist-4VwpGp6C.cjs +0 -2
- package/dist/dist-CId9bb_J.js +0 -2
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/effect-QlVUlMFu-AhgmGdMj.cjs +0 -2
- package/dist/effect-QlVUlMFu-BUdj03Tb.js +0 -2
- package/dist/error-BVvc5jcw.js +0 -2
- package/dist/error-CR4whExy.cjs +0 -2
- package/dist/esm-CTYQPwZr.js +0 -2
- package/dist/esm-DCHnJS63.cjs +0 -2
- package/dist/index-CLddUTqr-CeV0aeBL.cjs +0 -2
- package/dist/index-CLddUTqr-FaVhUOQu.js +0 -2
- package/dist/index.cjs +0 -2
- package/dist/index.js +0 -2
- package/dist/server/index.cjs +0 -2
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +0 -2
- package/dist/services-B8neClCI.cjs +0 -2
- package/dist/services-BKh9M2E5.js +0 -2
- package/dist/sury-CWZTCd75-CEZXDAeW.cjs +0 -2
- package/dist/sury-CWZTCd75-DOXpSi96.js +0 -2
- package/dist/typebox-Dei93FPO-BOIkUnIO.js +0 -2
- package/dist/typebox-Dei93FPO-Br8qsfny.cjs +0 -2
- package/dist/utils-C8gwr-ur.js +0 -2
- package/dist/utils-CDNA_ewa.cjs +0 -2
- package/dist/valibot--1zFm7rT-B84p7SXG.cjs +0 -2
- package/dist/valibot--1zFm7rT-BD4syL2V.js +0 -2
- package/dist/validator/custom-resolver.cjs +0 -2
- package/dist/validator/custom-resolver.js +0 -2
- package/dist/validator/loader.cjs +0 -2
- package/dist/validator/loader.js +0 -2
- package/dist/zod-Bwrt9trS-0iZO7FLc.js +0 -2
- package/dist/zod-Bwrt9trS-BoI5Bg-K.cjs +0 -2
- package/package.json +8 -7
- package/dist/analyze-D2rLrvfs.cjs.map +0 -1
- package/dist/analyze-nF1WWQyX.js.map +0 -1
- package/dist/arktype-aI7TBD0R-CA70n59_.cjs.map +0 -1
- package/dist/arktype-aI7TBD0R-cDMJgbIj.js.map +0 -1
- package/dist/build/analyze/analyzeEntry.d.ts.map +0 -1
- package/dist/build/analyze/bundleExternals.d.ts.map +0 -1
- package/dist/build/analyze/constants.d.ts.map +0 -1
- package/dist/build/analyze/externals.d.ts.map +0 -1
- package/dist/build/analyze.d.ts.map +0 -1
- package/dist/build/analyzeEntryProjectType.d.ts.map +0 -1
- package/dist/build/babel/check-config-export.d.ts.map +0 -1
- package/dist/build/babel/detect-pino-transports.d.ts.map +0 -1
- package/dist/build/babel/remove-all-options-except.d.ts.map +0 -1
- package/dist/build/babel/remove-deployer.d.ts.map +0 -1
- package/dist/build/babel/remove-non-referenced-nodes.d.ts.map +0 -1
- package/dist/build/bundler.d.ts.map +0 -1
- package/dist/build/bundlerOptions.d.ts.map +0 -1
- package/dist/build/deployer.d.ts.map +0 -1
- package/dist/build/fs-routing/codegen.d.ts.map +0 -1
- package/dist/build/fs-routing/discover.d.ts.map +0 -1
- package/dist/build/fs-routing/mirror.d.ts.map +0 -1
- package/dist/build/fs-routing/prepare.d.ts.map +0 -1
- package/dist/build/index.d.ts.map +0 -1
- package/dist/build/isNodeBuiltin.d.ts.map +0 -1
- package/dist/build/package-info.d.ts.map +0 -1
- package/dist/build/plugins/esbuild.d.ts.map +0 -1
- package/dist/build/plugins/esm-shim.d.ts.map +0 -1
- package/dist/build/plugins/hono-alias.d.ts.map +0 -1
- package/dist/build/plugins/local-storage-detector.d.ts.map +0 -1
- package/dist/build/plugins/module-alias.d.ts.map +0 -1
- package/dist/build/plugins/module-resolve-map.d.ts.map +0 -1
- package/dist/build/plugins/node-gyp-detector.d.ts.map +0 -1
- package/dist/build/plugins/node-modules-extension-resolver.d.ts.map +0 -1
- package/dist/build/plugins/pino.d.ts.map +0 -1
- package/dist/build/plugins/protocol-external-resolver.d.ts.map +0 -1
- package/dist/build/plugins/remove-all-except.d.ts.map +0 -1
- package/dist/build/plugins/remove-deployer.d.ts.map +0 -1
- package/dist/build/plugins/remove-unused-references.d.ts.map +0 -1
- package/dist/build/plugins/subpath-externals-resolver.d.ts.map +0 -1
- package/dist/build/plugins/tsconfig-paths.d.ts.map +0 -1
- package/dist/build/plugins/workspace-deps-watcher.d.ts.map +0 -1
- package/dist/build/serverOptions.d.ts.map +0 -1
- package/dist/build/shared/extract-mastra-option.d.ts.map +0 -1
- package/dist/build/types.d.ts.map +0 -1
- package/dist/build/utils.d.ts.map +0 -1
- package/dist/build/watcher.d.ts.map +0 -1
- package/dist/build-DOrefH60.js.map +0 -1
- package/dist/build-Df3yvOA7.cjs.map +0 -1
- package/dist/bundler/index.d.ts.map +0 -1
- package/dist/bundler/workspaceDependencies.d.ts.map +0 -1
- package/dist/bundler-BLVFCaU7.js.map +0 -1
- package/dist/bundler-BX2HMBEc.js.map +0 -1
- package/dist/bundler-CpVrkklZ.cjs.map +0 -1
- package/dist/bundler-N6zbYjHG.cjs.map +0 -1
- package/dist/bundlerOptions-CNcBNp_E.cjs.map +0 -1
- package/dist/bundlerOptions-c8B4wLqe.js.map +0 -1
- package/dist/core-DM6JYCRs.js.map +0 -1
- package/dist/core-Dw6oRE58.cjs.map +0 -1
- package/dist/deploy/base.d.ts.map +0 -1
- package/dist/deploy/index.d.ts.map +0 -1
- package/dist/deploy/log.d.ts.map +0 -1
- package/dist/dist-4VwpGp6C.cjs.map +0 -1
- package/dist/dist-CId9bb_J.js.map +0 -1
- package/dist/effect-QlVUlMFu-AhgmGdMj.cjs.map +0 -1
- package/dist/effect-QlVUlMFu-BUdj03Tb.js.map +0 -1
- package/dist/error-BVvc5jcw.js.map +0 -1
- package/dist/error-CR4whExy.cjs.map +0 -1
- package/dist/esm-CTYQPwZr.js.map +0 -1
- package/dist/esm-DCHnJS63.cjs.map +0 -1
- package/dist/index-CLddUTqr-CeV0aeBL.cjs.map +0 -1
- package/dist/index-CLddUTqr-FaVhUOQu.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/server/handlers/a2a.d.ts.map +0 -1
- package/dist/server/handlers/agent-learning.d.ts.map +0 -1
- package/dist/server/handlers/client.d.ts.map +0 -1
- package/dist/server/handlers/error.d.ts.map +0 -1
- package/dist/server/handlers/health.d.ts.map +0 -1
- package/dist/server/handlers/restart-active-runs.d.ts.map +0 -1
- package/dist/server/handlers/root.d.ts.map +0 -1
- package/dist/server/handlers/utils/query-parsers.d.ts.map +0 -1
- package/dist/server/handlers/utils.d.ts.map +0 -1
- package/dist/server/index.cjs.map +0 -1
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/index.js.map +0 -1
- package/dist/server/openapi.script.d.ts.map +0 -1
- package/dist/server/types.d.ts.map +0 -1
- package/dist/server/welcome.d.ts.map +0 -1
- package/dist/services/deps.d.ts.map +0 -1
- package/dist/services/env.d.ts.map +0 -1
- package/dist/services/fs.d.ts.map +0 -1
- package/dist/services/index.d.ts.map +0 -1
- package/dist/services-B8neClCI.cjs.map +0 -1
- package/dist/services-BKh9M2E5.js.map +0 -1
- package/dist/sury-CWZTCd75-CEZXDAeW.cjs.map +0 -1
- package/dist/sury-CWZTCd75-DOXpSi96.js.map +0 -1
- package/dist/typebox-Dei93FPO-BOIkUnIO.js.map +0 -1
- package/dist/typebox-Dei93FPO-Br8qsfny.cjs.map +0 -1
- package/dist/utils-C8gwr-ur.js.map +0 -1
- package/dist/utils-CDNA_ewa.cjs.map +0 -1
- package/dist/valibot--1zFm7rT-B84p7SXG.cjs.map +0 -1
- package/dist/valibot--1zFm7rT-BD4syL2V.js.map +0 -1
- package/dist/validator/custom-resolver.cjs.map +0 -1
- package/dist/validator/custom-resolver.d.ts.map +0 -1
- package/dist/validator/custom-resolver.js.map +0 -1
- package/dist/validator/loader.cjs.map +0 -1
- package/dist/validator/loader.d.ts.map +0 -1
- package/dist/validator/loader.js.map +0 -1
- package/dist/validator/validate.d.ts.map +0 -1
- package/dist/zod-Bwrt9trS-0iZO7FLc.js.map +0 -1
- package/dist/zod-Bwrt9trS-BoI5Bg-K.cjs.map +0 -1
- /package/dist/_types/{@mastra_hono@1.7.28-alpha.5 → @mastra_hono@1.7.28-alpha.6}/dist/auth-middleware.d.ts +0 -0
- /package/dist/_types/{@mastra_hono@1.7.28-alpha.5 → @mastra_hono@1.7.28-alpha.6}/dist/browser-stream/index.d.ts +0 -0
- /package/dist/_types/{@mastra_hono@1.7.28-alpha.5 → @mastra_hono@1.7.28-alpha.6}/dist/index.d.ts +0 -0
- /package/dist/_types/{@mastra_hono@1.7.28-alpha.5 → @mastra_hono@1.7.28-alpha.6}/package.json +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/deploy/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,8BAAsB,QAAS,SAAQ,OAAQ,YAAW,SAAS;IACjE,IAAI,EAAE,WAAW,CAAqB;IAEtC,YAAY,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAIjC;IAED,WAAW,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAE/B;IAED,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/deploy/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
|
package/dist/deploy/log.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/deploy/log.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,eAAO,MAAM,gBAAgB,WAAY,aAAa,aAerD,CAAC;AAUF,wBAAgB,wBAAwB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,wBAE9D;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,sBAsD/F"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dist-4VwpGp6C.cjs","names":[],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@valibot/to-json-schema/1.8.0/7a4480ae30573bca6c79fe2b0696ad0f7216b0ae992d31a770d2f560d22d2f98/node_modules/@valibot/to-json-schema/dist/index.mjs"],"sourcesContent":["//#region src/utils/addError.ts\n/**\n* Adds an error message to the errors array.\n*\n* @param errors The array of error messages.\n* @param message The error message to add.\n*\n* @returns The new errors.\n*/\nfunction addError(errors, message) {\n\tif (errors) {\n\t\terrors.push(message);\n\t\treturn errors;\n\t}\n\treturn [message];\n}\n\n//#endregion\n//#region src/utils/escapeRegExp.ts\nconst ESCAPE_REGEX = /[.*+?^${}()|[\\]\\\\]/g;\n/**\n* Escapes special regex characters in a string.\n*\n* @param string The string to escape.\n*\n* @returns The escaped string.\n*/\nfunction escapeRegExp(string) {\n\treturn string.replace(ESCAPE_REGEX, \"\\\\$&\");\n}\n\n//#endregion\n//#region src/utils/handleError.ts\n/**\n* Throws an error or logs a warning based on the configuration.\n*\n* @param message The message to throw or log.\n* @param config The conversion configuration.\n*/\nfunction handleError(message, config) {\n\tswitch (config?.errorMode) {\n\t\tcase \"ignore\": break;\n\t\tcase \"warn\":\n\t\t\tconsole.warn(message);\n\t\t\tbreak;\n\t\tdefault: throw new Error(message);\n\t}\n}\n\n//#endregion\n//#region src/utils/isJsonConstValue.ts\n/**\n* Whether a value is JSON compatible for a const keyword.\n*\n* @param value The value to check.\n*\n* @returns Whether the value is JSON compatible.\n*/\nfunction isJsonConstValue(value) {\n\treturn typeof value === \"boolean\" || typeof value === \"number\" && Number.isFinite(value) || typeof value === \"string\";\n}\n\n//#endregion\n//#region src/utils/isJsonEnumValues.ts\n/**\n* Whether values are JSON compatible for an enum keyword.\n*\n* @param values The values to check.\n*\n* @returns Whether the values are JSON compatible.\n*/\nfunction isJsonEnumValues(values) {\n\treturn values.every(isJsonConstValue);\n}\n\n//#endregion\n//#region src/utils/ReferenceMap.ts\n/**\n* Schema reference map with collision-free reference ID allocation.\n*/\nvar ReferenceMap = class extends Map {\n\t/**\n\t* Creates an empty schema reference map.\n\t*/\n\tconstructor() {\n\t\tsuper();\n\t\tthis.count = 0;\n\t\tthis.usedIds = /* @__PURE__ */ new Set();\n\t}\n\t/**\n\t* Adds a schema reference and reserves its ID.\n\t*\n\t* @param schema The Valibot schema.\n\t* @param referenceId The reference ID.\n\t*\n\t* @returns The reference map.\n\t*/\n\tset(schema, referenceId) {\n\t\tthis.usedIds.add(referenceId);\n\t\treturn super.set(schema, referenceId);\n\t}\n\t/**\n\t* Creates a reference ID that is not yet used.\n\t*\n\t* @param definitions The JSON Schema definitions.\n\t*\n\t* @returns The unused reference ID.\n\t*/\n\tcreateId(definitions) {\n\t\twhile (this.usedIds.has(`${this.count}`) || `${this.count}` in definitions) this.count++;\n\t\treturn `${this.count++}`;\n\t}\n};\n\n//#endregion\n//#region src/converters/convertAction/convertAction.ts\n/**\n* Returns the stricter lower bound.\n*\n* @param current The current lower bound.\n* @param value The new lower bound.\n*\n* @returns The stricter lower bound.\n*/\nfunction getLowerBound(current, value) {\n\tif (typeof current !== \"number\" || !Number.isFinite(current) || value > current) return value;\n\treturn current;\n}\n/**\n* Returns the stricter upper bound.\n*\n* @param current The current upper bound.\n* @param value The new upper bound.\n*\n* @returns The stricter upper bound.\n*/\nfunction getUpperBound(current, value) {\n\tif (typeof current !== \"number\" || !Number.isFinite(current) || value < current) return value;\n\treturn current;\n}\n/**\n* Returns the combined not restriction.\n*\n* @param current The current not restriction.\n* @param value The new not restriction.\n*\n* @returns The combined not restriction.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getNotRestriction(current, value) {\n\treturn current !== void 0 ? { anyOf: [current, value] } : value;\n}\n/**\n* Intersects allowed values with an existing enum restriction.\n*\n* @param jsonSchema The JSON Schema object.\n* @param values The allowed values.\n*/\nfunction intersectEnum(jsonSchema, values) {\n\tlet enumValues = jsonSchema.enum ?? values;\n\tif (jsonSchema.enum) {\n\t\tconst valueSet = new Set(values);\n\t\tenumValues = enumValues.filter((value) => valueSet.has(value));\n\t}\n\tif (enumValues.length) jsonSchema.enum = [...new Set(enumValues)];\n\telse {\n\t\tdelete jsonSchema.enum;\n\t\tjsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, {});\n\t}\n}\n/**\n* Converts any supported Valibot action to the JSON Schema format.\n*\n* @param jsonSchema The JSON Schema object.\n* @param valibotAction The Valibot action object.\n* @param config The conversion configuration.\n*\n* @returns The converted JSON Schema.\n*/\nfunction convertAction(jsonSchema, valibotAction, config) {\n\tif (config?.ignoreActions?.includes(valibotAction.type)) return jsonSchema;\n\tlet errors;\n\tswitch (valibotAction.type) {\n\t\tcase \"base64\":\n\t\t\tjsonSchema.contentEncoding = \"base64\";\n\t\t\tbreak;\n\t\tcase \"bic\":\n\t\tcase \"cuid2\":\n\t\tcase \"decimal\":\n\t\tcase \"digits\":\n\t\tcase \"domain\":\n\t\tcase \"emoji\":\n\t\tcase \"hash\":\n\t\tcase \"hexadecimal\":\n\t\tcase \"hex_color\":\n\t\tcase \"isrc\":\n\t\tcase \"iso_time_second\":\n\t\tcase \"iso_week\":\n\t\tcase \"ksuid\":\n\t\tcase \"mac\":\n\t\tcase \"mac48\":\n\t\tcase \"mac64\":\n\t\tcase \"nanoid\":\n\t\tcase \"octal\":\n\t\tcase \"slug\":\n\t\tcase \"ulid\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"description\":\n\t\t\tjsonSchema.description = valibotAction.description;\n\t\t\tbreak;\n\t\tcase \"email\":\n\t\tcase \"rfc_email\":\n\t\t\tjsonSchema.format = \"email\";\n\t\t\tbreak;\n\t\tcase \"ends_with\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = `${escapeRegExp(valibotAction.requirement)}$`;\n\t\t\tbreak;\n\t\tcase \"empty\":\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.maxItems = 0;\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.maxLength = 0;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"entries\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"entries\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.minProperties = getLowerBound(jsonSchema.minProperties, valibotAction.requirement);\n\t\t\tjsonSchema.maxProperties = getUpperBound(jsonSchema.maxProperties, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"examples\":\n\t\t\tif (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.examples];\n\t\t\telse jsonSchema.examples = valibotAction.examples;\n\t\t\tbreak;\n\t\tcase \"gt_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"gt_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"gt_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\terrors = addError(errors, \"The \\\"gt_value\\\" action is not supported for OpenAPI 3.0.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.exclusiveMinimum = getLowerBound(jsonSchema.exclusiveMinimum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"includes\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = escapeRegExp(valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"integer\":\n\t\t\tjsonSchema.type = \"integer\";\n\t\t\tbreak;\n\t\tcase \"ipv4\":\n\t\t\tjsonSchema.format = \"ipv4\";\n\t\t\tbreak;\n\t\tcase \"ipv6\":\n\t\t\tjsonSchema.format = \"ipv6\";\n\t\t\tbreak;\n\t\tcase \"iso_date\":\n\t\t\tjsonSchema.format = \"date\";\n\t\t\tbreak;\n\t\tcase \"iso_date_time\":\n\t\tcase \"iso_timestamp\":\n\t\t\tjsonSchema.format = \"date-time\";\n\t\t\tbreak;\n\t\tcase \"iso_time\":\n\t\t\tjsonSchema.format = \"time\";\n\t\t\tbreak;\n\t\tcase \"jws_compact\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"length\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"length\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (jsonSchema.type === \"array\") {\n\t\t\t\tjsonSchema.minItems = getLowerBound(jsonSchema.minItems, valibotAction.requirement);\n\t\t\t\tjsonSchema.maxItems = getUpperBound(jsonSchema.maxItems, valibotAction.requirement);\n\t\t\t} else {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = getLowerBound(jsonSchema.minLength, valibotAction.requirement);\n\t\t\t\tjsonSchema.maxLength = getUpperBound(jsonSchema.maxLength, valibotAction.requirement);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"lt_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"lt_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"lt_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\terrors = addError(errors, \"The \\\"lt_value\\\" action is not supported for OpenAPI 3.0.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.exclusiveMaximum = getUpperBound(jsonSchema.exclusiveMaximum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"max_entries\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"max_entries\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.maxProperties = getUpperBound(jsonSchema.maxProperties, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"max_length\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"max_length\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.maxItems = getUpperBound(jsonSchema.maxItems, valibotAction.requirement);\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.maxLength = getUpperBound(jsonSchema.maxLength, valibotAction.requirement);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"max_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"max_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"max_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.maximum = getUpperBound(jsonSchema.maximum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"metadata\":\n\t\t\tif (typeof valibotAction.metadata.title === \"string\") jsonSchema.title = valibotAction.metadata.title;\n\t\t\tif (typeof valibotAction.metadata.description === \"string\") jsonSchema.description = valibotAction.metadata.description;\n\t\t\tif (Array.isArray(valibotAction.metadata.examples)) if (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.metadata.examples];\n\t\t\telse jsonSchema.examples = valibotAction.metadata.examples;\n\t\t\tfor (const key of Object.keys(valibotAction.metadata)) if (key !== \"title\" && key !== \"description\" && key !== \"examples\" && key !== \"__proto__\") jsonSchema[key] = valibotAction.metadata[key];\n\t\t\tbreak;\n\t\tcase \"min_entries\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"min_entries\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.minProperties = getLowerBound(jsonSchema.minProperties, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"min_length\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"min_length\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.minItems = getLowerBound(jsonSchema.minItems, valibotAction.requirement);\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = getLowerBound(jsonSchema.minLength, valibotAction.requirement);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"min_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"min_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"min_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.minimum = getLowerBound(jsonSchema.minimum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"multiple_of\":\n\t\t\tjsonSchema.multipleOf = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"non_empty\":\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.minItems = getLowerBound(jsonSchema.minItems, 1);\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = getLowerBound(jsonSchema.minLength, 1);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"not_value\":\n\t\t\tif (!isJsonConstValue(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"not_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, config?.target === \"openapi-3.0\" ? { enum: [valibotAction.requirement] } : { const: valibotAction.requirement });\n\t\t\tbreak;\n\t\tcase \"not_values\":\n\t\t\tif (!isJsonEnumValues(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"A requirement of the \\\"not_values\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (valibotAction.requirement.length) jsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, { enum: [...new Set(valibotAction.requirement)] });\n\t\t\tbreak;\n\t\tcase \"regex\":\n\t\t\tif (valibotAction.requirement.flags) errors = addError(errors, \"RegExp flags are not supported by JSON Schema.\");\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"safe_integer\":\n\t\t\tjsonSchema.type = \"integer\";\n\t\t\tjsonSchema.minimum = getLowerBound(jsonSchema.minimum, Number.MIN_SAFE_INTEGER);\n\t\t\tjsonSchema.maximum = getUpperBound(jsonSchema.maximum, Number.MAX_SAFE_INTEGER);\n\t\t\tbreak;\n\t\tcase \"starts_with\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = `^${escapeRegExp(valibotAction.requirement)}`;\n\t\t\tbreak;\n\t\tcase \"title\":\n\t\t\tjsonSchema.title = valibotAction.title;\n\t\t\tbreak;\n\t\tcase \"url\":\n\t\t\tjsonSchema.format = \"uri\";\n\t\t\tbreak;\n\t\tcase \"uuid\":\n\t\t\tjsonSchema.format = \"uuid\";\n\t\t\tbreak;\n\t\tcase \"value\":\n\t\t\tif (!isJsonConstValue(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") intersectEnum(jsonSchema, [valibotAction.requirement]);\n\t\t\telse if (\"const\" in jsonSchema && jsonSchema.const !== valibotAction.requirement) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with a different \"const\" restriction.`);\n\t\t\telse jsonSchema.const = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"values\":\n\t\t\tif (!isJsonEnumValues(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"A requirement of the \\\"values\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tintersectEnum(jsonSchema, valibotAction.requirement);\n\t\t\tbreak;\n\t\tdefault: errors = addError(errors, `The \"${valibotAction.type}\" action cannot be converted to JSON Schema.`);\n\t}\n\tif (config?.overrideAction) {\n\t\tconst actionOverride = config.overrideAction({\n\t\t\tvalibotAction,\n\t\t\tjsonSchema,\n\t\t\terrors\n\t\t});\n\t\tif (actionOverride) return { ...actionOverride };\n\t}\n\tif (errors) for (const message of errors) handleError(message, config);\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/converters/convertSchema/convertSchema.ts\n/**\n* Flattens a Valibot pipe by recursively expanding nested pipes.\n*\n* @param pipe The pipeline to flatten.\n*\n* @returns A flat pipeline.\n*/\nfunction flattenPipe(pipe) {\n\treturn pipe.flatMap((item) => \"pipe\" in item ? flattenPipe(item.pipe) : item);\n}\n/**\n* Returns the JSON Pointer reference for a definition key.\n*\n* @param referenceId The unescaped definition key.\n*\n* @returns The encoded JSON Pointer fragment.\n*/\nfunction getDefinitionRef(referenceId) {\n\treturn `#/$defs/${referenceId.replaceAll(\"~\", \"~0\").replaceAll(\"/\", \"~1\")}`;\n}\n/**\n* Converts any supported Valibot schema to the JSON Schema format.\n*\n* @param jsonSchema The JSON Schema object.\n* @param valibotSchema The Valibot schema object.\n* @param config The conversion configuration.\n* @param context The conversion context.\n* @param skipRef Whether to skip using a reference.\n*\n* @returns The converted JSON Schema.\n*/\nfunction convertSchema(jsonSchema, valibotSchema, config, context, skipRef = false) {\n\tif (!skipRef) {\n\t\tconst referenceId = context.referenceMap.get(valibotSchema);\n\t\tif (referenceId) {\n\t\t\tjsonSchema.$ref = getDefinitionRef(referenceId);\n\t\t\tif (config?.overrideRef) {\n\t\t\t\tconst refOverride = config.overrideRef({\n\t\t\t\t\t...context,\n\t\t\t\t\treferenceId,\n\t\t\t\t\tvalibotSchema,\n\t\t\t\t\tjsonSchema\n\t\t\t\t});\n\t\t\t\tif (refOverride) jsonSchema.$ref = refOverride;\n\t\t\t}\n\t\t\treturn jsonSchema;\n\t\t}\n\t}\n\tif (\"pipe\" in valibotSchema) {\n\t\tconst flatPipe = flattenPipe(valibotSchema.pipe);\n\t\tlet startIndex = 0;\n\t\tlet stopIndex = flatPipe.length - 1;\n\t\tif (config?.typeMode === \"input\") {\n\t\t\tconst inputStopIndex = flatPipe.slice(1).findIndex((item) => item.kind === \"schema\" || item.kind === \"transformation\" && (item.type === \"find_item\" || item.type === \"parse_json\" || item.type === \"raw_transform\" || item.type === \"reduce_items\" || item.type === \"stringify_json\" || item.type === \"to_bigint\" || item.type === \"to_boolean\" || item.type === \"to_date\" || item.type === \"to_number\" || item.type === \"to_string\" || item.type === \"transform\"));\n\t\t\tif (inputStopIndex !== -1) stopIndex = inputStopIndex;\n\t\t} else if (config?.typeMode === \"output\") {\n\t\t\tconst outputStartIndex = flatPipe.findLastIndex((item) => item.kind === \"schema\");\n\t\t\tif (outputStartIndex !== -1) startIndex = outputStartIndex;\n\t\t}\n\t\tfor (let index = startIndex; index <= stopIndex; index++) {\n\t\t\tconst valibotPipeItem = flatPipe[index];\n\t\t\tif (valibotPipeItem.kind === \"schema\") {\n\t\t\t\tif (index > startIndex) handleError(\"Set the \\\"typeMode\\\" config to \\\"input\\\" or \\\"output\\\" to convert pipelines with multiple schemas.\", config);\n\t\t\t\tjsonSchema = convertSchema(jsonSchema, valibotPipeItem, config, context, true);\n\t\t\t} else jsonSchema = convertAction(jsonSchema, valibotPipeItem, config);\n\t\t}\n\t\treturn jsonSchema;\n\t}\n\tlet errors;\n\tswitch (valibotSchema.type) {\n\t\tcase \"boolean\":\n\t\t\tjsonSchema.type = \"boolean\";\n\t\t\tbreak;\n\t\tcase \"null\":\n\t\t\tif (config?.target === \"openapi-3.0\") jsonSchema.enum = [null];\n\t\t\telse jsonSchema.type = \"null\";\n\t\t\tbreak;\n\t\tcase \"number\":\n\t\t\tjsonSchema.type = \"number\";\n\t\t\tbreak;\n\t\tcase \"string\":\n\t\t\tjsonSchema.type = \"string\";\n\t\t\tbreak;\n\t\tcase \"array\":\n\t\t\tjsonSchema.type = \"array\";\n\t\t\tjsonSchema.items = convertSchema({}, valibotSchema.item, config, context);\n\t\t\tbreak;\n\t\tcase \"tuple\":\n\t\tcase \"tuple_with_rest\":\n\t\tcase \"loose_tuple\":\n\t\tcase \"strict_tuple\":\n\t\t\tjsonSchema.type = \"array\";\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\tjsonSchema.items = { anyOf: [] };\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.items.anyOf.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.items.anyOf.push(convertSchema({}, valibotSchema.rest, config, context));\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\" || valibotSchema.type === \"tuple\") jsonSchema.maxItems = valibotSchema.items.length;\n\t\t\t} else if (config?.target === \"draft-2020-12\") {\n\t\t\t\tjsonSchema.prefixItems = [];\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.prefixItems.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.items = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\") jsonSchema.items = false;\n\t\t\t} else {\n\t\t\t\tjsonSchema.items = [];\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.items.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.additionalItems = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\") jsonSchema.additionalItems = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"object\":\n\t\tcase \"object_with_rest\":\n\t\tcase \"loose_object\":\n\t\tcase \"strict_object\":\n\t\t\tjsonSchema.type = \"object\";\n\t\t\tjsonSchema.properties = {};\n\t\t\tjsonSchema.required = [];\n\t\t\tfor (const key in valibotSchema.entries) {\n\t\t\t\tconst entry = valibotSchema.entries[key];\n\t\t\t\tjsonSchema.properties[key] = convertSchema({}, entry, config, context);\n\t\t\t\tif (entry.type !== \"exact_optional\" && entry.type !== \"nullish\" && entry.type !== \"optional\") jsonSchema.required.push(key);\n\t\t\t}\n\t\t\tif (valibotSchema.type === \"object_with_rest\") jsonSchema.additionalProperties = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\telse if (valibotSchema.type === \"strict_object\") jsonSchema.additionalProperties = false;\n\t\t\tbreak;\n\t\tcase \"record\":\n\t\t\tif (config?.target === \"openapi-3.0\" && \"pipe\" in valibotSchema.key) errors = addError(errors, \"The \\\"record\\\" schema with a schema for the key that contains a \\\"pipe\\\" cannot be converted to JSON Schema.\");\n\t\t\tif (valibotSchema.key.type !== \"string\") errors = addError(errors, `The \"record\" schema with the \"${valibotSchema.key.type}\" schema for the key cannot be converted to JSON Schema.`);\n\t\t\tjsonSchema.type = \"object\";\n\t\t\tif (config?.target !== \"openapi-3.0\") jsonSchema.propertyNames = convertSchema({}, valibotSchema.key, config, context);\n\t\t\tjsonSchema.additionalProperties = convertSchema({}, valibotSchema.value, config, context);\n\t\t\tbreak;\n\t\tcase \"any\":\n\t\tcase \"unknown\": break;\n\t\tcase \"never\":\n\t\t\tjsonSchema.not = {};\n\t\t\tbreak;\n\t\tcase \"nullable\":\n\t\tcase \"nullish\":\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\tconst innerSchema = convertSchema({}, valibotSchema.wrapped, config, context);\n\t\t\t\tObject.assign(jsonSchema, innerSchema);\n\t\t\t\tjsonSchema.nullable = true;\n\t\t\t} else jsonSchema.anyOf = [convertSchema({}, valibotSchema.wrapped, config, context), { type: \"null\" }];\n\t\t\tif (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === \"function\" ? valibotSchema.default() : valibotSchema.default;\n\t\t\tbreak;\n\t\tcase \"exact_optional\":\n\t\tcase \"optional\":\n\t\tcase \"undefinedable\":\n\t\t\tjsonSchema = convertSchema(jsonSchema, valibotSchema.wrapped, config, context);\n\t\t\tif (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === \"function\" ? valibotSchema.default() : valibotSchema.default;\n\t\t\tbreak;\n\t\tcase \"literal\":\n\t\t\tif (!isJsonConstValue(valibotSchema.literal)) {\n\t\t\t\terrors = addError(errors, \"The value of the \\\"literal\\\" schema is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") jsonSchema.enum = [valibotSchema.literal];\n\t\t\telse jsonSchema.const = valibotSchema.literal;\n\t\t\tbreak;\n\t\tcase \"enum\":\n\t\tcase \"picklist\": {\n\t\t\tconst options = valibotSchema.options;\n\t\t\tif (!options.every((option) => typeof option === \"string\" || typeof option === \"number\" && Number.isFinite(option))) {\n\t\t\t\terrors = addError(errors, `An option of the \"${valibotSchema.type}\" schema is not JSON compatible.`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.enum = options;\n\t\t\tif (options.every((option) => typeof option === \"string\")) jsonSchema.type = \"string\";\n\t\t\telse if (options.every((option) => typeof option === \"number\")) jsonSchema.type = \"number\";\n\t\t\telse if (config?.target !== \"openapi-3.0\") jsonSchema.type = [\"string\", \"number\"];\n\t\t\tbreak;\n\t\t}\n\t\tcase \"union\":\n\t\t\tjsonSchema.anyOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"variant\":\n\t\t\tjsonSchema.oneOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"intersect\":\n\t\t\tjsonSchema.allOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"lazy\": {\n\t\t\tlet wrappedValibotSchema = context.getterMap.get(valibotSchema.getter);\n\t\t\tif (!wrappedValibotSchema) {\n\t\t\t\twrappedValibotSchema = valibotSchema.getter(void 0);\n\t\t\t\tcontext.getterMap.set(valibotSchema.getter, wrappedValibotSchema);\n\t\t\t}\n\t\t\tlet referenceId = context.referenceMap.get(wrappedValibotSchema);\n\t\t\tif (!referenceId) {\n\t\t\t\treferenceId = context.referenceMap.createId(context.definitions);\n\t\t\t\tcontext.referenceMap.set(wrappedValibotSchema, referenceId);\n\t\t\t\tcontext.definitions[referenceId] = convertSchema({}, wrappedValibotSchema, config, context, true);\n\t\t\t}\n\t\t\tjsonSchema.$ref = getDefinitionRef(referenceId);\n\t\t\tif (config?.overrideRef) {\n\t\t\t\tconst refOverride = config.overrideRef({\n\t\t\t\t\t...context,\n\t\t\t\t\treferenceId,\n\t\t\t\t\tvalibotSchema: wrappedValibotSchema,\n\t\t\t\t\tjsonSchema\n\t\t\t\t});\n\t\t\t\tif (refOverride) jsonSchema.$ref = refOverride;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault: errors = addError(errors, `The \"${valibotSchema.type}\" schema cannot be converted to JSON Schema.`);\n\t}\n\tif (config?.overrideSchema) {\n\t\tconst schemaOverride = config.overrideSchema({\n\t\t\t...context,\n\t\t\treferenceId: context.referenceMap.get(valibotSchema),\n\t\t\tvalibotSchema,\n\t\t\tjsonSchema,\n\t\t\terrors\n\t\t});\n\t\tif (schemaOverride) return { ...schemaOverride };\n\t}\n\tif (errors) for (const message of errors) handleError(message, config);\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/storages/globalDefs/globalDefs.ts\nlet store;\n/**\n* Adds new definitions to the global schema definitions.\n*\n* @param definitions The schema definitions.\n*\n* @beta\n*/\nfunction addGlobalDefs(definitions) {\n\tstore = {\n\t\t...store ?? {},\n\t\t...definitions\n\t};\n}\n/**\n* Returns the current global schema definitions.\n*\n* @returns The schema definitions.\n*\n* @beta\n*/\nfunction getGlobalDefs() {\n\treturn store;\n}\n\n//#endregion\n//#region src/functions/toJsonSchema/toJsonSchema.ts\n/**\n* Converts a Valibot schema to the JSON Schema format.\n*\n* @param schema The Valibot schema object.\n* @param config The JSON Schema configuration.\n*\n* @returns The converted JSON Schema.\n*/\nfunction toJsonSchema(schema, config) {\n\tconst context = {\n\t\tdefinitions: {},\n\t\treferenceMap: new ReferenceMap(),\n\t\tgetterMap: /* @__PURE__ */ new Map()\n\t};\n\tconst definitions = config?.definitions ?? getGlobalDefs();\n\tif (definitions) {\n\t\tfor (const key in definitions) context.referenceMap.set(definitions[key], key);\n\t\tfor (const key in definitions) context.definitions[key] = convertSchema({}, definitions[key], config, context, true);\n\t}\n\tconst jsonSchema = convertSchema({}, schema, config, context);\n\tconst target = config?.target ?? \"draft-07\";\n\tif (target === \"draft-2020-12\") jsonSchema.$schema = \"https://json-schema.org/draft/2020-12/schema\";\n\telse if (target === \"draft-07\") jsonSchema.$schema = \"http://json-schema.org/draft-07/schema#\";\n\tif (context.referenceMap.size) jsonSchema.$defs = context.definitions;\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/functions/toJsonSchemaDefs/toJsonSchemaDefs.ts\n/**\n* Converts Valibot schema definitions to JSON Schema definitions.\n*\n* @param definitions The Valibot schema definitions.\n* @param config The JSON Schema configuration.\n*\n* @returns The converted JSON Schema definitions.\n*/\nfunction toJsonSchemaDefs(definitions, config) {\n\tconst context = {\n\t\tdefinitions: {},\n\t\treferenceMap: new ReferenceMap(),\n\t\tgetterMap: /* @__PURE__ */ new Map()\n\t};\n\tfor (const key in definitions) context.referenceMap.set(definitions[key], key);\n\tfor (const key in definitions) context.definitions[key] = convertSchema({}, definitions[key], config, context, true);\n\treturn context.definitions;\n}\n\n//#endregion\n//#region src/functions/toStandardJsonSchema/toStandardJsonSchema.ts\nconst SUPPORTED_TARGETS = [\n\t\"draft-07\",\n\t\"draft-2020-12\",\n\t\"openapi-3.0\"\n];\n/**\n* Converts a Valibot schema to the Standard JSON Schema format.\n*\n* @param schema The Valibot schema object.\n*\n* @returns The Standard JSON Schema.\n*/\nfunction toStandardJsonSchema(schema) {\n\treturn { \"~standard\": {\n\t\t...schema[\"~standard\"],\n\t\tjsonSchema: {\n\t\t\tinput(options) {\n\t\t\t\tif (SUPPORTED_TARGETS.includes(options.target)) return toJsonSchema(schema, {\n\t\t\t\t\ttypeMode: \"input\",\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\t...options.libraryOptions\n\t\t\t\t});\n\t\t\t\tthrow new Error(`Unsupported target: ${options.target}`);\n\t\t\t},\n\t\t\toutput(options) {\n\t\t\t\tif (SUPPORTED_TARGETS.includes(options.target)) return toJsonSchema(schema, {\n\t\t\t\t\ttypeMode: \"output\",\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\t...options.libraryOptions\n\t\t\t\t});\n\t\t\t\tthrow new Error(`Unsupported target: ${options.target}`);\n\t\t\t}\n\t\t}\n\t} };\n}\n\n//#endregion\nexport { addGlobalDefs, getGlobalDefs, toJsonSchema, toJsonSchemaDefs, toStandardJsonSchema };"],"ignoreList":[0],"mappings":";;;;;;;;;AASA,SAAS,SAAS,QAAQ,SAAS;CAClC,IAAI,QAAQ;EACX,OAAO,KAAK,OAAO;EACnB,OAAO;CACR;CACA,OAAO,CAAC,OAAO;AAChB;AAIA,MAAM,eAAe;;;;;;;;AAQrB,SAAS,aAAa,QAAQ;CAC7B,OAAO,OAAO,QAAQ,cAAc,MAAM;AAC3C;;;;;;;AAUA,SAAS,YAAY,SAAS,QAAQ;CACrC,QAAQ,QAAQ,WAAhB;EACC,KAAK,UAAU;EACf,KAAK;GACJ,QAAQ,KAAK,OAAO;GACpB;EACD,SAAS,MAAM,IAAI,MAAM,OAAO;CACjC;AACD;;;;;;;;AAWA,SAAS,iBAAiB,OAAO;CAChC,OAAO,OAAO,UAAU,aAAa,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,KAAK,OAAO,UAAU;AAC9G;;;;;;;;AAWA,SAAS,iBAAiB,QAAQ;CACjC,OAAO,OAAO,MAAM,gBAAgB;AACrC;;;;AAOA,IAAI,eAAe,cAAc,IAAI;;;;CAIpC,cAAc;EACb,MAAM;EACN,KAAK,QAAQ;EACb,KAAK,0BAA0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AW,UAAU;CACrD,IAAI,QAAQ,aAAa,MAAM,WAAW,QAAQ,QAAQ;CAC1D,OAAO;AACR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dist-CId9bb_J.js","names":[],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@valibot/to-json-schema/1.8.0/7a4480ae30573bca6c79fe2b0696ad0f7216b0ae992d31a770d2f560d22d2f98/node_modules/@valibot/to-json-schema/dist/index.mjs"],"sourcesContent":["//#region src/utils/addError.ts\n/**\n* Adds an error message to the errors array.\n*\n* @param errors The array of error messages.\n* @param message The error message to add.\n*\n* @returns The new errors.\n*/\nfunction addError(errors, message) {\n\tif (errors) {\n\t\terrors.push(message);\n\t\treturn errors;\n\t}\n\treturn [message];\n}\n\n//#endregion\n//#region src/utils/escapeRegExp.ts\nconst ESCAPE_REGEX = /[.*+?^${}()|[\\]\\\\]/g;\n/**\n* Escapes special regex characters in a string.\n*\n* @param string The string to escape.\n*\n* @returns The escaped string.\n*/\nfunction escapeRegExp(string) {\n\treturn string.replace(ESCAPE_REGEX, \"\\\\$&\");\n}\n\n//#endregion\n//#region src/utils/handleError.ts\n/**\n* Throws an error or logs a warning based on the configuration.\n*\n* @param message The message to throw or log.\n* @param config The conversion configuration.\n*/\nfunction handleError(message, config) {\n\tswitch (config?.errorMode) {\n\t\tcase \"ignore\": break;\n\t\tcase \"warn\":\n\t\t\tconsole.warn(message);\n\t\t\tbreak;\n\t\tdefault: throw new Error(message);\n\t}\n}\n\n//#endregion\n//#region src/utils/isJsonConstValue.ts\n/**\n* Whether a value is JSON compatible for a const keyword.\n*\n* @param value The value to check.\n*\n* @returns Whether the value is JSON compatible.\n*/\nfunction isJsonConstValue(value) {\n\treturn typeof value === \"boolean\" || typeof value === \"number\" && Number.isFinite(value) || typeof value === \"string\";\n}\n\n//#endregion\n//#region src/utils/isJsonEnumValues.ts\n/**\n* Whether values are JSON compatible for an enum keyword.\n*\n* @param values The values to check.\n*\n* @returns Whether the values are JSON compatible.\n*/\nfunction isJsonEnumValues(values) {\n\treturn values.every(isJsonConstValue);\n}\n\n//#endregion\n//#region src/utils/ReferenceMap.ts\n/**\n* Schema reference map with collision-free reference ID allocation.\n*/\nvar ReferenceMap = class extends Map {\n\t/**\n\t* Creates an empty schema reference map.\n\t*/\n\tconstructor() {\n\t\tsuper();\n\t\tthis.count = 0;\n\t\tthis.usedIds = /* @__PURE__ */ new Set();\n\t}\n\t/**\n\t* Adds a schema reference and reserves its ID.\n\t*\n\t* @param schema The Valibot schema.\n\t* @param referenceId The reference ID.\n\t*\n\t* @returns The reference map.\n\t*/\n\tset(schema, referenceId) {\n\t\tthis.usedIds.add(referenceId);\n\t\treturn super.set(schema, referenceId);\n\t}\n\t/**\n\t* Creates a reference ID that is not yet used.\n\t*\n\t* @param definitions The JSON Schema definitions.\n\t*\n\t* @returns The unused reference ID.\n\t*/\n\tcreateId(definitions) {\n\t\twhile (this.usedIds.has(`${this.count}`) || `${this.count}` in definitions) this.count++;\n\t\treturn `${this.count++}`;\n\t}\n};\n\n//#endregion\n//#region src/converters/convertAction/convertAction.ts\n/**\n* Returns the stricter lower bound.\n*\n* @param current The current lower bound.\n* @param value The new lower bound.\n*\n* @returns The stricter lower bound.\n*/\nfunction getLowerBound(current, value) {\n\tif (typeof current !== \"number\" || !Number.isFinite(current) || value > current) return value;\n\treturn current;\n}\n/**\n* Returns the stricter upper bound.\n*\n* @param current The current upper bound.\n* @param value The new upper bound.\n*\n* @returns The stricter upper bound.\n*/\nfunction getUpperBound(current, value) {\n\tif (typeof current !== \"number\" || !Number.isFinite(current) || value < current) return value;\n\treturn current;\n}\n/**\n* Returns the combined not restriction.\n*\n* @param current The current not restriction.\n* @param value The new not restriction.\n*\n* @returns The combined not restriction.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction getNotRestriction(current, value) {\n\treturn current !== void 0 ? { anyOf: [current, value] } : value;\n}\n/**\n* Intersects allowed values with an existing enum restriction.\n*\n* @param jsonSchema The JSON Schema object.\n* @param values The allowed values.\n*/\nfunction intersectEnum(jsonSchema, values) {\n\tlet enumValues = jsonSchema.enum ?? values;\n\tif (jsonSchema.enum) {\n\t\tconst valueSet = new Set(values);\n\t\tenumValues = enumValues.filter((value) => valueSet.has(value));\n\t}\n\tif (enumValues.length) jsonSchema.enum = [...new Set(enumValues)];\n\telse {\n\t\tdelete jsonSchema.enum;\n\t\tjsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, {});\n\t}\n}\n/**\n* Converts any supported Valibot action to the JSON Schema format.\n*\n* @param jsonSchema The JSON Schema object.\n* @param valibotAction The Valibot action object.\n* @param config The conversion configuration.\n*\n* @returns The converted JSON Schema.\n*/\nfunction convertAction(jsonSchema, valibotAction, config) {\n\tif (config?.ignoreActions?.includes(valibotAction.type)) return jsonSchema;\n\tlet errors;\n\tswitch (valibotAction.type) {\n\t\tcase \"base64\":\n\t\t\tjsonSchema.contentEncoding = \"base64\";\n\t\t\tbreak;\n\t\tcase \"bic\":\n\t\tcase \"cuid2\":\n\t\tcase \"decimal\":\n\t\tcase \"digits\":\n\t\tcase \"domain\":\n\t\tcase \"emoji\":\n\t\tcase \"hash\":\n\t\tcase \"hexadecimal\":\n\t\tcase \"hex_color\":\n\t\tcase \"isrc\":\n\t\tcase \"iso_time_second\":\n\t\tcase \"iso_week\":\n\t\tcase \"ksuid\":\n\t\tcase \"mac\":\n\t\tcase \"mac48\":\n\t\tcase \"mac64\":\n\t\tcase \"nanoid\":\n\t\tcase \"octal\":\n\t\tcase \"slug\":\n\t\tcase \"ulid\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"description\":\n\t\t\tjsonSchema.description = valibotAction.description;\n\t\t\tbreak;\n\t\tcase \"email\":\n\t\tcase \"rfc_email\":\n\t\t\tjsonSchema.format = \"email\";\n\t\t\tbreak;\n\t\tcase \"ends_with\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = `${escapeRegExp(valibotAction.requirement)}$`;\n\t\t\tbreak;\n\t\tcase \"empty\":\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.maxItems = 0;\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.maxLength = 0;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"entries\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"entries\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.minProperties = getLowerBound(jsonSchema.minProperties, valibotAction.requirement);\n\t\t\tjsonSchema.maxProperties = getUpperBound(jsonSchema.maxProperties, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"examples\":\n\t\t\tif (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.examples];\n\t\t\telse jsonSchema.examples = valibotAction.examples;\n\t\t\tbreak;\n\t\tcase \"gt_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"gt_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"gt_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\terrors = addError(errors, \"The \\\"gt_value\\\" action is not supported for OpenAPI 3.0.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.exclusiveMinimum = getLowerBound(jsonSchema.exclusiveMinimum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"includes\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = escapeRegExp(valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"integer\":\n\t\t\tjsonSchema.type = \"integer\";\n\t\t\tbreak;\n\t\tcase \"ipv4\":\n\t\t\tjsonSchema.format = \"ipv4\";\n\t\t\tbreak;\n\t\tcase \"ipv6\":\n\t\t\tjsonSchema.format = \"ipv6\";\n\t\t\tbreak;\n\t\tcase \"iso_date\":\n\t\t\tjsonSchema.format = \"date\";\n\t\t\tbreak;\n\t\tcase \"iso_date_time\":\n\t\tcase \"iso_timestamp\":\n\t\t\tjsonSchema.format = \"date-time\";\n\t\t\tbreak;\n\t\tcase \"iso_time\":\n\t\t\tjsonSchema.format = \"time\";\n\t\t\tbreak;\n\t\tcase \"jws_compact\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"length\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"length\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (jsonSchema.type === \"array\") {\n\t\t\t\tjsonSchema.minItems = getLowerBound(jsonSchema.minItems, valibotAction.requirement);\n\t\t\t\tjsonSchema.maxItems = getUpperBound(jsonSchema.maxItems, valibotAction.requirement);\n\t\t\t} else {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = getLowerBound(jsonSchema.minLength, valibotAction.requirement);\n\t\t\t\tjsonSchema.maxLength = getUpperBound(jsonSchema.maxLength, valibotAction.requirement);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"lt_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"lt_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"lt_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\terrors = addError(errors, \"The \\\"lt_value\\\" action is not supported for OpenAPI 3.0.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.exclusiveMaximum = getUpperBound(jsonSchema.exclusiveMaximum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"max_entries\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"max_entries\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.maxProperties = getUpperBound(jsonSchema.maxProperties, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"max_length\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"max_length\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.maxItems = getUpperBound(jsonSchema.maxItems, valibotAction.requirement);\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.maxLength = getUpperBound(jsonSchema.maxLength, valibotAction.requirement);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"max_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"max_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"max_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.maximum = getUpperBound(jsonSchema.maximum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"metadata\":\n\t\t\tif (typeof valibotAction.metadata.title === \"string\") jsonSchema.title = valibotAction.metadata.title;\n\t\t\tif (typeof valibotAction.metadata.description === \"string\") jsonSchema.description = valibotAction.metadata.description;\n\t\t\tif (Array.isArray(valibotAction.metadata.examples)) if (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.metadata.examples];\n\t\t\telse jsonSchema.examples = valibotAction.metadata.examples;\n\t\t\tfor (const key of Object.keys(valibotAction.metadata)) if (key !== \"title\" && key !== \"description\" && key !== \"examples\" && key !== \"__proto__\") jsonSchema[key] = valibotAction.metadata[key];\n\t\t\tbreak;\n\t\tcase \"min_entries\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"min_entries\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.minProperties = getLowerBound(jsonSchema.minProperties, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"min_length\":\n\t\t\tif (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"min_length\\\" action must be a non-negative integer.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.minItems = getLowerBound(jsonSchema.minItems, valibotAction.requirement);\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = getLowerBound(jsonSchema.minLength, valibotAction.requirement);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"min_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") {\n\t\t\t\terrors = addError(errors, `The \"min_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!Number.isFinite(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"min_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.minimum = getLowerBound(jsonSchema.minimum, valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"multiple_of\":\n\t\t\tjsonSchema.multipleOf = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"non_empty\":\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.minItems = getLowerBound(jsonSchema.minItems, 1);\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = getLowerBound(jsonSchema.minLength, 1);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"not_value\":\n\t\t\tif (!isJsonConstValue(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"not_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, config?.target === \"openapi-3.0\" ? { enum: [valibotAction.requirement] } : { const: valibotAction.requirement });\n\t\t\tbreak;\n\t\tcase \"not_values\":\n\t\t\tif (!isJsonEnumValues(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"A requirement of the \\\"not_values\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (valibotAction.requirement.length) jsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, { enum: [...new Set(valibotAction.requirement)] });\n\t\t\tbreak;\n\t\tcase \"regex\":\n\t\t\tif (valibotAction.requirement.flags) errors = addError(errors, \"RegExp flags are not supported by JSON Schema.\");\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"safe_integer\":\n\t\t\tjsonSchema.type = \"integer\";\n\t\t\tjsonSchema.minimum = getLowerBound(jsonSchema.minimum, Number.MIN_SAFE_INTEGER);\n\t\t\tjsonSchema.maximum = getUpperBound(jsonSchema.maximum, Number.MAX_SAFE_INTEGER);\n\t\t\tbreak;\n\t\tcase \"starts_with\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = `^${escapeRegExp(valibotAction.requirement)}`;\n\t\t\tbreak;\n\t\tcase \"title\":\n\t\t\tjsonSchema.title = valibotAction.title;\n\t\t\tbreak;\n\t\tcase \"url\":\n\t\t\tjsonSchema.format = \"uri\";\n\t\t\tbreak;\n\t\tcase \"uuid\":\n\t\t\tjsonSchema.format = \"uuid\";\n\t\t\tbreak;\n\t\tcase \"value\":\n\t\t\tif (!isJsonConstValue(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") intersectEnum(jsonSchema, [valibotAction.requirement]);\n\t\t\telse if (\"const\" in jsonSchema && jsonSchema.const !== valibotAction.requirement) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with a different \"const\" restriction.`);\n\t\t\telse jsonSchema.const = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"values\":\n\t\t\tif (!isJsonEnumValues(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"A requirement of the \\\"values\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tintersectEnum(jsonSchema, valibotAction.requirement);\n\t\t\tbreak;\n\t\tdefault: errors = addError(errors, `The \"${valibotAction.type}\" action cannot be converted to JSON Schema.`);\n\t}\n\tif (config?.overrideAction) {\n\t\tconst actionOverride = config.overrideAction({\n\t\t\tvalibotAction,\n\t\t\tjsonSchema,\n\t\t\terrors\n\t\t});\n\t\tif (actionOverride) return { ...actionOverride };\n\t}\n\tif (errors) for (const message of errors) handleError(message, config);\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/converters/convertSchema/convertSchema.ts\n/**\n* Flattens a Valibot pipe by recursively expanding nested pipes.\n*\n* @param pipe The pipeline to flatten.\n*\n* @returns A flat pipeline.\n*/\nfunction flattenPipe(pipe) {\n\treturn pipe.flatMap((item) => \"pipe\" in item ? flattenPipe(item.pipe) : item);\n}\n/**\n* Returns the JSON Pointer reference for a definition key.\n*\n* @param referenceId The unescaped definition key.\n*\n* @returns The encoded JSON Pointer fragment.\n*/\nfunction getDefinitionRef(referenceId) {\n\treturn `#/$defs/${referenceId.replaceAll(\"~\", \"~0\").replaceAll(\"/\", \"~1\")}`;\n}\n/**\n* Converts any supported Valibot schema to the JSON Schema format.\n*\n* @param jsonSchema The JSON Schema object.\n* @param valibotSchema The Valibot schema object.\n* @param config The conversion configuration.\n* @param context The conversion context.\n* @param skipRef Whether to skip using a reference.\n*\n* @returns The converted JSON Schema.\n*/\nfunction convertSchema(jsonSchema, valibotSchema, config, context, skipRef = false) {\n\tif (!skipRef) {\n\t\tconst referenceId = context.referenceMap.get(valibotSchema);\n\t\tif (referenceId) {\n\t\t\tjsonSchema.$ref = getDefinitionRef(referenceId);\n\t\t\tif (config?.overrideRef) {\n\t\t\t\tconst refOverride = config.overrideRef({\n\t\t\t\t\t...context,\n\t\t\t\t\treferenceId,\n\t\t\t\t\tvalibotSchema,\n\t\t\t\t\tjsonSchema\n\t\t\t\t});\n\t\t\t\tif (refOverride) jsonSchema.$ref = refOverride;\n\t\t\t}\n\t\t\treturn jsonSchema;\n\t\t}\n\t}\n\tif (\"pipe\" in valibotSchema) {\n\t\tconst flatPipe = flattenPipe(valibotSchema.pipe);\n\t\tlet startIndex = 0;\n\t\tlet stopIndex = flatPipe.length - 1;\n\t\tif (config?.typeMode === \"input\") {\n\t\t\tconst inputStopIndex = flatPipe.slice(1).findIndex((item) => item.kind === \"schema\" || item.kind === \"transformation\" && (item.type === \"find_item\" || item.type === \"parse_json\" || item.type === \"raw_transform\" || item.type === \"reduce_items\" || item.type === \"stringify_json\" || item.type === \"to_bigint\" || item.type === \"to_boolean\" || item.type === \"to_date\" || item.type === \"to_number\" || item.type === \"to_string\" || item.type === \"transform\"));\n\t\t\tif (inputStopIndex !== -1) stopIndex = inputStopIndex;\n\t\t} else if (config?.typeMode === \"output\") {\n\t\t\tconst outputStartIndex = flatPipe.findLastIndex((item) => item.kind === \"schema\");\n\t\t\tif (outputStartIndex !== -1) startIndex = outputStartIndex;\n\t\t}\n\t\tfor (let index = startIndex; index <= stopIndex; index++) {\n\t\t\tconst valibotPipeItem = flatPipe[index];\n\t\t\tif (valibotPipeItem.kind === \"schema\") {\n\t\t\t\tif (index > startIndex) handleError(\"Set the \\\"typeMode\\\" config to \\\"input\\\" or \\\"output\\\" to convert pipelines with multiple schemas.\", config);\n\t\t\t\tjsonSchema = convertSchema(jsonSchema, valibotPipeItem, config, context, true);\n\t\t\t} else jsonSchema = convertAction(jsonSchema, valibotPipeItem, config);\n\t\t}\n\t\treturn jsonSchema;\n\t}\n\tlet errors;\n\tswitch (valibotSchema.type) {\n\t\tcase \"boolean\":\n\t\t\tjsonSchema.type = \"boolean\";\n\t\t\tbreak;\n\t\tcase \"null\":\n\t\t\tif (config?.target === \"openapi-3.0\") jsonSchema.enum = [null];\n\t\t\telse jsonSchema.type = \"null\";\n\t\t\tbreak;\n\t\tcase \"number\":\n\t\t\tjsonSchema.type = \"number\";\n\t\t\tbreak;\n\t\tcase \"string\":\n\t\t\tjsonSchema.type = \"string\";\n\t\t\tbreak;\n\t\tcase \"array\":\n\t\t\tjsonSchema.type = \"array\";\n\t\t\tjsonSchema.items = convertSchema({}, valibotSchema.item, config, context);\n\t\t\tbreak;\n\t\tcase \"tuple\":\n\t\tcase \"tuple_with_rest\":\n\t\tcase \"loose_tuple\":\n\t\tcase \"strict_tuple\":\n\t\t\tjsonSchema.type = \"array\";\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\tjsonSchema.items = { anyOf: [] };\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.items.anyOf.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.items.anyOf.push(convertSchema({}, valibotSchema.rest, config, context));\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\" || valibotSchema.type === \"tuple\") jsonSchema.maxItems = valibotSchema.items.length;\n\t\t\t} else if (config?.target === \"draft-2020-12\") {\n\t\t\t\tjsonSchema.prefixItems = [];\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.prefixItems.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.items = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\") jsonSchema.items = false;\n\t\t\t} else {\n\t\t\t\tjsonSchema.items = [];\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.items.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.additionalItems = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\") jsonSchema.additionalItems = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"object\":\n\t\tcase \"object_with_rest\":\n\t\tcase \"loose_object\":\n\t\tcase \"strict_object\":\n\t\t\tjsonSchema.type = \"object\";\n\t\t\tjsonSchema.properties = {};\n\t\t\tjsonSchema.required = [];\n\t\t\tfor (const key in valibotSchema.entries) {\n\t\t\t\tconst entry = valibotSchema.entries[key];\n\t\t\t\tjsonSchema.properties[key] = convertSchema({}, entry, config, context);\n\t\t\t\tif (entry.type !== \"exact_optional\" && entry.type !== \"nullish\" && entry.type !== \"optional\") jsonSchema.required.push(key);\n\t\t\t}\n\t\t\tif (valibotSchema.type === \"object_with_rest\") jsonSchema.additionalProperties = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\telse if (valibotSchema.type === \"strict_object\") jsonSchema.additionalProperties = false;\n\t\t\tbreak;\n\t\tcase \"record\":\n\t\t\tif (config?.target === \"openapi-3.0\" && \"pipe\" in valibotSchema.key) errors = addError(errors, \"The \\\"record\\\" schema with a schema for the key that contains a \\\"pipe\\\" cannot be converted to JSON Schema.\");\n\t\t\tif (valibotSchema.key.type !== \"string\") errors = addError(errors, `The \"record\" schema with the \"${valibotSchema.key.type}\" schema for the key cannot be converted to JSON Schema.`);\n\t\t\tjsonSchema.type = \"object\";\n\t\t\tif (config?.target !== \"openapi-3.0\") jsonSchema.propertyNames = convertSchema({}, valibotSchema.key, config, context);\n\t\t\tjsonSchema.additionalProperties = convertSchema({}, valibotSchema.value, config, context);\n\t\t\tbreak;\n\t\tcase \"any\":\n\t\tcase \"unknown\": break;\n\t\tcase \"never\":\n\t\t\tjsonSchema.not = {};\n\t\t\tbreak;\n\t\tcase \"nullable\":\n\t\tcase \"nullish\":\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\tconst innerSchema = convertSchema({}, valibotSchema.wrapped, config, context);\n\t\t\t\tObject.assign(jsonSchema, innerSchema);\n\t\t\t\tjsonSchema.nullable = true;\n\t\t\t} else jsonSchema.anyOf = [convertSchema({}, valibotSchema.wrapped, config, context), { type: \"null\" }];\n\t\t\tif (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === \"function\" ? valibotSchema.default() : valibotSchema.default;\n\t\t\tbreak;\n\t\tcase \"exact_optional\":\n\t\tcase \"optional\":\n\t\tcase \"undefinedable\":\n\t\t\tjsonSchema = convertSchema(jsonSchema, valibotSchema.wrapped, config, context);\n\t\t\tif (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === \"function\" ? valibotSchema.default() : valibotSchema.default;\n\t\t\tbreak;\n\t\tcase \"literal\":\n\t\t\tif (!isJsonConstValue(valibotSchema.literal)) {\n\t\t\t\terrors = addError(errors, \"The value of the \\\"literal\\\" schema is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") jsonSchema.enum = [valibotSchema.literal];\n\t\t\telse jsonSchema.const = valibotSchema.literal;\n\t\t\tbreak;\n\t\tcase \"enum\":\n\t\tcase \"picklist\": {\n\t\t\tconst options = valibotSchema.options;\n\t\t\tif (!options.every((option) => typeof option === \"string\" || typeof option === \"number\" && Number.isFinite(option))) {\n\t\t\t\terrors = addError(errors, `An option of the \"${valibotSchema.type}\" schema is not JSON compatible.`);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.enum = options;\n\t\t\tif (options.every((option) => typeof option === \"string\")) jsonSchema.type = \"string\";\n\t\t\telse if (options.every((option) => typeof option === \"number\")) jsonSchema.type = \"number\";\n\t\t\telse if (config?.target !== \"openapi-3.0\") jsonSchema.type = [\"string\", \"number\"];\n\t\t\tbreak;\n\t\t}\n\t\tcase \"union\":\n\t\t\tjsonSchema.anyOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"variant\":\n\t\t\tjsonSchema.oneOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"intersect\":\n\t\t\tjsonSchema.allOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"lazy\": {\n\t\t\tlet wrappedValibotSchema = context.getterMap.get(valibotSchema.getter);\n\t\t\tif (!wrappedValibotSchema) {\n\t\t\t\twrappedValibotSchema = valibotSchema.getter(void 0);\n\t\t\t\tcontext.getterMap.set(valibotSchema.getter, wrappedValibotSchema);\n\t\t\t}\n\t\t\tlet referenceId = context.referenceMap.get(wrappedValibotSchema);\n\t\t\tif (!referenceId) {\n\t\t\t\treferenceId = context.referenceMap.createId(context.definitions);\n\t\t\t\tcontext.referenceMap.set(wrappedValibotSchema, referenceId);\n\t\t\t\tcontext.definitions[referenceId] = convertSchema({}, wrappedValibotSchema, config, context, true);\n\t\t\t}\n\t\t\tjsonSchema.$ref = getDefinitionRef(referenceId);\n\t\t\tif (config?.overrideRef) {\n\t\t\t\tconst refOverride = config.overrideRef({\n\t\t\t\t\t...context,\n\t\t\t\t\treferenceId,\n\t\t\t\t\tvalibotSchema: wrappedValibotSchema,\n\t\t\t\t\tjsonSchema\n\t\t\t\t});\n\t\t\t\tif (refOverride) jsonSchema.$ref = refOverride;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault: errors = addError(errors, `The \"${valibotSchema.type}\" schema cannot be converted to JSON Schema.`);\n\t}\n\tif (config?.overrideSchema) {\n\t\tconst schemaOverride = config.overrideSchema({\n\t\t\t...context,\n\t\t\treferenceId: context.referenceMap.get(valibotSchema),\n\t\t\tvalibotSchema,\n\t\t\tjsonSchema,\n\t\t\terrors\n\t\t});\n\t\tif (schemaOverride) return { ...schemaOverride };\n\t}\n\tif (errors) for (const message of errors) handleError(message, config);\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/storages/globalDefs/globalDefs.ts\nlet store;\n/**\n* Adds new definitions to the global schema definitions.\n*\n* @param definitions The schema definitions.\n*\n* @beta\n*/\nfunction addGlobalDefs(definitions) {\n\tstore = {\n\t\t...store ?? {},\n\t\t...definitions\n\t};\n}\n/**\n* Returns the current global schema definitions.\n*\n* @returns The schema definitions.\n*\n* @beta\n*/\nfunction getGlobalDefs() {\n\treturn store;\n}\n\n//#endregion\n//#region src/functions/toJsonSchema/toJsonSchema.ts\n/**\n* Converts a Valibot schema to the JSON Schema format.\n*\n* @param schema The Valibot schema object.\n* @param config The JSON Schema configuration.\n*\n* @returns The converted JSON Schema.\n*/\nfunction toJsonSchema(schema, config) {\n\tconst context = {\n\t\tdefinitions: {},\n\t\treferenceMap: new ReferenceMap(),\n\t\tgetterMap: /* @__PURE__ */ new Map()\n\t};\n\tconst definitions = config?.definitions ?? getGlobalDefs();\n\tif (definitions) {\n\t\tfor (const key in definitions) context.referenceMap.set(definitions[key], key);\n\t\tfor (const key in definitions) context.definitions[key] = convertSchema({}, definitions[key], config, context, true);\n\t}\n\tconst jsonSchema = convertSchema({}, schema, config, context);\n\tconst target = config?.target ?? \"draft-07\";\n\tif (target === \"draft-2020-12\") jsonSchema.$schema = \"https://json-schema.org/draft/2020-12/schema\";\n\telse if (target === \"draft-07\") jsonSchema.$schema = \"http://json-schema.org/draft-07/schema#\";\n\tif (context.referenceMap.size) jsonSchema.$defs = context.definitions;\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/functions/toJsonSchemaDefs/toJsonSchemaDefs.ts\n/**\n* Converts Valibot schema definitions to JSON Schema definitions.\n*\n* @param definitions The Valibot schema definitions.\n* @param config The JSON Schema configuration.\n*\n* @returns The converted JSON Schema definitions.\n*/\nfunction toJsonSchemaDefs(definitions, config) {\n\tconst context = {\n\t\tdefinitions: {},\n\t\treferenceMap: new ReferenceMap(),\n\t\tgetterMap: /* @__PURE__ */ new Map()\n\t};\n\tfor (const key in definitions) context.referenceMap.set(definitions[key], key);\n\tfor (const key in definitions) context.definitions[key] = convertSchema({}, definitions[key], config, context, true);\n\treturn context.definitions;\n}\n\n//#endregion\n//#region src/functions/toStandardJsonSchema/toStandardJsonSchema.ts\nconst SUPPORTED_TARGETS = [\n\t\"draft-07\",\n\t\"draft-2020-12\",\n\t\"openapi-3.0\"\n];\n/**\n* Converts a Valibot schema to the Standard JSON Schema format.\n*\n* @param schema The Valibot schema object.\n*\n* @returns The Standard JSON Schema.\n*/\nfunction toStandardJsonSchema(schema) {\n\treturn { \"~standard\": {\n\t\t...schema[\"~standard\"],\n\t\tjsonSchema: {\n\t\t\tinput(options) {\n\t\t\t\tif (SUPPORTED_TARGETS.includes(options.target)) return toJsonSchema(schema, {\n\t\t\t\t\ttypeMode: \"input\",\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\t...options.libraryOptions\n\t\t\t\t});\n\t\t\t\tthrow new Error(`Unsupported target: ${options.target}`);\n\t\t\t},\n\t\t\toutput(options) {\n\t\t\t\tif (SUPPORTED_TARGETS.includes(options.target)) return toJsonSchema(schema, {\n\t\t\t\t\ttypeMode: \"output\",\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\t...options.libraryOptions\n\t\t\t\t});\n\t\t\t\tthrow new Error(`Unsupported target: ${options.target}`);\n\t\t\t}\n\t\t}\n\t} };\n}\n\n//#endregion\nexport { addGlobalDefs, getGlobalDefs, toJsonSchema, toJsonSchemaDefs, toStandardJsonSchema };"],"ignoreList":[0],"mappings":";;;;;;;;;AASA,SAAS,SAAS,QAAQ,SAAS;CAClC,IAAI,QAAQ;EACX,OAAO,KAAK,OAAO;EACnB,OAAO;CACR;CACA,OAAO,CAAC,OAAO;AAChB;AAIA,MAAM,eAAe;;;;;;;;AAQrB,SAAS,aAAa,QAAQ;CAC7B,OAAO,OAAO,QAAQ,cAAc,MAAM;AAC3C;;;;;;;AAUA,SAAS,YAAY,SAAS,QAAQ;CACrC,QAAQ,QAAQ,WAAhB;EACC,KAAK,UAAU;EACf,KAAK;GACJ,QAAQ,KAAK,OAAO;GACpB;EACD,S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AAI,aAAa;EAChB,KAAK,MAAM,OAAO,aAAa,QAAQ,aAAa,IAAI,YAAY,MAAM,GAAG;EAC7E,KAAK,MAAM,OAAO,aAAa,QAAQ,YAAY,OAAO,cAAc,CAAC,GAAG,YAAY,MAAM,QAAQ,SAAS,IAAI;CACpH;CACA,MAAM,aAAa,cAAc,CAAC,GAAG,QAAQ,QAAQ,OAAO;CAC5D,MAAM,SAAS,QAAQ,UAAU;CACjC,IAAI,WAAW,iBAAiB,WAAW,UAAU;MAChD,IAAI,WAAW,YAAY,WAAW,UAAU;CACrD,IAAI,QAAQ,aAAa,MAAM,WAAW,QAAQ,QAAQ;CAC1D,OAAO;AACR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"effect-QlVUlMFu-AhgmGdMj.cjs","names":["MissingDependencyError"],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.7/40b278604ed4c7b1ed4ec3230f494f37aaa93a9e03a609e7c6039a8f944503ff/node_modules/@standard-community/standard-json/dist/effect-QlVUlMFu.js"],"sourcesContent":["import { M as MissingDependencyError } from './index-CLddUTqr.js';\nimport 'quansync';\n\nasync function getToJsonSchemaFn() {\n try {\n const { JSONSchema } = await import('effect');\n return (schema) => JSONSchema.make(schema);\n } catch {\n throw new MissingDependencyError(\"effect\");\n }\n}\n\nexport { getToJsonSchemaFn as default };\n"],"ignoreList":[0],"mappings":";;AAGA,eAAe,oBAAoB;CACjC,IAAI;EACF,MAAM,EAAE,eAAe,MAAM,OAAO;EACpC,QAAQ,WAAW,WAAW,KAAK,MAAM;CAC3C,QAAQ;EACN,MAAM,IAAIA,uBAAAA,uBAAuB,QAAQ;CAC3C;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"effect-QlVUlMFu-BUdj03Tb.js","names":[],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.7/40b278604ed4c7b1ed4ec3230f494f37aaa93a9e03a609e7c6039a8f944503ff/node_modules/@standard-community/standard-json/dist/effect-QlVUlMFu.js"],"sourcesContent":["import { M as MissingDependencyError } from './index-CLddUTqr.js';\nimport 'quansync';\n\nasync function getToJsonSchemaFn() {\n try {\n const { JSONSchema } = await import('effect');\n return (schema) => JSONSchema.make(schema);\n } catch {\n throw new MissingDependencyError(\"effect\");\n }\n}\n\nexport { getToJsonSchemaFn as default };\n"],"ignoreList":[0],"mappings":";;AAGA,eAAe,oBAAoB;CACjC,IAAI;EACF,MAAM,EAAE,eAAe,MAAM,OAAO;EACpC,QAAQ,WAAW,WAAW,KAAK,MAAM;CAC3C,QAAQ;EACN,MAAM,IAAI,uBAAuB,QAAQ;CAC3C;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-BVvc5jcw.js","names":[],"sources":["../../_internal-core/dist/error/index.js"],"sourcesContent":["// src/error/utils.ts\n/**\n* Safely converts an object to a string representation.\n* Uses JSON.stringify first, but falls back to String() if:\n* - JSON.stringify fails (e.g., circular references)\n* - JSON.stringify returns \"{}\" (e.g., Error objects with no enumerable properties)\n*/\nfunction safeParseErrorObject(obj) {\n\tif (typeof obj !== \"object\" || obj === null) return String(obj);\n\ttry {\n\t\tconst stringified = JSON.stringify(obj);\n\t\tif (stringified === \"{}\") return String(obj);\n\t\treturn stringified;\n\t} catch {\n\t\treturn String(obj);\n\t}\n}\n/**\n* Safely converts an unknown error to an Error instance.\n*/\nfunction getErrorFromUnknown(unknown, options = {}) {\n\tconst defaultOptions = {\n\t\tfallbackMessage: \"Unknown error\",\n\t\tmaxDepth: 5,\n\t\tsupportSerialization: true,\n\t\tserializeStack: true\n\t};\n\tconst mergedOptions = options ? {\n\t\t...defaultOptions,\n\t\t...options\n\t} : defaultOptions;\n\tconst { fallbackMessage, maxDepth, supportSerialization, serializeStack } = mergedOptions;\n\tif (unknown && unknown instanceof Error) {\n\t\tif (supportSerialization) addErrorToJSON(unknown, serializeStack, { maxDepth });\n\t\treturn unknown;\n\t}\n\tlet error;\n\tif (unknown && typeof unknown === \"object\") {\n\t\tconst errorMessage = unknown && \"message\" in unknown && typeof unknown.message === \"string\" ? unknown.message : safeParseErrorObject(unknown);\n\t\tconst errorCause = \"cause\" in unknown && unknown.cause !== void 0 ? unknown.cause instanceof Error ? unknown.cause : maxDepth > 0 ? getErrorFromUnknown(unknown.cause, {\n\t\t\t...mergedOptions,\n\t\t\tmaxDepth: maxDepth - 1\n\t\t}) : void 0 : void 0;\n\t\terror = new Error(errorMessage, errorCause ? { cause: errorCause } : void 0);\n\t\tObject.assign(error, unknown);\n\t\terror.stack = \"stack\" in unknown && typeof unknown.stack === \"string\" ? unknown.stack : void 0;\n\t} else if (unknown && typeof unknown === \"string\") {\n\t\terror = new Error(unknown);\n\t\terror.stack = void 0;\n\t} else error = new Error(fallbackMessage);\n\tif (supportSerialization) addErrorToJSON(error, serializeStack, { maxDepth });\n\treturn error;\n}\nconst DEFAULT_MAX_DEPTH = 5;\n/**\n* Adds a toJSON method to an Error instance for proper serialization.\n* Ensures that message, name, cause, and custom properties are all serialized.\n* Stack is only included in JSON output if serializeStack is true.\n* Recursively adds toJSON to the cause chain for proper nested error serialization.\n*/\nfunction addErrorToJSON(error, serializeStack = true, options) {\n\tconst maxDepth = options?.maxDepth ?? DEFAULT_MAX_DEPTH;\n\tconst currentDepth = options?.currentDepth ?? 0;\n\tif (error.toJSON) return;\n\tif (error.cause instanceof Error && currentDepth < maxDepth) addErrorToJSON(error.cause, serializeStack, {\n\t\tmaxDepth,\n\t\tcurrentDepth: currentDepth + 1\n\t});\n\tObject.defineProperty(error, \"toJSON\", {\n\t\tvalue: function() {\n\t\t\tconst json = {\n\t\t\t\tmessage: this.message,\n\t\t\t\tname: this.name\n\t\t\t};\n\t\t\tif (serializeStack && this.stack !== void 0) json.stack = this.stack;\n\t\t\tif (this.cause !== void 0) {\n\t\t\t\tif (this.cause instanceof Error && \"toJSON\" in this.cause && typeof this.cause.toJSON === \"function\") json.cause = this.cause.toJSON();\n\t\t\t\telse json.cause = this.cause;\n\t\t\t}\n\t\t\tconst errorAsAny = this;\n\t\t\tfor (const key in errorAsAny) if (errorAsAny.hasOwnProperty(key) && !(key in json) && key !== \"toJSON\") json[key] = errorAsAny[key];\n\t\t\treturn json;\n\t\t},\n\t\tenumerable: false,\n\t\twritable: true,\n\t\tconfigurable: true\n\t});\n}\n// src/error/index.ts\nlet ErrorDomain = /* @__PURE__ */ function(ErrorDomain) {\n\tErrorDomain[\"TOOL\"] = \"TOOL\";\n\tErrorDomain[\"AGENT\"] = \"AGENT\";\n\tErrorDomain[\"MCP\"] = \"MCP\";\n\tErrorDomain[\"AGENT_NETWORK\"] = \"AGENT_NETWORK\";\n\tErrorDomain[\"MASTRA_SERVER\"] = \"MASTRA_SERVER\";\n\tErrorDomain[\"MASTRA_OBSERVABILITY\"] = \"MASTRA_OBSERVABILITY\";\n\tErrorDomain[\"MASTRA_WORKFLOW\"] = \"MASTRA_WORKFLOW\";\n\tErrorDomain[\"MASTRA_VOICE\"] = \"MASTRA_VOICE\";\n\tErrorDomain[\"MASTRA_VECTOR\"] = \"MASTRA_VECTOR\";\n\tErrorDomain[\"MASTRA_MEMORY\"] = \"MASTRA_MEMORY\";\n\tErrorDomain[\"LLM\"] = \"LLM\";\n\tErrorDomain[\"EVAL\"] = \"EVAL\";\n\tErrorDomain[\"SCORER\"] = \"SCORER\";\n\tErrorDomain[\"A2A\"] = \"A2A\";\n\tErrorDomain[\"MASTRA_INSTANCE\"] = \"MASTRA_INSTANCE\";\n\tErrorDomain[\"MASTRA\"] = \"MASTRA\";\n\tErrorDomain[\"DEPLOYER\"] = \"DEPLOYER\";\n\tErrorDomain[\"STORAGE\"] = \"STORAGE\";\n\tErrorDomain[\"MODEL_ROUTER\"] = \"MODEL_ROUTER\";\n\treturn ErrorDomain;\n}({});\nlet ErrorCategory = /* @__PURE__ */ function(ErrorCategory) {\n\tErrorCategory[\"UNKNOWN\"] = \"UNKNOWN\";\n\tErrorCategory[\"USER\"] = \"USER\";\n\tErrorCategory[\"SYSTEM\"] = \"SYSTEM\";\n\tErrorCategory[\"THIRD_PARTY\"] = \"THIRD_PARTY\";\n\treturn ErrorCategory;\n}({});\n/**\n* Base error class for the Mastra ecosystem.\n* It standardizes error reporting and can be extended for more specific error types.\n*/\nvar MastraBaseError = class extends Error {\n\tid;\n\tdomain;\n\tcategory;\n\tdetails = {};\n\tmessage;\n\tcause;\n\tconstructor(errorDefinition, originalError) {\n\t\tconst error = originalError ? getErrorFromUnknown(originalError, {\n\t\t\tserializeStack: false,\n\t\t\tfallbackMessage: \"Unknown error\"\n\t\t}) : void 0;\n\t\tconst message = errorDefinition.text ?? error?.message ?? \"Unknown error\";\n\t\tsuper(message, { cause: error });\n\t\tthis.id = errorDefinition.id;\n\t\tthis.domain = errorDefinition.domain;\n\t\tthis.category = errorDefinition.category;\n\t\tthis.details = errorDefinition.details ?? {};\n\t\tthis.message = message;\n\t\tthis.cause = error;\n\t\tObject.setPrototypeOf(this, new.target.prototype);\n\t}\n\t/**\n\t* Returns a structured representation of the error, useful for logging or API responses.\n\t*/\n\ttoJSONDetails() {\n\t\treturn {\n\t\t\tmessage: this.message,\n\t\t\tdomain: this.domain,\n\t\t\tcategory: this.category,\n\t\t\tdetails: this.details\n\t\t};\n\t}\n\ttoJSON() {\n\t\treturn {\n\t\t\tmessage: this.message,\n\t\t\tdomain: this.domain,\n\t\t\tcategory: this.category,\n\t\t\tcode: this.id,\n\t\t\tdetails: this.details,\n\t\t\tcause: this.cause?.toJSON?.()\n\t\t};\n\t}\n\ttoString() {\n\t\treturn JSON.stringify(this.toJSON());\n\t}\n};\nvar MastraError = class extends MastraBaseError {};\n/** Permanent workflow step failure — bypasses workflow retryConfig. */\nvar MastraNonRetryableError = class extends Error {\n\tisNonRetryable = true;\n\tconstructor(message, options) {\n\t\tsuper(message, options);\n\t\tthis.name = \"MastraNonRetryableError\";\n\t\tObject.setPrototypeOf(this, new.target.prototype);\n\t}\n};\nexport { ErrorCategory, ErrorDomain, MastraBaseError, MastraError, MastraNonRetryableError, getErrorFromUnknown, safeParseErrorObject };\n\n//# sourceMappingURL=index.js.map"],"mappings":";;;;;;;AAOA,SAAS,qBAAqB,KAAK;CAClC,IAAI,OAAO,QAAQ,YAAY,QAAQ,MAAM,OAAO,OAAO,GAAG;CAC9D,IAAI;EACH,MAAM,cAAc,KAAK,UAAU,GAAG;EACtC,IAAI,gBAAgB,MAAM,OAAO,OAAO,GAAG;EAC3C,OAAO;CACR,QAAQ;EACP,OAAO,OAAO,GAAG;CAClB;AACD;;;;AAIA,SAAS,oBAAoB,SAAS,UAAU,CAAC,GAAG;CACnD,MAAM,iBAAiB;EACtB,iBAAiB;EACjB,UAAU;EACV,sBAAsB;EACtB,gBAAgB;CACjB;CACA,MAAM,gBAAgB,UAAU;EAC/B,GAAG;EACH,GAAG;CACJ,IAAI;CACJ,MAAM,EAAE,iBAAiB,UAAU,sBAAsB,mBAAmB;CAC5E,IAAI,WAAW,mBAAmB,OAAO;EACxC,IAAI,sBAAsB,eAAe,SAAS,gBAAgB,EAAE,SAAS,CAAC;EAC9E,OAAO;CACR;CACA,IAAI;CACJ,IAAI,WAAW,OAAO,YAAY,UAAU;EAC3C,MAAM,eAAe,WAAW,aAAa,WAAW,OAAO,QAAQ,YAAY,WAAW,QAAQ,UAAU,qBAAqB,OAAO;EAC5I,MAAM,aAAa,WAAW,WAAW,QAAQ,UAAU,KAAK,IAAI,QAAQ,iBAAiB,QAAQ,QAAQ,QAAQ,WAAW,IAAI,oBAAoB,QAAQ,OAAO;GACtK,GAAG;GACH,UAAU,WAAW;EACtB,CAAC,IAAI,KAAK,IAAI,KAAK;EACnB,QAAQ,IAAI,MAAM,cAAc,aAAa,EAAE,OAAO,WAAW,IAAI,KAAK,CAAC;EAC3E,OAAO,OAAO,OAAO,OAAO;EAC5B,MAAM,QAAQ,WAAW,WAAW,OAAO,QAAQ,UAAU,WAAW,QAAQ,QAAQ,KAAK;CAC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@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-CR4whExy.cjs","names":[],"sources":["../../_internal-core/dist/error/index.js"],"sourcesContent":["// src/error/utils.ts\n/**\n* Safely converts an object to a string representation.\n* Uses JSON.stringify first, but falls back to String() if:\n* - JSON.stringify fails (e.g., circular references)\n* - JSON.stringify returns \"{}\" (e.g., Error objects with no enumerable properties)\n*/\nfunction safeParseErrorObject(obj) {\n\tif (typeof obj !== \"object\" || obj === null) return String(obj);\n\ttry {\n\t\tconst stringified = JSON.stringify(obj);\n\t\tif (stringified === \"{}\") return String(obj);\n\t\treturn stringified;\n\t} catch {\n\t\treturn String(obj);\n\t}\n}\n/**\n* Safely converts an unknown error to an Error instance.\n*/\nfunction getErrorFromUnknown(unknown, options = {}) {\n\tconst defaultOptions = {\n\t\tfallbackMessage: \"Unknown error\",\n\t\tmaxDepth: 5,\n\t\tsupportSerialization: true,\n\t\tserializeStack: true\n\t};\n\tconst mergedOptions = options ? {\n\t\t...defaultOptions,\n\t\t...options\n\t} : defaultOptions;\n\tconst { fallbackMessage, maxDepth, supportSerialization, serializeStack } = mergedOptions;\n\tif (unknown && unknown instanceof Error) {\n\t\tif (supportSerialization) addErrorToJSON(unknown, serializeStack, { maxDepth });\n\t\treturn unknown;\n\t}\n\tlet error;\n\tif (unknown && typeof unknown === \"object\") {\n\t\tconst errorMessage = unknown && \"message\" in unknown && typeof unknown.message === \"string\" ? unknown.message : safeParseErrorObject(unknown);\n\t\tconst errorCause = \"cause\" in unknown && unknown.cause !== void 0 ? unknown.cause instanceof Error ? unknown.cause : maxDepth > 0 ? getErrorFromUnknown(unknown.cause, {\n\t\t\t...mergedOptions,\n\t\t\tmaxDepth: maxDepth - 1\n\t\t}) : void 0 : void 0;\n\t\terror = new Error(errorMessage, errorCause ? { cause: errorCause } : void 0);\n\t\tObject.assign(error, unknown);\n\t\terror.stack = \"stack\" in unknown && typeof unknown.stack === \"string\" ? unknown.stack : void 0;\n\t} else if (unknown && typeof unknown === \"string\") {\n\t\terror = new Error(unknown);\n\t\terror.stack = void 0;\n\t} else error = new Error(fallbackMessage);\n\tif (supportSerialization) addErrorToJSON(error, serializeStack, { maxDepth });\n\treturn error;\n}\nconst DEFAULT_MAX_DEPTH = 5;\n/**\n* Adds a toJSON method to an Error instance for proper serialization.\n* Ensures that message, name, cause, and custom properties are all serialized.\n* Stack is only included in JSON output if serializeStack is true.\n* Recursively adds toJSON to the cause chain for proper nested error serialization.\n*/\nfunction addErrorToJSON(error, serializeStack = true, options) {\n\tconst maxDepth = options?.maxDepth ?? DEFAULT_MAX_DEPTH;\n\tconst currentDepth = options?.currentDepth ?? 0;\n\tif (error.toJSON) return;\n\tif (error.cause instanceof Error && currentDepth < maxDepth) addErrorToJSON(error.cause, serializeStack, {\n\t\tmaxDepth,\n\t\tcurrentDepth: currentDepth + 1\n\t});\n\tObject.defineProperty(error, \"toJSON\", {\n\t\tvalue: function() {\n\t\t\tconst json = {\n\t\t\t\tmessage: this.message,\n\t\t\t\tname: this.name\n\t\t\t};\n\t\t\tif (serializeStack && this.stack !== void 0) json.stack = this.stack;\n\t\t\tif (this.cause !== void 0) {\n\t\t\t\tif (this.cause instanceof Error && \"toJSON\" in this.cause && typeof this.cause.toJSON === \"function\") json.cause = this.cause.toJSON();\n\t\t\t\telse json.cause = this.cause;\n\t\t\t}\n\t\t\tconst errorAsAny = this;\n\t\t\tfor (const key in errorAsAny) if (errorAsAny.hasOwnProperty(key) && !(key in json) && key !== \"toJSON\") json[key] = errorAsAny[key];\n\t\t\treturn json;\n\t\t},\n\t\tenumerable: false,\n\t\twritable: true,\n\t\tconfigurable: true\n\t});\n}\n// src/error/index.ts\nlet ErrorDomain = /* @__PURE__ */ function(ErrorDomain) {\n\tErrorDomain[\"TOOL\"] = \"TOOL\";\n\tErrorDomain[\"AGENT\"] = \"AGENT\";\n\tErrorDomain[\"MCP\"] = \"MCP\";\n\tErrorDomain[\"AGENT_NETWORK\"] = \"AGENT_NETWORK\";\n\tErrorDomain[\"MASTRA_SERVER\"] = \"MASTRA_SERVER\";\n\tErrorDomain[\"MASTRA_OBSERVABILITY\"] = \"MASTRA_OBSERVABILITY\";\n\tErrorDomain[\"MASTRA_WORKFLOW\"] = \"MASTRA_WORKFLOW\";\n\tErrorDomain[\"MASTRA_VOICE\"] = \"MASTRA_VOICE\";\n\tErrorDomain[\"MASTRA_VECTOR\"] = \"MASTRA_VECTOR\";\n\tErrorDomain[\"MASTRA_MEMORY\"] = \"MASTRA_MEMORY\";\n\tErrorDomain[\"LLM\"] = \"LLM\";\n\tErrorDomain[\"EVAL\"] = \"EVAL\";\n\tErrorDomain[\"SCORER\"] = \"SCORER\";\n\tErrorDomain[\"A2A\"] = \"A2A\";\n\tErrorDomain[\"MASTRA_INSTANCE\"] = \"MASTRA_INSTANCE\";\n\tErrorDomain[\"MASTRA\"] = \"MASTRA\";\n\tErrorDomain[\"DEPLOYER\"] = \"DEPLOYER\";\n\tErrorDomain[\"STORAGE\"] = \"STORAGE\";\n\tErrorDomain[\"MODEL_ROUTER\"] = \"MODEL_ROUTER\";\n\treturn ErrorDomain;\n}({});\nlet ErrorCategory = /* @__PURE__ */ function(ErrorCategory) {\n\tErrorCategory[\"UNKNOWN\"] = \"UNKNOWN\";\n\tErrorCategory[\"USER\"] = \"USER\";\n\tErrorCategory[\"SYSTEM\"] = \"SYSTEM\";\n\tErrorCategory[\"THIRD_PARTY\"] = \"THIRD_PARTY\";\n\treturn ErrorCategory;\n}({});\n/**\n* Base error class for the Mastra ecosystem.\n* It standardizes error reporting and can be extended for more specific error types.\n*/\nvar MastraBaseError = class extends Error {\n\tid;\n\tdomain;\n\tcategory;\n\tdetails = {};\n\tmessage;\n\tcause;\n\tconstructor(errorDefinition, originalError) {\n\t\tconst error = originalError ? getErrorFromUnknown(originalError, {\n\t\t\tserializeStack: false,\n\t\t\tfallbackMessage: \"Unknown error\"\n\t\t}) : void 0;\n\t\tconst message = errorDefinition.text ?? error?.message ?? \"Unknown error\";\n\t\tsuper(message, { cause: error });\n\t\tthis.id = errorDefinition.id;\n\t\tthis.domain = errorDefinition.domain;\n\t\tthis.category = errorDefinition.category;\n\t\tthis.details = errorDefinition.details ?? {};\n\t\tthis.message = message;\n\t\tthis.cause = error;\n\t\tObject.setPrototypeOf(this, new.target.prototype);\n\t}\n\t/**\n\t* Returns a structured representation of the error, useful for logging or API responses.\n\t*/\n\ttoJSONDetails() {\n\t\treturn {\n\t\t\tmessage: this.message,\n\t\t\tdomain: this.domain,\n\t\t\tcategory: this.category,\n\t\t\tdetails: this.details\n\t\t};\n\t}\n\ttoJSON() {\n\t\treturn {\n\t\t\tmessage: this.message,\n\t\t\tdomain: this.domain,\n\t\t\tcategory: this.category,\n\t\t\tcode: this.id,\n\t\t\tdetails: this.details,\n\t\t\tcause: this.cause?.toJSON?.()\n\t\t};\n\t}\n\ttoString() {\n\t\treturn JSON.stringify(this.toJSON());\n\t}\n};\nvar MastraError = class extends MastraBaseError {};\n/** Permanent workflow step failure — bypasses workflow retryConfig. */\nvar MastraNonRetryableError = class extends Error {\n\tisNonRetryable = true;\n\tconstructor(message, options) {\n\t\tsuper(message, options);\n\t\tthis.name = \"MastraNonRetryableError\";\n\t\tObject.setPrototypeOf(this, new.target.prototype);\n\t}\n};\nexport { ErrorCategory, ErrorDomain, MastraBaseError, MastraError, MastraNonRetryableError, getErrorFromUnknown, safeParseErrorObject };\n\n//# sourceMappingURL=index.js.map"],"mappings":";;;;;;;AAOA,SAAS,qBAAqB,KAAK;CAClC,IAAI,OAAO,QAAQ,YAAY,QAAQ,MAAM,OAAO,OAAO,GAAG;CAC9D,IAAI;EACH,MAAM,cAAc,KAAK,UAAU,GAAG;EACtC,IAAI,gBAAgB,MAAM,OAAO,OAAO,GAAG;EAC3C,OAAO;CACR,QAAQ;EACP,OAAO,OAAO,GAAG;CAClB;AACD;;;;AAIA,SAAS,oBAAoB,SAAS,UAAU,CAAC,GAAG;CACnD,MAAM,iBAAiB;EACtB,iBAAiB;EACjB,UAAU;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